@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,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ngAddModules = 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
|
const presets_1 = require("../shared/presets");
|
|
8
8
|
/**
|
|
@@ -19,7 +19,7 @@ function ngAddModulesFn(options) {
|
|
|
19
19
|
const presetRunner = preset ? await presets_1.presets[preset]({ forwardOptions }) : undefined;
|
|
20
20
|
const externalPresetRunner = externalPresets ? await (0, presets_1.getExternalPreset)(externalPresets, tree, context)?.({ projectName: forwardOptions.projectName, forwardOptions }) : undefined;
|
|
21
21
|
const mods = [...new Set([...(presetRunner?.modules || []), ...(externalPresetRunner?.modules || [])])];
|
|
22
|
-
if (mods.length) {
|
|
22
|
+
if (mods.length > 0) {
|
|
23
23
|
context.logger.info(`The following modules will be installed: ${mods.join(', ')}`);
|
|
24
24
|
if (context.interactive && !await (0, prompt_1.askConfirmation)('Would you like to process to the setup of these modules?', true)) {
|
|
25
25
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/add-modules/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/add-modules/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACV,WAAW,EACZ,MAAM,kBAAkB,CAAC;AAE1B,MAAM,WAAW,4BAA6B,SAAQ,qBAAqB;IACzE,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjC,oDAAoD;IACpD,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IAEjC,kEAAkE;IAClE,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/component/container/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/component/container/index.ts"],"names":[],"mappings":"AACA,OAAO,EASL,IAAI,EAML,MAAM,4BAA4B,CAAC;AA2CpC,OAAO,EACL,4CAA4C,EAC7C,MAAM,UAAU,CAAC;AAElB,eAAO,MAAM,gBAAgB,cAAc,CAAC;AAkQ5C;;;GAGG;AACH,eAAO,MAAM,4BAA4B,iEAAwE,CAAC"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ngGenerateComponentContainer = exports.CONTAINER_FOLDER = void 0;
|
|
4
|
+
const path = require("node:path");
|
|
4
5
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
6
|
const schematics_2 = require("@o3r/schematics");
|
|
6
7
|
const ast_utils_1 = require("@schematics/angular/utility/ast-utils");
|
|
7
8
|
const change_1 = require("@schematics/angular/utility/change");
|
|
8
|
-
const path = require("node:path");
|
|
9
9
|
const ts = require("typescript");
|
|
10
10
|
const configuration_1 = require("../../rule-factories/component/configuration");
|
|
11
|
-
const rules_engine_1 = require("../../rule-factories/component/rules-engine");
|
|
12
|
-
const fixture_1 = require("../../rule-factories/component/fixture");
|
|
13
11
|
const context_1 = require("../../rule-factories/component/context");
|
|
12
|
+
const fixture_1 = require("../../rule-factories/component/fixture");
|
|
13
|
+
const rules_engine_1 = require("../../rule-factories/component/rules-engine");
|
|
14
14
|
const presenter_1 = require("../presenter");
|
|
15
15
|
const structures_types_1 = require("../structures.types");
|
|
16
16
|
exports.CONTAINER_FOLDER = 'container';
|
|
@@ -46,7 +46,7 @@ function ngGenerateComponentContainerFn(options) {
|
|
|
46
46
|
const fullStructureRequested = options.componentStructure === 'full';
|
|
47
47
|
const generateFiles = (tree, context) => {
|
|
48
48
|
const workspaceProject = options.projectName ? (0, schematics_2.getWorkspaceConfig)(tree)?.projects[options.projectName] : undefined;
|
|
49
|
-
const properties = getTemplateProperties(options, structures_types_1.ComponentStructureDef.Cont, options.prefix
|
|
49
|
+
const properties = getTemplateProperties(options, structures_types_1.ComponentStructureDef.Cont, options.prefix || workspaceProject?.prefix);
|
|
50
50
|
const destination = (0, schematics_2.getDestinationPath)('@o3r/core:component', options.path, tree, options.projectName);
|
|
51
51
|
const componentDestination = path.posix.join(destination, fullStructureRequested ? path.posix.join(properties.folderName, exports.CONTAINER_FOLDER) : properties.folderName);
|
|
52
52
|
const componentPath = path.posix.join(componentDestination, `${properties.name}.component.ts`);
|
|
@@ -81,12 +81,14 @@ function ngGenerateComponentContainerFn(options) {
|
|
|
81
81
|
skipSelector: false,
|
|
82
82
|
skipTests: false,
|
|
83
83
|
standalone: options.standalone,
|
|
84
|
-
...(options.standalone
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
84
|
+
...(options.standalone
|
|
85
|
+
? {
|
|
86
|
+
skipImport: true
|
|
87
|
+
}
|
|
88
|
+
: {
|
|
89
|
+
module: `${properties.name}.module.ts`,
|
|
90
|
+
export: true
|
|
91
|
+
}),
|
|
90
92
|
flat: true
|
|
91
93
|
}),
|
|
92
94
|
// Angular schematics generate spec file with this pattern: component-name.component.spec.ts
|
|
@@ -180,7 +182,7 @@ class Mock${properties.presenterComponentName} {}
|
|
|
180
182
|
};
|
|
181
183
|
return (0, schematics_1.chain)([
|
|
182
184
|
generateFiles,
|
|
183
|
-
|
|
185
|
+
fullStructureRequested ? (0, schematics_1.noop)() : (options.skipLinter ? (0, schematics_1.noop)() : (0, schematics_2.applyEsLintFix)())
|
|
184
186
|
]);
|
|
185
187
|
}
|
|
186
188
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../schematics/component/container/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../schematics/component/container/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,4CAA6C,SAAQ,qBAAqB;IACzF,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjC,wCAAwC;IACxC,aAAa,EAAE,MAAM,CAAC;IAEtB,sBAAsB;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE5B,0BAA0B;IAC1B,kBAAkB,EAAE,MAAM,GAAG,WAAW,CAAC;IAEzC,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjC,uBAAuB;IACvB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE1B,0DAA0D;IAC1D,oBAAoB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAE3C,gEAAgE;IAChE,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAErC,6DAA6D;IAC7D,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAEjC,yDAAyD;IACzD,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAErC,8BAA8B;IAC9B,UAAU,EAAE,OAAO,CAAC;IAEpB,oDAAoD;IACpD,UAAU,EAAE,OAAO,CAAC;CACrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/component/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/component/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAOL,IAAI,EAML,MAAM,4BAA4B,CAAC;AAUpC,OAAO,EACL,mCAAmC,EACpC,MAAM,UAAU,CAAC;AA+GlB;;;GAGG;AACH,eAAO,MAAM,mBAAmB,wDAA+D,CAAC"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ngGenerateComponent = 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
|
/**
|
|
9
9
|
* Execute component container schematic with provided options
|
|
10
|
-
*
|
|
11
10
|
* @param options
|
|
12
11
|
*/
|
|
13
12
|
function generateComponentContainer(options) {
|
|
@@ -21,7 +20,6 @@ function generateComponentContainer(options) {
|
|
|
21
20
|
}
|
|
22
21
|
/**
|
|
23
22
|
* Execute component presenter schematic with provided options
|
|
24
|
-
*
|
|
25
23
|
* @param options
|
|
26
24
|
*/
|
|
27
25
|
function generateComponentPresenter(options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/component/presenter/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/component/presenter/index.ts"],"names":[],"mappings":"AACA,OAAO,EASL,IAAI,EAML,MAAM,4BAA4B,CAAC;AAkCpC,OAAO,EACL,mCAAmC,EACpC,MAAM,WAAW,CAAC;AAKnB,eAAO,MAAM,gBAAgB,cAAc,CAAC;AAgL5C;;;GAGG;AACH,eAAO,MAAM,4BAA4B,wDAAwE,CAAC"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ngGenerateComponentPresenter = exports.PRESENTER_FOLDER = void 0;
|
|
4
|
+
const path = require("node:path");
|
|
4
5
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
6
|
const schematics_2 = require("@o3r/schematics");
|
|
6
|
-
const path = require("node:path");
|
|
7
7
|
const analytics_1 = require("../../rule-factories/component/analytics");
|
|
8
8
|
const configuration_1 = require("../../rule-factories/component/configuration");
|
|
9
9
|
const context_1 = require("../../rule-factories/component/context");
|
|
10
|
+
const design_token_1 = require("../../rule-factories/component/design-token");
|
|
10
11
|
const fixture_1 = require("../../rule-factories/component/fixture");
|
|
11
12
|
const localization_1 = require("../../rule-factories/component/localization");
|
|
12
13
|
const theming_1 = require("../../rule-factories/component/theming");
|
|
13
|
-
const design_token_1 = require("../../rule-factories/component/design-token");
|
|
14
14
|
const structures_types_1 = require("../structures.types");
|
|
15
15
|
exports.PRESENTER_FOLDER = 'presenter';
|
|
16
16
|
/**
|
|
@@ -22,7 +22,7 @@ exports.PRESENTER_FOLDER = 'presenter';
|
|
|
22
22
|
const getTemplateProperties = (options, componentStructureDef, prefix) => {
|
|
23
23
|
const inputComponentName = (0, schematics_2.getInputComponentName)(options.componentName);
|
|
24
24
|
const folderName = (0, schematics_2.getComponentFolderName)(inputComponentName);
|
|
25
|
-
const structure = componentStructureDef
|
|
25
|
+
const structure = componentStructureDef === structures_types_1.ComponentStructureDef.Simple ? '' : componentStructureDef;
|
|
26
26
|
return {
|
|
27
27
|
...options,
|
|
28
28
|
componentName: (0, schematics_2.getComponentName)(inputComponentName, structure).replace(/Component$/, ''),
|
|
@@ -80,12 +80,14 @@ function ngGenerateComponentPresenterFn(options) {
|
|
|
80
80
|
type: 'Component',
|
|
81
81
|
skipSelector: false,
|
|
82
82
|
standalone: options.standalone,
|
|
83
|
-
...(options.standalone
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
83
|
+
...(options.standalone
|
|
84
|
+
? {
|
|
85
|
+
skipImport: true
|
|
86
|
+
}
|
|
87
|
+
: {
|
|
88
|
+
module: `${properties.name}.module.ts`,
|
|
89
|
+
export: true
|
|
90
|
+
}),
|
|
89
91
|
flat: true
|
|
90
92
|
}),
|
|
91
93
|
// Angular schematics generate spec file with this pattern: component-name.component.spec.ts
|
|
@@ -113,13 +115,12 @@ function ngGenerateComponentPresenterFn(options) {
|
|
|
113
115
|
]), (0, schematics_1.schematic)('convert-component', {
|
|
114
116
|
path: componentPath,
|
|
115
117
|
skipLinter: options.skipLinter
|
|
116
|
-
}));
|
|
117
|
-
rules.push((0, configuration_1.getAddConfigurationRules)(componentPath, options), (0, theming_1.getAddThemingRules)(o3rStylePath, options), (0, design_token_1.getAddDesignTokenRules)(o3rStylePath, o3rDesignTokenPath, options), (0, localization_1.getAddLocalizationRules)(componentPath, options), (0, fixture_1.getAddFixtureRules)(componentPath, options), (0, analytics_1.getAddAnalyticsRules)(componentPath, options), (0, context_1.getAddContextRules)(componentPath, options));
|
|
118
|
+
}), (0, configuration_1.getAddConfigurationRules)(componentPath, options), (0, theming_1.getAddThemingRules)(o3rStylePath, options), (0, design_token_1.getAddDesignTokenRules)(o3rStylePath, o3rDesignTokenPath, options), (0, localization_1.getAddLocalizationRules)(componentPath, options), (0, fixture_1.getAddFixtureRules)(componentPath, options), (0, analytics_1.getAddAnalyticsRules)(componentPath, options), (0, context_1.getAddContextRules)(componentPath, options));
|
|
118
119
|
return (0, schematics_1.chain)(rules);
|
|
119
120
|
};
|
|
120
121
|
return (0, schematics_1.chain)([
|
|
121
122
|
generateFiles,
|
|
122
|
-
|
|
123
|
+
fullStructureRequested ? (0, schematics_1.noop)() : (options.skipLinter ? (0, schematics_1.noop)() : (0, schematics_2.applyEsLintFix)())
|
|
123
124
|
]);
|
|
124
125
|
}
|
|
125
126
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../schematics/component/presenter/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../schematics/component/presenter/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACV,kBAAkB,EACnB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,WAAW,4CAA6C,SAAQ,qBAAqB;IACzF,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjC,wCAAwC;IACxC,aAAa,EAAE,MAAM,CAAC;IAEtB,sBAAsB;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE5B,0BAA0B;IAC1B,kBAAkB,EAAE,kBAAkB,CAAC;IAEvC,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjC,uBAAuB;IACvB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE1B,0DAA0D;IAC1D,oBAAoB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAE3C,uEAAuE;IACvE,eAAe,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAEtC,gEAAgE;IAChE,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAErC,yEAAyE;IACzE,iBAAiB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAExC,yDAAyD;IACzD,eAAe,EAAE,OAAO,CAAC;IAEzB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAEjC,oDAAoD;IACpD,aAAa,EAAE,OAAO,CAAC;IAEvB,8BAA8B;IAC9B,UAAU,EAAE,OAAO,CAAC;IAEpB,oDAAoD;IACpD,UAAU,EAAE,OAAO,CAAC;CACrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/component/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/component/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACV,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,WAAW,mCAAoC,SAAQ,qBAAqB;IAChF,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjC,wCAAwC;IACxC,aAAa,EAAE,MAAM,CAAC;IAEtB,sBAAsB;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE5B,0BAA0B;IAC1B,kBAAkB,EAAE,kBAAkB,CAAC;IAEvC,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjC,uBAAuB;IACvB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE1B,0DAA0D;IAC1D,oBAAoB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAE3C,uEAAuE;IACvE,eAAe,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAEtC,wEAAwE;IACxE,mBAAmB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAE1C,gEAAgE;IAChE,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAErC,yDAAyD;IACzD,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAErC,yDAAyD;IACzD,eAAe,EAAE,OAAO,CAAC;IAEzB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAEjC,oDAAoD;IACpD,aAAa,EAAE,OAAO,CAAC;IAEvB,2DAA2D;IAC3D,iBAAiB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAExC,8BAA8B;IAC9B,UAAU,EAAE,OAAO,CAAC;IAEpB,oDAAoD;IACpD,UAAU,EAAE,OAAO,CAAC;CACrB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type ComponentStructure = 'full' | 'container' | 'presenter' | 'simple';
|
|
2
2
|
export declare enum ComponentStructureDef {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
Cont = "Cont",
|
|
4
|
+
Pres = "Pres",
|
|
5
|
+
Simple = "Simple"
|
|
6
6
|
}
|
|
7
7
|
//# sourceMappingURL=structures.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structures.types.d.ts","sourceRoot":"","sources":["../../../schematics/component/structures.types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"structures.types.d.ts","sourceRoot":"","sources":["../../../schematics/component/structures.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,WAAW,GAAG,WAAW,GAAG,QAAQ,CAAC;AAC/E,oBAAY,qBAAqB;IAE/B,IAAI,SAAS;IACb,IAAI,SAAS;IACb,MAAM,WAAW;CAElB"}
|
|
@@ -3,8 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ComponentStructureDef = void 0;
|
|
4
4
|
var ComponentStructureDef;
|
|
5
5
|
(function (ComponentStructureDef) {
|
|
6
|
+
/* eslint-disable @typescript-eslint/naming-convention -- cannot be changed without introducing breaking changes */
|
|
6
7
|
ComponentStructureDef["Cont"] = "Cont";
|
|
7
8
|
ComponentStructureDef["Pres"] = "Pres";
|
|
8
9
|
ComponentStructureDef["Simple"] = "Simple";
|
|
10
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
9
11
|
})(ComponentStructureDef || (exports.ComponentStructureDef = ComponentStructureDef = {}));
|
|
10
12
|
//# sourceMappingURL=structures.types.js.map
|
|
@@ -2,7 +2,6 @@ import { Rule } from '@angular-devkit/schematics';
|
|
|
2
2
|
import type { NgAddConfigSchematicsSchema } from './schema';
|
|
3
3
|
/**
|
|
4
4
|
* Add context to an existing component
|
|
5
|
-
*
|
|
6
5
|
* @param options
|
|
7
6
|
*/
|
|
8
7
|
export declare function ngAddContextFn(options: NgAddConfigSchematicsSchema): Rule;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/context-to-component/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/context-to-component/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAQL,IAAI,EAML,MAAM,4BAA4B,CAAC;AAapC,OAAO,KAAK,EACV,2BAA2B,EAC5B,MAAM,UAAU,CAAC;AAWlB;;;GAGG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,2BAA2B,GAAG,IAAI,CAsEzE;AAED,eAAO,MAAM,YAAY,gDAAwD,CAAC"}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ngAddContext = void 0;
|
|
4
4
|
exports.ngAddContextFn = ngAddContextFn;
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
5
6
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
6
7
|
const schematics_2 = require("@o3r/schematics");
|
|
7
|
-
const node_path_1 = require("node:path");
|
|
8
8
|
const ts = require("typescript");
|
|
9
9
|
const checkContext = (componentPath, tree) => {
|
|
10
10
|
const files = [
|
|
@@ -16,7 +16,6 @@ const checkContext = (componentPath, tree) => {
|
|
|
16
16
|
};
|
|
17
17
|
/**
|
|
18
18
|
* Add context to an existing component
|
|
19
|
-
*
|
|
20
19
|
* @param options
|
|
21
20
|
*/
|
|
22
21
|
function ngAddContextFn(options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/context-to-component/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/context-to-component/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,2BAA4B,SAAQ,qBAAqB;IACxE,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;IAEb,8BAA8B;IAC9B,UAAU,EAAE,OAAO,CAAC;CACrB"}
|
|
@@ -2,7 +2,6 @@ import { Rule } from '@angular-devkit/schematics';
|
|
|
2
2
|
import { ConvertToO3rComponentSchematicsSchema } from './schema';
|
|
3
3
|
/**
|
|
4
4
|
* Convert an Angular component into an Otter component
|
|
5
|
-
*
|
|
6
5
|
* @param options
|
|
7
6
|
*/
|
|
8
7
|
export declare const convertToO3rComponent: (options: ConvertToO3rComponentSchematicsSchema) => Rule;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/convert-component/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/convert-component/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,IAAI,EAEL,MAAM,4BAA4B,CAAC;AAgBpC,OAAO,EACL,qCAAqC,EACtC,MAAM,UAAU,CAAC;AAiDlB;;;GAGG;AACH,eAAO,MAAM,qBAAqB,0DAAiE,CAAC"}
|
|
@@ -8,7 +8,6 @@ const change_1 = require("@schematics/angular/utility/change");
|
|
|
8
8
|
const ts = require("typescript");
|
|
9
9
|
/**
|
|
10
10
|
* Convert an Angular component into an Otter component
|
|
11
|
-
*
|
|
12
11
|
* @param options
|
|
13
12
|
*/
|
|
14
13
|
function convertToO3rComponentFn(options) {
|
|
@@ -36,7 +35,6 @@ function convertToO3rComponentFn(options) {
|
|
|
36
35
|
}
|
|
37
36
|
/**
|
|
38
37
|
* Convert an Angular component into an Otter component
|
|
39
|
-
*
|
|
40
38
|
* @param options
|
|
41
39
|
*/
|
|
42
40
|
exports.convertToO3rComponent = (0, schematics_2.createSchematicWithMetricsIfInstalled)(convertToO3rComponentFn);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/convert-component/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/convert-component/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACV,aAAa,EACd,MAAM,WAAW,CAAC;AAEnB,MAAM,WAAW,qCAAsC,SAAQ,qBAAqB;IAClF,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IAEb,8BAA8B;IAC9B,UAAU,EAAE,OAAO,CAAC;IAEpB,4BAA4B;IAC5B,aAAa,EAAE,aAAa,CAAC;CAC9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/ng-add/component-decorator/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/ng-add/component-decorator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EAEL,MAAM,4BAA4B,CAAC;AA6BpC;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAE,IA8DvC,CAAC"}
|
|
@@ -9,7 +9,7 @@ const removeImport = (source, symbolName, fileName) => {
|
|
|
9
9
|
const importNode = source.statements.filter((statement) => ts.isImportDeclaration(statement)
|
|
10
10
|
&& ts.isStringLiteral(statement.moduleSpecifier)
|
|
11
11
|
&& statement.moduleSpecifier.text === fileName).map((statement) => statement.importClause?.namedBindings && ts.isNamedImports(statement.importClause.namedBindings)
|
|
12
|
-
? statement.importClause.namedBindings.elements.find((e) => e.name.escapedText === symbolName)
|
|
12
|
+
? statement.importClause.namedBindings.elements.find((e) => e.name.escapedText.toString() === symbolName)
|
|
13
13
|
: undefined).find((element) => !!element);
|
|
14
14
|
return importNode ? computeRemovePosition(importNode) : undefined;
|
|
15
15
|
};
|
|
@@ -37,7 +37,7 @@ const updateComponentDecorators = async (tree) => {
|
|
|
37
37
|
return text === 'Block' || text === 'Page';
|
|
38
38
|
});
|
|
39
39
|
const componentType = componentTypeNode?.expression?.getText() || 'Component';
|
|
40
|
-
if (!!componentTypeNode && componentType === 'Block' || componentType === 'Page' || componentType === 'ExposedComponent') {
|
|
40
|
+
if (!!componentTypeNode && (componentType === 'Block' || componentType === 'Page' || componentType === 'ExposedComponent')) {
|
|
41
41
|
recorder.remove(componentTypeNode.getFullStart(), componentTypeNode.end - componentTypeNode.getFullStart());
|
|
42
42
|
const removePos = removeImport(source, componentType, '@o3r/core');
|
|
43
43
|
if (removePos) {
|
|
@@ -49,7 +49,7 @@ const updateComponentDecorators = async (tree) => {
|
|
|
49
49
|
&& member.type
|
|
50
50
|
&& ts.isTypeReferenceNode(member.type)
|
|
51
51
|
&& ts.isIdentifier(member.type.typeName)
|
|
52
|
-
&& member.type.typeName.escapedText === 'ConfigurationObserver');
|
|
52
|
+
&& member.type.typeName.escapedText.toString() === 'ConfigurationObserver');
|
|
53
53
|
if (dynamicConfigObserver) {
|
|
54
54
|
const importConfigObserverChange = (0, ast_utils_1.insertImport)(source, filePath, 'ConfigObserver', '@o3r/configuration');
|
|
55
55
|
if (importConfigObserverChange instanceof change_1.InsertChange) {
|
|
@@ -62,7 +62,7 @@ const updateComponentDecorators = async (tree) => {
|
|
|
62
62
|
.reduce((acc, member) => acc.concat(ts.canHaveDecorators(member) ? ts.getDecorators(member) || [] : []), [])
|
|
63
63
|
.find((decorator) => ts.isCallExpression(decorator.expression)
|
|
64
64
|
&& ts.isIdentifier(decorator.expression.expression)
|
|
65
|
-
&& decorator.expression.expression.escapedText === 'InputMerge');
|
|
65
|
+
&& decorator.expression.expression.escapedText.toString() === 'InputMerge');
|
|
66
66
|
if (inputMergeDecorator) {
|
|
67
67
|
const inputMergeDecoratorRemovePos = computeRemovePosition(inputMergeDecorator);
|
|
68
68
|
recorder.remove(inputMergeDecoratorRemovePos.start, inputMergeDecoratorRemovePos.length);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAGL,IAAI,EACL,MAAM,4BAA4B,CAAC;AAyBpC,OAAO,EACL,qBAAqB,EACtB,MAAM,UAAU,CAAC;AAsElB;;;GAGG;AACH,eAAO,MAAM,KAAK,0CAAiD,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ngAdd = void 0;
|
|
4
|
-
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
4
|
const fs = require("node:fs");
|
|
6
5
|
const path = require("node:path");
|
|
7
|
-
const presets_1 = require("../shared/presets");
|
|
8
6
|
const prompt_1 = require("@angular/cli/src/utilities/prompt");
|
|
7
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
9
8
|
const schematics_2 = require("@o3r/schematics");
|
|
10
|
-
const index_1 = require("./project-setup/index");
|
|
11
9
|
const schematics_3 = require("@o3r/schematics");
|
|
12
10
|
const dependencies_1 = require("@schematics/angular/utility/dependencies");
|
|
11
|
+
const presets_1 = require("../shared/presets");
|
|
12
|
+
const index_1 = require("./project-setup/index");
|
|
13
13
|
const workspacePackageName = '@o3r/workspace';
|
|
14
14
|
const o3rDevDependencies = [
|
|
15
15
|
'@o3r/schematics'
|
|
@@ -49,16 +49,15 @@ function ngAddFn(options) {
|
|
|
49
49
|
(dependenciesSetupConfig.ngAddToRun ||= []).push(workspacePackageName);
|
|
50
50
|
}
|
|
51
51
|
return (0, schematics_1.chain)([
|
|
52
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
53
52
|
(0, schematics_2.setupSchematicsParamsForProject)({ '*:ng-add': { registerDevtool: options.withDevtool } }, options.projectName),
|
|
54
53
|
options.projectName ? (0, index_1.prepareProject)(options, dependenciesSetupConfig) : (0, schematics_1.noop)(),
|
|
55
54
|
(0, schematics_2.registerPackageCollectionSchematics)(corePackageJsonContent),
|
|
56
55
|
async (t, c) => {
|
|
57
56
|
const { preset, externalPresets, ...forwardOptions } = options;
|
|
58
57
|
const presetRunner = await presets_1.presets[preset]({ projectName: forwardOptions.projectName, forwardOptions });
|
|
59
|
-
const externalPresetRunner = externalPresets ? await (0, presets_1.getExternalPreset)(externalPresets, t, c)
|
|
58
|
+
const externalPresetRunner = externalPresets ? await (0, presets_1.getExternalPreset)(externalPresets, t, c)({ projectName: forwardOptions.projectName, forwardOptions }) : undefined;
|
|
60
59
|
const modules = [...new Set([...(presetRunner.modules || []), ...(externalPresetRunner?.modules || [])])];
|
|
61
|
-
if (modules.length) {
|
|
60
|
+
if (modules.length > 0) {
|
|
62
61
|
c.logger.info(`The following modules will be installed: ${modules.join(', ')}`);
|
|
63
62
|
if (c.interactive && !await (0, prompt_1.askConfirmation)('Would you like to process to the setup of these modules?', true)) {
|
|
64
63
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/ng-add/project-setup/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/ng-add/project-setup/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,IAAI,EACV,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAML,KAAK,wBAAwB,EAC9B,MAAM,iBAAiB,CAAC;AAQzB,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,WAAW,CAAC;AAenB;;;;;GAKG;AACH,eAAO,MAAM,cAAc,YAAa,qBAAqB,2BAA2B,wBAAwB,KAAG,IA+ClH,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.prepareProject = void 0;
|
|
4
|
-
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
4
|
const fs = require("node:fs");
|
|
6
5
|
const path = require("node:path");
|
|
7
|
-
const
|
|
6
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
8
7
|
const schematics_2 = require("@o3r/schematics");
|
|
8
|
+
const index_1 = require("../../rule-factories/index");
|
|
9
9
|
const update_builders_names_1 = require("../updates-for-v8/cms-adapters/update-builders-names");
|
|
10
10
|
const update_generators_names_1 = require("../updates-for-v8/generators/update-generators-names");
|
|
11
11
|
const replaced_packages_1 = require("../updates-for-v8/replaced-packages");
|
|
@@ -24,14 +24,14 @@ const prepareProject = (options, dependenciesSetupConfig) => async (tree, contex
|
|
|
24
24
|
context.logger.error('Could not find @o3r/core package. Are you sure it is installed?');
|
|
25
25
|
}
|
|
26
26
|
const o3rCoreVersion = corePackageJsonContent.version;
|
|
27
|
-
const installOtterLinter = await (0, index_2.shouldOtterLinterBeInstalled)(context);
|
|
27
|
+
const installOtterLinter = await (0, index_2.shouldOtterLinterBeInstalled)(context, tree);
|
|
28
28
|
const workspaceConfig = (0, schematics_2.getWorkspaceConfig)(tree);
|
|
29
|
-
const workspaceProject = options.projectName && workspaceConfig?.projects?.[options.projectName] || undefined;
|
|
29
|
+
const workspaceProject = (options.projectName && workspaceConfig?.projects?.[options.projectName]) || undefined;
|
|
30
30
|
const projectType = workspaceProject?.projectType;
|
|
31
31
|
const depsInfo = (0, schematics_2.getO3rPeerDeps)(corePackageJsonPath);
|
|
32
32
|
const internalPackagesToInstallWithNgAdd = Array.from(new Set([
|
|
33
33
|
...(projectType === 'application' ? ['@o3r/application'] : []),
|
|
34
|
-
...(installOtterLinter ? [
|
|
34
|
+
...(installOtterLinter ? [`@o3r/eslint-config${(0, index_2.isUsingFlatConfig)(tree) ? '' : '-otter'}`] : []),
|
|
35
35
|
...depsInfo.o3rPeerDeps
|
|
36
36
|
]));
|
|
37
37
|
const projectDirectory = workspaceProject?.root;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,KAAK,GAAG,KAAK,CAAC;AAElD,MAAM,WAAW,qBAAsB,SAAQ,qBAAqB;IAClE,qDAAqD;IACrD,MAAM,EAAE,WAAW,CAAC;IAEpB,kEAAkE;IAClE,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAErC,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjC,8BAA8B;IAC9B,UAAU,EAAE,OAAO,CAAC;IAEpB,+BAA+B;IAC/B,WAAW,EAAE,OAAO,CAAC;IAErB,iDAAiD;IACjD,MAAM,EAAE,OAAO,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAElD,0CAA0C;IAC1C,OAAO,EAAE,OAAO,CAAC;IAEjB,8DAA8D;IAC9D,WAAW,EAAE,OAAO,CAAC;IAErB,sEAAsE;IACtE,YAAY,EAAE,OAAO,CAAC;IAEtB,8CAA8C;IAC9C,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-builders-names.d.ts","sourceRoot":"","sources":["../../../../../schematics/ng-add/updates-for-v8/cms-adapters/update-builders-names.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"update-builders-names.d.ts","sourceRoot":"","sources":["../../../../../schematics/ng-add/updates-for-v8/cms-adapters/update-builders-names.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,IAAI,EACL,MAAM,4BAA4B,CAAC;AAiDpC;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAI1C"}
|
|
@@ -1,53 +1,52 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.updateBuildersNames = updateBuildersNames;
|
|
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
|
/**
|
|
8
|
-
*
|
|
7
|
+
* Change otter builders names into angular.json
|
|
8
|
+
* @param tree
|
|
9
|
+
* @param context
|
|
9
10
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
* @param context
|
|
15
|
-
*/
|
|
16
|
-
const updateAngularJson = (tree, context) => {
|
|
17
|
-
const workspace = (0, schematics_2.getWorkspaceConfig)(tree);
|
|
18
|
-
if (!workspace) {
|
|
19
|
-
context.logger.error('No workspace detected, the extractors will not be added');
|
|
20
|
-
return tree;
|
|
21
|
-
}
|
|
22
|
-
const projectsInAngularJson = Object.keys(workspace.projects);
|
|
23
|
-
const buildersMappingFromV7 = {
|
|
24
|
-
'@otter/cms-adapters:component-extractor': '@o3r/components:extractor',
|
|
25
|
-
'@otter/cms-adapters:localization-extractor': '@o3r/localization:extractor',
|
|
26
|
-
'@otter/cms-adapters:style-extractor': '@o3r/styling:extractor',
|
|
27
|
-
'@otter/cms-adapters:rules-engine-extractor': 'o3r/rules-engine:extractor',
|
|
28
|
-
'@otter/ng-tools:i18n': '@o3r/localization:i18n',
|
|
29
|
-
'@otter/ng-tools:localization': '@o3r/localization:localization',
|
|
30
|
-
'@otter/ng-tools:app-version': '@o3r/core:app-version',
|
|
31
|
-
'@otter/ng-tools:multi-watcher': '@o3r/core:multi-watcher',
|
|
32
|
-
'@otter/ng-tools:lib-build': '@o3r/core:lib-build',
|
|
33
|
-
'@otter/ng-tools:ngc': '@o3r/core:ngc',
|
|
34
|
-
'@otter/ng-tools:pattern-replacement': '@o3r/core:pattern-replacement'
|
|
35
|
-
};
|
|
36
|
-
projectsInAngularJson.forEach(projectName => {
|
|
37
|
-
const workspaceProject = workspace.projects[projectName];
|
|
38
|
-
if (workspaceProject.architect) {
|
|
39
|
-
Object.keys(workspaceProject.architect).forEach(architectName => {
|
|
40
|
-
const builderName = workspaceProject.architect[architectName].builder;
|
|
41
|
-
if (buildersMappingFromV7[builderName]) {
|
|
42
|
-
workspaceProject.architect[architectName].builder = buildersMappingFromV7[builderName];
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
workspace.projects[projectName] = workspaceProject;
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
tree.overwrite('/angular.json', JSON.stringify(workspace, null, 2));
|
|
11
|
+
const updateAngularJson = (tree, context) => {
|
|
12
|
+
const workspace = (0, schematics_2.getWorkspaceConfig)(tree);
|
|
13
|
+
if (!workspace) {
|
|
14
|
+
context.logger.error('No workspace detected, the extractors will not be added');
|
|
49
15
|
return tree;
|
|
16
|
+
}
|
|
17
|
+
const projectsInAngularJson = Object.keys(workspace.projects);
|
|
18
|
+
const buildersMappingFromV7 = {
|
|
19
|
+
'@otter/cms-adapters:component-extractor': '@o3r/components:extractor',
|
|
20
|
+
'@otter/cms-adapters:localization-extractor': '@o3r/localization:extractor',
|
|
21
|
+
'@otter/cms-adapters:style-extractor': '@o3r/styling:extractor',
|
|
22
|
+
'@otter/cms-adapters:rules-engine-extractor': 'o3r/rules-engine:extractor',
|
|
23
|
+
'@otter/ng-tools:i18n': '@o3r/localization:i18n',
|
|
24
|
+
'@otter/ng-tools:localization': '@o3r/localization:localization',
|
|
25
|
+
'@otter/ng-tools:app-version': '@o3r/core:app-version',
|
|
26
|
+
'@otter/ng-tools:multi-watcher': '@o3r/core:multi-watcher',
|
|
27
|
+
'@otter/ng-tools:lib-build': '@o3r/core:lib-build',
|
|
28
|
+
'@otter/ng-tools:ngc': '@o3r/core:ngc',
|
|
29
|
+
'@otter/ng-tools:pattern-replacement': '@o3r/core:pattern-replacement'
|
|
50
30
|
};
|
|
31
|
+
projectsInAngularJson.forEach((projectName) => {
|
|
32
|
+
const workspaceProject = workspace.projects[projectName];
|
|
33
|
+
if (workspaceProject.architect) {
|
|
34
|
+
Object.keys(workspaceProject.architect).forEach((architectName) => {
|
|
35
|
+
const builderName = workspaceProject.architect[architectName].builder;
|
|
36
|
+
if (buildersMappingFromV7[builderName]) {
|
|
37
|
+
workspaceProject.architect[architectName].builder = buildersMappingFromV7[builderName];
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
workspace.projects[projectName] = workspaceProject;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
tree.overwrite('/angular.json', JSON.stringify(workspace, null, 2));
|
|
44
|
+
return tree;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Update otter builders names
|
|
48
|
+
*/
|
|
49
|
+
function updateBuildersNames() {
|
|
51
50
|
return (0, schematics_1.chain)([
|
|
52
51
|
updateAngularJson
|
|
53
52
|
]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-generators-names.d.ts","sourceRoot":"","sources":["../../../../../schematics/ng-add/updates-for-v8/generators/update-generators-names.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"update-generators-names.d.ts","sourceRoot":"","sources":["../../../../../schematics/ng-add/updates-for-v8/generators/update-generators-names.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,IAAI,EACL,MAAM,4BAA4B,CAAC;AAkEpC;;GAEG;AACH,wBAAgB,0BAA0B,IAAI,IAAI,CAIjD"}
|