Skip to content

chore: restructure into a monorepo using pnpm #2140

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

Open
wants to merge 24 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
0f98d80
feat(repo)!: restructure into a monorepo
Elessar1802 Oct 20, 2024
477ff64
chore: update Dockerfile(s) & allow build on arm
Elessar1802 Oct 20, 2024
a377eb1
chore: remove --frozen-lockfile option due to fe-lib dep
Elessar1802 Oct 20, 2024
f29ec8d
chore: update Dockerfile.web to override devtron-fe-lib if mounted
Elessar1802 Oct 20, 2024
fa41428
fix: build command in package.json & revert target url in vite.config…
Elessar1802 Nov 11, 2024
2357887
fix: enable HMR for packages in dashboard
Elessar1802 Nov 11, 2024
d66ede3
fix: use import statement for devtron-fe-lib
Elessar1802 Nov 11, 2024
dfb04b9
fix: review comments
Elessar1802 Nov 11, 2024
3c139b6
chore: add scripts for storybook in root package.json
Elessar1802 Nov 11, 2024
c8ecd25
fix(lint): lint --fix applied on all files
Elessar1802 Nov 11, 2024
3983993
fix: broken tsconfig.json
Elessar1802 Nov 11, 2024
ba3cb85
feat: add lint-staged & break lint into compile & lint
Elessar1802 Nov 11, 2024
dfd122d
chore: change author of fe-lib dummy repo
Elessar1802 Nov 12, 2024
41a30d9
chore: update README.md to reflect latest changes
Elessar1802 Nov 12, 2024
ffcf475
fix: link to release verion in README.md
Elessar1802 Nov 12, 2024
0562505
chore: mention correct license in package.json
Elessar1802 Nov 12, 2024
b4365b4
chore: remove author and license from package.json of internal apps &…
Elessar1802 Nov 12, 2024
c216503
chore: revert target url in vite.config.mts
Elessar1802 Nov 12, 2024
52142a9
fix(eslint): unable to find tsconfig.json
Elessar1802 Nov 12, 2024
edea433
chore: add compile command to root package.json
Elessar1802 Nov 12, 2024
1830b80
fix: use resolve to get lib paths in vite.config.mts
Elessar1802 Nov 12, 2024
7e428f3
chore: remove unneeded ci-workflows
Elessar1802 Nov 12, 2024
3a25c22
.
Elessar1802 Nov 12, 2024
e223932
fix: change import style for devtron-fe-lib
Elessar1802 Nov 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
23 changes: 0 additions & 23 deletions .deepsource.toml

This file was deleted.

6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
node_modules/
README.md
.github
.husky
.lintstagedrc
LICENSE
.vscode/
.prettierrc.js
17 changes: 9 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
node_modules/
.pnp/
.pnp.js

# testing
/coverage
coverage/

# production
/build
/dist
build/
dist/

# misc
.DS_Store
Expand All @@ -29,9 +29,10 @@ yarn-error.log
/public/env-config.js
env-config.js
.idea/
/test-results/
/playwright-report/
/playwright/.cache/
# TODO: delete unnecessary stuff
test-results/
playwright-report/
playwright/.cache/
playwright/.auth/
.npmrc

Expand Down
6 changes: 4 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@

. "$(dirname "$0")/_/husky.sh"

yarn tsc --noEmit
yarn lint-staged
# TODO: add lint-staged && use pnpm -r lint (not working due to eslint & its ignorefile)
pnpm --filter web lint
pnpm --filter @devtron-labs/devtron-fe-common-lib lint
pnpm --filter @devtron-labs/devtron-fe-lib lint
5 changes: 0 additions & 5 deletions .lintstagedrc

This file was deleted.

33 changes: 0 additions & 33 deletions Dockerfile

This file was deleted.

13 changes: 7 additions & 6 deletions Dockerfile.storybook
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
FROM node:20-alpine AS builder
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable

WORKDIR /app
COPY package.json .
COPY yarn.lock .

RUN yarn install --network-timeout 600000

COPY . .

RUN yarn build-storybook
RUN pnpm i

RUN pnpm --filter=web build-storybook

FROM nginx:stable

COPY --from=builder /app/storybook-static/ /usr/share/nginx/html
COPY --from=builder /app/apps/web/storybook-static/ /usr/share/nginx/html
WORKDIR /usr/share/nginx/html

CMD ["/bin/bash", "-c", "nginx -g \"daemon off;\""]
Expand Down
34 changes: 34 additions & 0 deletions Dockerfile.web
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM node:20-alpine AS builder
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable

WORKDIR /app

COPY . .

RUN echo `git rev-parse --short HEAD` > health.html

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

FROM nginx:stable

RUN useradd -ms /bin/bash devtron

COPY --from=builder /app/apps/web/dist/ /usr/share/nginx/html
COPY --from=builder /app/apps/web/nginx.conf /etc/nginx/nginx.conf
COPY --from=builder /app/apps/web/nginx-default.conf /etc/nginx/conf.d/default.conf

WORKDIR /usr/share/nginx/html
COPY --from=builder /app/apps/web/./env.sh .
COPY --from=builder /app/apps/web/.env .
COPY --from=builder /app/health.html .

RUN chown -R devtron:devtron /usr/share/nginx/html
# Make our shell script executable
RUN chmod +x env.sh
USER devtron
CMD ["/bin/bash", "-c", "/usr/share/nginx/html/env.sh && nginx -g \"daemon off;\""]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
158 changes: 158 additions & 0 deletions apps/web/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
{
"name": "web",
"version": "0.2.0",
"private": true,
"homepage": "/dashboard",
"dependencies": {
"@devtron-labs/devtron-fe-common-lib": "workspace:*",
"@devtron-labs/devtron-fe-lib": "workspace:*",
"@esbuild-plugins/node-globals-polyfill": "0.2.3",
"@rjsf/core": "^5.13.3",
"@rjsf/utils": "^5.13.3",
"@rjsf/validator-ajv8": "^5.13.3",
"@sentry/browser": "7.50.0",
"@sentry/integrations": "7.50.0",
"@sentry/tracing": "7.50.0",
"@tippyjs/react": "4.2.6",
"@typeform/embed-react": "2.20.0",
"@types/marked": "4.0.8",
"@vitejs/plugin-react": "4.3.1",
"command-line-parser": "^0.2.10",
"compute-histogram": "^0.9.11",
"dayjs": "^1.11.8",
"dompurify": "^3.0.2",
"fast-json-patch": "^3.1.1",
"flexsearch": "^0.6.32",
"jsonpath-plus": "^9.0.0",
"marked": "4.3.0",
"moment": "^2.29.4",
"monaco-editor": "0.44.0",
"monaco-yaml": "5.1.1",
"query-string": "^7.1.1",
"react": "^17.0.2",
"react-csv": "^2.2.2",
"react-dates": "^21.8.0",
"react-dom": "^17.0.2",
"react-draggable": "^4.4.5",
"react-ga4": "^1.4.1",
"react-gtm-module": "^2.0.11",
"react-keybind": "^0.9.4",
"react-mde": "^11.5.0",
"react-monaco-editor": "^0.55.0",
"react-router-dom": "^5.3.4",
"react-select": "5.8.0",
"react-virtualized": "^9.22.5",
"recharts": "^2.1.9",
"rollup-plugin-node-polyfills": "0.2.1",
"rxjs": "^7.5.4",
"sockjs-client": "1.6.1",
"tippy.js": "^6.3.7",
"vite": "5.4.6",
"vite-plugin-require-transform": "1.0.21",
"vite-plugin-svgr": "^2.4.0",
"xterm": "^4.19.0",
"xterm-addon-fit": "^0.5.0",
"xterm-addon-search": "^0.9.0",
"xterm-webfont": "^2.0.0",
"yaml": "^2.4.1"
},
"scripts": {
"lint": "tsc --noEmit && eslint 'src/**/*.{js,jsx,ts,tsx}' --max-warnings 0",
"lint-fix": "eslint 'src/**/*.{js,jsx,ts,tsx}' --fix",
"start": "vite --open",
"build": "NODE_OPTIONS=--max_old_space_size=4096 vite build --sourcemap",
"serve": "vite preview",
"build-light": "NODE_OPTIONS=--max_old_space_size=4096 GENERATE_SOURCEMAP=false vite build",
"build-k8s-app": "NODE_OPTIONS=--max_old_space_size=4096 GENERATE_SOURCEMAP=false VITE_K8S_CLIENT=true vite build",
"test": "vitest test",
"test-coverage:watch": "npm run test -- --coverage",
"test-coverage": "npm run test -- --coverage --watchAll=false",
"test:ci": "jest --watchAll=false --ci --json --coverage --testLocationInResults --outputFile=report.json",
"jest": "jest",
"storybook": "IS_STORYBOOK=true storybook dev -p 6006",
"build-storybook": "IS_STORYBOOK=true storybook build"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
],
"devDependencies": {
"@chromatic-com/storybook": "^1.8.0",
"@playwright/test": "^1.32.1",
"@sentry/cli": "^2.2.0",
"@storybook/addon-a11y": "^8.2.9",
"@storybook/addon-actions": "^8.2.9",
"@storybook/addon-essentials": "^8.2.9",
"@storybook/addon-interactions": "^8.2.9",
"@storybook/addon-links": "^8.2.9",
"@storybook/blocks": "^8.2.9",
"@storybook/react": "^8.2.9",
"@storybook/react-vite": "^8.2.9",
"@storybook/test": "^8.2.9",
"@testing-library/jest-dom": "^5.16.2",
"@testing-library/react": "^12.1.4",
"@types/jest": "^27.4.1",
"@types/node": "20.11.0",
"@types/react": "17.0.39",
"@types/react-csv": "^1.1.3",
"@types/react-dom": "17.0.13",
"@types/react-router-dom": "^5.3.3",
"@types/react-transition-group": "^4.4.4",
"@types/recharts": "^1.8.23",
"@types/recompose": "^0.30.10",
"@typescript-eslint/eslint-plugin": "8.3.0",
"@typescript-eslint/parser": "8.3.0",
"env-cmd": "10.1.0",
"eslint": "^8.56.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-prettier": "^5.1.2",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-storybook": "^0.8.0",
"jest-extended": "^2.0.0",
"jest-junit": "^13.0.0",
"jsdom-worker": "^0.2.1",
"mock-socket": "^9.2.1",
"prettier": "^3.1.1",
"react-test-render": "^1.1.2",
"sass": "^1.69.7",
"storybook": "^8.2.9",
"ts-jest": "29.2.5",
"ts-node": "10.9.2",
"typescript": "5.5.4",
"vite-plugin-pwa": "0.20.2",
"vite-tsconfig-paths": "5.0.1",
"vitest": "2.0.5",
"workbox-core": "7.1.0",
"workbox-navigation-preload": "7.1.0",
"workbox-precaching": "7.1.0",
"workbox-routing": "7.1.0",
"workbox-strategies": "7.1.0",
"workbox-window": "7.1.0",
"worker-loader": "3.0.8"
},
"jest": {
"collectCoverageFrom": [
"**/*.{ts,tsx,js,jsx}",
"!**/?(*.)+(mock).+(ts|js)",
"!**/node_modules/**",
"!**/coverage/**",
"!**/serviceWorker.ts",
"!**/index.tsx",
"!**/setupProxy.js"
],
"setupFilesAfterEnv": [
"jest-extended"
],
"moduleNameMapper": {
"monaco-editor": "<rootDir>/node_modules/react-monaco-editor",
"monaco-yaml": "<rootDir>/node_modules/react-monaco-editor"
}
}
}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ export const getManifestRequestValues = (config: AppEnvDeploymentConfigDTO): { d
null

return {
data: _data ? YAMLStringify(_data) ?? '' : '',
data: _data ? (YAMLStringify(_data) ?? '') : '',
chartRefId: getDraftConfigChartRefId(config),
}
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Loading
Loading