@nx/angular 16.6.0-beta.8 → 16.7.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/angular",
3
- "version": "16.6.0-beta.8",
3
+ "version": "16.7.0-beta.1",
4
4
  "private": false,
5
5
  "description": "The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides: \n\n- Integration with libraries such as Storybook, Jest, ESLint, Tailwind CSS, and Cypress. \n\n- Generators to help scaffold code quickly (like: Micro Frontends, Libraries, both internal to your codebase and publishable to npm) \n\n- Upgrading AngularJS applications \n\n- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.",
6
6
  "repository": {
@@ -66,21 +66,21 @@
66
66
  "migrations": "./migrations.json"
67
67
  },
68
68
  "dependencies": {
69
- "@nrwl/angular": "16.6.0-beta.8",
70
- "@nx/cypress": "16.6.0-beta.8",
71
- "@nx/devkit": "16.6.0-beta.8",
72
- "@nx/jest": "16.6.0-beta.8",
73
- "@nx/js": "16.6.0-beta.8",
74
- "@nx/linter": "16.6.0-beta.8",
75
- "@nx/webpack": "16.6.0-beta.8",
76
- "@nx/workspace": "16.6.0-beta.8",
69
+ "@nrwl/angular": "16.7.0-beta.1",
70
+ "@nx/cypress": "16.7.0-beta.1",
71
+ "@nx/devkit": "16.7.0-beta.1",
72
+ "@nx/jest": "16.7.0-beta.1",
73
+ "@nx/js": "16.7.0-beta.1",
74
+ "@nx/linter": "16.7.0-beta.1",
75
+ "@nx/webpack": "16.7.0-beta.1",
76
+ "@nx/workspace": "16.7.0-beta.1",
77
77
  "@phenomnomnominal/tsquery": "~5.0.1",
78
78
  "@typescript-eslint/type-utils": "^5.36.1",
79
79
  "chalk": "^4.1.0",
80
80
  "enquirer": "^2.3.6",
81
81
  "find-cache-dir": "^3.3.2",
82
82
  "ignore": "^5.0.4",
83
- "magic-string": "~0.26.2",
83
+ "magic-string": "~0.30.2",
84
84
  "minimatch": "3.0.5",
85
85
  "semver": "7.5.3",
86
86
  "tslib": "^2.3.0",
@@ -107,5 +107,5 @@
107
107
  "module": "fesm2022/nx-angular.mjs",
108
108
  "typings": "index.d.ts",
109
109
  "sideEffects": false,
110
- "gitHead": "d1d06349e703d903ac47fb7adc7d250ce140d77e"
110
+ "gitHead": "50a145bb64edcf76985184a9a83d1449dcd4f3d9"
111
111
  }
@@ -19,7 +19,7 @@ const log = require("ng-packagr/lib/utils/log");
19
19
  const path_1 = require("path");
20
20
  const postcssPresetEnv = require("postcss-preset-env");
21
21
  const postcssUrl = require("postcss-url");
22
- const url_1 = require("url");
22
+ const node_url_1 = require("node:url");
23
23
  const angular_version_utils_1 = require("../../../utilities/angular-version-utils");
24
24
  const tailwindcss_1 = require("../../../utilities/tailwindcss");
25
25
  const postcss = require('postcss');
@@ -187,7 +187,7 @@ class StylesheetProcessor {
187
187
  }
188
188
  return (yield Promise.resolve().then(() => require('sass')))
189
189
  .compileString(css, {
190
- url: (0, url_1.pathToFileURL)(filePath),
190
+ url: (0, node_url_1.pathToFileURL)(filePath),
191
191
  syntax: '.sass' === ext ? 'indented' : 'scss',
192
192
  loadPaths: this.styleIncludePaths,
193
193
  })
@@ -19,7 +19,7 @@ const log = require("ng-packagr/lib/utils/log");
19
19
  const path_1 = require("path");
20
20
  const postcssPresetEnv = require("postcss-preset-env");
21
21
  const postcssUrl = require("postcss-url");
22
- const url_1 = require("url");
22
+ const node_url_1 = require("node:url");
23
23
  const angular_version_utils_1 = require("../../../utilities/angular-version-utils");
24
24
  const tailwindcss_1 = require("../../../utilities/tailwindcss");
25
25
  const postcss = require('postcss');
@@ -180,7 +180,7 @@ class StylesheetProcessor {
180
180
  }
181
181
  return (yield Promise.resolve().then(() => require('sass')))
182
182
  .compileString(css, {
183
- url: (0, url_1.pathToFileURL)(filePath),
183
+ url: (0, node_url_1.pathToFileURL)(filePath),
184
184
  syntax: '.sass' === ext ? 'indented' : 'scss',
185
185
  loadPaths: this.styleIncludePaths,
186
186
  })
@@ -2,11 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addE2e = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const cypress_1 = require("@nx/cypress");
6
5
  const devkit_1 = require("@nx/devkit");
7
6
  const versions_1 = require("../../../utils/versions");
8
7
  const remove_scaffolded_e2e_1 = require("./remove-scaffolded-e2e");
8
+ const cypress_1 = require("@nx/cypress");
9
9
  function addE2e(tree, options) {
10
+ var _a;
10
11
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
11
12
  (0, remove_scaffolded_e2e_1.removeScaffoldedE2e)(tree, options, options.ngCliSchematicE2ERoot);
12
13
  if (options.e2eTestRunner === 'cypress') {
@@ -22,6 +23,26 @@ function addE2e(tree, options) {
22
23
  skipFormat: true,
23
24
  });
24
25
  }
26
+ else if (options.e2eTestRunner === 'playwright') {
27
+ const { configurationGenerator: playwrightConfigurationGenerator } = (0, devkit_1.ensurePackage)('@nx/playwright', versions_1.nxVersion);
28
+ (0, devkit_1.addProjectConfiguration)(tree, options.e2eProjectName, {
29
+ root: options.e2eProjectRoot,
30
+ sourceRoot: (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'src'),
31
+ targets: {},
32
+ implicitDependencies: [options.name],
33
+ });
34
+ yield playwrightConfigurationGenerator(tree, {
35
+ project: options.e2eProjectName,
36
+ skipFormat: true,
37
+ skipPackageJson: options.skipPackageJson,
38
+ directory: 'src',
39
+ js: false,
40
+ linter: options.linter,
41
+ setParserOptionsProject: options.setParserOptionsProject,
42
+ webServerCommand: `${(0, devkit_1.getPackageManagerCommand)().exec} nx serve ${options.name}`,
43
+ webServerAddress: `http://localhost:${(_a = options.port) !== null && _a !== void 0 ? _a : 4200}`,
44
+ });
45
+ }
25
46
  });
26
47
  }
27
48
  exports.addE2e = addE2e;
@@ -105,8 +105,9 @@
105
105
  },
106
106
  "e2eTestRunner": {
107
107
  "type": "string",
108
- "enum": ["cypress", "none"],
108
+ "enum": ["cypress", "playwright", "none"],
109
109
  "description": "Test runner to use for end to end (E2E) tests.",
110
+ "x-prompt": "Which E2E test runner would you like to use?",
110
111
  "default": "cypress"
111
112
  },
112
113
  "tags": {
@@ -112,8 +112,9 @@
112
112
  },
113
113
  "e2eTestRunner": {
114
114
  "type": "string",
115
- "enum": ["cypress", "none"],
115
+ "enum": ["cypress", "playwright", "none"],
116
116
  "description": "Test runner to use for end to end (E2E) tests.",
117
+ "x-prompt": "Which E2E test runner would you like to use?",
117
118
  "default": "cypress"
118
119
  },
119
120
  "tags": {
@@ -2,13 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.angularInitGenerator = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const cypress_1 = require("@nx/cypress");
6
5
  const devkit_1 = require("@nx/devkit");
7
6
  const jest_1 = require("@nx/jest");
8
7
  const linter_1 = require("@nx/linter");
9
8
  const js_1 = require("@nx/js");
10
9
  const test_runners_1 = require("../../utils/test-runners");
11
10
  const version_utils_1 = require("../utils/version-utils");
11
+ const versions_1 = require("../../utils/versions");
12
12
  function angularInitGenerator(tree, rawOptions) {
13
13
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
14
14
  const tasks = [];
@@ -123,7 +123,14 @@ function addE2ETestRunner(tree, options) {
123
123
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
124
124
  switch (options.e2eTestRunner) {
125
125
  case test_runners_1.E2eTestRunner.Cypress:
126
- return (0, cypress_1.cypressInitGenerator)(tree, {
126
+ const { cypressInitGenerator } = (0, devkit_1.ensurePackage)('@nx/cypress', versions_1.nxVersion);
127
+ return cypressInitGenerator(tree, {
128
+ skipPackageJson: options.skipPackageJson,
129
+ });
130
+ case test_runners_1.E2eTestRunner.Playwright:
131
+ const { initGenerator: playwrightInitGenerator } = (0, devkit_1.ensurePackage)('@nx/playwright', versions_1.nxVersion);
132
+ return playwrightInitGenerator(tree, {
133
+ skipFormat: true,
127
134
  skipPackageJson: options.skipPackageJson,
128
135
  });
129
136
  default:
@@ -21,7 +21,8 @@
21
21
  },
22
22
  "e2eTestRunner": {
23
23
  "type": "string",
24
- "enum": ["cypress", "none"],
24
+ "enum": ["cypress", "playwright", "none"],
25
+ "x-prompt": "Which E2E test runner would you like to use?",
25
26
  "description": "Test runner to use for end to end (e2e) tests.",
26
27
  "default": "cypress",
27
28
  "x-priority": "important"
@@ -106,8 +106,9 @@
106
106
  },
107
107
  "e2eTestRunner": {
108
108
  "type": "string",
109
- "enum": ["cypress", "none"],
109
+ "enum": ["cypress", "playwright", "none"],
110
110
  "description": "Test runner to use for end to end (E2E) tests.",
111
+ "x-prompt": "Which E2E test runner would you like to use?",
111
112
  "default": "cypress"
112
113
  },
113
114
  "tags": {
@@ -10,7 +10,8 @@ const tree_utilities_1 = require("./tree-utilities");
10
10
  let tsModule;
11
11
  let tsquery;
12
12
  function getComponentsInfo(tree, entryPoint, moduleFilePaths, projectName) {
13
- return moduleFilePaths.flatMap((moduleFilePath) => {
13
+ return moduleFilePaths
14
+ .flatMap((moduleFilePath) => {
14
15
  const file = (0, ast_utils_1.getTsSourceFile)(tree, moduleFilePath);
15
16
  const declaredComponents = (0, module_info_1.getModuleDeclaredComponents)(file, moduleFilePath, projectName);
16
17
  if (declaredComponents.length === 0) {
@@ -22,7 +23,8 @@ function getComponentsInfo(tree, entryPoint, moduleFilePaths, projectName) {
22
23
  const imports = file.statements.filter((statement) => statement.kind === tsModule.SyntaxKind.ImportDeclaration);
23
24
  const componentsInfo = declaredComponents.map((componentName) => getComponentInfo(tree, entryPoint, file, imports, moduleFilePath, componentName));
24
25
  return componentsInfo;
25
- });
26
+ })
27
+ .filter((f) => f !== undefined);
26
28
  }
27
29
  exports.getComponentsInfo = getComponentsInfo;
28
30
  function getStandaloneComponentsInfo(tree, entryPoint) {
@@ -4,5 +4,6 @@ export declare enum UnitTestRunner {
4
4
  }
5
5
  export declare enum E2eTestRunner {
6
6
  Cypress = "cypress",
7
+ Playwright = "playwright",
7
8
  None = "none"
8
9
  }
@@ -9,5 +9,6 @@ var UnitTestRunner;
9
9
  var E2eTestRunner;
10
10
  (function (E2eTestRunner) {
11
11
  E2eTestRunner["Cypress"] = "cypress";
12
+ E2eTestRunner["Playwright"] = "playwright";
12
13
  E2eTestRunner["None"] = "none";
13
14
  })(E2eTestRunner || (exports.E2eTestRunner = E2eTestRunner = {}));