Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: restructure into a monorepo using pnpm #2140

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

Elessar1802
Copy link
Contributor

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Checklist:

  • The title of the PR states what changed and the related issues number (used for the release note).
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

Copy link

sonarcloud bot commented Oct 21, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
25 Security Hotspots
4.0% Duplication on New Code (required ≤ 3%)
E Security Rating on New Code (required ≥ A)
D Reliability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

@eshankvaish
Copy link
Contributor

  • Remove linter.py, sentry.sh
  • Common out custom.d.ts
  • vite-env

"worker-loader": "3.0.8"
"lint": "pnpm run -r lint",
"build:prod": "pnpm run -r build",
"build:libs": "pnpm filter './packages/**' build"
Copy link
Contributor

@eshankvaish eshankvaish Oct 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's start a pnpm start script as well

Suggested change
"build:libs": "pnpm filter './packages/**' build"
"build:libs": "pnpm --filter './packages/**' build"

}
}
"devDependencies": {
"husky": "^7.0.4"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's add lint-staged as well

RUN if [ -d "./devtron-fe-lib" ]; then rm -rf packages/devtron-fe-lib; cp -r ./devtron-fe-lib packages/devtron-fe-lib; fi

RUN pnpm i
RUN pnpm run build:prod
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's verify that no source maps are built for fe-lib

RUN yarn build-storybook
RUN pnpm i

RUN pnpm --filter=web build-storybook
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • move to package.json
  • also add the script for start storybook

ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable

WORKDIR /app
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename the file back to Dockerfile

@@ -0,0 +1,69 @@
.eslintrc.cjs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Move eslint to the top level along with these files
  • What about linting for fe-lib

@@ -0,0 +1,62 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • clean up tsconfig
  • add the tsconfig at the root by extending the one from dashboard
  • Check for alias at the root level

@@ -0,0 +1,114 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

skipping rest of the common-lib.

We can checkout: https://medium.com/@chris_72272/keeping-git-history-when-converting-multiple-repos-into-a-monorepo-97641744d928 or some similar stuff

Comment on lines +100 to +106
proxy: {
'/orchestrator': {
target: TARGET_URL,
changeOrigin: true,
},
'/grafana': TARGET_URL,
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create a common object and reuse

},
"author": "Devtron",
"license": "ISC",
"bugs": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • clean up the package json.
  • Check for singleton for react and other stuff. Can those be commoned out?

@@ -29,7 +29,7 @@ import { VitePWA } from 'vite-plugin-pwa'
import tsconfigPaths from 'vite-tsconfig-paths'

const WRONG_CODE = `import { bpfrpt_proptype_WindowScroller } from "../WindowScroller.js";`
const TARGET_URL = 'https://preview.devtron.ai/'
const TARGET_URL = 'https://devtron-ent-7.devtron.info/'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert

@@ -0,0 +1,201 @@
import { ButtonHTMLAttributes, PropsWithChildren } from 'react'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix parsing error

closeMenuOnSelect = false,
...props
}: SelectPickerProps<OptionValue, IsMulti>) => {
const { inputId, required, isDisabled, controlShouldRenderValue = true, value, options } = props
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HMR is not working as expected

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Readme needs to be updated

# TODO: delete unnecessary stuff
test-results/
playwright-report/
playwright/.cache/
playwright/.auth/
.npmrc

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Also add your script
Suggested change
packages/devtron-fe-lib

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fe-lib PR

@Elessar1802 Elessar1802 marked this pull request as ready for review October 24, 2024 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants