@nx/angular 16.8.0-beta.1 → 16.8.0-beta.3

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/migrations.json CHANGED
@@ -325,6 +325,10 @@
325
325
  "version": "~14.0.0",
326
326
  "alwaysAddToPackageJson": false
327
327
  },
328
+ "@angular/pwa": {
329
+ "version": "~14.0.0",
330
+ "alwaysAddToPackageJson": false
331
+ },
328
332
  "@angular/core": {
329
333
  "version": "~14.0.0",
330
334
  "alwaysAddToPackageJson": true
@@ -542,6 +546,10 @@
542
546
  "version": "~14.1.0",
543
547
  "alwaysAddToPackageJson": false
544
548
  },
549
+ "@angular/pwa": {
550
+ "version": "~14.1.0",
551
+ "alwaysAddToPackageJson": false
552
+ },
545
553
  "@schematics/angular": {
546
554
  "version": "~14.1.0",
547
555
  "alwaysAddToPackageJson": false
@@ -602,6 +610,10 @@
602
610
  "version": "~14.1.1",
603
611
  "alwaysAddToPackageJson": false
604
612
  },
613
+ "@angular/pwa": {
614
+ "version": "~14.1.1",
615
+ "alwaysAddToPackageJson": false
616
+ },
605
617
  "@schematics/angular": {
606
618
  "version": "~14.1.1",
607
619
  "alwaysAddToPackageJson": false
@@ -656,6 +668,10 @@
656
668
  "version": "~14.2.0",
657
669
  "alwaysAddToPackageJson": false
658
670
  },
671
+ "@angular/pwa": {
672
+ "version": "~14.2.0",
673
+ "alwaysAddToPackageJson": false
674
+ },
659
675
  "@schematics/angular": {
660
676
  "version": "~14.2.0",
661
677
  "alwaysAddToPackageJson": false
@@ -770,6 +786,10 @@
770
786
  "version": "~15.0.0",
771
787
  "alwaysAddToPackageJson": false
772
788
  },
789
+ "@angular/pwa": {
790
+ "version": "~15.0.0",
791
+ "alwaysAddToPackageJson": false
792
+ },
773
793
  "@schematics/angular": {
774
794
  "version": "~15.0.0",
775
795
  "alwaysAddToPackageJson": false
@@ -903,6 +923,10 @@
903
923
  "version": "~15.1.0",
904
924
  "alwaysAddToPackageJson": false
905
925
  },
926
+ "@angular/pwa": {
927
+ "version": "~15.1.0",
928
+ "alwaysAddToPackageJson": false
929
+ },
906
930
  "@angular/core": {
907
931
  "version": "~15.1.0",
908
932
  "alwaysAddToPackageJson": true
@@ -968,6 +992,10 @@
968
992
  "version": "~15.2.0",
969
993
  "alwaysAddToPackageJson": false
970
994
  },
995
+ "@angular/pwa": {
996
+ "version": "~15.2.0",
997
+ "alwaysAddToPackageJson": false
998
+ },
971
999
  "@angular/core": {
972
1000
  "version": "~15.2.0",
973
1001
  "alwaysAddToPackageJson": true
@@ -1101,6 +1129,10 @@
1101
1129
  "version": "~16.0.0",
1102
1130
  "alwaysAddToPackageJson": false
1103
1131
  },
1132
+ "@angular/pwa": {
1133
+ "version": "~16.0.0",
1134
+ "alwaysAddToPackageJson": false
1135
+ },
1104
1136
  "@schematics/angular": {
1105
1137
  "version": "~16.0.0",
1106
1138
  "alwaysAddToPackageJson": false
@@ -1211,6 +1243,10 @@
1211
1243
  "version": "~16.1.0",
1212
1244
  "alwaysAddToPackageJson": false
1213
1245
  },
1246
+ "@angular/pwa": {
1247
+ "version": "~16.1.0",
1248
+ "alwaysAddToPackageJson": false
1249
+ },
1214
1250
  "@angular/core": {
1215
1251
  "version": "~16.1.0",
1216
1252
  "alwaysAddToPackageJson": true
@@ -1272,6 +1308,10 @@
1272
1308
  "version": "~16.2.0",
1273
1309
  "alwaysAddToPackageJson": false
1274
1310
  },
1311
+ "@angular/pwa": {
1312
+ "version": "~16.2.0",
1313
+ "alwaysAddToPackageJson": false
1314
+ },
1275
1315
  "@angular/core": {
1276
1316
  "version": "~16.2.0",
1277
1317
  "alwaysAddToPackageJson": true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/angular",
3
- "version": "16.8.0-beta.1",
3
+ "version": "16.8.0-beta.3",
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,14 +66,14 @@
66
66
  "migrations": "./migrations.json"
67
67
  },
68
68
  "dependencies": {
69
- "@nrwl/angular": "16.8.0-beta.1",
70
- "@nx/cypress": "16.8.0-beta.1",
71
- "@nx/devkit": "16.8.0-beta.1",
72
- "@nx/jest": "16.8.0-beta.1",
73
- "@nx/js": "16.8.0-beta.1",
74
- "@nx/linter": "16.8.0-beta.1",
75
- "@nx/webpack": "16.8.0-beta.1",
76
- "@nx/workspace": "16.8.0-beta.1",
69
+ "@nrwl/angular": "16.8.0-beta.3",
70
+ "@nx/cypress": "16.8.0-beta.3",
71
+ "@nx/devkit": "16.8.0-beta.3",
72
+ "@nx/jest": "16.8.0-beta.3",
73
+ "@nx/js": "16.8.0-beta.3",
74
+ "@nx/linter": "16.8.0-beta.3",
75
+ "@nx/webpack": "16.8.0-beta.3",
76
+ "@nx/workspace": "16.8.0-beta.3",
77
77
  "@phenomnomnominal/tsquery": "~5.0.1",
78
78
  "@typescript-eslint/type-utils": "^5.36.1",
79
79
  "chalk": "^4.1.0",
@@ -99,6 +99,9 @@
99
99
  "peerDependenciesMeta": {
100
100
  "@nguniversal/builders": {
101
101
  "optional": true
102
+ },
103
+ "esbuild": {
104
+ "optional": true
102
105
  }
103
106
  },
104
107
  "publishConfig": {
@@ -107,5 +110,5 @@
107
110
  "module": "fesm2022/nx-angular.mjs",
108
111
  "typings": "index.d.ts",
109
112
  "sideEffects": false,
110
- "gitHead": "231a998e004c13e559c171ba6c164a9127886153"
113
+ "gitHead": "dcd48165a485bc8db57a1fb02b96a0772de3b7e9"
111
114
  }
@@ -6,7 +6,8 @@ const devkit_1 = require("@nx/devkit");
6
6
  const linter_1 = require("@nx/linter");
7
7
  const lint_project_1 = require("@nx/linter/src/generators/lint-project/lint-project");
8
8
  const add_angular_eslint_dependencies_1 = require("./lib/add-angular-eslint-dependencies");
9
- const create_eslint_configuration_1 = require("./lib/create-eslint-configuration");
9
+ const eslint_file_1 = require("@nx/linter/src/generators/utils/eslint-file");
10
+ const string_utils_1 = require("@nx/devkit/src/utils/string-utils");
10
11
  function addLintingGenerator(tree, options) {
11
12
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
12
13
  const tasks = [];
@@ -27,7 +28,51 @@ function addLintingGenerator(tree, options) {
27
28
  rootProject: rootProject,
28
29
  });
29
30
  tasks.push(lintTask);
30
- (0, devkit_1.updateJson)(tree, (0, devkit_1.joinPathFragments)(options.projectRoot, '.eslintrc.json'), (json) => (0, create_eslint_configuration_1.extendAngularEslintJson)(json, options));
31
+ if ((0, eslint_file_1.isEslintConfigSupported)(tree)) {
32
+ const eslintFile = (0, eslint_file_1.findEslintFile)(tree, options.projectRoot);
33
+ // keep parser options if they exist
34
+ const hasParserOptions = tree
35
+ .read((0, devkit_1.joinPathFragments)(options.projectRoot, eslintFile), 'utf8')
36
+ .includes(`${options.projectRoot}/tsconfig.*?.json`);
37
+ (0, eslint_file_1.replaceOverridesInLintConfig)(tree, options.projectRoot, [
38
+ Object.assign(Object.assign({ files: ['*.ts'] }, (hasParserOptions
39
+ ? {
40
+ parserOptions: {
41
+ project: [`${options.projectRoot}/tsconfig.*?.json`],
42
+ },
43
+ }
44
+ : {})), { extends: [
45
+ 'plugin:@nx/angular',
46
+ 'plugin:@angular-eslint/template/process-inline-templates',
47
+ ], rules: {
48
+ '@angular-eslint/directive-selector': [
49
+ 'error',
50
+ {
51
+ type: 'attribute',
52
+ prefix: (0, string_utils_1.camelize)(options.prefix),
53
+ style: 'camelCase',
54
+ },
55
+ ],
56
+ '@angular-eslint/component-selector': [
57
+ 'error',
58
+ {
59
+ type: 'element',
60
+ prefix: (0, string_utils_1.dasherize)(options.prefix),
61
+ style: 'kebab-case',
62
+ },
63
+ ],
64
+ } }),
65
+ {
66
+ files: ['*.html'],
67
+ extends: ['plugin:@nx/angular-template'],
68
+ /**
69
+ * Having an empty rules object present makes it more obvious to the user where they would
70
+ * extend things from if they needed to
71
+ */
72
+ rules: {},
73
+ },
74
+ ]);
75
+ }
31
76
  if (!options.skipPackageJson) {
32
77
  const installTask = (0, add_angular_eslint_dependencies_1.addAngularEsLintDependencies)(tree);
33
78
  tasks.push(installTask);
@@ -4,6 +4,9 @@ import type { AddLintingGeneratorSchema } from '../schema';
4
4
  type EslintExtensionSchema = {
5
5
  prefix: string;
6
6
  };
7
+ /**
8
+ * @deprecated Use tools from `@nx/linter/src/generators/utils/eslint-file` instead
9
+ */
7
10
  export declare const extendAngularEslintJson: (json: Linter.Config, options: EslintExtensionSchema) => {
8
11
  overrides: ({
9
12
  files: string[];
@@ -26,7 +29,7 @@ export declare const extendAngularEslintJson: (json: Linter.Config, options: Esl
26
29
  [name: string]: boolean;
27
30
  };
28
31
  globals?: {
29
- [name: string]: boolean | "readonly" | "readable" | "writable" | "writeable";
32
+ [name: string]: boolean | "off" | "readonly" | "readable" | "writable" | "writeable";
30
33
  };
31
34
  noInlineConfig?: boolean;
32
35
  overrides?: Linter.ConfigOverride<Linter.RulesRecord>[];
@@ -58,7 +61,7 @@ export declare const extendAngularEslintJson: (json: Linter.Config, options: Esl
58
61
  };
59
62
  extends?: string | string[];
60
63
  globals?: {
61
- [name: string]: boolean | "readonly" | "readable" | "writable" | "writeable";
64
+ [name: string]: boolean | "off" | "readonly" | "readable" | "writable" | "writeable";
62
65
  };
63
66
  noInlineConfig?: boolean;
64
67
  parser?: string;
@@ -3,6 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createEsLintConfiguration = exports.extendAngularEslintJson = void 0;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const string_utils_1 = require("@nx/devkit/src/utils/string-utils");
6
+ /**
7
+ * @deprecated Use tools from `@nx/linter/src/generators/utils/eslint-file` instead
8
+ */
6
9
  const extendAngularEslintJson = (json, options) => {
7
10
  const overrides = [
8
11
  Object.assign(Object.assign({}, json.overrides[0]), { files: ['*.ts'], extends: [
@@ -20,20 +20,8 @@ function normalizeOptions(host, options) {
20
20
  });
21
21
  options.rootProject = appProjectRoot === '.';
22
22
  options.projectNameAndRootFormat = projectNameAndRootFormat;
23
- let e2eProjectName = 'e2e';
24
- let e2eProjectRoot = 'e2e';
25
- if (!options.rootProject) {
26
- const projectNameAndRoot = yield (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(host, {
27
- name: `${options.name}-e2e`,
28
- projectType: 'application',
29
- directory: options.directory,
30
- projectNameAndRootFormat: options.projectNameAndRootFormat,
31
- rootProject: options.rootProject,
32
- callingGenerator: '@nx/angular:application',
33
- });
34
- e2eProjectName = projectNameAndRoot.projectName;
35
- e2eProjectRoot = projectNameAndRoot.projectRoot;
36
- }
23
+ const e2eProjectName = options.rootProject ? 'e2e' : `${appProjectName}-e2e`;
24
+ const e2eProjectRoot = options.rootProject ? 'e2e' : `${appProjectRoot}-e2e`;
37
25
  const parsedTags = options.tags
38
26
  ? options.tags.split(',').map((s) => s.trim())
39
27
  : [];
@@ -67,7 +67,17 @@ function hostInternal(tree, options) {
67
67
  installTasks.push(ssrInstallTask);
68
68
  }
69
69
  for (const remote of remotesToGenerate) {
70
- yield (0, remote_1.default)(tree, Object.assign(Object.assign({}, options), { name: remote, host: hostProjectName, skipFormat: true, standalone: options.standalone }));
70
+ let remoteDirectory = options.directory;
71
+ if (options.projectNameAndRootFormat === 'as-provided' &&
72
+ options.directory) {
73
+ /**
74
+ * With the `as-provided` format, the provided directory would be the root
75
+ * of the host application. Append the remote name to the host parent
76
+ * directory to get the remote directory.
77
+ */
78
+ remoteDirectory = (0, devkit_1.joinPathFragments)(options.directory, '..', remote);
79
+ }
80
+ yield (0, remote_1.default)(tree, Object.assign(Object.assign({}, options), { name: remote, directory: remoteDirectory, host: hostProjectName, skipFormat: true, standalone: options.standalone }));
71
81
  }
72
82
  if (!options.skipFormat) {
73
83
  yield (0, devkit_1.formatFiles)(tree);
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
5
5
  const devkit_1 = require("@nx/devkit");
6
6
  const setup_ssr_1 = require("../../setup-ssr/setup-ssr");
7
7
  const versions_1 = require("../../../utils/versions");
8
+ const path_1 = require("path");
8
9
  function addSsr(tree, options, appName) {
9
10
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
10
11
  let project = (0, devkit_1.readProjectConfiguration)(tree, appName);
@@ -14,7 +15,7 @@ function addSsr(tree, options, appName) {
14
15
  });
15
16
  tree.rename((0, devkit_1.joinPathFragments)(project.sourceRoot, 'main.server.ts'), (0, devkit_1.joinPathFragments)(project.sourceRoot, 'bootstrap.server.ts'));
16
17
  tree.write((0, devkit_1.joinPathFragments)(project.root, 'server.ts'), "import('./src/main.server');");
17
- (0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '../files'), project.root, {
18
+ (0, devkit_1.generateFiles)(tree, (0, path_1.join)(__dirname, '../files'), project.root, {
18
19
  appName,
19
20
  standalone: options.standalone,
20
21
  tmpl: '',
@@ -9,6 +9,7 @@ const default_base_1 = require("nx/src/utils/default-base");
9
9
  const versions_1 = require("@nx/js/src/utils/versions");
10
10
  const angular_json_1 = require("nx/src/adapter/angular-json");
11
11
  const versions_2 = require("../../../utils/versions");
12
+ const path_1 = require("path");
12
13
  function validateWorkspace(tree) {
13
14
  const errors = [];
14
15
  if (!tree.exists('package.json')) {
@@ -234,7 +235,7 @@ function createWorkspaceFiles(tree) {
234
235
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
235
236
  updateVsCodeRecommendedExtensions(tree);
236
237
  yield (0, js_1.initGenerator)(tree, { skipFormat: true });
237
- (0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '../files/root'), '.', {
238
+ (0, devkit_1.generateFiles)(tree, (0, path_1.join)(__dirname, '../files/root'), '.', {
238
239
  tmpl: '',
239
240
  dot: '.',
240
241
  rootTsConfigPath: (0, js_1.getRootTsConfigPathInTree)(tree),
@@ -4,12 +4,13 @@ exports.generateSSRFiles = void 0;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const semver_1 = require("semver");
6
6
  const version_utils_1 = require("../../utils/version-utils");
7
+ const path_1 = require("path");
7
8
  function generateSSRFiles(tree, schema) {
8
9
  const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, schema.project);
9
10
  const projectRoot = projectConfig.root;
10
11
  const browserBundleOutputPath = projectConfig.targets.build.options.outputPath;
11
12
  const pathToFiles = (0, devkit_1.joinPathFragments)(__dirname, '..', 'files');
12
- (0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(pathToFiles, 'base'), projectRoot, Object.assign(Object.assign({}, schema), { tpl: '' }));
13
+ (0, devkit_1.generateFiles)(tree, (0, path_1.join)(pathToFiles, 'base'), projectRoot, Object.assign(Object.assign({}, schema), { tpl: '' }));
13
14
  if (schema.standalone) {
14
15
  (0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(pathToFiles, 'standalone'), projectRoot, Object.assign(Object.assign({}, schema), { browserBundleOutputPath, tpl: '' }));
15
16
  }