@o3r/core 10.0.0-next.9 → 11.0.0-next.0
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/README.md +38 -13
- package/builders/app-version/index.d.ts.map +1 -1
- package/builders/app-version/index.js +1 -1
- package/builders/app-version/index.js.map +1 -1
- package/builders/app-version/schema.json +1 -1
- package/builders/lib-build/schema.json +1 -1
- package/builders/multi-watcher/schema.json +1 -1
- package/builders/ngc/schema.json +1 -1
- package/builders/pattern-replacement/index.d.ts.map +1 -1
- package/builders/pattern-replacement/index.js +5 -5
- package/builders/pattern-replacement/index.js.map +1 -1
- package/builders/pattern-replacement/schema.json +1 -1
- package/builders/run-script/index.d.ts +4 -0
- package/builders/run-script/index.d.ts.map +1 -0
- package/builders/run-script/index.js +34 -0
- package/builders/run-script/index.js.map +1 -0
- package/builders/run-script/schema.d.ts +6 -0
- package/builders/run-script/schema.d.ts.map +1 -0
- package/{schematics/library → builders/run-script}/schema.js.map +1 -1
- package/builders/run-script/schema.json +15 -0
- package/builders.json +5 -0
- package/collection.json +0 -23
- package/core/application/dgp.interfaces.d.ts +6 -3
- package/core/application/dgp.interfaces.d.ts.map +1 -1
- package/core/devkit/devtools.interface.d.ts +16 -2
- package/core/devkit/devtools.interface.d.ts.map +1 -1
- package/core/index.d.ts +1 -0
- package/core/index.d.ts.map +1 -1
- package/core/index.js +1 -0
- package/core/index.js.map +1 -1
- package/core/interfaces/configuration.d.ts +39 -17
- package/core/interfaces/configuration.d.ts.map +1 -1
- package/core/interfaces/index.d.ts +0 -3
- package/core/interfaces/index.d.ts.map +1 -1
- package/core/interfaces/index.js +0 -3
- package/core/interfaces/index.js.map +1 -1
- package/core/metadata/component.decorator.d.ts +0 -1
- package/core/metadata/component.decorator.d.ts.map +1 -1
- package/core/metadata/component.decorator.js +0 -1
- package/core/metadata/component.decorator.js.map +1 -1
- package/core/metadata/component.identifier.d.ts +7 -0
- package/core/metadata/component.identifier.d.ts.map +1 -0
- package/core/metadata/component.identifier.js +9 -0
- package/core/metadata/component.identifier.js.map +1 -0
- package/core/metadata/index.d.ts +1 -0
- package/core/metadata/index.d.ts.map +1 -1
- package/core/metadata/index.js +1 -0
- package/core/metadata/index.js.map +1 -1
- package/core/rules-engine/index.d.ts +2 -0
- package/core/rules-engine/index.d.ts.map +1 -0
- package/core/rules-engine/index.js +2 -0
- package/core/rules-engine/index.js.map +1 -0
- package/core/rules-engine/rules-engine.interfaces.d.ts +24 -0
- package/core/rules-engine/rules-engine.interfaces.d.ts.map +1 -0
- package/core/rules-engine/rules-engine.interfaces.js +2 -0
- package/core/rules-engine/rules-engine.interfaces.js.map +1 -0
- package/esm2022/core/application/dgp.interfaces.mjs +1 -1
- package/esm2022/core/devkit/devtools.interface.mjs +1 -1
- package/esm2022/core/index.mjs +2 -1
- package/esm2022/core/interfaces/configuration.mjs +1 -1
- package/esm2022/core/interfaces/index.mjs +1 -4
- package/esm2022/core/metadata/component.decorator.mjs +1 -2
- package/esm2022/core/metadata/component.identifier.mjs +9 -0
- package/esm2022/core/metadata/index.mjs +2 -1
- package/esm2022/core/rules-engine/index.mjs +2 -0
- package/esm2022/core/rules-engine/rules-engine.interfaces.mjs +2 -0
- package/esm2022/log/logger.mjs +1 -1
- package/esm2022/messages/message.helpers.mjs +1 -5
- package/esm2022/store/async/async-entity.adapter.mjs +1 -2
- package/esm2022/store/async/async.adapter.mjs +1 -1
- package/esm2022/store/async/async.helpers.mjs +1 -4
- package/esm2022/store/async/async.operators.mjs +3 -4
- package/esm2022/store/async/async.serializer.mjs +1 -4
- package/esm2022/store/index.mjs +1 -2
- package/esm2022/utils/debug/debug.helper.mjs +1 -3
- package/esm2022/utils/deep-fill/deep-fill.mjs +23 -28
- package/esm2022/utils/rendering/rendering.helpers.mjs +1 -2
- package/fesm2022/o3r-core.mjs +47 -169
- package/fesm2022/o3r-core.mjs.map +1 -1
- package/log/logger.d.ts +0 -5
- package/log/logger.d.ts.map +1 -1
- package/messages/message.helpers.d.ts +0 -3
- package/messages/message.helpers.d.ts.map +1 -1
- package/messages/message.helpers.js +0 -4
- package/messages/message.helpers.js.map +1 -1
- package/migration.json +5 -0
- package/package.json +46 -39
- package/schematics/add-modules/index.d.ts +1 -2
- package/schematics/add-modules/index.d.ts.map +1 -1
- package/schematics/add-modules/index.js +16 -9
- package/schematics/add-modules/index.js.map +1 -1
- package/schematics/add-modules/schema.d.ts +5 -1
- package/schematics/add-modules/schema.d.ts.map +1 -1
- package/schematics/add-modules/schema.json +14 -4
- package/schematics/component/container/index.d.ts +0 -1
- package/schematics/component/container/index.d.ts.map +1 -1
- package/schematics/component/container/index.js +1 -3
- package/schematics/component/container/index.js.map +1 -1
- package/schematics/component/container/schema.json +1 -1
- package/schematics/component/index.d.ts.map +1 -1
- package/schematics/component/index.js +5 -2
- package/schematics/component/index.js.map +1 -1
- package/schematics/component/presenter/index.d.ts +0 -1
- package/schematics/component/presenter/index.d.ts.map +1 -1
- package/schematics/component/presenter/index.js +9 -9
- package/schematics/component/presenter/index.js.map +1 -1
- package/schematics/component/presenter/schema.json +4 -3
- package/schematics/component/schema.json +4 -4
- package/schematics/component/structures.types.d.ts +3 -2
- package/schematics/component/structures.types.d.ts.map +1 -1
- package/schematics/component/structures.types.js +1 -0
- package/schematics/component/structures.types.js.map +1 -1
- package/schematics/context-to-component/index.d.ts.map +1 -1
- package/schematics/context-to-component/index.js +1 -1
- package/schematics/context-to-component/index.js.map +1 -1
- package/schematics/context-to-component/schema.json +1 -1
- package/schematics/convert-component/index.js +2 -2
- package/schematics/convert-component/index.js.map +1 -1
- package/schematics/convert-component/schema.json +1 -1
- package/schematics/ng-add/index.d.ts.map +1 -1
- package/schematics/ng-add/index.js +30 -31
- package/schematics/ng-add/index.js.map +1 -1
- package/schematics/ng-add/project-setup/index.d.ts +0 -1
- package/schematics/ng-add/project-setup/index.d.ts.map +1 -1
- package/schematics/ng-add/project-setup/index.js +16 -65
- package/schematics/ng-add/project-setup/index.js.map +1 -1
- package/schematics/ng-add/schema.d.ts +7 -46
- package/schematics/ng-add/schema.d.ts.map +1 -1
- package/schematics/ng-add/schema.json +16 -86
- 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 +7 -3
- package/schematics/ng-add/updates-for-v8/cms-adapters/update-builders-names.js.map +1 -1
- 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 +7 -2
- package/schematics/ng-add/updates-for-v8/generators/update-generators-names.js.map +1 -1
- package/schematics/ng-add-create/schema.json +1 -1
- package/schematics/ng-add-create/templates/schematics/ng-add/schema.json.template +2 -2
- package/schematics/ng-update/index.d.ts +4 -0
- package/schematics/ng-update/index.d.ts.map +1 -1
- package/schematics/ng-update/index.js +14 -1
- package/schematics/ng-update/index.js.map +1 -1
- package/schematics/ng-update/v10.0/configuration.d.ts +9 -0
- package/schematics/ng-update/v10.0/configuration.d.ts.map +1 -0
- package/schematics/ng-update/v10.0/configuration.js +23 -0
- package/schematics/ng-update/v10.0/configuration.js.map +1 -0
- package/schematics/page/index.d.ts +0 -1
- package/schematics/page/index.d.ts.map +1 -1
- package/schematics/page/index.js +6 -11
- package/schematics/page/index.js.map +1 -1
- package/schematics/page/schema.json +1 -1
- package/schematics/renovate/schema.json +1 -1
- package/schematics/renovate/templates/azure-pipelines.ugrade.yml +1 -1
- package/schematics/rule-factories/additional-modules/index.d.ts +0 -1
- package/schematics/rule-factories/additional-modules/index.d.ts.map +1 -1
- package/schematics/rule-factories/additional-modules/index.js +14 -18
- package/schematics/rule-factories/additional-modules/index.js.map +1 -1
- package/schematics/rule-factories/component/common.js +2 -2
- package/schematics/rule-factories/component/common.js.map +1 -1
- package/schematics/rule-factories/customization-environment/index.d.ts +0 -1
- package/schematics/rule-factories/customization-environment/index.d.ts.map +1 -1
- package/schematics/rule-factories/customization-environment/index.js +9 -30
- package/schematics/rule-factories/customization-environment/index.js.map +1 -1
- package/schematics/rule-factories/index.d.ts +0 -3
- package/schematics/rule-factories/index.d.ts.map +1 -1
- package/schematics/rule-factories/index.js +0 -3
- package/schematics/rule-factories/index.js.map +1 -1
- package/schematics/rule-factories/o3r-basic-updates/index.d.ts +1 -2
- package/schematics/rule-factories/o3r-basic-updates/index.d.ts.map +1 -1
- package/schematics/rule-factories/o3r-basic-updates/index.js +7 -4
- package/schematics/rule-factories/o3r-basic-updates/index.js.map +1 -1
- package/schematics/rule-factories/otter-environment/index.d.ts +0 -1
- package/schematics/rule-factories/otter-environment/index.d.ts.map +1 -1
- package/schematics/rule-factories/otter-environment/index.js +8 -13
- package/schematics/rule-factories/otter-environment/index.js.map +1 -1
- package/schematics/rule-factories/store/index.d.ts.map +1 -1
- package/schematics/rule-factories/store/index.js +30 -13
- package/schematics/rule-factories/store/index.js.map +1 -1
- package/schematics/schematics-update/schema.json +1 -1
- package/schematics/service/index.d.ts +0 -1
- package/schematics/service/index.d.ts.map +1 -1
- package/schematics/service/index.js +1 -2
- package/schematics/service/index.js.map +1 -1
- package/schematics/service/schema.json +1 -1
- package/schematics/shared/presets/all.preset.d.ts +10 -0
- package/schematics/shared/presets/all.preset.d.ts.map +1 -0
- package/schematics/shared/presets/all.preset.js +40 -0
- package/schematics/shared/presets/all.preset.js.map +1 -0
- package/schematics/shared/presets/external.preset.d.ts +10 -0
- package/schematics/shared/presets/external.preset.d.ts.map +1 -0
- package/schematics/shared/presets/external.preset.js +25 -0
- package/schematics/shared/presets/external.preset.js.map +1 -0
- package/schematics/shared/presets/helpers.js +1 -1
- package/schematics/shared/presets/helpers.js.map +1 -1
- package/schematics/shared/presets/index.d.ts +1 -0
- package/schematics/shared/presets/index.d.ts.map +1 -1
- package/schematics/shared/presets/index.js +4 -1
- package/schematics/shared/presets/index.js.map +1 -1
- package/schematics/show-modules/index.d.ts +1 -2
- package/schematics/show-modules/index.d.ts.map +1 -1
- package/schematics/show-modules/index.js +3 -5
- package/schematics/show-modules/index.js.map +1 -1
- package/schematics/show-modules/schema.json +1 -1
- package/schematics/store/entity-async/index.d.ts.map +1 -1
- package/schematics/store/entity-async/index.js +4 -0
- package/schematics/store/entity-async/index.js.map +1 -1
- package/schematics/store/entity-async/schema.json +1 -1
- package/schematics/store/entity-async/templates/__storeName@dasherize__.state.ts +1 -1
- package/schematics/store/entity-sync/index.d.ts.map +1 -1
- package/schematics/store/entity-sync/index.js +4 -0
- package/schematics/store/entity-sync/index.js.map +1 -1
- package/schematics/store/entity-sync/schema.json +1 -1
- package/schematics/store/entity-sync/templates/__storeName@dasherize__.state.ts +1 -1
- package/schematics/store/schema.json +1 -1
- package/schematics/store/simple-async/index.d.ts.map +1 -1
- package/schematics/store/simple-async/index.js +2 -0
- package/schematics/store/simple-async/index.js.map +1 -1
- package/schematics/store/simple-async/schema.json +1 -1
- package/schematics/store/simple-sync/index.d.ts.map +1 -1
- package/schematics/store/simple-sync/index.js +1 -0
- package/schematics/store/simple-sync/index.js.map +1 -1
- package/schematics/store/simple-sync/schema.json +1 -1
- package/schematics/store-action/schema.json +1 -1
- package/store/async/async-entity.adapter.d.ts +0 -8
- package/store/async/async-entity.adapter.d.ts.map +1 -1
- package/store/async/async-entity.adapter.js +0 -1
- package/store/async/async-entity.adapter.js.map +1 -1
- package/store/async/async.adapter.d.ts +0 -13
- package/store/async/async.adapter.d.ts.map +1 -1
- package/store/async/async.adapter.js.map +1 -1
- package/store/async/async.helpers.d.ts +0 -3
- package/store/async/async.helpers.d.ts.map +1 -1
- package/store/async/async.helpers.js +0 -3
- package/store/async/async.helpers.js.map +1 -1
- package/store/async/async.operators.d.ts +2 -3
- package/store/async/async.operators.d.ts.map +1 -1
- package/store/async/async.operators.js +2 -3
- package/store/async/async.operators.js.map +1 -1
- package/store/async/async.serializer.d.ts +0 -3
- package/store/async/async.serializer.d.ts.map +1 -1
- package/store/async/async.serializer.js +0 -3
- package/store/async/async.serializer.js.map +1 -1
- package/store/index.d.ts +0 -1
- package/store/index.d.ts.map +1 -1
- package/store/index.js +0 -1
- package/store/index.js.map +1 -1
- package/utils/debug/debug.helper.d.ts +0 -2
- package/utils/debug/debug.helper.d.ts.map +1 -1
- package/utils/debug/debug.helper.js +0 -2
- package/utils/debug/debug.helper.js.map +1 -1
- package/utils/deep-fill/deep-fill.d.ts +17 -12
- package/utils/deep-fill/deep-fill.d.ts.map +1 -1
- package/utils/deep-fill/deep-fill.js +22 -27
- package/utils/deep-fill/deep-fill.js.map +1 -1
- package/utils/rendering/rendering.helpers.d.ts +0 -1
- package/utils/rendering/rendering.helpers.d.ts.map +1 -1
- package/utils/rendering/rendering.helpers.js +0 -1
- package/utils/rendering/rendering.helpers.js.map +1 -1
- package/builders/package.json +0 -3
- package/core/interfaces/block.d.ts +0 -9
- package/core/interfaces/block.d.ts.map +0 -1
- package/core/interfaces/block.js +0 -2
- package/core/interfaces/block.js.map +0 -1
- package/core/interfaces/exposed-component.d.ts +0 -10
- package/core/interfaces/exposed-component.d.ts.map +0 -1
- package/core/interfaces/exposed-component.js +0 -2
- package/core/interfaces/exposed-component.js.map +0 -1
- package/core/interfaces/page.d.ts +0 -9
- package/core/interfaces/page.d.ts.map +0 -1
- package/core/interfaces/page.js +0 -2
- package/core/interfaces/page.js.map +0 -1
- package/esm2022/core/interfaces/block.mjs +0 -2
- package/esm2022/core/interfaces/exposed-component.mjs +0 -2
- package/esm2022/core/interfaces/page.mjs +0 -2
- package/esm2022/store/storage/index.mjs +0 -2
- package/esm2022/store/storage/store-sync.mjs +0 -111
- package/schematics/application/index.d.ts +0 -9
- package/schematics/application/index.d.ts.map +0 -1
- package/schematics/application/index.js +0 -68
- package/schematics/application/index.js.map +0 -1
- package/schematics/application/schema.d.ts +0 -14
- package/schematics/application/schema.d.ts.map +0 -1
- package/schematics/application/schema.js.map +0 -1
- package/schematics/application/schema.json +0 -38
- package/schematics/application/templates/package.json.template +0 -29
- package/schematics/library/index.d.ts +0 -9
- package/schematics/library/index.d.ts.map +0 -1
- package/schematics/library/index.js +0 -41
- package/schematics/library/index.js.map +0 -1
- package/schematics/library/rules/rules.ng.d.ts +0 -11
- package/schematics/library/rules/rules.ng.d.ts.map +0 -1
- package/schematics/library/rules/rules.ng.js +0 -113
- package/schematics/library/rules/rules.ng.js.map +0 -1
- package/schematics/library/rules/rules.nx.d.ts +0 -10
- package/schematics/library/rules/rules.nx.d.ts.map +0 -1
- package/schematics/library/rules/rules.nx.js +0 -126
- package/schematics/library/rules/rules.nx.js.map +0 -1
- package/schematics/library/rules/shared.d.ts +0 -19
- package/schematics/library/rules/shared.d.ts.map +0 -1
- package/schematics/library/rules/shared.js +0 -84
- package/schematics/library/rules/shared.js.map +0 -1
- package/schematics/library/schema.d.ts +0 -18
- package/schematics/library/schema.d.ts.map +0 -1
- package/schematics/library/schema.js +0 -3
- package/schematics/library/schema.json +0 -51
- package/schematics/library/templates/ng/.eslintrc.js.template +0 -19
- package/schematics/library/templates/ng/.gitignore.template +0 -2
- package/schematics/library/templates/ng/.npmignore.template +0 -0
- package/schematics/library/templates/ng/jest.config.js.template +0 -37
- package/schematics/library/templates/ng/testing/setup-jest.ts.template +0 -2
- package/schematics/library/templates/ng/tsconfig.builders.json.template +0 -22
- package/schematics/library/templates/ng/tsconfig.eslint.json.template +0 -8
- package/schematics/library/templates/ng/tsconfig.json.template +0 -12
- package/schematics/library/templates/ng/tsconfig.spec.json.template +0 -17
- package/schematics/library/templates/nx/.eslintrc.js.template +0 -19
- package/schematics/library/templates/nx/.gitignore.template +0 -2
- package/schematics/library/templates/nx/.npmignore.template +0 -0
- package/schematics/library/templates/nx/jest.config.js.template +0 -37
- package/schematics/library/templates/nx/project.json.template +0 -66
- package/schematics/library/templates/nx/testing/setup-jest.ts.template +0 -2
- package/schematics/library/templates/nx/tsconfig.eslint.json.template +0 -8
- package/schematics/package.json +0 -3
- package/schematics/rule-factories/azure-pipeline/index.d.ts +0 -14
- package/schematics/rule-factories/azure-pipeline/index.d.ts.map +0 -1
- package/schematics/rule-factories/azure-pipeline/index.js +0 -64
- package/schematics/rule-factories/azure-pipeline/index.js.map +0 -1
- package/schematics/rule-factories/azure-pipeline/templates/azure/scripts/e2e/attach-files-to-test-results.js.template +0 -147
- package/schematics/rule-factories/azure-pipeline/templates/azure/scripts/e2e/compute-deployment-service-url.js.template +0 -20
- package/schematics/rule-factories/azure-pipeline/templates/azure/scripts/e2e/gen-pckg-json-e2e.js.template +0 -15
- package/schematics/rule-factories/azure-pipeline/templates/azure/scripts/e2e/get-app-version.js.template +0 -36
- package/schematics/rule-factories/azure-pipeline/templates/azure/scripts/e2e/get-major-minor.js.template +0 -8
- package/schematics/rule-factories/azure-pipeline/templates/azure/templates/steps/allure.yml.template +0 -24
- package/schematics/rule-factories/azure-pipeline/templates/azure/templates/steps/cascading.yml.template +0 -8
- package/schematics/rule-factories/azure-pipeline/templates/azure/templates/steps/publish.yml.template +0 -14
- package/schematics/rule-factories/azure-pipeline/templates/azure/templates/steps/set-version-tag.yml.template +0 -13
- package/schematics/rule-factories/azure-pipeline/templates/azure/templates/steps/setup.yml.template +0 -21
- package/schematics/rule-factories/azure-pipeline/templates/azure/templates/steps/versioning.yml.template +0 -8
- package/schematics/rule-factories/azure-pipeline/templates/azure-pipelines.yml.template +0 -252
- package/schematics/rule-factories/module-list/index.d.ts +0 -11
- package/schematics/rule-factories/module-list/index.d.ts.map +0 -1
- package/schematics/rule-factories/module-list/index.js +0 -45
- package/schematics/rule-factories/module-list/index.js.map +0 -1
- package/schematics/rule-factories/monorepo/index.d.ts +0 -16
- package/schematics/rule-factories/monorepo/index.d.ts.map +0 -1
- package/schematics/rule-factories/monorepo/index.js +0 -65
- package/schematics/rule-factories/monorepo/index.js.map +0 -1
- package/schematics/rule-factories/renovate/index.d.ts +0 -8
- package/schematics/rule-factories/renovate/index.d.ts.map +0 -1
- package/schematics/rule-factories/renovate/index.js +0 -27
- package/schematics/rule-factories/renovate/index.js.map +0 -1
- package/schematics/rule-factories/renovate/templates/__dot__renovaterc.json.template +0 -61
- package/schematics/sdk/index.d.ts +0 -8
- package/schematics/sdk/index.d.ts.map +0 -1
- package/schematics/sdk/index.js +0 -62
- package/schematics/sdk/index.js.map +0 -1
- package/schematics/sdk/rules/clean-standalone.rule.d.ts +0 -7
- package/schematics/sdk/rules/clean-standalone.rule.d.ts.map +0 -1
- package/schematics/sdk/rules/clean-standalone.rule.js +0 -28
- package/schematics/sdk/rules/clean-standalone.rule.js.map +0 -1
- package/schematics/sdk/rules/rules.ng.d.ts +0 -11
- package/schematics/sdk/rules/rules.ng.d.ts.map +0 -1
- package/schematics/sdk/rules/rules.ng.js +0 -38
- package/schematics/sdk/rules/rules.ng.js.map +0 -1
- package/schematics/sdk/rules/rules.nx.d.ts +0 -11
- package/schematics/sdk/rules/rules.nx.d.ts.map +0 -1
- package/schematics/sdk/rules/rules.nx.js +0 -60
- package/schematics/sdk/rules/rules.nx.js.map +0 -1
- package/schematics/sdk/rules/update-ts-paths.rule.d.ts +0 -10
- package/schematics/sdk/rules/update-ts-paths.rule.d.ts.map +0 -1
- package/schematics/sdk/rules/update-ts-paths.rule.js +0 -41
- package/schematics/sdk/rules/update-ts-paths.rule.js.map +0 -1
- package/schematics/sdk/schema.d.ts +0 -19
- package/schematics/sdk/schema.d.ts.map +0 -1
- package/schematics/sdk/schema.js +0 -3
- package/schematics/sdk/schema.js.map +0 -1
- package/schematics/sdk/schema.json +0 -46
- package/schematics/sdk/templates/jest.config.js.template +0 -12
- package/schematics/store/common/mocks/example-module.d.ts +0 -2
- package/schematics/store/common/mocks/example-module.d.ts.map +0 -1
- package/schematics/store/common/mocks/example-module.js +0 -40
- package/schematics/store/common/mocks/example-module.js.map +0 -1
- package/schematics/store/common/mocks/index.d.ts +0 -2
- package/schematics/store/common/mocks/index.d.ts.map +0 -1
- package/schematics/store/common/mocks/index.js +0 -12
- package/schematics/store/common/mocks/index.js.map +0 -1
- package/schematics/store/entity-async/mocks/example-actions.d.ts +0 -2
- package/schematics/store/entity-async/mocks/example-actions.d.ts.map +0 -1
- package/schematics/store/entity-async/mocks/example-actions.js +0 -82
- package/schematics/store/entity-async/mocks/example-actions.js.map +0 -1
- package/schematics/store/entity-async/mocks/example-effect-spec.d.ts +0 -2
- package/schematics/store/entity-async/mocks/example-effect-spec.d.ts.map +0 -1
- package/schematics/store/entity-async/mocks/example-effect-spec.js +0 -45
- package/schematics/store/entity-async/mocks/example-effect-spec.js.map +0 -1
- package/schematics/store/entity-async/mocks/example-effect.d.ts +0 -2
- package/schematics/store/entity-async/mocks/example-effect.d.ts.map +0 -1
- package/schematics/store/entity-async/mocks/example-effect.js +0 -72
- package/schematics/store/entity-async/mocks/example-effect.js.map +0 -1
- package/schematics/store/entity-async/mocks/example-reducer-spec.d.ts +0 -2
- package/schematics/store/entity-async/mocks/example-reducer-spec.d.ts.map +0 -1
- package/schematics/store/entity-async/mocks/example-reducer-spec.js +0 -127
- package/schematics/store/entity-async/mocks/example-reducer-spec.js.map +0 -1
- package/schematics/store/entity-async/mocks/example-reducer.d.ts +0 -2
- package/schematics/store/entity-async/mocks/example-reducer.d.ts.map +0 -1
- package/schematics/store/entity-async/mocks/example-reducer.js +0 -69
- package/schematics/store/entity-async/mocks/example-reducer.js.map +0 -1
- package/schematics/store/entity-async/mocks/example-selectors-spec.d.ts +0 -2
- package/schematics/store/entity-async/mocks/example-selectors-spec.d.ts.map +0 -1
- package/schematics/store/entity-async/mocks/example-selectors-spec.js +0 -16
- package/schematics/store/entity-async/mocks/example-selectors-spec.js.map +0 -1
- package/schematics/store/entity-async/mocks/example-selectors.d.ts +0 -2
- package/schematics/store/entity-async/mocks/example-selectors.d.ts.map +0 -1
- package/schematics/store/entity-async/mocks/example-selectors.js +0 -28
- package/schematics/store/entity-async/mocks/example-selectors.js.map +0 -1
- package/schematics/store/entity-async/mocks/example-state.d.ts +0 -2
- package/schematics/store/entity-async/mocks/example-state.d.ts.map +0 -1
- package/schematics/store/entity-async/mocks/example-state.js +0 -39
- package/schematics/store/entity-async/mocks/example-state.js.map +0 -1
- package/schematics/store/entity-async/mocks/example-sync.d.ts +0 -2
- package/schematics/store/entity-async/mocks/example-sync.d.ts.map +0 -1
- package/schematics/store/entity-async/mocks/example-sync.js +0 -29
- package/schematics/store/entity-async/mocks/example-sync.js.map +0 -1
- package/schematics/store/entity-sync/mocks/example-actions.d.ts +0 -2
- package/schematics/store/entity-sync/mocks/example-actions.d.ts.map +0 -1
- package/schematics/store/entity-sync/mocks/example-actions.js +0 -56
- package/schematics/store/entity-sync/mocks/example-actions.js.map +0 -1
- package/schematics/store/entity-sync/mocks/example-reducer-spec.d.ts +0 -2
- package/schematics/store/entity-sync/mocks/example-reducer-spec.d.ts.map +0 -1
- package/schematics/store/entity-sync/mocks/example-reducer-spec.js +0 -85
- package/schematics/store/entity-sync/mocks/example-reducer-spec.js.map +0 -1
- package/schematics/store/entity-sync/mocks/example-reducer.d.ts +0 -2
- package/schematics/store/entity-sync/mocks/example-reducer.d.ts.map +0 -1
- package/schematics/store/entity-sync/mocks/example-reducer.js +0 -51
- package/schematics/store/entity-sync/mocks/example-reducer.js.map +0 -1
- package/schematics/store/entity-sync/mocks/example-selectors-spec.d.ts +0 -2
- package/schematics/store/entity-sync/mocks/example-selectors-spec.d.ts.map +0 -1
- package/schematics/store/entity-sync/mocks/example-selectors-spec.js +0 -10
- package/schematics/store/entity-sync/mocks/example-selectors-spec.js.map +0 -1
- package/schematics/store/entity-sync/mocks/example-selectors.d.ts +0 -2
- package/schematics/store/entity-sync/mocks/example-selectors.d.ts.map +0 -1
- package/schematics/store/entity-sync/mocks/example-selectors.js +0 -25
- package/schematics/store/entity-sync/mocks/example-selectors.js.map +0 -1
- package/schematics/store/entity-sync/mocks/example-state.d.ts +0 -2
- package/schematics/store/entity-sync/mocks/example-state.d.ts.map +0 -1
- package/schematics/store/entity-sync/mocks/example-state.js +0 -37
- package/schematics/store/entity-sync/mocks/example-state.js.map +0 -1
- package/schematics/store/simple-async/mocks/example-actions.d.ts +0 -2
- package/schematics/store/simple-async/mocks/example-actions.d.ts.map +0 -1
- package/schematics/store/simple-async/mocks/example-actions.js +0 -56
- package/schematics/store/simple-async/mocks/example-actions.js.map +0 -1
- package/schematics/store/simple-async/mocks/example-effect-spec.d.ts +0 -2
- package/schematics/store/simple-async/mocks/example-effect-spec.d.ts.map +0 -1
- package/schematics/store/simple-async/mocks/example-effect-spec.js +0 -45
- package/schematics/store/simple-async/mocks/example-effect-spec.js.map +0 -1
- package/schematics/store/simple-async/mocks/example-effect.d.ts +0 -2
- package/schematics/store/simple-async/mocks/example-effect.d.ts.map +0 -1
- package/schematics/store/simple-async/mocks/example-effect.js +0 -54
- package/schematics/store/simple-async/mocks/example-effect.js.map +0 -1
- package/schematics/store/simple-async/mocks/example-reducer-spec.d.ts +0 -2
- package/schematics/store/simple-async/mocks/example-reducer-spec.d.ts.map +0 -1
- package/schematics/store/simple-async/mocks/example-reducer-spec.js +0 -58
- package/schematics/store/simple-async/mocks/example-reducer-spec.js.map +0 -1
- package/schematics/store/simple-async/mocks/example-reducer.d.ts +0 -2
- package/schematics/store/simple-async/mocks/example-reducer.d.ts.map +0 -1
- package/schematics/store/simple-async/mocks/example-reducer.js +0 -46
- package/schematics/store/simple-async/mocks/example-reducer.js.map +0 -1
- package/schematics/store/simple-async/mocks/example-state.d.ts +0 -2
- package/schematics/store/simple-async/mocks/example-state.d.ts.map +0 -1
- package/schematics/store/simple-async/mocks/example-state.js +0 -39
- package/schematics/store/simple-async/mocks/example-state.js.map +0 -1
- package/schematics/store/simple-async/mocks/example-sync.d.ts +0 -2
- package/schematics/store/simple-async/mocks/example-sync.d.ts.map +0 -1
- package/schematics/store/simple-async/mocks/example-sync.js +0 -22
- package/schematics/store/simple-async/mocks/example-sync.js.map +0 -1
- package/schematics/store/simple-sync/mocks/example-actions.d.ts +0 -2
- package/schematics/store/simple-sync/mocks/example-actions.d.ts.map +0 -1
- package/schematics/store/simple-sync/mocks/example-actions.js +0 -28
- package/schematics/store/simple-sync/mocks/example-actions.js.map +0 -1
- package/schematics/store/simple-sync/mocks/example-reducer-spec.d.ts +0 -2
- package/schematics/store/simple-sync/mocks/example-reducer-spec.d.ts.map +0 -1
- package/schematics/store/simple-sync/mocks/example-reducer-spec.js +0 -38
- package/schematics/store/simple-sync/mocks/example-reducer-spec.js.map +0 -1
- package/schematics/store/simple-sync/mocks/example-reducer.d.ts +0 -2
- package/schematics/store/simple-sync/mocks/example-reducer.d.ts.map +0 -1
- package/schematics/store/simple-sync/mocks/example-reducer.js +0 -32
- package/schematics/store/simple-sync/mocks/example-reducer.js.map +0 -1
- package/schematics/store/simple-sync/mocks/example-state.d.ts +0 -2
- package/schematics/store/simple-sync/mocks/example-state.d.ts.map +0 -1
- package/schematics/store/simple-sync/mocks/example-state.js +0 -22
- package/schematics/store/simple-sync/mocks/example-state.js.map +0 -1
- package/store/storage/index.d.ts +0 -2
- package/store/storage/index.d.ts.map +0 -1
- package/store/storage/index.js +0 -2
- package/store/storage/index.js.map +0 -1
- package/store/storage/store-sync.d.ts +0 -113
- package/store/storage/store-sync.d.ts.map +0 -1
- package/store/storage/store-sync.js +0 -111
- package/store/storage/store-sync.js.map +0 -1
- /package/{schematics/application → builders/run-script}/schema.js +0 -0
package/schematics/page/index.js
CHANGED
|
@@ -3,36 +3,33 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ngGeneratePage = void 0;
|
|
4
4
|
const core_1 = require("@angular-devkit/core");
|
|
5
5
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
6
|
+
const schematics_2 = require("@o3r/schematics");
|
|
6
7
|
const path = require("node:path");
|
|
7
8
|
const ts = require("typescript");
|
|
8
|
-
const schematics_2 = require("@o3r/schematics");
|
|
9
9
|
const configuration_1 = require("../rule-factories/component/configuration");
|
|
10
10
|
const theming_1 = require("../rule-factories/component/theming");
|
|
11
11
|
const localization_1 = require("../rule-factories/component/localization");
|
|
12
12
|
const fixture_1 = require("../rule-factories/component/fixture");
|
|
13
|
-
const ast_utils_1 = require("@schematics/angular/utility/ast-utils");
|
|
14
13
|
/**
|
|
15
14
|
* Add a Page to an Otter project
|
|
16
|
-
*
|
|
17
15
|
* @param options
|
|
18
16
|
*/
|
|
19
17
|
function ngGeneratePage(options) {
|
|
20
18
|
const isApplication = (tree) => {
|
|
21
|
-
const workspaceProject = (0, schematics_2.
|
|
19
|
+
const workspaceProject = options.projectName ? (0, schematics_2.getWorkspaceConfig)(tree)?.projects[options.projectName] : undefined;
|
|
22
20
|
if (!workspaceProject) {
|
|
23
|
-
throw new
|
|
21
|
+
throw new schematics_2.O3rCliError('Cannot create a page on library');
|
|
24
22
|
}
|
|
25
23
|
return tree;
|
|
26
24
|
};
|
|
27
25
|
const pageName = core_1.strings.classify(options.name);
|
|
28
26
|
/**
|
|
29
27
|
* Generates page files.
|
|
30
|
-
*
|
|
31
28
|
* @param tree File tree
|
|
32
29
|
* @param context Context of the rule
|
|
33
30
|
*/
|
|
34
31
|
const generateFiles = (tree, context) => {
|
|
35
|
-
const workspaceProject = (0, schematics_2.
|
|
32
|
+
const workspaceProject = options.projectName ? (0, schematics_2.getWorkspaceConfig)(tree)?.projects[options.projectName] : undefined;
|
|
36
33
|
if (!workspaceProject) {
|
|
37
34
|
context.logger.warn('No application detected in this project, the page cannot be generated');
|
|
38
35
|
return schematics_1.noop;
|
|
@@ -40,7 +37,7 @@ function ngGeneratePage(options) {
|
|
|
40
37
|
const destination = (0, schematics_2.getDestinationPath)('@o3r/core:page', options.path, tree, options.projectName);
|
|
41
38
|
const pagePath = path.posix.join(destination, core_1.strings.dasherize(options.scope), core_1.strings.dasherize(options.name));
|
|
42
39
|
const dasherizedPageName = core_1.strings.dasherize(options.name);
|
|
43
|
-
const projectName =
|
|
40
|
+
const projectName = options.projectName;
|
|
44
41
|
const componentPath = path.posix.join(pagePath, `${dasherizedPageName}.component.ts`);
|
|
45
42
|
const ngSpecPath = path.posix.join(pagePath, `${dasherizedPageName}.component.spec.ts`);
|
|
46
43
|
const o3rSpecPath = path.posix.join(pagePath, `${dasherizedPageName}.spec.ts`);
|
|
@@ -61,8 +58,7 @@ function ngGeneratePage(options) {
|
|
|
61
58
|
const sourceFileContent = tree.readText(moduleFilePath);
|
|
62
59
|
const sourceFile = ts.createSourceFile(moduleFilePath, sourceFileContent, ts.ScriptTarget.ES2015, true);
|
|
63
60
|
const recorder = tree.beginUpdate(moduleFilePath);
|
|
64
|
-
const
|
|
65
|
-
const moduleIndex = ngModulesMetadata[0] ? ngModulesMetadata[0].pos - ('NgModule'.length + 1) : sourceFileContent.indexOf('@NgModule');
|
|
61
|
+
const { moduleIndex } = (0, schematics_2.getModuleIndex)(sourceFile, sourceFileContent);
|
|
66
62
|
(0, schematics_2.addImportToModuleFile)('RouterModule', '@angular/router', sourceFile, sourceFileContent, context, recorder, moduleFilePath, moduleIndex, `.forChild([{path: '', component: ${core_1.strings.classify(pageName)}Component}])`, true);
|
|
67
63
|
tree.commitUpdate(recorder);
|
|
68
64
|
return tree;
|
|
@@ -128,7 +124,6 @@ function ngGeneratePage(options) {
|
|
|
128
124
|
};
|
|
129
125
|
/**
|
|
130
126
|
* Updates App Routing Module to add the new page route.
|
|
131
|
-
*
|
|
132
127
|
* @param tree File tree
|
|
133
128
|
* @param context Context of the rule
|
|
134
129
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/page/index.ts"],"names":[],"mappings":";;;AAAA,+CAA+C;AAC/C,2DAAgM;AAChM,kCAAkC;AAClC,iCAAiC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/page/index.ts"],"names":[],"mappings":";;;AAAA,+CAA+C;AAC/C,2DAAgM;AAChM,gDASyB;AACzB,kCAAkC;AAClC,iCAAiC;AAEjC,6EAAqF;AACrF,iEAAyE;AACzE,2EAAmF;AACnF,iEAAyE;AAEzE;;;GAGG;AACH,SAAgB,cAAc,CAAC,OAAuC;IAEpE,MAAM,aAAa,GAAG,CAAC,IAA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,CAAC,IAAA,2BAAc,GAAE;KAC/C,CAAC,CAAC;AACL,CAAC;AApMD,wCAoMC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/additional-modules/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,IAAI,EAA0B,MAAM,4BAA4B,CAAC;AAiBjF
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/additional-modules/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,IAAI,EAA0B,MAAM,4BAA4B,CAAC;AAiBjF;;;;;;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,SAAS,EAAE,MAAM,GAAG,IAAI,CAwMrJ"}
|
|
@@ -4,6 +4,7 @@ exports.updateAdditionalModules = void 0;
|
|
|
4
4
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
5
|
const schematics_2 = require("@o3r/schematics");
|
|
6
6
|
const ts = require("typescript");
|
|
7
|
+
const utility_1 = require("@schematics/angular/utility");
|
|
7
8
|
const ast_utils_1 = require("@schematics/angular/utility/ast-utils");
|
|
8
9
|
const change_1 = require("@schematics/angular/utility/change");
|
|
9
10
|
const path = require("node:path");
|
|
@@ -11,7 +12,6 @@ const packageJsonPath = path.resolve(__dirname, '..', '..', '..', 'package.json'
|
|
|
11
12
|
const ngrxStoreDevtoolsDep = '@ngrx/store-devtools';
|
|
12
13
|
/**
|
|
13
14
|
* Add additional modules for dev only
|
|
14
|
-
*
|
|
15
15
|
* @param options @see RuleFactory.options
|
|
16
16
|
* @param options.projectName
|
|
17
17
|
* @param options.workingDirectory the directory where to execute the rule factory
|
|
@@ -20,12 +20,12 @@ const ngrxStoreDevtoolsDep = '@ngrx/store-devtools';
|
|
|
20
20
|
function updateAdditionalModules(options, _rootPath) {
|
|
21
21
|
/**
|
|
22
22
|
* Update package.json to add additional modules dependencies
|
|
23
|
-
*
|
|
24
23
|
* @param tree
|
|
25
24
|
* @param context
|
|
26
25
|
*/
|
|
27
26
|
const updatePackageJson = (tree, context) => {
|
|
28
|
-
const
|
|
27
|
+
const workspaceProject = options.projectName ? (0, schematics_2.getWorkspaceConfig)(tree)?.projects[options.projectName] : undefined;
|
|
28
|
+
const type = (0, schematics_2.getProjectNewDependenciesType)(workspaceProject);
|
|
29
29
|
const generatorDependencies = [ngrxStoreDevtoolsDep];
|
|
30
30
|
try {
|
|
31
31
|
return (0, schematics_2.ngAddPeerDependencyPackages)(generatorDependencies, packageJsonPath, type, { ...options, skipNgAddSchematicRun: true });
|
|
@@ -37,11 +37,11 @@ function updateAdditionalModules(options, _rootPath) {
|
|
|
37
37
|
};
|
|
38
38
|
/**
|
|
39
39
|
* Import additional modules in AppModule
|
|
40
|
-
*
|
|
41
40
|
* @param tree
|
|
42
41
|
* @param context
|
|
43
42
|
*/
|
|
44
43
|
const registerModules = (tree, context) => {
|
|
44
|
+
const additionalRules = [];
|
|
45
45
|
const moduleFilePath = (0, schematics_2.getAppModuleFilePath)(tree, context, options.projectName);
|
|
46
46
|
if (!moduleFilePath) {
|
|
47
47
|
return tree;
|
|
@@ -52,17 +52,12 @@ function updateAdditionalModules(options, _rootPath) {
|
|
|
52
52
|
if ((0, ast_utils_1.isImported)(sourceFile, 'StoreDevtoolsModule', ngrxStoreDevtoolsDep) || (0, ast_utils_1.isImported)(sourceFile, 'additionalModules', '../environments/environment')) {
|
|
53
53
|
return tree;
|
|
54
54
|
}
|
|
55
|
-
const
|
|
56
|
-
const ngModulesMetadata = (0, ast_utils_1.getDecoratorMetadata)(sourceFile, 'NgModule', '@angular/core');
|
|
57
|
-
const moduleIndex = ngModulesMetadata[0] ? ngModulesMetadata[0].pos - ('NgModule'.length + 1) : sourceFileContent.indexOf('@NgModule');
|
|
58
|
-
const addImportToModuleFile = (name, file, moduleFunction) => (0, schematics_2.addImportToModuleFile)(name, file, sourceFile, sourceFileContent, context, recorder, moduleFilePath, moduleIndex, moduleFunction);
|
|
55
|
+
const addImportToModuleFile = (name, file, moduleFunction) => additionalRules.push((0, utility_1.addRootImport)(options.projectName, ({ code, external }) => code `${external(name, file)}${moduleFunction}`));
|
|
59
56
|
addImportToModuleFile('additionalModules', '../environments/environment');
|
|
60
|
-
|
|
61
|
-
return tree;
|
|
57
|
+
return (0, schematics_1.chain)(additionalRules)(tree, context);
|
|
62
58
|
};
|
|
63
59
|
/**
|
|
64
60
|
* Register additional modules for development
|
|
65
|
-
*
|
|
66
61
|
* @param tree
|
|
67
62
|
* @param context
|
|
68
63
|
*/
|
|
@@ -76,16 +71,17 @@ function updateAdditionalModules(options, _rootPath) {
|
|
|
76
71
|
if ((0, ast_utils_1.isImported)(sourceFile, 'StoreDevtoolsModule', ngrxStoreDevtoolsDep)) {
|
|
77
72
|
return tree;
|
|
78
73
|
}
|
|
79
|
-
const workspaceProject = (0, schematics_2.
|
|
74
|
+
const workspaceProject = options.projectName ? (0, schematics_2.getWorkspaceConfig)(tree)?.projects[options.projectName] : undefined;
|
|
80
75
|
if (!workspaceProject) {
|
|
81
76
|
context.logger.warn('No application detected in the project, the development modules will not be added.');
|
|
82
77
|
return tree;
|
|
83
78
|
}
|
|
79
|
+
const mainFilePath = workspaceProject.architect.build.options.main ?? workspaceProject.architect.build.options.browser;
|
|
84
80
|
// supposing we are in ng 15, the env dev file name is environment.development.ts
|
|
85
|
-
let envDevFilePath = path.join(path.dirname(
|
|
81
|
+
let envDevFilePath = path.join(path.dirname(mainFilePath), 'environments', 'environment.development.ts');
|
|
86
82
|
if (!tree.exists(envDevFilePath)) {
|
|
87
83
|
// we are in ng 14, environment dev file name is: environment.ts
|
|
88
|
-
envDevFilePath = path.join(path.dirname(
|
|
84
|
+
envDevFilePath = path.join(path.dirname(mainFilePath), 'environments', 'environment.ts');
|
|
89
85
|
}
|
|
90
86
|
if (!tree.exists(envDevFilePath)) { // if we don't use the env setup, we skip the step
|
|
91
87
|
context.logger.warn(` Cannot find environment in ${envDevFilePath}`);
|
|
@@ -109,7 +105,6 @@ function updateAdditionalModules(options, _rootPath) {
|
|
|
109
105
|
};
|
|
110
106
|
/**
|
|
111
107
|
* Register additional modules for production
|
|
112
|
-
*
|
|
113
108
|
* @param tree
|
|
114
109
|
* @param context
|
|
115
110
|
*/
|
|
@@ -123,16 +118,17 @@ function updateAdditionalModules(options, _rootPath) {
|
|
|
123
118
|
if ((0, ast_utils_1.isImported)(sourceFile, 'StoreDevtoolsModule', ngrxStoreDevtoolsDep)) {
|
|
124
119
|
return tree;
|
|
125
120
|
}
|
|
126
|
-
const workspaceProject = (0, schematics_2.
|
|
121
|
+
const workspaceProject = options.projectName ? (0, schematics_2.getWorkspaceConfig)(tree)?.projects[options.projectName] : undefined;
|
|
127
122
|
if (!workspaceProject) {
|
|
128
123
|
context.logger.warn('No application detected in the project, the development modules will not be added.');
|
|
129
124
|
return tree;
|
|
130
125
|
}
|
|
126
|
+
const mainFilePath = workspaceProject.architect.build.options.main ?? workspaceProject.architect.build.options.browser;
|
|
131
127
|
// supposing we are in ng 14, environment prod file name is: environment.prod.ts
|
|
132
|
-
let envProdFilePath = path.join(path.dirname(
|
|
128
|
+
let envProdFilePath = path.join(path.dirname(mainFilePath), 'environments', 'environment.prod.ts');
|
|
133
129
|
if (!tree.exists(envProdFilePath)) {
|
|
134
130
|
// we are in ng 15, environment prod file name is: environment.ts
|
|
135
|
-
envProdFilePath = path.join(path.dirname(
|
|
131
|
+
envProdFilePath = path.join(path.dirname(mainFilePath), 'environments', 'environment.ts');
|
|
136
132
|
}
|
|
137
133
|
if (!tree.exists(envProdFilePath)) { // if we don't use the env setup, we skip the step
|
|
138
134
|
context.logger.warn(` Cannot find environment in ${envProdFilePath}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../schematics/rule-factories/additional-modules/index.ts"],"names":[],"mappings":";;;AAAA,2DAAiF;AACjF,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../schematics/rule-factories/additional-modules/index.ts"],"names":[],"mappings":";;;AAAA,2DAAiF;AACjF,gDAKyB;AACzB,iCAAiC;AACjC,yDAA4D;AAC5D,qEAAiF;AACjF,+DAAkE;AAElE,kCAAkC;AAElC,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;AAClF,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;AAEpD;;;;;;GAMG;AACH,SAAgB,uBAAuB,CAAC,OAAoF,EAAE,SAAiB;IAC7I;;;;OAIG;IACH,MAAM,iBAAiB,GAAS,CAAC,IAAU,EAAE,OAAyB,EAAE,EAAE;QACxE,MAAM,gBAAgB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,IAAA,+BAAkB,EAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACnH,MAAM,IAAI,GAAuB,IAAA,0CAA6B,EAAC,gBAAgB,CAAC,CAAC;QACjF,MAAM,qBAAqB,GAAG,CAAC,oBAAoB,CAAC,CAAC;QAErD,IAAI;YACF,OAAO,IAAA,wCAA2B,EAAC,qBAAqB,EAAE,eAAe,EAAE,IAAI,EAAE,EAAC,GAAG,OAAO,EAAE,qBAAqB,EAAE,IAAI,EAAC,CAAC,CAAC;SAC7H;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,wCAAwC,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,eAAe,EAAE,CAAC,CAAC;SAC5H;QACD,OAAO,IAAI,CAAC;IAEd,CAAC,CAAC;IAEF;;;;OAIG;IACH,MAAM,eAAe,GAAS,C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AE,CAAC,QAAQ,EAAE,EACtC,EAAE,CAAC,YAAY,CAAC,MAAM,EACtB,IAAI,CACL,CAAC;QAEF,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;QAElD,MAAM,cAAc,GAAG,IAAI,MAAM,CAAC,oCAAoC,EAAE,GAAG,CAAC,CAAC;QAE7E,yHAAyH;QACzH,IAAI,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE;YACnC,OAAO,IAAI,CAAC;SACb;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;QAEnD,QAAQ,CAAC,WAAW,CAAC,iBAAiB,CAAC,MAAM,EAAE,EAAE,0CAA0C,CAAC,CAAC;QAE7F,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;QAE5B,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;IAEF,OAAO,IAAA,kBAAK,EAAC;QACX,iBAAiB;QACjB,eAAe;QACf,4BAA4B;QAC5B,6BAA6B;KAC9B,CAAC,CAAC;AACL,CAAC;AAxMD,0DAwMC"}
|
|
@@ -24,7 +24,7 @@ const askQuestionsToGetRulesOrThrowIfPackageNotAvailable = (path, optionName, de
|
|
|
24
24
|
try {
|
|
25
25
|
const packageJson = tree.readJson('./package.json');
|
|
26
26
|
if (!packageJson.dependencies?.[packageName] && !packageJson.devDependencies?.[packageName]) {
|
|
27
|
-
throw new
|
|
27
|
+
throw new schematics_2.O3rCliError(`Package ${packageName} not installed`);
|
|
28
28
|
}
|
|
29
29
|
if (typeof applyRule !== 'boolean' && context.interactive) {
|
|
30
30
|
applyRule = await (0, prompt_1.askConfirmation)(ruleQuestion, true);
|
|
@@ -57,7 +57,7 @@ const askQuestionsToGetRulesOrThrowIfPackageNotAvailable = (path, optionName, de
|
|
|
57
57
|
}
|
|
58
58
|
catch {
|
|
59
59
|
if (applyRule) {
|
|
60
|
-
throw new
|
|
60
|
+
throw new schematics_2.O3rCliError(`
|
|
61
61
|
You need to install '${packageName}' to be able to generate component with the option ${optionName}.
|
|
62
62
|
Please run 'ng add ${packageName}'.
|
|
63
63
|
`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../schematics/rule-factories/component/common.ts"],"names":[],"mappings":";;;AAAA,2DAAqH;AACrH,8DAAiF;AACjF,
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../schematics/rule-factories/component/common.ts"],"names":[],"mappings":";;;AAAA,2DAAqH;AACrH,8DAAiF;AACjF,gDAAmG;AAGnG;;;;;;;;;;;;GAYG;AACI,MAAM,kDAAkD,GAAG,CAChE,IAAY,EACZ,UAAkB,EAClB,gBAA4C,EAC5C,YAAoB,EACpB,sBAAgC,EAChC,WAAmB,EACnB,aAAqB,EACrB,mBAAwB,EAAE,EACpB,EAAE;IACR,IAAI,SAAS,GAAG,gBAAgB,CAAC;IACjC,IAAI,eAAe,GAAkB,IAAI,CAAC;IAC1C,OAAO,KAAK,EAAE,IAAU,EAAE,OAAyB,EAAE,EAAE;QACrD,IAAI;YACF,MAAM,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAgB,CAAC;YACnE,IAAI,CAAC,WAAW,CAAC,YAAY,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,eAAe,EAAE,CAAC,WAAW,CAAC,EAAE;gBAC3F,MAAM,IAAI,wBAAW,CAAC,WAAW,WAAW,gBAAgB,CAAC,CAAC;aAC/D;YACD,IAAI,OAAO,SAAS,KAAK,SAAS,IAAI,OAAO,CAAC,WAAW,EAAE;gBACzD,SAAS,GAAG,MAAM,IAAA,wBAAe,EAAC,YAAY,EAAE,IAAI,CAAC,CAAC;gBACtD,IAAI,SAAS,EAAE;oBACb,eAAe,GAAG,MAAM,IAAA,oBAAW,EAAC,mCAAmC,UAAU,cAAc,EAAE;wBAC/F;4BACE,IAAI,EAAE,QAAQ;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AAC,CAAC,iBAAI,CAAC;IACZ,CAAC,CAAC;AACJ,CAAC,CAAC;AA5EW,QAAA,kDAAkD,sDA4E7D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/customization-environment/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,IAAI,EAML,MAAM,4BAA4B,CAAC;AAUpC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/customization-environment/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,IAAI,EAML,MAAM,4BAA4B,CAAC;AAUpC;;;;;;;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,CAkGnK"}
|
|
@@ -3,13 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.updateCustomizationEnvironment = void 0;
|
|
4
4
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
5
|
const schematics_2 = require("@o3r/schematics");
|
|
6
|
+
const utility_1 = require("@schematics/angular/utility");
|
|
6
7
|
const ast_utils_1 = require("@schematics/angular/utility/ast-utils");
|
|
7
|
-
const change_1 = require("@schematics/angular/utility/change");
|
|
8
8
|
const dependencies_1 = require("@schematics/angular/utility/dependencies");
|
|
9
9
|
const node_path_1 = require("node:path");
|
|
10
10
|
/**
|
|
11
11
|
* Enable customization capabilities
|
|
12
|
-
*
|
|
13
12
|
* @param rootPath @see RuleFactory.rootPath
|
|
14
13
|
* @param o3rCoreVersion
|
|
15
14
|
* @param options
|
|
@@ -19,12 +18,11 @@ const node_path_1 = require("node:path");
|
|
|
19
18
|
function updateCustomizationEnvironment(rootPath, o3rCoreVersion, options, isLibrary) {
|
|
20
19
|
/**
|
|
21
20
|
* Generate customization folder
|
|
22
|
-
*
|
|
23
21
|
* @param tree
|
|
24
22
|
* @param context
|
|
25
23
|
*/
|
|
26
24
|
const generateC11nFolder = (tree, context) => {
|
|
27
|
-
const workingDirectory = (0, schematics_2.
|
|
25
|
+
const workingDirectory = options?.projectName && (0, schematics_2.getWorkspaceConfig)(tree)?.projects[options.projectName]?.root || '.';
|
|
28
26
|
if (tree.exists(node_path_1.posix.join(workingDirectory, 'src', 'customization', 'presenters-map.empty.ts'))) {
|
|
29
27
|
return tree;
|
|
30
28
|
}
|
|
@@ -37,11 +35,11 @@ function updateCustomizationEnvironment(rootPath, o3rCoreVersion, options, isLib
|
|
|
37
35
|
};
|
|
38
36
|
/**
|
|
39
37
|
* Edit main module with the customization required information
|
|
40
|
-
*
|
|
41
38
|
* @param tree
|
|
42
39
|
* @param context
|
|
43
40
|
*/
|
|
44
41
|
const registerModules = (tree, context) => {
|
|
42
|
+
const additionalRules = [];
|
|
45
43
|
const fileInfo = (0, schematics_2.getFileInfo)(tree, context, options?.projectName);
|
|
46
44
|
if (!fileInfo.moduleFilePath || !fileInfo.appModuleFile || !fileInfo.sourceFile) {
|
|
47
45
|
return tree;
|
|
@@ -52,36 +50,17 @@ function updateCustomizationEnvironment(rootPath, o3rCoreVersion, options, isLib
|
|
|
52
50
|
}
|
|
53
51
|
const fileContent = tree.readText(fileInfo.moduleFilePath).replace(/[\r\n ]*/g, '');
|
|
54
52
|
const recorder = tree.beginUpdate(fileInfo.moduleFilePath);
|
|
55
|
-
const moduleIndex = fileInfo.
|
|
56
|
-
fileInfo.ngModulesMetadata[0].pos - ('NgModule'.length + 1) : fileInfo.appModuleFile.indexOf('@NgModule');
|
|
53
|
+
const moduleIndex = fileInfo.moduleIndex;
|
|
57
54
|
/**
|
|
58
55
|
* Insert import on top of the main module file
|
|
59
|
-
*
|
|
60
56
|
* @param rec
|
|
61
57
|
* @param name
|
|
62
58
|
* @param file
|
|
63
59
|
* @param isDefault
|
|
64
60
|
*/
|
|
65
61
|
const insertImportToModuleFile = (rec, name, file, isDefault) => (0, schematics_2.insertImportToModuleFile)(name, file, fileInfo.sourceFile, rec, fileInfo.moduleFilePath, isDefault);
|
|
66
|
-
/**
|
|
67
|
-
* Add elements in the metadata of the ngModule (customComponents, imports etc.)
|
|
68
|
-
*
|
|
69
|
-
* @param rec
|
|
70
|
-
* @param metadataField
|
|
71
|
-
* @param name
|
|
72
|
-
*/
|
|
73
|
-
const addToNgModuleMetadata = (rec, metadataField, name) => {
|
|
74
|
-
(0, ast_utils_1.addSymbolToNgModuleMetadata)(fileInfo.sourceFile, fileInfo.moduleFilePath, metadataField, name)
|
|
75
|
-
.forEach((change) => {
|
|
76
|
-
if (change instanceof change_1.InsertChange) {
|
|
77
|
-
rec = rec.insertLeft(change.pos, change.toAdd);
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
return rec;
|
|
81
|
-
};
|
|
82
62
|
/**
|
|
83
63
|
* Add custom code before the module definition
|
|
84
|
-
*
|
|
85
64
|
* @param rec
|
|
86
65
|
* @param line
|
|
87
66
|
*/
|
|
@@ -91,17 +70,17 @@ function updateCustomizationEnvironment(rootPath, o3rCoreVersion, options, isLib
|
|
|
91
70
|
updatedRecorder = insertImportToModuleFile(updatedRecorder, 'registerCustomComponents', '../customization/presenters-map.empty');
|
|
92
71
|
updatedRecorder = insertImportToModuleFile(updatedRecorder, 'Provider', '@angular/core');
|
|
93
72
|
updatedRecorder = insertImportToModuleFile(updatedRecorder, 'initializeCustomProviders', '../customization/custom-providers.empty');
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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})`));
|
|
97
76
|
updatedRecorder = insertImportToModuleFile(updatedRecorder, 'C11nModule', '@o3r/components');
|
|
98
77
|
updatedRecorder = insertBeforeModule(updatedRecorder, 'const entry = initializeEntryComponents();');
|
|
99
78
|
updatedRecorder = insertBeforeModule(updatedRecorder, 'const customProviders: Provider[] = initializeCustomProviders();');
|
|
100
79
|
tree.commitUpdate(updatedRecorder);
|
|
101
|
-
return tree;
|
|
80
|
+
return (0, schematics_1.chain)(additionalRules)(tree, context);
|
|
102
81
|
};
|
|
103
82
|
return (tree, _context) => {
|
|
104
|
-
const workingDirectory = (0, schematics_2.
|
|
83
|
+
const workingDirectory = options?.projectName && (0, schematics_2.getWorkspaceConfig)(tree)?.projects[options.projectName]?.root || '.';
|
|
105
84
|
return (0, schematics_1.chain)([
|
|
106
85
|
generateC11nFolder,
|
|
107
86
|
registerModules,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../schematics/rule-factories/customization-environment/index.ts"],"names":[],"mappings":";;;AAAA,2DAaoC;AACpC,gDAGyB;AACzB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../schematics/rule-factories/customization-environment/index.ts"],"names":[],"mappings":";;;AAAA,2DAaoC;AACpC,gDAGyB;AACzB,yDAA6E;AAC7E,qEAAmE;AACnE,2EAA8E;AAC9E,yCAAkC;AAElC;;;;;;;GAOG;AACH,SAAgB,8BAA8B,CAAC,QAAgB,EAAE,cAAuB,EAAE,OAA8C,EAAE,SAAmB;IAC3J;;;;OAIG;IACH,MAAM,kBAAkB,GAAG,CAAC,IAAU,EAAE,OAAyB,EAAE,EAAE;QACnE,MAAM,gBAAgB,GAAG,OAAO,EAAE,WAAW,IAAI,IAAA,+BAAkB,EAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,IAAI,IAAI,GAAG,CAAC;QACtH,IAAI,IAA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AC,EAAE,EAAE,CAAC,IAAI,CAAA,kEAAkE,CAAC,CAAC,CAAC;QAC/I,eAAe,GAAG,wBAAwB,CAAC,eAAe,EAAE,YAAY,EAAE,iBAAiB,CAAC,CAAC;QAE7F,eAAe,GAAG,kBAAkB,CAAC,eAAe,EAAE,4CAA4C,CAAC,CAAC;QAEpG,eAAe,GAAG,kBAAkB,CAAC,eAAe,EAAE,kEAAkE,CAAC,CAAC;QAE1H,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC;QAEnC,OAAO,IAAA,kBAAK,EAAC,eAAe,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC/C,CAAC,CAAC;IAEF,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE;QACxB,MAAM,gBAAgB,GAAG,OAAO,EAAE,WAAW,IAAI,IAAA,+BAAkB,EAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,IAAI,IAAI,GAAG,CAAC;QAEtH,OAAO,IAAA,kBAAK,EAAC;YACX,kBAAkB;YAClB,eAAe;YACf,IAAA,0BAAa,EAAC,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,EAAE;gBACvD,gBAAgB,EAAE,IAAI;gBACtB,OAAO,EAAE,cAAc;gBACvB,iBAAiB,EAAE,8CAA8C;gBACjE,WAAW,EAAE,OAAO,EAAE,WAAW;gBACjC,cAAc,EAAE,SAAS,CAAC,CAAC,CAAC,iCAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,iCAAkB,CAAC,OAAO;gBAChF,gBAAgB;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAlGD,wEAkGC"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
export * from './o3r-basic-updates/index';
|
|
2
2
|
export * from './additional-modules/index';
|
|
3
|
-
export * from './azure-pipeline/index';
|
|
4
3
|
export * from './customization-environment/index';
|
|
5
4
|
export * from './otter-environment/index';
|
|
6
5
|
export * from './playwright/index';
|
|
7
|
-
export * from './renovate/index';
|
|
8
6
|
export * from './store/index';
|
|
9
|
-
export * from './monorepo/index';
|
|
10
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/rule-factories/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/rule-factories/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mCAAmC,CAAC;AAClD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC"}
|
|
@@ -3,11 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./o3r-basic-updates/index"), exports);
|
|
5
5
|
tslib_1.__exportStar(require("./additional-modules/index"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./azure-pipeline/index"), exports);
|
|
7
6
|
tslib_1.__exportStar(require("./customization-environment/index"), exports);
|
|
8
7
|
tslib_1.__exportStar(require("./otter-environment/index"), exports);
|
|
9
8
|
tslib_1.__exportStar(require("./playwright/index"), exports);
|
|
10
|
-
tslib_1.__exportStar(require("./renovate/index"), exports);
|
|
11
9
|
tslib_1.__exportStar(require("./store/index"), exports);
|
|
12
|
-
tslib_1.__exportStar(require("./monorepo/index"), exports);
|
|
13
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/rule-factories/index.ts"],"names":[],"mappings":";;;AAAA,oEAA0C;AAC1C,qEAA2C;AAC3C,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/rule-factories/index.ts"],"names":[],"mappings":";;;AAAA,oEAA0C;AAC1C,qEAA2C;AAC3C,4EAAkD;AAClD,oEAA0C;AAC1C,6DAAmC;AACnC,wDAA8B"}
|
|
@@ -2,10 +2,9 @@ import { Rule } from '@angular-devkit/schematics';
|
|
|
2
2
|
import { WorkspaceProject } from '@o3r/schematics';
|
|
3
3
|
/**
|
|
4
4
|
* Package.json updates to include o3r ng update script
|
|
5
|
-
* Install of dev-tools and schematics packages
|
|
6
|
-
*
|
|
7
5
|
* @param pName project name
|
|
8
6
|
* @param o3rCoreVersion
|
|
7
|
+
* @param _o3rCoreVersion
|
|
9
8
|
* @param projectType
|
|
10
9
|
*/
|
|
11
10
|
export declare function o3rBasicUpdates(pName: string | null | undefined, _o3rCoreVersion?: string, projectType?: WorkspaceProject['projectType']): Rule;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/o3r-basic-updates/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAA0B,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAInD
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/o3r-basic-updates/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAA0B,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAInD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,eAAe,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,gBAAgB,CAAC,aAAa,CAAC,GAAG,IAAI,CAqC/I"}
|
|
@@ -4,10 +4,9 @@ exports.o3rBasicUpdates = void 0;
|
|
|
4
4
|
const schematics_1 = require("@o3r/schematics");
|
|
5
5
|
/**
|
|
6
6
|
* Package.json updates to include o3r ng update script
|
|
7
|
-
* Install of dev-tools and schematics packages
|
|
8
|
-
*
|
|
9
7
|
* @param pName project name
|
|
10
8
|
* @param o3rCoreVersion
|
|
9
|
+
* @param _o3rCoreVersion
|
|
11
10
|
* @param projectType
|
|
12
11
|
*/
|
|
13
12
|
function o3rBasicUpdates(pName, _o3rCoreVersion, projectType) {
|
|
@@ -18,8 +17,12 @@ function o3rBasicUpdates(pName, _o3rCoreVersion, projectType) {
|
|
|
18
17
|
packageJsonObj.scripts['update:otter'] = 'ng update @o3r/core';
|
|
19
18
|
tree.overwrite(packageJsonPath, JSON.stringify(packageJsonObj, null, 2));
|
|
20
19
|
};
|
|
21
|
-
return (tree,
|
|
22
|
-
const workspace = (0, schematics_1.
|
|
20
|
+
return (tree, context) => {
|
|
21
|
+
const workspace = (0, schematics_1.getWorkspaceConfig)(tree);
|
|
22
|
+
if (!workspace) {
|
|
23
|
+
context.logger.error('No workspace detected');
|
|
24
|
+
return tree;
|
|
25
|
+
}
|
|
23
26
|
if (!projectType) { // at the root of the monorepo
|
|
24
27
|
const rootPackageJsonPath = '/package.json';
|
|
25
28
|
if (tree.exists(rootPackageJsonPath)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../schematics/rule-factories/o3r-basic-updates/index.ts"],"names":[],"mappings":";;;AAEA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../schematics/rule-factories/o3r-basic-updates/index.ts"],"names":[],"mappings":";;;AAEA,gDAAsE;AAGtE;;;;;;GAMG;AACH,SAAgB,eAAe,CAAC,KAAgC,EAAE,eAAwB,EAAE,WAA6C;IAEvI,MAAM,cAAc,GAAG,CAAC,IAAU,EAAE,cAA2B,EAAE,eAAe,GAAG,eAAe,EAAE,EAAE;QACpG,IAAI,CAAC,cAAc,CAAC,OAA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;AAEJ,CAAC;AArCD,0CAqCC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/otter-environment/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,IAAI,EAA0B,MAAM,4BAA4B,CAAC;AAOjF
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/otter-environment/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,IAAI,EAA0B,MAAM,4BAA4B,CAAC;AAOjF;;;;;;;;;;;GAWG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE;IACP,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACxC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC,EACD,SAAS,EAAE,MAAM,GAChB,IAAI,CAmJN"}
|