@nx/plugin 16.0.0-beta.5
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/CHANGELOG.md +8 -0
- package/LICENSE +22 -0
- package/README.md +67 -0
- package/executors.json +16 -0
- package/generators.d.ts +6 -0
- package/generators.js +10 -0
- package/generators.js.map +1 -0
- package/generators.json +81 -0
- package/index.d.ts +0 -0
- package/index.js +1 -0
- package/index.js.map +1 -0
- package/migrations.json +46 -0
- package/package.json +45 -0
- package/src/executors/e2e/compat.d.ts +1 -0
- package/src/executors/e2e/compat.js +7 -0
- package/src/executors/e2e/compat.js.map +1 -0
- package/src/executors/e2e/e2e.impl.d.ts +7 -0
- package/src/executors/e2e/e2e.impl.js +81 -0
- package/src/executors/e2e/e2e.impl.js.map +1 -0
- package/src/executors/e2e/schema.d.ts +6 -0
- package/src/executors/e2e/schema.json +220 -0
- package/src/generators/create-package/create-package.d.ts +5 -0
- package/src/generators/create-package/create-package.js +115 -0
- package/src/generators/create-package/create-package.js.map +1 -0
- package/src/generators/create-package/files/create-framework-package/bin/index.ts__tmpl__ +26 -0
- package/src/generators/create-package/files/e2e/__name__.spec.ts__tmpl__ +30 -0
- package/src/generators/create-package/schema.d.ts +17 -0
- package/src/generators/create-package/schema.json +69 -0
- package/src/generators/create-package/utils/normalize-schema.d.ts +10 -0
- package/src/generators/create-package/utils/normalize-schema.js +22 -0
- package/src/generators/create-package/utils/normalize-schema.js.map +1 -0
- package/src/generators/e2e-project/e2e.d.ts +6 -0
- package/src/generators/e2e-project/e2e.js +107 -0
- package/src/generators/e2e-project/e2e.js.map +1 -0
- package/src/generators/e2e-project/files/tests/__pluginName__.spec.ts__tmpl__ +37 -0
- package/src/generators/e2e-project/files/tsconfig.json__tmpl__ +6 -0
- package/src/generators/e2e-project/schema.d.ts +12 -0
- package/src/generators/e2e-project/schema.json +57 -0
- package/src/generators/executor/executor.d.ts +6 -0
- package/src/generators/executor/executor.js +104 -0
- package/src/generators/executor/executor.js.map +1 -0
- package/src/generators/executor/files/executor/__fileName__/executor.spec.ts__tmpl__ +11 -0
- package/src/generators/executor/files/executor/__fileName__/executor.ts__tmpl__ +11 -0
- package/src/generators/executor/files/executor/__fileName__/schema.d.ts__tmpl__ +1 -0
- package/src/generators/executor/files/executor/__fileName__/schema.json__tmpl__ +9 -0
- package/src/generators/executor/files/hasher/__fileName__/hasher.spec.ts__tmpl__ +22 -0
- package/src/generators/executor/files/hasher/__fileName__/hasher.ts__tmpl__ +12 -0
- package/src/generators/executor/schema.d.ts +9 -0
- package/src/generators/executor/schema.json +64 -0
- package/src/generators/generator/files/generator/__fileName__/generator.spec.ts__tmpl__ +20 -0
- package/src/generators/generator/files/generator/__fileName__/generator.ts__tmpl__ +72 -0
- package/src/generators/generator/files/generator/__fileName__/schema.d.ts__tmpl__ +5 -0
- package/src/generators/generator/files/generator/__fileName__/schema.json__tmpl__ +27 -0
- package/src/generators/generator/generator.d.ts +6 -0
- package/src/generators/generator/generator.js +106 -0
- package/src/generators/generator/generator.js.map +1 -0
- package/src/generators/generator/schema.d.ts +8 -0
- package/src/generators/generator/schema.json +60 -0
- package/src/generators/lint-checks/generator.d.ts +7 -0
- package/src/generators/lint-checks/generator.js +187 -0
- package/src/generators/lint-checks/generator.js.map +1 -0
- package/src/generators/lint-checks/schema.d.ts +4 -0
- package/src/generators/lint-checks/schema.json +25 -0
- package/src/generators/migration/files/migration/__name__/__name__.spec.ts__tmpl__ +17 -0
- package/src/generators/migration/files/migration/__name__/__name__.ts__tmpl__ +6 -0
- package/src/generators/migration/migration.d.ts +5 -0
- package/src/generators/migration/migration.js +111 -0
- package/src/generators/migration/migration.js.map +1 -0
- package/src/generators/migration/schema.d.ts +8 -0
- package/src/generators/migration/schema.json +59 -0
- package/src/generators/plugin/files/plugin/src/index.ts__tmpl__ +0 -0
- package/src/generators/plugin/plugin.d.ts +5 -0
- package/src/generators/plugin/plugin.js +95 -0
- package/src/generators/plugin/plugin.js.map +1 -0
- package/src/generators/plugin/schema.d.ts +17 -0
- package/src/generators/plugin/schema.json +93 -0
- package/src/generators/plugin/utils/normalize-schema.d.ts +14 -0
- package/src/generators/plugin/utils/normalize-schema.js +31 -0
- package/src/generators/plugin/utils/normalize-schema.js.map +1 -0
- package/src/generators/preset/generator.d.ts +3 -0
- package/src/generators/preset/generator.js +53 -0
- package/src/generators/preset/generator.js.map +1 -0
- package/src/generators/preset/schema.d.ts +4 -0
- package/src/generators/preset/schema.json +20 -0
- package/src/migrations/update-14-1-9/add-swc-deps-if-needed.d.ts +2 -0
- package/src/migrations/update-14-1-9/add-swc-deps-if-needed.js +14 -0
- package/src/migrations/update-14-1-9/add-swc-deps-if-needed.js.map +1 -0
- package/src/migrations/update-15-0-0/specify-output-capture.d.ts +2 -0
- package/src/migrations/update-15-0-0/specify-output-capture.js +57 -0
- package/src/migrations/update-15-0-0/specify-output-capture.js.map +1 -0
- package/src/migrations/update-15-9-0/jest-29-configs.d.ts +3 -0
- package/src/migrations/update-15-9-0/jest-29-configs.js +154 -0
- package/src/migrations/update-15-9-0/jest-29-configs.js.map +1 -0
- package/src/migrations/update-15-9-0/jest-29-tests.d.ts +5 -0
- package/src/migrations/update-15-9-0/jest-29-tests.js +65 -0
- package/src/migrations/update-15-9-0/jest-29-tests.js.map +1 -0
- package/src/migrations/update-16-0-0/cli-in-schema-json.d.ts +3 -0
- package/src/migrations/update-16-0-0/cli-in-schema-json.js +84 -0
- package/src/migrations/update-16-0-0/cli-in-schema-json.js.map +1 -0
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.d.ts +2 -0
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js +13 -0
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js.map +1 -0
- package/src/utils/has-generator.d.ts +2 -0
- package/src/utils/has-generator.js +17 -0
- package/src/utils/has-generator.js.map +1 -0
- package/src/utils/testing-utils/async-commands.d.ts +28 -0
- package/src/utils/testing-utils/async-commands.js +51 -0
- package/src/utils/testing-utils/async-commands.js.map +1 -0
- package/src/utils/testing-utils/commands.d.ts +17 -0
- package/src/utils/testing-utils/commands.js +64 -0
- package/src/utils/testing-utils/commands.js.map +1 -0
- package/src/utils/testing-utils/create-package-cli.d.ts +18 -0
- package/src/utils/testing-utils/create-package-cli.js +53 -0
- package/src/utils/testing-utils/create-package-cli.js.map +1 -0
- package/src/utils/testing-utils/index.d.ts +6 -0
- package/src/utils/testing-utils/index.js +10 -0
- package/src/utils/testing-utils/index.js.map +1 -0
- package/src/utils/testing-utils/nx-project.d.ts +25 -0
- package/src/utils/testing-utils/nx-project.js +64 -0
- package/src/utils/testing-utils/nx-project.js.map +1 -0
- package/src/utils/testing-utils/paths.d.ts +15 -0
- package/src/utils/testing-utils/paths.js +33 -0
- package/src/utils/testing-utils/paths.js.map +1 -0
- package/src/utils/testing-utils/utils.d.ts +80 -0
- package/src/utils/testing-utils/utils.js +145 -0
- package/src/utils/testing-utils/utils.js.map +1 -0
- package/src/utils/versions.d.ts +1 -0
- package/src/utils/versions.js +5 -0
- package/src/utils/versions.js.map +1 -0
- package/testing.d.ts +1 -0
- package/testing.js +5 -0
- package/testing.js.map +1 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"cli": "nx",
|
|
4
|
+
"$id": "NxPluginGenerator",
|
|
5
|
+
"title": "Create a Generator for an Nx Plugin",
|
|
6
|
+
"description": "Create a Generator for an Nx Plugin.",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"examples": [
|
|
9
|
+
{
|
|
10
|
+
"command": "nx g generator my-generator --project=my-plugin",
|
|
11
|
+
"description": "Generate `libs/my-plugin/src/generators/my-generator`"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"properties": {
|
|
15
|
+
"project": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "The name of the project.",
|
|
18
|
+
"alias": "p",
|
|
19
|
+
"$default": {
|
|
20
|
+
"$source": "projectName"
|
|
21
|
+
},
|
|
22
|
+
"x-prompt": "What is the name of the project for the generator?",
|
|
23
|
+
"x-priority": "important"
|
|
24
|
+
},
|
|
25
|
+
"name": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"description": "Generator name.",
|
|
28
|
+
"$default": {
|
|
29
|
+
"$source": "argv",
|
|
30
|
+
"index": 0
|
|
31
|
+
},
|
|
32
|
+
"x-prompt": "What name would you like to use for the generator?",
|
|
33
|
+
"x-priority": "important"
|
|
34
|
+
},
|
|
35
|
+
"description": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"description": "Generator description.",
|
|
38
|
+
"alias": "d"
|
|
39
|
+
},
|
|
40
|
+
"unitTestRunner": {
|
|
41
|
+
"type": "string",
|
|
42
|
+
"enum": ["jest", "none"],
|
|
43
|
+
"description": "Test runner to use for unit tests.",
|
|
44
|
+
"default": "jest"
|
|
45
|
+
},
|
|
46
|
+
"skipLintChecks": {
|
|
47
|
+
"type": "boolean",
|
|
48
|
+
"default": false,
|
|
49
|
+
"description": "Do not add an eslint configuration for plugin json files."
|
|
50
|
+
},
|
|
51
|
+
"skipFormat": {
|
|
52
|
+
"type": "boolean",
|
|
53
|
+
"default": false,
|
|
54
|
+
"description": "Do not format files with prettier.",
|
|
55
|
+
"x-priority": "internal"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"required": ["project", "name"],
|
|
59
|
+
"additionalProperties": false
|
|
60
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ProjectConfiguration, TargetConfiguration, Tree } from '@nx/devkit';
|
|
2
|
+
import { Schema as EsLintExecutorOptions } from '@nx/linter/src/executors/eslint/schema';
|
|
3
|
+
import { PluginLintChecksGeneratorSchema } from './schema';
|
|
4
|
+
import { PackageJson } from 'nx/src/utils/package-json';
|
|
5
|
+
export default function pluginLintCheckGenerator(host: Tree, options: PluginLintChecksGeneratorSchema): Promise<() => import("@nx/devkit").GeneratorCallback>;
|
|
6
|
+
export declare function addMigrationJsonChecks(host: Tree, options: PluginLintChecksGeneratorSchema, packageJson: PackageJson): void;
|
|
7
|
+
export declare function getEsLintOptions(project: ProjectConfiguration): [target: string, configuration: TargetConfiguration<EsLintExecutorOptions>];
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getEsLintOptions = exports.addMigrationJsonChecks = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
const versions_1 = require("../../utils/versions");
|
|
7
|
+
const logger_1 = require("nx/src/utils/logger");
|
|
8
|
+
const package_json_1 = require("nx/src/utils/package-json");
|
|
9
|
+
function pluginLintCheckGenerator(host, options) {
|
|
10
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
11
|
+
const project = (0, devkit_1.readProjectConfiguration)(host, options.projectName);
|
|
12
|
+
const packageJson = (0, devkit_1.readJson)(host, (0, devkit_1.joinPathFragments)(project.root, 'package.json'));
|
|
13
|
+
// This rule is eslint **only**
|
|
14
|
+
if (projectIsEsLintEnabled(project)) {
|
|
15
|
+
updateRootEslintConfig(host);
|
|
16
|
+
updateProjectEslintConfig(host, project, packageJson);
|
|
17
|
+
updateProjectTarget(host, options, packageJson);
|
|
18
|
+
// Project is setup for vscode
|
|
19
|
+
if (host.exists('.vscode')) {
|
|
20
|
+
setupVsCodeLintingForJsonFiles(host);
|
|
21
|
+
}
|
|
22
|
+
// Project contains migrations.json
|
|
23
|
+
const migrationsPath = (0, package_json_1.readNxMigrateConfig)(packageJson).migrations;
|
|
24
|
+
if (migrationsPath &&
|
|
25
|
+
host.exists((0, devkit_1.joinPathFragments)(project.root, migrationsPath))) {
|
|
26
|
+
addMigrationJsonChecks(host, options, packageJson);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
devkit_1.logger.error(`${logger_1.NX_PREFIX} plugin lint checks can only be added to plugins which use eslint for linting`);
|
|
31
|
+
}
|
|
32
|
+
const installTask = (0, devkit_1.addDependenciesToPackageJson)(host, {}, { 'jsonc-eslint-parser': versions_1.jsoncEslintParserVersion });
|
|
33
|
+
if (!options.skipFormat) {
|
|
34
|
+
yield (0, devkit_1.formatFiles)(host);
|
|
35
|
+
}
|
|
36
|
+
return () => installTask;
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
exports.default = pluginLintCheckGenerator;
|
|
40
|
+
function addMigrationJsonChecks(host, options, packageJson) {
|
|
41
|
+
var _a, _b;
|
|
42
|
+
const projectConfiguration = (0, devkit_1.readProjectConfiguration)(host, options.projectName);
|
|
43
|
+
if (!projectIsEsLintEnabled(projectConfiguration)) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const [eslintTarget, eslintTargetConfiguration] = getEsLintOptions(projectConfiguration);
|
|
47
|
+
const relativeMigrationsJsonPath = (0, package_json_1.readNxMigrateConfig)(packageJson).migrations;
|
|
48
|
+
if (!relativeMigrationsJsonPath) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const migrationsJsonPath = (0, devkit_1.joinPathFragments)(projectConfiguration.root, relativeMigrationsJsonPath);
|
|
52
|
+
if (eslintTarget &&
|
|
53
|
+
!((_b = (_a = eslintTargetConfiguration.options) === null || _a === void 0 ? void 0 : _a.lintFilePatterns) === null || _b === void 0 ? void 0 : _b.includes(migrationsJsonPath))) {
|
|
54
|
+
// Add to lintFilePatterns
|
|
55
|
+
eslintTargetConfiguration.options.lintFilePatterns.push(migrationsJsonPath);
|
|
56
|
+
(0, devkit_1.updateProjectConfiguration)(host, options.projectName, projectConfiguration);
|
|
57
|
+
// Update project level eslintrc
|
|
58
|
+
(0, devkit_1.updateJson)(host, `${projectConfiguration.root}/.eslintrc.json`, (c) => {
|
|
59
|
+
const override = c.overrides.find((o) => {
|
|
60
|
+
var _a, _b, _c, _d;
|
|
61
|
+
return ((_b = Object.keys((_a = o.rules) !== null && _a !== void 0 ? _a : {})) === null || _b === void 0 ? void 0 : _b.includes('@nx/nx-plugin-checks')) ||
|
|
62
|
+
((_d = Object.keys((_c = o.rules) !== null && _c !== void 0 ? _c : {})) === null || _d === void 0 ? void 0 : _d.includes('@nrwl/nx/nx-plugin-checks'));
|
|
63
|
+
});
|
|
64
|
+
if (Array.isArray(override === null || override === void 0 ? void 0 : override.files) &&
|
|
65
|
+
!override.files.includes(relativeMigrationsJsonPath)) {
|
|
66
|
+
override.files.push(relativeMigrationsJsonPath);
|
|
67
|
+
}
|
|
68
|
+
return c;
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
exports.addMigrationJsonChecks = addMigrationJsonChecks;
|
|
73
|
+
function updateProjectTarget(host, options, packageJson) {
|
|
74
|
+
var _a, _b;
|
|
75
|
+
const project = (0, devkit_1.readProjectConfiguration)(host, options.projectName);
|
|
76
|
+
if (!project.targets) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
for (const [target, configuration] of Object.entries(project.targets)) {
|
|
80
|
+
if (configuration.executor === '@nx/linter:eslint' ||
|
|
81
|
+
configuration.executor === '@nrwl/linter:eslint') {
|
|
82
|
+
const opts = (_a = configuration.options) !== null && _a !== void 0 ? _a : {};
|
|
83
|
+
(_b = opts.lintFilePatterns) !== null && _b !== void 0 ? _b : (opts.lintFilePatterns = []);
|
|
84
|
+
if (packageJson.generators) {
|
|
85
|
+
opts.lintFilePatterns.push((0, devkit_1.joinPathFragments)(project.root, packageJson.generators));
|
|
86
|
+
}
|
|
87
|
+
if (packageJson.schematics &&
|
|
88
|
+
packageJson.schematics !== packageJson.generators) {
|
|
89
|
+
opts.lintFilePatterns.push((0, devkit_1.joinPathFragments)(project.root, packageJson.schematics));
|
|
90
|
+
}
|
|
91
|
+
if (packageJson.executors) {
|
|
92
|
+
opts.lintFilePatterns.push((0, devkit_1.joinPathFragments)(project.root, packageJson.executors));
|
|
93
|
+
}
|
|
94
|
+
if (packageJson.builders &&
|
|
95
|
+
packageJson.builders !== packageJson.executors) {
|
|
96
|
+
opts.lintFilePatterns.push((0, devkit_1.joinPathFragments)(project.root, packageJson.builders));
|
|
97
|
+
}
|
|
98
|
+
opts.lintFilePatterns.push(`${project.root}/package.json`);
|
|
99
|
+
opts.lintFilePatterns = [...new Set(opts.lintFilePatterns)];
|
|
100
|
+
project.targets[target].options = opts;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
(0, devkit_1.updateProjectConfiguration)(host, options.projectName, project);
|
|
104
|
+
}
|
|
105
|
+
function updateProjectEslintConfig(host, options, packageJson) {
|
|
106
|
+
var _a, _b, _c;
|
|
107
|
+
// Update the project level lint configuration to specify
|
|
108
|
+
// the plugin schema rule for generated files
|
|
109
|
+
const eslintPath = `${options.root}/.eslintrc.json`;
|
|
110
|
+
const eslintConfig = (0, devkit_1.readJson)(host, eslintPath);
|
|
111
|
+
(_a = eslintConfig.overrides) !== null && _a !== void 0 ? _a : (eslintConfig.overrides = []);
|
|
112
|
+
let entry = eslintConfig.overrides.find((x) => {
|
|
113
|
+
var _a, _b;
|
|
114
|
+
return Object.keys((_a = x.rules) !== null && _a !== void 0 ? _a : {}).includes('@nx/nx-plugin-checks') ||
|
|
115
|
+
Object.keys((_b = x.rules) !== null && _b !== void 0 ? _b : {}).includes('@nrwl/nx/nx-plugin-checks');
|
|
116
|
+
});
|
|
117
|
+
const newentry = !entry;
|
|
118
|
+
entry !== null && entry !== void 0 ? entry : (entry = { files: [] });
|
|
119
|
+
entry.files = [
|
|
120
|
+
...new Set([
|
|
121
|
+
...((_b = entry.files) !== null && _b !== void 0 ? _b : []),
|
|
122
|
+
...[
|
|
123
|
+
'./package.json',
|
|
124
|
+
packageJson.generators,
|
|
125
|
+
packageJson.executors,
|
|
126
|
+
packageJson.schematics,
|
|
127
|
+
packageJson.builders,
|
|
128
|
+
].filter((f) => !!f),
|
|
129
|
+
]),
|
|
130
|
+
];
|
|
131
|
+
entry.parser = 'jsonc-eslint-parser';
|
|
132
|
+
(_c = entry.rules) !== null && _c !== void 0 ? _c : (entry.rules = {
|
|
133
|
+
'@nx/nx-plugin-checks': 'error',
|
|
134
|
+
});
|
|
135
|
+
if (newentry) {
|
|
136
|
+
eslintConfig.overrides.push(entry);
|
|
137
|
+
}
|
|
138
|
+
(0, devkit_1.writeJson)(host, eslintPath, eslintConfig);
|
|
139
|
+
}
|
|
140
|
+
// Update the root eslint to specify a parser for json files
|
|
141
|
+
// This is required, otherwise every json file that is not overriden
|
|
142
|
+
// will display false errors in the IDE
|
|
143
|
+
function updateRootEslintConfig(host) {
|
|
144
|
+
var _a;
|
|
145
|
+
const rootESLint = (0, devkit_1.readJson)(host, '.eslintrc.json');
|
|
146
|
+
(_a = rootESLint.overrides) !== null && _a !== void 0 ? _a : (rootESLint.overrides = []);
|
|
147
|
+
if (!eslintConfigContainsJsonOverride(rootESLint)) {
|
|
148
|
+
rootESLint.overrides.push({
|
|
149
|
+
files: '*.json',
|
|
150
|
+
parser: 'jsonc-eslint-parser',
|
|
151
|
+
rules: {},
|
|
152
|
+
});
|
|
153
|
+
(0, devkit_1.writeJson)(host, '.eslintrc.json', rootESLint);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
function setupVsCodeLintingForJsonFiles(host) {
|
|
157
|
+
var _a;
|
|
158
|
+
let existing = {};
|
|
159
|
+
if (host.exists('.vscode/settings.json')) {
|
|
160
|
+
existing = (0, devkit_1.readJson)(host, '.vscode/settings.json');
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
devkit_1.logger.info(`${logger_1.NX_PREFIX} We've updated the vscode settings for this repository to ensure that plugin lint checks show up inside your IDE. This created .vscode/settings.json. To read more about this file, check vscode's documentation. It is frequently not commited, so other developers may need to add similar settings if they'd like to see the lint checks in the IDE rather than only during linting.`);
|
|
164
|
+
}
|
|
165
|
+
// setup eslint validation for json files
|
|
166
|
+
const eslintValidate = (_a = existing['eslint.validate']) !== null && _a !== void 0 ? _a : [];
|
|
167
|
+
if (!eslintValidate.includes('json')) {
|
|
168
|
+
existing['eslint.validate'] = [...eslintValidate, 'json'];
|
|
169
|
+
}
|
|
170
|
+
(0, devkit_1.writeJson)(host, '.vscode/settings.json', existing);
|
|
171
|
+
}
|
|
172
|
+
function eslintConfigContainsJsonOverride(eslintConfig) {
|
|
173
|
+
return eslintConfig.overrides.some((x) => {
|
|
174
|
+
if (typeof x.files === 'string' && x.files.includes('.json')) {
|
|
175
|
+
return true;
|
|
176
|
+
}
|
|
177
|
+
return Array.isArray(x.files) && x.files.some((f) => f.includes('.json'));
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
function projectIsEsLintEnabled(project) {
|
|
181
|
+
return !!getEsLintOptions(project);
|
|
182
|
+
}
|
|
183
|
+
function getEsLintOptions(project) {
|
|
184
|
+
return Object.entries(project.targets || {}).find(([, x]) => x.executor === '@nx/linter:eslint' || x.executor === '@nrwl/linter:eslint');
|
|
185
|
+
}
|
|
186
|
+
exports.getEsLintOptions = getEsLintOptions;
|
|
187
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/plugin/src/generators/lint-checks/generator.ts"],"names":[],"mappings":";;;;AAAA,uCAaoB;AAMpB,mDAAgE;AAEhE,gDAAgD;AAChD,4DAA6E;AAE7E,SAA8B,wBAAwB,CACpD,IAAU,EACV,OAAwC;;QAExC,MAAM,OAAO,GAAG,IAAA,iCAAwB,EAAC,IAAI,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;QACpE,MAAM,WAAW,GAAG,IAAA,iBAAQ,EAC1B,IAAI,EACJ,IAAA,0BAAiB,EAAC,OAAO,CAAC,IAAI,EAAE,cAAc,CAAC,CAChD,CAAC;QAEF,+BAA+B;QAC/B,IAAI,sBAAsB,CAAC,OAAO,CAAC,EAAE;YACnC,sB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,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,IAAI,CAC/C,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CACR,CAAC,CAAC,QAAQ,KAAK,mBAAmB,IAAI,CAAC,CAAC,QAAQ,KAAK,qBAAqB,CAC7E,CAAC;AACJ,CAAC;AAPD,4CAOC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"cli": "nx",
|
|
4
|
+
"$id": "PluginLint",
|
|
5
|
+
"title": "",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"description": "Adds linting configuration to validate common json files for nx plugins.",
|
|
8
|
+
"properties": {
|
|
9
|
+
"projectName": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"description": "Which project should be the configuration be added to?",
|
|
12
|
+
"$default": {
|
|
13
|
+
"$source": "projectName"
|
|
14
|
+
},
|
|
15
|
+
"x-priority": "important"
|
|
16
|
+
},
|
|
17
|
+
"skipFormat": {
|
|
18
|
+
"type": "boolean",
|
|
19
|
+
"x-priority": "internal",
|
|
20
|
+
"description": "Skip formatting files with prettier.",
|
|
21
|
+
"default": false
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"required": ["projectName"]
|
|
25
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing';
|
|
2
|
+
import { Tree } from '@nx/devkit';
|
|
3
|
+
|
|
4
|
+
import update from './<%= name %>';
|
|
5
|
+
|
|
6
|
+
describe('<%= name %> migration', () => {
|
|
7
|
+
let tree: Tree;
|
|
8
|
+
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
tree = createTreeWithEmptyWorkspace({layout: 'apps-libs'});
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('should run successfully', async () => {
|
|
14
|
+
await update(tree);
|
|
15
|
+
// ... expect changes made
|
|
16
|
+
});
|
|
17
|
+
});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Tree } from '@nx/devkit';
|
|
2
|
+
import type { Schema } from './schema';
|
|
3
|
+
export declare function migrationGenerator(host: Tree, schema: Schema): Promise<void>;
|
|
4
|
+
export default migrationGenerator;
|
|
5
|
+
export declare const migrationSchematic: (generatorOptions: Schema) => (tree: any, context: any) => Promise<any>;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.migrationSchematic = exports.migrationGenerator = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
const path = require("path");
|
|
7
|
+
const generator_1 = require("../lint-checks/generator");
|
|
8
|
+
const package_json_1 = require("nx/src/utils/package-json");
|
|
9
|
+
function normalizeOptions(host, options) {
|
|
10
|
+
var _a;
|
|
11
|
+
let name;
|
|
12
|
+
if (options.name) {
|
|
13
|
+
name = (0, devkit_1.names)(options.name).fileName;
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
name = (0, devkit_1.names)(`update-${options.packageVersion}`).fileName;
|
|
17
|
+
}
|
|
18
|
+
const description = (_a = options.description) !== null && _a !== void 0 ? _a : name;
|
|
19
|
+
const { root: projectRoot, sourceRoot: projectSourceRoot } = (0, devkit_1.readProjectConfiguration)(host, options.project);
|
|
20
|
+
const normalized = Object.assign(Object.assign({}, options), { name,
|
|
21
|
+
description,
|
|
22
|
+
projectRoot,
|
|
23
|
+
projectSourceRoot });
|
|
24
|
+
return normalized;
|
|
25
|
+
}
|
|
26
|
+
function addFiles(host, options) {
|
|
27
|
+
(0, devkit_1.generateFiles)(host, path.join(__dirname, 'files/migration'), `${options.projectSourceRoot}/migrations`, Object.assign(Object.assign({}, options), { tmpl: '' }));
|
|
28
|
+
}
|
|
29
|
+
function updateMigrationsJson(host, options) {
|
|
30
|
+
var _a, _b;
|
|
31
|
+
const configuredMigrationPath = (0, package_json_1.readNxMigrateConfig)((0, devkit_1.readJson)(host, (0, devkit_1.joinPathFragments)(options.projectRoot, 'package.json'))).migrations;
|
|
32
|
+
const migrationsPath = (0, devkit_1.joinPathFragments)(options.projectRoot, configuredMigrationPath !== null && configuredMigrationPath !== void 0 ? configuredMigrationPath : 'migrations.json');
|
|
33
|
+
const migrations = host.exists(migrationsPath)
|
|
34
|
+
? (0, devkit_1.readJson)(host, migrationsPath)
|
|
35
|
+
: {};
|
|
36
|
+
const generators = (_a = migrations.generators) !== null && _a !== void 0 ? _a : {};
|
|
37
|
+
generators[options.name] = {
|
|
38
|
+
version: options.packageVersion,
|
|
39
|
+
description: options.description,
|
|
40
|
+
cli: 'nx',
|
|
41
|
+
implementation: `./src/migrations/${options.name}/${options.name}`,
|
|
42
|
+
};
|
|
43
|
+
migrations.generators = generators;
|
|
44
|
+
if (options.packageJsonUpdates) {
|
|
45
|
+
const packageJsonUpdatesObj = (_b = migrations.packageJsonUpdates) !== null && _b !== void 0 ? _b : {};
|
|
46
|
+
if (!packageJsonUpdatesObj[options.packageVersion]) {
|
|
47
|
+
packageJsonUpdatesObj[options.packageVersion] = {
|
|
48
|
+
version: options.packageVersion,
|
|
49
|
+
packages: {},
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
migrations.packageJsonUpdates = packageJsonUpdatesObj;
|
|
53
|
+
}
|
|
54
|
+
(0, devkit_1.writeJson)(host, migrationsPath, migrations);
|
|
55
|
+
}
|
|
56
|
+
function updatePackageJson(host, options) {
|
|
57
|
+
(0, devkit_1.updateJson)(host, path.join(options.projectRoot, 'package.json'), (json) => {
|
|
58
|
+
const migrationKey = json['ng-update'] ? 'ng-update' : 'nx-migrations';
|
|
59
|
+
const preexistingValue = json[migrationKey];
|
|
60
|
+
if (typeof preexistingValue === 'string') {
|
|
61
|
+
return json;
|
|
62
|
+
}
|
|
63
|
+
else if (!json[migrationKey]) {
|
|
64
|
+
json[migrationKey] = {
|
|
65
|
+
migrations: './migrations.json',
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
else if (preexistingValue.migrations) {
|
|
69
|
+
preexistingValue.migrations = './migrations.json';
|
|
70
|
+
}
|
|
71
|
+
return json;
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
function updateWorkspaceJson(host, options) {
|
|
75
|
+
var _a, _b;
|
|
76
|
+
const project = (0, devkit_1.readProjectConfiguration)(host, options.project);
|
|
77
|
+
const assets = (_b = (_a = project.targets.build) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.assets;
|
|
78
|
+
if (assets &&
|
|
79
|
+
assets.filter((a) => a.glob === 'migrations.json').length === 0) {
|
|
80
|
+
project.targets.build.options.assets = [
|
|
81
|
+
...assets,
|
|
82
|
+
{
|
|
83
|
+
input: `./${options.projectRoot}`,
|
|
84
|
+
glob: 'migrations.json',
|
|
85
|
+
output: '.',
|
|
86
|
+
},
|
|
87
|
+
];
|
|
88
|
+
(0, devkit_1.updateProjectConfiguration)(host, options.project, project);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function migrationGenerator(host, schema) {
|
|
92
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
93
|
+
const options = normalizeOptions(host, schema);
|
|
94
|
+
addFiles(host, options);
|
|
95
|
+
updateMigrationsJson(host, options);
|
|
96
|
+
updateWorkspaceJson(host, options);
|
|
97
|
+
updateMigrationsJson(host, options);
|
|
98
|
+
updatePackageJson(host, options);
|
|
99
|
+
if (!host.exists('migrations.json')) {
|
|
100
|
+
const packageJsonPath = (0, devkit_1.joinPathFragments)(options.projectRoot, 'package.json');
|
|
101
|
+
(0, generator_1.addMigrationJsonChecks)(host, { projectName: schema.project }, (0, devkit_1.readJson)(host, packageJsonPath));
|
|
102
|
+
}
|
|
103
|
+
if (!options.skipFormat) {
|
|
104
|
+
yield (0, devkit_1.formatFiles)(host);
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
exports.migrationGenerator = migrationGenerator;
|
|
109
|
+
exports.default = migrationGenerator;
|
|
110
|
+
exports.migrationSchematic = (0, devkit_1.convertNxGenerator)(migrationGenerator);
|
|
111
|
+
//# sourceMappingURL=migration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migration.js","sourceRoot":"","sources":["../../../../../../packages/plugin/src/generators/migration/migration.ts"],"names":[],"mappings":";;;;AAAA,uCAWoB;AAGpB,6BAA6B;AAC7B,wDAAkE;AAClE,4DAA6E;AAM7E,SAAS,gBAAgB,CAAC,IAAU,EAAE,OAAe;;IACnD,IAAI,IAAY,CAAC;IACjB,IAAI,OAAO,CAAC,IAAI,EAAE;QAChB,IAAI,GAAG,IAAA,cAAK,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC;KACrC;SAAM;QACL,IAAI,GAAG,IAAA,cAAK,EAAC,UAAU,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC,QAAQ,CAAC;KAC3D;IAED,MAAM,WAAW,GAAW,MAAA,OAAO,CAAC,WAAW,mCAAI,IAAI,CAAC;IAExD,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,iBAAiB,EAAE,GACxD,IAAA,iCAAwB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAElD,MAAM,UAAU,mCACX,OAAO,KACV,IAAI;QACJ,WAAW;QACX,WAAW;QACX,iBAAiB,GAClB,CAAC;IAEF,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,SAAS,QAAQ,CAAC,IAAU,EAAE,OAAyB;IACrD,IAAA,sBAAa,EACX,IAAI,EACJ,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,iBAAiB,CAAC,EACvC,GAAG,OAAO,CAAC,iBAAiB,aAAa,kCACpC,OAAO,KAAE,IAAI,EAAE,EAAE,IACvB,CAAC;AACJ,CAAC;AAED,SAAS,oBAAoB,CAAC,IAAU,EAAE,OAAyB;;IAC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AAM,EAAE,GAAG;aACZ;SACF,CAAC;QACF,IAAA,mCAA0B,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;KAC5D;AACH,CAAC;AAED,SAAsB,kBAAkB,CAAC,IAAU,EAAE,MAAc;;QACjE,MAAM,OAAO,GAAG,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAE/C,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACxB,oBAAoB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACpC,mBAAmB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACnC,oBAAoB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACpC,iBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAEjC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,EAAE;YACnC,MAAM,eAAe,GAAG,IAAA,0BAAiB,EACvC,OAAO,CAAC,WAAW,EACnB,cAAc,CACf,CAAC;YACF,IAAA,kCAAsB,EACpB,IAAI,EACJ,EAAE,WAAW,EAAE,MAAM,CAAC,OAAO,EAAE,EAC/B,IAAA,iBAAQ,EAAc,IAAI,EAAE,eAAe,CAAC,CAC7C,CAAC;SACH;QAED,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YACvB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;SACzB;IACH,CAAC;CAAA;AAxBD,gDAwBC;AAED,kBAAe,kBAAkB,CAAC;AACrB,QAAA,kBAAkB,GAAG,IAAA,2BAAkB,EAAC,kBAAkB,CAAC,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"cli": "nx",
|
|
4
|
+
"$id": "NxPluginMigration",
|
|
5
|
+
"title": "Create a Migration for an Nx Plugin",
|
|
6
|
+
"description": "Create a Migration for an Nx Plugin.",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"examples": [
|
|
9
|
+
{
|
|
10
|
+
"command": "nx g migration my-migration --project=my-plugin --version=1.0.0",
|
|
11
|
+
"description": "Generate `libs/my-plugin/src/migrations/my-migration`"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"properties": {
|
|
15
|
+
"project": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "The name of the project.",
|
|
18
|
+
"alias": "p",
|
|
19
|
+
"$default": {
|
|
20
|
+
"$source": "projectName"
|
|
21
|
+
},
|
|
22
|
+
"x-prompt": "What is the name of the project for the migration?",
|
|
23
|
+
"x-priority": "important"
|
|
24
|
+
},
|
|
25
|
+
"name": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"description": "Migration name.",
|
|
28
|
+
"$default": {
|
|
29
|
+
"$source": "argv",
|
|
30
|
+
"index": 0
|
|
31
|
+
},
|
|
32
|
+
"x-priority": "important"
|
|
33
|
+
},
|
|
34
|
+
"description": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"description": "Migration description."
|
|
37
|
+
},
|
|
38
|
+
"packageVersion": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"description": "Version to use for the migration.",
|
|
41
|
+
"alias": "v",
|
|
42
|
+
"x-prompt": "What version would you like to use for the migration?",
|
|
43
|
+
"x-priority": "important"
|
|
44
|
+
},
|
|
45
|
+
"packageJsonUpdates": {
|
|
46
|
+
"type": "boolean",
|
|
47
|
+
"description": "Whether or not to include `package.json` updates.",
|
|
48
|
+
"alias": "p",
|
|
49
|
+
"default": false
|
|
50
|
+
},
|
|
51
|
+
"skipLintChecks": {
|
|
52
|
+
"type": "boolean",
|
|
53
|
+
"default": false,
|
|
54
|
+
"description": "Do not eslint configuration for plugin json files."
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"required": ["project", "packageVersion"],
|
|
58
|
+
"additionalProperties": false
|
|
59
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { GeneratorCallback, Tree } from '@nx/devkit';
|
|
2
|
+
import type { Schema } from './schema';
|
|
3
|
+
export declare function pluginGenerator(host: Tree, schema: Schema): Promise<GeneratorCallback>;
|
|
4
|
+
export default pluginGenerator;
|
|
5
|
+
export declare const pluginSchematic: (generatorOptions: Schema) => (tree: any, context: any) => Promise<any>;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pluginSchematic = exports.pluginGenerator = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
const js_1 = require("@nx/js");
|
|
7
|
+
const add_swc_dependencies_1 = require("@nx/js/src/utils/swc/add-swc-dependencies");
|
|
8
|
+
const linter_1 = require("@nx/linter");
|
|
9
|
+
const path = require("path");
|
|
10
|
+
const e2e_1 = require("../e2e-project/e2e");
|
|
11
|
+
const generator_1 = require("../lint-checks/generator");
|
|
12
|
+
const normalize_schema_1 = require("./utils/normalize-schema");
|
|
13
|
+
const add_tslib_dependencies_1 = require("@nx/js/src/utils/typescript/add-tslib-dependencies");
|
|
14
|
+
const add_swc_dependencies_2 = require("@nx/js/src/utils/swc/add-swc-dependencies");
|
|
15
|
+
const nxVersion = require('../../../package.json').version;
|
|
16
|
+
function addFiles(host, options) {
|
|
17
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
18
|
+
host.delete((0, devkit_1.normalizePath)(`${options.projectRoot}/src/lib`));
|
|
19
|
+
(0, devkit_1.generateFiles)(host, path.join(__dirname, './files/plugin'), options.projectRoot, Object.assign(Object.assign({}, options), { tmpl: '' }));
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
function updatePluginConfig(host, options) {
|
|
23
|
+
var _a;
|
|
24
|
+
var _b;
|
|
25
|
+
const project = (0, devkit_1.readProjectConfiguration)(host, options.name);
|
|
26
|
+
if (project.targets.build) {
|
|
27
|
+
(_a = (_b = project.targets.build.options).assets) !== null && _a !== void 0 ? _a : (_b.assets = []);
|
|
28
|
+
project.targets.build.options.assets = [
|
|
29
|
+
...project.targets.build.options.assets,
|
|
30
|
+
{
|
|
31
|
+
input: `./${options.projectRoot}/src`,
|
|
32
|
+
glob: '**/!(*.ts)',
|
|
33
|
+
output: './src',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
input: `./${options.projectRoot}/src`,
|
|
37
|
+
glob: '**/*.d.ts',
|
|
38
|
+
output: './src',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
input: `./${options.projectRoot}`,
|
|
42
|
+
glob: 'generators.json',
|
|
43
|
+
output: '.',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
input: `./${options.projectRoot}`,
|
|
47
|
+
glob: 'executors.json',
|
|
48
|
+
output: '.',
|
|
49
|
+
},
|
|
50
|
+
];
|
|
51
|
+
(0, devkit_1.updateProjectConfiguration)(host, options.name, project);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function pluginGenerator(host, schema) {
|
|
55
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
56
|
+
const options = (0, normalize_schema_1.normalizeOptions)(host, schema);
|
|
57
|
+
const tasks = [];
|
|
58
|
+
tasks.push(yield (0, js_1.libraryGenerator)(host, Object.assign(Object.assign({}, schema), { config: 'project', bundler: options.bundler, publishable: true, importPath: options.npmPackageName, skipFormat: true })));
|
|
59
|
+
tasks.push((0, add_tslib_dependencies_1.addTsLibDependencies)(host));
|
|
60
|
+
tasks.push((0, devkit_1.addDependenciesToPackageJson)(host, {
|
|
61
|
+
'@nx/devkit': nxVersion,
|
|
62
|
+
}, {
|
|
63
|
+
'@nx/jest': nxVersion,
|
|
64
|
+
'@nx/js': nxVersion,
|
|
65
|
+
'@nx/plugin': nxVersion,
|
|
66
|
+
}));
|
|
67
|
+
// Ensures Swc Deps are installed to handle running
|
|
68
|
+
// local plugin generators and executors
|
|
69
|
+
tasks.push((0, add_swc_dependencies_1.addSwcDependencies)(host));
|
|
70
|
+
tasks.push((0, add_swc_dependencies_2.addSwcRegisterDependencies)(host));
|
|
71
|
+
yield addFiles(host, options);
|
|
72
|
+
updatePluginConfig(host, options);
|
|
73
|
+
if (options.e2eTestRunner !== 'none') {
|
|
74
|
+
tasks.push(yield (0, e2e_1.e2eProjectGenerator)(host, {
|
|
75
|
+
pluginName: options.name,
|
|
76
|
+
projectDirectory: options.projectDirectory,
|
|
77
|
+
pluginOutputPath: `dist/${options.libsDir}/${options.projectDirectory}`,
|
|
78
|
+
npmPackageName: options.npmPackageName,
|
|
79
|
+
skipFormat: true,
|
|
80
|
+
rootProject: options.rootProject,
|
|
81
|
+
}));
|
|
82
|
+
}
|
|
83
|
+
if (options.linter === linter_1.Linter.EsLint && !options.skipLintChecks) {
|
|
84
|
+
yield (0, generator_1.default)(host, { projectName: options.name });
|
|
85
|
+
}
|
|
86
|
+
if (!options.skipFormat) {
|
|
87
|
+
yield (0, devkit_1.formatFiles)(host);
|
|
88
|
+
}
|
|
89
|
+
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
exports.pluginGenerator = pluginGenerator;
|
|
93
|
+
exports.default = pluginGenerator;
|
|
94
|
+
exports.pluginSchematic = (0, devkit_1.convertNxGenerator)(pluginGenerator);
|
|
95
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../../../../packages/plugin/src/generators/plugin/plugin.ts"],"names":[],"mappings":";;;;AAAA,uCAWoB;AACpB,+BAAgE;AAChE,oFAA+E;AAC/E,uCAAoC;AACpC,6BAA6B;AAC7B,4CAAyD;AACzD,wDAAgE;AAChE,+DAA8E;AAC9E,+FAA0F;AAC1F,oFAAuF;AAIvF,MAAM,SAAS,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC,OAAO,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