@nx/plugin 0.0.0-pr-31222-862e973 → 0.0.0-pr-31313-387cdca
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/LICENSE +1 -1
- package/README.md +1 -1
- package/generators.json +4 -4
- package/migrations.json +1 -20
- package/package.json +5 -6
- package/src/generators/create-package/create-package.js +40 -15
- package/src/generators/create-package/files/create-framework-package/bin/index.ts__tmpl__ +11 -7
- package/src/generators/create-package/files/e2e/__cliName__.spec.ts__tmpl__ +8 -6
- package/src/generators/create-package/schema.d.ts +8 -7
- package/src/generators/create-package/schema.json +16 -19
- package/src/generators/create-package/utils/normalize-schema.d.ts +6 -0
- package/src/generators/create-package/utils/normalize-schema.js +21 -4
- package/src/generators/e2e-project/e2e.d.ts +1 -2
- package/src/generators/e2e-project/e2e.js +67 -32
- package/src/generators/e2e-project/files/src/{__pluginName__.spec.ts__tmpl__ → __simplePluginName__.spec.ts__tmpl__} +9 -7
- package/src/generators/e2e-project/schema.d.ts +1 -2
- package/src/generators/e2e-project/schema.json +5 -7
- package/src/generators/executor/executor.d.ts +2 -3
- package/src/generators/executor/executor.js +31 -29
- package/src/generators/executor/files/executor/{executor.spec.ts.template → __fileName__.spec.ts.template} +11 -2
- package/src/generators/executor/schema.d.ts +3 -11
- package/src/generators/executor/schema.json +7 -29
- package/src/generators/generator/files/generator/{generator.spec.ts.template → __fileName__.spec.ts.template} +1 -1
- package/src/generators/generator/generator.d.ts +1 -2
- package/src/generators/generator/generator.js +30 -28
- package/src/generators/generator/schema.d.ts +3 -11
- package/src/generators/generator/schema.json +17 -25
- package/src/generators/migration/migration.d.ts +2 -3
- package/src/generators/migration/migration.js +39 -43
- package/src/generators/migration/schema.d.ts +1 -9
- package/src/generators/migration/schema.json +16 -22
- package/src/generators/plugin/plugin.d.ts +1 -1
- package/src/generators/plugin/plugin.js +42 -41
- package/src/generators/plugin/schema.d.ts +7 -7
- package/src/generators/plugin/schema.json +16 -18
- package/src/generators/plugin/utils/normalize-schema.d.ts +10 -4
- package/src/generators/plugin/utils/normalize-schema.js +21 -17
- package/src/generators/preset/generator.d.ts +5 -3
- package/src/generators/preset/generator.js +48 -21
- package/src/generators/preset/schema.d.ts +9 -0
- package/src/generators/preset/schema.json +4 -0
- package/src/utils/paths.d.ts +2 -0
- package/src/utils/paths.js +31 -0
- package/src/utils/testing-utils/async-commands.js +1 -1
- package/src/utils/testing-utils/commands.js +1 -1
- package/src/utils/testing-utils/nx-project.js +2 -2
- package/src/migrations/update-16-0-0/cli-in-schema-json.d.ts +0 -3
- package/src/migrations/update-16-0-0/cli-in-schema-json.js +0 -134
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.d.ts +0 -2
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js +0 -9
- package/src/migrations/update-16-2-0/replace-e2e-executor.d.ts +0 -7
- package/src/migrations/update-16-2-0/replace-e2e-executor.js +0 -32
- /package/src/generators/executor/files/executor/{executor.ts.template → __fileName__.ts.template} +0 -0
- /package/src/generators/generator/files/generator/{generator.ts.template → __fileName__.ts.template} +0 -0
- /package/src/generators/migration/files/migration/{__name__.spec.ts__tmpl__ → __fileName__.spec.ts__tmpl__} +0 -0
- /package/src/generators/migration/files/migration/{__name__.ts__tmpl__ → __fileName__.ts__tmpl__} +0 -0
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.presetGenerator = presetGenerator;
|
|
4
|
+
exports.presetGeneratorInternal = presetGeneratorInternal;
|
|
4
5
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const
|
|
6
|
-
const plugin_1 = require("../plugin/plugin");
|
|
6
|
+
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
7
7
|
const create_package_1 = require("../create-package/create-package");
|
|
8
|
-
|
|
8
|
+
const plugin_1 = require("../plugin/plugin");
|
|
9
|
+
async function presetGenerator(tree, rawOptions) {
|
|
10
|
+
return await presetGeneratorInternal(tree, {
|
|
11
|
+
addPlugin: false,
|
|
12
|
+
useProjectJson: true,
|
|
13
|
+
...rawOptions,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
async function presetGeneratorInternal(tree, rawOptions) {
|
|
9
17
|
const tasks = [];
|
|
10
|
-
const
|
|
11
|
-
? options.pluginName.split('/')[1]
|
|
12
|
-
: options.pluginName).fileName;
|
|
13
|
-
options.createPackageName =
|
|
14
|
-
options.createPackageName === 'false' // for command line in e2e, it is passed as a string
|
|
15
|
-
? undefined
|
|
16
|
-
: options.createPackageName;
|
|
18
|
+
const options = normalizeOptions(tree, rawOptions);
|
|
17
19
|
const pluginTask = await (0, plugin_1.pluginGenerator)(tree, {
|
|
18
20
|
compiler: 'tsc',
|
|
19
|
-
linter:
|
|
20
|
-
name: pluginProjectName,
|
|
21
|
+
linter: 'eslint',
|
|
21
22
|
skipFormat: true,
|
|
22
23
|
unitTestRunner: 'jest',
|
|
23
24
|
importPath: options.pluginName,
|
|
@@ -25,23 +26,27 @@ async function default_1(tree, options) {
|
|
|
25
26
|
publishable: true,
|
|
26
27
|
// when creating a CLI package, the plugin will be in the packages folder
|
|
27
28
|
directory: options.createPackageName && options.createPackageName !== 'false'
|
|
28
|
-
?
|
|
29
|
-
:
|
|
29
|
+
? `packages/${options.pluginName}`
|
|
30
|
+
: options.pluginName,
|
|
30
31
|
rootProject: options.createPackageName ? false : true,
|
|
32
|
+
useProjectJson: options.useProjectJson,
|
|
33
|
+
addPlugin: options.addPlugin,
|
|
31
34
|
});
|
|
32
35
|
tasks.push(pluginTask);
|
|
33
36
|
moveNxPluginToDevDeps(tree);
|
|
34
37
|
if (options.createPackageName) {
|
|
35
38
|
const e2eProject = `${options.pluginName}-e2e`;
|
|
36
|
-
const cliTask = await (0, create_package_1.
|
|
37
|
-
directory:
|
|
39
|
+
const cliTask = await (0, create_package_1.createPackageGenerator)(tree, {
|
|
40
|
+
directory: `packages/${options.createPackageName}`,
|
|
38
41
|
name: options.createPackageName,
|
|
39
42
|
e2eProject: e2eProject,
|
|
40
43
|
project: options.pluginName,
|
|
41
44
|
skipFormat: true,
|
|
42
45
|
unitTestRunner: 'jest',
|
|
43
|
-
linter:
|
|
46
|
+
linter: 'eslint',
|
|
44
47
|
compiler: 'tsc',
|
|
48
|
+
useProjectJson: options.useProjectJson,
|
|
49
|
+
addPlugin: options.addPlugin,
|
|
45
50
|
});
|
|
46
51
|
tasks.push(cliTask);
|
|
47
52
|
}
|
|
@@ -50,9 +55,31 @@ async function default_1(tree, options) {
|
|
|
50
55
|
}
|
|
51
56
|
function moveNxPluginToDevDeps(tree) {
|
|
52
57
|
(0, devkit_1.updateJson)(tree, 'package.json', (json) => {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
58
|
+
if (json.dependencies['@nx/plugin']) {
|
|
59
|
+
const nxPluginEntry = json.dependencies['@nx/plugin'];
|
|
60
|
+
delete json.dependencies['@nx/plugin'];
|
|
61
|
+
json.devDependencies['@nx/plugin'] = nxPluginEntry;
|
|
62
|
+
}
|
|
56
63
|
return json;
|
|
57
64
|
});
|
|
58
65
|
}
|
|
66
|
+
function normalizeOptions(tree, options) {
|
|
67
|
+
const isTsSolutionSetup = (0, ts_solution_setup_1.isUsingTsSolutionSetup)(tree);
|
|
68
|
+
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
69
|
+
const addPlugin = options.addPlugin ??
|
|
70
|
+
(isTsSolutionSetup &&
|
|
71
|
+
process.env.NX_ADD_PLUGINS !== 'false' &&
|
|
72
|
+
nxJson.useInferencePlugins !== false);
|
|
73
|
+
return {
|
|
74
|
+
...options,
|
|
75
|
+
pluginName: (0, devkit_1.names)(options.pluginName.includes('/')
|
|
76
|
+
? options.pluginName.split('/')[1]
|
|
77
|
+
: options.pluginName).fileName,
|
|
78
|
+
createPackageName: options.createPackageName === 'false' // for command line in e2e, it is passed as a string
|
|
79
|
+
? undefined
|
|
80
|
+
: options.createPackageName,
|
|
81
|
+
addPlugin,
|
|
82
|
+
useProjectJson: options.useProjectJson ?? !isTsSolutionSetup,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
exports.default = presetGenerator;
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
export interface PresetGeneratorSchema {
|
|
2
2
|
pluginName: string;
|
|
3
3
|
createPackageName?: string;
|
|
4
|
+
useProjectJson?: boolean;
|
|
5
|
+
addPlugin?: boolean;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface NormalizedPresetGeneratorOptions
|
|
9
|
+
extends PresetGeneratorSchema {
|
|
10
|
+
createPackageName: string;
|
|
11
|
+
useProjectJson: boolean;
|
|
12
|
+
addPlugin: boolean;
|
|
4
13
|
}
|
|
@@ -24,6 +24,10 @@
|
|
|
24
24
|
"createPackageName": {
|
|
25
25
|
"type": "string",
|
|
26
26
|
"description": "Name of package which creates a workspace"
|
|
27
|
+
},
|
|
28
|
+
"useProjectJson": {
|
|
29
|
+
"type": "boolean",
|
|
30
|
+
"description": "Use a `project.json` configuration file instead of inlining the Nx configuration in the `package.json` file."
|
|
27
31
|
}
|
|
28
32
|
},
|
|
29
33
|
"required": ["pluginName"]
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getArtifactMetadataDirectory = getArtifactMetadataDirectory;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const posix_1 = require("node:path/posix");
|
|
6
|
+
function getArtifactMetadataDirectory(tree, projectName, sourceDirectory, isTsSolutionSetup) {
|
|
7
|
+
const project = (0, devkit_1.readProjectConfiguration)(tree, projectName);
|
|
8
|
+
if (!isTsSolutionSetup) {
|
|
9
|
+
return `./${(0, posix_1.relative)(project.root, sourceDirectory)}`;
|
|
10
|
+
}
|
|
11
|
+
const target = Object.values(project.targets ?? {}).find((t) => t.executor === '@nx/js:tsc' || t.executor === '@nx/js:swc');
|
|
12
|
+
// the repo is using the new ts setup where the outputs are contained inside the project
|
|
13
|
+
if (target?.executor === '@nx/js:tsc') {
|
|
14
|
+
// the @nx/js:tsc executor defaults rootDir to the project root
|
|
15
|
+
return `./${(0, posix_1.join)('dist', (0, posix_1.relative)(target.options.rootDir ?? project.root, sourceDirectory))}`;
|
|
16
|
+
}
|
|
17
|
+
if (target?.executor === '@nx/js:swc') {
|
|
18
|
+
return `./${(0, posix_1.join)('dist', target.options.stripLeadingPaths
|
|
19
|
+
? (0, posix_1.relative)((0, posix_1.dirname)(target.options.main), sourceDirectory)
|
|
20
|
+
: (0, posix_1.relative)(project.root, sourceDirectory))}`;
|
|
21
|
+
}
|
|
22
|
+
// We generate the plugin with the executors above, so we shouldn't get here
|
|
23
|
+
// unless the user manually changed the build process. In that case, we can't
|
|
24
|
+
// reliably determine the output directory because it depends on the build
|
|
25
|
+
// tool, so we'll just assume some defaults.
|
|
26
|
+
const baseDir = project.sourceRoot ??
|
|
27
|
+
(tree.exists((0, posix_1.join)(project.root, 'src'))
|
|
28
|
+
? (0, posix_1.join)(project.root, 'src')
|
|
29
|
+
: project.root);
|
|
30
|
+
return `./${(0, posix_1.join)('dist', (0, posix_1.relative)(baseDir, sourceDirectory))}`;
|
|
31
|
+
}
|
|
@@ -19,7 +19,7 @@ function runCommandAsync(command, opts = {
|
|
|
19
19
|
(0, child_process_1.exec)(command, {
|
|
20
20
|
cwd: opts.cwd ?? (0, paths_1.tmpProjPath)(),
|
|
21
21
|
env: { ...process.env, ...opts.env },
|
|
22
|
-
windowsHide:
|
|
22
|
+
windowsHide: false,
|
|
23
23
|
}, (err, stdout, stderr) => {
|
|
24
24
|
if (!opts.silenceError && err) {
|
|
25
25
|
reject(err);
|
|
@@ -21,7 +21,7 @@ function runNxCommand(command, opts = {
|
|
|
21
21
|
const execSyncOptions = {
|
|
22
22
|
cwd,
|
|
23
23
|
env: { ...process.env, ...opts.env },
|
|
24
|
-
windowsHide:
|
|
24
|
+
windowsHide: false,
|
|
25
25
|
};
|
|
26
26
|
if ((0, utils_1.fileExists)((0, paths_1.tmpProjPath)('package.json'))) {
|
|
27
27
|
const pmc = (0, devkit_1.getPackageManagerCommand)((0, devkit_1.detectPackageManager)(cwd));
|
|
@@ -17,7 +17,7 @@ function runNxNewCommand(args, silent) {
|
|
|
17
17
|
return (0, child_process_1.execSync)(`node ${require.resolve('nx')} new proj --nx-workspace-root=${localTmpDir} --no-interactive --skip-install --collection=@nx/workspace --npmScope=proj --preset=apps ${args || ''}`, {
|
|
18
18
|
cwd: localTmpDir,
|
|
19
19
|
...(silent && false ? { stdio: ['ignore', 'ignore', 'ignore'] } : {}),
|
|
20
|
-
windowsHide:
|
|
20
|
+
windowsHide: false,
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
function patchPackageJsonForPlugin(npmPackageName, distPath) {
|
|
@@ -45,7 +45,7 @@ function runPackageManagerInstall(silent = true) {
|
|
|
45
45
|
const install = (0, child_process_1.execSync)(pmc.install, {
|
|
46
46
|
cwd,
|
|
47
47
|
...(silent ? { stdio: ['ignore', 'ignore', 'ignore'] } : {}),
|
|
48
|
-
windowsHide:
|
|
48
|
+
windowsHide: false,
|
|
49
49
|
});
|
|
50
50
|
return install ? install.toString() : '';
|
|
51
51
|
}
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateCliPropsForPlugins = updateCliPropsForPlugins;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const package_json_1 = require("nx/src/utils/package-json");
|
|
6
|
-
const path_1 = require("path");
|
|
7
|
-
function updateCliPropsForPlugins(tree) {
|
|
8
|
-
const projects = (0, devkit_1.getProjects)(tree);
|
|
9
|
-
for (const project of projects.values()) {
|
|
10
|
-
if (tree.exists((0, devkit_1.joinPathFragments)(project.root, 'package.json'))) {
|
|
11
|
-
const packageJson = (0, devkit_1.readJson)(tree, (0, devkit_1.joinPathFragments)(project.root, 'package.json'));
|
|
12
|
-
const migrateConfig = (0, package_json_1.readNxMigrateConfig)(packageJson);
|
|
13
|
-
if (migrateConfig.migrations) {
|
|
14
|
-
const migrationsPath = (0, devkit_1.joinPathFragments)(project.root, migrateConfig.migrations);
|
|
15
|
-
if (tree.exists(migrationsPath)) {
|
|
16
|
-
updateMigrationsJsonForPlugin(tree, migrationsPath);
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
devkit_1.output.warn({
|
|
20
|
-
title: `Migrations file specified for ${packageJson.name} does not exist: ${migrationsPath}`,
|
|
21
|
-
bodyLines: [
|
|
22
|
-
'Please ensure that migrations that use the Angular Devkit are placed inside the `schematics` property, and migrations that use the Nx Devkit are placed inside the `generators` property.',
|
|
23
|
-
],
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
if (packageJson.generators) {
|
|
28
|
-
const generatorsPath = (0, devkit_1.joinPathFragments)(project.root, packageJson.generators);
|
|
29
|
-
if (tree.exists(generatorsPath)) {
|
|
30
|
-
removeCliFromGeneratorSchemaJsonFiles(tree, generatorsPath);
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
devkit_1.output.warn({
|
|
34
|
-
title: `Generators file specified for ${packageJson.name} does not exist: ${generatorsPath}`,
|
|
35
|
-
bodyLines: [
|
|
36
|
-
"The `cli` property inside generator's `schema.json` files is no longer supported.",
|
|
37
|
-
],
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
if (packageJson.executors) {
|
|
42
|
-
const executorsPath = (0, devkit_1.joinPathFragments)(project.root, packageJson.executors);
|
|
43
|
-
if (tree.exists(executorsPath)) {
|
|
44
|
-
removeCliFromExecutorSchemaJsonFiles(tree, executorsPath);
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
devkit_1.output.warn({
|
|
48
|
-
title: `Executors file specified for ${packageJson.name} does not exist: ${executorsPath}`,
|
|
49
|
-
bodyLines: [
|
|
50
|
-
"The `cli` property inside executor's `schema.json` files is no longer supported.",
|
|
51
|
-
],
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
if (packageJson.builders) {
|
|
56
|
-
const buildersPath = (0, devkit_1.joinPathFragments)(project.root, packageJson.builders);
|
|
57
|
-
if (tree.exists(buildersPath)) {
|
|
58
|
-
removeCliFromExecutorSchemaJsonFiles(tree, buildersPath);
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
devkit_1.output.warn({
|
|
62
|
-
title: `Builders file specified for ${packageJson.name} does not exist: ${buildersPath}`,
|
|
63
|
-
bodyLines: [
|
|
64
|
-
"The `cli` property inside builder's `schema.json` files is no longer supported.",
|
|
65
|
-
],
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
if (packageJson.schematics) {
|
|
70
|
-
const schematicsPath = (0, devkit_1.joinPathFragments)(project.root, packageJson.schematics);
|
|
71
|
-
if (tree.exists(schematicsPath)) {
|
|
72
|
-
removeCliFromGeneratorSchemaJsonFiles(tree, schematicsPath);
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
devkit_1.output.warn({
|
|
76
|
-
title: `Schematics file specified for ${packageJson.name} does not exist: ${schematicsPath}`,
|
|
77
|
-
bodyLines: [
|
|
78
|
-
"The `cli` property inside schematic's `schema.json` files is no longer supported.",
|
|
79
|
-
],
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
function removeCliFromExecutorSchemaJsonFiles(tree, collectionPath) {
|
|
87
|
-
const collection = (0, devkit_1.readJson)(tree, collectionPath);
|
|
88
|
-
for (const [name, entry] of Object.entries(collection.executors ?? {}).concat(Object.entries(collection.builders ?? {}))) {
|
|
89
|
-
deleteCliPropFromSchemaFile(collectionPath, entry, tree);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
function removeCliFromGeneratorSchemaJsonFiles(tree, collectionPath) {
|
|
93
|
-
const collection = (0, devkit_1.readJson)(tree, collectionPath);
|
|
94
|
-
for (const [name, entry] of Object.entries(collection.generators ?? {}).concat(Object.entries(collection.schematics ?? {}))) {
|
|
95
|
-
deleteCliPropFromSchemaFile(collectionPath, entry, tree);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
function updateMigrationsJsonForPlugin(tree, collectionPath) {
|
|
99
|
-
(0, devkit_1.updateJson)(tree, collectionPath, (json) => {
|
|
100
|
-
for (const migration in json.generators ?? {}) {
|
|
101
|
-
if (!(json.generators[migration].cli === 'nx')) {
|
|
102
|
-
json.schematics ??= {};
|
|
103
|
-
json.schematics[migration] = json.generators[migration];
|
|
104
|
-
delete json.generators[migration];
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
for (const migration in json.schematics ?? {}) {
|
|
108
|
-
if (json.schematics[migration].cli === 'nx') {
|
|
109
|
-
json.generators ??= {};
|
|
110
|
-
json.generators[migration] = json.schematics[migration];
|
|
111
|
-
delete json.schematics[migration];
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
return json;
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
exports.default = updateCliPropsForPlugins;
|
|
118
|
-
function deleteCliPropFromSchemaFile(collectionPath, entry, tree) {
|
|
119
|
-
if (typeof entry === 'string' || !entry.schema) {
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
const schemaPath = (0, devkit_1.joinPathFragments)((0, path_1.dirname)(collectionPath), entry.schema);
|
|
123
|
-
if (tree.exists(schemaPath)) {
|
|
124
|
-
(0, devkit_1.updateJson)(tree, schemaPath, (json) => {
|
|
125
|
-
if (json.cli) {
|
|
126
|
-
delete json.cli;
|
|
127
|
-
}
|
|
128
|
-
return json;
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
else {
|
|
132
|
-
console.warn(`Could not find schema file ${schemaPath}`);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = replacePackage;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const replace_package_1 = require("@nx/devkit/src/utils/replace-package");
|
|
6
|
-
async function replacePackage(tree) {
|
|
7
|
-
await (0, replace_package_1.replaceNrwlPackageWithNxPackage)(tree, '@nrwl/nx-plugin', '@nx/plugin');
|
|
8
|
-
await (0, devkit_1.formatFiles)(tree);
|
|
9
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Tree } from '@nx/devkit';
|
|
2
|
-
import { JestExecutorOptions } from '@nx/jest/src/executors/jest/schema';
|
|
3
|
-
export interface NxPluginE2EExecutorOptions extends JestExecutorOptions {
|
|
4
|
-
target: string;
|
|
5
|
-
jestConfig: string;
|
|
6
|
-
}
|
|
7
|
-
export default function replaceE2EExecutor(tree: Tree): Promise<void>;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = replaceE2EExecutor;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const executor_options_utils_1 = require("@nx/devkit/src/generators/executor-options-utils");
|
|
6
|
-
async function replaceE2EExecutor(tree) {
|
|
7
|
-
const projects = (0, devkit_1.getProjects)(tree);
|
|
8
|
-
for (const executor of ['@nx/plugin:e2e', '@nrwl/nx-plugin:e2e']) {
|
|
9
|
-
(0, executor_options_utils_1.forEachExecutorOptions)(tree, executor, (options, project, target, configuration) => {
|
|
10
|
-
const projectConfiguration = projects.get(project);
|
|
11
|
-
const config = {
|
|
12
|
-
...options,
|
|
13
|
-
target: undefined,
|
|
14
|
-
runInBand: true,
|
|
15
|
-
};
|
|
16
|
-
if (configuration) {
|
|
17
|
-
projectConfiguration.targets[target].configurations[configuration] =
|
|
18
|
-
config;
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
projectConfiguration.targets[target].dependsOn = [
|
|
22
|
-
...(projectConfiguration.targets[target].dependsOn ?? []),
|
|
23
|
-
options.target,
|
|
24
|
-
];
|
|
25
|
-
projectConfiguration.targets[target].executor = '@nx/jest:jest';
|
|
26
|
-
projectConfiguration.targets[target].options = config;
|
|
27
|
-
}
|
|
28
|
-
(0, devkit_1.updateProjectConfiguration)(tree, project, projectConfiguration);
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
await (0, devkit_1.formatFiles)(tree);
|
|
32
|
-
}
|
/package/src/generators/executor/files/executor/{executor.ts.template → __fileName__.ts.template}
RENAMED
|
File without changes
|
/package/src/generators/generator/files/generator/{generator.ts.template → __fileName__.ts.template}
RENAMED
|
File without changes
|
|
File without changes
|
/package/src/generators/migration/files/migration/{__name__.ts__tmpl__ → __fileName__.ts__tmpl__}
RENAMED
|
File without changes
|