@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
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const generator_utilities_1 = require("@rxap/generator-utilities");
|
|
7
|
-
const path_1 = require("path");
|
|
1
|
+
import { getProjects, } from '@nx/devkit';
|
|
2
|
+
import { CoerceFile, GetProjectSourceRoot, SkipNonLibraryProject, VisitTree, } from '@rxap/generator-utilities';
|
|
3
|
+
import { join } from 'path';
|
|
8
4
|
function generateIndexFile(tree, projectName) {
|
|
9
|
-
const sourceRoot =
|
|
10
|
-
const libRoot =
|
|
5
|
+
const sourceRoot = GetProjectSourceRoot(tree, projectName);
|
|
6
|
+
const libRoot = join(sourceRoot, 'lib');
|
|
11
7
|
let filePathList = [];
|
|
12
|
-
for (const { path, isFile } of
|
|
8
|
+
for (const { path, isFile } of VisitTree(tree, libRoot)) {
|
|
13
9
|
if (isFile &&
|
|
14
10
|
path.endsWith('.ts') &&
|
|
15
11
|
!path.endsWith('.spec.ts') &&
|
|
@@ -39,7 +35,7 @@ function generateIndexFile(tree, projectName) {
|
|
|
39
35
|
}
|
|
40
36
|
else {
|
|
41
37
|
for (const fileName of map.get(basePath)) {
|
|
42
|
-
const fullPathToLibRoot =
|
|
38
|
+
const fullPathToLibRoot = join('lib', basePath, fileName);
|
|
43
39
|
rootIndexFile += `export * from './${fullPathToLibRoot.replace(/\.ts$/, '')}';\n`;
|
|
44
40
|
}
|
|
45
41
|
}
|
|
@@ -48,26 +44,23 @@ function generateIndexFile(tree, projectName) {
|
|
|
48
44
|
if (!rootIndexFile) {
|
|
49
45
|
rootIndexFile = 'export {};';
|
|
50
46
|
}
|
|
51
|
-
|
|
47
|
+
CoerceFile(tree, join(sourceRoot, 'index.ts'), rootIndexFile, true);
|
|
52
48
|
}
|
|
53
49
|
function skipProject(tree, options, project, projectName) {
|
|
54
|
-
if (
|
|
50
|
+
if (SkipNonLibraryProject(tree, options, project, projectName)) {
|
|
55
51
|
return true;
|
|
56
52
|
}
|
|
57
53
|
return false;
|
|
58
54
|
}
|
|
59
|
-
function indexExportGenerator(tree, options) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
continue;
|
|
65
|
-
}
|
|
66
|
-
console.log('generate index file for project: ', projectName);
|
|
67
|
-
generateIndexFile(tree, projectName);
|
|
55
|
+
export async function indexExportGenerator(tree, options) {
|
|
56
|
+
console.log('index export generator: ', options);
|
|
57
|
+
for (const [projectName, project] of getProjects(tree).entries()) {
|
|
58
|
+
if (skipProject(tree, options, project, projectName)) {
|
|
59
|
+
continue;
|
|
68
60
|
}
|
|
69
|
-
|
|
61
|
+
console.log('generate index file for project: ', projectName);
|
|
62
|
+
generateIndexFile(tree, projectName);
|
|
63
|
+
}
|
|
70
64
|
}
|
|
71
|
-
|
|
72
|
-
exports.default = indexExportGenerator;
|
|
65
|
+
export default indexExportGenerator;
|
|
73
66
|
//# sourceMappingURL=generator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/library/src/generators/index-export/generator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/library/src/generators/index-export/generator.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,GAEZ,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,UAAU,EACV,oBAAoB,EACpB,qBAAqB,EACrB,SAAS,GACV,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAG5B,SAAS,iBAAiB,CAAC,IAAU,EAAE,WAAmB;IAExD,MAAM,UAAU,GAAG,oBAAoB,CAAC,IAAI,EAAE,WAAW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AO,CAAC,GAAG,CAAC,0BAA0B,EAAE,OAAO,CAAC,CAAC;IAEjD,KAAK,MAAM,CAAE,WAAW,EAAE,OAAO,CAAE,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE;QAClE,IAAI,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE;YACpD,SAAS;SACV;QAED,OAAO,CAAC,GAAG,CAAC,mCAAmC,EAAE,WAAW,CAAC,CAAC;QAE9D,iBAAiB,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;KACtC;AAEH,CAAC;AAED,eAAe,oBAAoB,CAAC"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
const generator_1 = tslib_1.__importDefault(require("./generator"));
|
|
6
|
-
const schematic = (0, devkit_1.convertNxGenerator)(generator_1.default);
|
|
7
|
-
exports.default = schematic;
|
|
1
|
+
import { convertNxGenerator } from '@nx/devkit';
|
|
2
|
+
import generator from './generator';
|
|
3
|
+
const schematic = convertNxGenerator(generator);
|
|
4
|
+
export default schematic;
|
|
8
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/library/src/generators/index-export/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/library/src/generators/index-export/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC,MAAM,SAAS,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;AAChD,eAAe,SAAS,CAAC"}
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const plugin_nestjs_1 = require("@rxap/plugin-nestjs");
|
|
9
|
-
const generator_1 = tslib_1.__importDefault(require("../init-buildable/generator"));
|
|
10
|
-
const generator_2 = tslib_1.__importDefault(require("../init-plugin/generator"));
|
|
11
|
-
const generator_3 = tslib_1.__importDefault(require("../init-publishable/generator"));
|
|
1
|
+
import { getProjects, updateProjectConfiguration, } from '@nx/devkit';
|
|
2
|
+
import { CoerceProjectTags, IsBuildable, IsPublishable, SkipNonLibraryProject, } from '@rxap/generator-utilities';
|
|
3
|
+
import { AngularInitGenerator } from '@rxap/plugin-angular';
|
|
4
|
+
import { nestJsInitGenerator } from '@rxap/plugin-nestjs';
|
|
5
|
+
import initBuildableGenerator from '../init-buildable/generator';
|
|
6
|
+
import initPluginGenerator from '../init-plugin/generator';
|
|
7
|
+
import initPublishableGenerator from '../init-publishable/generator';
|
|
12
8
|
function updateProjectTags(project) {
|
|
13
9
|
const tags = project.root.split('/').filter(Boolean);
|
|
14
10
|
tags.unshift(); // remove the first element this is libs or packages, etc.
|
|
@@ -18,43 +14,45 @@ function updateProjectTags(project) {
|
|
|
18
14
|
if (tags[0] === 'nest') {
|
|
19
15
|
tags.push('nestjs');
|
|
20
16
|
}
|
|
21
|
-
|
|
17
|
+
CoerceProjectTags(project, tags);
|
|
22
18
|
}
|
|
23
19
|
function skipProject(tree, options, project, projectName) {
|
|
24
|
-
if (
|
|
20
|
+
if (SkipNonLibraryProject(tree, options, project, projectName)) {
|
|
25
21
|
return true;
|
|
26
22
|
}
|
|
27
23
|
return false;
|
|
28
24
|
}
|
|
29
|
-
function initGenerator(tree, options) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if (skipProject(tree, options, project, projectName)) {
|
|
35
|
-
continue;
|
|
36
|
-
}
|
|
37
|
-
console.log(`init project: ${projectName}`);
|
|
38
|
-
updateProjectTags(project);
|
|
39
|
-
(0, devkit_1.updateProjectConfiguration)(tree, project.name, project);
|
|
40
|
-
if ((0, generator_utilities_1.IsBuildable)(project)) {
|
|
41
|
-
yield (0, generator_1.default)(tree, options);
|
|
42
|
-
}
|
|
43
|
-
if ((0, generator_utilities_1.IsPublishable)(tree, project)) {
|
|
44
|
-
yield (0, generator_3.default)(tree, options);
|
|
45
|
-
}
|
|
46
|
-
if ((_a = project.tags) === null || _a === void 0 ? void 0 : _a.includes('angular')) {
|
|
47
|
-
yield (0, plugin_angular_1.AngularInitGenerator)(tree, Object.assign(Object.assign({}, options), { projects: [projectName] }));
|
|
48
|
-
}
|
|
49
|
-
if ((_b = project.tags) === null || _b === void 0 ? void 0 : _b.includes('plugin')) {
|
|
50
|
-
yield (0, generator_2.default)(tree, Object.assign(Object.assign({}, options), { projects: [projectName] }));
|
|
51
|
-
}
|
|
52
|
-
if ((_c = project.tags) === null || _c === void 0 ? void 0 : _c.includes('nest')) {
|
|
53
|
-
yield (0, plugin_nestjs_1.nestJsInitGenerator)(tree, Object.assign(Object.assign({}, options), { projects: [projectName] }));
|
|
54
|
-
}
|
|
25
|
+
export async function initGenerator(tree, options) {
|
|
26
|
+
console.log('library init generator:', options);
|
|
27
|
+
for (const [projectName, project] of getProjects(tree).entries()) {
|
|
28
|
+
if (skipProject(tree, options, project, projectName)) {
|
|
29
|
+
continue;
|
|
55
30
|
}
|
|
56
|
-
|
|
31
|
+
console.log(`init project: ${projectName}`);
|
|
32
|
+
updateProjectTags(project);
|
|
33
|
+
updateProjectConfiguration(tree, project.name, project);
|
|
34
|
+
if (IsBuildable(project)) {
|
|
35
|
+
await initBuildableGenerator(tree, options);
|
|
36
|
+
}
|
|
37
|
+
if (IsPublishable(tree, project)) {
|
|
38
|
+
await initPublishableGenerator(tree, options);
|
|
39
|
+
}
|
|
40
|
+
if (project.tags?.includes('angular')) {
|
|
41
|
+
await AngularInitGenerator(tree, { ...options, projects: [projectName] });
|
|
42
|
+
}
|
|
43
|
+
if (project.tags?.includes('plugin')) {
|
|
44
|
+
await initPluginGenerator(tree, {
|
|
45
|
+
...options,
|
|
46
|
+
projects: [projectName],
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
if (project.tags?.includes('nest')) {
|
|
50
|
+
await nestJsInitGenerator(tree, {
|
|
51
|
+
...options,
|
|
52
|
+
projects: [projectName],
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
57
56
|
}
|
|
58
|
-
|
|
59
|
-
exports.default = initGenerator;
|
|
57
|
+
export default initGenerator;
|
|
60
58
|
//# sourceMappingURL=generator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/library/src/generators/init/generator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/library/src/generators/init/generator.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EAGX,0BAA0B,GAC3B,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,iBAAiB,EACjB,WAAW,EACX,aAAa,EACb,qBAAqB,GACtB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,sBAAsB,MAAM,6BAA6B,CAAC;AACjE,OAAO,mBAAmB,MAAM,0BAA0B,CAAC;AAC3D,OAAO,wBAAwB,MAAM,+BAA+B,CAAC;AAIrE,SAAS,iBAAiB,CAAC,OAA6B;IACtD,MAAM,IAAI,GAAa,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC/D,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,0DAA0D;IAC1E,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,SAAS,EAAE;QACzB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CA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G,OAAO,EAAE,QAAQ,EAAE,CAAE,WAAW,CAAE,EAAE,CAAC,CAAC;SAC7E;QAED,IAAI,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE;YACpC,MAAM,mBAAmB,CACvB,IAAI,EACJ;gBACE,GAAG,OAAO;gBACV,QAAQ,EAAE,CAAE,WAAW,CAAE;aAC1B,CACF,CAAC;SACH;QAED,IAAI,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE;YAClC,MAAM,mBAAmB,CACvB,IAAI,EACJ;gBACE,GAAG,OAAO;gBACV,QAAQ,EAAE,CAAE,WAAW,CAAE;aAC1B,CACF,CAAC;SACH;KAEF;AAEH,CAAC;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
const generator_1 = tslib_1.__importDefault(require("./generator"));
|
|
6
|
-
const schematic = (0, devkit_1.convertNxGenerator)(generator_1.default);
|
|
7
|
-
exports.default = schematic;
|
|
1
|
+
import { convertNxGenerator } from '@nx/devkit';
|
|
2
|
+
import generator from './generator';
|
|
3
|
+
const schematic = convertNxGenerator(generator);
|
|
4
|
+
export default schematic;
|
|
8
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/library/src/generators/init/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/library/src/generators/init/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC,MAAM,SAAS,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;AAChD,eAAe,SAAS,CAAC"}
|
|
@@ -1,43 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const generator_utilities_1 = require("@rxap/generator-utilities");
|
|
7
|
-
const workspace_utilities_1 = require("@rxap/workspace-utilities");
|
|
1
|
+
import { getProjects, readNxJson, updateNxJson, updateProjectConfiguration, } from '@nx/devkit';
|
|
2
|
+
import { SkipNonBuildableProject } from '@rxap/generator-utilities';
|
|
3
|
+
import { CoerceTarget, CoerceTargetDefaultsDependency, } from '@rxap/workspace-utilities';
|
|
8
4
|
function setGeneralTargetDefaults(tree) {
|
|
9
|
-
const nxJson =
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
const nxJson = readNxJson(tree);
|
|
6
|
+
CoerceTargetDefaultsDependency(nxJson, 'build', '^build');
|
|
7
|
+
updateNxJson(tree, nxJson);
|
|
12
8
|
}
|
|
13
9
|
function updateProjectTargets(project) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
(0, workspace_utilities_1.CoerceTarget)(project, 'build', {
|
|
10
|
+
if (project.targets?.['build']?.configurations?.['production']) {
|
|
11
|
+
CoerceTarget(project, 'build', {
|
|
17
12
|
defaultConfiguration: 'production',
|
|
18
13
|
});
|
|
19
14
|
}
|
|
20
15
|
}
|
|
21
16
|
function skipProject(tree, options, project, projectName) {
|
|
22
|
-
if (
|
|
17
|
+
if (SkipNonBuildableProject(tree, options, project, projectName)) {
|
|
23
18
|
return true;
|
|
24
19
|
}
|
|
25
20
|
return false;
|
|
26
21
|
}
|
|
27
|
-
function initBuildableGenerator(tree, options) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
continue;
|
|
34
|
-
}
|
|
35
|
-
console.log(`init project: ${projectName}`);
|
|
36
|
-
updateProjectTargets(project);
|
|
37
|
-
(0, devkit_1.updateProjectConfiguration)(tree, project.name, project);
|
|
22
|
+
export async function initBuildableGenerator(tree, options) {
|
|
23
|
+
console.log('buildable library init generator:', options);
|
|
24
|
+
setGeneralTargetDefaults(tree);
|
|
25
|
+
for (const [projectName, project] of getProjects(tree).entries()) {
|
|
26
|
+
if (skipProject(tree, options, project, projectName)) {
|
|
27
|
+
continue;
|
|
38
28
|
}
|
|
39
|
-
|
|
29
|
+
console.log(`init project: ${projectName}`);
|
|
30
|
+
updateProjectTargets(project);
|
|
31
|
+
updateProjectConfiguration(tree, project.name, project);
|
|
32
|
+
}
|
|
40
33
|
}
|
|
41
|
-
|
|
42
|
-
exports.default = initBuildableGenerator;
|
|
34
|
+
export default initBuildableGenerator;
|
|
43
35
|
//# sourceMappingURL=generator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/library/src/generators/init-buildable/generator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/library/src/generators/init-buildable/generator.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EAEX,UAAU,EAEV,YAAY,EACZ,0BAA0B,GAC3B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EACL,YAAY,EACZ,8BAA8B,GAC/B,MAAM,2BAA2B,CAAC;AAInC,SAAS,wBAAwB,CAAC,IAAU;IAC1C,MAAM,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IAEhC,8BAA8B,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IAE1D,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAE7B,CAAC;AAED,SAAS,oBAAoB,CAAC,OAA6B;IACzD,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,EAAE,cAAc,EAAE,CAAC,YAAY,CAAC,EAAE;QAC9D,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE;YAC7B,oBAAoB,EAAE,YAAY;SACnC,CAAC,CAAC;KACJ;AACH,CAAC;AAED,SAAS,WAAW,CAClB,IAAU,EACV,OAA4B,EAC5B,OAA6B,EAC7B,WAAmB;IAGnB,IAAI,uBAAuB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE;QAChE,OAAO,IAAI,CAAC;KACb;IAED,OAAO,KAAK,CAAC;AAEf,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,IAAU,EACV,OAAqC;IAErC,OAAO,CAAC,GAAG,CAAC,mCAAmC,EAAE,OAAO,CAAC,CAAC;IAE1D,wBAAwB,CAAC,IAAI,CAAC,CAAC;IAE/B,KAAK,MAAM,CAAE,WAAW,EAAE,OAAO,CAAE,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE;QAElE,IAAI,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE;YACpD,SAAS;SACV;QAED,OAAO,CAAC,GAAG,CAAC,iBAAkB,WAAY,EAAE,CAAC,CAAC;QAC9C,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAE9B,0BAA0B,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;KAEzD;AACH,CAAC;AAED,eAAe,sBAAsB,CAAC"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
const generator_1 = tslib_1.__importDefault(require("./generator"));
|
|
6
|
-
const schematic = (0, devkit_1.convertNxGenerator)(generator_1.default);
|
|
7
|
-
exports.default = schematic;
|
|
1
|
+
import { convertNxGenerator } from '@nx/devkit';
|
|
2
|
+
import generator from './generator';
|
|
3
|
+
const schematic = convertNxGenerator(generator);
|
|
4
|
+
export default schematic;
|
|
8
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/library/src/generators/init-buildable/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/library/src/generators/init-buildable/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC,MAAM,SAAS,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;AAChD,eAAe,SAAS,CAAC"}
|
|
@@ -1,30 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const generator_utilities_1 = require("@rxap/generator-utilities");
|
|
7
|
-
const plugin_utilities_1 = require("@rxap/plugin-utilities");
|
|
8
|
-
const workspace_utilities_1 = require("@rxap/workspace-utilities");
|
|
1
|
+
import { getProjects, readNxJson, updateNxJson, updateProjectConfiguration, } from '@nx/devkit';
|
|
2
|
+
import { SkipNonLibraryProject } from '@rxap/generator-utilities';
|
|
3
|
+
import { HasGenerators } from '@rxap/plugin-utilities';
|
|
4
|
+
import { CoerceTarget, CoerceTargetDefaultsDependency, } from '@rxap/workspace-utilities';
|
|
9
5
|
function skipProject(tree, options, project, projectName) {
|
|
10
|
-
|
|
11
|
-
if ((0, generator_utilities_1.SkipNonLibraryProject)(tree, options, project, projectName)) {
|
|
6
|
+
if (SkipNonLibraryProject(tree, options, project, projectName)) {
|
|
12
7
|
return true;
|
|
13
8
|
}
|
|
14
|
-
if (!
|
|
9
|
+
if (!project.tags?.includes('plugin')) {
|
|
15
10
|
return true;
|
|
16
11
|
}
|
|
17
12
|
return false;
|
|
18
13
|
}
|
|
19
14
|
function updateProjectTargets(tree, project) {
|
|
20
|
-
|
|
15
|
+
CoerceTarget(project, 'check-version', {
|
|
21
16
|
executor: '@rxap/plugin-library:check-version',
|
|
22
17
|
options: {
|
|
23
18
|
packageName: 'nx',
|
|
24
19
|
},
|
|
25
20
|
});
|
|
26
|
-
if (
|
|
27
|
-
|
|
21
|
+
if (HasGenerators(tree, project)) {
|
|
22
|
+
CoerceTarget(project, 'expose-as-schematic', {
|
|
28
23
|
executor: '@rxap/plugin-library:run-generator',
|
|
29
24
|
options: {
|
|
30
25
|
generator: '@rxap/plugin-library:expose-as-schematic',
|
|
@@ -33,25 +28,22 @@ function updateProjectTargets(tree, project) {
|
|
|
33
28
|
}
|
|
34
29
|
}
|
|
35
30
|
function setGeneralTargetDefaults(tree) {
|
|
36
|
-
const nxJson =
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
31
|
+
const nxJson = readNxJson(tree);
|
|
32
|
+
CoerceTargetDefaultsDependency(nxJson, 'build', 'check-version');
|
|
33
|
+
CoerceTargetDefaultsDependency(nxJson, 'build', 'expose-as-schematic');
|
|
34
|
+
updateNxJson(tree, nxJson);
|
|
40
35
|
}
|
|
41
|
-
function initPluginGenerator(tree, options) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
continue;
|
|
48
|
-
}
|
|
49
|
-
console.log(`init project: ${projectName}`);
|
|
50
|
-
updateProjectTargets(tree, project);
|
|
51
|
-
(0, devkit_1.updateProjectConfiguration)(tree, project.name, project);
|
|
36
|
+
export async function initPluginGenerator(tree, options) {
|
|
37
|
+
console.log('plugin library init generator:', options);
|
|
38
|
+
setGeneralTargetDefaults(tree);
|
|
39
|
+
for (const [projectName, project] of getProjects(tree).entries()) {
|
|
40
|
+
if (skipProject(tree, options, project, projectName)) {
|
|
41
|
+
continue;
|
|
52
42
|
}
|
|
53
|
-
|
|
43
|
+
console.log(`init project: ${projectName}`);
|
|
44
|
+
updateProjectTargets(tree, project);
|
|
45
|
+
updateProjectConfiguration(tree, project.name, project);
|
|
46
|
+
}
|
|
54
47
|
}
|
|
55
|
-
|
|
56
|
-
exports.default = initPluginGenerator;
|
|
48
|
+
export default initPluginGenerator;
|
|
57
49
|
//# sourceMappingURL=generator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/library/src/generators/init-plugin/generator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/library/src/generators/init-plugin/generator.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EAEX,UAAU,EAEV,YAAY,EACZ,0BAA0B,GAC3B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EACL,YAAY,EACZ,8BAA8B,GAC/B,MAAM,2BAA2B,CAAC;AAGnC,SAAS,WAAW,CAClB,IAAU,EACV,OAAkC,EAClC,OAA6B,EAC7B,WAAmB;IAGnB,IAAI,qBAAqB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE;QAC9D,OAAO,IAAI,CAAC;KACb;IAED,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE;QACrC,OAAO,IAAI,CAAC;KACb;IAED,OAAO,KAAK,CAAC;AAEf,CAAC;AAED,SAAS,oBAAoB,CAAC,IAAU,EAAE,OAA6B;IAErE,YAAY,CAAC,OAAO,EAAE,eAAe,EAAE;QACrC,QAAQ,EAAE,oCAAoC;QAC9C,OAAO,EAAE;YACP,WAAW,EAAE,IAAI;SAClB;KACF,CAAC,CAAC;IAEH,IAAI,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE;QAChC,YAAY,CAAC,OAAO,EAAE,qBAAqB,EAAE;YAC3C,QAAQ,EAAE,oCAAoC;YAC9C,OAAO,EAAE;gBACP,SAAS,EAAE,0CAA0C;aACtD;SACF,CAAC,CAAC;KACJ;AAEH,CAAC;AAED,SAAS,wBAAwB,CAAC,IAAU;IAC1C,MAAM,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IAEhC,8BAA8B,CAAC,MAAM,EAAE,OAAO,EAAE,eAAe,CAAC,CAAC;IACjE,8BAA8B,CAAC,MAAM,EAAE,OAAO,EAAE,qBAAqB,CAAC,CAAC;IAEvE,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC7B,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,IAAU,EACV,OAAkC;IAElC,OAAO,CAAC,GAAG,CAAC,gCAAgC,EAAE,OAAO,CAAC,CAAC;IAEvD,wBAAwB,CAAC,IAAI,CAAC,CAAC;IAE/B,KAAK,MAAM,CAAE,WAAW,EAAE,OAAO,CAAE,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE;QAElE,IAAI,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE;YACpD,SAAS;SACV;QAED,OAAO,CAAC,GAAG,CAAC,iBAAkB,WAAY,EAAE,CAAC,CAAC;QAE9C,oBAAoB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAEpC,0BAA0B,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;KAEzD;AAEH,CAAC;AAED,eAAe,mBAAmB,CAAC"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
const generator_1 = tslib_1.__importDefault(require("./generator"));
|
|
6
|
-
const schematic = (0, devkit_1.convertNxGenerator)(generator_1.default);
|
|
7
|
-
exports.default = schematic;
|
|
1
|
+
import { convertNxGenerator } from '@nx/devkit';
|
|
2
|
+
import generator from './generator';
|
|
3
|
+
const schematic = convertNxGenerator(generator);
|
|
4
|
+
export default schematic;
|
|
8
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/library/src/generators/init-plugin/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/library/src/generators/init-plugin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC,MAAM,SAAS,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;AAChD,eAAe,SAAS,CAAC"}
|
|
@@ -1,40 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const generator_utilities_1 = require("@rxap/generator-utilities");
|
|
7
|
-
const workspace_utilities_1 = require("@rxap/workspace-utilities");
|
|
8
|
-
const path_1 = require("path");
|
|
1
|
+
import { generateFiles, getProjects, readJson, readNxJson, updateNxJson, updateProjectConfiguration, writeJson, } from '@nx/devkit';
|
|
2
|
+
import { CoerceFile, CoerceIgnorePattern, GetBuildOutputForProject, SkipNonPublishableProject, } from '@rxap/generator-utilities';
|
|
3
|
+
import { CoerceTarget, CoerceTargetDefaultsDependency, CoerceTargetDefaultsInput, CoerceTargetDefaultsOutput, } from '@rxap/workspace-utilities';
|
|
4
|
+
import { join, relative, } from 'path';
|
|
9
5
|
function setGeneralTargetDefaults(tree) {
|
|
10
|
-
const nxJson =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
const nxJson = readNxJson(tree);
|
|
7
|
+
CoerceTargetDefaultsDependency(nxJson, 'build', 'readme');
|
|
8
|
+
CoerceTargetDefaultsDependency(nxJson, 'fix-dependencies', '^fix-dependencies');
|
|
9
|
+
CoerceTargetDefaultsInput(nxJson, 'readme', '{projectRoot}/README.md.handlebars', '{projectRoot}/GETSTARTED.md', '{projectRoot}/GUIDES.md', '{projectRoot}/package.json', '{projectRoot}/collection.json', '{projectRoot}/generators.json', '{projectRoot}/executors.json', '{projectRoot}/builders.json');
|
|
10
|
+
CoerceTargetDefaultsOutput(nxJson, 'readme', '{projectRoot}/README.md');
|
|
11
|
+
updateNxJson(tree, nxJson);
|
|
16
12
|
}
|
|
17
13
|
function updateProjectPackageJson(tree, project, projectName, rootPackageJson) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
(_a = packageJson.scripts) !== null && _a !== void 0 ? _a : (packageJson.scripts = {});
|
|
14
|
+
const packageJson = readJson(tree, join(project.root, 'package.json'));
|
|
15
|
+
packageJson.scripts ??= {};
|
|
21
16
|
if (Object.keys(packageJson.scripts).length === 0) {
|
|
22
17
|
delete packageJson.scripts;
|
|
23
18
|
}
|
|
24
|
-
|
|
19
|
+
packageJson.publishConfig ??= {};
|
|
25
20
|
packageJson.publishConfig.access = 'public';
|
|
26
|
-
const output =
|
|
27
|
-
packageJson.publishConfig.directory =
|
|
21
|
+
const output = GetBuildOutputForProject(project);
|
|
22
|
+
packageJson.publishConfig.directory = relative(project.root, output);
|
|
28
23
|
// add common properties
|
|
29
24
|
packageJson.keywords = [
|
|
30
25
|
...new Set([
|
|
31
|
-
...(
|
|
32
|
-
...(
|
|
33
|
-
...(
|
|
26
|
+
...(packageJson.keywords ?? []),
|
|
27
|
+
...(rootPackageJson.keywords ?? []),
|
|
28
|
+
...(project.tags ?? []),
|
|
34
29
|
]),
|
|
35
30
|
];
|
|
36
31
|
if (rootPackageJson.homepage) {
|
|
37
|
-
packageJson.homepage =
|
|
32
|
+
packageJson.homepage = join(rootPackageJson.homepage, project.root);
|
|
38
33
|
}
|
|
39
34
|
packageJson.bugs = rootPackageJson.bugs;
|
|
40
35
|
packageJson.license = rootPackageJson.license;
|
|
@@ -45,13 +40,13 @@ function updateProjectPackageJson(tree, project, projectName, rootPackageJson) {
|
|
|
45
40
|
packageJson.repository.directory = project.root;
|
|
46
41
|
}
|
|
47
42
|
packageJson.author = rootPackageJson.author;
|
|
48
|
-
|
|
43
|
+
writeJson(tree, join(project.root, 'package.json'), packageJson);
|
|
49
44
|
}
|
|
50
45
|
function updateProjectTargets(project) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
46
|
+
CoerceTarget(project, 'update-dependencies', { executor: '@rxap/plugin-library:update-dependencies' });
|
|
47
|
+
CoerceTarget(project, 'update-package-group', { executor: '@rxap/plugin-library:update-package-group' });
|
|
48
|
+
CoerceTarget(project, 'readme', { executor: '@rxap/plugin-library:readme' });
|
|
49
|
+
CoerceTarget(project, 'fix-dependencies', {
|
|
55
50
|
executor: '@rxap/plugin-library:run-generator',
|
|
56
51
|
outputs: [
|
|
57
52
|
'{workspaceRoot}/{projectRoot}/package.json',
|
|
@@ -65,34 +60,31 @@ function updateProjectTargets(project) {
|
|
|
65
60
|
});
|
|
66
61
|
}
|
|
67
62
|
function skipProject(tree, options, project, projectName) {
|
|
68
|
-
if (
|
|
63
|
+
if (SkipNonPublishableProject(tree, options, project, projectName)) {
|
|
69
64
|
return true;
|
|
70
65
|
}
|
|
71
66
|
return false;
|
|
72
67
|
}
|
|
73
|
-
function initPublishableGenerator(tree, options) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
continue;
|
|
81
|
-
}
|
|
82
|
-
console.log(`init project: ${projectName}`);
|
|
83
|
-
updateProjectTargets(project);
|
|
84
|
-
updateProjectPackageJson(tree, project, projectName, rootPackageJson);
|
|
85
|
-
(0, devkit_1.generateFiles)(tree, (0, path_1.join)(__dirname, 'files'), project.root, options);
|
|
86
|
-
(0, generator_utilities_1.CoerceFile)(tree, (0, path_1.join)(project.root, 'CHANGELOG.md'));
|
|
87
|
-
(0, generator_utilities_1.CoerceFile)(tree, (0, path_1.join)(project.root, 'GETSTARTED.md'));
|
|
88
|
-
(0, generator_utilities_1.CoerceFile)(tree, (0, path_1.join)(project.root, 'GUIDES.md'));
|
|
89
|
-
(0, generator_utilities_1.CoerceFile)(tree, (0, path_1.join)(project.root, 'LICENSE.md'), tree.read('LICENSE'));
|
|
90
|
-
(0, generator_utilities_1.CoerceFile)(tree, (0, path_1.join)(project.root, 'LICENSE'), tree.read('LICENSE'));
|
|
91
|
-
(0, generator_utilities_1.CoerceIgnorePattern)(tree, (0, path_1.join)(project.root, '.gitignore'), ['README.md']);
|
|
92
|
-
(0, devkit_1.updateProjectConfiguration)(tree, project.name, project);
|
|
68
|
+
export async function initPublishableGenerator(tree, options) {
|
|
69
|
+
console.log('publishable library init generator:', options);
|
|
70
|
+
const rootPackageJson = readJson(tree, 'package.json');
|
|
71
|
+
setGeneralTargetDefaults(tree);
|
|
72
|
+
for (const [projectName, project] of getProjects(tree).entries()) {
|
|
73
|
+
if (skipProject(tree, options, project, projectName)) {
|
|
74
|
+
continue;
|
|
93
75
|
}
|
|
94
|
-
|
|
76
|
+
console.log(`init project: ${projectName}`);
|
|
77
|
+
updateProjectTargets(project);
|
|
78
|
+
updateProjectPackageJson(tree, project, projectName, rootPackageJson);
|
|
79
|
+
generateFiles(tree, join(__dirname, 'files'), project.root, options);
|
|
80
|
+
CoerceFile(tree, join(project.root, 'CHANGELOG.md'));
|
|
81
|
+
CoerceFile(tree, join(project.root, 'GETSTARTED.md'));
|
|
82
|
+
CoerceFile(tree, join(project.root, 'GUIDES.md'));
|
|
83
|
+
CoerceFile(tree, join(project.root, 'LICENSE.md'), tree.read('LICENSE'));
|
|
84
|
+
CoerceFile(tree, join(project.root, 'LICENSE'), tree.read('LICENSE'));
|
|
85
|
+
CoerceIgnorePattern(tree, join(project.root, '.gitignore'), ['README.md']);
|
|
86
|
+
updateProjectConfiguration(tree, project.name, project);
|
|
87
|
+
}
|
|
95
88
|
}
|
|
96
|
-
|
|
97
|
-
exports.default = initPublishableGenerator;
|
|
89
|
+
export default initPublishableGenerator;
|
|
98
90
|
//# sourceMappingURL=generator.js.map
|