@rxap/plugin-library 16.0.0-dev.3 → 16.0.0-dev.30
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 +192 -143
- package/{LICENSE → LICENSE.md} +3 -12
- package/README.md +143 -106
- package/executors.json +29 -0
- package/generators.json +76 -0
- package/package.json +92 -41
- package/src/executors/check-version/executor.d.ts +5 -0
- package/src/executors/check-version/executor.js +36 -0
- package/src/executors/check-version/executor.js.map +1 -0
- package/src/executors/check-version/schema.d.ts +3 -0
- package/src/executors/check-version/schema.json +16 -0
- package/src/executors/readme/executor.d.ts +5 -0
- package/src/executors/readme/executor.js +199 -0
- package/src/executors/readme/executor.js.map +1 -0
- package/src/executors/readme/schema.d.ts +1 -0
- package/src/{builders/update-package-group → executors/readme}/schema.json +2 -3
- package/src/executors/run-generator/executor.d.ts +5 -0
- package/src/executors/run-generator/executor.js +84 -0
- package/src/executors/run-generator/executor.js.map +1 -0
- package/src/executors/run-generator/schema.d.ts +7 -0
- package/src/executors/run-generator/schema.json +31 -0
- package/src/executors/update-dependencies/executor.d.ts +5 -0
- package/src/executors/update-dependencies/executor.js +32 -0
- package/src/executors/update-dependencies/executor.js.map +1 -0
- package/src/executors/update-dependencies/schema.d.ts +1 -0
- package/src/executors/update-dependencies/schema.json +9 -0
- package/src/executors/update-package-group/executor.d.ts +5 -0
- package/src/executors/update-package-group/executor.js +45 -0
- package/src/executors/update-package-group/executor.js.map +1 -0
- package/src/executors/update-package-group/schema.d.ts +1 -0
- package/src/executors/update-package-group/schema.json +9 -0
- package/src/generators/expose-as-schematic/generator.d.ts +4 -0
- package/src/generators/expose-as-schematic/generator.js +44 -0
- package/src/generators/expose-as-schematic/generator.js.map +1 -0
- package/src/generators/expose-as-schematic/index.d.ts +2 -0
- package/src/generators/expose-as-schematic/index.js +8 -0
- package/src/generators/expose-as-schematic/index.js.map +1 -0
- package/src/generators/expose-as-schematic/schema.d.ts +3 -0
- package/src/generators/expose-as-schematic/schema.json +16 -0
- package/src/generators/fix-dependencies/generator.d.ts +27 -0
- package/src/generators/fix-dependencies/generator.js +501 -0
- package/src/generators/fix-dependencies/generator.js.map +1 -0
- package/src/generators/fix-dependencies/index.d.ts +2 -0
- package/src/generators/fix-dependencies/index.js +8 -0
- package/src/generators/fix-dependencies/index.js.map +1 -0
- package/src/generators/fix-dependencies/schema.d.ts +8 -0
- package/src/generators/fix-dependencies/schema.json +31 -0
- package/src/generators/index-export/generator.d.ts +4 -0
- package/src/generators/index-export/generator.js +78 -0
- package/src/generators/index-export/generator.js.map +1 -0
- package/src/generators/index-export/index.d.ts +2 -0
- package/src/generators/index-export/index.js +8 -0
- package/src/generators/index-export/index.js.map +1 -0
- package/src/generators/index-export/schema.d.ts +3 -0
- package/src/generators/index-export/schema.json +16 -0
- package/src/generators/init/generator.d.ts +4 -0
- package/src/generators/init/generator.js +73 -0
- package/src/generators/init/generator.js.map +1 -0
- package/src/generators/init/index.d.ts +2 -0
- package/src/generators/init/index.js +8 -0
- package/src/generators/init/index.js.map +1 -0
- package/src/generators/init/schema.d.ts +5 -0
- package/src/generators/init/schema.json +26 -0
- package/src/generators/init-buildable/generator.d.ts +4 -0
- package/src/generators/init-buildable/generator.js +45 -0
- package/src/generators/init-buildable/generator.js.map +1 -0
- package/src/generators/init-buildable/index.d.ts +2 -0
- package/src/generators/init-buildable/index.js +8 -0
- package/src/generators/init-buildable/index.js.map +1 -0
- package/src/generators/init-buildable/schema.d.ts +5 -0
- package/src/generators/init-buildable/schema.json +26 -0
- package/src/generators/init-plugin/generator.d.ts +4 -0
- package/src/generators/init-plugin/generator.js +58 -0
- package/src/generators/init-plugin/generator.js.map +1 -0
- package/src/generators/init-plugin/index.d.ts +2 -0
- package/src/generators/init-plugin/index.js +8 -0
- package/src/generators/init-plugin/index.js.map +1 -0
- package/src/generators/init-plugin/schema.d.ts +5 -0
- package/src/generators/init-plugin/schema.json +26 -0
- package/src/generators/init-publishable/files/README.md.handlebars +115 -0
- package/src/generators/init-publishable/generator.d.ts +4 -0
- package/src/generators/init-publishable/generator.js +106 -0
- package/src/generators/init-publishable/generator.js.map +1 -0
- package/src/generators/init-publishable/index.d.ts +2 -0
- package/src/generators/init-publishable/index.js +8 -0
- package/src/generators/init-publishable/index.js.map +1 -0
- package/src/generators/init-publishable/schema.d.ts +5 -0
- package/src/generators/init-publishable/schema.json +26 -0
- package/src/index.d.ts +2 -1
- package/src/index.js +5 -0
- package/src/index.js.map +1 -1
- package/builders.json +0 -20
- package/collection.json +0 -32
- package/migration.json +0 -4
- package/src/builders/build-schematics/builder.d.ts +0 -13
- package/src/builders/build-schematics/builder.js +0 -84
- package/src/builders/build-schematics/builder.js.map +0 -1
- package/src/builders/build-schematics/schema.json +0 -78
- package/src/builders/update-package-group/builder.d.ts +0 -19
- package/src/builders/update-package-group/builder.js +0 -89
- package/src/builders/update-package-group/builder.js.map +0 -1
- package/src/builders/update-package-group/read-file.d.ts +0 -7
- package/src/builders/update-package-group/read-file.js +0 -11
- package/src/builders/update-package-group/read-file.js.map +0 -1
- package/src/builders/update-package-group/write-file.d.ts +0 -5
- package/src/builders/update-package-group/write-file.js +0 -11
- package/src/builders/update-package-group/write-file.js.map +0 -1
- package/src/builders/update-peer-dependencies/builder.d.ts +0 -40
- package/src/builders/update-peer-dependencies/builder.js +0 -293
- package/src/builders/update-peer-dependencies/builder.js.map +0 -1
- package/src/builders/update-peer-dependencies/schema.json +0 -33
- package/src/builders/utils/assets.d.ts +0 -14
- package/src/builders/utils/assets.js +0 -54
- package/src/builders/utils/assets.js.map +0 -1
- package/src/builders/utils/compile-typescript-files.d.ts +0 -13
- package/src/builders/utils/compile-typescript-files.js +0 -56
- package/src/builders/utils/compile-typescript-files.js.map +0 -1
- package/src/builders/utils/equals.d.ts +0 -1
- package/src/builders/utils/equals.js +0 -200
- package/src/builders/utils/equals.js.map +0 -1
- package/src/builders/utils/unique.d.ts +0 -1
- package/src/builders/utils/unique.js +0 -8
- package/src/builders/utils/unique.js.map +0 -1
- package/src/schematics/config/index.d.ts +0 -3
- package/src/schematics/config/index.js +0 -17
- package/src/schematics/config/index.js.map +0 -1
- package/src/schematics/config/schema.json +0 -50
- package/src/schematics/config-schematics/coerce-builders-json.d.ts +0 -2
- package/src/schematics/config-schematics/coerce-builders-json.js +0 -23
- package/src/schematics/config-schematics/coerce-builders-json.js.map +0 -1
- package/src/schematics/config-schematics/coerce-builders.d.ts +0 -1
- package/src/schematics/config-schematics/coerce-builders.js +0 -11
- package/src/schematics/config-schematics/coerce-builders.js.map +0 -1
- package/src/schematics/config-schematics/coerce-collection-json.d.ts +0 -2
- package/src/schematics/config-schematics/coerce-collection-json.js +0 -23
- package/src/schematics/config-schematics/coerce-collection-json.js.map +0 -1
- package/src/schematics/config-schematics/coerce-migration-json.d.ts +0 -2
- package/src/schematics/config-schematics/coerce-migration-json.js +0 -23
- package/src/schematics/config-schematics/coerce-migration-json.js.map +0 -1
- package/src/schematics/config-schematics/coerce-ng-update.d.ts +0 -1
- package/src/schematics/config-schematics/coerce-ng-update.js +0 -21
- package/src/schematics/config-schematics/coerce-ng-update.js.map +0 -1
- package/src/schematics/config-schematics/coerce-schematics.d.ts +0 -1
- package/src/schematics/config-schematics/coerce-schematics.js +0 -11
- package/src/schematics/config-schematics/coerce-schematics.js.map +0 -1
- package/src/schematics/config-schematics/index.d.ts +0 -3
- package/src/schematics/config-schematics/index.js +0 -82
- package/src/schematics/config-schematics/index.js.map +0 -1
- package/src/schematics/config-schematics/init-src-files.d.ts +0 -2
- package/src/schematics/config-schematics/init-src-files.js +0 -16
- package/src/schematics/config-schematics/init-src-files.js.map +0 -1
- package/src/schematics/config-schematics/schema.json +0 -47
- package/src/schematics/config-update-package-group/index.d.ts +0 -3
- package/src/schematics/config-update-package-group/index.js +0 -21
- package/src/schematics/config-update-package-group/index.js.map +0 -1
- package/src/schematics/config-update-package-group/schema.json +0 -21
- package/src/schematics/config-update-peer-dependencies/index.d.ts +0 -3
- package/src/schematics/config-update-peer-dependencies/index.js +0 -26
- package/src/schematics/config-update-peer-dependencies/index.js.map +0 -1
- package/src/schematics/config-update-peer-dependencies/schema.json +0 -28
- package/src/schematics/ng-add/index.d.ts +0 -3
- package/src/schematics/ng-add/index.js +0 -21
- package/src/schematics/ng-add/index.js.map +0 -1
- package/src/schematics/ng-add/schema.json +0 -17
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.indexExportGenerator = void 0;
|
|
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");
|
|
8
|
+
const path_1 = require("path");
|
|
9
|
+
function generateIndexFile(tree, sourceRoot) {
|
|
10
|
+
const libRoot = (0, path_1.join)(sourceRoot, 'lib');
|
|
11
|
+
let filePathList = [];
|
|
12
|
+
for (const { path, isFile } of (0, generator_utilities_1.VisitTree)(tree, libRoot)) {
|
|
13
|
+
if (isFile &&
|
|
14
|
+
path.endsWith('.ts') &&
|
|
15
|
+
!path.endsWith('.spec.ts') &&
|
|
16
|
+
!path.endsWith('.cy.ts') &&
|
|
17
|
+
!path.endsWith('.stories.ts') &&
|
|
18
|
+
!path.endsWith('.d.ts')) {
|
|
19
|
+
filePathList.push(path);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
filePathList = filePathList.map(path => path.replace(new RegExp(`^${libRoot}/`), ''));
|
|
23
|
+
const map = new Map();
|
|
24
|
+
for (const filePath of filePathList) {
|
|
25
|
+
const fragments = filePath.split('/');
|
|
26
|
+
const fileName = fragments.pop();
|
|
27
|
+
const basePath = fragments.join('/');
|
|
28
|
+
if (!map.has(basePath)) {
|
|
29
|
+
map.set(basePath, []);
|
|
30
|
+
}
|
|
31
|
+
map.get(basePath).push(fileName);
|
|
32
|
+
}
|
|
33
|
+
let rootIndexFile = '';
|
|
34
|
+
for (const basePath of Array.from(map.keys()).sort().reverse()) {
|
|
35
|
+
rootIndexFile += `${rootIndexFile ? '\n' : ''}// region ${basePath.split('/').join(' ')}\n`;
|
|
36
|
+
if (map.has('index.ts')) {
|
|
37
|
+
console.log('skip folder with index.ts file', basePath);
|
|
38
|
+
rootIndexFile += `export * from './lib/${basePath}/index';\n`;
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
for (const fileName of map.get(basePath)) {
|
|
42
|
+
const fullPathToLibRoot = (0, path_1.join)('lib', basePath, fileName);
|
|
43
|
+
rootIndexFile += `export * from './${fullPathToLibRoot.replace(/\.ts$/, '')}';\n`;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
rootIndexFile += `// endregion\n`;
|
|
47
|
+
}
|
|
48
|
+
if (!rootIndexFile) {
|
|
49
|
+
rootIndexFile = 'export {};';
|
|
50
|
+
}
|
|
51
|
+
(0, generator_utilities_1.CoerceFile)(tree, (0, path_1.join)(sourceRoot, 'index.ts'), rootIndexFile, true);
|
|
52
|
+
}
|
|
53
|
+
function skipProject(tree, options, project, projectName) {
|
|
54
|
+
if ((0, generator_utilities_1.SkipNonLibraryProject)(tree, options, project, projectName)) {
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
function indexExportGenerator(tree, options) {
|
|
60
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
console.log('index export generator: ', options);
|
|
62
|
+
for (const [projectName, project] of (0, devkit_1.getProjects)(tree).entries()) {
|
|
63
|
+
if (skipProject(tree, options, project, projectName)) {
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
console.log('generate index file for project: ', projectName);
|
|
67
|
+
for (const { path } of (0, workspace_utilities_1.SearchFile)(tree, (0, generator_utilities_1.GetProjectRoot)(tree, projectName))) {
|
|
68
|
+
if (path.endsWith('ng-package.json')) {
|
|
69
|
+
generateIndexFile(tree, (0, path_1.join)((0, path_1.dirname)(path), 'src'));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
generateIndexFile(tree, (0, generator_utilities_1.GetProjectSourceRoot)(tree, projectName));
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
exports.indexExportGenerator = indexExportGenerator;
|
|
77
|
+
exports.default = indexExportGenerator;
|
|
78
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/library/src/generators/index-export/generator.ts"],"names":[],"mappings":";;;;AAAA,uCAGoB;AACpB,mEAMmC;AACnC,mEAAuD;AACvD,+BAGc;AAGd,SAAS,iBAAiB,CAAC,IAAU,EAAE,UAAkB;IAEvD,MAAM,OAAO,GAAG,IAAA,WAAI,EAAC,UAAU,EAAE,KAAK,CAAC,CAAC;IAExC,IAAI,YAAY,GAAa,EAAE,CAAC;IAEhC,KAAK,MAAM,EACT,IAAI,EACJ,MAAM,EACP,IAAI,IAAA,+BAAS,EAAC,IAAI,EAAE,OAAO,CAAC,EAAE;QAC7B,IAAI,MAAM;YACR,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;YACpB,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC;YAC1B,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;YACxB,CAAC,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC;YAC7B,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;YACzB,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SACzB;KACF;IAED,YAAY,GAAG,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,IAAK,OAAQ,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAExF,M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,WAAW,CAAC,CAAC,CAAC;SAElE;IAEH,CAAC;CAAA;AAnBD,oDAmBC;AAED,kBAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const generator_1 = tslib_1.__importDefault(require("./generator"));
|
|
6
|
+
const schematic = (0, devkit_1.convertNxGenerator)(generator_1.default);
|
|
7
|
+
exports.default = schematic;
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/library/src/generators/index-export/index.ts"],"names":[],"mappings":";;;AAAA,uCAAgD;AAChD,oEAAoC;AAEpC,MAAM,SAAS,GAAG,IAAA,2BAAkB,EAAC,mBAAS,CAAC,CAAC;AAChD,kBAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"$id": "IndexExport",
|
|
4
|
+
"title": "",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"projects": {
|
|
8
|
+
"alias": "project",
|
|
9
|
+
"type": "array",
|
|
10
|
+
"items": {
|
|
11
|
+
"type": "string"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"required": []
|
|
16
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.initGenerator = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
const generator_utilities_1 = require("@rxap/generator-utilities");
|
|
7
|
+
const plugin_angular_1 = require("@rxap/plugin-angular");
|
|
8
|
+
const plugin_nestjs_1 = require("@rxap/plugin-nestjs");
|
|
9
|
+
const workspace_utilities_1 = require("@rxap/workspace-utilities");
|
|
10
|
+
const generator_1 = tslib_1.__importDefault(require("../init-buildable/generator"));
|
|
11
|
+
const generator_2 = tslib_1.__importDefault(require("../init-plugin/generator"));
|
|
12
|
+
const generator_3 = tslib_1.__importDefault(require("../init-publishable/generator"));
|
|
13
|
+
function updateProjectTags(project) {
|
|
14
|
+
const tags = project.root.split('/').filter(Boolean);
|
|
15
|
+
const projectName = tags.pop(); // remove the last element this is the project name
|
|
16
|
+
if (tags[0] === 'angular') {
|
|
17
|
+
tags.push('ngx');
|
|
18
|
+
}
|
|
19
|
+
if (tags[0] === 'nest') {
|
|
20
|
+
tags.push('nestjs');
|
|
21
|
+
}
|
|
22
|
+
(0, generator_utilities_1.CoerceProjectTags)(project, tags);
|
|
23
|
+
// if the tag list does not include the project name
|
|
24
|
+
if (!tags.includes(projectName)) {
|
|
25
|
+
// then remove the project name from the tags if it is included
|
|
26
|
+
project.tags = project.tags.filter(tag => tag !== projectName);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function updateProjectTargets(project) {
|
|
30
|
+
if (!(0, workspace_utilities_1.IsPluginProject)(project) && !(0, workspace_utilities_1.IsGeneratorProject)(project) && !(0, workspace_utilities_1.IsSchematicProject)(project)) {
|
|
31
|
+
(0, workspace_utilities_1.CoerceTarget)(project, 'index-export', {});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function skipProject(tree, options, project, projectName) {
|
|
35
|
+
if ((0, generator_utilities_1.SkipNonLibraryProject)(tree, options, project, projectName)) {
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
function initGenerator(tree, options) {
|
|
41
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
console.log('library init generator:', options);
|
|
43
|
+
for (const [projectName, project] of (0, devkit_1.getProjects)(tree).entries()) {
|
|
44
|
+
if (skipProject(tree, options, project, projectName)) {
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
if (!options.skipProjects) {
|
|
48
|
+
console.log(`init project: ${projectName}`);
|
|
49
|
+
updateProjectTags(project);
|
|
50
|
+
updateProjectTargets(project);
|
|
51
|
+
(0, devkit_1.updateProjectConfiguration)(tree, project.name, project);
|
|
52
|
+
}
|
|
53
|
+
if ((0, generator_utilities_1.IsBuildable)(project)) {
|
|
54
|
+
yield (0, generator_1.default)(tree, options);
|
|
55
|
+
}
|
|
56
|
+
if ((0, generator_utilities_1.IsPublishable)(tree, project)) {
|
|
57
|
+
yield (0, generator_3.default)(tree, options);
|
|
58
|
+
}
|
|
59
|
+
if ((0, workspace_utilities_1.IsAngularProject)(project)) {
|
|
60
|
+
yield (0, plugin_angular_1.AngularInitGenerator)(tree, Object.assign(Object.assign({}, options), { projects: [projectName], skipProjects: options.skipProjects }));
|
|
61
|
+
}
|
|
62
|
+
if ((0, workspace_utilities_1.IsPluginProject)(project)) {
|
|
63
|
+
yield (0, generator_2.default)(tree, Object.assign(Object.assign({}, options), { projects: [projectName], skipProjects: options.skipProjects }));
|
|
64
|
+
}
|
|
65
|
+
if ((0, workspace_utilities_1.IsNestJsProject)(project)) {
|
|
66
|
+
yield (0, plugin_nestjs_1.nestJsInitGenerator)(tree, Object.assign(Object.assign({}, options), { projects: [projectName], skipProjects: options.skipProjects }));
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
exports.initGenerator = initGenerator;
|
|
72
|
+
exports.default = initGenerator;
|
|
73
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/library/src/generators/init/generator.ts"],"names":[],"mappings":";;;;AAAA,uCAKoB;AACpB,mEAKmC;AACnC,yDAA4D;AAC5D,uDAA0D;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C,YAAY,IAErC,CAAC;aACH;YAED,IAAI,IAAA,qCAAe,EAAC,OAAO,CAAC,EAAE;gBAC5B,MAAM,IAAA,mCAAmB,EACvB,IAAI,kCAEC,OAAO,KACV,QAAQ,EAAE,CAAE,WAAW,CAAE,EACzB,YAAY,EAAE,OAAO,CAAC,YAAY,IAErC,CAAC;aACH;SAEF;IAEH,CAAC;CAAA;AA7DD,sCA6DC;AAED,kBAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const generator_1 = tslib_1.__importDefault(require("./generator"));
|
|
6
|
+
const schematic = (0, devkit_1.convertNxGenerator)(generator_1.default);
|
|
7
|
+
exports.default = schematic;
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/library/src/generators/init/index.ts"],"names":[],"mappings":";;;AAAA,uCAAgD;AAChD,oEAAoC;AAEpC,MAAM,SAAS,GAAG,IAAA,2BAAkB,EAAC,mBAAS,CAAC,CAAC;AAChD,kBAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"$id": "Init",
|
|
4
|
+
"title": "",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"projects": {
|
|
8
|
+
"alias": "project",
|
|
9
|
+
"type": "array",
|
|
10
|
+
"items": {
|
|
11
|
+
"type": "string"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"overwrite": {
|
|
15
|
+
"type": "boolean",
|
|
16
|
+
"default": false,
|
|
17
|
+
"description": "Whether to overwrite existing files"
|
|
18
|
+
},
|
|
19
|
+
"skipProjects": {
|
|
20
|
+
"type": "boolean",
|
|
21
|
+
"default": false,
|
|
22
|
+
"description": "Whether to skip executing project specific initialization"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"required": []
|
|
26
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.initBuildableGenerator = void 0;
|
|
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");
|
|
8
|
+
function setGeneralTargetDefaults(tree) {
|
|
9
|
+
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
10
|
+
(0, workspace_utilities_1.CoerceTargetDefaultsDependency)(nxJson, 'build', '^build');
|
|
11
|
+
(0, devkit_1.updateNxJson)(tree, nxJson);
|
|
12
|
+
}
|
|
13
|
+
function updateProjectTargets(project) {
|
|
14
|
+
var _a, _b, _c;
|
|
15
|
+
if ((_c = (_b = (_a = project.targets) === null || _a === void 0 ? void 0 : _a['build']) === null || _b === void 0 ? void 0 : _b.configurations) === null || _c === void 0 ? void 0 : _c['production']) {
|
|
16
|
+
(0, workspace_utilities_1.CoerceTarget)(project, 'build', {
|
|
17
|
+
defaultConfiguration: 'production',
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function skipProject(tree, options, project, projectName) {
|
|
22
|
+
if ((0, generator_utilities_1.SkipNonBuildableProject)(tree, options, project, projectName)) {
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
function initBuildableGenerator(tree, options) {
|
|
28
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
console.log('buildable library init generator:', options);
|
|
30
|
+
setGeneralTargetDefaults(tree);
|
|
31
|
+
if (!options.skipProjects) {
|
|
32
|
+
for (const [projectName, project] of (0, devkit_1.getProjects)(tree).entries()) {
|
|
33
|
+
if (skipProject(tree, options, project, projectName)) {
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
console.log(`init project: ${projectName}`);
|
|
37
|
+
updateProjectTargets(project);
|
|
38
|
+
(0, devkit_1.updateProjectConfiguration)(tree, project.name, project);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
exports.initBuildableGenerator = initBuildableGenerator;
|
|
44
|
+
exports.default = initBuildableGenerator;
|
|
45
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/library/src/generators/init-buildable/generator.ts"],"names":[],"mappings":";;;;AAAA,uCAOoB;AACpB,mEAAoE;AACpE,mEAGmC;AAInC,SAAS,wBAAwB,CAAC,IAAU;IAC1C,MAAM,MAAM,GAAG,IAAA,mBAAU,EAAC,IAAI,CAAC,CAAC;IAEhC,IAAA,oDAA8B,EAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IAE1D,IAAA,qBAAY,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAE7B,CAAC;AAED,SAAS,oBAAoB,CAAC,OAA6B;;IACzD,IAAI,MAAA,MAAA,MAAA,OAAO,CAAC,OAAO,0CAAG,OAAO,CAAC,0CAAE,cAAc,0CAAG,YAAY,CAAC,EAAE;QAC9D,IAAA,kCAAY,EAAC,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,IAAA,6CAAuB,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE;QAChE,OAAO,IAAI,CAAC;KACb;IAED,OAAO,KAAK,CAAC;AAEf,CAAC;AAED,SAAsB,sBAAsB,CAC1C,IAAU,EACV,OAAqC;;QAErC,OAAO,CAAC,GAAG,CAAC,mCAAmC,EAAE,OAAO,CAAC,CAAC;QAE1D,wBAAwB,CAAC,IAAI,CAAC,CAAC;QAE/B,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE;YACzB,KAAK,MAAM,CAAE,WAAW,EAAE,OAAO,CAAE,IAAI,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE;gBAElE,IAAI,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE;oBACpD,SAAS;iBACV;gBAED,OAAO,CAAC,GAAG,CAAC,iBAAkB,WAAY,EAAE,CAAC,CAAC;gBAC9C,oBAAoB,CAAC,OAAO,CAAC,CAAC;gBAE9B,IAAA,mCAA0B,EAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;aAEzD;SACF;IACH,CAAC;CAAA;AAtBD,wDAsBC;AAED,kBAAe,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const generator_1 = tslib_1.__importDefault(require("./generator"));
|
|
6
|
+
const schematic = (0, devkit_1.convertNxGenerator)(generator_1.default);
|
|
7
|
+
exports.default = schematic;
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/library/src/generators/init-buildable/index.ts"],"names":[],"mappings":";;;AAAA,uCAAgD;AAChD,oEAAoC;AAEpC,MAAM,SAAS,GAAG,IAAA,2BAAkB,EAAC,mBAAS,CAAC,CAAC;AAChD,kBAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"$id": "InitBuildable",
|
|
4
|
+
"title": "",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"projects": {
|
|
8
|
+
"alias": "project",
|
|
9
|
+
"type": "array",
|
|
10
|
+
"items": {
|
|
11
|
+
"type": "string"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"overwrite": {
|
|
15
|
+
"type": "boolean",
|
|
16
|
+
"default": false,
|
|
17
|
+
"description": "Whether to overwrite existing files"
|
|
18
|
+
},
|
|
19
|
+
"skipProjects": {
|
|
20
|
+
"type": "boolean",
|
|
21
|
+
"default": false,
|
|
22
|
+
"description": "Whether to skip executing project specific initialization"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"required": []
|
|
26
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.initPluginGenerator = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
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");
|
|
9
|
+
function skipProject(tree, options, project, projectName) {
|
|
10
|
+
if ((0, generator_utilities_1.SkipNonLibraryProject)(tree, options, project, projectName)) {
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
if (!(0, workspace_utilities_1.IsPluginProject)(project)) {
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
function updateProjectTargets(tree, project) {
|
|
19
|
+
(0, workspace_utilities_1.CoerceTarget)(project, 'check-version', {
|
|
20
|
+
executor: '@rxap/plugin-library:check-version',
|
|
21
|
+
options: {
|
|
22
|
+
packageName: 'nx',
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
if ((0, plugin_utilities_1.HasGenerators)(tree, project)) {
|
|
26
|
+
(0, workspace_utilities_1.CoerceTarget)(project, 'expose-as-schematic', {
|
|
27
|
+
executor: '@rxap/plugin-library:run-generator',
|
|
28
|
+
options: {
|
|
29
|
+
generator: '@rxap/plugin-library:expose-as-schematic',
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function setGeneralTargetDefaults(tree) {
|
|
35
|
+
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
36
|
+
(0, workspace_utilities_1.CoerceTargetDefaultsDependency)(nxJson, 'build', 'check-version');
|
|
37
|
+
(0, workspace_utilities_1.CoerceTargetDefaultsDependency)(nxJson, 'build', 'expose-as-schematic');
|
|
38
|
+
(0, devkit_1.updateNxJson)(tree, nxJson);
|
|
39
|
+
}
|
|
40
|
+
function initPluginGenerator(tree, options) {
|
|
41
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
console.log('plugin library init generator:', options);
|
|
43
|
+
setGeneralTargetDefaults(tree);
|
|
44
|
+
if (!options.skipProjects) {
|
|
45
|
+
for (const [projectName, project] of (0, devkit_1.getProjects)(tree).entries()) {
|
|
46
|
+
if (skipProject(tree, options, project, projectName)) {
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
console.log(`init project: ${projectName}`);
|
|
50
|
+
updateProjectTargets(tree, project);
|
|
51
|
+
(0, devkit_1.updateProjectConfiguration)(tree, project.name, project);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
exports.initPluginGenerator = initPluginGenerator;
|
|
57
|
+
exports.default = initPluginGenerator;
|
|
58
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/library/src/generators/init-plugin/generator.ts"],"names":[],"mappings":";;;;AAAA,uCAOoB;AACpB,mEAAkE;AAClE,6DAAuD;AACvD,mEAImC;AAGnC,SAAS,WAAW,CAClB,IAAU,EACV,OAAkC,EAClC,OAA6B,EAC7B,WAAmB;IAGnB,IAAI,IAAA,2CAAqB,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE;QAC9D,OAAO,IAAI,CAAC;KACb;IAED,IAAI,CAAC,IAAA,qCAAe,EAAC,OAAO,CAAC,EAAE;QAC7B,OAAO,IAAI,CAAC;KACb;IAED,OAAO,KAAK,CAAC;AAEf,CAAC;AAED,SAAS,oBAAoB,CAAC,IAAU,EAAE,OAA6B;IAErE,IAAA,kCAAY,EAAC,OAAO,EAAE,eAAe,EAAE;QACrC,QAAQ,EAAE,oCAAoC;QAC9C,OAAO,EAAE;YACP,WAAW,EAAE,IAAI;SAClB;KACF,CAAC,CAAC;IAEH,IAAI,IAAA,gCAAa,EAAC,IAAI,EAAE,OAAO,CAAC,EAAE;QAChC,IAAA,kCAAY,EAAC,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,IAAA,mBAAU,EAAC,IAAI,CAAC,CAAC;IAEhC,IAAA,oDAA8B,EAAC,MAAM,EAAE,OAAO,EAAE,eAAe,CAAC,CAAC;IACjE,IAAA,oDAA8B,EAAC,MAAM,EAAE,OAAO,EAAE,qBAAqB,CAAC,CAAC;IAEvE,IAAA,qBAAY,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC7B,CAAC;AAED,SAAsB,mBAAmB,CACvC,IAAU,EACV,OAAkC;;QAElC,OAAO,CAAC,GAAG,CAAC,gCAAgC,EAAE,OAAO,CAAC,CAAC;QAEvD,wBAAwB,CAAC,IAAI,CAAC,CAAC;QAE/B,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE;YAEzB,KAAK,MAAM,CAAE,WAAW,EAAE,OAAO,CAAE,IAAI,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE;gBAElE,IAAI,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE;oBACpD,SAAS;iBACV;gBAED,OAAO,CAAC,GAAG,CAAC,iBAAkB,WAAY,EAAE,CAAC,CAAC;gBAE9C,oBAAoB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;gBAEpC,IAAA,mCAA0B,EAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;aAEzD;SAEF;IAEH,CAAC;CAAA;AA1BD,kDA0BC;AAED,kBAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const generator_1 = tslib_1.__importDefault(require("./generator"));
|
|
6
|
+
const schematic = (0, devkit_1.convertNxGenerator)(generator_1.default);
|
|
7
|
+
exports.default = schematic;
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/library/src/generators/init-plugin/index.ts"],"names":[],"mappings":";;;AAAA,uCAAgD;AAChD,oEAAoC;AAEpC,MAAM,SAAS,GAAG,IAAA,2BAAkB,EAAC,mBAAS,CAAC,CAAC;AAChD,kBAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"$id": "InitPlugin",
|
|
4
|
+
"title": "",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"projects": {
|
|
8
|
+
"alias": "project",
|
|
9
|
+
"type": "array",
|
|
10
|
+
"items": {
|
|
11
|
+
"type": "string"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"overwrite": {
|
|
15
|
+
"type": "boolean",
|
|
16
|
+
"default": false,
|
|
17
|
+
"description": "Whether to overwrite existing files"
|
|
18
|
+
},
|
|
19
|
+
"skipProjects": {
|
|
20
|
+
"type": "boolean",
|
|
21
|
+
"default": false,
|
|
22
|
+
"description": "Whether to skip executing project specific initialization"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"required": []
|
|
26
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# {{packageJson.name}}
|
|
2
|
+
{{#if packageJson.description ~}}
|
|
3
|
+
> {{packageJson.description}}
|
|
4
|
+
{{/if}}
|
|
5
|
+
|
|
6
|
+
[](https://www.npmjs.com/package/{{packageJson.name}})
|
|
7
|
+
[](https://commitizen.github.io/cz-cli/)
|
|
8
|
+
[](https://github.com/prettier/prettier)
|
|
9
|
+

|
|
10
|
+

|
|
11
|
+

|
|
12
|
+
|
|
13
|
+
- [Installation](#installation)
|
|
14
|
+
{{#if getStartedContent ~}}
|
|
15
|
+
- [Get started](#get-started)
|
|
16
|
+
{{/if}}
|
|
17
|
+
{{#if guidesContent ~}}
|
|
18
|
+
- [Guides](#guides)
|
|
19
|
+
{{/if}}
|
|
20
|
+
{{#if hasGenerators ~}}
|
|
21
|
+
- [Generators](#generators)
|
|
22
|
+
{{/if}}
|
|
23
|
+
{{#if hasExecutors ~}}
|
|
24
|
+
- [Executors](#executors)
|
|
25
|
+
{{/if}}
|
|
26
|
+
|
|
27
|
+
# Installation
|
|
28
|
+
|
|
29
|
+
**Add the package to your workspace:**
|
|
30
|
+
```bash
|
|
31
|
+
yarn add {{packageJson.name}}
|
|
32
|
+
```
|
|
33
|
+
{{#if hasPeerDependencies ~}}
|
|
34
|
+
|
|
35
|
+
**Install peer dependencies:**
|
|
36
|
+
```bash
|
|
37
|
+
yarn add {{#each peerDependencyList}}{{this.name}}@{{this.version}} {{/each}}
|
|
38
|
+
```
|
|
39
|
+
{{/if}}
|
|
40
|
+
{{#if hasInitGenerator ~}}
|
|
41
|
+
|
|
42
|
+
**Execute the init generator:**
|
|
43
|
+
```bash
|
|
44
|
+
yarn nx g {{packageJson.name}}:init
|
|
45
|
+
```
|
|
46
|
+
{{/if}}
|
|
47
|
+
{{#if hasConfigGenerator ~}}
|
|
48
|
+
|
|
49
|
+
**Execute the config generator to use the package with a project:**
|
|
50
|
+
```bash
|
|
51
|
+
yarn nx g {{packageJson.name}}:config [project]
|
|
52
|
+
```
|
|
53
|
+
{{/if}}
|
|
54
|
+
{{#if getStartedContent ~}}
|
|
55
|
+
|
|
56
|
+
# Get started
|
|
57
|
+
|
|
58
|
+
{{{getStartedContent}}}
|
|
59
|
+
{{/if}}
|
|
60
|
+
{{#if guidesContent ~}}
|
|
61
|
+
|
|
62
|
+
# Guides
|
|
63
|
+
|
|
64
|
+
{{{guidesContent}}}
|
|
65
|
+
{{/if}}
|
|
66
|
+
{{#if hasGenerators ~}}
|
|
67
|
+
|
|
68
|
+
# Generators
|
|
69
|
+
{{#each generatorList}}
|
|
70
|
+
|
|
71
|
+
## {{this.name}}
|
|
72
|
+
> {{this.description}}
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
yarn nx g {{@root.packageJson.name}}:{{this.name}}
|
|
76
|
+
```
|
|
77
|
+
{{#hasProperties this.schema.properties}}
|
|
78
|
+
|
|
79
|
+
Option | Type | Default | Description
|
|
80
|
+
--- | --- | --- | ---
|
|
81
|
+
{{#each this.schema.properties}}
|
|
82
|
+
{{@key}} | {{this.type}} | {{this.default}} | {{this.description}}
|
|
83
|
+
{{/each}}
|
|
84
|
+
{{/hasProperties}}
|
|
85
|
+
{{/each}}
|
|
86
|
+
{{/if}}
|
|
87
|
+
{{#if hasExecutors ~}}
|
|
88
|
+
|
|
89
|
+
# Executors
|
|
90
|
+
{{#each executorsList}}
|
|
91
|
+
|
|
92
|
+
## {{this.name}}
|
|
93
|
+
> {{this.description}}
|
|
94
|
+
|
|
95
|
+
**project.json**
|
|
96
|
+
```json
|
|
97
|
+
{
|
|
98
|
+
"targets": {
|
|
99
|
+
"{{this.name}}": {
|
|
100
|
+
"executor": "{{@root.packageJson.name}}:{{this.name}}"
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
{{#hasProperties this.schema.properties}}
|
|
106
|
+
|
|
107
|
+
Option | Type | Default | Description
|
|
108
|
+
--- | --- | --- | ---
|
|
109
|
+
{{#each this.schema.properties}}
|
|
110
|
+
{{@key}} | {{this.type}} | {{this.default}} | {{this.description}}
|
|
111
|
+
{{/each}}
|
|
112
|
+
{{/hasProperties}}
|
|
113
|
+
{{/each}}
|
|
114
|
+
|
|
115
|
+
{{/if}}
|