nx 16.4.0-beta.6 → 16.4.0-beta.7

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",
3
- "version": "16.4.0-beta.6",
3
+ "version": "16.4.0-beta.7",
4
4
  "private": false,
5
5
  "description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
6
6
  "repository": {
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "homepage": "https://nx.dev",
34
34
  "dependencies": {
35
- "@nrwl/tao": "16.4.0-beta.6",
35
+ "@nrwl/tao": "16.4.0-beta.7",
36
36
  "@parcel/watcher": "2.0.4",
37
37
  "@yarnpkg/lockfile": "^1.1.0",
38
38
  "@yarnpkg/parsers": "^3.0.0-rc.18",
@@ -80,16 +80,16 @@
80
80
  }
81
81
  },
82
82
  "optionalDependencies": {
83
- "@nx/nx-darwin-arm64": "16.4.0-beta.6",
84
- "@nx/nx-darwin-x64": "16.4.0-beta.6",
85
- "@nx/nx-freebsd-x64": "16.4.0-beta.6",
86
- "@nx/nx-linux-arm-gnueabihf": "16.4.0-beta.6",
87
- "@nx/nx-linux-arm64-gnu": "16.4.0-beta.6",
88
- "@nx/nx-linux-arm64-musl": "16.4.0-beta.6",
89
- "@nx/nx-linux-x64-gnu": "16.4.0-beta.6",
90
- "@nx/nx-linux-x64-musl": "16.4.0-beta.6",
91
- "@nx/nx-win32-arm64-msvc": "16.4.0-beta.6",
92
- "@nx/nx-win32-x64-msvc": "16.4.0-beta.6"
83
+ "@nx/nx-darwin-arm64": "16.4.0-beta.7",
84
+ "@nx/nx-darwin-x64": "16.4.0-beta.7",
85
+ "@nx/nx-freebsd-x64": "16.4.0-beta.7",
86
+ "@nx/nx-linux-arm-gnueabihf": "16.4.0-beta.7",
87
+ "@nx/nx-linux-arm64-gnu": "16.4.0-beta.7",
88
+ "@nx/nx-linux-arm64-musl": "16.4.0-beta.7",
89
+ "@nx/nx-linux-x64-gnu": "16.4.0-beta.7",
90
+ "@nx/nx-linux-x64-musl": "16.4.0-beta.7",
91
+ "@nx/nx-win32-arm64-msvc": "16.4.0-beta.7",
92
+ "@nx/nx-win32-x64-msvc": "16.4.0-beta.7"
93
93
  },
94
94
  "nx-migrations": {
95
95
  "migrations": "./migrations.json",
@@ -175,5 +175,5 @@
175
175
  },
176
176
  "main": "./bin/nx.js",
177
177
  "types": "./bin/nx.d.ts",
178
- "gitHead": "6eda3ff725a1e5ee973e71cb711b065dcc3f2a16"
178
+ "gitHead": "847d3a45b61cd2c267acb66c4165a5bb875aff4f"
179
179
  }
@@ -1,7 +1,7 @@
1
1
  import { ProjectConfiguration, ProjectsConfigurations } from '../config/workspace-json-project-json';
2
2
  export declare function shouldMergeAngularProjects(root: string, includeProjectsFromAngularJson: boolean): boolean;
3
3
  export declare function isAngularPluginInstalled(): boolean;
4
- export declare function mergeAngularJsonAndGlobProjects(globProjects: {
4
+ export declare function mergeAngularJsonAndProjects(projects: {
5
5
  [name: string]: ProjectConfiguration;
6
6
  }, angularCliWorkspaceRoot: string): {
7
7
  [name: string]: ProjectConfiguration;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toOldFormat = exports.toNewFormat = exports.mergeAngularJsonAndGlobProjects = exports.isAngularPluginInstalled = exports.shouldMergeAngularProjects = void 0;
3
+ exports.toOldFormat = exports.toNewFormat = exports.mergeAngularJsonAndProjects = exports.isAngularPluginInstalled = exports.shouldMergeAngularProjects = void 0;
4
4
  const fs_1 = require("fs");
5
5
  const path = require("path");
6
6
  const fileutils_1 = require("../utils/fileutils");
@@ -38,20 +38,20 @@ exports.isAngularPluginInstalled = isAngularPluginInstalled;
38
38
  function readAngularJson(angularCliWorkspaceRoot) {
39
39
  return toNewFormat((0, fileutils_1.readJsonFile)(path.join(angularCliWorkspaceRoot, 'angular.json'))).projects;
40
40
  }
41
- function mergeAngularJsonAndGlobProjects(globProjects, angularCliWorkspaceRoot) {
41
+ function mergeAngularJsonAndProjects(projects, angularCliWorkspaceRoot) {
42
42
  const res = readAngularJson(angularCliWorkspaceRoot);
43
43
  const folders = new Set();
44
44
  for (let k of Object.keys(res)) {
45
45
  folders.add(res[k].root);
46
46
  }
47
- for (let k of Object.keys(globProjects)) {
48
- if (!folders.has(globProjects[k].root)) {
49
- res[k] = globProjects[k];
47
+ for (let k of Object.keys(projects)) {
48
+ if (!folders.has(projects[k].root)) {
49
+ res[k] = projects[k];
50
50
  }
51
51
  }
52
52
  return res;
53
53
  }
54
- exports.mergeAngularJsonAndGlobProjects = mergeAngularJsonAndGlobProjects;
54
+ exports.mergeAngularJsonAndProjects = mergeAngularJsonAndProjects;
55
55
  function toNewFormat(w) {
56
56
  Object.values(w.projects || {}).forEach((projectConfig) => {
57
57
  if (projectConfig.architect) {
@@ -3,15 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.renameJsToJsx = void 0;
4
4
  const fs_extra_1 = require("fs-extra");
5
5
  const glob_1 = require("glob");
6
+ const fileutils_1 = require("../../../../utils/fileutils");
6
7
  // Vite cannot process JSX like <div> or <Header> unless the file is named .jsx or .tsx
7
8
  function renameJsToJsx(appName, isStandalone) {
8
9
  const files = (0, glob_1.sync)(isStandalone ? 'src/**/*.js' : `apps/${appName}/src/**/*.js`);
9
10
  files.forEach((file) => {
10
- const content = (0, fs_extra_1.readFileSync)(file).toString();
11
- // Try to detect JSX before renaming to .jsx
12
- // Files like setupTests.js from CRA should not be renamed
13
- if (/<[a-zA-Z0-9]+/.test(content)) {
14
- (0, fs_extra_1.renameSync)(file, `${file}x`);
11
+ if ((0, fileutils_1.fileExists)(file)) {
12
+ const content = (0, fs_extra_1.readFileSync)(file).toString();
13
+ // Try to detect JSX before renaming to .jsx
14
+ // Files like setupTests.js from CRA should not be renamed
15
+ if (/<[a-zA-Z0-9]+/.test(content)) {
16
+ (0, fs_extra_1.renameSync)(file, `${file}x`);
17
+ }
15
18
  }
16
19
  });
17
20
  }
@@ -34,7 +34,7 @@ function listHandler(args) {
34
34
  title: 'Community Plugins',
35
35
  bodyLines: [
36
36
  'Looking for a technology / framework not listed above?',
37
- 'There are many excellent plugins matintained by the Nx community.',
37
+ 'There are many excellent plugins maintained by the Nx community.',
38
38
  'Search for the one you need here: https://nx.dev/plugins/registry.',
39
39
  ],
40
40
  });
@@ -72,7 +72,7 @@ export declare function deduplicateProjectFiles(files: string[]): string[];
72
72
  export declare function inferProjectFromNonStandardFile(file: string): ProjectConfiguration & {
73
73
  name: string;
74
74
  };
75
- export declare function buildProjectsConfigurationsFromGlobs(nxJson: NxJsonConfiguration, projectFiles: string[], // making this parameter allows devkit to pick up newly created projects
75
+ export declare function buildProjectsConfigurationsFromProjectPaths(nxJson: NxJsonConfiguration, projectFiles: string[], // making this parameter allows devkit to pick up newly created projects
76
76
  readJson?: <T extends Object>(string: any) => T): ProjectsConfigurations;
77
77
  export declare function mergeTargetConfigurations(projectConfiguration: ProjectConfiguration, target: string, targetDefaults: TargetDefaults[string]): TargetConfiguration;
78
78
  export declare function readTargetDefaultsForTarget(targetName: string, targetDefaults: TargetDefaults, executor?: string): TargetDefaults[string];
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.renamePropertyWithStableKeys = exports.readTargetDefaultsForTarget = exports.mergeTargetConfigurations = exports.buildProjectsConfigurationsFromGlobs = exports.inferProjectFromNonStandardFile = exports.deduplicateProjectFiles = exports.globForProjectFiles = exports.getGlobPatternsFromPackageManagerWorkspaces = exports.getGlobPatternsFromPluginsAsync = exports.getGlobPatternsFromPlugins = exports.toProjectName = exports.normalizeExecutorSchema = exports.Workspaces = void 0;
3
+ exports.renamePropertyWithStableKeys = exports.readTargetDefaultsForTarget = exports.mergeTargetConfigurations = exports.buildProjectsConfigurationsFromProjectPaths = exports.inferProjectFromNonStandardFile = exports.deduplicateProjectFiles = exports.globForProjectFiles = exports.getGlobPatternsFromPackageManagerWorkspaces = exports.getGlobPatternsFromPluginsAsync = exports.getGlobPatternsFromPlugins = exports.toProjectName = exports.normalizeExecutorSchema = exports.Workspaces = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const fast_glob_1 = require("fast-glob");
6
6
  const fs_1 = require("fs");
@@ -58,11 +58,11 @@ class Workspaces {
58
58
  return this.cachedProjectsConfig;
59
59
  }
60
60
  const nxJson = this.readNxJson();
61
- const projectsConfigurations = buildProjectsConfigurationsFromGlobs(nxJson, globForProjectFiles(this.root, (opts === null || opts === void 0 ? void 0 : opts._ignorePluginInference)
61
+ const projectsConfigurations = buildProjectsConfigurationsFromProjectPaths(nxJson, globForProjectFiles(this.root, (opts === null || opts === void 0 ? void 0 : opts._ignorePluginInference)
62
62
  ? []
63
63
  : getGlobPatternsFromPlugins(nxJson, (0, installation_directory_1.getNxRequirePaths)(this.root), this.root), nxJson), (path) => (0, fileutils_1.readJsonFile)((0, path_1.join)(this.root, path)));
64
64
  if ((0, angular_json_1.shouldMergeAngularProjects)(this.root, opts === null || opts === void 0 ? void 0 : opts._includeProjectsFromAngularJson)) {
65
- projectsConfigurations.projects = (0, angular_json_1.mergeAngularJsonAndGlobProjects)(projectsConfigurations.projects, this.root);
65
+ projectsConfigurations.projects = (0, angular_json_1.mergeAngularJsonAndProjects)(projectsConfigurations.projects, this.root);
66
66
  }
67
67
  this.cachedProjectsConfig = this.mergeTargetDefaultsIntoProjectDescriptions(projectsConfigurations, nxJson);
68
68
  return this.cachedProjectsConfig;
@@ -384,7 +384,9 @@ function getGlobPatternsFromPackageManagerWorkspaces(root) {
384
384
  // Include the root project
385
385
  return packageJson.nx ? patterns.concat('package.json') : patterns;
386
386
  }
387
- catch (_c) { }
387
+ catch (_c) {
388
+ return [];
389
+ }
388
390
  }
389
391
  exports.getGlobPatternsFromPackageManagerWorkspaces = getGlobPatternsFromPackageManagerWorkspaces;
390
392
  function normalizePatterns(patterns) {
@@ -511,7 +513,7 @@ function inferProjectFromNonStandardFile(file) {
511
513
  };
512
514
  }
513
515
  exports.inferProjectFromNonStandardFile = inferProjectFromNonStandardFile;
514
- function buildProjectsConfigurationsFromGlobs(nxJson, projectFiles, // making this parameter allows devkit to pick up newly created projects
516
+ function buildProjectsConfigurationsFromProjectPaths(nxJson, projectFiles, // making this parameter allows devkit to pick up newly created projects
515
517
  readJson = (string) => (0, fileutils_1.readJsonFile)(string) // making this an arg allows us to reuse in devkit
516
518
  ) {
517
519
  const projects = {};
@@ -558,8 +560,7 @@ readJson = (string) => (0, fileutils_1.readJsonFile)(string) // making this an a
558
560
  projects[name] = config;
559
561
  }
560
562
  else {
561
- logger_1.logger.error(`Skipping project inferred from ${file} since project ${name} already exists.`);
562
- throw new Error();
563
+ logger_1.logger.warn(`Skipping project inferred from ${file} since project ${name} already exists.`);
563
564
  }
564
565
  }
565
566
  }
@@ -569,7 +570,7 @@ readJson = (string) => (0, fileutils_1.readJsonFile)(string) // making this an a
569
570
  projects: projects,
570
571
  };
571
572
  }
572
- exports.buildProjectsConfigurationsFromGlobs = buildProjectsConfigurationsFromGlobs;
573
+ exports.buildProjectsConfigurationsFromProjectPaths = buildProjectsConfigurationsFromProjectPaths;
573
574
  function mergeTargetConfigurations(projectConfiguration, target, targetDefaults) {
574
575
  var _a, _b;
575
576
  const targetConfiguration = (_a = projectConfiguration.targets) === null || _a === void 0 ? void 0 : _a[target];