Compare commits

...

43 Commits

Author SHA1 Message Date
FrozenPandaz 7285ee50fc chore(misc): publish 15.5.3 2023-01-20 18:36:29 -05:00
Leosvel Pérez Espinosa 771fe4a76d cleanup(angular): enable the ng-cli e2e test (#14503)
(cherry picked from commit 6c926d8c32)
2023-01-20 17:39:52 -05:00
Leosvel Pérez Espinosa 22528d187a cleanup(angular): disable ng-add e2e tests temporarily (#14487)
(cherry picked from commit 26d67c6b24)
2023-01-20 17:39:47 -05:00
Caleb Ukle c46b24c28c fix(testing): do not set vitest root when not in workspaceRoot (#14362)
(cherry picked from commit 7857ae00a0)
2023-01-20 17:21:52 -05:00
Jack Hsu 39b55001ce feat(webpack): update babel-loader to 9.1.2 to fix hashing issues (#14527)
(cherry picked from commit f1f69df470)
2023-01-20 17:21:50 -05:00
Taylor McMonigle acd2bee3ed fix(bundling): fix esbuild watch yields success=false when no error (#14359)
(cherry picked from commit 2baa80d8b3)
2023-01-20 17:21:42 -05:00
Jason Jean c59d6c7e27 docs(misc): refine schemas for @nrwl/workspace (#14522)
(cherry picked from commit d6517506df)
2023-01-20 17:21:40 -05:00
Jack Hsu 1cd1e40045 fix(webpack): handle new https options in webpack-dev-server (#14520)
(cherry picked from commit da0e3ba1c7)
2023-01-20 17:21:36 -05:00
Denis Frenademetz 7025e339a3 fix(testing): update jest snapshots (#14452)
(cherry picked from commit 9cc2be6106)
2023-01-20 16:01:34 -05:00
Tim Fisher c685f3422e fix(react): fix imports in tmpl (#14369)
(cherry picked from commit 1c3ebfc055)
2023-01-20 15:29:54 -05:00
Katerina Skroumpelou 69cb681a09 fix(vite): remove environments generation (#14515)
(cherry picked from commit c2be735097)
2023-01-20 15:29:44 -05:00
Michael Bagnasco 7a48c21770 fix(testing): fixed a typo with the 15.5.0 cypress migration warning (#14384)
Co-authored-by: Michael Bagnasco <michael@sbevision.com>
(cherry picked from commit f8854d7089)
2023-01-20 15:29:10 -05:00
Katerina Skroumpelou df20a01b71 fix(angular): fix path for import (#14517)
(cherry picked from commit 928385892f)
2023-01-20 15:29:02 -05:00
Colum Ferry 6563ed7265 fix(angular): should find the tsconfig at root of project #14379 (#14514)
(cherry picked from commit ce04b80a9a)
2023-01-20 15:28:47 -05:00
Colum Ferry fc9dedfc6f fix(angular): ngrx attaching to route and non-standalone apis for 14 (#14489)
Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
(cherry picked from commit b076f0380a)
2023-01-20 15:27:54 -05:00
Colum Ferry 03843ece52 fix(angular): karma setup should be generated correctly for v14 (#14459)
(cherry picked from commit 6330d9ec97)
2023-01-20 15:27:51 -05:00
Jack Hsu 6d72e3b00d chore(repo): update CI config to mitigate memory failures (#14502)
(cherry picked from commit f297cb6883)
2023-01-20 15:21:57 -05:00
Isaac Mann 91abb6d767 chore(core): delete accidentally committed file (#14491)
(cherry picked from commit 78a55953b0)
2023-01-20 15:21:27 -05:00
Emily Xiong 9e8382e2da docs(react-native): add x-priority to react-native, expo and detox (#14402)
(cherry picked from commit 93ac55ff2a)
2023-01-20 15:20:11 -05:00
Jack Hsu 3fa9d43d06 fix(react): remove unit test runner prompt when generating library (#14457)
(cherry picked from commit 99b49189eb)
2023-01-20 15:19:56 -05:00
FrozenPandaz 22d6519948 chore(misc): publish 15.5.2 2023-01-17 19:18:44 -05:00
Josh Goldberg 372334c0d5 fix(misc): add missing alt text to files-readme logo (#14446)
(cherry picked from commit 5adfc09d76)
2023-01-17 19:11:13 -05:00
Jack Hsu 2bc9e3546f fix(react): install tsconfig-paths-webpack-plugin when converting CRA… (#14442)
(cherry picked from commit 91b653ed64)
2023-01-17 18:20:53 -05:00
James Henry dfd29167d5 chore(testing): add lerna-smoke-tests (#14347)
(cherry picked from commit 965c638d8d)
2023-01-17 16:17:41 -05:00
Jack Hsu e30398bf92 fix(webpack): allow optimization to be turned off via CLI (#14431)
(cherry picked from commit da8b855c6c)
2023-01-17 16:17:26 -05:00
Colum Ferry 5a0620c628 feat(angular): upgrade nguniversal version (#14419)
(cherry picked from commit 2773f40202)
2023-01-17 11:07:11 -05:00
Miroslav Jonaš 17d9ce80ff fix(linter): wildcard sourceTag should be respected for banned imports (#14418)
(cherry picked from commit 2b23963415)
2023-01-17 11:06:25 -05:00
Jack Hsu 00336d85f5 fix(web): remove hard dependencies to @nrwl/vite and @nrwl/webpack (#14408)
(cherry picked from commit e0bd338225)
2023-01-17 11:06:17 -05:00
Auke van Leeuwen ecf7befe74 fix(js): fix reading tsconfig.json on TypeScript 4.9 (#14380)
(cherry picked from commit ada727cf1a)
2023-01-17 11:02:47 -05:00
Nicholas Cunningham 3b9ca39c5d fix(vite): add fix for vitest configuration (#14404)
(cherry picked from commit 351b4aabf2)
2023-01-17 10:59:00 -05:00
Katerina Skroumpelou b86896443b fix(storybook): better error handling (#14396)
(cherry picked from commit 55aba1365d)
2023-01-17 10:58:51 -05:00
Miroslav Jonaš 74ca312916 fix(core): fix broken lines and columns import (#14394)
(cherry picked from commit a70eec8e40)
2023-01-17 10:58:46 -05:00
Colum Ferry 23d107318e feat(angular): add priority flags to generators (#14299)
(cherry picked from commit a22bd54f3f)
2023-01-17 10:58:28 -05:00
Leosvel Pérez Espinosa a0bf588fbe cleanup(angular): ensure latest and backward compatible versions are strongly typed (#14387)
(cherry picked from commit c300722233)
2023-01-17 10:58:21 -05:00
Leosvel Pérez Espinosa fd5dffefd6 cleanup(angular): reduce sourcemap loading and decoding in ng-packagr-lite executor (#14360)
(cherry picked from commit 90ca4c949a)
2023-01-17 10:58:19 -05:00
Jason Jean 8f66166e09 fix(core): fix implicit dependencies conversions from project inputs (#14364)
(cherry picked from commit 898db859b5)
2023-01-17 10:58:01 -05:00
Jason Jean 30024d2e19 fix(core): cap inferred max workers count at 8 (#14366)
(cherry picked from commit ab8197ccdf)
2023-01-17 10:57:56 -05:00
Phillip Barta d6857632a2 fix(misc): loosen chalk version (#14276)
(cherry picked from commit 415d1c745c)
2023-01-17 10:57:50 -05:00
Benjamin Cabanes 1a3c3cffcd feat(nx-cloud): display current token for connect-to-nx-cloud (#14315)
(cherry picked from commit 0db507394e)
2023-01-17 10:57:32 -05:00
Colum Ferry 116eb3e5c9 fix(angular): correctly error scam-to-standalone when used in Angular < 14.1.0 (#14341)
(cherry picked from commit 81211bfc8f)
2023-01-17 10:57:26 -05:00
Colum Ferry eaac3ae80d fix(angular): correctly error application when standalone is used in Angular < 14.1.0 (#14338)
(cherry picked from commit 3041b0a227)
2023-01-17 10:57:24 -05:00
Leosvel Pérez Espinosa 9f6077364f fix(angular): fix assets copying in ng-packagr-lite executor (#14355)
(cherry picked from commit 3e9f4bf99a)
2023-01-17 10:57:17 -05:00
Leosvel Pérez Espinosa 1c21e0c73c feat(angular): add backwards compat support for the ngrx generator (#14348)
(cherry picked from commit 295547b3a9)
2023-01-17 10:57:13 -05:00
268 changed files with 2341 additions and 5182 deletions
+15 -23
View File
@@ -147,6 +147,11 @@ jobs:
NX_E2E_RUN_CYPRESS: 'false'
NX_VERBOSE_LOGGING: 'false'
steps:
- run:
name: Configure git metadata (needed for lerna smoke tests)
command: |
git config --global user.email test@test.com
git config --global user.name "Test Test"
- run:
name: Set dynamic nx run variable
command: |
@@ -182,17 +187,20 @@ jobs:
no_output_timeout: 60m
command: |
pids=()
npx nx-cloud record -- nx format:check --base=$NX_BASE --head=$NX_HEAD &
pids+=($!)
npx nx run-many -t check-imports check-commit check-lock-files root-lint depcheck documentation --parallel=1 --no-dte &
(npx nx lint --no-dte &&
npx nx run-many -t check-imports check-commit check-lock-files depcheck documentation --parallel=1 --no-dte) &
pids+=($!)
yarn nx affected -t test lint --base=$NX_BASE --head=$NX_HEAD --parallel=1 &
yarn nx affected --target=lint --base=$NX_BASE --head=$NX_HEAD --parallel=3 &
pids+=($!)
yarn nx affected --target=test --base=$NX_BASE --head=$NX_HEAD --parallel=1 &
pids+=($!)
(yarn nx affected --target=build --base=$NX_BASE --head=$NX_HEAD --parallel=3 &&
npx nx affected --target=e2e --base=$NX_BASE --head=$NX_HEAD --exclude=e2e-storybook,e2e-storybook-angular,e2e-react-native,e2e-detox --parallel=1) &
npx nx affected --target=e2e --base=$NX_BASE --head=$NX_HEAD --exclude=e2e-storybook,e2e-storybook-angular --parallel=1) &
pids+=($!)
for pid in "${pids[@]}"; do
@@ -213,27 +221,11 @@ jobs:
echo "export NX_RUN_GROUP=\"run-group-macos-$CIRCLE_WORKFLOW_ID\";" >> $BASH_ENV
- setup:
os: macos
- nx/set-shas:
main-branch-name: 'master'
- run:
name: Check if "detox" or "react-native" were modified directly
name: Run E2E Tests for macOS
# FIXME: remove --exclude=e2e-detox once we have a fix for the detox tests
command: |
COUNT=`git diff --name-only $NX_BASE $NX_HEAD | (grep -E 'packages/detox|packages/react-native|e2e/detox|e2e/react-native' || true) | wc -l`
if [[ $COUNT -gt 0 ]]; then
echo "React Native and Detox were touched directly"
echo "export E2E_AFFECTED=true;" >> $BASH_ENV
else
echo "React Native and Detox were not touched directly"
echo "export E2E_AFFECTED=false;" >> $BASH_ENV
fi
- run:
name: Run E2E Tests
command: |
if $E2E_AFFECTED; then
npx nx affected --target=e2e --base=$NX_BASE --head=$NX_HEAD --exclude=e2e-make-angular-cli-faster,e2e-detox,e2e-js,e2e-next,e2e-workspace-create,e2e-nx-run,e2e-nx-misc,e2e-react,e2e-web,e2e-webpack,e2e-rollup,e2e-esbuild,e2e-angular-extensions,e2e-angular-core,e2e-nx-plugin,e2e-cypress,e2e-node,e2e-linter,e2e-jest,e2e-add-nx-to-monorepo,nx-dev-e2e,e2e-nx-init,e2e-graph-client,e2e-vite,e2e-cra-to-nx,e2e-storybook,e2e-storybook-angular --parallel=1;
else
echo "Skipping E2E tests";
fi
npx nx run-many -t e2e-macos --parallel=1 --exclude=e2e-detox
no_output_timeout: 45m
# -------------------------
-4267
View File
File diff suppressed because it is too large Load Diff
@@ -18,15 +18,18 @@
"prefix": {
"type": "string",
"format": "html-selector",
"description": "The prefix to apply to generated selectors."
"description": "The prefix to apply to generated selectors.",
"x-priority": "important"
},
"projectName": {
"type": "string",
"description": "The name of the project."
"description": "The name of the project.",
"x-priority": "important"
},
"projectRoot": {
"type": "string",
"description": "The path to the root of the selected project."
"description": "The path to the root of the selected project.",
"x-priority": "important"
},
"setParserOptionsProject": {
"type": "boolean",
@@ -36,12 +39,14 @@
"skipFormat": {
"type": "boolean",
"description": "Skip formatting files.",
"default": false
"default": false,
"x-priority": "internal"
},
"skipPackageJson": {
"type": "boolean",
"default": false,
"description": "Do not add dependencies to `package.json`."
"description": "Do not add dependencies to `package.json`.",
"x-priority": "internal"
}
},
"additionalProperties": false,
@@ -18,7 +18,8 @@
},
"directory": {
"description": "The directory of the new application.",
"type": "string"
"type": "string",
"x-priority": "important"
},
"style": {
"description": "The file extension to be used for style files.",
@@ -49,7 +50,8 @@
"type": "boolean",
"description": "Generate a routing module.",
"default": false,
"x-prompt": "Would you like to configure routing for this application?"
"x-prompt": "Would you like to configure routing for this application?",
"x-priority": "important"
},
"inlineStyle": {
"description": "Specifies if the style will be in the ts file.",
@@ -83,12 +85,14 @@
"skipFormat": {
"description": "Skip formatting files.",
"type": "boolean",
"default": false
"default": false,
"x-priority": "internal"
},
"skipPackageJson": {
"type": "boolean",
"default": false,
"description": "Do not add dependencies to `package.json`."
"description": "Do not add dependencies to `package.json`.",
"x-priority": "internal"
},
"unitTestRunner": {
"type": "string",
@@ -123,7 +127,8 @@
},
"standaloneConfig": {
"description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`.",
"type": "boolean"
"type": "boolean",
"x-priority": "internal"
},
"port": {
"type": "number",
@@ -140,7 +145,7 @@
"default": false
},
"standalone": {
"description": "Generate an application that is setup to use standalone components.",
"description": "Generate an application that is setup to use standalone components. _Note: This is only supported in Angular versions >= 14.1.0_",
"type": "boolean",
"default": false
},
@@ -148,7 +153,8 @@
"description": "Create an application at the root of the workspace.",
"type": "boolean",
"default": false,
"hidden": true
"hidden": true,
"x-priority": "internal"
}
},
"additionalProperties": false,
@@ -12,7 +12,8 @@
"skipFormat": {
"description": "Skip formatting files.",
"type": "boolean",
"default": false
"default": false,
"x-priority": "internal"
}
},
"additionalProperties": false,
@@ -11,27 +11,32 @@
"projectName": {
"type": "string",
"description": "The name of the project.",
"examples": ["ui-samples"]
"examples": ["ui-samples"],
"x-priority": "important"
},
"projectPath": {
"type": "string",
"description": "Path to the project.",
"examples": ["libs/ui-samples"]
"examples": ["libs/ui-samples"],
"x-priority": "important"
},
"componentName": {
"type": "string",
"description": "Class name of the component.",
"examples": ["AwesomeComponent"]
"examples": ["AwesomeComponent"],
"x-priority": "important"
},
"componentPath": {
"type": "string",
"description": "Relative path to the component file from the project root.",
"examples": ["awesome"]
"examples": ["awesome"],
"x-priority": "important"
},
"componentFileName": {
"type": "string",
"description": "Component file name without the `.ts` extension.",
"examples": ["awesome.component"]
"examples": ["awesome.component"],
"x-priority": "important"
},
"cypressProject": {
"type": "string",
@@ -44,7 +49,8 @@
"skipFormat": {
"description": "Skip formatting files.",
"type": "boolean",
"default": false
"default": false,
"x-priority": "internal"
}
},
"additionalProperties": false,
@@ -11,27 +11,32 @@
"projectPath": {
"type": "string",
"description": "Path to the project.",
"examples": ["libs/ui-samples"]
"examples": ["libs/ui-samples"],
"x-priority": "important"
},
"componentName": {
"type": "string",
"description": "Class name of the component.",
"examples": ["AwesomeComponent"]
"examples": ["AwesomeComponent"],
"x-priority": "important"
},
"componentPath": {
"type": "string",
"description": "Relative path to the component file from the project root.",
"examples": ["awesome"]
"examples": ["awesome"],
"x-priority": "important"
},
"componentFileName": {
"type": "string",
"description": "Component file name without the `.ts` extension.",
"examples": ["awesome.component"]
"examples": ["awesome.component"],
"x-priority": "important"
},
"skipFormat": {
"description": "Skip formatting files.",
"type": "boolean",
"default": false
"default": false,
"x-priority": "internal"
}
},
"additionalProperties": false,
@@ -12,30 +12,35 @@
"type": "string",
"description": "The name of the project where the component is located.",
"x-dropdown": "projects",
"x-prompt": "What project is the component located in?"
"x-prompt": "What project is the component located in?",
"x-priority": "important"
},
"componentName": {
"type": "string",
"description": "Class name of the component to create a test for.",
"examples": ["MyFancyButtonComponent"],
"x-prompt": "What is the class name of the component to create a test for?"
"x-prompt": "What is the class name of the component to create a test for?",
"x-priority": "important"
},
"componentDir": {
"type": "string",
"description": "Relative path to the folder that contains the component from the project root.",
"examples": ["src/lib/my-fancy-button"],
"x-prompt": "What is the path to the component directory from the project root?"
"x-prompt": "What is the path to the component directory from the project root?",
"x-priority": "important"
},
"componentFileName": {
"type": "string",
"description": "File name that contains the component without the `.ts` extension.",
"examples": ["my-fancy-button.component"],
"x-prompt": "What is the file name that contains the component?"
"x-prompt": "What is the file name that contains the component?",
"x-priority": "important"
},
"skipFormat": {
"description": "Skip formatting files.",
"type": "boolean",
"default": false
"default": false,
"x-priority": "internal"
}
},
"additionalProperties": false,
@@ -19,7 +19,8 @@
"project": {
"type": "string",
"description": "The name of the project.",
"x-dropdown": "projects"
"x-dropdown": "projects",
"x-priority": "important"
},
"name": {
"type": "string",
@@ -48,7 +49,8 @@
"standalone": {
"description": "Whether the generated component is standalone. _Note: This is only supported in Angular versions >= 14.1.0_",
"type": "boolean",
"default": false
"default": false,
"x-priority": "important"
},
"viewEncapsulation": {
"description": "The view encapsulation strategy to use in the new component.",
@@ -107,7 +109,8 @@
"export": {
"type": "boolean",
"description": "Specifies if the component should be exported in the declaring `NgModule`. Additionally, if the project is a library, the component will be exported from the project's entry point (normally `index.ts`) if the module it belongs to is also exported or if the component is standalone.",
"default": false
"default": false,
"x-priority": "important"
}
},
"required": ["name"],
@@ -20,7 +20,8 @@
"type": "string",
"description": "The name of the micro frontend project to migrate.",
"$default": { "$source": "argv", "index": 0 },
"x-prompt": "What micro frontend project would you like to migrate?"
"x-prompt": "What micro frontend project would you like to migrate?",
"x-priority": "important"
}
},
"presets": []
@@ -27,7 +27,8 @@
"description": "The name of the Angular project to convert. Please note, if the project is an Angular app with an associated Cypress e2e project, it will also attempt to convert that.",
"type": "string",
"$default": { "$source": "argv", "index": 0 },
"x-prompt": "Which Angular project would you like to convert from TSLint to ESLint?"
"x-prompt": "Which Angular project would you like to convert from TSLint to ESLint?",
"x-priority": "important"
},
"ignoreExistingTslintConfig": {
"type": "boolean",
@@ -44,7 +45,8 @@
"skipFormat": {
"type": "boolean",
"description": "Skip formatting files.",
"default": false
"default": false,
"x-priority": "internal"
}
},
"additionalProperties": false,
@@ -13,7 +13,8 @@
"type": "string",
"description": "The name of the project to add cypress component testing configuration to",
"x-dropdown": "projects",
"x-prompt": "What project should we add Cypress component testing to?"
"x-prompt": "What project should we add Cypress component testing to?",
"x-priority": "important"
},
"generateTests": {
"type": "boolean",
@@ -24,12 +25,14 @@
"buildTarget": {
"type": "string",
"description": "A build target used to configure Cypress component testing in the format of `project:target[:configuration]`. The build target should be an angular app. If not provided we will try to infer it from your projects usage.",
"pattern": "^[^:\\s]+:[^:\\s]+(:\\S+)?$"
"pattern": "^[^:\\s]+:[^:\\s]+(:\\S+)?$",
"x-priority": "important"
},
"skipFormat": {
"type": "boolean",
"description": "Skip formatting files",
"default": false
"default": false,
"x-priority": "internal"
}
},
"required": ["project"],
@@ -11,12 +11,14 @@
"properties": {
"project": {
"type": "string",
"description": "The name of the project."
"description": "The name of the project.",
"x-priority": "important"
},
"name": {
"type": "string",
"description": "The name of the main AngularJS module.",
"$default": { "$source": "argv", "index": 0 }
"$default": { "$source": "argv", "index": 0 },
"x-priority": "important"
},
"angularJsImport": {
"type": "string",
@@ -25,12 +27,14 @@
"skipFormat": {
"type": "boolean",
"description": "Skip formatting files.",
"default": false
"default": false,
"x-priority": "internal"
},
"skipPackageJson": {
"type": "boolean",
"description": "Do not add `@angular/upgrade` to `package.json` (e.g., `--skipPackageJson`).",
"default": false
"default": false,
"x-priority": "internal"
}
},
"additionalProperties": false,
@@ -22,7 +22,8 @@
},
"remotes": {
"type": "array",
"description": "The names of the remote applications to add to the host."
"description": "The names of the remote applications to add to the host.",
"x-priority": "important"
},
"dynamic": {
"type": "boolean",
@@ -90,12 +91,14 @@
"skipPackageJson": {
"type": "boolean",
"default": false,
"description": "Do not add dependencies to `package.json`."
"description": "Do not add dependencies to `package.json`.",
"x-priority": "internal"
},
"skipPostInstall": {
"type": "boolean",
"default": false,
"description": "Do not add or append `ngcc` to the `postinstall` script in `package.json`."
"description": "Do not add or append `ngcc` to the `postinstall` script in `package.json`.",
"x-priority": "internal"
},
"unitTestRunner": {
"type": "string",
@@ -145,7 +148,8 @@
"skipFormat": {
"description": "Skip formatting files.",
"type": "boolean",
"default": false
"default": false,
"x-priority": "internal"
},
"standalone": {
"type": "boolean",
@@ -155,7 +159,8 @@
"ssr": {
"description": "Whether to configure SSR for the host application",
"type": "boolean",
"default": false
"default": false,
"x-priority": "important"
}
},
"additionalProperties": false,
@@ -19,29 +19,34 @@
"type": "string",
"enum": ["karma", "jest", "none"],
"description": "Test runner to use for unit tests.",
"default": "jest"
"default": "jest",
"x-priority": "important"
},
"e2eTestRunner": {
"type": "string",
"enum": ["protractor", "cypress", "none"],
"description": "Test runner to use for end to end (e2e) tests.",
"default": "cypress"
"default": "cypress",
"x-priority": "important"
},
"skipInstall": {
"type": "boolean",
"description": "Skip installing after adding `@nrwl/workspace`.",
"default": false
"default": false,
"x-priority": "internal"
},
"skipFormat": {
"description": "Skip formatting files.",
"type": "boolean",
"default": false
"default": false,
"x-priority": "internal"
},
"linter": {
"description": "The tool to use for running lint checks.",
"type": "string",
"enum": ["eslint", "none"],
"default": "eslint"
"default": "eslint",
"x-priority": "important"
},
"style": {
"description": "The file extension to be used for style files.",
@@ -71,7 +76,8 @@
"skipPackageJson": {
"type": "boolean",
"default": false,
"description": "Do not add dependencies to `package.json`."
"description": "Do not add dependencies to `package.json`.",
"x-priority": "internal"
}
},
"additionalProperties": false,
@@ -12,17 +12,20 @@
"project": {
"type": "string",
"description": "The name of the project.",
"x-dropdown": "projects"
"x-dropdown": "projects",
"x-priority": "important"
},
"skipFormat": {
"description": "Skip formatting files.",
"type": "boolean",
"default": false
"default": false,
"x-priority": "internal"
},
"skipPackageJson": {
"description": "Skip updating package.json.",
"type": "boolean",
"default": false
"default": false,
"x-priority": "internal"
}
},
"additionalProperties": false,
@@ -18,7 +18,8 @@
"skipPackageJson": {
"type": "boolean",
"default": false,
"description": "Do not add dependencies to `package.json`."
"description": "Do not add dependencies to `package.json`.",
"x-priority": "internal"
}
},
"additionalProperties": false,
@@ -14,14 +14,16 @@
"description": "The name of the secondary entry point.",
"$default": { "$source": "argv", "index": 0 },
"x-prompt": "What name would you like to use for the secondary entry point?",
"pattern": "^[a-zA-Z].*$"
"pattern": "^[a-zA-Z].*$",
"x-priority": "important"
},
"library": {
"type": "string",
"description": "The name of the library to create the secondary entry point for.",
"x-prompt": "What library would you like to create the secondary entry point for?",
"pattern": "^[a-zA-Z].*$",
"x-dropdown": "projects"
"x-dropdown": "projects",
"x-priority": "important"
},
"skipModule": {
"type": "boolean",
@@ -18,17 +18,20 @@
},
"directory": {
"type": "string",
"description": "A directory where the library is placed."
"description": "A directory where the library is placed.",
"x-priority": "important"
},
"publishable": {
"type": "boolean",
"default": false,
"description": "Generate a publishable library."
"description": "Generate a publishable library.",
"x-priority": "important"
},
"buildable": {
"type": "boolean",
"default": false,
"description": "Generate a buildable library."
"description": "Generate a buildable library.",
"x-priority": "important"
},
"prefix": {
"type": "string",
@@ -39,7 +42,8 @@
"skipFormat": {
"description": "Skip formatting files.",
"type": "boolean",
"default": false
"default": false,
"x-priority": "internal"
},
"simpleModuleName": {
"description": "Keep the module name simple (when using `--directory`).",
@@ -60,7 +64,8 @@
"skipPackageJson": {
"type": "boolean",
"default": false,
"description": "Do not add dependencies to `package.json`."
"description": "Do not add dependencies to `package.json`.",
"x-priority": "internal"
},
"skipTsConfig": {
"type": "boolean",
@@ -70,16 +75,19 @@
"routing": {
"type": "boolean",
"default": false,
"description": "Add router configuration. See `lazy` for more information."
"description": "Add router configuration. See `lazy` for more information.",
"x-priority": "important"
},
"lazy": {
"type": "boolean",
"default": false,
"description": "Add `RouterModule.forChild` when set to true, and a simple array of routes when set to false."
"description": "Add `RouterModule.forChild` when set to true, and a simple array of routes when set to false.",
"x-priority": "important"
},
"parent": {
"type": "string",
"description": "Path to the parent route configuration using `loadChildren` or `children`, depending on what `lazy` is set to."
"description": "Path to the parent route configuration using `loadChildren` or `children`, depending on what `lazy` is set to.",
"x-priority": "important"
},
"tags": {
"type": "string",
@@ -108,7 +116,8 @@
},
"standaloneConfig": {
"description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`.",
"type": "boolean"
"type": "boolean",
"x-priority": "internal"
},
"compilationMode": {
"description": "Specifies the compilation mode to use. If not specified, it will default to `partial` for publishable libraries and to `full` for buildable libraries. The `full` value can not be used for publishable libraries.",
@@ -19,12 +19,14 @@
"type": "string",
"alias": "project",
"description": "The name of the Angular project to move.",
"x-dropdown": "projects"
"x-dropdown": "projects",
"x-priority": "important"
},
"destination": {
"type": "string",
"description": "The folder to move the Angular project into.",
"$default": { "$source": "argv", "index": 0 }
"$default": { "$source": "argv", "index": 0 },
"x-priority": "important"
},
"importPath": {
"type": "string",
@@ -39,7 +41,8 @@
"type": "boolean",
"aliases": ["skip-format"],
"description": "Skip formatting files.",
"default": false
"default": false,
"x-priority": "internal"
}
},
"required": ["projectName", "destination"],
@@ -11,21 +11,25 @@
"properties": {
"npmScope": {
"type": "string",
"description": "Npm scope for importing libs. NOTE: only used if running the generator in an Angular CLI workspace."
"description": "Npm scope for importing libs. NOTE: only used if running the generator in an Angular CLI workspace.",
"x-priority": "important"
},
"defaultBase": {
"type": "string",
"description": "Default base branch for affected. NOTE: only used if running the generator in an Angular CLI workspace."
"description": "Default base branch for affected. NOTE: only used if running the generator in an Angular CLI workspace.",
"x-priority": "important"
},
"skipInstall": {
"type": "boolean",
"description": "Skip installing added packages.",
"default": false
"default": false,
"x-priority": "internal"
},
"preserveAngularCliLayout": {
"type": "boolean",
"description": "Preserve the Angular CLI layout instead of moving the app into apps. NOTE: only used if running the generator in an Angular CLI workspace.",
"default": false
"default": false,
"x-priority": "important"
},
"unitTestRunner": {
"type": "string",
@@ -42,7 +46,8 @@
"skipFormat": {
"description": "Skip formatting files. NOTE: only used if running the generator in an Nx workspace.",
"type": "boolean",
"default": false
"default": false,
"x-priority": "internal"
},
"linter": {
"description": "The tool to use for running lint checks. NOTE: only used if running the generator in an Nx workspace.",
@@ -59,12 +64,14 @@
"skipPackageJson": {
"type": "boolean",
"default": false,
"description": "Do not add dependencies to `package.json`. NOTE: only used if running the generator in an Nx workspace."
"description": "Do not add dependencies to `package.json`. NOTE: only used if running the generator in an Nx workspace.",
"x-priority": "internal"
},
"skipPostInstall": {
"type": "boolean",
"default": false,
"description": "Do not add or append `ngcc` to the `postinstall` script in `package.json`. NOTE: only used if running the generator in an Nx workspace."
"description": "Do not add or append `ngcc` to the `postinstall` script in `package.json`. NOTE: only used if running the generator in an Nx workspace.",
"x-priority": "internal"
}
},
"additionalProperties": false,
@@ -23,7 +23,8 @@
"type": "string",
"description": "Name of the NgRx feature state, such as `products` or `users`. Recommended to use the plural form of the name.",
"$default": { "$source": "argv", "index": 0 },
"x-prompt": "What name would you like to use for the NgRx feature state? An example would be `users`."
"x-prompt": "What name would you like to use for the NgRx feature state? An example would be `users`.",
"x-priority": "important"
},
"module": {
"type": "string",
@@ -32,12 +33,13 @@
},
"parent": {
"type": "string",
"description": "The path to the `NgModule` or the `Routes` definition file (for Standalone API usage) where the feature state will be registered. The host directory will create/use the new state directory.",
"x-prompt": "What is the path to the module or Routes definition where this NgRx state should be registered?"
"description": "The path to the `NgModule` or the `Routes` definition file (for Standalone API usage) where the feature state will be registered. The host directory will create/use the new state directory. _Note: The Standalone API usage is only supported in Angular versions >= 14.1.0_.",
"x-prompt": "What is the path to the module or Routes definition where this NgRx state should be registered?",
"x-priority": "important"
},
"route": {
"type": "string",
"description": "The route that the Standalone NgRx Providers should be added to.",
"description": "The route that the Standalone NgRx Providers should be added to. _Note: This is only supported in Angular versions >= 14.1.0_.",
"default": "''"
},
"directory": {
@@ -49,7 +51,8 @@
"type": "boolean",
"default": false,
"description": "Setup root or feature state management with NgRx.",
"x-prompt": "Is this the root state of the application?"
"x-prompt": "Is this the root state of the application?",
"x-priority": "important"
},
"facade": {
"type": "boolean",
@@ -70,12 +73,14 @@
"skipFormat": {
"description": "Skip formatting files.",
"type": "boolean",
"default": false
"default": false,
"x-priority": "internal"
},
"skipPackageJson": {
"type": "boolean",
"default": false,
"description": "Do not update the `package.json` with NgRx dependencies."
"description": "Do not update the `package.json` with NgRx dependencies.",
"x-priority": "internal"
},
"barrels": {
"type": "boolean",
@@ -23,7 +23,8 @@
"host": {
"type": "string",
"description": "The name of the host app to attach this remote app to.",
"x-dropdown": "projects"
"x-dropdown": "projects",
"x-priority": "important"
},
"port": {
"type": "number",
@@ -90,7 +91,8 @@
"skipPackageJson": {
"type": "boolean",
"default": false,
"description": "Do not add dependencies to `package.json`."
"description": "Do not add dependencies to `package.json`.",
"x-priority": "internal"
},
"unitTestRunner": {
"type": "string",
@@ -140,7 +142,8 @@
"skipFormat": {
"description": "Skip formatting files.",
"type": "boolean",
"default": false
"default": false,
"x-priority": "internal"
},
"standalone": {
"description": "Whether to generate a remote application with standalone components. _Note: This is only supported in Angular versions >= 14.1.0_",
@@ -25,13 +25,15 @@
"project": {
"type": "string",
"description": "The name of the project.",
"x-dropdown": "projects"
"x-dropdown": "projects",
"x-priority": "important"
},
"name": {
"type": "string",
"description": "The name of the directive.",
"$default": { "$source": "argv", "index": 0 },
"x-prompt": "What name would you like to use for the directive?"
"x-prompt": "What name would you like to use for the directive?",
"x-priority": "important"
},
"skipTests": {
"type": "boolean",
@@ -41,7 +43,8 @@
"inlineScam": {
"type": "boolean",
"description": "Create the `NgModule` in the same file as the Directive.",
"default": true
"default": true,
"x-priority": "important"
},
"flat": {
"type": "boolean",
@@ -65,7 +68,8 @@
"export": {
"type": "boolean",
"description": "Specifies if the SCAM should be exported from the project's entry point (normally `index.ts`). It only applies to libraries.",
"default": true
"default": true,
"x-priority": "important"
}
},
"required": ["name"],
@@ -25,13 +25,15 @@
"project": {
"type": "string",
"description": "The name of the project.",
"x-dropdown": "projects"
"x-dropdown": "projects",
"x-priority": "important"
},
"name": {
"type": "string",
"description": "The name of the pipe.",
"$default": { "$source": "argv", "index": 0 },
"x-prompt": "What name would you like to use for the pipe?"
"x-prompt": "What name would you like to use for the pipe?",
"x-priority": "important"
},
"skipTests": {
"type": "boolean",
@@ -41,7 +43,8 @@
"inlineScam": {
"type": "boolean",
"description": "Create the NgModule in the same file as the Pipe.",
"default": true
"default": true,
"x-priority": "important"
},
"flat": {
"type": "boolean",
@@ -51,7 +54,8 @@
"export": {
"type": "boolean",
"description": "Specifies if the SCAM should be exported from the project's entry point (normally `index.ts`). It only applies to libraries.",
"default": true
"default": true,
"x-priority": "important"
}
},
"required": ["name"],
@@ -6,23 +6,26 @@
"$id": "GeneratorAngularScamToStandalone",
"cli": "nx",
"title": "Convert an Inline SCAM to Standalone Component",
"description": "Convert an Inline SCAM to a Standalone Component.",
"description": "Convert an Inline SCAM to a Standalone Component. _Note: This generator is only supported with Angular versions >= 14.1.0_.",
"type": "object",
"properties": {
"component": {
"type": "string",
"description": "The path to the SCAM component file, relative to the root of the project containing the SCAM.",
"$default": { "$source": "argv", "index": 0 }
"$default": { "$source": "argv", "index": 0 },
"x-priority": "important"
},
"project": {
"type": "string",
"description": "The project containing the SCAM.",
"x-prompt": "What project contains the SCAM?",
"x-dropdown": "projects"
"x-dropdown": "projects",
"x-priority": "important"
},
"skipFormat": {
"type": "boolean",
"description": "Skip formatting the workspace after the generator completes."
"description": "Skip formatting the workspace after the generator completes.",
"x-priority": "internal"
}
},
"examplesFile": "## Examples\n\n{% tabs %}\n\n{% tab label=\"Basic Usage\" %}\n\nThis generator allows you to convert an Inline SCAM to a Standalone Component. It's important that the SCAM you wish to convert has it's NgModule within the same file for the generator to be able to correctly convert the component to Standalone.\n\n```bash\n\nnx g @nrwl/angular:scam-to-standalone --component=libs/mylib/src/lib/myscam/myscam.component.ts --project=mylib\n\n```\n\n{% /tab %}\n\n{% /tabs %}\n",
@@ -25,7 +25,8 @@
"project": {
"type": "string",
"description": "The name of the project.",
"x-dropdown": "projects"
"x-dropdown": "projects",
"x-priority": "important"
},
"name": {
"type": "string",
@@ -78,7 +79,8 @@
"inlineScam": {
"type": "boolean",
"description": "Create the `NgModule` in the same file as the component.",
"default": true
"default": true,
"x-priority": "important"
},
"flat": {
"type": "boolean",
@@ -112,7 +114,8 @@
"export": {
"type": "boolean",
"description": "Specifies if the SCAM should be exported from the project's entry point (normally `index.ts`). It only applies to libraries.",
"default": true
"default": true,
"x-priority": "important"
}
},
"required": ["name"],
@@ -42,16 +42,19 @@
},
"routing": {
"type": "boolean",
"description": "Generate a routing setup to allow a host application to route to the remote application."
"description": "Generate a routing setup to allow a host application to route to the remote application.",
"x-priority": "important"
},
"skipFormat": {
"type": "boolean",
"description": "Skip formatting the workspace after the generator completes."
"description": "Skip formatting the workspace after the generator completes.",
"x-priority": "internal"
},
"skipPackageJson": {
"type": "boolean",
"default": false,
"description": "Do not add dependencies to `package.json`."
"description": "Do not add dependencies to `package.json`.",
"x-priority": "internal"
},
"skipE2E": {
"type": "boolean",
@@ -51,7 +51,8 @@
},
"skipFormat": {
"type": "boolean",
"description": "Skip formatting the workspace after the generator completes."
"description": "Skip formatting the workspace after the generator completes.",
"x-priority": "internal"
}
},
"required": ["project"],
@@ -22,7 +22,8 @@
},
"skipFormat": {
"type": "boolean",
"description": "Skips formatting the workspace after the generator completes."
"description": "Skips formatting the workspace after the generator completes.",
"x-priority": "internal"
},
"stylesEntryPoint": {
"type": "string",
@@ -31,7 +32,8 @@
"skipPackageJson": {
"type": "boolean",
"default": false,
"description": "Do not add dependencies to `package.json`."
"description": "Do not add dependencies to `package.json`.",
"x-priority": "internal"
}
},
"additionalProperties": false,
@@ -15,12 +15,14 @@
"description": "Project for which to generate stories.",
"$default": { "$source": "argv", "index": 0 },
"x-prompt": "What's the name of the project for which you want to generate stories?",
"x-dropdown": "projects"
"x-dropdown": "projects",
"x-priority": "important"
},
"generateCypressSpecs": {
"type": "boolean",
"description": "Specifies whether to automatically generate `*.spec.ts` files in the Cypress e2e app generated by the `cypress-configure` generator.",
"x-prompt": "Do you want to generate Cypress specs as well?"
"x-prompt": "Do you want to generate Cypress specs as well?",
"x-priority": "important"
},
"cypressProject": {
"type": "string",
@@ -29,7 +31,8 @@
"skipFormat": {
"description": "Skip formatting files.",
"type": "boolean",
"default": false
"default": false,
"x-priority": "internal"
},
"ignorePaths": {
"type": "array",
@@ -58,7 +58,8 @@
"skipFormat": {
"description": "Skip formatting files.",
"type": "boolean",
"default": false
"default": false,
"x-priority": "internal"
},
"ignorePaths": {
"type": "array",
@@ -11,12 +11,14 @@
"properties": {
"project": {
"type": "string",
"description": "The name of the project."
"description": "The name of the project.",
"x-priority": "important"
},
"name": {
"type": "string",
"description": "The name of the main AngularJS module.",
"$default": { "$source": "argv", "index": 0 }
"$default": { "$source": "argv", "index": 0 },
"x-priority": "important"
},
"angularJsImport": {
"type": "string",
@@ -29,17 +31,20 @@
"skipFormat": {
"type": "boolean",
"description": "Skip formatting files.",
"default": false
"default": false,
"x-priority": "internal"
},
"skipPackageJson": {
"type": "boolean",
"description": "Do not add `@angular/upgrade` to `package.json` (e.g., `--skipPackageJson`).",
"default": false
"default": false,
"x-priority": "internal"
},
"router": {
"type": "boolean",
"description": "Sets up router synchronization (e.g., `--router`).",
"default": false
"default": false,
"x-priority": "important"
}
},
"additionalProperties": false,
@@ -17,13 +17,15 @@
"project": {
"type": "string",
"description": "The name of the project.",
"x-dropdown": "projects"
"x-dropdown": "projects",
"x-priority": "important"
},
"name": {
"type": "string",
"description": "The name of the worker.",
"$default": { "$source": "argv", "index": 0 },
"x-prompt": "What name would you like to use for the worker?"
"x-prompt": "What name would you like to use for the worker?",
"x-priority": "important"
},
"snippet": {
"type": "boolean",
@@ -33,7 +35,8 @@
"skipFormat": {
"description": "Skip formatting files.",
"type": "boolean",
"default": false
"default": false,
"x-priority": "internal"
}
},
"additionalProperties": false,
@@ -35,7 +35,8 @@
"description": "Specify Detox config file path. If not supplied, detox searches for `.detoxrc[.js]` or `detox` section in package.json.",
"alias": "cp",
"x-completion-type": "file",
"x-completion-glob": ".detoxrc?(.js)"
"x-completion-glob": ".detoxrc?(.js)",
"x-priority": "important"
},
"runnerConfig": {
"type": "string",
@@ -51,7 +51,8 @@
"skipFormat": {
"description": "Skip formatting files.",
"type": "boolean",
"default": false
"default": false,
"x-priority": "internal"
},
"setParserOptionsProject": {
"type": "boolean",
@@ -10,7 +10,8 @@
"skipFormat": {
"description": "Skip formatting files.",
"type": "boolean",
"default": false
"default": false,
"x-priority": "internal"
}
},
"required": [],
@@ -19,7 +19,8 @@
"type": {
"enum": ["app-bundle", "apk"],
"description": "Type of build: [app-bundle⎮apk].",
"alias": "t"
"alias": "t",
"x-priority": "important"
},
"releaseChannel": {
"type": "string",
@@ -48,8 +49,9 @@
},
"sync": {
"type": "boolean",
"description": "Syncs npm dependencies to package.json (for React Native autolink). Always true when --install is used.",
"default": true
"description": "Syncs npm dependencies to package.json (for React Native autolink).",
"default": true,
"x-priority": "internal"
}
},
"required": [],
@@ -44,7 +44,8 @@
"type": {
"enum": ["archive", "simulator"],
"description": "Type of build: [archive⎮simulator].",
"alias": "t"
"alias": "t",
"x-priority": "important"
},
"releaseChannel": {
"type": "string",
@@ -85,8 +86,9 @@
},
"sync": {
"type": "boolean",
"description": "Syncs npm dependencies to package.json (for React Native autolink). Always true when --install is used.",
"default": true
"description": "Syncs npm dependencies to package.json (for React Native autolink).",
"default": true,
"x-priority": "internal"
}
},
"required": [],
@@ -14,7 +14,8 @@
"platform": {
"enum": ["ios", "android", "all"],
"alias": "p",
"description": "The platform to build the app, example values: ios, android, all."
"description": "The platform to build the app, example values: ios, android, all.",
"x-priority": "important"
},
"json": {
"type": "boolean",
@@ -14,7 +14,8 @@
"platform": {
"enum": ["ios", "android", "all"],
"alias": "p",
"description": "The platform to build the app, example values: ios, android, all."
"description": "The platform to build the app, exaple values: ios, android, all.",
"x-priority": "important"
},
"json": {
"type": "boolean",
@@ -24,7 +25,8 @@
"profile": {
"type": "string",
"description": "Name of the build profile from eas.json. Defaults to \"production\" if defined in eas.json.",
"examples": ["PROFILE_NAME"]
"examples": ["production", "development", "preview"],
"x-priority": "important"
},
"nonInteractive": {
"type": "boolean",
@@ -54,7 +56,7 @@
"autoSubmitWithProfile": {
"type": "string",
"description": "Submit on build complete using the submit profile with provided name",
"examples": ["PROFILE_NAME"]
"examples": ["production", "development", "preview"]
}
},
"required": [],
@@ -14,7 +14,8 @@
"platform": {
"enum": ["ios", "android"],
"alias": "p",
"description": "The platform to build the app, example values: ios, android, all."
"description": "The platform to build the app, example values: ios, android, all.",
"x-priority": "important"
},
"distribution": {
"enum": ["store", "internal", "simulator"],
@@ -14,7 +14,8 @@
"platform": {
"description": "Choose the platform to compile for",
"enum": ["ios", "android", "all", "web"],
"alias": "p"
"alias": "p",
"x-priority": "important"
},
"dev": {
"type": "boolean",
@@ -46,7 +47,7 @@
"default": "metro"
}
},
"required": ["bundler"],
"required": [],
"presets": []
},
"description": "Export the JavaScript and assets for your app using Metro/webpack bundler",
@@ -14,13 +14,15 @@
"install": {
"type": "boolean",
"description": "Installing npm packages and CocoaPods.",
"default": false
"default": false,
"x-priority": "internal"
},
"platform": {
"description": "Platforms to sync",
"default": "all",
"enum": ["ios", "android", "all"],
"alias": "p"
"alias": "p",
"x-priority": "important"
},
"template": {
"type": "string",
@@ -32,7 +32,8 @@
"enum": ["managed", "bare"],
"default": "managed",
"description": "Target environment for which this publish is intended. Options are managed or bare.",
"alias": "t"
"alias": "t",
"x-priority": "important"
},
"maxWorkers": {
"type": "number",
@@ -20,7 +20,8 @@
"xcodeConfiguration": {
"type": "string",
"description": "(iOS) Xcode configuration to use. Debug or Release",
"default": "Debug"
"default": "Debug",
"x-priority": "important"
},
"scheme": {
"type": "string",
@@ -29,7 +30,8 @@
"variant": {
"type": "string",
"description": "(Android) Specify your app's build variant (e.g. debug, release).",
"default": "debug"
"default": "debug",
"x-priority": "important"
},
"device": {
"type": "string",
@@ -38,8 +40,9 @@
},
"sync": {
"type": "boolean",
"description": "Syncs npm dependencies to package.json (for React Native autolink). Always true when --install is used.",
"default": true
"description": "Syncs npm dependencies to package.json (for React Native autolink).",
"default": true,
"x-priority": "internal"
},
"port": {
"type": "number",
@@ -35,7 +35,8 @@
"enum": ["ios", "android", "all"],
"alias": "p",
"description": "The platform to build the app, example values: ios, android, all.",
"default": "all"
"default": "all",
"x-priority": "important"
},
"json": {
"type": "boolean",
@@ -8,11 +8,11 @@
"description": "Create an Expo Application for Nx.",
"examples": [
{
"command": "g app myapp --directory=nested",
"command": "g @nrwl/expo:app myapp --directory=nested",
"description": "Generate apps/nested/myapp"
},
{
"command": "g app myapp --classComponent",
"command": "g @nrwl/expo:app myapp --classComponent",
"description": "Use class components instead of functional components"
}
],
@@ -30,12 +30,14 @@
},
"directory": {
"description": "The directory of the new application.",
"type": "string"
"type": "string",
"x-priority": "important"
},
"skipFormat": {
"description": "Skip formatting files",
"type": "boolean",
"default": false
"default": false,
"x-priority": "internal"
},
"linter": {
"description": "The tool to use for running lint checks.",
@@ -9,11 +9,11 @@
"type": "object",
"examples": [
{
"command": "g component my-component --project=mylib",
"command": "g @nrwl/expo:component my-component --project=mylib",
"description": "Generate a component in the mylib library"
},
{
"command": "g component my-component --project=mylib --classComponent",
"command": "g @nrwl/expo:component my-component --project=mylib --classComponent",
"description": "Generate a class component in the mylib library"
}
],
@@ -39,7 +39,8 @@
"skipFormat": {
"description": "Skip formatting files.",
"type": "boolean",
"default": false
"default": false,
"x-priority": "internal"
},
"skipTests": {
"type": "boolean",
@@ -48,7 +49,8 @@
},
"directory": {
"type": "string",
"description": "Create the component under this directory (can be nested)."
"description": "Create the component under this directory (can be nested).",
"x-priority": "important"
},
"flat": {
"type": "boolean",
@@ -17,7 +17,8 @@
"skipFormat": {
"description": "Skip formatting files",
"type": "boolean",
"default": false
"default": false,
"x-priority": "internal"
},
"e2eTestRunner": {
"description": "Adds the specified e2e test runner",
@@ -9,7 +9,7 @@
"type": "object",
"examples": [
{
"command": "g lib mylib --directory=myapp",
"command": "g @nrwl/expo:lib mylib --directory=myapp",
"description": "Generate libs/myapp/mylib"
}
],
@@ -23,7 +23,8 @@
},
"directory": {
"type": "string",
"description": "A directory where the lib is placed."
"description": "A directory where the lib is placed.",
"x-priority": "important"
},
"linter": {
"description": "The tool to use for running lint checks.",
@@ -45,12 +46,14 @@
"skipFormat": {
"description": "Skip formatting files.",
"type": "boolean",
"default": false
"default": false,
"x-priority": "internal"
},
"skipTsConfig": {
"type": "boolean",
"default": false,
"description": "Do not update tsconfig.json for development experience."
"description": "Do not update tsconfig.json for development experience.",
"x-priority": "internal"
},
"pascalCaseFiles": {
"type": "boolean",
@@ -76,11 +79,6 @@
"description": "Generate JavaScript files rather than TypeScript files.",
"default": false
},
"globalCss": {
"type": "boolean",
"description": "When true, the stylesheet is generated using global CSS instead of CSS modules (e.g. file is '*.css' rather than '*.module.css').",
"default": false
},
"strict": {
"type": "boolean",
"description": "Whether to enable tsconfig strict mode or not.",
@@ -21,7 +21,8 @@
"type": "string",
"description": "Specify your app's build variant (e.g. `debug`, `release`).",
"default": "debug",
"examples": ["debug", "release"]
"examples": ["debug", "release"],
"x-priority": "important"
},
"appId": {
"type": "string",
@@ -28,7 +28,8 @@
"type": "string",
"description": "Explicitly set the Xcode configuration to use.",
"default": "Debug",
"examples": ["Debug", "Release"]
"examples": ["Debug", "Release"],
"x-priority": "important"
},
"scheme": {
"type": "string",
@@ -38,21 +39,25 @@
"type": "string",
"description": "Explicitly set simulator to use. Optionally include iOS version between parenthesis at the end to match an exact version: `iPhone X (12.1)`.",
"default": "iPhone 13",
"examples": ["iPhone 13", "iPhone X"]
"examples": ["iPhone 13", "iPhone X"],
"x-priority": "important"
},
"device": {
"type": "string",
"description": "Explicitly set device to use by name. The value is not required if you have a single device connected."
"description": "Explicitly set device to use by name. The value is not required if you have a single device connected.",
"x-priority": "important"
},
"install": {
"type": "boolean",
"description": "Runs `pod install` for native modules before building iOS app.",
"default": true
"default": true,
"x-priority": "internal"
},
"sync": {
"type": "boolean",
"description": "Syncs npm dependencies to `package.json` (for React Native autolink). Always true when `--install` is used.",
"default": true
"default": true,
"x-priority": "internal"
},
"port": {
"type": "number",
@@ -9,11 +9,11 @@
"description": "Create a React Application for Nx.",
"examples": [
{
"command": "nx g app myapp --directory=nested",
"command": "nx g @nrwl/react-native:app myapp --directory=nested",
"description": "Generate `apps/nested/myapp`"
},
{
"command": "nx g app myapp --classComponent",
"command": "nx g @nrwl/react-native:app myapp --classComponent",
"description": "Use class components instead of functional components"
}
],
@@ -36,7 +36,8 @@
"skipFormat": {
"description": "Skip formatting files",
"type": "boolean",
"default": false
"default": false,
"x-priority": "internal"
},
"linter": {
"description": "The tool to use for running lint checks.",
@@ -74,12 +75,14 @@
"install": {
"type": "boolean",
"description": "Runs `pod install` for native modules before building iOS app.",
"default": true
"default": true,
"x-priority": "internal"
},
"skipPackageJson": {
"description": "Do not add dependencies to `package.json`.",
"type": "boolean",
"default": false
"default": false,
"x-priority": "internal"
}
},
"required": [],
@@ -10,11 +10,11 @@
"type": "object",
"examples": [
{
"command": "nx g component my-component --project=mylib",
"command": "nx g @nrwl/react-native:component my-component --project=mylib",
"description": "Generate a component in the `mylib` library"
},
{
"command": "nx g component my-component --project=mylib --classComponent",
"command": "nx g @nrwl/react-native:component my-component --project=mylib --classComponent",
"description": "Generate a class component in the `mylib` library"
}
],
@@ -44,7 +44,8 @@
},
"directory": {
"type": "string",
"description": "Create the component under this directory (can be nested)."
"description": "Create the component under this directory (can be nested).",
"x-priority": "important"
},
"flat": {
"type": "boolean",
@@ -18,7 +18,8 @@
"skipFormat": {
"description": "Skip formatting files.",
"type": "boolean",
"default": false
"default": false,
"x-priority": "internal"
},
"e2eTestRunner": {
"description": "Adds the specified E2E test runner.",
@@ -34,7 +35,8 @@
"skipPackageJson": {
"description": "Do not add dependencies to `package.json`.",
"type": "boolean",
"default": false
"default": false,
"x-priority": "internal"
}
},
"required": [],
@@ -10,7 +10,7 @@
"type": "object",
"examples": [
{
"command": "nx g lib mylib --directory=myapp",
"command": "nx g @nrwl/react-native:lib mylib --directory=myapp",
"description": "Generate `libs/myapp/mylib`"
}
],
@@ -24,7 +24,9 @@
},
"directory": {
"type": "string",
"description": "A directory where the lib is placed."
"description": "A directory where the lib is placed.",
"alias": "dir",
"x-priority": "important"
},
"linter": {
"description": "The tool to use for running lint checks.",
@@ -46,12 +48,14 @@
"skipFormat": {
"description": "Skip formatting files.",
"type": "boolean",
"default": false
"default": false,
"x-priority": "internal"
},
"skipTsConfig": {
"type": "boolean",
"default": false,
"description": "Do not update `tsconfig.json` for development experience."
"description": "Do not update `tsconfig.json` for development experience.",
"x-priority": "internal"
},
"pascalCaseFiles": {
"type": "boolean",
@@ -77,11 +81,6 @@
"description": "Generate JavaScript files rather than TypeScript files.",
"default": false
},
"globalCss": {
"type": "boolean",
"description": "When `true`, the stylesheet is generated using global CSS instead of CSS modules (e.g. file is `*.css` rather than `*.module.css`).",
"default": false
},
"strict": {
"type": "boolean",
"description": "Whether to enable tsconfig strict mode or not.",
@@ -95,7 +94,8 @@
"skipPackageJson": {
"description": "Do not add dependencies to `package.json`.",
"type": "boolean",
"default": false
"default": false,
"x-priority": "internal"
}
},
"required": ["name"],
@@ -21,7 +21,8 @@
"type": "boolean",
"description": "Automatically generate *.stories.ts files for components declared in this project?",
"x-prompt": "Automatically generate *.stories.ts files for components declared in this project?",
"default": true
"default": true,
"x-priority": "important"
},
"js": {
"type": "boolean",
@@ -33,7 +33,8 @@
"install": {
"type": "boolean",
"description": "Runs `pod install` for native modules before building iOS app.",
"default": true
"default": true,
"x-priority": "internal"
}
},
"required": ["name"],
@@ -80,7 +80,8 @@
"unitTestRunner": {
"type": "string",
"enum": ["jest", "vitest", "none"],
"description": "Test runner to use for unit tests."
"description": "Test runner to use for unit tests.",
"x-prompt": "What unit test runner should be used?"
},
"inSourceTests": {
"type": "boolean",
@@ -123,6 +123,7 @@
"examplesFile": "`workspace.json`:\n\n```json\n//...\n\"frontend\": {\n \"targets\": {\n //...\n \"ls-project-root\": {\n \"executor\": \"nx:run-commands\",\n \"options\": {\n \"command\": \"ls apps/frontend/src\"\n }\n }\n }\n}\n```\n\n```bash\nnx run frontend:ls-project-root\n```\n\n##### Chaining commands, interpolating args and setting the cwd\n\nLet's say each of our workspace projects has some custom bash scripts in a `scripts` folder.\nWe want a simple way to create empty bash script files for a given project, that have the execute permissions already set.\n\nGiven that Nx knows our workspace structure, we should be able to give it a project and the name of our script, and it should take care of the rest.\n\nThe `commands` option accepts as many commands as you want. By default, they all run in parallel.\nYou can run them sequentially by setting `parallel: false`:\n\n```json\n\"create-script\": {\n \"executor\": \"nx:run-commands\",\n \"options\": {\n \"commands\": [\n \"mkdir -p scripts\",\n \"touch scripts/{args.name}.sh\",\n \"chmod +x scripts/{args.name}.sh\"\n ],\n \"cwd\": \"apps/frontend\",\n \"parallel\": false\n }\n}\n```\n\nBy setting the `cwd` option, each command will run in the `apps/frontend` folder.\n\nWe run the above with:\n\n```bash\nnx run frontend:create-script --args=\"--name=example\"\n```\n\nor simply with:\n\n```bash\nnx run frontend:create-script --name=example\n```\n\n##### Arguments forwarding\n\nWhen interpolation is not present in the command, all arguments are forwarded to the command by default.\n\nThis is useful when you need to pass raw argument strings to your command.\n\nFor example, when you run:\n\nnx run frontend:webpack --args=\"--config=example.config.js\"\n\n```json\n\"webpack\": {\n \"executor\": \"nx:run-commands\",\n \"options\": {\n \"command\": \"webpack\"\n }\n}\n```\n\nThe above command will execute: `webpack --config=example.config.js`\n\nThis functionality can be disabled by using `commands` and expanding each `command` into an object\nthat sets the `forwardAllArgs` option to `false` as shown below:\n\n```json\n\"webpack\": {\n \"executor\": \"nx:run-commands\",\n \"options\": {\n \"commands\": [\n {\n \"command\": \"webpack\",\n \"forwardAllArgs\": false\n }\n ]\n }\n}\n```\n\n##### Custom **done** conditions\n\nNormally, `run-commands` considers the commands done when all of them have finished running. If you don't need to wait until they're all done, you can set a special string that considers the commands finished the moment the string appears in `stdout` or `stderr`:\n\n```json\n\"finish-when-ready\": {\n \"executor\": \"nx:run-commands\",\n \"options\": {\n \"commands\": [\n \"sleep 5 && echo 'FINISHED'\",\n \"echo 'READY'\"\n ],\n \"readyWhen\": \"READY\",\n \"parallel\": true\n }\n}\n```\n\n```bash\nnx run frontend:finish-when-ready\n```\n\nThe above commands will finish immediately, instead of waiting for 5 seconds.\n\n##### Nx Affected\n\nThe true power of `run-commands` comes from the fact that it runs through `nx`, which knows about your project graph. So you can run **custom commands** only for the projects that have been affected by a change.\n\nWe can create some configurations to generate docs, and if run using `nx affected`, it will only generate documentation for the projects that have been changed:\n\n```bash\nnx affected --target=generate-docs\n```\n\n```json\n//...\n\"frontend\": {\n \"targets\": {\n //...\n \"generate-docs\": {\n \"executor\": \"nx:run-commands\",\n \"options\": {\n \"command\": \"npx compodoc -p apps/frontend/tsconfig.app.json\"\n }\n }\n }\n},\n\"api\": {\n \"targets\": {\n //...\n \"generate-docs\": {\n \"executor\": \"nx:run-commands\",\n \"options\": {\n \"command\": \"npx compodoc -p apps/api/tsconfig.app.json\"\n }\n }\n }\n}\n```\n"
},
"description": "Run any custom commands with Nx.",
"x-deprecated": "Use nx:run-commands instead. This will be removed in v16.",
"aliases": [],
"hidden": false,
"path": "/packages/workspace/src/executors/run-commands/schema.json",
@@ -26,6 +26,7 @@
"presets": []
},
"description": "Run an NPM script using Nx.",
"x-deprecated": "Use nx:run-script instead. This will be removed in v16.",
"aliases": [],
"hidden": false,
"path": "/packages/workspace/src/executors/run-script/schema.json",
@@ -27,7 +27,8 @@
"skipFormat": {
"description": "Skip formatting files.",
"type": "boolean",
"default": false
"default": false,
"x-priority": "internal"
}
},
"presets": []
@@ -24,7 +24,8 @@
},
"directory": {
"type": "string",
"description": "A directory where the lib is placed."
"description": "A directory where the lib is placed.",
"x-priority": "important"
},
"linter": {
"description": "The tool to use for running lint checks.",
@@ -45,7 +46,8 @@
"skipFormat": {
"description": "Skip formatting files.",
"type": "boolean",
"default": false
"default": false,
"x-priority": "internal"
},
"skipTsConfig": {
"type": "boolean",
@@ -60,7 +62,8 @@
},
"importPath": {
"type": "string",
"description": "The library name used to import it, like `@myorg/my-awesome-lib`."
"description": "The library name used to import it, like `@myorg/my-awesome-lib`.",
"x-priority": "important"
},
"babelJest": {
"type": "boolean",
@@ -100,7 +103,8 @@
},
"standaloneConfig": {
"description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`.",
"type": "boolean"
"type": "boolean",
"x-priority": "internal"
}
},
"required": ["name"],
@@ -39,7 +39,8 @@
"type": "boolean",
"aliases": ["skip-format"],
"description": "Skip formatting files.",
"default": false
"default": false,
"x-priority": "internal"
}
},
"required": ["projectName", "destination"],
@@ -35,7 +35,8 @@
"type": "boolean",
"aliases": ["skip-format"],
"description": "Skip formatting files.",
"default": false
"default": false,
"x-priority": "internal"
},
"importPath": {
"type": "string",
@@ -24,7 +24,8 @@
"project": {
"description": "Project name.",
"type": "string",
"x-prompt": "What project does the target belong to?"
"x-prompt": "What project does the target belong to?",
"x-dropdown": "projects"
},
"command": {
"description": "Command to run.",
@@ -17,10 +17,11 @@
"skipFormat": {
"description": "Skip formatting files.",
"type": "boolean",
"default": false
"default": false,
"x-priority": "internal"
}
},
"required": [],
"required": ["name"],
"presets": []
},
"aliases": ["workspace-schematic"],
+2 -1
View File
@@ -16,7 +16,8 @@ import {
} from '@nrwl/e2e/utils';
import { PackageManager } from 'nx/src/utils/package-manager';
describe('convert Angular CLI workspace to an Nx workspace', () => {
// TODO(leo): temporarily disabled until a bug in the Angular CLI is solved
xdescribe('convert Angular CLI workspace to an Nx workspace', () => {
let project: string;
let packageManager: PackageManager;
+5 -35
View File
@@ -34,44 +34,14 @@ describe('using Nx executors and generators with Angular CLI', () => {
});
it('should convert Nx executors into Angular CLI compatible builders', () => {
// update package.json
const packageJson = readJson('package.json');
packageJson.description = 'some description';
updateFile('package.json', JSON.stringify(packageJson, null, 2));
// use vite to build a library
packageInstall('vite', undefined, 'latest');
packageInstall('@nrwl/vite');
packageInstall('@nrwl/angular');
const angularJson = readJson('angular.json');
angularJson.projects[project].architect.build = {
builder: '@nrwl/vite:build',
options: {
configFile: 'vite.config.ts',
outputPath: 'dist',
},
};
angularJson.projects[project].architect.build.builder =
'@nrwl/angular:webpack-browser';
updateFile('angular.json', JSON.stringify(angularJson, null, 2));
updateFile(
'vite.config.ts',
`
import { defineConfig } from 'vite';
export default defineConfig({
build: {
lib: {
entry: 'src/main.ts',
name: 'my-app',
fileName: 'main',
formats: ['cjs']
}
}
});
`
);
updateFile(`src/main.ts`, `console.log('Hello World');`);
runCommand(`npx ng build ${project}`);
runCommand(`npx ng build ${project} --configuration=development`);
checkFilesExist(`dist/main.js`);
expect(runCommand(`node dist/main.js`)).toMatch(/Hello World/);
checkFilesExist(`dist/${project}/main.js`);
});
});
+1 -1
View File
@@ -4,7 +4,7 @@
"sourceRoot": "e2e/detox",
"projectType": "application",
"targets": {
"e2e": {},
"e2e-macos": {},
"run-e2e-tests": {}
},
"implicitDependencies": ["detox"]
+11
View File
@@ -0,0 +1,11 @@
/* eslint-disable */
export default {
transform: {
'^.+\\.[tj]sx?$': 'ts-jest',
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
maxWorkers: 1,
globals: { 'ts-jest': { tsconfig: '<rootDir>/tsconfig.spec.json' } },
displayName: 'e2e-lerna-smoke-tests',
preset: '../../jest.preset.js',
};
+11
View File
@@ -0,0 +1,11 @@
{
"name": "e2e-lerna-smoke-tests",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "e2e/lerna-smoke-tests",
"projectType": "application",
"targets": {
"e2e": {},
"run-e2e-tests": {}
},
"implicitDependencies": ["nx", "devkit"]
}
@@ -0,0 +1,79 @@
/**
* These minimal smoke tests are here to ensure that we do not break assumptions on the lerna side
* when making updates to nx or @nrwl/devkit.
*/
import {
cleanupLernaWorkspace,
newLernaWorkspace,
runLernaCLI,
tmpProjPath,
updateJson,
} from '@nrwl/e2e/utils';
expect.addSnapshotSerializer({
serialize(str: string) {
return (
str
// Not all package managers print the package.json path in the output
.replace(tmpProjPath(), '')
.replace('/private', '')
.replace('/packages/package-1', '')
// We trim each line to reduce the chances of snapshot flakiness
.split('\n')
.map((r) => r.trim())
.join('\n')
);
},
test(val: string) {
return val != null && typeof val === 'string';
},
});
describe('Lerna Smoke Tests', () => {
beforeAll(() => newLernaWorkspace());
afterAll(() => cleanupLernaWorkspace());
// `lerna repair` builds on top of `nx repair` and runs all of its generators
describe('lerna repair', () => {
// If this snapshot fails it means that nx repair generators are making assumptions which don't hold true for lerna workspaces
it('should complete successfully on a new lerna workspace', async () => {
expect(runLernaCLI(`repair`)).toMatchInlineSnapshot(`
> Lerna No changes were necessary. This workspace is up to date!
`);
}, 1000000);
});
// `lerna run` delegates to the nx task runner behind the scenes
describe('lerna run', () => {
it('should complete successfully on a new lerna workspace', async () => {
runLernaCLI('create package-1 -y');
updateJson('packages/package-1/package.json', (json) => ({
...json,
scripts: {
...(json.scripts || {}),
'print-name': 'echo test-package-1',
},
}));
expect(runLernaCLI(`run print-name`)).toMatchInlineSnapshot(`
> package-1:print-name
> package-1@0.0.0 print-name
> echo test-package-1
test-package-1
> Lerna (powered by Nx) Successfully ran target print-name for project package-1
`);
}, 1000000);
});
});
+13
View File
@@ -0,0 +1,13 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"types": ["node", "jest"]
},
"include": [],
"files": [],
"references": [
{
"path": "./tsconfig.spec.json"
}
]
}
+20
View File
@@ -0,0 +1,20 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"module": "commonjs",
"types": ["jest", "node"]
},
"include": [
"**/*.test.ts",
"**/*.spec.ts",
"**/*.spec.tsx",
"**/*.test.tsx",
"**/*.spec.js",
"**/*.test.js",
"**/*.spec.jsx",
"**/*.test.jsx",
"**/*.d.ts",
"jest.config.ts"
]
}
+20 -3
View File
@@ -1,8 +1,8 @@
import {
checkFilesDoNotExist,
checkFilesExist,
cleanupProject,
newProject,
readFile,
runCLI,
runCLIAsync,
tmpProjPath,
@@ -10,6 +10,7 @@ import {
updateFile,
} from '@nrwl/e2e/utils';
import { execSync } from 'child_process';
import { read } from 'fs-extra';
describe('Node Applications + webpack', () => {
beforeEach(() => newProject());
@@ -23,13 +24,29 @@ describe('Node Applications + webpack', () => {
checkFilesExist(`apps/${app}/webpack.config.js`);
updateFile(`apps/${app}/src/main.ts`, `console.log('Hello World!');`);
updateFile(
`apps/${app}/src/main.ts`,
`
function foo(x: string) {
return "foo " + x;
};
console.log(foo("bar"));
`
);
await runCLIAsync(`build ${app}`);
checkFilesExist(`dist/apps/${app}/main.js`);
// no optimization by default
const content = readFile(`dist/apps/${app}/main.js`);
expect(content).toContain('console.log(foo("bar"))');
const result = execSync(`node dist/apps/${app}/main.js`, {
cwd: tmpProjPath(),
}).toString();
expect(result).toMatch(/Hello World!/);
expect(result).toMatch(/foo bar/);
await runCLIAsync(`build ${app} --optimization`);
const optimizedContent = readFile(`dist/apps/${app}/main.js`);
expect(optimizedContent).toContain('console.log("foo "+"bar")');
}, 300_000);
});
+1 -1
View File
@@ -4,7 +4,7 @@
"sourceRoot": "e2e/react-native",
"projectType": "application",
"targets": {
"e2e": {},
"e2e-macos": {},
"run-e2e-tests": {}
},
"implicitDependencies": ["react-native"]
+157 -2
View File
@@ -7,6 +7,7 @@ import {
workspaceRoot,
} from '@nrwl/devkit';
import { angularCliVersion } from '@nrwl/workspace/src/utils/versions';
import { dump } from '@zkochan/js-yaml';
import { ChildProcess, exec, execSync, ExecSyncOptions } from 'child_process';
import {
copySync,
@@ -46,7 +47,8 @@ export function getPublishedVersion(): string {
export function detectPackageManager(dir: string = ''): PackageManager {
return existsSync(join(dir, 'yarn.lock'))
? 'yarn'
: existsSync(join(dir, 'pnpm-lock.yaml'))
: existsSync(join(dir, 'pnpm-lock.yaml')) ||
existsSync(join(dir, 'pnpm-workspace.yaml'))
? 'pnpm'
: 'npm';
}
@@ -374,6 +376,106 @@ export function newProject({
}
}
export function newLernaWorkspace({
name = uniq('lerna-proj'),
packageManager = getSelectedPackageManager(),
} = {}): string {
try {
const projScope = name;
projName = name;
const pm = getPackageManagerCommand({ packageManager });
createNonNxProjectDirectory(projScope, packageManager !== 'pnpm');
if (packageManager === 'pnpm') {
updateFile(
'pnpm-workspace.yaml',
dump({
packages: ['packages/*'],
})
);
updateFile(
'.npmrc',
'prefer-frozen-lockfile=false\nstrict-peer-dependencies=false\nauto-install-peers=true'
);
}
if (process.env.NX_VERBOSE_LOGGING == 'true') {
logInfo(`NX`, `E2E test has created a lerna workspace: ${tmpProjPath()}`);
}
// We need to force the real latest version of lerna to depend on our locally published version of nx
updateJson(`package.json`, (json) => {
// yarn workspaces can only be enabled in private projects
json.private = true;
const nxVersion = getPublishedVersion();
const overrides = {
...json.overrides,
nx: nxVersion,
'@nrwl/devkit': nxVersion,
};
if (packageManager === 'pnpm') {
json.pnpm = {
...json.pnpm,
overrides: {
...json.pnpm?.overrides,
...overrides,
},
};
} else if (packageManager === 'yarn') {
json.resolutions = {
...json.resolutions,
...overrides,
};
} else {
json.overrides = overrides;
}
return json;
});
/**
* Again, in order to ensure we override the required version relationships, we first install lerna as a devDep
* before running `lerna init`.
*/
execSync(
`${pm.addDev} lerna@${getLatestLernaVersion()}${
packageManager === 'pnpm'
? ' --workspace-root'
: packageManager === 'yarn'
? ' -W'
: ''
}`,
{
cwd: tmpProjPath(),
stdio: isVerbose() ? 'inherit' : 'pipe',
env: { CI: 'true', ...process.env },
encoding: 'utf-8',
}
);
execSync(`${pm.runLerna} init`, {
cwd: tmpProjPath(),
stdio: isVerbose() ? 'inherit' : 'pipe',
env: { CI: 'true', ...process.env },
encoding: 'utf-8',
});
execSync(pm.install, {
cwd: tmpProjPath(),
stdio: isVerbose() ? 'inherit' : 'pipe',
env: { CI: 'true', ...process.env },
encoding: 'utf-8',
});
return projScope;
} catch (e) {
logError(`Failed to set up lerna workspace for e2e tests.`, e.message);
throw e;
}
}
const KILL_PORT_DELAY = 5000;
export async function killPort(port: number): Promise<boolean> {
@@ -416,6 +518,14 @@ export async function cleanupProject(opts?: RunCmdOpts) {
}
}
export function cleanupLernaWorkspace() {
if (isCI) {
try {
removeSync(tmpProjPath());
} catch (e) {}
}
}
export function runCypressTests() {
if (process.env.NX_E2E_RUN_CYPRESS === 'true') {
ensureCypressInstallation();
@@ -476,7 +586,7 @@ export function runCommandAsync(
exec(
command,
{
cwd: tmpProjPath(),
cwd: opts.cwd || tmpProjPath(),
env: {
CI: 'true',
...(opts.env || getStrippedEnvironmentVariables()),
@@ -629,6 +739,42 @@ export function runCLI(
}
}
export function runLernaCLI(
command: string,
opts: RunCmdOpts = {
silenceError: false,
env: undefined,
}
): string {
try {
const pm = getPackageManagerCommand();
const logs = execSync(`${pm.runLerna} ${command}`, {
cwd: opts.cwd || tmpProjPath(),
env: { CI: 'true', ...(opts.env || getStrippedEnvironmentVariables()) },
encoding: 'utf-8',
stdio: 'pipe',
maxBuffer: 50 * 1024 * 1024,
});
const r = stripConsoleColors(logs);
if (isVerbose()) {
console.log(logs);
}
return r;
} catch (e) {
if (opts.silenceError) {
return stripConsoleColors(e.stdout?.toString() + e.stderr?.toString());
} else {
logError(
`Original command: ${command}`,
`${e.stdout?.toString()}\n\n${e.stderr?.toString()}`
);
throw e;
}
}
}
/**
* Remove log colors for fail proof string search
* @param log
@@ -882,6 +1028,7 @@ export function getPackageManagerCommand({
addProd: string;
addDev: string;
list: string;
runLerna: string;
} {
const npmMajorVersion = getNpmMajorVersion();
const publishedVersion = getPublishedVersion();
@@ -899,6 +1046,7 @@ export function getPackageManagerCommand({
addProd: `npm install --legacy-peer-deps`,
addDev: `npm install --legacy-peer-deps -D`,
list: 'npm ls --depth 10',
runLerna: `npx lerna`,
},
yarn: {
// `yarn create nx-workspace` is failing due to wrong global path
@@ -911,6 +1059,7 @@ export function getPackageManagerCommand({
addProd: `yarn add`,
addDev: `yarn add -D`,
list: 'npm ls --depth 10',
runLerna: `yarn lerna`,
},
// Pnpm 3.5+ adds nx to
pnpm: {
@@ -923,6 +1072,7 @@ export function getPackageManagerCommand({
addProd: `pnpm add`,
addDev: `pnpm add -D`,
list: 'npm ls --depth 10',
runLerna: `pnpm exec lerna`,
},
}[packageManager.trim() as PackageManager];
}
@@ -932,6 +1082,11 @@ function getNpmMajorVersion(): string {
return npmMajorVersion;
}
function getLatestLernaVersion(): string {
const lernaVersion = execSync(`npm view lerna version`).toString().trim();
return lernaVersion;
}
export const packageManagerLockFile = {
npm: 'package-lock.json',
yarn: 'yarn.lock',
+10 -1
View File
@@ -205,12 +205,21 @@ describe('Vite Plugin', () => {
expect(result.combinedOutput).toContain(
`Successfully ran target test for project ${lib}`
);
// TODO(caleb): run tests from project root and make sure they still work
const nestedResults = await runCLIAsync(`test ${lib} --skip-nx-cache`, {
cwd: `${tmpProjPath()}/libs/${lib}`,
});
expect(nestedResults.combinedOutput).toContain(
`Successfully ran target test for project ${lib}`
);
}, 100_000);
it('should collect coverage', () => {
runCLI(`generate @nrwl/react:lib ${lib} --unitTestRunner=vitest`);
updateFile(`libs/${lib}/vite.config.ts`, () => {
return `import { defineConfig } from 'vite';
return `/// <reference types="vitest" />
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import viteTsConfigPaths from 'vite-tsconfig-paths';
+23
View File
@@ -0,0 +1,23 @@
import {
cleanupProject,
newProject,
runCLI,
runCommandUntil,
uniq,
} from '@nrwl/e2e/utils';
describe('Web Components Applications with bundler set as webpack', () => {
beforeEach(() => newProject());
afterEach(() => cleanupProject());
it('should support https for dev-server', async () => {
const appName = uniq('app');
runCLI(
`generate @nrwl/web:app ${appName} --bundler=webpack --no-interactive`
);
await runCommandUntil(`serve ${appName} --port=5000 --ssl`, (output) => {
return output.includes('listening at https://localhost:5000');
});
}, 300_000);
});
+1 -1
View File
@@ -1,6 +1,6 @@
{
"packages": ["build/packages/*"],
"version": "15.5.1",
"version": "15.5.3",
"granularPathspec": false,
"command": {
"publish": {
@@ -104,6 +104,15 @@ export function Content({
>
{schemaViewModel.type}
</div>
{schemaViewModel.deprecated && (
<div
aria-hidden="true"
data-tooltip="Deprecated"
className="relative inline-flex rounded-md border border-red-100 bg-red-50 px-4 py-2 text-xs font-medium uppercase text-red-600 dark:border-red-900 dark:bg-red-900/30 dark:text-red-400"
>
Deprecated
</div>
)}
{schemaViewModel.hidden && (
<div
aria-hidden="true"
@@ -144,6 +153,27 @@ export function Content({
</div>
</div>
{schemaViewModel.deprecated && (
<div className="my-6 block rounded-md bg-red-50 p-4 ring-1 ring-red-100 dark:bg-red-900/30 dark:ring-red-900">
<div className="flex">
<div className="flex-shrink-0">
<HandRaisedIcon
className="h-5 w-5 text-red-500"
aria-hidden="true"
/>
</div>
<div className="ml-3">
<div className="mt-0 block text-sm font-medium text-red-600 dark:text-red-400">
Deprecated
</div>
<p className="prose-sm mt-2 block text-red-700 dark:text-red-600">
{schemaViewModel.deprecated}
</p>
</div>
</div>
</div>
)}
{!schemaViewModel.subReference && schemaViewModel.hidden && (
<div className="my-6 block rounded-md bg-red-50 p-4 ring-1 ring-red-100 dark:bg-red-900/30 dark:ring-red-900">
<div className="flex">
@@ -19,6 +19,7 @@ function getReferenceFromQuery(query: string): string {
export interface SchemaViewModel {
currentSchema: NxSchema | null;
currentSchemaExamples: Example | Errors;
deprecated: string;
hidden: boolean;
lookup: Lookup;
packageName: string;
@@ -63,6 +64,7 @@ export function getSchemaViewModel(
);
},
hidden: schema.hidden,
deprecated: schema['x-deprecated'],
type: schema.type,
};
}
@@ -76,6 +76,8 @@ export interface SchemaMetadata {
path: string;
schema: NxSchema | null;
type: 'executor' | 'generator';
'x-deprecated'?: string;
}
export interface NxSchema extends JsonSchema1 {
+33
View File
@@ -95,6 +95,39 @@
{
"env": "SELECTED_CLI"
},
{
"env": "SELECTED_PM"
},
{
"env": "NX_E2E_CI_CACHE_KEY"
}
],
"options": {
"commands": [
{
"command": "yarn e2e-start-local-registry"
},
{
"command": "yarn e2e-build-package-publish"
},
{
"command": "nx run-e2e-tests {projectName}"
}
],
"parallel": false
}
},
"e2e-macos": {
"executor": "nx:run-commands",
"inputs": [
"default",
"^production",
{
"env": "SELECTED_CLI"
},
{
"env": "SELECTED_PM"
},
{
"env": "NX_E2E_CI_CACHE_KEY"
}
+5 -6
View File
@@ -22,7 +22,7 @@
"submit-plugin": "node ./scripts/submit-plugin.js",
"prepare": "is-ci || husky install",
"echo": "echo 123458",
"root-lint": "nx workspace-lint"
"lint": "nx workspace-lint"
},
"devDependencies": {
"@angular-devkit/architect": "~0.1501.0",
@@ -53,7 +53,7 @@
"@ngrx/effects": "~15.0.0",
"@ngrx/router-store": "~15.0.0",
"@ngrx/store": "~15.0.0",
"@nguniversal/builders": "~15.0.0",
"@nguniversal/builders": "~15.1.0",
"@nrwl/cypress": "15.5.0-beta.1",
"@nrwl/devkit": "15.5.0-beta.1",
"@nrwl/eslint-plugin-nx": "15.5.0-beta.1",
@@ -122,9 +122,9 @@
"ajv": "^8.11.0",
"autoprefixer": "10.4.13",
"babel-jest": "28.1.3",
"babel-loader": "^8.2.2",
"babel-loader": "^9.1.2",
"browserslist": "^4.21.4",
"chalk": "4.1.0",
"chalk": "^4.1.0",
"chokidar": "^3.5.1",
"confusing-browser-globals": "^1.0.9",
"conventional-changelog-cli": "^2.0.23",
@@ -310,8 +310,7 @@
"resolutions": {
"**/xmlhttprequest-ssl": "~1.6.2",
"minimist": "^1.2.6",
"underscore": "^1.12.1",
"@nguniversal/builders/@angular-devkit/architect": "~0.1501.0"
"underscore": "^1.12.1"
},
"nx": {
"includedScripts": [
+13
View File
@@ -1757,6 +1757,19 @@
"alwaysAddToPackageJson": false
}
}
},
"15.5.2": {
"version": "15.5.2-beta.0",
"packages": {
"@nguniversal/builders": {
"version": "~15.1.0",
"alwaysAddToPackageJson": false
},
"@nguniversal/express-engine": {
"version": "~15.1.0",
"alwaysAddToPackageJson": false
}
}
}
}
}
+10 -2
View File
@@ -40,7 +40,6 @@
},
"dependencies": {
"@angular-devkit/schematics": "~15.1.0",
"@nguniversal/builders": "~15.0.0",
"@nrwl/cypress": "file:../cypress",
"@nrwl/devkit": "file:../devkit",
"@nrwl/jest": "file:../jest",
@@ -49,7 +48,7 @@
"@nrwl/workspace": "file:../workspace",
"@phenomnomnominal/tsquery": "4.1.1",
"@schematics/angular": "~15.1.0",
"chalk": "4.1.0",
"chalk": "^4.1.0",
"chokidar": "^3.5.1",
"http-server": "^14.1.0",
"ignore": "^5.0.4",
@@ -61,6 +60,15 @@
"webpack": "^5.75.0",
"webpack-merge": "5.7.3"
},
"peerDependencies": {
"@nguniversal/builders": "~15.1.0",
"rxjs": "^6.5.3 || ^7.5.0"
},
"peerDependenciesMeta": {
"@nguniversal/builders": {
"optional": true
}
},
"publishConfig": {
"access": "public"
}
@@ -14,15 +14,13 @@ import type { Schema } from './schema';
import { createTmpTsConfigForBuildableLibs } from '../utilities/buildable-libs';
import { from } from 'rxjs';
import { switchMap } from 'rxjs/operators';
import { getRootTsConfigPath } from 'nx/src/utils/typescript';
export function executeWebpackDevServerBuilder(
rawOptions: Schema,
context: import('@angular-devkit/architect').BuilderContext
) {
process.env.NX_TSCONFIG_PATH = joinPathFragments(
context.workspaceRoot,
'tsconfig.base.json'
);
process.env.NX_TSCONFIG_PATH = getRootTsConfigPath();
const options = normalizeOptions(rawOptions);
@@ -122,34 +122,31 @@ async function copyAssets(
const assets: AssetEntry[] = [];
for (const item of ngPackage.assets) {
const asset: Partial<AssetEntry> = {};
if (typeof item == 'object') {
asset.glob = item.glob;
asset.input = path.join(ngPackage.src, item.input);
asset.output = path.join(ngPackage.dest, item.output);
asset.ignore = item.ignore;
for (const assetPath of ngPackage.assets) {
let asset: AssetEntry;
if (typeof assetPath === 'object') {
asset = { ...assetPath };
} else {
const assetPath = item; // might be a glob
const assetFullPath = path.join(ngPackage.src, assetPath);
const [isDir, isFile] = await stat(assetFullPath)
const [isDir, isFile] = await stat(path.join(ngPackage.src, assetPath))
.then((stats) => [stats.isDirectory(), stats.isFile()])
.catch(() => [false, false]);
if (isDir) {
asset.glob = '**/*';
asset.input = assetFullPath;
asset.output = path.join(ngPackage.dest, assetPath);
asset = { glob: '**/*', input: assetPath, output: assetPath };
} else if (isFile) {
asset.glob = path.basename(assetFullPath); // filenames are their own glob
asset.input = path.dirname(assetFullPath);
asset.output = path.dirname(path.join(ngPackage.dest, assetPath));
// filenames are their own glob
asset = {
glob: path.basename(assetPath),
input: path.dirname(assetPath),
output: path.dirname(assetPath),
};
} else {
asset.glob = assetPath;
asset.input = ngPackage.src;
asset.output = ngPackage.dest;
asset = { glob: assetPath, input: '/', output: '/' };
}
}
asset.input = path.join(ngPackage.src, asset.input);
asset.output = path.join(ngPackage.dest, asset.output);
const isAncestorPath = (target: string, datum: string) =>
path.relative(datum, target).startsWith('..');
if (isAncestorPath(asset.input, ngPackage.src)) {
@@ -163,7 +160,7 @@ async function copyAssets(
);
}
assets.push(asset as AssetEntry);
assets.push(asset);
}
for (const asset of assets) {
@@ -14,7 +14,9 @@ import { EntryPointNode, fileUrl } from 'ng-packagr/lib/ng-package/nodes';
import { ensureUnixPath } from 'ng-packagr/lib/utils/path';
import { NgPackageConfig } from 'ng-packagr/ng-package.schema';
import * as path from 'path';
import { gte } from 'semver';
import * as ts from 'typescript';
import { getInstalledPackageVersionInfo } from '../../../utilities/angular-version-utils';
import { StylesheetProcessor } from '../styles/stylesheet-processor';
export function cacheCompilerHost(
@@ -27,6 +29,8 @@ export function cacheCompilerHost(
sourcesFileCache: FileCache = entryPoint.cache.sourcesFileCache
): CompilerHost {
const compilerHost = ts.createIncrementalCompilerHost(compilerOptions);
const { version: ngPackagrVersion } =
getInstalledPackageVersionInfo('ng-packagr');
const getNode = (fileName: string) => {
const nodeUri = fileUrl(ensureUnixPath(fileName));
@@ -114,10 +118,30 @@ export function cacheCompilerHost(
fileName = fileName.replace(/\.js(\.map)?$/, '.mjs$1');
const outputCache = entryPoint.cache.outputCache;
outputCache.set(fileName, {
content: data,
version: createHash('sha256').update(data).digest('hex'),
});
// added in https://github.com/ng-packagr/ng-packagr/pull/2502, first released in 15.0.2
if (gte(ngPackagrVersion, '15.0.2')) {
// Extract inline sourcemap which will later be used by rollup.
const version = createHash('sha256').update(data).digest('hex');
let map = undefined;
if (fileName.endsWith('.mjs')) {
const cachedData = outputCache.get(fileName);
map =
cachedData?.version === version
? cachedData.map
: require('convert-source-map').fromComment(data).toJSON();
}
outputCache.set(fileName, {
content: data,
version,
map,
});
} else {
outputCache.set(fileName, {
content: data,
version: createHash('sha256').update(data).digest('hex'),
});
}
}
compilerHost.writeFile.call(
@@ -1,13 +1,19 @@
import { readModulePackageJson } from 'nx/src/utils/package-json';
import { major } from 'semver';
type AngularVersionInfo = { major: number; version: string };
type VersionInfo = { major: number; version: string };
export function getInstalledAngularVersionInfo(): AngularVersionInfo | null {
export function getInstalledAngularVersionInfo(): VersionInfo | null {
return getInstalledPackageVersionInfo('@angular/core');
}
export function getInstalledPackageVersionInfo(
pkgName: string
): VersionInfo | null {
try {
const {
packageJson: { version },
} = readModulePackageJson('@angular/core');
} = readModulePackageJson(pkgName);
return { major: major(version), version };
} catch {
@@ -8,7 +8,7 @@ import { Linter, lintProjectGenerator } from '@nrwl/linter';
import { mapLintPattern } from '@nrwl/linter/src/generators/lint-project/lint-project';
import { runTasksInSerial } from '@nrwl/workspace/src/utilities/run-tasks-in-serial';
import { join } from 'path';
import { getGeneratorDirectoryForInstalledAngularVersion } from '../utils/angular-version-utils';
import { getGeneratorDirectoryForInstalledAngularVersion } from '../utils/version-utils';
import { addAngularEsLintDependencies } from './lib/add-angular-eslint-dependencies';
import { extendAngularEslintJson } from './lib/create-eslint-configuration';
import type { AddLintingGeneratorSchema } from './schema';
@@ -1,17 +1,18 @@
import type { GeneratorCallback, Tree } from '@nrwl/devkit';
import { addDependenciesToPackageJson } from '@nrwl/devkit';
import { versions } from '../../../../utils/versions';
import { backwardCompatibleVersions } from '../../../../utils/backward-compatible-versions';
export function addAngularEsLintDependencies(tree: Tree): GeneratorCallback {
return addDependenciesToPackageJson(
tree,
{},
{
'@angular-eslint/eslint-plugin': versions.angularV14.angularEslintVersion,
'@angular-eslint/eslint-plugin':
backwardCompatibleVersions.angularV14.angularEslintVersion,
'@angular-eslint/eslint-plugin-template':
versions.angularV14.angularEslintVersion,
backwardCompatibleVersions.angularV14.angularEslintVersion,
'@angular-eslint/template-parser':
versions.angularV14.angularEslintVersion,
backwardCompatibleVersions.angularV14.angularEslintVersion,
}
);
}
@@ -15,15 +15,18 @@
"prefix": {
"type": "string",
"format": "html-selector",
"description": "The prefix to apply to generated selectors."
"description": "The prefix to apply to generated selectors.",
"x-priority": "important"
},
"projectName": {
"type": "string",
"description": "The name of the project."
"description": "The name of the project.",
"x-priority": "important"
},
"projectRoot": {
"type": "string",
"description": "The path to the root of the selected project."
"description": "The path to the root of the selected project.",
"x-priority": "important"
},
"setParserOptionsProject": {
"type": "boolean",
@@ -33,12 +36,14 @@
"skipFormat": {
"type": "boolean",
"description": "Skip formatting files.",
"default": false
"default": false,
"x-priority": "internal"
},
"skipPackageJson": {
"type": "boolean",
"default": false,
"description": "Do not add dependencies to `package.json`."
"description": "Do not add dependencies to `package.json`.",
"x-priority": "internal"
}
},
"additionalProperties": false,
@@ -134,4 +134,8 @@ function updateAppAndE2EProjectConfigurations(
removeProjectConfiguration(host, options.e2eProjectName);
}
}
// delete some default test configs
host.delete(`${options.appProjectRoot}/karma.conf.js`);
host.delete(`${options.appProjectRoot}/src/test.ts`);
}
@@ -7,6 +7,7 @@ import {
readJson,
readNxJson,
readProjectConfiguration,
stripIndents,
updateJson,
} from '@nrwl/devkit';
import {
@@ -1069,6 +1070,26 @@ describe('app', () => {
expect(project.targets.build.options['outputPath']).toBe('dist/my-app');
});
});
it('should error correctly when Angular version does not support standalone', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
updateJson(tree, 'package.json', (json) => ({
...json,
dependencies: {
'@angular/core': '14.0.0',
},
}));
// ACT & ASSERT
await expect(
generateApp(tree, 'my-app', {
standalone: true,
})
).rejects
.toThrow(stripIndents`The "standalone" option is only supported in Angular >= 14.1.0. You are currently using 14.0.0.
You can resolve this error by removing the "standalone" option or by migrating to Angular 14.1.0.`);
});
});
async function generateApp(
@@ -3,6 +3,7 @@ import {
installPackagesTask,
moveFilesToNewDirectory,
readNxJson,
stripIndents,
Tree,
updateNxJson,
} from '@nrwl/devkit';
@@ -12,7 +13,10 @@ import { join } from 'path';
import { UnitTestRunner } from '../../utils/test-runners';
import { angularInitGenerator } from '../init/init';
import { setupTailwindGenerator } from '../setup-tailwind/setup-tailwind';
import { getGeneratorDirectoryForInstalledAngularVersion } from '../utils/angular-version-utils';
import {
getGeneratorDirectoryForInstalledAngularVersion,
getInstalledAngularVersionInfo,
} from '../utils/version-utils';
import {
addE2e,
addLinting,
@@ -31,19 +35,26 @@ import {
updateNxComponentTemplate,
} from './lib';
import type { Schema } from './schema';
import { lt } from 'semver';
export async function applicationGenerator(
tree: Tree,
schema: Partial<Schema>
) {
const installedAngularVersionInfo = getInstalledAngularVersionInfo(tree);
if (lt(installedAngularVersionInfo.version, '14.1.0') && schema.standalone) {
throw new Error(stripIndents`The "standalone" option is only supported in Angular >= 14.1.0. You are currently using ${installedAngularVersionInfo.version}.
You can resolve this error by removing the "standalone" option or by migrating to Angular 14.1.0.`);
}
const generatorDirectory =
getGeneratorDirectoryForInstalledAngularVersion(tree);
if (generatorDirectory) {
let previousGenerator = await import(
join(__dirname, generatorDirectory, 'application')
);
await previousGenerator.default(tree, schema);
return;
return await previousGenerator.default(tree, schema);
}
const options = normalizeOptions(tree, schema);
@@ -18,7 +18,8 @@
},
"directory": {
"description": "The directory of the new application.",
"type": "string"
"type": "string",
"x-priority": "important"
},
"style": {
"description": "The file extension to be used for style files.",
@@ -52,7 +53,8 @@
"type": "boolean",
"description": "Generate a routing module.",
"default": false,
"x-prompt": "Would you like to configure routing for this application?"
"x-prompt": "Would you like to configure routing for this application?",
"x-priority": "important"
},
"inlineStyle": {
"description": "Specifies if the style will be in the ts file.",
@@ -86,12 +88,14 @@
"skipFormat": {
"description": "Skip formatting files.",
"type": "boolean",
"default": false
"default": false,
"x-priority": "internal"
},
"skipPackageJson": {
"type": "boolean",
"default": false,
"description": "Do not add dependencies to `package.json`."
"description": "Do not add dependencies to `package.json`.",
"x-priority": "internal"
},
"unitTestRunner": {
"type": "string",
@@ -126,7 +130,8 @@
},
"standaloneConfig": {
"description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`.",
"type": "boolean"
"type": "boolean",
"x-priority": "internal"
},
"port": {
"type": "number",
@@ -143,7 +148,7 @@
"default": false
},
"standalone": {
"description": "Generate an application that is setup to use standalone components.",
"description": "Generate an application that is setup to use standalone components. _Note: This is only supported in Angular versions >= 14.1.0_",
"type": "boolean",
"default": false
},
@@ -151,7 +156,8 @@
"description": "Create an application at the root of the workspace.",
"type": "boolean",
"default": false,
"hidden": true
"hidden": true,
"x-priority": "internal"
}
},
"additionalProperties": false,

Some files were not shown because too many files have changed in this diff Show More