mirror of
https://github.com/bitwarden/browser
synced 2026-02-22 04:14:04 +00:00
feat(cli): integrate Nx with CLI application
- Add project.json with build, serve, test, and lint targets - Support both OSS and Bit configurations via Nx configurations - Maintain backward compatibility with existing npm build scripts - Update webpack configs to work with both Nx and direct webpack CLI calls - Enable nx build cli --configuration=[oss|oss-dev|bit|bit-dev] commands - Enable nx serve cli for development workflow with watch mode - Preserve all existing npm run build:* commands for compatibility
This commit is contained in:
80
apps/cli/project.json
Normal file
80
apps/cli/project.json
Normal file
@@ -0,0 +1,80 @@
|
||||
{
|
||||
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||
"name": "cli",
|
||||
"projectType": "application",
|
||||
"sourceRoot": "apps/cli/src",
|
||||
"tags": ["scope:cli", "type:app"],
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "@nx/webpack:webpack",
|
||||
"outputs": ["{options.outputPath}"],
|
||||
"defaultConfiguration": "oss",
|
||||
"options": {
|
||||
"outputPath": "dist/apps/cli",
|
||||
"webpackConfig": "apps/cli/webpack.nx.config.js",
|
||||
"tsConfig": "apps/cli/tsconfig.json",
|
||||
"main": "apps/cli/src/bw.ts",
|
||||
"target": "node",
|
||||
"compiler": "tsc"
|
||||
},
|
||||
"configurations": {
|
||||
"oss": {
|
||||
"mode": "production"
|
||||
},
|
||||
"oss-dev": {
|
||||
"mode": "development"
|
||||
},
|
||||
"bit": {
|
||||
"mode": "production",
|
||||
"webpackConfig": "bitwarden_license/bit-cli/webpack.config.js",
|
||||
"main": "bitwarden_license/bit-cli/src/bw.ts",
|
||||
"tsConfig": "bitwarden_license/bit-cli/tsconfig.json"
|
||||
},
|
||||
"bit-dev": {
|
||||
"mode": "development",
|
||||
"webpackConfig": "bitwarden_license/bit-cli/webpack.config.js",
|
||||
"main": "bitwarden_license/bit-cli/src/bw.ts",
|
||||
"tsConfig": "bitwarden_license/bit-cli/tsconfig.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"serve": {
|
||||
"executor": "@nx/webpack:webpack",
|
||||
"defaultConfiguration": "oss-dev",
|
||||
"options": {
|
||||
"outputPath": "dist/apps/cli",
|
||||
"webpackConfig": "apps/cli/webpack.nx.config.js",
|
||||
"tsConfig": "apps/cli/tsconfig.json",
|
||||
"main": "apps/cli/src/bw.ts",
|
||||
"target": "node",
|
||||
"compiler": "tsc",
|
||||
"watch": true
|
||||
},
|
||||
"configurations": {
|
||||
"oss-dev": {
|
||||
"mode": "development"
|
||||
},
|
||||
"bit-dev": {
|
||||
"mode": "development",
|
||||
"webpackConfig": "bitwarden_license/bit-cli/webpack.config.js",
|
||||
"main": "bitwarden_license/bit-cli/src/bw.ts",
|
||||
"tsConfig": "bitwarden_license/bit-cli/tsconfig.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"executor": "@nx/jest:jest",
|
||||
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
||||
"options": {
|
||||
"jestConfig": "apps/cli/jest.config.js"
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nx/eslint:lint",
|
||||
"outputs": ["{options.outputFile}"],
|
||||
"options": {
|
||||
"lintFilePatterns": ["apps/cli/**/*.ts"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user