@nx/gradle 23.0.0-beta.23 → 23.0.0-beta.25
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/{batch-runner → dist/batch-runner}/build/libs/gradle-batch-runner-all.jar +0 -0
- package/{batch-runner → dist/batch-runner}/build/libs/gradle-batch-runner.jar +0 -0
- package/dist/index.d.ts +1 -0
- package/{plugin-v1.d.ts → dist/plugin-v1.d.ts} +0 -1
- package/{plugin.d.ts → dist/plugin.d.ts} +0 -1
- package/{src → dist/src}/executors/gradle/get-exclude-task.d.ts +0 -1
- package/{src → dist/src}/executors/gradle/gradle-batch.impl.d.ts +0 -1
- package/{src → dist/src}/executors/gradle/gradle.impl.d.ts +0 -1
- package/{src → dist/src}/generators/ci-workflow/generator.d.ts +0 -1
- package/{src → dist/src}/generators/init/gradle-project-graph-plugin-utils.d.ts +0 -1
- package/{src → dist/src}/generators/init/init.d.ts +0 -1
- package/{src/migrations/20-2-0/add-include-subprojects-tasks.d.ts → dist/src/migrations/21-0-0/change-ciTargetName-to-ciTestTargetName.d.ts} +0 -1
- package/{src → dist/src}/migrations/21-0-0/change-plugin-to-v1.d.ts +0 -1
- package/{src → dist/src}/migrations/21-1-2/change-plugin-version-0-1-0.d.ts +0 -1
- package/{src → dist/src}/migrations/21-3-0/change-plugin-version-0-1-2.d.ts +0 -1
- package/{src → dist/src}/migrations/21-3-11/change-plugin-version-0-1-4.d.ts +0 -1
- package/{src → dist/src}/migrations/21-4-0/change-plugin-version-0-1-5.d.ts +0 -1
- package/{src → dist/src}/migrations/21-4-1/change-plugin-version-0-1-6.d.ts +0 -1
- package/{src → dist/src}/migrations/21-5-1/change-plugin-version-0-1-7.d.ts +0 -1
- package/{src → dist/src}/migrations/21-6-1/change-plugin-version-0-1-8.d.ts +0 -1
- package/{src → dist/src}/migrations/22-1-0/change-plugin-version-0-1-9.d.ts +0 -1
- package/dist/src/migrations/22-2-0/change-plugin-version-0-1-10.d.ts +2 -0
- package/dist/src/migrations/22-3-0/change-plugin-version-0-1-11.d.ts +2 -0
- package/dist/src/migrations/22-5-0/change-plugin-version-0-1-12.d.ts +2 -0
- package/dist/src/migrations/22-5-3/change-plugin-version-0-1-13.d.ts +2 -0
- package/dist/src/migrations/22-6-0/change-plugin-version-0-1-14.d.ts +2 -0
- package/dist/src/migrations/22-6-0/change-plugin-version-0-1-15.d.ts +2 -0
- package/dist/src/migrations/22-7-0/change-plugin-version-0-1-16.d.ts +2 -0
- package/dist/src/migrations/22-7-0/change-plugin-version-0-1-17.d.ts +2 -0
- package/dist/src/migrations/22-7-0/change-plugin-version-0-1-18.d.ts +2 -0
- package/dist/src/migrations/22-7-0/change-plugin-version-0-1-19.d.ts +2 -0
- package/dist/src/migrations/22-7-0/change-plugin-version-0-1-20.d.ts +2 -0
- package/dist/src/migrations/23-0-0/change-plugin-version-0-1-21.d.ts +2 -0
- package/dist/src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes.d.ts +9 -0
- package/dist/src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes.js +137 -0
- package/dist/src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes.md +25 -0
- package/{src → dist/src}/plugin/dependencies.d.ts +0 -1
- package/{src → dist/src}/plugin/nodes.d.ts +0 -1
- package/{src → dist/src}/plugin/utils/get-project-graph-from-gradle-plugin.d.ts +0 -1
- package/{src → dist/src}/plugin/utils/get-project-graph-lines.d.ts +0 -1
- package/{src → dist/src}/plugin/utils/gradle-plugin-options.d.ts +0 -1
- package/{src → dist/src}/plugin-v1/dependencies.d.ts +0 -1
- package/{src → dist/src}/plugin-v1/nodes.d.ts +0 -1
- package/{src → dist/src}/plugin-v1/utils/get-gradle-report.d.ts +0 -1
- package/{src → dist/src}/plugin-v1/utils/get-project-report-lines.d.ts +0 -1
- package/{src → dist/src}/utils/exec-gradle.d.ts +0 -1
- package/{src → dist/src}/utils/has-gradle-plugin.d.ts +0 -1
- package/{src → dist/src}/utils/split-config-files.d.ts +0 -1
- package/{src → dist/src}/utils/version-catalog-ast-utils.d.ts +0 -1
- package/{src → dist/src}/utils/versions.d.ts +0 -1
- package/{src → dist/src}/utils/versions.js +2 -1
- package/executors.json +3 -3
- package/generators.json +4 -4
- package/migrations.json +50 -51
- package/package.json +50 -15
- package/index.d.ts +0 -2
- package/index.d.ts.map +0 -1
- package/plugin-v1.d.ts.map +0 -1
- package/plugin.d.ts.map +0 -1
- package/src/executors/gradle/get-exclude-task.d.ts.map +0 -1
- package/src/executors/gradle/gradle-batch.impl.d.ts.map +0 -1
- package/src/executors/gradle/gradle.impl.d.ts.map +0 -1
- package/src/generators/ci-workflow/generator.d.ts.map +0 -1
- package/src/generators/init/gradle-project-graph-plugin-utils.d.ts.map +0 -1
- package/src/generators/init/init.d.ts.map +0 -1
- package/src/migrations/20-2-0/add-include-subprojects-tasks.d.ts.map +0 -1
- package/src/migrations/20-2-0/add-include-subprojects-tasks.js +0 -32
- package/src/migrations/20-2-0/add-include-subprojects-tasks.md +0 -28
- package/src/migrations/21-0-0/change-ciTargetName-to-ciTestTargetName.d.ts +0 -3
- package/src/migrations/21-0-0/change-ciTargetName-to-ciTestTargetName.d.ts.map +0 -1
- package/src/migrations/21-0-0/change-plugin-to-v1.d.ts.map +0 -1
- package/src/migrations/21-1-2/change-plugin-version-0-1-0.d.ts.map +0 -1
- package/src/migrations/21-3-0/change-plugin-version-0-1-2.d.ts.map +0 -1
- package/src/migrations/21-3-11/change-plugin-version-0-1-4.d.ts.map +0 -1
- package/src/migrations/21-4-0/change-plugin-version-0-1-5.d.ts.map +0 -1
- package/src/migrations/21-4-1/change-plugin-version-0-1-6.d.ts.map +0 -1
- package/src/migrations/21-5-1/change-plugin-version-0-1-7.d.ts.map +0 -1
- package/src/migrations/21-6-1/change-plugin-version-0-1-8.d.ts.map +0 -1
- package/src/migrations/22-1-0/change-plugin-version-0-1-9.d.ts.map +0 -1
- package/src/migrations/22-2-0/change-plugin-version-0-1-10.d.ts +0 -3
- package/src/migrations/22-2-0/change-plugin-version-0-1-10.d.ts.map +0 -1
- package/src/migrations/22-3-0/change-plugin-version-0-1-11.d.ts +0 -3
- package/src/migrations/22-3-0/change-plugin-version-0-1-11.d.ts.map +0 -1
- package/src/migrations/22-5-0/change-plugin-version-0-1-12.d.ts +0 -3
- package/src/migrations/22-5-0/change-plugin-version-0-1-12.d.ts.map +0 -1
- package/src/migrations/22-5-3/change-plugin-version-0-1-13.d.ts +0 -3
- package/src/migrations/22-5-3/change-plugin-version-0-1-13.d.ts.map +0 -1
- package/src/migrations/22-6-0/change-plugin-version-0-1-14.d.ts +0 -3
- package/src/migrations/22-6-0/change-plugin-version-0-1-14.d.ts.map +0 -1
- package/src/migrations/22-6-0/change-plugin-version-0-1-15.d.ts +0 -3
- package/src/migrations/22-6-0/change-plugin-version-0-1-15.d.ts.map +0 -1
- package/src/migrations/22-7-0/change-plugin-version-0-1-16.d.ts +0 -3
- package/src/migrations/22-7-0/change-plugin-version-0-1-16.d.ts.map +0 -1
- package/src/migrations/22-7-0/change-plugin-version-0-1-17.d.ts +0 -3
- package/src/migrations/22-7-0/change-plugin-version-0-1-17.d.ts.map +0 -1
- package/src/migrations/22-7-0/change-plugin-version-0-1-18.d.ts +0 -3
- package/src/migrations/22-7-0/change-plugin-version-0-1-18.d.ts.map +0 -1
- package/src/migrations/22-7-0/change-plugin-version-0-1-19.d.ts +0 -3
- package/src/migrations/22-7-0/change-plugin-version-0-1-19.d.ts.map +0 -1
- package/src/migrations/22-7-0/change-plugin-version-0-1-20.d.ts +0 -3
- package/src/migrations/22-7-0/change-plugin-version-0-1-20.d.ts.map +0 -1
- package/src/migrations/23-0-0/change-plugin-version-0-1-21.d.ts +0 -3
- package/src/migrations/23-0-0/change-plugin-version-0-1-21.d.ts.map +0 -1
- package/src/plugin/dependencies.d.ts.map +0 -1
- package/src/plugin/nodes.d.ts.map +0 -1
- package/src/plugin/utils/get-project-graph-from-gradle-plugin.d.ts.map +0 -1
- package/src/plugin/utils/get-project-graph-lines.d.ts.map +0 -1
- package/src/plugin/utils/gradle-plugin-options.d.ts.map +0 -1
- package/src/plugin-v1/dependencies.d.ts.map +0 -1
- package/src/plugin-v1/nodes.d.ts.map +0 -1
- package/src/plugin-v1/utils/get-gradle-report.d.ts.map +0 -1
- package/src/plugin-v1/utils/get-project-report-lines.d.ts.map +0 -1
- package/src/utils/exec-gradle.d.ts.map +0 -1
- package/src/utils/has-gradle-plugin.d.ts.map +0 -1
- package/src/utils/split-config-files.d.ts.map +0 -1
- package/src/utils/version-catalog-ast-utils.d.ts.map +0 -1
- package/src/utils/versions.d.ts.map +0 -1
- /package/{LICENSE → dist/LICENSE} +0 -0
- /package/{index.js → dist/index.js} +0 -0
- /package/{plugin-v1.js → dist/plugin-v1.js} +0 -0
- /package/{plugin.js → dist/plugin.js} +0 -0
- /package/{src → dist/src}/executors/gradle/get-exclude-task.js +0 -0
- /package/{src → dist/src}/executors/gradle/gradle-batch.impl.js +0 -0
- /package/{src → dist/src}/executors/gradle/gradle.impl.js +0 -0
- /package/{src → dist/src}/executors/gradle/schema.d.ts +0 -0
- /package/{src → dist/src}/executors/gradle/schema.json +0 -0
- /package/{src → dist/src}/generators/ci-workflow/files/circleci/.circleci/config.yml.template +0 -0
- /package/{src → dist/src}/generators/ci-workflow/files/github/.github/workflows/__workflowFileName__.yml.template +0 -0
- /package/{src → dist/src}/generators/ci-workflow/generator.js +0 -0
- /package/{src → dist/src}/generators/ci-workflow/schema.json +0 -0
- /package/{src → dist/src}/generators/init/gradle-project-graph-plugin-utils.js +0 -0
- /package/{src → dist/src}/generators/init/init.js +0 -0
- /package/{src → dist/src}/generators/init/schema.d.ts +0 -0
- /package/{src → dist/src}/generators/init/schema.json +0 -0
- /package/{src → dist/src}/migrations/21-0-0/change-ciTargetName-to-ciTestTargetName.js +0 -0
- /package/{src → dist/src}/migrations/21-0-0/change-ciTargetName-to-ciTestTargetName.md +0 -0
- /package/{src → dist/src}/migrations/21-0-0/change-plugin-to-v1.js +0 -0
- /package/{src → dist/src}/migrations/21-0-0/change-plugin-to-v1.md +0 -0
- /package/{src → dist/src}/migrations/21-1-2/change-plugin-version-0-1-0.js +0 -0
- /package/{src → dist/src}/migrations/21-1-2/change-plugin-version-0-1-0.md +0 -0
- /package/{src → dist/src}/migrations/21-3-0/change-plugin-version-0-1-2.js +0 -0
- /package/{src → dist/src}/migrations/21-3-0/change-plugin-version-0-1-2.md +0 -0
- /package/{src → dist/src}/migrations/21-3-11/change-plugin-version-0-1-4.js +0 -0
- /package/{src → dist/src}/migrations/21-3-11/change-plugin-version-0-1-4.md +0 -0
- /package/{src → dist/src}/migrations/21-4-0/change-plugin-version-0-1-5.js +0 -0
- /package/{src → dist/src}/migrations/21-4-0/change-plugin-version-0-1-5.md +0 -0
- /package/{src → dist/src}/migrations/21-4-1/change-plugin-version-0-1-6.js +0 -0
- /package/{src → dist/src}/migrations/21-4-1/change-plugin-version-0-1-6.md +0 -0
- /package/{src → dist/src}/migrations/21-5-1/change-plugin-version-0-1-7.js +0 -0
- /package/{src → dist/src}/migrations/21-5-1/change-plugin-version-0-1-7.md +0 -0
- /package/{src → dist/src}/migrations/21-6-1/change-plugin-version-0-1-8.js +0 -0
- /package/{src → dist/src}/migrations/21-6-1/change-plugin-version-0-1-8.md +0 -0
- /package/{src → dist/src}/migrations/22-1-0/change-plugin-version-0-1-9.js +0 -0
- /package/{src → dist/src}/migrations/22-1-0/change-plugin-version-0-1-9.md +0 -0
- /package/{src → dist/src}/migrations/22-2-0/change-plugin-version-0-1-10.js +0 -0
- /package/{src → dist/src}/migrations/22-2-0/change-plugin-version-0-1-10.md +0 -0
- /package/{src → dist/src}/migrations/22-3-0/change-plugin-version-0-1-11.js +0 -0
- /package/{src → dist/src}/migrations/22-3-0/change-plugin-version-0-1-11.md +0 -0
- /package/{src → dist/src}/migrations/22-5-0/change-plugin-version-0-1-12.js +0 -0
- /package/{src → dist/src}/migrations/22-5-0/change-plugin-version-0-1-12.md +0 -0
- /package/{src → dist/src}/migrations/22-5-3/change-plugin-version-0-1-13.js +0 -0
- /package/{src → dist/src}/migrations/22-5-3/change-plugin-version-0-1-13.md +0 -0
- /package/{src → dist/src}/migrations/22-6-0/change-plugin-version-0-1-14.js +0 -0
- /package/{src → dist/src}/migrations/22-6-0/change-plugin-version-0-1-14.md +0 -0
- /package/{src → dist/src}/migrations/22-6-0/change-plugin-version-0-1-15.js +0 -0
- /package/{src → dist/src}/migrations/22-6-0/change-plugin-version-0-1-15.md +0 -0
- /package/{src → dist/src}/migrations/22-7-0/change-plugin-version-0-1-16.js +0 -0
- /package/{src → dist/src}/migrations/22-7-0/change-plugin-version-0-1-16.md +0 -0
- /package/{src → dist/src}/migrations/22-7-0/change-plugin-version-0-1-17.js +0 -0
- /package/{src → dist/src}/migrations/22-7-0/change-plugin-version-0-1-17.md +0 -0
- /package/{src → dist/src}/migrations/22-7-0/change-plugin-version-0-1-18.js +0 -0
- /package/{src → dist/src}/migrations/22-7-0/change-plugin-version-0-1-18.md +0 -0
- /package/{src → dist/src}/migrations/22-7-0/change-plugin-version-0-1-19.js +0 -0
- /package/{src → dist/src}/migrations/22-7-0/change-plugin-version-0-1-19.md +0 -0
- /package/{src → dist/src}/migrations/22-7-0/change-plugin-version-0-1-20.js +0 -0
- /package/{src → dist/src}/migrations/22-7-0/change-plugin-version-0-1-20.md +0 -0
- /package/{src → dist/src}/migrations/23-0-0/change-plugin-version-0-1-21.js +0 -0
- /package/{src → dist/src}/migrations/23-0-0/change-plugin-version-0-1-21.md +0 -0
- /package/{src → dist/src}/plugin/dependencies.js +0 -0
- /package/{src → dist/src}/plugin/nodes.js +0 -0
- /package/{src → dist/src}/plugin/utils/get-project-graph-from-gradle-plugin.js +0 -0
- /package/{src → dist/src}/plugin/utils/get-project-graph-lines.js +0 -0
- /package/{src → dist/src}/plugin/utils/gradle-plugin-options.js +0 -0
- /package/{src → dist/src}/plugin-v1/dependencies.js +0 -0
- /package/{src → dist/src}/plugin-v1/nodes.js +0 -0
- /package/{src → dist/src}/plugin-v1/utils/get-gradle-report.js +0 -0
- /package/{src → dist/src}/plugin-v1/utils/get-project-report-lines.js +0 -0
- /package/{src → dist/src}/utils/exec-gradle.js +0 -0
- /package/{src → dist/src}/utils/has-gradle-plugin.js +0 -0
- /package/{src → dist/src}/utils/split-config-files.js +0 -0
- /package/{src → dist/src}/utils/version-catalog-ast-utils.js +0 -0
|
Binary file
|
|
Binary file
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './plugin';
|
|
@@ -5,4 +5,3 @@ export declare const createNodes: import("packages/devkit/dist").CreateNodes<imp
|
|
|
5
5
|
*/
|
|
6
6
|
export declare const createNodesV2: import("packages/devkit/dist").CreateNodes<import("./src/plugin/utils/gradle-plugin-options").GradlePluginOptions>;
|
|
7
7
|
export declare const createDependencies: import("packages/devkit/dist").CreateDependencies<import("./src/plugin/utils/gradle-plugin-options").GradlePluginOptions>;
|
|
8
|
-
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { ProjectGraphProjectNode, TaskGraph } from '@nx/devkit';
|
|
2
2
|
export declare function getExcludeTasksFromTaskGraph(taskIdsToExcludeDepsOf: Iterable<string>, runningTaskIds: Set<string>, taskGraph: TaskGraph, nodes: Record<string, ProjectGraphProjectNode>, includeDependsOnTasks?: Set<string>): Set<string>;
|
|
3
3
|
export declare function getAllDependsOnFromTaskGraph(startTaskIds: Iterable<string>, taskGraph: TaskGraph): Set<string>;
|
|
4
|
-
//# sourceMappingURL=get-exclude-task.d.ts.map
|
|
@@ -19,4 +19,3 @@ export declare function updateNxPluginVersion(content: string, newVersion: strin
|
|
|
19
19
|
* Ensures all build.gradle(.kts) files use the expected version of dev.nx.gradle.project-graph.
|
|
20
20
|
*/
|
|
21
21
|
export declare function addNxProjectGraphPlugin(tree: Tree, expectedVersion?: string): Promise<void>;
|
|
22
|
-
//# sourceMappingURL=gradle-project-graph-plugin-utils.d.ts.map
|
|
@@ -3,4 +3,3 @@ import { InitGeneratorSchema } from './schema';
|
|
|
3
3
|
export declare function initGenerator(tree: Tree, options: InitGeneratorSchema): Promise<GeneratorCallback>;
|
|
4
4
|
export declare function updateNxJsonConfiguration(tree: Tree): void;
|
|
5
5
|
export default initGenerator;
|
|
6
|
-
//# sourceMappingURL=init.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Tree } from '@nx/devkit';
|
|
2
|
+
export default function migrateCreateNodesV2ToCreateNodes(tree: Tree): Promise<void>;
|
|
3
|
+
/**
|
|
4
|
+
* Rewrites named imports and re-exports of `createNodesV2` to `createNodes`
|
|
5
|
+
* when they come from one of the given module specifiers. Only the named
|
|
6
|
+
* bindings are touched — the module specifier, the `import`/`export` keyword,
|
|
7
|
+
* any `type` modifier, and any default import are left untouched.
|
|
8
|
+
*/
|
|
9
|
+
export declare function rewriteCreateNodesV2Imports(source: string, specifiers: ReadonlySet<string>): string;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = migrateCreateNodesV2ToCreateNodes;
|
|
4
|
+
exports.rewriteCreateNodesV2Imports = rewriteCreateNodesV2Imports;
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
const TS_EXTENSIONS = ['.ts', '.tsx', '.cts', '.mts'];
|
|
7
|
+
const DEPRECATED_NAME = 'createNodesV2';
|
|
8
|
+
const CANONICAL_NAME = 'createNodes';
|
|
9
|
+
// Module specifiers from which `@nx/gradle` publicly exposes `createNodesV2`.
|
|
10
|
+
// A named import or re-export of `createNodesV2` from one of these is rewritten
|
|
11
|
+
// to the canonical `createNodes` export.
|
|
12
|
+
const TARGET_SPECIFIERS = new Set([
|
|
13
|
+
'@nx/gradle',
|
|
14
|
+
'@nx/gradle/plugin-v1',
|
|
15
|
+
]);
|
|
16
|
+
let ts;
|
|
17
|
+
async function migrateCreateNodesV2ToCreateNodes(tree) {
|
|
18
|
+
let touchedCount = 0;
|
|
19
|
+
(0, devkit_1.visitNotIgnoredFiles)(tree, '.', (filePath) => {
|
|
20
|
+
if (!TS_EXTENSIONS.some((ext) => filePath.endsWith(ext))) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const original = tree.read(filePath, 'utf-8');
|
|
24
|
+
if (!original || !original.includes(DEPRECATED_NAME)) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const updated = rewriteCreateNodesV2Imports(original, TARGET_SPECIFIERS);
|
|
28
|
+
if (updated !== original) {
|
|
29
|
+
tree.write(filePath, updated);
|
|
30
|
+
touchedCount += 1;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
if (touchedCount > 0) {
|
|
34
|
+
devkit_1.logger.info(`Renamed \`${DEPRECATED_NAME}\` imports to \`${CANONICAL_NAME}\` in ${touchedCount} file(s).`);
|
|
35
|
+
}
|
|
36
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Rewrites named imports and re-exports of `createNodesV2` to `createNodes`
|
|
40
|
+
* when they come from one of the given module specifiers. Only the named
|
|
41
|
+
* bindings are touched — the module specifier, the `import`/`export` keyword,
|
|
42
|
+
* any `type` modifier, and any default import are left untouched.
|
|
43
|
+
*/
|
|
44
|
+
function rewriteCreateNodesV2Imports(source, specifiers) {
|
|
45
|
+
ts ??= (0, devkit_1.ensurePackage)('typescript', '*');
|
|
46
|
+
const sourceFile = ts.createSourceFile('tmp.ts', source, ts.ScriptTarget.Latest,
|
|
47
|
+
/* setParentNodes */ true, ts.ScriptKind.TSX);
|
|
48
|
+
const changes = [];
|
|
49
|
+
for (const stmt of sourceFile.statements) {
|
|
50
|
+
if (ts.isImportDeclaration(stmt)) {
|
|
51
|
+
collectImportRewrite(sourceFile, stmt, specifiers, changes);
|
|
52
|
+
}
|
|
53
|
+
else if (ts.isExportDeclaration(stmt)) {
|
|
54
|
+
collectExportRewrite(sourceFile, stmt, specifiers, changes);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return changes.length > 0 ? (0, devkit_1.applyChangesToString)(source, changes) : source;
|
|
58
|
+
}
|
|
59
|
+
function isTargetSpecifier(node, specifiers) {
|
|
60
|
+
return ts.isStringLiteral(node) && specifiers.has(node.text);
|
|
61
|
+
}
|
|
62
|
+
function collectImportRewrite(sourceFile, stmt, specifiers, changes) {
|
|
63
|
+
if (!isTargetSpecifier(stmt.moduleSpecifier, specifiers)) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const namedBindings = stmt.importClause?.namedBindings;
|
|
67
|
+
// Only `import { ... }` carries renameable named bindings. `import x`,
|
|
68
|
+
// `import * as ns`, and side-effect imports reference the module wholesale
|
|
69
|
+
// and keep working through the `createNodesV2` runtime alias, so we leave
|
|
70
|
+
// them be. A mixed `import def, { createNodesV2 }` still has its named
|
|
71
|
+
// bindings rewritten below — the default binding is untouched.
|
|
72
|
+
if (!namedBindings || !ts.isNamedImports(namedBindings)) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
rewriteNamedBindings(sourceFile, namedBindings, changes);
|
|
76
|
+
}
|
|
77
|
+
function collectExportRewrite(sourceFile, stmt, specifiers, changes) {
|
|
78
|
+
if (!stmt.moduleSpecifier ||
|
|
79
|
+
!isTargetSpecifier(stmt.moduleSpecifier, specifiers)) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
// `export { ... } from '...'` can be rewritten; `export * from '...'` has no
|
|
83
|
+
// named bindings to rename.
|
|
84
|
+
if (!stmt.exportClause || !ts.isNamedExports(stmt.exportClause)) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
rewriteNamedBindings(sourceFile, stmt.exportClause, changes);
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Re-renders the `{ ... }` of a named import/export, renaming any
|
|
91
|
+
* `createNodesV2` specifier to `createNodes`. If renaming would collide with a
|
|
92
|
+
* `createNodes` that is already present (e.g. `{ createNodes, createNodesV2 }`),
|
|
93
|
+
* the duplicate is dropped. Returns without recording a change when the binding
|
|
94
|
+
* list contains no `createNodesV2`.
|
|
95
|
+
*/
|
|
96
|
+
function rewriteNamedBindings(sourceFile, namedBindings, changes) {
|
|
97
|
+
const elements = namedBindings.elements;
|
|
98
|
+
const hasDeprecated = elements.some((el) => (el.propertyName ?? el.name).text === DEPRECATED_NAME);
|
|
99
|
+
if (!hasDeprecated) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
const seen = new Set();
|
|
103
|
+
const rendered = [];
|
|
104
|
+
for (const el of elements) {
|
|
105
|
+
const text = renderSpecifier(el);
|
|
106
|
+
if (!seen.has(text)) {
|
|
107
|
+
seen.add(text);
|
|
108
|
+
rendered.push(text);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
const start = namedBindings.getStart(sourceFile);
|
|
112
|
+
changes.push({
|
|
113
|
+
type: devkit_1.ChangeType.Delete,
|
|
114
|
+
start,
|
|
115
|
+
length: namedBindings.getEnd() - start,
|
|
116
|
+
}, {
|
|
117
|
+
type: devkit_1.ChangeType.Insert,
|
|
118
|
+
index: start,
|
|
119
|
+
text: `{ ${rendered.join(', ')} }`,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
function renderSpecifier(el) {
|
|
123
|
+
const typePrefix = el.isTypeOnly ? 'type ' : '';
|
|
124
|
+
const rename = (name) => name === DEPRECATED_NAME ? CANONICAL_NAME : name;
|
|
125
|
+
// `{ name }` — no alias, so the local binding follows the rename.
|
|
126
|
+
if (!el.propertyName) {
|
|
127
|
+
return `${typePrefix}${rename(el.name.text)}`;
|
|
128
|
+
}
|
|
129
|
+
// `{ propertyName as name }` — only the imported (left) side is renamed; the
|
|
130
|
+
// local alias is preserved. A now-redundant alias such as
|
|
131
|
+
// `createNodesV2 as createNodes` collapses to `createNodes`.
|
|
132
|
+
const canonicalImported = rename(el.propertyName.text);
|
|
133
|
+
const localName = el.name.text;
|
|
134
|
+
return canonicalImported === localName
|
|
135
|
+
? `${typePrefix}${localName}`
|
|
136
|
+
: `${typePrefix}${canonicalImported} as ${localName}`;
|
|
137
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#### Rename `createNodesV2` imports to `createNodes`
|
|
2
|
+
|
|
3
|
+
`@nx/gradle` renamed its primary inferred-plugin export from `createNodesV2` to `createNodes`. The `createNodesV2` name is preserved as a deprecated alias for now, but new code should use `createNodes`.
|
|
4
|
+
|
|
5
|
+
This migration scans every `.ts`, `.tsx`, `.cts`, and `.mts` file in your workspace and rewrites named imports and re-exports of `createNodesV2` from `@nx/gradle` and `@nx/gradle/plugin-v1` to `createNodes`.
|
|
6
|
+
|
|
7
|
+
#### Sample Code Changes
|
|
8
|
+
|
|
9
|
+
##### Before
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { createNodesV2 } from '@nx/gradle';
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
##### After
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { createNodes } from '@nx/gradle';
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Aliases are preserved (`createNodesV2 as cn` becomes `createNodes as cn`), and if a file already imports both names (`{ createNodes, createNodesV2 }`) the redundant binding is dropped.
|
|
22
|
+
|
|
23
|
+
#### What is not rewritten
|
|
24
|
+
|
|
25
|
+
Only static `import`/`export` named bindings from `@nx/gradle` and `@nx/gradle/plugin-v1` are rewritten. Namespace imports, dynamic `import(...)`, `require(...)` destructuring, and property access such as `plugin.createNodesV2` are left untouched — they keep working through the `createNodesV2` runtime alias. Update those by hand if you want to drop the deprecated name everywhere.
|
|
@@ -26,4 +26,3 @@ export declare function getCurrentBuildFiles(): string[];
|
|
|
26
26
|
*/
|
|
27
27
|
export declare function populateProjectGraph(workspaceRoot: string, gradlewFiles: string[], options: GradlePluginOptions): Promise<void>;
|
|
28
28
|
export declare function processNxProjectGraph(projectGraphLines: string[]): ProjectGraphReport;
|
|
29
|
-
//# sourceMappingURL=get-project-graph-from-gradle-plugin.d.ts.map
|
|
@@ -6,4 +6,3 @@ import { GradlePluginOptions } from './gradle-plugin-options';
|
|
|
6
6
|
export declare function cancelPendingProjectGraphRequest(): void;
|
|
7
7
|
export declare function getGraphTimeoutMs(): number;
|
|
8
8
|
export declare function getNxProjectGraphLines(gradlewFile: string, gradleConfigHash: string, gradlePluginOptions: GradlePluginOptions): Promise<string[]>;
|
|
9
|
-
//# sourceMappingURL=get-project-graph-lines.d.ts.map
|
|
@@ -34,4 +34,3 @@ export declare function getCurrentGradleReport(): GradleReport;
|
|
|
34
34
|
export declare function populateGradleReport(workspaceRoot: string, gradlewFiles: string[]): Promise<void>;
|
|
35
35
|
export declare function processProjectReports(projectReportLines: string[]): GradleReport;
|
|
36
36
|
export declare function processGradleDependencies(depsFile: string): Set<string>;
|
|
37
|
-
//# sourceMappingURL=get-gradle-report.d.ts.map
|
|
@@ -27,4 +27,3 @@ export declare function getCustomGradleExecutableDirectoryFromPlugin(nxJson: NxJ
|
|
|
27
27
|
export declare function findGradlewFile(filePathToSearch: string, workspaceRoot: string, customExecutableDirectory?: string): string;
|
|
28
28
|
export declare function findGradlewUsingFilePathTraversal(filePathToSearch: string, workspaceRoot: string, currentSearchPath?: string): string;
|
|
29
29
|
export declare function findGradlewUsingCustomExecutableDirectory(customGradleExecutableDirectory: string, workspaceRoot: string): string;
|
|
30
|
-
//# sourceMappingURL=exec-gradle.d.ts.map
|
|
@@ -17,4 +17,3 @@ export declare function extractPluginVersionFromCatalogAst(sourceText: string, p
|
|
|
17
17
|
* Updates Nx plugin version in all catalog files using AST-based approach
|
|
18
18
|
*/
|
|
19
19
|
export declare function updateNxPluginVersionInCatalogsAst(tree: Tree, expectedVersion: string): Promise<boolean>;
|
|
20
|
-
//# sourceMappingURL=version-catalog-ast-utils.d.ts.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.gradleProjectGraphVersion = exports.gradleProjectGraphPluginName = exports.nxVersion = void 0;
|
|
4
|
-
|
|
4
|
+
const path_1 = require("path");
|
|
5
|
+
exports.nxVersion = require((0, path_1.join)('@nx/gradle', 'package.json')).version;
|
|
5
6
|
exports.gradleProjectGraphPluginName = 'dev.nx.gradle.project-graph';
|
|
6
7
|
exports.gradleProjectGraphVersion = '0.1.21';
|
package/executors.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"executors": {
|
|
3
3
|
"gradle": {
|
|
4
|
-
"batchImplementation": "./src/executors/gradle/gradle-batch.impl",
|
|
5
|
-
"implementation": "./src/executors/gradle/gradle.impl",
|
|
6
|
-
"schema": "./src/executors/gradle/schema.json",
|
|
4
|
+
"batchImplementation": "./dist/src/executors/gradle/gradle-batch.impl",
|
|
5
|
+
"implementation": "./dist/src/executors/gradle/gradle.impl",
|
|
6
|
+
"schema": "./dist/src/executors/gradle/schema.json",
|
|
7
7
|
"description": "Runs gradle tasks via the Gradle Tooling API or by invoking gradlew.",
|
|
8
8
|
"preferBatch": true
|
|
9
9
|
}
|
package/generators.json
CHANGED
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
"version": "0.1",
|
|
4
4
|
"generators": {
|
|
5
5
|
"init": {
|
|
6
|
-
"factory": "./src/generators/init/init#initGenerator",
|
|
7
|
-
"schema": "./src/generators/init/schema.json",
|
|
6
|
+
"factory": "./dist/src/generators/init/init#initGenerator",
|
|
7
|
+
"schema": "./dist/src/generators/init/schema.json",
|
|
8
8
|
"description": "Initializes a Gradle project in the current workspace",
|
|
9
9
|
"hidden": true
|
|
10
10
|
},
|
|
11
11
|
"ci-workflow": {
|
|
12
|
-
"factory": "./src/generators/ci-workflow/generator",
|
|
13
|
-
"schema": "./src/generators/ci-workflow/schema.json",
|
|
12
|
+
"factory": "./dist/src/generators/ci-workflow/generator",
|
|
13
|
+
"schema": "./dist/src/generators/ci-workflow/schema.json",
|
|
14
14
|
"description": "Setup a CI Workflow to run Nx in CI"
|
|
15
15
|
}
|
|
16
16
|
}
|