@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,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.initPublishableGenerator = 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 setGeneralTargetDefaults(tree) {
|
|
10
|
+
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
11
|
+
(0, workspace_utilities_1.CoerceTargetDefaultsDependency)(nxJson, 'build', 'readme');
|
|
12
|
+
(0, workspace_utilities_1.CoerceTargetDefaultsDependency)(nxJson, 'fix-dependencies', '^fix-dependencies');
|
|
13
|
+
(0, workspace_utilities_1.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');
|
|
14
|
+
(0, workspace_utilities_1.CoerceTargetDefaultsOutput)(nxJson, 'readme', '{projectRoot}/README.md');
|
|
15
|
+
(0, devkit_1.updateNxJson)(tree, nxJson);
|
|
16
|
+
}
|
|
17
|
+
function updateProjectPackageJson(tree, project, projectName, rootPackageJson) {
|
|
18
|
+
var _a, _b, _c, _d, _e;
|
|
19
|
+
const packageJson = (0, devkit_1.readJson)(tree, (0, path_1.join)(project.root, 'package.json'));
|
|
20
|
+
(_a = packageJson.scripts) !== null && _a !== void 0 ? _a : (packageJson.scripts = {});
|
|
21
|
+
if (Object.keys(packageJson.scripts).length === 0) {
|
|
22
|
+
delete packageJson.scripts;
|
|
23
|
+
}
|
|
24
|
+
(_b = packageJson.publishConfig) !== null && _b !== void 0 ? _b : (packageJson.publishConfig = {});
|
|
25
|
+
packageJson.publishConfig.access = 'public';
|
|
26
|
+
const output = (0, generator_utilities_1.GetBuildOutputForProject)(project);
|
|
27
|
+
packageJson.publishConfig.directory = (0, path_1.relative)(project.root, output);
|
|
28
|
+
// add common properties
|
|
29
|
+
packageJson.keywords = [
|
|
30
|
+
...new Set([
|
|
31
|
+
...((_c = packageJson.keywords) !== null && _c !== void 0 ? _c : []),
|
|
32
|
+
...((_d = rootPackageJson.keywords) !== null && _d !== void 0 ? _d : []),
|
|
33
|
+
...((_e = project.tags) !== null && _e !== void 0 ? _e : []),
|
|
34
|
+
projectName,
|
|
35
|
+
]),
|
|
36
|
+
];
|
|
37
|
+
if (rootPackageJson.homepage) {
|
|
38
|
+
packageJson.homepage = (0, path_1.join)(rootPackageJson.homepage, project.root);
|
|
39
|
+
}
|
|
40
|
+
packageJson.bugs = rootPackageJson.bugs;
|
|
41
|
+
packageJson.license = rootPackageJson.license;
|
|
42
|
+
packageJson.contributors = rootPackageJson.contributors;
|
|
43
|
+
packageJson.funding = rootPackageJson.funding;
|
|
44
|
+
packageJson.repository = rootPackageJson.repository;
|
|
45
|
+
if (packageJson.repository && typeof packageJson.repository === 'object') {
|
|
46
|
+
packageJson.repository.directory = project.root;
|
|
47
|
+
}
|
|
48
|
+
packageJson.author = rootPackageJson.author;
|
|
49
|
+
(0, devkit_1.writeJson)(tree, (0, path_1.join)(project.root, 'package.json'), packageJson);
|
|
50
|
+
}
|
|
51
|
+
function updateProjectTargets(project) {
|
|
52
|
+
(0, workspace_utilities_1.CoerceTarget)(project, 'update-dependencies', { executor: '@rxap/plugin-library:update-dependencies' });
|
|
53
|
+
(0, workspace_utilities_1.CoerceTarget)(project, 'update-package-group', { executor: '@rxap/plugin-library:update-package-group' });
|
|
54
|
+
(0, workspace_utilities_1.CoerceTarget)(project, 'readme', { executor: '@rxap/plugin-library:readme' });
|
|
55
|
+
(0, workspace_utilities_1.CoerceTarget)(project, 'fix-dependencies', {
|
|
56
|
+
executor: '@rxap/plugin-library:run-generator',
|
|
57
|
+
outputs: [
|
|
58
|
+
'{workspaceRoot}/{projectRoot}/package.json',
|
|
59
|
+
],
|
|
60
|
+
options: {
|
|
61
|
+
generator: '@rxap/plugin-library:fix-dependencies',
|
|
62
|
+
options: {
|
|
63
|
+
strict: true,
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
function skipProject(tree, options, project, projectName) {
|
|
69
|
+
if ((0, generator_utilities_1.SkipNonPublishableProject)(tree, options, project, projectName)) {
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
function initPublishableGenerator(tree, options) {
|
|
75
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
console.log('publishable library init generator:', options);
|
|
77
|
+
const rootPackageJson = (0, devkit_1.readJson)(tree, 'package.json');
|
|
78
|
+
setGeneralTargetDefaults(tree);
|
|
79
|
+
if (!options.skipProjects) {
|
|
80
|
+
for (const [projectName, project] of (0, devkit_1.getProjects)(tree).entries()) {
|
|
81
|
+
if (skipProject(tree, options, project, projectName)) {
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
console.log(`init project: ${projectName}`);
|
|
85
|
+
updateProjectTargets(project);
|
|
86
|
+
updateProjectPackageJson(tree, project, projectName, rootPackageJson);
|
|
87
|
+
(0, devkit_1.generateFiles)(tree, (0, path_1.join)(__dirname, 'files'), project.root, options);
|
|
88
|
+
(0, generator_utilities_1.CoerceFile)(tree, (0, path_1.join)(project.root, 'CHANGELOG.md'));
|
|
89
|
+
(0, generator_utilities_1.CoerceFile)(tree, (0, path_1.join)(project.root, 'GETSTARTED.md'));
|
|
90
|
+
(0, generator_utilities_1.CoerceFile)(tree, (0, path_1.join)(project.root, 'GUIDES.md'));
|
|
91
|
+
if (tree.exists('LICENSE')) {
|
|
92
|
+
(0, generator_utilities_1.CoerceFile)(tree, (0, path_1.join)(project.root, 'LICENSE.md'), tree.read('LICENSE'));
|
|
93
|
+
(0, generator_utilities_1.CoerceFile)(tree, (0, path_1.join)(project.root, 'LICENSE'), tree.read('LICENSE'));
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
console.warn('no LICENSE file found in the workspace root');
|
|
97
|
+
}
|
|
98
|
+
(0, generator_utilities_1.CoerceIgnorePattern)(tree, (0, path_1.join)(project.root, '.gitignore'), ['README.md']);
|
|
99
|
+
(0, devkit_1.updateProjectConfiguration)(tree, project.name, project);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
exports.initPublishableGenerator = initPublishableGenerator;
|
|
105
|
+
exports.default = initPublishableGenerator;
|
|
106
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/library/src/generators/init-publishable/generator.ts"],"names":[],"mappings":";;;;AAAA,uCAUoB;AACpB,mEAKmC;AAEnC,mEAKmC;AACnC,+BAGc;AAId,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;IAC1D,IAAA,oDAA8B,EAAC,MAAM,EAAE,kBAAkB,EAAE,mBAAmB,CAAC,CAAC;IAEhF,IAAA,+CAAyB,EACvB,MAAM,EACN,QAAQ,EACR,oCAAoC,EACpC,6BAA6B,EAC7B,yBAAyB,EACzB,4BAA4B,EAC5B,+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AC,OAAO,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC;gBACtD,IAAA,gCAAU,EAAC,IAAI,EAAE,IAAA,WAAI,EAAC,OAAO,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC;gBAClD,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE;oBAC1B,IAAA,gCAAU,EAAC,IAAI,EAAE,IAAA,WAAI,EAAC,OAAO,CAAC,IAAI,EAAE,YAAY,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;oBACzE,IAAA,gCAAU,EAAC,IAAI,EAAE,IAAA,WAAI,EAAC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;iBACvE;qBAAM;oBACL,OAAO,CAAC,IAAI,CAAC,6CAA6C,CAAC,CAAC;iBAC7D;gBACD,IAAA,yCAAmB,EAAC,IAAI,EAAE,IAAA,WAAI,EAAC,OAAO,CAAC,IAAI,EAAE,YAAY,CAAC,EAAE,CAAE,WAAW,CAAE,CAAC,CAAC;gBAE7E,IAAA,mCAA0B,EAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;aAEzD;SAEF;IAEH,CAAC;CAAA;AAxCD,4DAwCC;AAED,kBAAe,wBAAwB,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-publishable/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": "InitPublishable",
|
|
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
|
+
}
|
package/src/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export { indexExportGenerator as LibraryIndexExportGenerator } from './generators/index-export/generator';
|
|
2
|
+
export { initGenerator as LibraryInitGenerator } from './generators/init/generator';
|
package/src/index.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LibraryInitGenerator = exports.LibraryIndexExportGenerator = void 0;
|
|
4
|
+
var generator_1 = require("./generators/index-export/generator");
|
|
5
|
+
Object.defineProperty(exports, "LibraryIndexExportGenerator", { enumerable: true, get: function () { return generator_1.indexExportGenerator; } });
|
|
6
|
+
var generator_2 = require("./generators/init/generator");
|
|
7
|
+
Object.defineProperty(exports, "LibraryInitGenerator", { enumerable: true, get: function () { return generator_2.initGenerator; } });
|
|
3
8
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/plugin/library/src/index.ts"],"names":[],"mappings":";;;AAAA,iEAA0G;AAAjG,wHAAA,oBAAoB,OAA+B;AAC5D,yDAAoF;AAA3E,iHAAA,aAAa,OAAwB"}
|
package/builders.json
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "../../node_modules/@angular-devkit/architect/src/builders-schema.json",
|
|
3
|
-
"builders": {
|
|
4
|
-
"build-schematics": {
|
|
5
|
-
"implementation": "./src/builders/build-schematics/builder",
|
|
6
|
-
"schema": "./src/builders/build-schematics/schema.json",
|
|
7
|
-
"description": "Builds the library schematics and copy all files into the out path"
|
|
8
|
-
},
|
|
9
|
-
"update-package-group": {
|
|
10
|
-
"implementation": "./src/builders/update-package-group/builder",
|
|
11
|
-
"schema": "./src/builders/update-package-group/schema.json",
|
|
12
|
-
"description": "Updates the package-group in the project package.json"
|
|
13
|
-
},
|
|
14
|
-
"update-peer-dependencies": {
|
|
15
|
-
"implementation": "./src/builders/update-peer-dependencies/builder",
|
|
16
|
-
"schema": "./src/builders/update-peer-dependencies/schema.json",
|
|
17
|
-
"description": "Updates the package.json peerDependencies and will predict the next version of local dependencies."
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
package/collection.json
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "../../node_modules/@angular-devkit/schematics/collection-schema.json",
|
|
3
|
-
"name": "rxap-plugin-library",
|
|
4
|
-
"version": "0.0.1",
|
|
5
|
-
"schematics": {
|
|
6
|
-
"config-schematics": {
|
|
7
|
-
"description": "Adds the builder @rxap/pack-library:build-schematics to the specified project",
|
|
8
|
-
"factory": "./src/schematics/config-schematics/index",
|
|
9
|
-
"schema": "./src/schematics/config-schematics/schema.json"
|
|
10
|
-
},
|
|
11
|
-
"config": {
|
|
12
|
-
"description": "Adds @rxap/plugin-library builder to the specified project",
|
|
13
|
-
"factory": "./src/schematics/config/index",
|
|
14
|
-
"schema": "./src/schematics/config/schema.json"
|
|
15
|
-
},
|
|
16
|
-
"config-update-package-group": {
|
|
17
|
-
"description": "Adds @rxap/plugin-library:update-package-group builder to the specified project",
|
|
18
|
-
"factory": "./src/schematics/config-update-package-group/index",
|
|
19
|
-
"schema": "./src/schematics/config-update-package-group/schema.json"
|
|
20
|
-
},
|
|
21
|
-
"config-update-peer-dependencies": {
|
|
22
|
-
"description": "Adds the builder @rxap/plugin-library:update-peer-dependencies to the specified project.",
|
|
23
|
-
"factory": "./src/schematics/config-update-peer-dependencies/index",
|
|
24
|
-
"schema": "./src/schematics/config-update-peer-dependencies/schema.json"
|
|
25
|
-
},
|
|
26
|
-
"ng-add": {
|
|
27
|
-
"description": "Setup the package @rxap/plugin-library for the workspace.",
|
|
28
|
-
"factory": "./src/schematics/ng-add/index",
|
|
29
|
-
"schema": "./src/schematics/ng-add/schema.json"
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
package/migration.json
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { BuilderContext, BuilderOutput } from '@angular-devkit/architect';
|
|
2
|
-
import { BuildMigrationsBuilderSchema } from './schema';
|
|
3
|
-
export declare class Builder {
|
|
4
|
-
readonly options: BuildMigrationsBuilderSchema;
|
|
5
|
-
readonly context: BuilderContext;
|
|
6
|
-
constructor(options: BuildMigrationsBuilderSchema, context: BuilderContext);
|
|
7
|
-
static Run(options: BuildMigrationsBuilderSchema, context: BuilderContext): Promise<BuilderOutput>;
|
|
8
|
-
static Create(): any;
|
|
9
|
-
run(): Promise<BuilderOutput>;
|
|
10
|
-
private getSchemaFileName;
|
|
11
|
-
}
|
|
12
|
-
declare const _default: any;
|
|
13
|
-
export default _default;
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Builder = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const architect_1 = require("@angular-devkit/architect");
|
|
6
|
-
const compile_typescript_files_1 = require("../utils/compile-typescript-files");
|
|
7
|
-
const path_1 = require("path");
|
|
8
|
-
const assets_1 = require("../utils/assets");
|
|
9
|
-
const fs_extra_1 = require("fs-extra");
|
|
10
|
-
class Builder {
|
|
11
|
-
constructor(options, context) {
|
|
12
|
-
this.options = options;
|
|
13
|
-
this.context = context;
|
|
14
|
-
}
|
|
15
|
-
static Run(options, context) {
|
|
16
|
-
return new Builder(options, context).run();
|
|
17
|
-
}
|
|
18
|
-
static Create() {
|
|
19
|
-
return (0, architect_1.createBuilder)(Builder.Run);
|
|
20
|
-
}
|
|
21
|
-
run() {
|
|
22
|
-
var _a, _b;
|
|
23
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
24
|
-
const projectName = (_a = this.context.target) === null || _a === void 0 ? void 0 : _a.project;
|
|
25
|
-
if (!projectName) {
|
|
26
|
-
console.error('Could not access the project name');
|
|
27
|
-
return { success: false, error: 'Could not access the project name' };
|
|
28
|
-
}
|
|
29
|
-
const metadata = yield this.context.getProjectMetadata(projectName);
|
|
30
|
-
const projectRoot = metadata.root;
|
|
31
|
-
if (!projectRoot) {
|
|
32
|
-
console.error('Could not access the project root');
|
|
33
|
-
return { success: false, error: 'Could not access the project root' };
|
|
34
|
-
}
|
|
35
|
-
const outputPath = (0, path_1.join)(this.context.workspaceRoot, this.options.outputPath);
|
|
36
|
-
const assets = (_b = this.options.assets) !== null && _b !== void 0 ? _b : [];
|
|
37
|
-
assets.push({
|
|
38
|
-
input: `./${projectRoot}`,
|
|
39
|
-
glob: this.getSchemaFileName(this.options.type),
|
|
40
|
-
output: '.',
|
|
41
|
-
ignore: []
|
|
42
|
-
});
|
|
43
|
-
assets.push({
|
|
44
|
-
input: `./${projectRoot}/src/${this.options.type}`,
|
|
45
|
-
glob: '**/schema.json',
|
|
46
|
-
output: `./src/${this.options.type}`,
|
|
47
|
-
ignore: []
|
|
48
|
-
});
|
|
49
|
-
assets.push({
|
|
50
|
-
input: `./${projectRoot}/src/${this.options.type}`,
|
|
51
|
-
glob: '**/files/**',
|
|
52
|
-
output: `./src/${this.options.type}`,
|
|
53
|
-
dot: true,
|
|
54
|
-
ignore: []
|
|
55
|
-
});
|
|
56
|
-
const files = (0, assets_1.AssetGlobsToFiles)(assets, this.context.workspaceRoot, outputPath);
|
|
57
|
-
(0, fs_extra_1.removeSync)((0, path_1.join)(outputPath, 'src', this.options.type));
|
|
58
|
-
const result = yield (0, compile_typescript_files_1.CompileTypeScript)({
|
|
59
|
-
outputPath,
|
|
60
|
-
tsConfig: this.options.tsConfig,
|
|
61
|
-
projectName,
|
|
62
|
-
projectRoot,
|
|
63
|
-
deleteOutputPath: false
|
|
64
|
-
});
|
|
65
|
-
yield (0, assets_1.CopyAssetFiles)(files);
|
|
66
|
-
return Object.assign(Object.assign({}, result), { outputPath: this.options.outputPath });
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
getSchemaFileName(type) {
|
|
70
|
-
switch (type) {
|
|
71
|
-
case 'builders':
|
|
72
|
-
return 'builders.json';
|
|
73
|
-
case 'schematics':
|
|
74
|
-
return 'collection.json';
|
|
75
|
-
case 'migrations':
|
|
76
|
-
return 'migration.json';
|
|
77
|
-
default:
|
|
78
|
-
throw new Error(`The schematic build type '${type}' is not allowed`);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
exports.Builder = Builder;
|
|
83
|
-
exports.default = Builder.Create();
|
|
84
|
-
//# sourceMappingURL=builder.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buil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ACT,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU,IACnC;;KAEH;IAEO,iBAAiB,CAAC,IAA8C;QACtE,QAAQ,IAAI,EAAE;YACZ,KAAK,UAAU;gBACb,OAAO,eAAe,CAAC;YACzB,KAAK,YAAY;gBACf,OAAO,iBAAiB,CAAC;YAC3B,KAAK,YAAY;gBACf,OAAO,gBAAgB,CAAC;YAE1B;gBACE,MAAM,IAAI,KAAK,CAAC,6BAA6B,IAAI,kBAAkB,CAAC,CAAC;SAExE;IACH,CAAC;CAEF;AAlGD,0BAkGC;AAED,kBAAe,OAAO,CAAC,MAAM,EAAE,CAAC"}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 2,
|
|
3
|
-
"outputCapture": "direct-nodejs",
|
|
4
|
-
"$schema": "http://json-schema.org/schema",
|
|
5
|
-
"title": "Build builder",
|
|
6
|
-
"description": "",
|
|
7
|
-
"type": "object",
|
|
8
|
-
"properties": {
|
|
9
|
-
"tsConfig": {
|
|
10
|
-
"type": "string",
|
|
11
|
-
"description": "The name of the Typescript configuration file."
|
|
12
|
-
},
|
|
13
|
-
"outputPath": {
|
|
14
|
-
"type": "string",
|
|
15
|
-
"description": "The output path of the generated files."
|
|
16
|
-
},
|
|
17
|
-
"assets": {
|
|
18
|
-
"type": "array",
|
|
19
|
-
"description": "List of static library assets.",
|
|
20
|
-
"default": [],
|
|
21
|
-
"items": {
|
|
22
|
-
"$ref": "#/definitions/assetPattern"
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
"type": {
|
|
26
|
-
"type": "string",
|
|
27
|
-
"enum": [
|
|
28
|
-
"migrations",
|
|
29
|
-
"schematics",
|
|
30
|
-
"builders"
|
|
31
|
-
]
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
"required": [
|
|
35
|
-
"tsConfig",
|
|
36
|
-
"outputPath",
|
|
37
|
-
"type"
|
|
38
|
-
],
|
|
39
|
-
"definitions": {
|
|
40
|
-
"assetPattern": {
|
|
41
|
-
"oneOf": [
|
|
42
|
-
{
|
|
43
|
-
"type": "object",
|
|
44
|
-
"properties": {
|
|
45
|
-
"glob": {
|
|
46
|
-
"type": "string",
|
|
47
|
-
"description": "The pattern to match."
|
|
48
|
-
},
|
|
49
|
-
"input": {
|
|
50
|
-
"type": "string",
|
|
51
|
-
"description": "The input directory path in which to apply 'glob'. Defaults to the project root."
|
|
52
|
-
},
|
|
53
|
-
"ignore": {
|
|
54
|
-
"description": "An array of globs to ignore.",
|
|
55
|
-
"type": "array",
|
|
56
|
-
"items": {
|
|
57
|
-
"type": "string"
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
"output": {
|
|
61
|
-
"type": "string",
|
|
62
|
-
"description": "Absolute path within the output."
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
"additionalProperties": false,
|
|
66
|
-
"required": [
|
|
67
|
-
"glob",
|
|
68
|
-
"input",
|
|
69
|
-
"output"
|
|
70
|
-
]
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
"type": "string"
|
|
74
|
-
}
|
|
75
|
-
]
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { BuilderContext, BuilderOutput } from '@angular-devkit/architect';
|
|
2
|
-
import { json } from '@angular-devkit/core';
|
|
3
|
-
import { UpdatePackageGroupBuilderSchema } from './schema';
|
|
4
|
-
export interface Target extends json.JsonObject {
|
|
5
|
-
project: string;
|
|
6
|
-
target: string;
|
|
7
|
-
configuration: string;
|
|
8
|
-
}
|
|
9
|
-
export declare class Builder {
|
|
10
|
-
readonly options: UpdatePackageGroupBuilderSchema;
|
|
11
|
-
readonly context: BuilderContext;
|
|
12
|
-
constructor(options: UpdatePackageGroupBuilderSchema, context: BuilderContext);
|
|
13
|
-
static Run(options: UpdatePackageGroupBuilderSchema, context: BuilderContext): Promise<BuilderOutput>;
|
|
14
|
-
static Create(): any;
|
|
15
|
-
extractRootPath(project: string): Promise<string>;
|
|
16
|
-
run(): Promise<BuilderOutput>;
|
|
17
|
-
}
|
|
18
|
-
declare const _default: any;
|
|
19
|
-
export default _default;
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Builder = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const architect_1 = require("@angular-devkit/architect");
|
|
6
|
-
const read_file_1 = require("./read-file");
|
|
7
|
-
const path_1 = require("path");
|
|
8
|
-
const write_file_1 = require("./write-file");
|
|
9
|
-
const fs_1 = require("fs");
|
|
10
|
-
const equals_1 = require("../utils/equals");
|
|
11
|
-
class Builder {
|
|
12
|
-
constructor(options, context) {
|
|
13
|
-
this.options = options;
|
|
14
|
-
this.context = context;
|
|
15
|
-
}
|
|
16
|
-
static Run(options, context) {
|
|
17
|
-
return new Builder(options, context).run();
|
|
18
|
-
}
|
|
19
|
-
static Create() {
|
|
20
|
-
return (0, architect_1.createBuilder)(Builder.Run);
|
|
21
|
-
}
|
|
22
|
-
extractRootPath(project) {
|
|
23
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
24
|
-
const projectMetadata = yield this.context.getProjectMetadata(project);
|
|
25
|
-
const root = projectMetadata.root;
|
|
26
|
-
if (!root || typeof root !== 'string') {
|
|
27
|
-
throw new Error(`Could not extract root path for project '${project}'`);
|
|
28
|
-
}
|
|
29
|
-
return root;
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
run() {
|
|
33
|
-
var _a, _b;
|
|
34
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
35
|
-
if (!((_a = this.context.target) === null || _a === void 0 ? void 0 : _a.project)) {
|
|
36
|
-
throw new Error('The target project is not defined!');
|
|
37
|
-
}
|
|
38
|
-
const readFile = new read_file_1.ReadFile();
|
|
39
|
-
const root = yield this.extractRootPath((_b = this.context.target) === null || _b === void 0 ? void 0 : _b.project);
|
|
40
|
-
const packageJsonFilePath = (0, path_1.join)(process.cwd(), root, 'package.json');
|
|
41
|
-
if (!(0, fs_1.existsSync)(packageJsonFilePath)) {
|
|
42
|
-
throw new Error(`Could not find package.json in location '${packageJsonFilePath}'`);
|
|
43
|
-
}
|
|
44
|
-
const packageJson = JSON.parse(readFile.sync(packageJsonFilePath));
|
|
45
|
-
if (!packageJson.peerDependencies) {
|
|
46
|
-
return { success: true };
|
|
47
|
-
}
|
|
48
|
-
const name = packageJson.name;
|
|
49
|
-
const scopeMatch = name.match(/^@([^/]+)/);
|
|
50
|
-
if (scopeMatch) {
|
|
51
|
-
const scope = scopeMatch[1];
|
|
52
|
-
// extract all packages with the same scope from the
|
|
53
|
-
// peer dependencies
|
|
54
|
-
const sameScopePackageGroup = Object
|
|
55
|
-
.keys(packageJson.peerDependencies)
|
|
56
|
-
.filter(peerName => peerName.match(new RegExp(`^@${scope}`)));
|
|
57
|
-
// CoerceProperty(packageJson, 'ng-update.packageGroup', []);
|
|
58
|
-
if (!packageJson['ng-update']) {
|
|
59
|
-
packageJson['ng-update'] = { packageGroup: [] };
|
|
60
|
-
}
|
|
61
|
-
// extract all defined package group and exclude
|
|
62
|
-
// packages with the same scope
|
|
63
|
-
const existingPackageGroup = packageJson['ng-update']
|
|
64
|
-
.packageGroup
|
|
65
|
-
.filter((peerName) => !peerName.match(new RegExp(`^@${scope}`)));
|
|
66
|
-
const newPackageGroup = [
|
|
67
|
-
name,
|
|
68
|
-
...existingPackageGroup,
|
|
69
|
-
...sameScopePackageGroup
|
|
70
|
-
].filter((item, index, self) => self.indexOf(item) === index)
|
|
71
|
-
.sort((a, b) => a.localeCompare(b));
|
|
72
|
-
packageJson['ng-update'].packageGroup = newPackageGroup;
|
|
73
|
-
const oldPackageJson = JSON.parse(readFile.sync(packageJsonFilePath));
|
|
74
|
-
if (!(0, equals_1.equals)(oldPackageJson, packageJson)) {
|
|
75
|
-
const writeFile = new write_file_1.WriteFile();
|
|
76
|
-
writeFile.sync(packageJsonFilePath, JSON.stringify(packageJson, undefined, 2));
|
|
77
|
-
console.log('Set ng-update.packageGroup = ', newPackageGroup);
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
console.info(`The package.json ng-update.packageGroup is not updated. No changes detected!`);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
return { success: true };
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
exports.Builder = Builder;
|
|
88
|
-
exports.default = Builder.Create();
|
|
89
|
-
//# sourceMappingURL=builder.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"builder.js","sourceRoot":"","sources":["../../../../../../libs/library/src/builders/update-package-group/builder.ts"],"names":[],"mappings":";;;;AAAA,yDAAyF;AAGzF,2CAAuC;AACvC,+BAA4B;AAC5B,6CAAyC;AACzC,2BAAgC;AAChC,4CAAyC;AAQzC,MAAa,OAAO;IAElB,YACkB,OAAwC,EACxC,OAAuB;QADvB,YAAO,GAAP,OAAO,CAAiC;QACxC,YAAO,GAAP,OAAO,CAAgB;IAEzC,CAAC;IAEM,MAAM,CAAC,GAAG,CACf,OAAwC,EACxC,OAAuB;QAEvB,OAAO,IAAI,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC;IAC7C,CAAC;IAEM,MAAM,CAAC,MAAM;QAClB,OAAO,IAAA,yBAAa,EAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACpC,CAAC;IAEY,eAAe,CAAC,OAAe;;YAE1C,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;YACvE,MAAM,IAAI,GAAG,eAAe,CAAC,IAAI,CAAC;YAElC,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;gBACrC,MAAM,IAAI,KAAK,CAAC,4CAA4C,OAAO,GAAG,CAAC,CA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AC,8EAA8E,CAAC,CAAC;iBAC9F;aAEF;YAED,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;KAE1B;CAEF;AA9GD,0BA8GC;AAED,kBAAe,OAAO,CAAC,MAAM,EAAE,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ReadFile = void 0;
|
|
4
|
-
const fs_1 = require("fs");
|
|
5
|
-
class ReadFile {
|
|
6
|
-
sync(path, options = 'utf-8') {
|
|
7
|
-
return (0, fs_1.readFileSync)(path, options);
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
exports.ReadFile = ReadFile;
|
|
11
|
-
//# sourceMappingURL=read-file.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"read-file.js","sourceRoot":"","sources":["../../../../../../libs/library/src/builders/update-package-group/read-file.ts"],"names":[],"mappings":";;;AAAA,2BAAkC;AAElC,MAAa,QAAQ;IAEZ,IAAI,CAAC,IAAY,EAAE,UAAyE,OAAO;QACxG,OAAO,IAAA,iBAAY,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACrC,CAAC;CAEF;AAND,4BAMC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WriteFile = void 0;
|
|
4
|
-
const fs_1 = require("fs");
|
|
5
|
-
class WriteFile {
|
|
6
|
-
sync(path, data, options) {
|
|
7
|
-
(0, fs_1.writeFileSync)(path, data, options);
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
exports.WriteFile = WriteFile;
|
|
11
|
-
//# sourceMappingURL=write-file.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"write-file.js","sourceRoot":"","sources":["../../../../../../libs/library/src/builders/update-package-group/write-file.ts"],"names":[],"mappings":";;;AAAA,2BAAqD;AAErD,MAAa,SAAS;IAEb,IAAI,CAAC,IAAY,EAAE,IAAS,EAAE,OAA0B;QAC7D,IAAA,kBAAa,EAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IACrC,CAAC;CAEF;AAND,8BAMC"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { BuilderContext, BuilderOutput } from '@angular-devkit/architect';
|
|
2
|
-
import { json } from '@angular-devkit/core';
|
|
3
|
-
import { UpdatePeerDependenciesBuilderSchema } from './schema';
|
|
4
|
-
export interface Target extends json.JsonObject {
|
|
5
|
-
project: string;
|
|
6
|
-
target: string;
|
|
7
|
-
configuration: string;
|
|
8
|
-
}
|
|
9
|
-
export declare class Builder {
|
|
10
|
-
readonly options: UpdatePeerDependenciesBuilderSchema;
|
|
11
|
-
readonly context: BuilderContext;
|
|
12
|
-
private readonly rootPackageVersionMap;
|
|
13
|
-
private projectGraph;
|
|
14
|
-
private readonly dependencyVersionMap;
|
|
15
|
-
private readonly projectNewVersion;
|
|
16
|
-
private readonly flattenDependenciesMap;
|
|
17
|
-
constructor(options: UpdatePeerDependenciesBuilderSchema, context: BuilderContext);
|
|
18
|
-
static Run(options: UpdatePeerDependenciesBuilderSchema, context: BuilderContext): Promise<BuilderOutput>;
|
|
19
|
-
static Create(): any;
|
|
20
|
-
run(): Promise<BuilderOutput>;
|
|
21
|
-
private loadRootPackageVersionMap;
|
|
22
|
-
private parseJsonFile;
|
|
23
|
-
private flattenDependencies;
|
|
24
|
-
private filterIgnoredDependencies;
|
|
25
|
-
private filterForPeerDependencies;
|
|
26
|
-
private getPackageName;
|
|
27
|
-
private getDependencyVersion;
|
|
28
|
-
private getProjectPackageJson;
|
|
29
|
-
private getProjectPackageJsonPath;
|
|
30
|
-
private getProjectNgPackageJson;
|
|
31
|
-
private getProjectNgPackageJsonPath;
|
|
32
|
-
private hasProjectNgPackageJsonPath;
|
|
33
|
-
private writeProjectNgPackageJson;
|
|
34
|
-
private writeProjectPackageJson;
|
|
35
|
-
private mapToPackageDependencies;
|
|
36
|
-
private updateNgPackage;
|
|
37
|
-
private update;
|
|
38
|
-
}
|
|
39
|
-
declare const _default: any;
|
|
40
|
-
export default _default;
|