@o3r/core 11.6.0-prerelease.5 → 11.6.0-prerelease.51
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/builders/app-version/index.d.ts.map +1 -1
- package/builders/app-version/index.js +1 -1
- package/builders/app-version/schema.d.ts.map +1 -1
- package/builders/lib-build/index.d.ts +1 -2
- package/builders/lib-build/index.d.ts.map +1 -1
- package/builders/lib-build/index.js +10 -10
- package/builders/lib-build/schema.d.ts +1 -2
- package/builders/lib-build/schema.d.ts.map +1 -1
- package/builders/multi-watcher/index.d.ts.map +1 -1
- package/builders/multi-watcher/index.js +1 -0
- package/builders/multi-watcher/schema.d.ts.map +1 -1
- package/builders/ngc/index.d.ts.map +1 -1
- package/builders/ngc/index.js +4 -5
- package/builders/ngc/schema.d.ts.map +1 -1
- package/builders/pattern-replacement/index.d.ts.map +1 -1
- package/builders/pattern-replacement/index.js +2 -3
- package/builders/pattern-replacement/schema.d.ts.map +1 -1
- package/builders/run-script/index.d.ts.map +1 -1
- package/builders/run-script/index.js +3 -3
- package/builders/utils.d.ts.map +1 -1
- package/core/application/build-properties.d.ts +1 -1
- package/core/application/build-properties.d.ts.map +1 -1
- package/core/application/runtime.d.ts.map +1 -1
- package/core/common/interface-utils.d.ts.map +1 -1
- package/core/interfaces/configuration.d.ts.map +1 -1
- package/core/interfaces/context.d.ts.map +1 -1
- package/core/metadata/component.decorator.d.ts.map +1 -1
- package/core/metadata/index.d.ts +1 -1
- package/core/metadata/index.d.ts.map +1 -1
- package/esm2022/core/application/build-properties.mjs +2 -2
- package/esm2022/core/application/index.mjs +1 -1
- package/esm2022/core/application/runtime.mjs +1 -1
- package/esm2022/core/common/interface-utils.mjs +1 -1
- package/esm2022/core/devkit/devtools.interface.mjs +1 -1
- package/esm2022/core/interfaces/configuration.mjs +1 -1
- package/esm2022/core/interfaces/context.mjs +1 -2
- package/esm2022/core/metadata/component.decorator.mjs +2 -2
- package/esm2022/core/metadata/index.mjs +2 -2
- package/esm2022/messages/common-message.interface.mjs +1 -1
- package/esm2022/messages/index.mjs +1 -1
- package/esm2022/messages/message.helpers.mjs +7 -5
- package/esm2022/public_api.mjs +2 -2
- package/esm2022/store/async/async-entity.adapter.mjs +3 -3
- package/esm2022/store/async/async.adapter.mjs +8 -7
- package/esm2022/store/async/async.helpers.mjs +1 -1
- package/esm2022/store/async/async.interfaces.mjs +1 -1
- package/esm2022/store/async/async.operators.mjs +5 -5
- package/esm2022/store/async/async.props.mjs +3 -4
- package/esm2022/store/async/async.serializer.mjs +2 -2
- package/esm2022/store/async/index.mjs +4 -4
- package/esm2022/store/types.mjs +1 -1
- package/esm2022/utils/debug/debug.helper.mjs +1 -2
- package/esm2022/utils/deep-fill/deep-fill.mjs +3 -4
- package/esm2022/utils/rendering/rendering.helpers.mjs +3 -4
- package/fesm2022/o3r-core.mjs +48 -51
- package/fesm2022/o3r-core.mjs.map +1 -1
- package/messages/common-message.interface.d.ts.map +1 -1
- package/messages/message.helpers.d.ts.map +1 -1
- package/package.json +38 -29
- package/public_api.d.ts +1 -1
- package/public_api.d.ts.map +1 -1
- package/schematics/add-modules/index.d.ts.map +1 -1
- package/schematics/add-modules/index.js +2 -2
- package/schematics/add-modules/schema.d.ts.map +1 -1
- package/schematics/component/container/index.d.ts.map +1 -1
- package/schematics/component/container/index.js +13 -11
- package/schematics/component/container/schema.d.ts.map +1 -1
- package/schematics/component/index.d.ts.map +1 -1
- package/schematics/component/index.js +1 -3
- package/schematics/component/presenter/index.d.ts.map +1 -1
- package/schematics/component/presenter/index.js +13 -12
- package/schematics/component/presenter/schema.d.ts.map +1 -1
- package/schematics/component/schema.d.ts.map +1 -1
- package/schematics/component/structures.types.d.ts +3 -3
- package/schematics/component/structures.types.d.ts.map +1 -1
- package/schematics/component/structures.types.js +2 -0
- package/schematics/context-to-component/index.d.ts +0 -1
- package/schematics/context-to-component/index.d.ts.map +1 -1
- package/schematics/context-to-component/index.js +1 -2
- package/schematics/context-to-component/schema.d.ts.map +1 -1
- package/schematics/convert-component/index.d.ts +0 -1
- package/schematics/convert-component/index.d.ts.map +1 -1
- package/schematics/convert-component/index.js +0 -2
- package/schematics/convert-component/schema.d.ts.map +1 -1
- package/schematics/ng-add/component-decorator/index.d.ts.map +1 -1
- package/schematics/ng-add/component-decorator/index.js +4 -4
- package/schematics/ng-add/index.d.ts.map +1 -1
- package/schematics/ng-add/index.js +5 -6
- package/schematics/ng-add/project-setup/index.d.ts.map +1 -1
- package/schematics/ng-add/project-setup/index.js +5 -5
- package/schematics/ng-add/schema.d.ts.map +1 -1
- package/schematics/ng-add/updates-for-v8/cms-adapters/update-builders-names.d.ts.map +1 -1
- package/schematics/ng-add/updates-for-v8/cms-adapters/update-builders-names.js +40 -41
- package/schematics/ng-add/updates-for-v8/generators/update-generators-names.d.ts.map +1 -1
- package/schematics/ng-add/updates-for-v8/generators/update-generators-names.js +25 -27
- package/schematics/ng-add/utils/linter/index.d.ts +8 -3
- package/schematics/ng-add/utils/linter/index.d.ts.map +1 -1
- package/schematics/ng-add/utils/linter/index.js +11 -5
- package/schematics/ng-add-create/index.d.ts +0 -2
- package/schematics/ng-add-create/index.d.ts.map +1 -1
- package/schematics/ng-add-create/index.js +9 -15
- package/schematics/ng-add-create/schema.d.ts.map +1 -1
- package/schematics/ng-update/index.d.ts.map +1 -1
- package/schematics/ng-update/index.js +5 -3
- package/schematics/ng-update/v10.0/configuration.d.ts.map +1 -1
- package/schematics/ng-update/v10.0/configuration.js +2 -2
- package/schematics/ng-update/v8.2/import-map.d.ts.map +1 -1
- package/schematics/page/index.d.ts.map +1 -1
- package/schematics/page/index.js +16 -16
- package/schematics/page/schema.d.ts.map +1 -1
- package/schematics/renovate/index.d.ts.map +1 -1
- package/schematics/renovate/schema.d.ts.map +1 -1
- package/schematics/rule-factories/additional-modules/index.d.ts.map +1 -1
- package/schematics/rule-factories/additional-modules/index.js +3 -3
- package/schematics/rule-factories/component/analytics.d.ts.map +1 -1
- package/schematics/rule-factories/component/common.d.ts +0 -1
- package/schematics/rule-factories/component/common.d.ts.map +1 -1
- package/schematics/rule-factories/component/common.js +18 -15
- package/schematics/rule-factories/component/configuration.d.ts.map +1 -1
- package/schematics/rule-factories/component/context.d.ts.map +1 -1
- package/schematics/rule-factories/component/design-token.d.ts.map +1 -1
- package/schematics/rule-factories/component/fixture.d.ts.map +1 -1
- package/schematics/rule-factories/component/localization.d.ts.map +1 -1
- package/schematics/rule-factories/component/rules-engine.d.ts.map +1 -1
- package/schematics/rule-factories/component/theming.d.ts.map +1 -1
- package/schematics/rule-factories/customization-environment/index.d.ts.map +1 -1
- package/schematics/rule-factories/customization-environment/index.js +5 -7
- package/schematics/rule-factories/index.d.ts +1 -1
- package/schematics/rule-factories/index.d.ts.map +1 -1
- package/schematics/rule-factories/index.js +1 -1
- package/schematics/rule-factories/o3r-basic-updates/index.d.ts +0 -1
- package/schematics/rule-factories/o3r-basic-updates/index.d.ts.map +1 -1
- package/schematics/rule-factories/o3r-basic-updates/index.js +7 -8
- package/schematics/rule-factories/otter-environment/index.d.ts +1 -2
- package/schematics/rule-factories/otter-environment/index.d.ts.map +1 -1
- package/schematics/rule-factories/otter-environment/index.js +16 -18
- package/schematics/rule-factories/store/index.d.ts +3 -4
- package/schematics/rule-factories/store/index.d.ts.map +1 -1
- package/schematics/rule-factories/store/index.js +7 -8
- package/schematics/schematics-update/index.d.ts.map +1 -1
- package/schematics/schematics-update/index.js +3 -3
- package/schematics/schematics-update/schema.d.ts.map +1 -1
- package/schematics/service/index.d.ts.map +1 -1
- package/schematics/service/index.js +3 -3
- package/schematics/service/schema.d.ts.map +1 -1
- package/schematics/shared/presets/all.preset.d.ts.map +1 -1
- package/schematics/shared/presets/all.preset.js +2 -3
- package/schematics/shared/presets/basic.preset.d.ts.map +1 -1
- package/schematics/shared/presets/cms.preset.d.ts +0 -1
- package/schematics/shared/presets/cms.preset.d.ts.map +1 -1
- package/schematics/shared/presets/cms.preset.js +1 -3
- package/schematics/shared/presets/external.preset.d.ts.map +1 -1
- package/schematics/shared/presets/external.preset.js +1 -1
- package/schematics/shared/presets/helpers.d.ts.map +1 -1
- package/schematics/shared/presets/helpers.js +10 -8
- package/schematics/shared/presets/index.d.ts +1 -1
- package/schematics/shared/presets/index.d.ts.map +1 -1
- package/schematics/shared/presets/index.js +1 -1
- package/schematics/shared/presets/preset.interface.d.ts +1 -1
- package/schematics/shared/presets/preset.interface.d.ts.map +1 -1
- package/schematics/show-modules/index.d.ts.map +1 -1
- package/schematics/show-modules/schema.d.ts.map +1 -1
- package/schematics/store/common/helpers.d.ts.map +1 -1
- package/schematics/store/common/schema.d.ts.map +1 -1
- package/schematics/store/entity-async/index.d.ts.map +1 -1
- package/schematics/store/entity-async/index.js +3 -4
- package/schematics/store/entity-async/schema.d.ts.map +1 -1
- package/schematics/store/entity-sync/index.d.ts.map +1 -1
- package/schematics/store/entity-sync/index.js +3 -4
- package/schematics/store/entity-sync/schema.d.ts.map +1 -1
- package/schematics/store/index.d.ts.map +1 -1
- package/schematics/store/index.js +10 -5
- package/schematics/store/schema.d.ts.map +1 -1
- package/schematics/store/simple-async/index.d.ts.map +1 -1
- package/schematics/store/simple-async/index.js +2 -3
- package/schematics/store/simple-async/schema.d.ts.map +1 -1
- package/schematics/store/simple-sync/index.d.ts.map +1 -1
- package/schematics/store/simple-sync/index.js +2 -4
- package/schematics/store/simple-sync/schema.d.ts.map +1 -1
- package/schematics/store-action/index.d.ts.map +1 -1
- package/schematics/store-action/index.js +26 -22
- package/schematics/store-action/schema.d.ts.map +1 -1
- package/store/async/async-entity.adapter.d.ts.map +1 -1
- package/store/async/async.adapter.d.ts.map +1 -1
- package/store/async/async.helpers.d.ts.map +1 -1
- package/store/async/async.interfaces.d.ts.map +1 -1
- package/store/async/async.operators.d.ts +1 -0
- package/store/async/async.operators.d.ts.map +1 -1
- package/store/async/async.props.d.ts.map +1 -1
- package/store/async/async.serializer.d.ts.map +1 -1
- package/store/async/index.d.ts +3 -3
- package/store/async/index.d.ts.map +1 -1
- package/store/types.d.ts +9 -7
- package/store/types.d.ts.map +1 -1
- package/utils/debug/debug.helper.d.ts.map +1 -1
- package/utils/deep-fill/deep-fill.d.ts.map +1 -1
- package/utils/rendering/rendering.helpers.d.ts +0 -1
- package/utils/rendering/rendering.helpers.d.ts.map +1 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.updateOtterGeneratorsNames = updateOtterGeneratorsNames;
|
|
4
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
5
4
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
6
5
|
const schematics_2 = require("@o3r/schematics");
|
|
7
6
|
const generatorsMappingFromV7 = {
|
|
@@ -33,36 +32,35 @@ function updateGeneratorsPackage(schematicsToUpdate) {
|
|
|
33
32
|
}
|
|
34
33
|
});
|
|
35
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Change otter generators names into angular.json
|
|
37
|
+
* @param tree
|
|
38
|
+
* @param context
|
|
39
|
+
*/
|
|
40
|
+
const updateAngularJson = (tree, context) => {
|
|
41
|
+
const workspace = (0, schematics_2.getWorkspaceConfig)(tree);
|
|
42
|
+
if (!workspace) {
|
|
43
|
+
context.logger.error('No workspace detected');
|
|
44
|
+
return tree;
|
|
45
|
+
}
|
|
46
|
+
const projectsInAngularJson = Object.keys(workspace.projects);
|
|
47
|
+
if (workspace.schematics) {
|
|
48
|
+
updateGeneratorsPackage(workspace.schematics);
|
|
49
|
+
delete workspace.schematics['@otter/ng-tools:api-service'];
|
|
50
|
+
}
|
|
51
|
+
projectsInAngularJson.forEach((projectName) => {
|
|
52
|
+
if (workspace.projects[projectName].schematics) {
|
|
53
|
+
updateGeneratorsPackage(workspace.projects[projectName].schematics);
|
|
54
|
+
delete workspace.projects[projectName].schematics['@otter/ng-tools:api-service'];
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
tree.overwrite('/angular.json', JSON.stringify(workspace, null, 2));
|
|
58
|
+
return tree;
|
|
59
|
+
};
|
|
36
60
|
/**
|
|
37
61
|
* Update otter generators names
|
|
38
62
|
*/
|
|
39
63
|
function updateOtterGeneratorsNames() {
|
|
40
|
-
/**
|
|
41
|
-
* Change otter generators names into angular.json
|
|
42
|
-
*
|
|
43
|
-
* @param tree
|
|
44
|
-
* @param context
|
|
45
|
-
*/
|
|
46
|
-
const updateAngularJson = (tree, context) => {
|
|
47
|
-
const workspace = (0, schematics_2.getWorkspaceConfig)(tree);
|
|
48
|
-
if (!workspace) {
|
|
49
|
-
context.logger.error('No workspace detected');
|
|
50
|
-
return tree;
|
|
51
|
-
}
|
|
52
|
-
const projectsInAngularJson = Object.keys(workspace.projects);
|
|
53
|
-
if (workspace.schematics) {
|
|
54
|
-
updateGeneratorsPackage(workspace.schematics);
|
|
55
|
-
delete workspace.schematics['@otter/ng-tools:api-service'];
|
|
56
|
-
}
|
|
57
|
-
projectsInAngularJson.forEach(projectName => {
|
|
58
|
-
if (workspace.projects[projectName].schematics) {
|
|
59
|
-
updateGeneratorsPackage(workspace.projects[projectName].schematics);
|
|
60
|
-
delete workspace.projects[projectName].schematics['@otter/ng-tools:api-service'];
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
tree.overwrite('/angular.json', JSON.stringify(workspace, null, 2));
|
|
64
|
-
return tree;
|
|
65
|
-
};
|
|
66
64
|
return (0, schematics_1.chain)([
|
|
67
65
|
updateAngularJson
|
|
68
66
|
]);
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import { SchematicContext } from '@angular-devkit/schematics';
|
|
1
|
+
import { SchematicContext, type Tree } from '@angular-devkit/schematics';
|
|
2
|
+
/**
|
|
3
|
+
* If the ESLint FlatConfig is used in the repository
|
|
4
|
+
* @param tree
|
|
5
|
+
*/
|
|
6
|
+
export declare const isUsingFlatConfig: (tree: Tree) => import("@angular-devkit/core").PathFragment | undefined;
|
|
2
7
|
/**
|
|
3
8
|
* Checks if `eslint` package is installed. If so, ask the user for otter linter rules install.
|
|
4
9
|
* Otherwise displays a message to inform the user that otter linter rules can be added later.
|
|
5
|
-
*
|
|
6
10
|
* @param context Schematics context
|
|
11
|
+
* @param tree
|
|
7
12
|
*/
|
|
8
|
-
export declare const shouldOtterLinterBeInstalled: (context: SchematicContext) => Promise<boolean>;
|
|
13
|
+
export declare const shouldOtterLinterBeInstalled: (context: SchematicContext, tree: Tree) => Promise<boolean>;
|
|
9
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../schematics/ng-add/utils/linter/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../schematics/ng-add/utils/linter/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,gBAAgB,EAChB,KAAK,IAAI,EACV,MAAM,4BAA4B,CAAC;AAEpC;;;GAGG;AACH,eAAO,MAAM,iBAAiB,SAAU,IAAI,4DAAgF,CAAC;AAE7H;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,YAAmB,gBAAgB,QAAQ,IAAI,KAAG,OAAO,CAAC,OAAO,CAezG,CAAC"}
|
|
@@ -1,26 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.shouldOtterLinterBeInstalled = void 0;
|
|
3
|
+
exports.shouldOtterLinterBeInstalled = exports.isUsingFlatConfig = void 0;
|
|
4
4
|
const prompt_1 = require("@angular/cli/src/utilities/prompt");
|
|
5
|
+
/**
|
|
6
|
+
* If the ESLint FlatConfig is used in the repository
|
|
7
|
+
* @param tree
|
|
8
|
+
*/
|
|
9
|
+
const isUsingFlatConfig = (tree) => tree.root.subfiles.find((file) => /eslint\.config\.{m,c,}[jt]s/.test(file));
|
|
10
|
+
exports.isUsingFlatConfig = isUsingFlatConfig;
|
|
5
11
|
/**
|
|
6
12
|
* Checks if `eslint` package is installed. If so, ask the user for otter linter rules install.
|
|
7
13
|
* Otherwise displays a message to inform the user that otter linter rules can be added later.
|
|
8
|
-
*
|
|
9
14
|
* @param context Schematics context
|
|
15
|
+
* @param tree
|
|
10
16
|
*/
|
|
11
|
-
const shouldOtterLinterBeInstalled = async (context) => {
|
|
17
|
+
const shouldOtterLinterBeInstalled = async (context, tree) => {
|
|
12
18
|
const linterPackageName = 'eslint';
|
|
13
19
|
let useOtterLinter = false;
|
|
14
20
|
try {
|
|
15
21
|
require.resolve(`${linterPackageName}/package.json`);
|
|
16
22
|
if (context.interactive) {
|
|
17
23
|
useOtterLinter = await (0, prompt_1.askConfirmation)(`You already have ESLint installed. Would you like to add otter config rules for ESLint?
|
|
18
|
-
Otherwise, you can add them later via this command: ng add @o3r/eslint-config-otter`, true);
|
|
24
|
+
Otherwise, you can add them later via this command: ng add @o3r/eslint-config${(0, exports.isUsingFlatConfig)(tree) ? '' : '-otter'}`, true);
|
|
19
25
|
}
|
|
20
26
|
}
|
|
21
27
|
catch {
|
|
22
28
|
context.logger.info(`ESLint package not installed. Skipping Otter linter phase!
|
|
23
|
-
You can add Otter linter config rules later to the project via this command: ng add @o3r/eslint-config
|
|
29
|
+
You can add Otter linter config rules later to the project via this command: ng add @o3r/eslint-config`);
|
|
24
30
|
}
|
|
25
31
|
return useOtterLinter;
|
|
26
32
|
};
|
|
@@ -2,13 +2,11 @@ import { Rule } from '@angular-devkit/schematics';
|
|
|
2
2
|
import { NgGenerateUpdateSchematicsSchema } from './schema';
|
|
3
3
|
/**
|
|
4
4
|
* Rule factory to include `ng add` skeleton
|
|
5
|
-
*
|
|
6
5
|
* @param options
|
|
7
6
|
*/
|
|
8
7
|
export declare const updateTemplates: (options: NgGenerateUpdateSchematicsSchema) => Rule;
|
|
9
8
|
/**
|
|
10
9
|
* add a new ngUpdate function
|
|
11
|
-
*
|
|
12
10
|
* @param options
|
|
13
11
|
*/
|
|
14
12
|
export declare const ngAddCreate: (options: NgGenerateUpdateSchematicsSchema) => Rule;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add-create/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add-create/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAOL,IAAI,EAKL,MAAM,4BAA4B,CAAC;AASpC,OAAO,EACL,gCAAgC,EACjC,MAAM,UAAU,CAAC;AA6DlB;;;GAGG;AACH,eAAO,MAAM,eAAe,qDAA2D,CAAC;AAYxF;;;GAGG;AACH,eAAO,MAAM,WAAW,qDAAuD,CAAC"}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ngAddCreate = exports.updateTemplates = void 0;
|
|
4
|
-
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
-
const path = require("node:path");
|
|
6
4
|
const fs = require("node:fs");
|
|
5
|
+
const path = require("node:path");
|
|
6
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
7
7
|
const schematics_2 = require("@o3r/schematics");
|
|
8
|
-
const schematics_3 = require("@angular-devkit/schematics");
|
|
9
8
|
/**
|
|
10
9
|
* Rule factory to include `ng add` skeleton
|
|
11
|
-
*
|
|
12
10
|
* @param options
|
|
13
11
|
*/
|
|
14
12
|
function updateTemplatesFn(options) {
|
|
@@ -29,10 +27,9 @@ function updateTemplatesFn(options) {
|
|
|
29
27
|
const otterVersion = o3rCorePackageJson.dependencies['@o3r/schematics'];
|
|
30
28
|
const packageManagerRunner = (0, schematics_2.getPackageManagerRunner)();
|
|
31
29
|
packageJson.scripts ||= {};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
packageJson['schematics'] = './collection.json';
|
|
30
|
+
// eslint-disable-next-line @stylistic/max-len -- keep the command on the same line
|
|
31
|
+
packageJson.scripts['build:schematics'] = `tsc -b tsconfig.builders.json --pretty && ${packageManagerRunner} cpy 'schematics/**/*.json' dist/schematics && ${packageManagerRunner} cpy 'collection.json' dist`;
|
|
32
|
+
packageJson.schematics = './collection.json';
|
|
36
33
|
packageJson.peerDependencies ||= {};
|
|
37
34
|
packageJson.peerDependencies['@angular-devkit/schematics'] = angularVersion;
|
|
38
35
|
packageJson.peerDependencies['@angular-devkit/core'] = angularVersion;
|
|
@@ -50,27 +47,25 @@ function updateTemplatesFn(options) {
|
|
|
50
47
|
}
|
|
51
48
|
// generate skeleton
|
|
52
49
|
const featureName = options.name || path.basename(process.cwd());
|
|
53
|
-
const templateSource = (0,
|
|
54
|
-
(0,
|
|
50
|
+
const templateSource = (0, schematics_1.apply)((0, schematics_1.url)('./templates'), [
|
|
51
|
+
(0, schematics_1.template)({
|
|
55
52
|
featureName,
|
|
56
53
|
tsconfigBuildPath: (0, schematics_2.findConfigFileRelativePath)(tree, ['tsconfig.build.json', 'tsconfig.base.json', 'tsconfig.json'], targetPath)
|
|
57
54
|
}),
|
|
58
|
-
(0,
|
|
55
|
+
(0, schematics_1.renameTemplateFiles)(),
|
|
59
56
|
(0, schematics_1.move)(targetPath)
|
|
60
57
|
]);
|
|
61
|
-
const rule = (0,
|
|
58
|
+
const rule = (0, schematics_1.mergeWith)(templateSource, schematics_1.MergeStrategy.AllowCreationConflict);
|
|
62
59
|
return rule(tree, context);
|
|
63
60
|
};
|
|
64
61
|
}
|
|
65
62
|
/**
|
|
66
63
|
* Rule factory to include `ng add` skeleton
|
|
67
|
-
*
|
|
68
64
|
* @param options
|
|
69
65
|
*/
|
|
70
66
|
exports.updateTemplates = (0, schematics_2.createSchematicWithMetricsIfInstalled)(updateTemplatesFn);
|
|
71
67
|
/**
|
|
72
68
|
* add a new ngUpdate function
|
|
73
|
-
*
|
|
74
69
|
* @param options
|
|
75
70
|
*/
|
|
76
71
|
function ngAddCreateFn(options) {
|
|
@@ -80,7 +75,6 @@ function ngAddCreateFn(options) {
|
|
|
80
75
|
}
|
|
81
76
|
/**
|
|
82
77
|
* add a new ngUpdate function
|
|
83
|
-
*
|
|
84
78
|
* @param options
|
|
85
79
|
*/
|
|
86
80
|
exports.ngAddCreate = (0, schematics_2.createSchematicWithMetricsIfInstalled)(ngAddCreateFn);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add-create/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add-create/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,gCAAiC,SAAQ,qBAAqB;IAC7E,mBAAmB;IACnB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE1B,iDAAiD;IACjD,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAE3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-update/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-update/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,IAAI,EAGL,MAAM,4BAA4B,CAAC;AA0BpC;;GAEG;AAEH,eAAO,MAAM,UAAU,4BAAsD,CAAC;AAkB9E;;GAEG;AAEH,eAAO,MAAM,WAAW,4BAAuD,CAAC"}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
3
|
-
/* eslint-disable camelcase */
|
|
4
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
3
|
exports.updateV10_0 = exports.updateV8_2 = void 0;
|
|
6
4
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
7
5
|
const schematics_2 = require("@o3r/schematics");
|
|
8
|
-
const import_map_1 = require("./v8.2/import-map");
|
|
9
6
|
const configuration_1 = require("./v10.0/configuration");
|
|
7
|
+
const import_map_1 = require("./v8.2/import-map");
|
|
10
8
|
/**
|
|
11
9
|
* Update of Otter library V8.2
|
|
12
10
|
*/
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- version is in the function name
|
|
13
12
|
function updateV8_2Fn() {
|
|
14
13
|
return (tree, context) => {
|
|
15
14
|
const updateRules = [
|
|
@@ -21,10 +20,12 @@ function updateV8_2Fn() {
|
|
|
21
20
|
/**
|
|
22
21
|
* Update of Otter library V8.2
|
|
23
22
|
*/
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- version is in the function name
|
|
24
24
|
exports.updateV8_2 = (0, schematics_2.createSchematicWithMetricsIfInstalled)(updateV8_2Fn);
|
|
25
25
|
/**
|
|
26
26
|
* Update of Otter library V10.0
|
|
27
27
|
*/
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- version is in the function name
|
|
28
29
|
function updateV10_0Fn() {
|
|
29
30
|
return (tree, context) => {
|
|
30
31
|
const updateRules = [
|
|
@@ -38,5 +39,6 @@ function updateV10_0Fn() {
|
|
|
38
39
|
/**
|
|
39
40
|
* Update of Otter library V10.0
|
|
40
41
|
*/
|
|
42
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- version is in the function name
|
|
41
43
|
exports.updateV10_0 = (0, schematics_2.createSchematicWithMetricsIfInstalled)(updateV10_0Fn);
|
|
42
44
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../../schematics/ng-update/v10.0/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../../schematics/ng-update/v10.0/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EAEL,MAAM,4BAA4B,CAAC;AAOpC;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,EAAE,IAYjC,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.updateConfiguration = void 0;
|
|
4
4
|
const schematics_1 = require("@o3r/schematics");
|
|
5
|
-
const matchingRegex = /(Configuration)<\s*['
|
|
5
|
+
const matchingRegex = /(Configuration)<\s*["'](?:strict|legacy)["']\s*>/g;
|
|
6
6
|
/**
|
|
7
7
|
* Rule to update the configuration declaration
|
|
8
8
|
* As configuration cannot be legacy anymore,
|
|
@@ -14,7 +14,7 @@ const updateConfiguration = (tree) => {
|
|
|
14
14
|
files.forEach((file) => {
|
|
15
15
|
const text = tree.readText(file);
|
|
16
16
|
const matches = Array.from(text.matchAll(matchingRegex));
|
|
17
|
-
if (matches.length) {
|
|
17
|
+
if (matches.length > 0) {
|
|
18
18
|
tree.overwrite(file, text.replaceAll(matchingRegex, '$1'));
|
|
19
19
|
}
|
|
20
20
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import-map.d.ts","sourceRoot":"","sources":["../../../../schematics/ng-update/v8.2/import-map.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"import-map.d.ts","sourceRoot":"","sources":["../../../../schematics/ng-update/v8.2/import-map.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACf,MAAM,iBAAiB,CAAC;AAEzB,oFAAoF;AACpF,eAAO,MAAM,mBAAmB,EAAE,cAoCjC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/page/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/page/index.ts"],"names":[],"mappings":"AAIA,OAAO,EASL,IAAI,EAML,MAAM,4BAA4B,CAAC;AA0BpC,OAAO,EACL,8BAA8B,EAC/B,MAAM,UAAU,CAAC;AAsOlB;;;GAGG;AACH,eAAO,MAAM,cAAc,mDAA0D,CAAC"}
|
package/schematics/page/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ngGeneratePage = void 0;
|
|
4
|
+
const path = require("node:path");
|
|
4
5
|
const core_1 = require("@angular-devkit/core");
|
|
5
6
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
6
7
|
const schematics_2 = require("@o3r/schematics");
|
|
7
|
-
const path = require("node:path");
|
|
8
8
|
const ts = require("typescript");
|
|
9
9
|
const configuration_1 = require("../rule-factories/component/configuration");
|
|
10
|
-
const theming_1 = require("../rule-factories/component/theming");
|
|
11
|
-
const localization_1 = require("../rule-factories/component/localization");
|
|
12
10
|
const fixture_1 = require("../rule-factories/component/fixture");
|
|
11
|
+
const localization_1 = require("../rule-factories/component/localization");
|
|
12
|
+
const theming_1 = require("../rule-factories/component/theming");
|
|
13
13
|
/**
|
|
14
14
|
* Add a Page to an Otter project
|
|
15
15
|
* @param options
|
|
@@ -77,12 +77,14 @@ function ngGeneratePageFn(options) {
|
|
|
77
77
|
type: 'Component',
|
|
78
78
|
skipSelector: false,
|
|
79
79
|
standalone: options.standalone,
|
|
80
|
-
...(options.standalone
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
80
|
+
...(options.standalone
|
|
81
|
+
? {
|
|
82
|
+
skipImport: true
|
|
83
|
+
}
|
|
84
|
+
: {
|
|
85
|
+
module: `${dasherizedPageName}.module.ts`,
|
|
86
|
+
export: true
|
|
87
|
+
}),
|
|
86
88
|
flat: true
|
|
87
89
|
}),
|
|
88
90
|
// Angular schematics generate spec file with this pattern: component-name.component.spec.ts
|
|
@@ -106,8 +108,7 @@ function ngGeneratePageFn(options) {
|
|
|
106
108
|
path: componentPath,
|
|
107
109
|
skipLinter: options.skipLinter,
|
|
108
110
|
componentType: 'Page'
|
|
109
|
-
}))
|
|
110
|
-
rules.push((0, schematics_1.mergeWith)((0, schematics_1.apply)((0, schematics_1.url)('./templates'), [
|
|
111
|
+
}), (0, schematics_1.mergeWith)((0, schematics_1.apply)((0, schematics_1.url)('./templates'), [
|
|
111
112
|
(0, schematics_1.template)({
|
|
112
113
|
...core_1.strings,
|
|
113
114
|
...options,
|
|
@@ -115,8 +116,7 @@ function ngGeneratePageFn(options) {
|
|
|
115
116
|
}),
|
|
116
117
|
(0, schematics_1.renameTemplateFiles)(),
|
|
117
118
|
(0, schematics_1.move)(pagePath)
|
|
118
|
-
]), schematics_1.MergeStrategy.Overwrite))
|
|
119
|
-
rules.push((0, configuration_1.getAddConfigurationRules)(componentPath, options), (0, theming_1.getAddThemingRules)(o3rStylePath, options), (0, localization_1.getAddLocalizationRules)(componentPath, options), (0, fixture_1.getAddFixtureRules)(componentPath, {
|
|
119
|
+
]), schematics_1.MergeStrategy.Overwrite), (0, configuration_1.getAddConfigurationRules)(componentPath, options), (0, theming_1.getAddThemingRules)(o3rStylePath, options), (0, localization_1.getAddLocalizationRules)(componentPath, options), (0, fixture_1.getAddFixtureRules)(componentPath, {
|
|
120
120
|
skipLinter: options.skipLinter,
|
|
121
121
|
useComponentFixtures: options.usePageFixtures
|
|
122
122
|
}, true));
|
|
@@ -131,7 +131,7 @@ function ngGeneratePageFn(options) {
|
|
|
131
131
|
const indexFilePath = path.posix.join(core_1.strings.dasherize(options.scope), core_1.strings.dasherize(options.name), 'index');
|
|
132
132
|
const route = {
|
|
133
133
|
path: core_1.strings.dasherize(options.name),
|
|
134
|
-
import: `./${indexFilePath.replace(/[
|
|
134
|
+
import: `./${indexFilePath.replace(/[/\\]/g, '/')}`,
|
|
135
135
|
module: `${pageName}${options.standalone ? 'Component' : 'Module'}`
|
|
136
136
|
};
|
|
137
137
|
if (options.appRoutingModulePath) {
|
|
@@ -140,7 +140,7 @@ function ngGeneratePageFn(options) {
|
|
|
140
140
|
const appModuleFilePath = (0, schematics_2.getAppModuleFilePath)(tree, context, options.projectName);
|
|
141
141
|
if (appModuleFilePath) {
|
|
142
142
|
const text = tree.readText(appModuleFilePath);
|
|
143
|
-
const match = text.match(/(provideRouter|RouterModule\.forRoot)\((\s*)?(?<routeVarName>[
|
|
143
|
+
const match = text.match(/(provideRouter|RouterModule\.forRoot)\((\s*)?(?<routeVarName>[^\s),]*)/);
|
|
144
144
|
const routeVariableName = match?.groups?.routeVarName;
|
|
145
145
|
if (routeVariableName) {
|
|
146
146
|
const sourceFile = ts.createSourceFile(appModuleFilePath, text, ts.ScriptTarget.ES2015, true);
|
|
@@ -149,7 +149,7 @@ function ngGeneratePageFn(options) {
|
|
|
149
149
|
&& ts.isStringLiteral(statement.moduleSpecifier)
|
|
150
150
|
&& !!statement.importClause?.namedBindings
|
|
151
151
|
&& ts.isNamedImports(statement.importClause.namedBindings)
|
|
152
|
-
&& statement.importClause.namedBindings.elements.some((element) => element.name.escapedText === routeVariableName));
|
|
152
|
+
&& statement.importClause.namedBindings.elements.some((element) => element.name.escapedText.toString() === routeVariableName));
|
|
153
153
|
const importRouteVariablePath = importStatement?.moduleSpecifier?.text;
|
|
154
154
|
// If importRouteVariablePath is undefined it is because the variable is defined in this file
|
|
155
155
|
const appRoutingModulePath = importRouteVariablePath ? path.join(path.dirname(appModuleFilePath), `${importRouteVariablePath}.ts`) : appModuleFilePath;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/page/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/page/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,8BAA+B,SAAQ,qBAAqB;IAC3E,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjC,gBAAgB;IAChB,IAAI,EAAE,MAAM,CAAC;IAEb,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAC;IAEd,sCAAsC;IACtC,oBAAoB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE1C,sBAAsB;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE5B,qCAAqC;IACrC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE1B,8BAA8B;IAC9B,UAAU,EAAE,OAAO,CAAC;IAEpB,kEAAkE;IAClE,eAAe,EAAE,OAAO,CAAC;IAEzB,2DAA2D;IAC3D,cAAc,EAAE,OAAO,CAAC;IAExB,oDAAoD;IACpD,eAAe,EAAE,OAAO,CAAC;IAEzB,oDAAoD;IACpD,UAAU,EAAE,OAAO,CAAC;IAEpB,uCAAuC;IACvC,eAAe,EAAE,OAAO,CAAC;IAEzB,4BAA4B;IAC5B,aAAa,EAAE,OAAO,CAAC;CACxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/renovate/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/renovate/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAKL,IAAI,EAKL,MAAM,4BAA4B,CAAC;AAIpC,OAAO,EACL,qCAAqC,EACtC,MAAM,UAAU,CAAC;AAyBlB;;;GAGG;AACH,eAAO,MAAM,8BAA8B,0DAA0E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/renovate/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/renovate/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,qCAAsC,SAAQ,qBAAqB;IAClF,+DAA+D;IAC/D,gBAAgB,EAAE,MAAM,CAAC;CAC1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/additional-modules/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/additional-modules/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,IAAI,EAGL,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAIL,KAAK,wBAAwB,EAC9B,MAAM,iBAAiB,CAAC;AAuBzB;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,EAAE,uBAAuB,EAAE,wBAAwB,GAAG,IAAI,CA4MrL"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.updateAdditionalModules = updateAdditionalModules;
|
|
4
|
+
const fs = require("node:fs");
|
|
5
|
+
const path = require("node:path");
|
|
4
6
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
7
|
const schematics_2 = require("@o3r/schematics");
|
|
6
|
-
const ts = require("typescript");
|
|
7
8
|
const utility_1 = require("@schematics/angular/utility");
|
|
8
9
|
const ast_utils_1 = require("@schematics/angular/utility/ast-utils");
|
|
9
10
|
const change_1 = require("@schematics/angular/utility/change");
|
|
10
|
-
const path = require("node:path");
|
|
11
|
-
const fs = require("node:fs");
|
|
12
11
|
const dependencies_1 = require("@schematics/angular/utility/dependencies");
|
|
12
|
+
const ts = require("typescript");
|
|
13
13
|
const packageJsonPath = path.resolve(__dirname, '..', '..', '..', 'package.json');
|
|
14
14
|
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, { encoding: 'utf8' }));
|
|
15
15
|
const ngrxStoreDevtoolsDep = '@ngrx/store-devtools';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/component/analytics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/component/analytics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EACL,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,mCAAmC,EACpC,MAAM,wBAAwB,CAAC;AAKhC,eAAO,MAAM,oBAAoB,kBAChB,MAAM,WACZ,mCAAmC,KAC3C,IAaF,CAAC"}
|
|
@@ -2,7 +2,6 @@ import { Rule } from '@angular-devkit/schematics';
|
|
|
2
2
|
/**
|
|
3
3
|
* Ask questions to get rules to execute
|
|
4
4
|
* or throw if the package is not installed
|
|
5
|
-
*
|
|
6
5
|
* @param path file path
|
|
7
6
|
* @param optionName name of the option to setup
|
|
8
7
|
* @param defaultApplyRule should the rule be applied by default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/component/common.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/component/common.ts"],"names":[],"mappings":"AAIA,OAAO,EAIL,IAAI,EAIL,MAAM,4BAA4B,CAAC;AAUpC;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,kDAAkD,SACvD,MAAM,cACA,MAAM,oBACA,OAAO,GAAG,IAAI,GAAG,SAAS,gBAC9B,MAAM,0BACI,MAAM,EAAE,eACnB,MAAM,iBACJ,MAAM,qBACH,GAAG,KACpB,IAiEF,CAAC"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.askQuestionsToGetRulesOrThrowIfPackageNotAvailable = void 0;
|
|
4
|
-
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
4
|
const prompt_1 = require("@angular/cli/src/utilities/prompt");
|
|
5
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
6
6
|
const schematics_2 = require("@o3r/schematics");
|
|
7
7
|
/**
|
|
8
8
|
* Ask questions to get rules to execute
|
|
9
9
|
* or throw if the package is not installed
|
|
10
|
-
*
|
|
11
10
|
* @param path file path
|
|
12
11
|
* @param optionName name of the option to setup
|
|
13
12
|
* @param defaultApplyRule should the rule be applied by default
|
|
@@ -61,19 +60,23 @@ const askQuestionsToGetRulesOrThrowIfPackageNotAvailable = (path, optionName, de
|
|
|
61
60
|
...schematicOptions,
|
|
62
61
|
path
|
|
63
62
|
};
|
|
64
|
-
return applyRule
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
63
|
+
return applyRule
|
|
64
|
+
? (0, schematics_1.chain)([
|
|
65
|
+
packageName === '@o3r/core'
|
|
66
|
+
? (0, schematics_1.schematic)(schematicName, options)
|
|
67
|
+
: (0, schematics_1.externalSchematic)(packageName, schematicName, options),
|
|
68
|
+
...(alwaysApplyRule === 'ask-again'
|
|
69
|
+
? []
|
|
70
|
+
: [
|
|
71
|
+
(0, schematics_2.setupSchematicsParamsForProject)(schematicsNameToUpdate.reduce((acc, schematicToUpdateName) => {
|
|
72
|
+
acc[schematicToUpdateName] = {
|
|
73
|
+
[optionName]: alwaysApplyRule === 'yes'
|
|
74
|
+
};
|
|
75
|
+
return acc;
|
|
76
|
+
}, {}), options.projectName)
|
|
77
|
+
])
|
|
78
|
+
])
|
|
79
|
+
: schematics_1.noop;
|
|
77
80
|
};
|
|
78
81
|
};
|
|
79
82
|
exports.askQuestionsToGetRulesOrThrowIfPackageNotAvailable = askQuestionsToGetRulesOrThrowIfPackageNotAvailable;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/component/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/component/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EACL,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,mCAAmC,EACpC,MAAM,wBAAwB,CAAC;AAKhC,eAAO,MAAM,wBAAwB,kBACpB,MAAM,WACZ,IAAI,CAAC,mCAAmC,EAAE,gBAAgB,GAAG,YAAY,GAAG,aAAa,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,mCAAmC,EAAE,oBAAoB,CAAC,CAAC,KAC7K,IAcF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/component/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/component/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EACL,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,mCAAmC,EACpC,MAAM,wBAAwB,CAAC;AAKhC,eAAO,MAAM,kBAAkB,kBACd,MAAM,WACZ,IAAI,CAAC,mCAAmC,EAAE,YAAY,GAAG,YAAY,CAAC,KAC9E,IAYF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"design-token.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/component/design-token.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"design-token.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/component/design-token.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EACL,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,mCAAmC,EACpC,MAAM,wBAAwB,CAAC;AAKhC,eAAO,MAAM,sBAAsB,oBAChB,MAAM,aACZ,MAAM,WACR,IAAI,CAAC,mCAAmC,EAAE,qBAAqB,CAAC,KACxE,IAYF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixture.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/component/fixture.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"fixture.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/component/fixture.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EACL,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,mCAAmC,EACpC,MAAM,wBAAwB,CAAC;AAKhC,eAAO,MAAM,kBAAkB,kBACd,MAAM,WACZ,IAAI,CAAC,mCAAmC,EAAE,sBAAsB,GAAG,YAAY,CAAC,uBAExF,IAaF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localization.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/component/localization.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"localization.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/component/localization.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EACL,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,mCAAmC,EACpC,MAAM,wBAAwB,CAAC;AAKhC,eAAO,MAAM,uBAAuB,kBACnB,MAAM,WACZ,IAAI,CAAC,mCAAmC,EAAE,iBAAiB,GAAG,YAAY,GAAG,eAAe,CAAC,KACrG,IAaF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rules-engine.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/component/rules-engine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"rules-engine.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/component/rules-engine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EACL,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,mCAAmC,EACpC,MAAM,wBAAwB,CAAC;AAKhC,eAAO,MAAM,sBAAsB,kBAClB,MAAM,WACZ,IAAI,CAAC,mCAAmC,EAAE,gBAAgB,GAAG,YAAY,GAAG,aAAa,GAAG,oBAAoB,CAAC,KACzH,IAaF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theming.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/component/theming.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"theming.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/component/theming.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EACL,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,mCAAmC,EACpC,MAAM,wBAAwB,CAAC;AAKhC,eAAO,MAAM,kBAAkB,cAClB,MAAM,WACR,IAAI,CAAC,mCAAmC,EAAE,iBAAiB,CAAC,KACpE,IAQF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/customization-environment/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/customization-environment/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAOL,IAAI,EAML,MAAM,4BAA4B,CAAC;AAoBpC;;;;;;;GAOG;AACH,wBAAgB,8BAA8B,CAAC,QAAQ,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,EAAE,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,CAoGnK"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.updateCustomizationEnvironment = updateCustomizationEnvironment;
|
|
4
|
+
const node_path_1 = require("node:path");
|
|
4
5
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
6
|
const schematics_2 = require("@o3r/schematics");
|
|
6
7
|
const utility_1 = require("@schematics/angular/utility");
|
|
7
8
|
const ast_utils_1 = require("@schematics/angular/utility/ast-utils");
|
|
8
9
|
const dependencies_1 = require("@schematics/angular/utility/dependencies");
|
|
9
|
-
const node_path_1 = require("node:path");
|
|
10
10
|
/**
|
|
11
11
|
* Enable customization capabilities
|
|
12
12
|
* @param rootPath @see RuleFactory.rootPath
|
|
@@ -22,7 +22,7 @@ function updateCustomizationEnvironment(rootPath, o3rCoreVersion, options, isLib
|
|
|
22
22
|
* @param context
|
|
23
23
|
*/
|
|
24
24
|
const generateC11nFolder = (tree, context) => {
|
|
25
|
-
const workingDirectory = options?.projectName && (0, schematics_2.getWorkspaceConfig)(tree)?.projects[options.projectName]?.root || '.';
|
|
25
|
+
const workingDirectory = (options?.projectName && (0, schematics_2.getWorkspaceConfig)(tree)?.projects[options.projectName]?.root) || '.';
|
|
26
26
|
if (tree.exists(node_path_1.posix.join(workingDirectory, 'src', 'customization', 'presenters-map.empty.ts'))) {
|
|
27
27
|
return tree;
|
|
28
28
|
}
|
|
@@ -48,7 +48,7 @@ function updateCustomizationEnvironment(rootPath, o3rCoreVersion, options, isLib
|
|
|
48
48
|
if ((0, ast_utils_1.isImported)(fileInfo.sourceFile, 'C11nModule', '@otter/common') || (0, ast_utils_1.isImported)(fileInfo.sourceFile, 'C11nModule', '@o3r/components')) {
|
|
49
49
|
return tree;
|
|
50
50
|
}
|
|
51
|
-
const fileContent = tree.readText(fileInfo.moduleFilePath).replace(
|
|
51
|
+
const fileContent = tree.readText(fileInfo.moduleFilePath).replace(/\s*/g, '');
|
|
52
52
|
const recorder = tree.beginUpdate(fileInfo.moduleFilePath);
|
|
53
53
|
const moduleIndex = fileInfo.moduleIndex;
|
|
54
54
|
/**
|
|
@@ -70,9 +70,7 @@ function updateCustomizationEnvironment(rootPath, o3rCoreVersion, options, isLib
|
|
|
70
70
|
updatedRecorder = insertImportToModuleFile(updatedRecorder, 'registerCustomComponents', '../customization/presenters-map.empty');
|
|
71
71
|
updatedRecorder = insertImportToModuleFile(updatedRecorder, 'Provider', '@angular/core');
|
|
72
72
|
updatedRecorder = insertImportToModuleFile(updatedRecorder, 'initializeCustomProviders', '../customization/custom-providers.empty');
|
|
73
|
-
additionalRules.push((0, utility_1.addRootImport)(options?.projectName, ({ code }) => code `...entry.customComponentsModules`));
|
|
74
|
-
additionalRules.push((0, utility_1.addRootProvider)(options?.projectName, ({ code }) => code `...customProviders`));
|
|
75
|
-
additionalRules.push((0, utility_1.addRootImport)(options?.projectName, ({ code }) => code `C11nModule.forRoot({registerCompFunc: registerCustomComponents})`));
|
|
73
|
+
additionalRules.push((0, utility_1.addRootImport)(options?.projectName, ({ code }) => code `...entry.customComponentsModules`), (0, utility_1.addRootProvider)(options?.projectName, ({ code }) => code `...customProviders`), (0, utility_1.addRootImport)(options?.projectName, ({ code }) => code `C11nModule.forRoot({registerCompFunc: registerCustomComponents})`));
|
|
76
74
|
updatedRecorder = insertImportToModuleFile(updatedRecorder, 'C11nModule', '@o3r/components');
|
|
77
75
|
updatedRecorder = insertBeforeModule(updatedRecorder, 'const entry = initializeEntryComponents();');
|
|
78
76
|
updatedRecorder = insertBeforeModule(updatedRecorder, 'const customProviders: Provider[] = initializeCustomProviders();');
|
|
@@ -80,7 +78,7 @@ function updateCustomizationEnvironment(rootPath, o3rCoreVersion, options, isLib
|
|
|
80
78
|
return (0, schematics_1.chain)(additionalRules)(tree, context);
|
|
81
79
|
};
|
|
82
80
|
return (tree, _context) => {
|
|
83
|
-
const workingDirectory = options?.projectName && (0, schematics_2.getWorkspaceConfig)(tree)?.projects[options.projectName]?.root || '.';
|
|
81
|
+
const workingDirectory = (options?.projectName && (0, schematics_2.getWorkspaceConfig)(tree)?.projects[options.projectName]?.root) || '.';
|
|
84
82
|
return (0, schematics_1.chain)([
|
|
85
83
|
generateC11nFolder,
|
|
86
84
|
registerModules,
|