@nx/js 16.5.1 → 16.6.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/migrations.json CHANGED
@@ -41,6 +41,12 @@
41
41
  "version": "16.0.0-beta.1",
42
42
  "description": "Replace @nrwl/js with @nx/js",
43
43
  "implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages"
44
+ },
45
+ "explicitly-set-projects-to-update-buildable-deps": {
46
+ "cli": "nx",
47
+ "version": "16.6.0-beta.0",
48
+ "description": "Explicitly set 'updateBuildableProjectDepsInPackageJson' to 'true' in targets that rely on that value as the default.",
49
+ "factory": "./src/migrations/update-16-6-0/explicitly-set-projects-to-update-buildable-deps"
44
50
  }
45
51
  },
46
52
  "packageJsonUpdates": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/js",
3
- "version": "16.5.1",
3
+ "version": "16.6.0-beta.1",
4
4
  "private": false,
5
5
  "description": "The JS plugin for Nx contains executors and generators that provide the best experience for developing JavaScript and TypeScript projects. ",
6
6
  "repository": {
@@ -39,9 +39,9 @@
39
39
  "@babel/preset-env": "^7.15.0",
40
40
  "@babel/preset-typescript": "^7.15.0",
41
41
  "@babel/runtime": "^7.14.8",
42
- "@nrwl/js": "16.5.1",
43
- "@nx/devkit": "16.5.1",
44
- "@nx/workspace": "16.5.1",
42
+ "@nrwl/js": "16.6.0-beta.1",
43
+ "@nx/devkit": "16.6.0-beta.1",
44
+ "@nx/workspace": "16.6.0-beta.1",
45
45
  "@phenomnomnominal/tsquery": "~5.0.1",
46
46
  "babel-plugin-const-enum": "^1.0.1",
47
47
  "babel-plugin-macros": "^2.8.0",
@@ -69,5 +69,5 @@
69
69
  "access": "public"
70
70
  },
71
71
  "types": "./src/index.d.ts",
72
- "gitHead": "7b7f1e7f72a34cb31cff43ea0ebb80d0eab1ac79"
72
+ "gitHead": "cf9f5cbe6a7ce3b916ec6505dc8488f669cbc52b"
73
73
  }
@@ -69,13 +69,15 @@
69
69
  "updateBuildableProjectDepsInPackageJson": {
70
70
  "type": "boolean",
71
71
  "description": "Whether to update the buildable project dependencies in the build output package.json.",
72
- "default": true
72
+ "default": false,
73
+ "x-deprecated": "Configure the project to use the '@nx/dependency-checks' ESLint rule instead (https://nx.dev/packages/eslint-plugin/documents/dependency-checks). It will be removed in v17."
73
74
  },
74
75
  "buildableProjectDepsInPackageJsonType": {
75
76
  "type": "string",
76
77
  "description": "When `updateBuildableProjectDepsInPackageJson` is `true`, this adds dependencies to either `peerDependencies` or `dependencies`.",
77
78
  "enum": ["dependencies", "peerDependencies"],
78
- "default": "peerDependencies"
79
+ "default": "peerDependencies",
80
+ "x-deprecated": "Configure the project to use the '@nx/dependency-checks' ESLint rule instead (https://nx.dev/packages/eslint-plugin/documents/dependency-checks). It will be removed in v17."
79
81
  },
80
82
  "external": {
81
83
  "description": "A list projects to be treated as external. This feature is experimental",
@@ -57,13 +57,15 @@
57
57
  "updateBuildableProjectDepsInPackageJson": {
58
58
  "type": "boolean",
59
59
  "description": "Whether to update the buildable project dependencies in the build output package.json.",
60
- "default": true
60
+ "default": false,
61
+ "x-deprecated": "Configure the project to use the '@nx/dependency-checks' ESLint rule instead (https://nx.dev/packages/eslint-plugin/documents/dependency-checks). It will be removed in v17."
61
62
  },
62
63
  "buildableProjectDepsInPackageJsonType": {
63
64
  "type": "string",
64
65
  "description": "When `updateBuildableProjectDepsInPackageJson` is `true`, this adds dependencies to either `peerDependencies` or `dependencies`.",
65
66
  "enum": ["dependencies", "peerDependencies"],
66
- "default": "peerDependencies"
67
+ "default": "peerDependencies",
68
+ "x-deprecated": "Configure the project to use the '@nx/dependency-checks' ESLint rule instead (https://nx.dev/packages/eslint-plugin/documents/dependency-checks). It will be removed in v17."
67
69
  },
68
70
  "external": {
69
71
  "description": "A list projects to be treated as external. This feature is experimental",
@@ -238,8 +238,8 @@ function createFiles(tree, options, filesDir) {
238
238
  }
239
239
  function addJest(tree, options) {
240
240
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
241
- const { jestProjectGenerator } = (0, devkit_1.ensurePackage)('@nx/jest', versions_1.nxVersion);
242
- return yield jestProjectGenerator(tree, Object.assign(Object.assign({}, options), { project: options.name, setupFile: 'none', supportTsx: false, skipSerializers: true, testEnvironment: options.testEnvironment, skipFormat: true, compiler: options.bundler === 'swc' || options.bundler === 'tsc'
241
+ const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/jest', versions_1.nxVersion);
242
+ return yield configurationGenerator(tree, Object.assign(Object.assign({}, options), { project: options.name, setupFile: 'none', supportTsx: false, skipSerializers: true, testEnvironment: options.testEnvironment, skipFormat: true, compiler: options.bundler === 'swc' || options.bundler === 'tsc'
243
243
  ? options.bundler
244
244
  : options.bundler === 'rollup'
245
245
  ? 'swc'
@@ -70,8 +70,8 @@ function setupBuildGenerator(tree, options) {
70
70
  break;
71
71
  }
72
72
  case 'esbuild': {
73
- const { esbuildProjectGenerator } = (0, devkit_1.ensurePackage)('@nx/esbuild', versions_1.nxVersion);
74
- const task = yield esbuildProjectGenerator(tree, {
73
+ const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/esbuild', versions_1.nxVersion);
74
+ const task = yield configurationGenerator(tree, {
75
75
  main: mainFile,
76
76
  buildTarget: options.buildTarget,
77
77
  project: options.project,
@@ -81,8 +81,8 @@ function setupBuildGenerator(tree, options) {
81
81
  break;
82
82
  }
83
83
  case 'rollup': {
84
- const { rollupProjectGenerator } = (0, devkit_1.ensurePackage)('@nx/rollup', versions_1.nxVersion);
85
- const task = yield rollupProjectGenerator(tree, {
84
+ const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/rollup', versions_1.nxVersion);
85
+ const task = yield configurationGenerator(tree, {
86
86
  buildTarget: options.buildTarget,
87
87
  main: mainFile,
88
88
  project: options.project,
@@ -0,0 +1,2 @@
1
+ import { Tree } from '@nx/devkit';
2
+ export default function (tree: Tree): Promise<void>;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const devkit_1 = require("@nx/devkit");
5
+ const executors = new Set([
6
+ '@nx/js:swc',
7
+ '@nrwl/js:swc',
8
+ '@nx/js:tsc',
9
+ '@nrwl/js:tsc',
10
+ ]);
11
+ function default_1(tree) {
12
+ var _a;
13
+ var _b;
14
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
15
+ // use project graph to get the expanded target configurations
16
+ const projectGraph = yield (0, devkit_1.createProjectGraphAsync)();
17
+ for (const [projectName, { data: projectData }] of Object.entries(projectGraph.nodes)) {
18
+ if (projectData.projectType !== 'library') {
19
+ continue;
20
+ }
21
+ for (const [targetName, target] of Object.entries(projectData.targets || {})) {
22
+ if (!executors.has(target.executor)) {
23
+ continue;
24
+ }
25
+ if (!target.options ||
26
+ target.options.updateBuildableProjectDepsInPackageJson === undefined) {
27
+ // read the project configuration to write the explicit project configuration
28
+ // and avoid writing the expanded target configuration
29
+ const project = (0, devkit_1.readProjectConfiguration)(tree, projectName);
30
+ (_a = (_b = project.targets[targetName]).options) !== null && _a !== void 0 ? _a : (_b.options = {});
31
+ project.targets[targetName].options.updateBuildableProjectDepsInPackageJson = true;
32
+ (0, devkit_1.updateProjectConfiguration)(tree, projectName, project);
33
+ }
34
+ }
35
+ }
36
+ yield (0, devkit_1.formatFiles)(tree);
37
+ });
38
+ }
39
+ exports.default = default_1;
@@ -42,7 +42,17 @@ export interface ExecutorOptions {
42
42
  watch: boolean;
43
43
  clean?: boolean;
44
44
  transformers: TransformerEntry[];
45
+ /**
46
+ * @deprecated Configure the project to use the `@nx/dependency-checks` ESLint
47
+ * rule instead (https://nx.dev/packages/eslint-plugin/documents/dependency-checks).
48
+ * It will be removed in v17.
49
+ */
45
50
  updateBuildableProjectDepsInPackageJson?: boolean;
51
+ /**
52
+ * @deprecated Configure the project to use the `@nx/dependency-checks` ESLint
53
+ * rule instead (https://nx.dev/packages/eslint-plugin/documents/dependency-checks).
54
+ * It will be removed in v17.
55
+ */
46
56
  buildableProjectDepsInPackageJsonType?: 'dependencies' | 'peerDependencies';
47
57
  external?: 'all' | 'none' | string[];
48
58
  externalBuildTargets?: string[];