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:
committed by
GitHub
parent
977927af04
commit
627a6bda29
159
packages/twenty-front/project.json
Normal file
159
packages/twenty-front/project.json
Normal file
@ -0,0 +1,159 @@
|
||||
{
|
||||
"name": "twenty-front",
|
||||
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||
"projectType": "application",
|
||||
"targets": {
|
||||
"build": {
|
||||
"outputs": ["{options.outputPath}"],
|
||||
"options": {
|
||||
"outputPath": "{projectRoot}/build"
|
||||
}
|
||||
},
|
||||
"start": {
|
||||
"executor": "@nx/vite:dev-server",
|
||||
"options": {
|
||||
"buildTarget": "twenty-front:build",
|
||||
"hmr": true
|
||||
}
|
||||
},
|
||||
"preview": {
|
||||
"executor": "@nx/vite:preview-server",
|
||||
"options": {
|
||||
"buildTarget": "twenty-front:build",
|
||||
"port": 3001,
|
||||
"open": true
|
||||
}
|
||||
},
|
||||
"typecheck": {
|
||||
"executor": "nx:run-commands",
|
||||
"options": {
|
||||
"cwd": "{projectRoot}",
|
||||
"command": "tsc -b tsconfig.json",
|
||||
"incremental": true
|
||||
},
|
||||
"configurations": {
|
||||
"ci": { "incremental": false },
|
||||
"watch": { "watch": true }
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nx/eslint:lint",
|
||||
"outputs": ["{options.outputFile}"],
|
||||
"options": {
|
||||
"eslintConfig": "{projectRoot}/.eslintrc.cjs",
|
||||
"ignorePath": "{workspaceRoot}/.gitignore",
|
||||
"lintFilePatterns": [
|
||||
"{projectRoot}/src/**/*.{ts,tsx,json}",
|
||||
"{projectRoot}/package.json"
|
||||
],
|
||||
"maxWarnings": 0,
|
||||
"reportUnusedDisableDirectives": "error",
|
||||
"cache": true
|
||||
},
|
||||
"configurations": {
|
||||
"ci": {
|
||||
"eslintConfig": "{projectRoot}/.eslintrc-ci.cjs",
|
||||
"cache": false
|
||||
},
|
||||
"fix": {
|
||||
"fix": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"fmt": {
|
||||
"executor": "nx:run-commands",
|
||||
"inputs": ["{projectRoot}/src/**/*"],
|
||||
"cache": true,
|
||||
"options": {
|
||||
"cwd": "{projectRoot}",
|
||||
"command": "prettier src --check"
|
||||
},
|
||||
"configurations": {
|
||||
"fix": { "args": ["--write"] }
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"executor": "@nx/jest:jest",
|
||||
"outputs": ["{projectRoot}/coverage"],
|
||||
"options": {
|
||||
"jestConfig": "{projectRoot}/jest.config.ts",
|
||||
"coverage": true,
|
||||
"coverageReporters": ["text-summary"]
|
||||
},
|
||||
"configurations": {
|
||||
"ci": {
|
||||
"ci": true,
|
||||
"maxWorkers": 3
|
||||
},
|
||||
"coverage": {
|
||||
"coverageReporters": ["lcov", "text"]
|
||||
},
|
||||
"watch": { "watch": true }
|
||||
}
|
||||
},
|
||||
"storybook:dev": {
|
||||
"executor": "@nx/storybook:storybook",
|
||||
"options": {
|
||||
"port": 6006,
|
||||
"configDir": "{projectRoot}/.storybook"
|
||||
}
|
||||
},
|
||||
"storybook:static": {
|
||||
"executor": "@nx/web:file-server",
|
||||
"options": {
|
||||
"buildTarget": "twenty-front:storybook:build",
|
||||
"staticFilePath": "{projectRoot}/storybook-static",
|
||||
"port": 6006,
|
||||
"watch": false
|
||||
}
|
||||
},
|
||||
"storybook:test": {
|
||||
"executor": "nx:run-commands",
|
||||
"options": {
|
||||
"cwd": "{projectRoot}",
|
||||
"commands": [
|
||||
"test-storybook --url http://localhost:6006 --maxWorkers=3 --coverage",
|
||||
"nyc report --reporter=lcov --reporter=text-summary -t coverage/storybook --report-dir coverage/storybook --check-coverage"
|
||||
],
|
||||
"parallel": false
|
||||
},
|
||||
"configurations": {
|
||||
"docs": {
|
||||
"commands": ["STORYBOOK_SCOPE=ui-docs nx storybook:test"]
|
||||
},
|
||||
"modules": {
|
||||
"commands": ["STORYBOOK_SCOPE=modules nx storybook:test"]
|
||||
},
|
||||
"pages": { "commands": ["STORYBOOK_SCOPE=pages nx storybook:test"] }
|
||||
}
|
||||
},
|
||||
"graphql:generate": {
|
||||
"executor": "nx:run-commands",
|
||||
"defaultConfiguration": "data",
|
||||
"options": {
|
||||
"cwd": "{projectRoot}",
|
||||
"command": "dotenv cross-var graphql-codegen -- --config={args.config}"
|
||||
},
|
||||
"configurations": {
|
||||
"data": {
|
||||
"args": ["--config=codegen.cjs"]
|
||||
},
|
||||
"metadata": {
|
||||
"args": ["--config=codegen-metadata.cjs"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"chromatic": {
|
||||
"executor": "nx:run-commands",
|
||||
"options": {
|
||||
"cwd": "{projectRoot}",
|
||||
"command": "cross-var chromatic --project-token=$CHROMATIC_PROJECT_TOKEN --build-script-name=storybook:build"
|
||||
},
|
||||
"configurations": {
|
||||
"ci": {
|
||||
"args": ["--exit-zero-on-changes"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user