@nx/rollup 16.6.0-beta.0 → 16.6.0-beta.2

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/rollup",
3
- "version": "16.6.0-beta.0",
3
+ "version": "16.6.0-beta.2",
4
4
  "private": false,
5
5
  "description": "The Nx Plugin for Rollup contains executors and generators that support building applications using Rollup.",
6
6
  "repository": {
@@ -29,9 +29,9 @@
29
29
  "migrations": "./migrations.json"
30
30
  },
31
31
  "dependencies": {
32
- "@nrwl/rollup": "16.6.0-beta.0",
33
- "@nx/devkit": "16.6.0-beta.0",
34
- "@nx/js": "16.6.0-beta.0",
32
+ "@nrwl/rollup": "16.6.0-beta.2",
33
+ "@nx/devkit": "16.6.0-beta.2",
34
+ "@nx/js": "16.6.0-beta.2",
35
35
  "@rollup/plugin-babel": "^5.3.0",
36
36
  "@rollup/plugin-commonjs": "^20.0.0",
37
37
  "@rollup/plugin-image": "^2.1.0",
@@ -54,5 +54,5 @@
54
54
  "access": "public"
55
55
  },
56
56
  "types": "./index.d.ts",
57
- "gitHead": "5a7ffb93c9e84bffbf52f6ae9c6c1e3b8edb9d35"
57
+ "gitHead": "c3d31711b71d648cedeff688fce9334d393b586b"
58
58
  }
@@ -24,7 +24,17 @@ export interface RollupExecutorOptions {
24
24
  rollupConfig?: string | string[];
25
25
  watch?: boolean;
26
26
  assets?: any[];
27
+ /**
28
+ * @deprecated Configure the project to use the `@nx/dependency-checks` ESLint
29
+ * rule instead (https://nx.dev/packages/eslint-plugin/documents/dependency-checks).
30
+ * It will be removed in v17.
31
+ */
27
32
  updateBuildableProjectDepsInPackageJson?: boolean;
33
+ /**
34
+ * @deprecated Configure the project to use the `@nx/dependency-checks` ESLint
35
+ * rule instead (https://nx.dev/packages/eslint-plugin/documents/dependency-checks).
36
+ * It will be removed in v17.
37
+ */
28
38
  buildableProjectDepsInPackageJsonType?: 'dependencies' | 'peerDependencies';
29
39
  deleteOutputPath?: boolean;
30
40
  format?: string[];
@@ -5,19 +5,6 @@
5
5
  "description": "Packages a library for different web usages (ESM, CommonJS).",
6
6
  "cli": "nx",
7
7
  "type": "object",
8
- "presets": [
9
- {
10
- "name": "Including Dependencies in package.json",
11
- "keys": [
12
- "main",
13
- "outputPath",
14
- "project",
15
- "tsConfig",
16
- "buildableProjectDepsInPackageJsonType",
17
- "updateBuildableProjectDepsInPackageJson"
18
- ]
19
- }
20
- ],
21
8
  "properties": {
22
9
  "project": {
23
10
  "type": "string",
@@ -92,13 +79,15 @@
92
79
  "updateBuildableProjectDepsInPackageJson": {
93
80
  "type": "boolean",
94
81
  "description": "Update buildable project dependencies in `package.json`.",
95
- "default": false
82
+ "default": false,
83
+ "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."
96
84
  },
97
85
  "buildableProjectDepsInPackageJsonType": {
98
86
  "type": "string",
99
87
  "description": "When `updateBuildableProjectDepsInPackageJson` is `true`, this adds dependencies to either `peerDependencies` or `dependencies`.",
100
88
  "enum": ["dependencies", "peerDependencies"],
101
- "default": "peerDependencies"
89
+ "default": "peerDependencies",
90
+ "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."
102
91
  },
103
92
  "rollupConfig": {
104
93
  "oneOf": [
@@ -4,26 +4,29 @@ const tslib_1 = require("tslib");
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const executors = new Set(['@nx/rollup:rollup', '@nrwl/rollup:rollup']);
6
6
  function default_1(tree) {
7
+ var _a;
8
+ var _b;
7
9
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
8
- const projects = (0, devkit_1.getProjects)(tree);
9
- for (const [projectName, project] of projects) {
10
- if (project.projectType !== 'library') {
10
+ // use project graph to get the expanded target configurations
11
+ const projectGraph = yield (0, devkit_1.createProjectGraphAsync)();
12
+ for (const [projectName, { data: projectData }] of Object.entries(projectGraph.nodes)) {
13
+ if (projectData.projectType !== 'library') {
11
14
  continue;
12
15
  }
13
- let updated = false;
14
- for (const [, target] of Object.entries(project.targets || {})) {
16
+ for (const [targetName, target] of Object.entries(projectData.targets || {})) {
15
17
  if (!executors.has(target.executor)) {
16
18
  continue;
17
19
  }
18
- if (target.options &&
20
+ if (!target.options ||
19
21
  target.options.updateBuildableProjectDepsInPackageJson === undefined) {
20
- target.options.updateBuildableProjectDepsInPackageJson = true;
21
- updated = true;
22
+ // read the project configuration to write the explicit project configuration
23
+ // and avoid writing the expanded target configuration
24
+ const project = (0, devkit_1.readProjectConfiguration)(tree, projectName);
25
+ (_a = (_b = project.targets[targetName]).options) !== null && _a !== void 0 ? _a : (_b.options = {});
26
+ project.targets[targetName].options.updateBuildableProjectDepsInPackageJson = true;
27
+ (0, devkit_1.updateProjectConfiguration)(tree, projectName, project);
22
28
  }
23
29
  }
24
- if (updated) {
25
- (0, devkit_1.updateProjectConfiguration)(tree, projectName, project);
26
- }
27
30
  }
28
31
  yield (0, devkit_1.formatFiles)(tree);
29
32
  });