@rxap/config 16.0.0-dev.2 → 16.0.0-dev.21
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 +371 -0
- package/LICENSE +621 -21
- package/LICENSE.md +621 -0
- package/README.md +8 -63
- package/esm2022/index.mjs +6 -2
- package/esm2022/lib/config-loader.service.mjs +9 -9
- package/esm2022/lib/config-testing-service.mjs +33 -0
- package/esm2022/lib/config.service.mjs +114 -76
- package/esm2022/lib/tokens.mjs +1 -1
- package/esm2022/lib/types.mjs +1 -1
- package/esm2022/rxap-config.mjs +1 -1
- package/fesm2022/rxap-config.mjs +174 -101
- package/fesm2022/rxap-config.mjs.map +1 -1
- package/index.d.ts +3 -1
- package/lib/config-testing-service.d.ts +12 -0
- package/lib/config.service.d.ts +19 -8
- package/package.json +47 -41
- package/theme.css +1 -0
- package/collection.json +0 -15
- package/migration.json +0 -4
- package/src/schematics/ng-add/index.d.ts +0 -3
- package/src/schematics/ng-add/index.js +0 -59
- package/src/schematics/ng-add/index.js.map +0 -1
- package/src/schematics/ng-add/schema.json +0 -15
- package/src/schematics/side-load/index.d.ts +0 -3
- package/src/schematics/side-load/index.js +0 -27
- package/src/schematics/side-load/index.js.map +0 -1
- package/src/schematics/side-load/schema.json +0 -29
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const schematics_1 = require("@angular-devkit/schematics");
|
|
4
|
-
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
5
|
-
const ts_morph_1 = require("ts-morph");
|
|
6
|
-
const schematics_ts_morph_1 = require("@rxap/schematics-ts-morph");
|
|
7
|
-
const path_1 = require("path");
|
|
8
|
-
function default_1(options) {
|
|
9
|
-
return (host) => {
|
|
10
|
-
const rules = [
|
|
11
|
-
(0, schematics_utilities_1.InstallPeerDependencies)()
|
|
12
|
-
];
|
|
13
|
-
if (options.project) {
|
|
14
|
-
const projectSourceRoot = (0, schematics_utilities_1.GetProjectSourceRoot)(host, options.project);
|
|
15
|
-
const project = new ts_morph_1.Project({
|
|
16
|
-
useInMemoryFileSystem: true,
|
|
17
|
-
manipulationSettings: { quoteKind: ts_morph_1.QuoteKind.Single, indentationText: ts_morph_1.IndentationText.TwoSpaces }
|
|
18
|
-
});
|
|
19
|
-
(0, schematics_ts_morph_1.AddDir)(host.getDir(projectSourceRoot), project);
|
|
20
|
-
const mainSourceFile = project.getSourceFile('/main.ts');
|
|
21
|
-
if (!mainSourceFile) {
|
|
22
|
-
throw new schematics_1.SchematicsException(`Could not find the main.ts source file in '[projectSourceRoot]/main.ts'`);
|
|
23
|
-
}
|
|
24
|
-
(0, schematics_ts_morph_1.AddToArray)(mainSourceFile, 'configSideLoad', 'Promise.resolve()', 'Promise<any>[]');
|
|
25
|
-
(0, schematics_ts_morph_1.AddToArray)(mainSourceFile, 'setup', 'ConfigService.Load().then(() => Promise.all(configSideLoad))', 'Promise<any>[]');
|
|
26
|
-
mainSourceFile.addImportDeclarations([
|
|
27
|
-
{
|
|
28
|
-
namedImports: ['ConfigService'],
|
|
29
|
-
moduleSpecifier: '@rxap/config'
|
|
30
|
-
}
|
|
31
|
-
]);
|
|
32
|
-
rules.push((0, schematics_ts_morph_1.ApplyTsMorphProject)(project, projectSourceRoot));
|
|
33
|
-
const configFilePath = (0, path_1.join)(projectSourceRoot, 'config.json');
|
|
34
|
-
rules.push((0, schematics_utilities_1.UpdateAngularJson)(angular => {
|
|
35
|
-
const p = angular.projects.get(options.project);
|
|
36
|
-
if (p) {
|
|
37
|
-
const buildTarget = p.targets.get('build');
|
|
38
|
-
if (buildTarget) {
|
|
39
|
-
if (!buildTarget.options.assets) {
|
|
40
|
-
buildTarget.options.assets = [];
|
|
41
|
-
}
|
|
42
|
-
const assets = buildTarget.options.assets;
|
|
43
|
-
if (!assets.includes(configFilePath)) {
|
|
44
|
-
assets.push(configFilePath);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}));
|
|
49
|
-
rules.push(tree => {
|
|
50
|
-
if (!tree.exists(configFilePath)) {
|
|
51
|
-
tree.create(configFilePath, '{}');
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
return (0, schematics_1.chain)(rules);
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
exports.default = default_1;
|
|
59
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/config/src/schematics/ng-add/index.ts"],"names":[],"mappings":";;AAAA,2DAKoC;AACpC,qEAIoC;AAEpC,uCAIkB;AAClB,mEAImC;AACnC,+BAA4B;AAE5B,mBAAwB,OAAoB;IAC1C,OAAO,CAAC,IAAU,EAAE,EAAE;QAEpB,MAAM,KAAK,GAAW;YACpB,IAAA,8CAAuB,GAAE;SAC1B,CAAC;QAEF,IAAI,OAAO,CAAC,OAAO,EAAE;YAEnB,MAAM,iBAAiB,GAAG,IAAA,2CAAoB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;YACtE,MAAM,OAAO,GAAa,IAAI,kBAAO,CAAC;gBACpC,qBAAqB,EAAE,IAAI;gBAC3B,oBAAoB,EAAG,EAAE,SAAS,EAAE,oBAAS,CAAC,MAAM,EAAE,eAAe,EAAE,0BAAe,CAAC,SAAS,EAAE;aACnG,CAAC,CAAC;YACH,IAAA,4BAAM,EAAC,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC,CAAC;YAEhD,MAAM,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YAEzD,IAAI,CAAC,cAAc,EAAE;gBACnB,MAAM,IAAI,gCAAmB,CAAC,yEAAyE,CAAC,CAAC;aAC1G;YAED,IAAA,gCAAU,EACR,cAAc,EACd,gBAAgB,EAChB,mBAAmB,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AC;SAEJ;QAED,OAAO,IAAA,kBAAK,EAAC,KAAK,CAAC,CAAC;IAEtB,CAAC,CAAC;AACJ,CAAC;AA7ED,4BA6EC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
-
"$id": "config-ng-add",
|
|
4
|
-
"type": "object",
|
|
5
|
-
"properties": {
|
|
6
|
-
"project": {
|
|
7
|
-
"type": "string",
|
|
8
|
-
"description": "The project where the environment feature should be added",
|
|
9
|
-
"$default": {
|
|
10
|
-
"$source": "projectName"
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
"required": []
|
|
15
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
-
const ts_morph_1 = require("ts-morph");
|
|
6
|
-
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
7
|
-
const schematics_ts_morph_1 = require("@rxap/schematics-ts-morph");
|
|
8
|
-
const path_1 = require("path");
|
|
9
|
-
function default_1(options) {
|
|
10
|
-
return (host) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
11
|
-
var _a;
|
|
12
|
-
const project = new ts_morph_1.Project({
|
|
13
|
-
manipulationSettings: {
|
|
14
|
-
indentationText: ts_morph_1.IndentationText.TwoSpaces
|
|
15
|
-
},
|
|
16
|
-
useInMemoryFileSystem: true
|
|
17
|
-
});
|
|
18
|
-
const projectSourceRoot = (0, schematics_utilities_1.GetProjectSourceRoot)(host, options.project);
|
|
19
|
-
const mainSourceFile = project.createSourceFile('main.ts', host.read((0, path_1.join)(projectSourceRoot, 'main.ts')).toString('utf-8'));
|
|
20
|
-
(0, schematics_ts_morph_1.AddToArray)(mainSourceFile, 'configSideLoad', `ConfigService.SideLoad('${options.url}', '${options.propertyPath}', ${(_a = options.required) !== null && _a !== void 0 ? _a : false})`, 'Promise<any>[]');
|
|
21
|
-
return (0, schematics_1.chain)([
|
|
22
|
-
(0, schematics_ts_morph_1.ApplyTsMorphProject)(project, projectSourceRoot)
|
|
23
|
-
]);
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
exports.default = default_1;
|
|
27
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/config/src/schematics/side-load/index.ts"],"names":[],"mappings":";;;AAAA,2DAIoC;AAEpC,uCAGkB;AAClB,qEAAkE;AAClE,mEAGmC;AACnC,+BAA4B;AAE5B,mBAAwB,OAAuB;IAE7C,OAAO,CAAO,IAAU,EAAE,EAAE;;QAE1B,MAAM,OAAO,GAAG,IAAI,kBAAO,CAAC;YAC1B,oBAAoB,EAAG;gBACrB,eAAe,EAAE,0BAAe,CAAC,SAAS;aAC3C;YACD,qBAAqB,EAAE,IAAI;SAC5B,CAAC,CAAC;QAEH,MAAM,iBAAiB,GAAG,IAAA,2CAAoB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAEtE,MAAM,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAC7C,SAAS,EACT,IAAI,CAAC,IAAI,CAAC,IAAA,WAAI,EAAC,iBAAiB,EAAE,SAAS,CAAC,CAC1C,CAAC,QAAQ,CAAC,OAAO,CAAC,CACrB,CAAC;QAEF,IAAA,gCAAU,EACR,cAAc,EACd,gBAAgB,EAChB,2BAA2B,OAAO,CAAC,GAAG,OAAO,OAAO,CAAC,YAAY,MAAM,MAAA,OAAO,CAAC,QAAQ,mCAAI,KAAK,GAAG,EACnG,gBAAgB,CACjB,CAAC;QAEF,OAAO,IAAA,kBAAK,EAAC;YACX,IAAA,yCAAmB,EAAC,OAAO,EAAE,iBAAiB,CAAC;SAChD,CAAC,CAAC;IAEL,CAAC,CAAA,CAAC;AAEJ,CAAC;AAhCD,4BAgCC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/schema",
|
|
3
|
-
"$id": "config-side-load",
|
|
4
|
-
"title": "SideLoad",
|
|
5
|
-
"type": "object",
|
|
6
|
-
"properties": {
|
|
7
|
-
"project": {
|
|
8
|
-
"type": "string",
|
|
9
|
-
"description": "The project name"
|
|
10
|
-
},
|
|
11
|
-
"url": {
|
|
12
|
-
"type": "string",
|
|
13
|
-
"description": "Url for the config that should be side loaded"
|
|
14
|
-
},
|
|
15
|
-
"propertyPath": {
|
|
16
|
-
"type": "string",
|
|
17
|
-
"description": "Property path where the config should be added"
|
|
18
|
-
},
|
|
19
|
-
"required": {
|
|
20
|
-
"type": "boolean",
|
|
21
|
-
"default": false
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
"required": [
|
|
25
|
-
"project",
|
|
26
|
-
"url",
|
|
27
|
-
"propertyPath"
|
|
28
|
-
]
|
|
29
|
-
}
|