@rxap/plugin-library 16.0.0-dev.16 → 16.0.0-dev.17
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 +6 -0
- package/README.md +1 -1
- package/package.json +12 -12
- package/src/executors/check-version/executor.js +26 -32
- package/src/executors/check-version/executor.js.map +1 -1
- package/src/executors/readme/executor.js +55 -66
- package/src/executors/readme/executor.js.map +1 -1
- package/src/executors/run-generator/executor.js +23 -31
- package/src/executors/run-generator/executor.js.map +1 -1
- package/src/executors/update-dependencies/executor.js +12 -18
- package/src/executors/update-dependencies/executor.js.map +1 -1
- package/src/executors/update-package-group/executor.js +23 -30
- package/src/executors/update-package-group/executor.js.map +1 -1
- package/src/generators/expose-as-schematic/generator.js +28 -36
- package/src/generators/expose-as-schematic/generator.js.map +1 -1
- package/src/generators/expose-as-schematic/index.js +4 -7
- package/src/generators/expose-as-schematic/index.js.map +1 -1
- package/src/generators/fix-dependencies/generator.js +132 -151
- package/src/generators/fix-dependencies/generator.js.map +1 -1
- package/src/generators/fix-dependencies/index.js +4 -7
- package/src/generators/fix-dependencies/index.js.map +1 -1
- package/src/generators/index-export/generator.js +18 -25
- package/src/generators/index-export/generator.js.map +1 -1
- package/src/generators/index-export/index.js +4 -7
- package/src/generators/index-export/index.js.map +1 -1
- package/src/generators/init/generator.js +40 -42
- package/src/generators/init/generator.js.map +1 -1
- package/src/generators/init/index.js +4 -7
- package/src/generators/init/index.js.map +1 -1
- package/src/generators/init-buildable/generator.js +20 -28
- package/src/generators/init-buildable/generator.js.map +1 -1
- package/src/generators/init-buildable/index.js +4 -7
- package/src/generators/init-buildable/index.js.map +1 -1
- package/src/generators/init-plugin/generator.js +24 -32
- package/src/generators/init-plugin/generator.js.map +1 -1
- package/src/generators/init-plugin/index.js +4 -7
- package/src/generators/init-plugin/index.js.map +1 -1
- package/src/generators/init-publishable/generator.js +45 -53
- package/src/generators/init-publishable/generator.js.map +1 -1
- package/src/generators/init-publishable/index.js +4 -7
- package/src/generators/init-publishable/index.js.map +1 -1
- package/src/index.js +2 -7
- package/src/index.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [16.0.0-dev.17](https://gitlab.com/rxap/packages/compare/@rxap/plugin-library@16.0.0-dev.16...@rxap/plugin-library@16.0.0-dev.17) (2023-08-16)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- change from commonjs to es2022 ([fd0f2ba](https://gitlab.com/rxap/packages/commit/fd0f2bae24eae7c854e96f630076cd5598c30be6))
|
|
11
|
+
|
|
6
12
|
# [16.0.0-dev.16](https://gitlab.com/rxap/packages/compare/@rxap/plugin-library@16.0.0-dev.15...@rxap/plugin-library@16.0.0-dev.16) (2023-08-14)
|
|
7
13
|
|
|
8
14
|
### Bug Fixes
|
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ yarn add @rxap/plugin-library
|
|
|
19
19
|
```
|
|
20
20
|
**Install peer dependencies:**
|
|
21
21
|
```bash
|
|
22
|
-
yarn add @nx/devkit@^16.5.0 @rxap/generator-ts-morph@^1.0.1-dev.3 @rxap/generator-utilities@^1.1.0-dev.4 @rxap/node-utilities@^1.1.0-dev.1 @rxap/plugin-angular@^16.1.0-dev.
|
|
22
|
+
yarn add @nx/devkit@^16.5.0 @rxap/generator-ts-morph@^1.0.1-dev.3 @rxap/generator-utilities@^1.1.0-dev.4 @rxap/node-utilities@^1.1.0-dev.1 @rxap/plugin-angular@^16.1.0-dev.8 @rxap/plugin-nestjs@^16.1.0-dev.7 @rxap/plugin-utilities@^16.1.0-dev.6 @rxap/workspace-utilities@^0.1.0-dev.3 nx@^16.5.0 semver@^7.3.5 ts-morph@^18.0.0
|
|
23
23
|
```
|
|
24
24
|
**Execute the init generator:**
|
|
25
25
|
```bash
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rxap/plugin-library",
|
|
3
|
-
"version": "16.0.0-dev.
|
|
4
|
-
"type": "
|
|
3
|
+
"version": "16.0.0-dev.17",
|
|
4
|
+
"type": "module",
|
|
5
5
|
"executors": "./executors.json",
|
|
6
6
|
"generators": "./generators.json",
|
|
7
7
|
"publishConfig": {
|
|
@@ -24,11 +24,11 @@
|
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
"package": "@rxap/plugin-angular",
|
|
27
|
-
"version": "16.1.0-dev.
|
|
27
|
+
"version": "16.1.0-dev.8"
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
30
|
"package": "@rxap/plugin-nestjs",
|
|
31
|
-
"version": "16.1.0-dev.
|
|
31
|
+
"version": "16.1.0-dev.7"
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
"package": "@rxap/plugin-utilities",
|
|
@@ -77,21 +77,21 @@
|
|
|
77
77
|
"@rxap/generator-ts-morph": "^1.0.1-dev.3",
|
|
78
78
|
"@rxap/generator-utilities": "^1.1.0-dev.4",
|
|
79
79
|
"@rxap/node-utilities": "^1.1.0-dev.1",
|
|
80
|
-
"@rxap/plugin-angular": "^16.1.0-dev.
|
|
81
|
-
"@rxap/plugin-nestjs": "^16.1.0-dev.
|
|
80
|
+
"@rxap/plugin-angular": "^16.1.0-dev.8",
|
|
81
|
+
"@rxap/plugin-nestjs": "^16.1.0-dev.7",
|
|
82
82
|
"@rxap/plugin-utilities": "^16.1.0-dev.6",
|
|
83
83
|
"@rxap/workspace-utilities": "^0.1.0-dev.3",
|
|
84
84
|
"nx": "^16.5.0",
|
|
85
85
|
"semver": "^7.3.5",
|
|
86
86
|
"ts-morph": "^18.0.0",
|
|
87
|
-
"@rxap/plugin-localazy": "16.1.0-dev.
|
|
88
|
-
"@rxap/schematics-ts-morph": "16.0.0-dev.
|
|
89
|
-
"@rxap/schematics-utilities": "16.0.0-dev.
|
|
90
|
-
"@rxap/utilities": "16.0.0-dev.
|
|
91
|
-
"@rxap/workspace-ts-morph": "0.1.0-dev.
|
|
87
|
+
"@rxap/plugin-localazy": "16.1.0-dev.4",
|
|
88
|
+
"@rxap/schematics-ts-morph": "16.0.0-dev.11",
|
|
89
|
+
"@rxap/schematics-utilities": "16.0.0-dev.8",
|
|
90
|
+
"@rxap/utilities": "16.0.0-dev.10",
|
|
91
|
+
"@rxap/workspace-ts-morph": "0.1.0-dev.1"
|
|
92
92
|
},
|
|
93
93
|
"schematics": "./generators.json",
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "bbab80e59acbe435a02e69c9fec022780cf4640d",
|
|
95
95
|
"main": "./src/index.js",
|
|
96
96
|
"types": "./src/index.d.ts"
|
|
97
97
|
}
|
|
@@ -1,36 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const rootPackageJson = (0, plugin_utilities_1.readPackageJsonForProject)(context, 'packages');
|
|
12
|
-
const targetVersion = (_a = rootPackageJson.devDependencies[options.packageName]) !== null && _a !== void 0 ? _a : rootPackageJson.dependencies[options.packageName];
|
|
13
|
-
if (!targetVersion) {
|
|
14
|
-
console.error(`The package ${options.packageName} is not installed in the root package.json`);
|
|
15
|
-
return {
|
|
16
|
-
success: false,
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
console.log(`Current '${options.packageName}' version: ${targetVersion}`);
|
|
20
|
-
console.log(`Project version: ${projectJson.version}`);
|
|
21
|
-
const version = (0, semver_1.parse)(targetVersion);
|
|
22
|
-
const versionRange = `>=${version.major}`;
|
|
23
|
-
const normalizedVersion = projectJson.version.replace(/-.*$/, '');
|
|
24
|
-
if (!(0, semver_1.satisfies)(normalizedVersion, versionRange)) {
|
|
25
|
-
console.error(`The project version '${projectJson.version}' normalized '${normalizedVersion}' is not compatible with the '${options.packageName}' version '${targetVersion}' with the range '${versionRange}'`);
|
|
26
|
-
return {
|
|
27
|
-
success: false,
|
|
28
|
-
};
|
|
29
|
-
}
|
|
1
|
+
import { readPackageJsonForProject } from '@rxap/plugin-utilities';
|
|
2
|
+
import { parse, satisfies, } from 'semver';
|
|
3
|
+
export default async function runExecutor(options, context) {
|
|
4
|
+
console.log('Executor ran for CheckVersion', options);
|
|
5
|
+
const projectJson = readPackageJsonForProject(context);
|
|
6
|
+
const rootPackageJson = readPackageJsonForProject(context, 'packages');
|
|
7
|
+
const targetVersion = rootPackageJson.devDependencies[options.packageName] ??
|
|
8
|
+
rootPackageJson.dependencies[options.packageName];
|
|
9
|
+
if (!targetVersion) {
|
|
10
|
+
console.error(`The package ${options.packageName} is not installed in the root package.json`);
|
|
30
11
|
return {
|
|
31
|
-
success:
|
|
12
|
+
success: false,
|
|
32
13
|
};
|
|
33
|
-
}
|
|
14
|
+
}
|
|
15
|
+
console.log(`Current '${options.packageName}' version: ${targetVersion}`);
|
|
16
|
+
console.log(`Project version: ${projectJson.version}`);
|
|
17
|
+
const version = parse(targetVersion);
|
|
18
|
+
const versionRange = `>=${version.major}`;
|
|
19
|
+
const normalizedVersion = projectJson.version.replace(/-.*$/, '');
|
|
20
|
+
if (!satisfies(normalizedVersion, versionRange)) {
|
|
21
|
+
console.error(`The project version '${projectJson.version}' normalized '${normalizedVersion}' is not compatible with the '${options.packageName}' version '${targetVersion}' with the range '${versionRange}'`);
|
|
22
|
+
return {
|
|
23
|
+
success: false,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
success: true,
|
|
28
|
+
};
|
|
34
29
|
}
|
|
35
|
-
exports.default = runExecutor;
|
|
36
30
|
//# sourceMappingURL=executor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/library/src/executors/check-version/executor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/library/src/executors/check-version/executor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EACL,KAAK,EACL,SAAS,GACV,MAAM,QAAQ,CAAC;AAGhB,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,WAAW,CACvC,OAAmC,EACnC,OAAwB;IAExB,OAAO,CAAC,GAAG,CAAC,+BAA+B,EAAE,OAAO,CAAC,CAAC;IAEtD,MAAM,WAAW,GAAG,yBAAyB,CAAC,OAAO,CAAC,CAAC;IACvD,MAAM,eAAe,GAAG,yBAAyB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IAEvE,MAAM,aAAa,GAAG,eAAe,CAAC,eAAe,CAAC,OAAO,CAAC,WAAW,CAAC;QACxE,eAAe,CAAC,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAEpD,IAAI,CAAC,aAAa,EAAE;QAClB,OAAO,CAAC,KAAK,CAAC,eAAgB,OAAO,CAAC,WAAY,4CAA4C,CAAC,CAAC;QAChG,OAAO;YACL,OAAO,EAAE,KAAK;SACf,CAAC;KACH;IAED,OAAO,CAAC,GAAG,CAAC,YAAa,OAAO,CAAC,WAAY,cAAe,aAAc,EAAE,CAAC,CAAC;IAC9E,OAAO,CAAC,GAAG,CAAC,oBAAqB,WAAW,CAAC,OAAQ,EAAE,CAAC,CAAC;IAEzD,MAAM,OAAO,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC;IAErC,MAAM,YAAY,GAAG,KAAM,OAAO,CAAC,KAAM,EAAE,CAAC;IAE5C,MAAM,iBAAiB,GAAG,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAElE,IAAI,CAAC,SAAS,CAAC,iBAAiB,EAAE,YAAY,CAAC,EAAE;QAC/C,OAAO,CAAC,KAAK,CAAC,wBAAyB,WAAW,CAAC,OAAQ,iBAAkB,iBAAkB,iCAAkC,OAAO,CAAC,WAAY,cAAe,aAAc,qBAAsB,YAAa,GAAG,CAAC,CAAC;QAC1N,OAAO;YACL,OAAO,EAAE,KAAK;SACf,CAAC;KACH;IAED,OAAO;QACL,OAAO,EAAE,IAAI;KACd,CAAC;AACJ,CAAC"}
|
|
@@ -1,100 +1,92 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const plugin_utilities_1 = require("@rxap/plugin-utilities");
|
|
6
|
-
const Handlebars = tslib_1.__importStar(require("handlebars"));
|
|
7
|
-
const path_1 = require("path");
|
|
1
|
+
import { readJsonFile, } from '@nx/devkit';
|
|
2
|
+
import { GetProjectRoot, readFileFromProjectRoot, readPackageJsonForProject, writeFileToProjectRoot, } from '@rxap/plugin-utilities';
|
|
3
|
+
import * as Handlebars from 'handlebars';
|
|
4
|
+
import { join } from 'path';
|
|
8
5
|
function readGetStartedFile(context) {
|
|
9
6
|
// TODO : support GET_STARTED.md but with an fallback to GETSTARTED.md
|
|
10
|
-
return
|
|
7
|
+
return readFileFromProjectRoot(context, 'GETSTARTED.md');
|
|
11
8
|
}
|
|
12
9
|
function readGetGuidsFile(context) {
|
|
13
|
-
return
|
|
10
|
+
return readFileFromProjectRoot(context, 'GUIDES.md');
|
|
14
11
|
}
|
|
15
12
|
function getTemplate(context) {
|
|
16
|
-
const readmeTemplateFile =
|
|
13
|
+
const readmeTemplateFile = readFileFromProjectRoot(context, 'README.md.handlebars', true);
|
|
17
14
|
return Handlebars.compile(readmeTemplateFile);
|
|
18
15
|
}
|
|
19
16
|
function getSchematics(context) {
|
|
20
|
-
|
|
21
|
-
const { schematics } = (0, plugin_utilities_1.readPackageJsonForProject)(context);
|
|
17
|
+
const { schematics } = readPackageJsonForProject(context);
|
|
22
18
|
if (!schematics) {
|
|
23
19
|
return [];
|
|
24
20
|
}
|
|
25
|
-
const projectRoot =
|
|
26
|
-
const collectionJson =
|
|
21
|
+
const projectRoot = GetProjectRoot(context);
|
|
22
|
+
const collectionJson = readJsonFile(join(context.root, projectRoot, schematics));
|
|
27
23
|
const schematicList = [];
|
|
28
|
-
for (const [schematic, config] of Object.entries(
|
|
24
|
+
for (const [schematic, config] of Object.entries(collectionJson.schematics ?? {})) {
|
|
29
25
|
schematicList.push({
|
|
30
26
|
name: schematic,
|
|
31
27
|
description: config.description,
|
|
32
|
-
schema:
|
|
28
|
+
schema: readJsonFile(join(context.root, projectRoot, config.schema)),
|
|
33
29
|
});
|
|
34
30
|
}
|
|
35
31
|
return schematicList;
|
|
36
32
|
}
|
|
37
33
|
function getGenerators(context) {
|
|
38
|
-
|
|
39
|
-
const { generators } = (0, plugin_utilities_1.readPackageJsonForProject)(context);
|
|
34
|
+
const { generators } = readPackageJsonForProject(context);
|
|
40
35
|
if (!generators) {
|
|
41
36
|
return [];
|
|
42
37
|
}
|
|
43
|
-
const projectRoot =
|
|
44
|
-
const collectionJson =
|
|
38
|
+
const projectRoot = GetProjectRoot(context);
|
|
39
|
+
const collectionJson = readJsonFile(join(context.root, projectRoot, generators));
|
|
45
40
|
const generatorList = [];
|
|
46
|
-
for (const [generator, config] of Object.entries(
|
|
41
|
+
for (const [generator, config] of Object.entries(collectionJson.generators ?? {})) {
|
|
47
42
|
generatorList.push({
|
|
48
43
|
name: generator,
|
|
49
44
|
description: config.description,
|
|
50
|
-
schema:
|
|
45
|
+
schema: readJsonFile(join(context.root, projectRoot, config.schema)),
|
|
51
46
|
});
|
|
52
47
|
}
|
|
53
48
|
const schematicList = getSchematics(context);
|
|
54
49
|
return [...generatorList, ...schematicList];
|
|
55
50
|
}
|
|
56
51
|
function getBuilders(context) {
|
|
57
|
-
|
|
58
|
-
const { builders } = (0, plugin_utilities_1.readPackageJsonForProject)(context);
|
|
52
|
+
const { builders } = readPackageJsonForProject(context);
|
|
59
53
|
if (!builders) {
|
|
60
54
|
return [];
|
|
61
55
|
}
|
|
62
|
-
const projectRoot =
|
|
63
|
-
const buildersJson =
|
|
56
|
+
const projectRoot = GetProjectRoot(context);
|
|
57
|
+
const buildersJson = readJsonFile(join(context.root, projectRoot, builders));
|
|
64
58
|
const builderList = [];
|
|
65
|
-
for (const [builder, config] of Object.entries(
|
|
59
|
+
for (const [builder, config] of Object.entries(buildersJson.builders ?? {})) {
|
|
66
60
|
builderList.push({
|
|
67
61
|
name: builder,
|
|
68
62
|
description: config.description,
|
|
69
|
-
schema:
|
|
63
|
+
schema: readJsonFile(join(context.root, projectRoot, config.schema)),
|
|
70
64
|
});
|
|
71
65
|
}
|
|
72
66
|
return builderList;
|
|
73
67
|
}
|
|
74
68
|
function getExecutors(context) {
|
|
75
|
-
|
|
76
|
-
const { executors } = (0, plugin_utilities_1.readPackageJsonForProject)(context);
|
|
69
|
+
const { executors } = readPackageJsonForProject(context);
|
|
77
70
|
if (!executors) {
|
|
78
71
|
return [];
|
|
79
72
|
}
|
|
80
|
-
const projectRoot =
|
|
81
|
-
const executorsJson =
|
|
73
|
+
const projectRoot = GetProjectRoot(context);
|
|
74
|
+
const executorsJson = readJsonFile(join(context.root, projectRoot, executors));
|
|
82
75
|
const executorList = [];
|
|
83
|
-
for (const [executor, config] of Object.entries(
|
|
76
|
+
for (const [executor, config] of Object.entries(executorsJson.executors ?? {})) {
|
|
84
77
|
executorList.push({
|
|
85
78
|
name: executor,
|
|
86
79
|
description: config.description,
|
|
87
|
-
schema:
|
|
80
|
+
schema: readJsonFile(join(context.root, projectRoot, config.schema)),
|
|
88
81
|
});
|
|
89
82
|
}
|
|
90
83
|
const builderList = getBuilders(context);
|
|
91
84
|
return [...executorList, ...builderList];
|
|
92
85
|
}
|
|
93
86
|
function getPeerDependencyList(context) {
|
|
94
|
-
|
|
95
|
-
const packageJson = (0, plugin_utilities_1.readPackageJsonForProject)(context);
|
|
87
|
+
const packageJson = readPackageJsonForProject(context);
|
|
96
88
|
const peerDependencyList = [];
|
|
97
|
-
for (const [packageName, version] of Object.entries(
|
|
89
|
+
for (const [packageName, version] of Object.entries(packageJson.peerDependencies ?? {})) {
|
|
98
90
|
peerDependencyList.push({
|
|
99
91
|
name: packageName,
|
|
100
92
|
version,
|
|
@@ -107,35 +99,32 @@ Handlebars.registerHelper('hasProperties', function (record, options) {
|
|
|
107
99
|
options.fn(this);
|
|
108
100
|
}
|
|
109
101
|
});
|
|
110
|
-
function runExecutor(options, context) {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
hasConfigGenerator: generatorList.find((generator) => generator.name === 'config') !== undefined,
|
|
132
|
-
});
|
|
133
|
-
console.log('README.md generated');
|
|
134
|
-
(0, plugin_utilities_1.writeFileToProjectRoot)(context, 'README.md', readme);
|
|
135
|
-
return {
|
|
136
|
-
success: true,
|
|
137
|
-
};
|
|
102
|
+
export default async function runExecutor(options, context) {
|
|
103
|
+
const getStartedContent = readGetStartedFile(context);
|
|
104
|
+
const guidesContent = readGetGuidsFile(context);
|
|
105
|
+
const packageJson = readPackageJsonForProject(context);
|
|
106
|
+
const template = getTemplate(context);
|
|
107
|
+
const generatorList = getGenerators(context);
|
|
108
|
+
const executorsList = getExecutors(context);
|
|
109
|
+
const peerDependencyList = getPeerDependencyList(context);
|
|
110
|
+
console.log('Input for README.md template ready');
|
|
111
|
+
const readme = template({
|
|
112
|
+
packageJson,
|
|
113
|
+
getStartedContent,
|
|
114
|
+
guidesContent,
|
|
115
|
+
generatorList,
|
|
116
|
+
executorsList,
|
|
117
|
+
peerDependencyList,
|
|
118
|
+
hasPeerDependencies: peerDependencyList.length > 0,
|
|
119
|
+
hasGenerators: generatorList.length > 0,
|
|
120
|
+
hasExecutors: executorsList.length > 0,
|
|
121
|
+
hasInitGenerator: generatorList.find((generator) => generator.name === 'init') !== undefined,
|
|
122
|
+
hasConfigGenerator: generatorList.find((generator) => generator.name === 'config') !== undefined,
|
|
138
123
|
});
|
|
124
|
+
console.log('README.md generated');
|
|
125
|
+
writeFileToProjectRoot(context, 'README.md', readme);
|
|
126
|
+
return {
|
|
127
|
+
success: true,
|
|
128
|
+
};
|
|
139
129
|
}
|
|
140
|
-
exports.default = runExecutor;
|
|
141
130
|
//# sourceMappingURL=executor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/library/src/executors/readme/executor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/library/src/executors/readme/executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,cAAc,EACd,uBAAuB,EACvB,yBAAyB,EACzB,sBAAsB,GACvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,UAAU,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAG5B,SAAS,kBAAkB,CAAC,OAAwB;IAClD,sEAAsE;IACtE,OAAO,uBAAuB,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;AAC3D,CAAC;AAED,SAAS,gBAAgB,CAAC,OAAwB;IAChD,OAAO,uBAAuB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;AACvD,CAAC;AAED,SAAS,WAAW,CAAC,OAAwB;IAC3C,MAAM,kBAAkB,GAAG,uBAAuB,CAAC,OAAO,EAAE,sBAAsB,EAAE,IAAI,CAAC,CAAC;IAE1F,OAAO,UAAU,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAChD,CAAC;AAcD,SAAS,aAAa,CAAC,OAAwB;IAC7C,M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 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const workspace_utilities_1 = require("@rxap/workspace-utilities");
|
|
5
|
-
const run_commands_impl_1 = tslib_1.__importDefault(require("nx/src/executors/run-commands/run-commands.impl"));
|
|
1
|
+
import { IsRxapRepository } from '@rxap/workspace-utilities';
|
|
2
|
+
import run from 'nx/src/executors/run-commands/run-commands.impl';
|
|
6
3
|
function buildParameters(options = {}) {
|
|
7
4
|
const params = [];
|
|
8
5
|
for (const [key, value] of Object.entries(options)) {
|
|
@@ -20,32 +17,27 @@ function buildParameters(options = {}) {
|
|
|
20
17
|
}
|
|
21
18
|
return params.join(' ');
|
|
22
19
|
}
|
|
23
|
-
function runExecutor(options, context) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
if ((0, workspace_utilities_1.IsRxapRepository)(context.root)) {
|
|
30
|
-
if (options.generator.match(/@rxap\/schematic/)) {
|
|
31
|
-
command = `yarn schematic ${options.generator}`;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
(_a = options.options) !== null && _a !== void 0 ? _a : (options.options = {});
|
|
35
|
-
if (!options.withoutProjectArgument) {
|
|
36
|
-
(_b = (_c = options.options)['project']) !== null && _b !== void 0 ? _b : (_c['project'] = context.projectName);
|
|
37
|
-
}
|
|
38
|
-
command += ` ${buildParameters(options.options)}`;
|
|
39
|
-
if (options.dryRun) {
|
|
40
|
-
command += ' --dry-run';
|
|
20
|
+
export default async function runExecutor(options, context) {
|
|
21
|
+
console.log('Executor ran for RunGenerator', options);
|
|
22
|
+
let command = `nx g ${options.generator}`;
|
|
23
|
+
if (IsRxapRepository(context.root)) {
|
|
24
|
+
if (options.generator.match(/@rxap\/schematic/)) {
|
|
25
|
+
command = `yarn schematic ${options.generator}`;
|
|
41
26
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
27
|
+
}
|
|
28
|
+
options.options ??= {};
|
|
29
|
+
if (!options.withoutProjectArgument) {
|
|
30
|
+
options.options['project'] ??= context.projectName;
|
|
31
|
+
}
|
|
32
|
+
command += ` ${buildParameters(options.options)}`;
|
|
33
|
+
if (options.dryRun) {
|
|
34
|
+
command += ' --dry-run';
|
|
35
|
+
}
|
|
36
|
+
console.log('command: ', command);
|
|
37
|
+
return run({
|
|
38
|
+
cwd: context.root,
|
|
39
|
+
command,
|
|
40
|
+
__unparsed__: [],
|
|
41
|
+
}, context);
|
|
49
42
|
}
|
|
50
|
-
exports.default = runExecutor;
|
|
51
43
|
//# sourceMappingURL=executor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/library/src/executors/run-generator/executor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/library/src/executors/run-generator/executor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,GAAG,MAAM,iDAAiD,CAAC;AAGlE,SAAS,eAAe,CAAC,UAAmC,EAAE;IAC5D,MAAM,MAAM,GAAG,EAAE,CAAC;IAClB,KAAK,MAAM,CAAE,GAAG,EAAE,KAAK,CAAE,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QACpD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YACxB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;gBACxB,MAAM,CAAC,IAAI,CAAC,KAAM,GAAI,IAAK,IAAK,EAAE,CAAC,CAAC;aACrC;SACF;aAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YACpC,MAAM,CAAC,IAAI,CAAC,KAAM,GAAI,IAAK,IAAI,CAAC,SAAS,CAAC,KAAK,CAAE,EAAE,CAAC,CAAC;SACtD;aAAM;YACL,MAAM,CAAC,IAAI,CAAC,KAAM,GAAI,IAAK,KAAM,EAAE,CAAC,CAAC;SACtC;KACF;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC1B,CAAC;AAED,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,WAAW,CAAC,OAAmC,EAAE,OAAwB;IACrG,OAAO,CAAC,GAAG,CAAC,+BAA+B,EAAE,OAAO,CAAC,CAAC;IAEtD,IAAI,OAAO,GAAG,QAAS,OAAO,CAAC,SAAU,EAAE,CAAC;IAE5C,IAAI,gBAAgB,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QAClC,IAAI,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,kBAAkB,CAAC,EAAE;YAC/C,OAAO,GAAG,kBAAmB,OAAO,CAAC,SAAU,EAAE,CAAC;SACnD;KACF;IAED,OAAO,CAAC,OAAO,KAAK,EAAE,CAAC;IAEvB,IAAI,CAAC,OAAO,CAAC,sBAAsB,EAAE;QACnC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,OAAO,CAAC,WAAW,CAAC;KACpD;IAED,OAAO,IAAI,IAAK,eAAe,CAAC,OAAO,CAAC,OAAO,CAAE,EAAE,CAAC;IAEpD,IAAI,OAAO,CAAC,MAAM,EAAE;QAClB,OAAO,IAAI,YAAY,CAAC;KACzB;IAED,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAElC,OAAO,GAAG,CAAC;QACT,GAAG,EAAE,OAAO,CAAC,IAAI;QACjB,OAAO;QACP,YAAY,EAAE,EAAE;KACjB,EAAE,OAAO,CAAC,CAAC;AACd,CAAC"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const plugin_utilities_1 = require("@rxap/plugin-utilities");
|
|
1
|
+
import { getDirectPackageDependenciesForProject, readPackageJsonForProject, writePackageJsonFormProject, } from '@rxap/plugin-utilities';
|
|
5
2
|
function replaceVersionWithCurrentVersion(dependencies = {}, context) {
|
|
6
|
-
const directPackageDependencies =
|
|
3
|
+
const directPackageDependencies = getDirectPackageDependenciesForProject(context);
|
|
7
4
|
for (const [packageName] of Object.entries(dependencies)) {
|
|
8
5
|
console.log(`Check if ${packageName} is a direct dependency`);
|
|
9
6
|
if (directPackageDependencies[packageName]) {
|
|
@@ -15,18 +12,15 @@ function replaceVersionWithCurrentVersion(dependencies = {}, context) {
|
|
|
15
12
|
}
|
|
16
13
|
}
|
|
17
14
|
}
|
|
18
|
-
function runExecutor(options, context) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
};
|
|
29
|
-
});
|
|
15
|
+
export default async function runExecutor(options, context) {
|
|
16
|
+
const packageJson = readPackageJsonForProject(context);
|
|
17
|
+
const { dependencies, peerDependencies, optionalDependencies, } = packageJson;
|
|
18
|
+
replaceVersionWithCurrentVersion(dependencies, context);
|
|
19
|
+
replaceVersionWithCurrentVersion(peerDependencies, context);
|
|
20
|
+
replaceVersionWithCurrentVersion(optionalDependencies, context);
|
|
21
|
+
writePackageJsonFormProject(context, packageJson);
|
|
22
|
+
return {
|
|
23
|
+
success: true,
|
|
24
|
+
};
|
|
30
25
|
}
|
|
31
|
-
exports.default = runExecutor;
|
|
32
26
|
//# sourceMappingURL=executor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/library/src/executors/update-dependencies/executor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/library/src/executors/update-dependencies/executor.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,sCAAsC,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package-json");
|
|
5
|
-
const plugin_utilities_1 = require("@rxap/plugin-utilities");
|
|
1
|
+
import { normalizePackageGroup, } from 'nx/src/utils/package-json';
|
|
2
|
+
import { getDirectPackageDependenciesForProject, readPackageJsonForProject, writePackageJsonFormProject, } from '@rxap/plugin-utilities';
|
|
6
3
|
function getPackageGroup(context) {
|
|
7
|
-
const directPackageDependencies =
|
|
4
|
+
const directPackageDependencies = getDirectPackageDependenciesForProject(context);
|
|
8
5
|
return Object.entries(directPackageDependencies)
|
|
9
6
|
.filter(([packageName]) => packageName.startsWith('@rxap/'))
|
|
10
7
|
.map(([packageName, version]) => ({
|
|
@@ -13,33 +10,29 @@ function getPackageGroup(context) {
|
|
|
13
10
|
}));
|
|
14
11
|
}
|
|
15
12
|
function mergePackageGroup(original, updated) {
|
|
16
|
-
const normalized =
|
|
13
|
+
const normalized = normalizePackageGroup(original);
|
|
17
14
|
return [...updated, ...normalized].filter((item, index, array) => {
|
|
18
15
|
return array.findIndex(({ package: packageName }) => packageName === item.package) === index;
|
|
19
16
|
}).filter(({ package: packageName }) => packageName.startsWith('@rxap/'));
|
|
20
17
|
}
|
|
21
|
-
function runExecutor(options, context) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
success: true,
|
|
41
|
-
};
|
|
42
|
-
});
|
|
18
|
+
export default async function runExecutor(options, context) {
|
|
19
|
+
const packageJson = readPackageJsonForProject(context);
|
|
20
|
+
// ensure the property "ng-migrations" exists
|
|
21
|
+
packageJson['nx-migrations'] ??= {};
|
|
22
|
+
const { 'nx-migrations': nxMigrations } = packageJson;
|
|
23
|
+
if (!nxMigrations) {
|
|
24
|
+
console.error('INTERNAL: Could not extract the nx-migrations property from the package.json');
|
|
25
|
+
return { success: false };
|
|
26
|
+
}
|
|
27
|
+
if (typeof nxMigrations !== 'object') {
|
|
28
|
+
console.error('INTERNAL: The nx-migrations property in the package.json is not an object');
|
|
29
|
+
return { success: false };
|
|
30
|
+
}
|
|
31
|
+
nxMigrations.packageGroup ??= [];
|
|
32
|
+
nxMigrations.packageGroup = mergePackageGroup(nxMigrations.packageGroup, getPackageGroup(context));
|
|
33
|
+
writePackageJsonFormProject(context, packageJson);
|
|
34
|
+
return {
|
|
35
|
+
success: true,
|
|
36
|
+
};
|
|
43
37
|
}
|
|
44
|
-
exports.default = runExecutor;
|
|
45
38
|
//# sourceMappingURL=executor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/library/src/executors/update-package-group/executor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/library/src/executors/update-package-group/executor.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,qBAAqB,GAEtB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,sCAAsC,EACtC,yBAAyB,EACzB,2BAA2B,GAC5B,MAAM,wBAAwB,CAAC;AAEhC,SAAS,eAAe,CAAC,OAAwB;IAC/C,MAAM,yBAAyB,GAAG,sCAAsC,CAAC,OAAO,CAAC,CAAC;IAClF,OAAO,MAAM,CAAC,OAAO,CAAC,yBAAyB,CAAC;SAClC,MAAM,CAAC,CAAC,CAAE,WAAW,CAAE,EAAE,EAAE,CAAC,WAAW,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;SAC7D,GAAG,CAAC,CAAC,CAAE,WAAW,EAAE,OAAO,CAAE,EAAE,EAAE,CAAC,CAAC;QAClC,OAAO,EAAE,WAAW;QACpB,OAAO,EAAE,OAAO;KACjB,CAAC,CAAC,CAAC;AACnB,CAAC;AAED,SAAS,iBAAiB,CAAC,QAAsB,EAAE,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