Update twenty-front commands (#4667)

# This PR

- Moves dev and ci scripts to the `project.json` file in the
twenty-front package
- Adds a project.json file in the root of the project with the main
start command that start both twenty-server and twenty-front
applications concurrently
- Updates the script command of the root project with the start:prod
command (replacing the start command which will be used in dev with the
help of nx)
- Add a start:prod command in the twenty-front app, replacing the start
command (now used for dev purpose)

Issue ref #4645 

@charlesBochet @FelixMalfait please let me know how can I improve it

---------

Co-authored-by: Thaïs Guigon <guigon.thais@gmail.com>
This commit is contained in:
Pacifique LINJANJA
2024-04-17 18:06:02 +02:00
committed by GitHub
parent 977927af04
commit 627a6bda29
40 changed files with 800 additions and 381 deletions

View File

@ -4,43 +4,11 @@
"private": true,
"type": "module",
"scripts": {
"nx": "NX_DEFAULT_PROJECT=twenty-front node ../../node_modules/nx/bin/nx.js",
"start": "npx vite --host",
"start:clean": "yarn start --force",
"build": "yarn tsc && npx vite build && yarn build:inject-runtime-env",
"build:sourcemaps": "VITE_BUILD_SOURCEMAP=true NODE_OPTIONS=--max-old-space-size=3000 yarn build",
"build:inject-runtime-env": "sh ./scripts/inject-runtime-env.sh",
"tsc": "npx tsc --project tsconfig.app.json",
"tsc:ci": "yarn tsc --project tsconfig.json",
"tsc:watch": "yarn tsc --watch",
"tsc:spec": "yarn tsc --project tsconfig.spec.json",
"preview": "vite preview",
"lint": "npx eslint . --report-unused-disable-directives --max-warnings 0 --config .eslintrc.cjs",
"lint:ci": "yarn lint --config .eslintrc-ci.cjs",
"fmt:fix": "prettier --cache --write \"src/**/*.ts\" \"src/**/*.tsx\"",
"fmt": "prettier --check \"src/**/*.ts\" \"src/**/*.tsx\"",
"test": "npx jest",
"test-watch": "jest --watch",
"tsup": "tsup",
"coverage": "jest --coverage",
"storybook:modules:dev": "STORYBOOK_SCOPE=modules yarn storybook:dev",
"storybook:dev": "npx storybook dev -p 6006 --no-open",
"storybook:pages:dev": "STORYBOOK_SCOPE=pages yarn storybook:dev",
"storybook:docs:dev": "STORYBOOK_SCOPE=ui-docs yarn storybook:dev",
"storybook:build": "npx storybook build",
"storybook:modules:build": "STORYBOOK_SCOPE=modules npx nx storybook:build",
"storybook:pages:build": "STORYBOOK_SCOPE=pages npx nx storybook:build",
"storybook:docs:build": "STORYBOOK_SCOPE=ui-docs npx nx storybook:build",
"storybook:test": "test-storybook",
"storybook:test-slow": "test-storybook --maxWorkers=3",
"storybook:test-single-worker": "test-storybook --maxWorkers=1",
"storybook:coverage": "yarn storybook:test-slow --coverage ; npx nyc report --reporter=lcov -t coverage/storybook --report-dir coverage/storybook --check-coverage",
"storybook:modules:coverage": "STORYBOOK_SCOPE=modules yarn storybook:coverage",
"storybook:pages:coverage": "STORYBOOK_SCOPE=pages yarn storybook:coverage",
"graphql:data:generate": "dotenv cross-var graphql-codegen -- --config codegen.cjs",
"graphql:metadata:generate": "dotenv cross-var graphql-codegen -- --config codegen-metadata.cjs",
"chromatic": "cross-var npx chromatic --project-token=$CHROMATIC_PROJECT_TOKEN --build-script-name=storybook:build",
"chromatic:ci": "cross-var npx chromatic --project-token=$CHROMATIC_PROJECT_TOKEN --build-script-name=storybook:build --exit-zero-on-changes"
"build": "npx nx exec -- vite build && sh ./scripts/inject-runtime-env.sh",
"build:sourcemaps": "VITE_BUILD_SOURCEMAP=true NODE_OPTIONS=--max-old-space-size=3000 npx nx build",
"start:prod": "NODE_ENV=production npx nx exec -- vite --host",
"storybook:build": "npx nx exec -- storybook build",
"tsup": "npx nx exec -- tsup"
},
"engines": {
"node": "^18.17.1",