@ngxs/store 3.8.2 → 18.0.0-dev.master-f4c2c19
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 +1 -1
- package/{esm2015/index.js → esm2022/index.mjs} +2 -2
- package/esm2022/internals/custom-rxjs-subjects.mjs +92 -0
- package/esm2022/internals/index.mjs +10 -0
- package/esm2022/internals/initial-state.mjs +18 -0
- package/esm2022/internals/internal-tokens.mjs +6 -0
- package/esm2022/internals/memoize.mjs +45 -0
- package/esm2022/internals/metadata.mjs +57 -0
- package/esm2022/internals/ngxs-app-bootstrapped-state.mjs +19 -0
- package/esm2022/internals/state-stream.mjs +32 -0
- package/esm2022/internals/state-token.mjs +17 -0
- package/esm2022/internals/symbols.mjs +11 -0
- package/esm2022/internals/testing/fresh-platform.mjs +72 -0
- package/{esm2015/internals/testing/helpers/ngxs-test.component.js → esm2022/internals/testing/helpers/ngxs-test.component.mjs} +4 -4
- package/esm2022/internals/testing/helpers/ngxs-test.module.mjs +20 -0
- package/{esm2015/internals/testing/index.js → esm2022/internals/testing/index.mjs} +2 -2
- package/esm2022/internals/testing/ngxs.setup.mjs +48 -0
- package/{esm2015/internals/testing/skip-console-logging.js → esm2022/internals/testing/skip-console-logging.mjs} +1 -1
- package/esm2022/internals/testing/symbol.mjs +2 -0
- package/esm2022/operators/append.mjs +20 -0
- package/esm2022/operators/iif.mjs +38 -0
- package/esm2022/operators/insert-item.mjs +29 -0
- package/esm2022/operators/patch.mjs +21 -0
- package/esm2022/operators/remove-item.mjs +22 -0
- package/esm2022/operators/update-item.mjs +40 -0
- package/esm2022/plugins/actions.mjs +16 -0
- package/esm2022/plugins/index.mjs +4 -0
- package/esm2022/plugins/ngxs-store-plugins.mjs +5 -0
- package/esm2022/plugins/symbols.mjs +6 -0
- package/esm2022/plugins/utils.mjs +51 -0
- package/esm2022/src/actions/symbols.mjs +2 -0
- package/esm2022/src/actions-stream.mjs +52 -0
- package/esm2022/src/configs/messages.config.mjs +48 -0
- package/esm2022/src/decorators/action.mjs +31 -0
- package/esm2022/src/decorators/select/select-factory.mjs +29 -0
- package/esm2022/src/decorators/select/select.mjs +29 -0
- package/esm2022/src/decorators/select/symbols.mjs +29 -0
- package/esm2022/src/decorators/selector/selector.mjs +29 -0
- package/esm2022/src/decorators/selector/symbols.mjs +2 -0
- package/esm2022/src/decorators/selector-options.mjs +21 -0
- package/esm2022/src/decorators/state.mjs +35 -0
- package/esm2022/src/dev-features/ngxs-development.module.mjs +28 -0
- package/esm2022/src/dev-features/ngxs-unhandled-actions-logger.mjs +45 -0
- package/esm2022/src/dev-features/symbols.mjs +7 -0
- package/esm2022/src/execution/dispatch-outside-zone-ngxs-execution-strategy.mjs +55 -0
- package/{esm2015/src/execution/internal-ngxs-execution-strategy.js → esm2022/src/execution/internal-ngxs-execution-strategy.mjs} +6 -6
- package/{esm2015/src/execution/noop-ngxs-execution-strategy.js → esm2022/src/execution/noop-ngxs-execution-strategy.mjs} +4 -4
- package/esm2022/src/execution/symbols.mjs +29 -0
- package/esm2022/src/internal/dispatcher.mjs +106 -0
- package/esm2022/src/internal/fallback-subscriber.mjs +29 -0
- package/esm2022/src/internal/internals.mjs +206 -0
- package/esm2022/src/internal/lifecycle-state-manager.mjs +86 -0
- package/esm2022/src/internal/state-context-factory.mjs +71 -0
- package/esm2022/src/internal/state-factory.mjs +311 -0
- package/esm2022/src/internal/state-operations.mjs +63 -0
- package/esm2022/src/internal/state-operators.mjs +20 -0
- package/esm2022/src/internal/unhandled-rxjs-error-callback.mjs +39 -0
- package/esm2022/src/ivy/ivy-enabled-in-dev-mode.mjs +25 -0
- package/esm2022/src/module.mjs +27 -0
- package/esm2022/src/modules/ngxs-feature.module.mjs +18 -0
- package/esm2022/src/modules/ngxs-root.module.mjs +18 -0
- package/esm2022/src/ngxs-unhandled-error-handler.mjs +29 -0
- package/esm2022/src/operators/of-action.mjs +104 -0
- package/esm2022/src/plugin-manager.mjs +37 -0
- package/esm2022/src/plugin_api.mjs +2 -0
- package/{esm2015/src/private_api.js → esm2022/src/private_api.mjs} +2 -1
- package/esm2022/src/public_api.mjs +20 -0
- package/esm2022/src/selectors/create-model-selector.mjs +30 -0
- package/esm2022/src/selectors/create-pick-selector.mjs +16 -0
- package/esm2022/src/selectors/create-property-selectors.mjs +20 -0
- package/esm2022/src/selectors/create-selector.mjs +9 -0
- package/esm2022/src/selectors/private_api.mjs +2 -0
- package/esm2022/src/selectors/selector-checks.util.mjs +18 -0
- package/esm2022/src/selectors/selector-metadata.mjs +35 -0
- package/esm2022/src/selectors/selector-models.mjs +2 -0
- package/esm2022/src/selectors/selector-types.util.mjs +2 -0
- package/esm2022/src/selectors/selector-utils.mjs +95 -0
- package/esm2022/src/standalone-features/feature-providers.mjs +20 -0
- package/esm2022/src/standalone-features/index.mjs +5 -0
- package/esm2022/src/standalone-features/initializers.mjs +89 -0
- package/esm2022/src/standalone-features/plugin.mjs +20 -0
- package/esm2022/src/standalone-features/preboot.mjs +32 -0
- package/esm2022/src/standalone-features/provide-states.mjs +26 -0
- package/esm2022/src/standalone-features/provide-store.mjs +26 -0
- package/esm2022/src/standalone-features/root-providers.mjs +47 -0
- package/esm2022/src/store.mjs +117 -0
- package/esm2022/src/symbols.mjs +87 -0
- package/esm2022/src/utils/compose.mjs +26 -0
- package/esm2022/src/utils/create-dispatch-map.mjs +11 -0
- package/esm2022/src/utils/create-select-map.mjs +13 -0
- package/esm2022/src/utils/dispatch.mjs +7 -0
- package/{esm2015/src/utils/freeze.js → esm2022/src/utils/freeze.mjs} +1 -1
- package/esm2022/src/utils/public_api.mjs +5 -0
- package/esm2022/src/utils/select.mjs +19 -0
- package/esm2022/src/utils/store-validators.mjs +25 -0
- package/{fesm2015/ngxs-store-internals-testing.js → fesm2022/ngxs-store-internals-testing.mjs} +84 -81
- package/fesm2022/ngxs-store-internals-testing.mjs.map +1 -0
- package/fesm2022/ngxs-store-internals.mjs +296 -0
- package/fesm2022/ngxs-store-internals.mjs.map +1 -0
- package/{fesm2015/ngxs-store-operators.js → fesm2022/ngxs-store-operators.mjs} +3 -3
- package/fesm2022/ngxs-store-operators.mjs.map +1 -0
- package/fesm2022/ngxs-store-plugins.mjs +80 -0
- package/fesm2022/ngxs-store-plugins.mjs.map +1 -0
- package/{fesm2015/ngxs-store.js → fesm2022/ngxs-store.mjs} +1319 -1265
- package/fesm2022/ngxs-store.mjs.map +1 -0
- package/index.d.ts +1 -1
- package/{src/internal → internals}/custom-rxjs-subjects.d.ts +2 -2
- package/internals/index.d.ts +8 -4
- package/internals/initial-state.d.ts +5 -5
- package/internals/memoize.d.ts +1 -1
- package/internals/metadata.d.ts +25 -0
- package/internals/ngxs-app-bootstrapped-state.d.ts +8 -0
- package/internals/state-stream.d.ts +15 -0
- package/internals/state-token.d.ts +7 -0
- package/internals/symbols.d.ts +84 -3
- package/internals/testing/helpers/ngxs-test.component.d.ts +1 -1
- package/internals/testing/index.d.ts +2 -2
- package/internals/testing/symbol.d.ts +2 -2
- package/operators/patch.d.ts +2 -2
- package/operators/types.d.ts +5 -5
- package/operators/utils.d.ts +1 -1
- package/package.json +44 -13
- package/{src/actions → plugins}/actions.d.ts +3 -3
- package/plugins/index.d.ts +3 -0
- package/plugins/symbols.d.ts +13 -0
- package/{src/utils → plugins}/utils.d.ts +0 -17
- package/schematics/collection.json +36 -0
- package/schematics/src/actions/actions.factory.d.ts +3 -0
- package/schematics/src/actions/actions.factory.js +24 -0
- package/schematics/src/actions/actions.factory.js.map +1 -0
- package/schematics/src/actions/files/__name__.actions.ts__template__ +4 -0
- package/schematics/src/actions/schema.json +35 -0
- package/schematics/src/ng-add/add-declaration.d.ts +4 -0
- package/schematics/src/ng-add/add-declaration.js +109 -0
- package/schematics/src/ng-add/add-declaration.js.map +1 -0
- package/schematics/src/ng-add/ng-add.factory.d.ts +9 -0
- package/schematics/src/ng-add/ng-add.factory.js +89 -0
- package/schematics/src/ng-add/ng-add.factory.js.map +1 -0
- package/schematics/src/ng-add/schema.json +72 -0
- package/schematics/src/starter-kit/files/store/auth/auth.actions.ts__template__ +6 -0
- package/schematics/src/starter-kit/files/store/auth/auth.state.spec.ts__template__ +55 -0
- package/schematics/src/starter-kit/files/store/auth/auth.state.ts__template__ +47 -0
- package/schematics/src/starter-kit/files/store/dashboard/index.ts__template__ +4 -0
- package/schematics/src/starter-kit/files/store/dashboard/states/dictionary/dictionary.actions.ts__template__ +10 -0
- package/schematics/src/starter-kit/files/store/dashboard/states/dictionary/dictionary.state.spec.ts__template__ +92 -0
- package/schematics/src/starter-kit/files/store/dashboard/states/dictionary/dictionary.state.ts__template__ +62 -0
- package/schematics/src/starter-kit/files/store/dashboard/states/user/user.actions.ts__template__ +6 -0
- package/schematics/src/starter-kit/files/store/dashboard/states/user/user.state.spec.ts__template__ +61 -0
- package/schematics/src/starter-kit/files/store/dashboard/states/user/user.state.ts__template__ +42 -0
- package/schematics/src/starter-kit/files/store/store.config.ts__template__ +39 -0
- package/schematics/src/starter-kit/files/store/store.module.ts__template__ +22 -0
- package/schematics/src/starter-kit/schema.json +22 -0
- package/schematics/src/starter-kit/starter-kit.factory.d.ts +3 -0
- package/schematics/src/starter-kit/starter-kit.factory.js +21 -0
- package/schematics/src/starter-kit/starter-kit.factory.js.map +1 -0
- package/schematics/src/state/files/__name__.state.spec.ts__template__ +25 -0
- package/schematics/src/state/files/__name__.state.ts__template__ +22 -0
- package/schematics/src/state/schema.json +44 -0
- package/schematics/src/state/state.factory.d.ts +3 -0
- package/schematics/src/state/state.factory.js +29 -0
- package/schematics/src/state/state.factory.js.map +1 -0
- package/schematics/src/store/files/__name__.actions.ts__template__ +4 -0
- package/schematics/src/store/files/__name__.state.spec.ts__template__ +26 -0
- package/schematics/src/store/files/__name__.state.ts__template__ +29 -0
- package/schematics/src/store/schema.json +44 -0
- package/schematics/src/store/store.factory.d.ts +3 -0
- package/schematics/src/store/store.factory.js +29 -0
- package/schematics/src/store/store.factory.js.map +1 -0
- package/schematics/src/utils/common/lib.config.d.ts +10 -0
- package/schematics/src/utils/common/lib.config.js +15 -0
- package/schematics/src/utils/common/lib.config.js.map +1 -0
- package/schematics/src/utils/common/project-files.config.d.ts +3 -0
- package/schematics/src/utils/common/project-files.config.js +7 -0
- package/schematics/src/utils/common/project-files.config.js.map +1 -0
- package/schematics/src/utils/common/properties.d.ts +1 -0
- package/schematics/src/utils/common/properties.js +8 -0
- package/schematics/src/utils/common/properties.js.map +1 -0
- package/schematics/src/utils/config.d.ts +119 -0
- package/schematics/src/utils/config.js +21 -0
- package/schematics/src/utils/config.js.map +1 -0
- package/schematics/src/utils/generate-utils.d.ts +4 -0
- package/schematics/src/utils/generate-utils.js +14 -0
- package/schematics/src/utils/generate-utils.js.map +1 -0
- package/schematics/src/utils/interfaces/package.interface.d.ts +7 -0
- package/schematics/src/utils/interfaces/package.interface.js +3 -0
- package/schematics/src/utils/interfaces/package.interface.js.map +1 -0
- package/schematics/src/utils/ng-utils/README.md +1 -0
- package/schematics/src/utils/ng-utils/ast-utils.d.ts +99 -0
- package/schematics/src/utils/ng-utils/ast-utils.js +517 -0
- package/schematics/src/utils/ng-utils/ast-utils.js.map +1 -0
- package/schematics/src/utils/ng-utils/ng-ast-utils.d.ts +5 -0
- package/schematics/src/utils/ng-utils/ng-ast-utils.js +67 -0
- package/schematics/src/utils/ng-utils/ng-ast-utils.js.map +1 -0
- package/schematics/src/utils/ng-utils/project.d.ts +2 -0
- package/schematics/src/utils/ng-utils/project.js +27 -0
- package/schematics/src/utils/ng-utils/project.js.map +1 -0
- package/schematics/src/utils/ng-utils/standalone/app_config.d.ts +16 -0
- package/schematics/src/utils/ng-utils/standalone/app_config.js +84 -0
- package/schematics/src/utils/ng-utils/standalone/app_config.js.map +1 -0
- package/schematics/src/utils/ng-utils/standalone/code_block.d.ts +46 -0
- package/schematics/src/utils/ng-utils/standalone/code_block.js +73 -0
- package/schematics/src/utils/ng-utils/standalone/code_block.js.map +1 -0
- package/schematics/src/utils/ng-utils/standalone/index.d.ts +1 -0
- package/schematics/src/utils/ng-utils/standalone/index.js +7 -0
- package/schematics/src/utils/ng-utils/standalone/index.js.map +1 -0
- package/schematics/src/utils/ng-utils/standalone/rules.d.ts +38 -0
- package/schematics/src/utils/ng-utils/standalone/rules.js +195 -0
- package/schematics/src/utils/ng-utils/standalone/rules.js.map +1 -0
- package/schematics/src/utils/ng-utils/standalone/util.d.ts +28 -0
- package/schematics/src/utils/ng-utils/standalone/util.js +138 -0
- package/schematics/src/utils/ng-utils/standalone/util.js.map +1 -0
- package/schematics/src/utils/normalize-options.d.ts +11 -0
- package/schematics/src/utils/normalize-options.js +27 -0
- package/schematics/src/utils/normalize-options.js.map +1 -0
- package/schematics/src/utils/project.d.ts +19 -0
- package/schematics/src/utils/project.js +46 -0
- package/schematics/src/utils/project.js.map +1 -0
- package/schematics/src/utils/versions.json +3 -0
- package/src/actions/symbols.d.ts +3 -17
- package/src/actions-stream.d.ts +2 -2
- package/src/configs/messages.config.d.ts +3 -1
- package/src/decorators/action.d.ts +28 -3
- package/src/decorators/select/select.d.ts +3 -0
- package/src/decorators/select/symbols.d.ts +2 -3
- package/src/decorators/selector/selector.d.ts +2 -3
- package/src/decorators/selector/symbols.d.ts +73 -4
- package/src/decorators/selector-options.d.ts +2 -2
- package/src/decorators/state.d.ts +2 -3
- package/src/dev-features/ngxs-development.module.d.ts +1 -0
- package/src/execution/symbols.d.ts +8 -2
- package/src/internal/dispatcher.d.ts +5 -5
- package/src/internal/fallback-subscriber.d.ts +3 -0
- package/src/internal/internals.d.ts +13 -69
- package/src/internal/lifecycle-state-manager.d.ts +6 -6
- package/src/internal/state-factory.d.ts +8 -6
- package/src/internal/state-operations.d.ts +2 -2
- package/src/internal/unhandled-rxjs-error-callback.d.ts +2 -0
- package/src/module.d.ts +3 -14
- package/src/modules/ngxs-feature.module.d.ts +2 -9
- package/src/modules/ngxs-root.module.d.ts +2 -9
- package/src/ngxs-unhandled-error-handler.d.ts +16 -0
- package/src/operators/of-action.d.ts +3 -3
- package/src/plugin-manager.d.ts +1 -1
- package/src/plugin_api.d.ts +1 -5
- package/src/private_api.d.ts +1 -0
- package/src/public_api.d.ts +11 -8
- package/src/selectors/create-model-selector.d.ts +2 -2
- package/src/selectors/create-pick-selector.d.ts +1 -1
- package/src/selectors/create-property-selectors.d.ts +3 -3
- package/src/selectors/create-selector.d.ts +10 -10
- package/src/selectors/private_api.d.ts +7 -0
- package/src/selectors/selector-checks.util.d.ts +2 -2
- package/src/selectors/selector-metadata.d.ts +4 -4
- package/src/selectors/selector-models.d.ts +4 -4
- package/src/selectors/selector-types.util.d.ts +6 -7
- package/src/selectors/selector-utils.d.ts +3 -3
- package/src/standalone-features/feature-providers.d.ts +7 -0
- package/src/standalone-features/index.d.ts +4 -0
- package/src/standalone-features/initializers.d.ts +29 -0
- package/src/standalone-features/plugin.d.ts +17 -0
- package/src/standalone-features/preboot.d.ts +26 -0
- package/src/standalone-features/provide-states.d.ts +18 -0
- package/src/standalone-features/provide-store.d.ts +22 -0
- package/src/standalone-features/root-providers.d.ts +8 -0
- package/src/store.d.ts +13 -15
- package/src/symbols.d.ts +12 -54
- package/src/utils/compose.d.ts +1 -1
- package/src/utils/create-dispatch-map.d.ts +4 -0
- package/src/utils/create-select-map.d.ts +4 -0
- package/src/utils/dispatch.d.ts +2 -0
- package/src/utils/public_api.d.ts +4 -0
- package/src/utils/select.d.ts +16 -0
- package/src/utils/store-validators.d.ts +4 -3
- package/bundles/ngxs-store-internals-testing.umd.js +0 -684
- package/bundles/ngxs-store-internals-testing.umd.js.map +0 -1
- package/bundles/ngxs-store-internals.umd.js +0 -141
- package/bundles/ngxs-store-internals.umd.js.map +0 -1
- package/bundles/ngxs-store-operators.umd.js +0 -224
- package/bundles/ngxs-store-operators.umd.js.map +0 -1
- package/bundles/ngxs-store.umd.js +0 -3076
- package/bundles/ngxs-store.umd.js.map +0 -1
- package/esm2015/internals/index.js +0 -5
- package/esm2015/internals/initial-state.js +0 -17
- package/esm2015/internals/internal-tokens.js +0 -5
- package/esm2015/internals/memoize.js +0 -45
- package/esm2015/internals/ngxs-bootstrapper.js +0 -29
- package/esm2015/internals/src/symbols.js +0 -2
- package/esm2015/internals/symbols.js +0 -2
- package/esm2015/internals/testing/fresh-platform.js +0 -70
- package/esm2015/internals/testing/helpers/ngxs-test.module.js +0 -21
- package/esm2015/internals/testing/ngxs.setup.js +0 -46
- package/esm2015/internals/testing/symbol.js +0 -2
- package/esm2015/operators/append.js +0 -20
- package/esm2015/operators/iif.js +0 -38
- package/esm2015/operators/insert-item.js +0 -29
- package/esm2015/operators/patch.js +0 -21
- package/esm2015/operators/remove-item.js +0 -22
- package/esm2015/operators/update-item.js +0 -40
- package/esm2015/src/actions/actions.js +0 -16
- package/esm2015/src/actions/symbols.js +0 -2
- package/esm2015/src/actions-stream.js +0 -52
- package/esm2015/src/configs/messages.config.js +0 -36
- package/esm2015/src/decorators/action.js +0 -33
- package/esm2015/src/decorators/select/select-factory.js +0 -29
- package/esm2015/src/decorators/select/select.js +0 -26
- package/esm2015/src/decorators/select/symbols.js +0 -29
- package/esm2015/src/decorators/selector/selector.js +0 -32
- package/esm2015/src/decorators/selector/symbols.js +0 -2
- package/esm2015/src/decorators/selector-options.js +0 -21
- package/esm2015/src/decorators/state.js +0 -36
- package/esm2015/src/dev-features/ngxs-development.module.js +0 -22
- package/esm2015/src/dev-features/ngxs-unhandled-actions-logger.js +0 -46
- package/esm2015/src/dev-features/symbols.js +0 -6
- package/esm2015/src/execution/dispatch-outside-zone-ngxs-execution-strategy.js +0 -57
- package/esm2015/src/execution/symbols.js +0 -23
- package/esm2015/src/internal/custom-rxjs-subjects.js +0 -92
- package/esm2015/src/internal/dispatcher.js +0 -104
- package/esm2015/src/internal/error-handler.js +0 -64
- package/esm2015/src/internal/internals.js +0 -248
- package/esm2015/src/internal/lifecycle-state-manager.js +0 -79
- package/esm2015/src/internal/state-context-factory.js +0 -68
- package/esm2015/src/internal/state-factory.js +0 -288
- package/esm2015/src/internal/state-operations.js +0 -63
- package/esm2015/src/internal/state-operators.js +0 -20
- package/esm2015/src/internal/state-stream.js +0 -25
- package/esm2015/src/ivy/ivy-enabled-in-dev-mode.js +0 -25
- package/esm2015/src/module.js +0 -88
- package/esm2015/src/modules/ngxs-feature.module.js +0 -45
- package/esm2015/src/modules/ngxs-root.module.js +0 -41
- package/esm2015/src/operators/of-action.js +0 -102
- package/esm2015/src/plugin-manager.js +0 -37
- package/esm2015/src/plugin_api.js +0 -6
- package/esm2015/src/public_api.js +0 -27
- package/esm2015/src/public_to_deprecate.js +0 -14
- package/esm2015/src/selectors/create-model-selector.js +0 -30
- package/esm2015/src/selectors/create-pick-selector.js +0 -16
- package/esm2015/src/selectors/create-property-selectors.js +0 -20
- package/esm2015/src/selectors/create-selector.js +0 -9
- package/esm2015/src/selectors/selector-checks.util.js +0 -18
- package/esm2015/src/selectors/selector-metadata.js +0 -30
- package/esm2015/src/selectors/selector-models.js +0 -2
- package/esm2015/src/selectors/selector-types.util.js +0 -2
- package/esm2015/src/selectors/selector-utils.js +0 -74
- package/esm2015/src/state-token/state-token.js +0 -17
- package/esm2015/src/state-token/symbols.js +0 -2
- package/esm2015/src/store.js +0 -107
- package/esm2015/src/symbols.js +0 -58
- package/esm2015/src/utils/compose.js +0 -26
- package/esm2015/src/utils/store-validators.js +0 -25
- package/esm2015/src/utils/utils.js +0 -92
- package/fesm2015/ngxs-store-internals-testing.js.map +0 -1
- package/fesm2015/ngxs-store-internals.js +0 -101
- package/fesm2015/ngxs-store-internals.js.map +0 -1
- package/fesm2015/ngxs-store-operators.js.map +0 -1
- package/fesm2015/ngxs-store.js.map +0 -1
- package/internals/ngxs-bootstrapper.d.ts +0 -16
- package/internals/ngxs-store-internals.d.ts +0 -5
- package/internals/package.json +0 -10
- package/internals/src/symbols.d.ts +0 -7
- package/internals/testing/ngxs-store-internals-testing.d.ts +0 -5
- package/internals/testing/package.json +0 -10
- package/ngxs-store.d.ts +0 -5
- package/operators/ngxs-store-operators.d.ts +0 -5
- package/operators/package.json +0 -10
- package/src/internal/error-handler.d.ts +0 -26
- package/src/internal/state-stream.d.ts +0 -14
- package/src/public_to_deprecate.d.ts +0 -21
- package/src/state-token/state-token.d.ts +0 -7
- package/src/state-token/symbols.d.ts +0 -5
- /package/{esm2015/internals/ngxs-store-internals.js → esm2022/internals/ngxs-store-internals.mjs} +0 -0
- /package/{esm2015/internals/testing/ngxs-store-internals-testing.js → esm2022/internals/testing/ngxs-store-internals-testing.mjs} +0 -0
- /package/{esm2015/ngxs-store.js → esm2022/ngxs-store.mjs} +0 -0
- /package/{esm2015/operators/compose.js → esm2022/operators/compose.mjs} +0 -0
- /package/{esm2015/operators/index.js → esm2022/operators/index.mjs} +0 -0
- /package/{esm2015/operators/ngxs-store-operators.js → esm2022/operators/ngxs-store-operators.mjs} +0 -0
- /package/{esm2015/operators/types.js → esm2022/operators/types.mjs} +0 -0
- /package/{esm2015/operators/utils.js → esm2022/operators/utils.mjs} +0 -0
- /package/{esm2015/src/operators/leave-ngxs.js → esm2022/src/operators/leave-ngxs.mjs} +0 -0
- /package/{esm2015/src/selectors/index.js → esm2022/src/selectors/index.mjs} +0 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.state = void 0;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
const properties_1 = require("../utils/common/properties");
|
|
7
|
+
const generate_utils_1 = require("../utils/generate-utils");
|
|
8
|
+
const ng_ast_utils_1 = require("../utils/ng-utils/ng-ast-utils");
|
|
9
|
+
const project_1 = require("../utils/ng-utils/project");
|
|
10
|
+
const normalize_options_1 = require("../utils/normalize-options");
|
|
11
|
+
function state(options) {
|
|
12
|
+
return (host) => {
|
|
13
|
+
if ((0, properties_1.isEmpty)(options.name)) {
|
|
14
|
+
throw new schematics_1.SchematicsException('Invalid options, "name" is required.');
|
|
15
|
+
}
|
|
16
|
+
let isStandalone = options.standalone;
|
|
17
|
+
if (typeof isStandalone !== 'boolean') {
|
|
18
|
+
const mainFile = (0, project_1.getProjectMainFile)(host, options.project);
|
|
19
|
+
isStandalone = !!mainFile && (0, ng_ast_utils_1.isStandaloneApp)(host, mainFile);
|
|
20
|
+
}
|
|
21
|
+
const normalizedOptions = (0, normalize_options_1.normalizeBaseOptions)(host, options);
|
|
22
|
+
const path = options.flat
|
|
23
|
+
? normalizedOptions.path
|
|
24
|
+
: (0, path_1.join)(normalizedOptions.path, normalizedOptions.name);
|
|
25
|
+
return (0, generate_utils_1.generateFiles)((0, schematics_1.url)('./files'), path, Object.assign(Object.assign({}, normalizedOptions), { isStandalone }), options.spec);
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
exports.state = state;
|
|
29
|
+
//# sourceMappingURL=state.factory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.factory.js","sourceRoot":"","sources":["../../../../../packages/store/schematics/src/state/state.factory.ts"],"names":[],"mappings":";;;AAAA,2DAAkF;AAClF,+BAA4B;AAC5B,2DAAqD;AACrD,4DAAwD;AACxD,iEAAiE;AACjE,uDAA+D;AAC/D,kEAAkE;AAGlE,SAAgB,KAAK,CAAC,OAAoB;IACxC,OAAO,CAAC,IAAU,EAAE,EAAE;QACpB,IAAI,IAAA,oBAAO,EAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YAC1B,MAAM,IAAI,gCAAmB,CAAC,sCAAsC,CAAC,CAAC;QACxE,CAAC;QAED,IAAI,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC;QACtC,IAAI,OAAO,YAAY,KAAK,SAAS,EAAE,CAAC;YACtC,MAAM,QAAQ,GAAG,IAAA,4BAAkB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;YAC3D,YAAY,GAAG,CAAC,CAAC,QAAQ,IAAI,IAAA,8BAAe,EAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAC/D,CAAC;QAED,MAAM,iBAAiB,GAAG,IAAA,wCAAoB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC9D,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI;YACvB,CAAC,CAAC,iBAAiB,CAAC,IAAI;YACxB,CAAC,CAAC,IAAA,WAAI,EAAC,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAEzD,OAAO,IAAA,8BAAa,EAClB,IAAA,gBAAG,EAAC,SAAS,CAAC,EACd,IAAI,kCACC,iBAAiB,KAAE,YAAY,KACpC,OAAO,CAAC,IAAI,CACb,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AAxBD,sBAwBC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { TestBed } from '@angular/core/testing';
|
|
2
|
+
import { <% if (isStandalone) { %> provideStore, <% } else { %> NgxsModule, <% } %> Store } from '@ngxs/store';
|
|
3
|
+
import { <%= classify(name) %>State, <%= classify(name) %>StateModel } from './<%= dasherize(name) %>.state';
|
|
4
|
+
import { <%= classify(name) %>Action } from './<%= dasherize(name) %>.actions';
|
|
5
|
+
|
|
6
|
+
describe('<%= classify(name) %> store', () => {
|
|
7
|
+
let store: Store;
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
TestBed.configureTestingModule({
|
|
10
|
+
<% if (isStandalone) { %> providers: [provideStore([<%= classify(name) %>State])]
|
|
11
|
+
<% } else { %> imports: [NgxsModule.forRoot([<%= classify(name) %>State])] <% } %>
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
store = TestBed.inject(Store);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it('should create an action and add an item', () => {
|
|
18
|
+
const expected: <%= classify(name) %>StateModel = {
|
|
19
|
+
items: ['item-1']
|
|
20
|
+
};
|
|
21
|
+
store.dispatch(new <%= classify(name) %>Action('item-1'));
|
|
22
|
+
const actual = store.selectSnapshot(<%= classify(name) %>State.getState);
|
|
23
|
+
expect(actual).toEqual(expected);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import { State, Action, Selector, StateContext } from '@ngxs/store';
|
|
3
|
+
import { <%= classify(name) %>Action } from './<%= dasherize(name) %>.actions';
|
|
4
|
+
|
|
5
|
+
export interface <%= classify(name) %>StateModel {
|
|
6
|
+
items: string[];
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@State<<%= classify(name) %>StateModel>({
|
|
10
|
+
name: '<%= camelize(name) %>',
|
|
11
|
+
defaults: {
|
|
12
|
+
items: []
|
|
13
|
+
}
|
|
14
|
+
})
|
|
15
|
+
@Injectable()
|
|
16
|
+
export class <%= classify(name) %>State {
|
|
17
|
+
|
|
18
|
+
@Selector()
|
|
19
|
+
static getState(state: <%= classify(name) %>StateModel) {
|
|
20
|
+
return state;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@Action(<%= classify(name) %>Action)
|
|
24
|
+
add(ctx: StateContext<<%= classify(name) %>StateModel>, { payload }: <%= classify(name) %>Action) {
|
|
25
|
+
const stateModel = ctx.getState();
|
|
26
|
+
stateModel.items = [...stateModel.items, payload];
|
|
27
|
+
ctx.setState(stateModel);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"$id": "SchematicsNgxsStore",
|
|
4
|
+
"title": "Ngxs Store Options Schema",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"name": {
|
|
8
|
+
"description": "The name of the store.",
|
|
9
|
+
"type": "string",
|
|
10
|
+
"$default": {
|
|
11
|
+
"$source": "argv",
|
|
12
|
+
"index": 0
|
|
13
|
+
},
|
|
14
|
+
"x-prompt": "What name would you like to use for the store?",
|
|
15
|
+
"x-priority": "important"
|
|
16
|
+
},
|
|
17
|
+
"path": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"format": "path",
|
|
20
|
+
"description": "The path to create the store. Relative to the specified (or default) project."
|
|
21
|
+
},
|
|
22
|
+
"spec": {
|
|
23
|
+
"type": "boolean",
|
|
24
|
+
"description": "Specifies if a spec file is generated.",
|
|
25
|
+
"default": true
|
|
26
|
+
},
|
|
27
|
+
"flat": {
|
|
28
|
+
"type": "boolean",
|
|
29
|
+
"default": false,
|
|
30
|
+
"description": "Flag to indicate if a dir is created."
|
|
31
|
+
},
|
|
32
|
+
"project": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"description": "The name of the project.",
|
|
35
|
+
"aliases": ["p"],
|
|
36
|
+
"x-dropdown": "projects"
|
|
37
|
+
},
|
|
38
|
+
"standalone": {
|
|
39
|
+
"type": "boolean",
|
|
40
|
+
"description": "Explicitly set whether should generate standalone APIs for the generated store."
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"required": ["name"]
|
|
44
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.store = void 0;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
const properties_1 = require("../utils/common/properties");
|
|
7
|
+
const generate_utils_1 = require("../utils/generate-utils");
|
|
8
|
+
const ng_ast_utils_1 = require("../utils/ng-utils/ng-ast-utils");
|
|
9
|
+
const project_1 = require("../utils/ng-utils/project");
|
|
10
|
+
const normalize_options_1 = require("../utils/normalize-options");
|
|
11
|
+
function store(options) {
|
|
12
|
+
return (host) => {
|
|
13
|
+
if ((0, properties_1.isEmpty)(options.name)) {
|
|
14
|
+
throw new schematics_1.SchematicsException('Invalid options, "name" is required.');
|
|
15
|
+
}
|
|
16
|
+
let isStandalone = options.standalone;
|
|
17
|
+
if (typeof isStandalone !== 'boolean') {
|
|
18
|
+
const mainFile = (0, project_1.getProjectMainFile)(host, options.project);
|
|
19
|
+
isStandalone = !!mainFile && (0, ng_ast_utils_1.isStandaloneApp)(host, mainFile);
|
|
20
|
+
}
|
|
21
|
+
const normalizedOptions = (0, normalize_options_1.normalizeBaseOptions)(host, options);
|
|
22
|
+
const path = options.flat
|
|
23
|
+
? normalizedOptions.path
|
|
24
|
+
: (0, path_1.join)(normalizedOptions.path, normalizedOptions.name);
|
|
25
|
+
return (0, generate_utils_1.generateFiles)((0, schematics_1.url)('./files'), path, Object.assign(Object.assign({}, normalizedOptions), { isStandalone }), options.spec);
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
exports.store = store;
|
|
29
|
+
//# sourceMappingURL=store.factory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.factory.js","sourceRoot":"","sources":["../../../../../packages/store/schematics/src/store/store.factory.ts"],"names":[],"mappings":";;;AAAA,2DAAkF;AAClF,+BAA4B;AAC5B,2DAAqD;AACrD,4DAAwD;AACxD,iEAAiE;AACjE,uDAA+D;AAC/D,kEAAkE;AAGlE,SAAgB,KAAK,CAAC,OAAoB;IACxC,OAAO,CAAC,IAAU,EAAE,EAAE;QACpB,IAAI,IAAA,oBAAO,EAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YAC1B,MAAM,IAAI,gCAAmB,CAAC,sCAAsC,CAAC,CAAC;QACxE,CAAC;QAED,IAAI,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC;QACtC,IAAI,OAAO,YAAY,KAAK,SAAS,EAAE,CAAC;YACtC,MAAM,QAAQ,GAAG,IAAA,4BAAkB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;YAC3D,YAAY,GAAG,CAAC,CAAC,QAAQ,IAAI,IAAA,8BAAe,EAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAC/D,CAAC;QAED,MAAM,iBAAiB,GAAG,IAAA,wCAAoB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC9D,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI;YACvB,CAAC,CAAC,iBAAiB,CAAC,IAAI;YACxB,CAAC,CAAC,IAAA,WAAI,EAAC,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAEzD,OAAO,IAAA,8BAAa,EAClB,IAAA,gBAAG,EAAC,SAAS,CAAC,EACd,IAAI,kCACC,iBAAiB,KAAE,YAAY,KACpC,OAAO,CAAC,IAAI,CACb,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AAxBD,sBAwBC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare enum LIBRARIES {
|
|
2
|
+
DEVTOOLS = "@ngxs/devtools-plugin",
|
|
3
|
+
FORM = "@ngxs/form-plugin",
|
|
4
|
+
HMR = "@ngxs/hmr-plugin",
|
|
5
|
+
LOGGER = "@ngxs/logger-plugin",
|
|
6
|
+
ROUTER = "@ngxs/router-plugin",
|
|
7
|
+
STORAGE = "@ngxs/storage-plugin",
|
|
8
|
+
STORE = "@ngxs/store",
|
|
9
|
+
WEBSOCKET = "@ngxs/websocket-plugin"
|
|
10
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LIBRARIES = void 0;
|
|
4
|
+
var LIBRARIES;
|
|
5
|
+
(function (LIBRARIES) {
|
|
6
|
+
LIBRARIES["DEVTOOLS"] = "@ngxs/devtools-plugin";
|
|
7
|
+
LIBRARIES["FORM"] = "@ngxs/form-plugin";
|
|
8
|
+
LIBRARIES["HMR"] = "@ngxs/hmr-plugin";
|
|
9
|
+
LIBRARIES["LOGGER"] = "@ngxs/logger-plugin";
|
|
10
|
+
LIBRARIES["ROUTER"] = "@ngxs/router-plugin";
|
|
11
|
+
LIBRARIES["STORAGE"] = "@ngxs/storage-plugin";
|
|
12
|
+
LIBRARIES["STORE"] = "@ngxs/store";
|
|
13
|
+
LIBRARIES["WEBSOCKET"] = "@ngxs/websocket-plugin";
|
|
14
|
+
})(LIBRARIES || (exports.LIBRARIES = LIBRARIES = {}));
|
|
15
|
+
//# sourceMappingURL=lib.config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lib.config.js","sourceRoot":"","sources":["../../../../../../packages/store/schematics/src/utils/common/lib.config.ts"],"names":[],"mappings":";;;AAAA,IAAY,SASX;AATD,WAAY,SAAS;IACnB,+CAAkC,CAAA;IAClC,uCAA0B,CAAA;IAC1B,qCAAwB,CAAA;IACxB,2CAA8B,CAAA;IAC9B,2CAA8B,CAAA;IAC9B,6CAAgC,CAAA;IAChC,kCAAqB,CAAA;IACrB,iDAAoC,CAAA;AACtC,CAAC,EATW,SAAS,yBAAT,SAAS,QASpB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TSCONFIG_SPEC_JSON = exports.ANGULAR_JSON = exports.PACKAGE_JSON = void 0;
|
|
4
|
+
exports.PACKAGE_JSON = 'package.json';
|
|
5
|
+
exports.ANGULAR_JSON = 'angular.json';
|
|
6
|
+
exports.TSCONFIG_SPEC_JSON = 'src/tsconfig.spec.json';
|
|
7
|
+
//# sourceMappingURL=project-files.config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-files.config.js","sourceRoot":"","sources":["../../../../../../packages/store/schematics/src/utils/common/project-files.config.ts"],"names":[],"mappings":";;;AAAa,QAAA,YAAY,GAAG,cAAc,CAAC;AAC9B,QAAA,YAAY,GAAG,cAAc,CAAC;AAC9B,QAAA,kBAAkB,GAAG,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isEmpty(value: string | undefined): boolean;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isEmpty = void 0;
|
|
4
|
+
function isEmpty(value) {
|
|
5
|
+
return typeof value !== 'undefined' && !value.trim().length;
|
|
6
|
+
}
|
|
7
|
+
exports.isEmpty = isEmpty;
|
|
8
|
+
//# sourceMappingURL=properties.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"properties.js","sourceRoot":"","sources":["../../../../../../packages/store/schematics/src/utils/common/properties.ts"],"names":[],"mappings":";;;AAAA,SAAgB,OAAO,CAAC,KAAyB;IAC/C,OAAO,OAAO,KAAK,KAAK,WAAW,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC;AAC9D,CAAC;AAFD,0BAEC"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { Tree } from '@angular-devkit/schematics';
|
|
2
|
+
export interface AppConfig {
|
|
3
|
+
/**
|
|
4
|
+
* Name of the app.
|
|
5
|
+
*/
|
|
6
|
+
name?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Directory where app files are placed.
|
|
9
|
+
*/
|
|
10
|
+
appRoot?: string;
|
|
11
|
+
/**
|
|
12
|
+
* The root directory of the app.
|
|
13
|
+
*/
|
|
14
|
+
root?: string;
|
|
15
|
+
/**
|
|
16
|
+
* The output directory for build results.
|
|
17
|
+
*/
|
|
18
|
+
outDir?: string;
|
|
19
|
+
/**
|
|
20
|
+
* List of application assets.
|
|
21
|
+
*/
|
|
22
|
+
assets?: (string | {
|
|
23
|
+
/**
|
|
24
|
+
* The pattern to match.
|
|
25
|
+
*/
|
|
26
|
+
glob?: string;
|
|
27
|
+
/**
|
|
28
|
+
* The dir to search within.
|
|
29
|
+
*/
|
|
30
|
+
input?: string;
|
|
31
|
+
/**
|
|
32
|
+
* The output path (relative to the outDir).
|
|
33
|
+
*/
|
|
34
|
+
output?: string;
|
|
35
|
+
})[];
|
|
36
|
+
/**
|
|
37
|
+
* URL where files will be deployed.
|
|
38
|
+
*/
|
|
39
|
+
deployUrl?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Base url for the application being built.
|
|
42
|
+
*/
|
|
43
|
+
baseHref?: string;
|
|
44
|
+
/**
|
|
45
|
+
* The runtime platform of the app.
|
|
46
|
+
*/
|
|
47
|
+
platform?: 'browser' | 'server';
|
|
48
|
+
/**
|
|
49
|
+
* The name of the start HTML file.
|
|
50
|
+
*/
|
|
51
|
+
index?: string;
|
|
52
|
+
/**
|
|
53
|
+
* The name of the main entry-point file.
|
|
54
|
+
*/
|
|
55
|
+
main?: string;
|
|
56
|
+
/**
|
|
57
|
+
* The name of the polyfills file.
|
|
58
|
+
*/
|
|
59
|
+
polyfills?: string;
|
|
60
|
+
/**
|
|
61
|
+
* The name of the test entry-point file.
|
|
62
|
+
*/
|
|
63
|
+
test?: string;
|
|
64
|
+
/**
|
|
65
|
+
* The name of the TypeScript configuration file.
|
|
66
|
+
*/
|
|
67
|
+
tsconfig?: string;
|
|
68
|
+
/**
|
|
69
|
+
* The name of the TypeScript configuration file for unit tests.
|
|
70
|
+
*/
|
|
71
|
+
testTsconfig?: string;
|
|
72
|
+
/**
|
|
73
|
+
* The prefix to apply to generated selectors.
|
|
74
|
+
*/
|
|
75
|
+
prefix?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Experimental support for a service worker from @angular/service-worker.
|
|
78
|
+
*/
|
|
79
|
+
serviceWorker?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Global styles to be included in the build.
|
|
82
|
+
*/
|
|
83
|
+
styles?: (string | {
|
|
84
|
+
input?: string;
|
|
85
|
+
[name: string]: any;
|
|
86
|
+
})[];
|
|
87
|
+
/**
|
|
88
|
+
* Options to pass to style preprocessors
|
|
89
|
+
*/
|
|
90
|
+
stylePreprocessorOptions?: {
|
|
91
|
+
/**
|
|
92
|
+
* Paths to include. Paths will be resolved to project root.
|
|
93
|
+
*/
|
|
94
|
+
includePaths?: string[];
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* Global scripts to be included in the build.
|
|
98
|
+
*/
|
|
99
|
+
scripts?: (string | {
|
|
100
|
+
input: string;
|
|
101
|
+
[name: string]: any;
|
|
102
|
+
})[];
|
|
103
|
+
/**
|
|
104
|
+
* Source file for environment config.
|
|
105
|
+
*/
|
|
106
|
+
environmentSource?: string;
|
|
107
|
+
/**
|
|
108
|
+
* Name and corresponding file for environment config.
|
|
109
|
+
*/
|
|
110
|
+
environments?: {
|
|
111
|
+
[name: string]: any;
|
|
112
|
+
};
|
|
113
|
+
appShell?: {
|
|
114
|
+
app: string;
|
|
115
|
+
route: string;
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
export declare function getWorkspacePath(host: Tree): string | undefined;
|
|
119
|
+
export declare function getWorkspace(host: Tree): any;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getWorkspace = exports.getWorkspacePath = void 0;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
function getWorkspacePath(host) {
|
|
6
|
+
const possibleFiles = ['/angular.json', '/.angular.json', '/workspace.json'];
|
|
7
|
+
const path = possibleFiles.find(path => host.exists(path));
|
|
8
|
+
return path;
|
|
9
|
+
}
|
|
10
|
+
exports.getWorkspacePath = getWorkspacePath;
|
|
11
|
+
function getWorkspace(host) {
|
|
12
|
+
const path = getWorkspacePath(host);
|
|
13
|
+
const configBuffer = path ? host.read(path) : null;
|
|
14
|
+
if (configBuffer === null) {
|
|
15
|
+
throw new schematics_1.SchematicsException(`Could not find (${path})`);
|
|
16
|
+
}
|
|
17
|
+
const config = configBuffer.toString();
|
|
18
|
+
return JSON.parse(config);
|
|
19
|
+
}
|
|
20
|
+
exports.getWorkspace = getWorkspace;
|
|
21
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../../packages/store/schematics/src/utils/config.ts"],"names":[],"mappings":";;;AAAA,2DAAuE;AAkIvE,SAAgB,gBAAgB,CAAC,IAAU;IACzC,MAAM,aAAa,GAAG,CAAC,eAAe,EAAE,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;IAC7E,MAAM,IAAI,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAE3D,OAAO,IAAI,CAAC;AACd,CAAC;AALD,4CAKC;AAED,SAAgB,YAAY,CAAC,IAAU;IACrC,MAAM,IAAI,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACpC,MAAM,YAAY,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACnD,IAAI,YAAY,KAAK,IAAI,EAAE,CAAC;QAC1B,MAAM,IAAI,gCAAmB,CAAC,mBAAmB,IAAI,GAAG,CAAC,CAAC;IAC5D,CAAC;IACD,MAAM,MAAM,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAC;IAEvC,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AAC5B,CAAC;AATD,oCASC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateFiles = void 0;
|
|
4
|
+
const core_1 = require("@angular-devkit/core");
|
|
5
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
6
|
+
function generateFiles(srcFolder, target, substitutions, generateSpecs) {
|
|
7
|
+
return (0, schematics_1.mergeWith)((0, schematics_1.apply)(srcFolder, [
|
|
8
|
+
generateSpecs ? (0, schematics_1.noop)() : (0, schematics_1.filter)(path => !path.includes('.spec')),
|
|
9
|
+
(0, schematics_1.template)(Object.assign(Object.assign({ template: '' }, core_1.strings), substitutions)),
|
|
10
|
+
(0, schematics_1.move)(target)
|
|
11
|
+
]));
|
|
12
|
+
}
|
|
13
|
+
exports.generateFiles = generateFiles;
|
|
14
|
+
//# sourceMappingURL=generate-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-utils.js","sourceRoot":"","sources":["../../../../../packages/store/schematics/src/utils/generate-utils.ts"],"names":[],"mappings":";;;AAAA,+CAA+C;AAC/C,2DASoC;AAEpC,SAAgB,aAAa,CAC3B,SAAiB,EACjB,MAAc,EACd,aAEC,EACD,aAAuB;IAEvB,OAAO,IAAA,sBAAS,EACd,IAAA,kBAAK,EAAC,SAAS,EAAE;QACf,aAAa,CAAC,CAAC,CAAC,IAAA,iBAAI,GAAE,CAAC,CAAC,CAAC,IAAA,mBAAM,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAChE,IAAA,qBAAQ,gCACN,QAAQ,EAAE,EAAE,IACT,cAAO,GACP,aAAa,EAChB;QACF,IAAA,iBAAI,EAAC,MAAM,CAAC;KACb,CAAC,CACH,CAAC;AACJ,CAAC;AAnBD,sCAmBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package.interface.js","sourceRoot":"","sources":["../../../../../../packages/store/schematics/src/utils/interfaces/package.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
The ng-utils folder represents a set of files copied from the @schematics/angular package's latest version. These utilities can be removed once @ngxs supports @angular >=16 as the minimum required version.
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import * as ts from '@schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript';
|
|
2
|
+
import { Change } from '@schematics/angular/utility/change';
|
|
3
|
+
/**
|
|
4
|
+
* Add Import `import { symbolName } from fileName` if the import doesn't exit
|
|
5
|
+
* already. Assumes fileToEdit can be resolved and accessed.
|
|
6
|
+
* @param fileToEdit File we want to add import to.
|
|
7
|
+
* @param symbolName Item to import.
|
|
8
|
+
* @param fileName Path to the file.
|
|
9
|
+
* @param isDefault If true, import follows style for importing default exports.
|
|
10
|
+
* @param alias Alias that the symbol should be inserted under.
|
|
11
|
+
* @return Change
|
|
12
|
+
*/
|
|
13
|
+
export declare function insertImport(source: ts.SourceFile, fileToEdit: string, symbolName: string, fileName: string, isDefault?: boolean, alias?: string): Change;
|
|
14
|
+
/**
|
|
15
|
+
* Find all nodes from the AST in the subtree of node of SyntaxKind kind.
|
|
16
|
+
* @param node
|
|
17
|
+
* @param kind
|
|
18
|
+
* @param max The maximum number of items to return.
|
|
19
|
+
* @param recursive Continue looking for nodes of kind recursive until end
|
|
20
|
+
* the last child even when node of kind has been found.
|
|
21
|
+
* @return all nodes of kind, or [] if none is found
|
|
22
|
+
*/
|
|
23
|
+
export declare function findNodes(node: ts.Node, kind: ts.SyntaxKind, max?: number, recursive?: boolean): ts.Node[];
|
|
24
|
+
/**
|
|
25
|
+
* Find all nodes from the AST in the subtree that satisfy a type guard.
|
|
26
|
+
* @param node
|
|
27
|
+
* @param guard
|
|
28
|
+
* @param max The maximum number of items to return.
|
|
29
|
+
* @param recursive Continue looking for nodes of kind recursive until end
|
|
30
|
+
* the last child even when node of kind has been found.
|
|
31
|
+
* @return all nodes that satisfy the type guard, or [] if none is found
|
|
32
|
+
*/
|
|
33
|
+
export declare function findNodes<T extends ts.Node>(node: ts.Node, guard: (node: ts.Node) => node is T, max?: number, recursive?: boolean): T[];
|
|
34
|
+
/**
|
|
35
|
+
* Get all the nodes from a source.
|
|
36
|
+
* @param sourceFile The source file object.
|
|
37
|
+
* @returns {Array<ts.Node>} An array of all the nodes in the source.
|
|
38
|
+
*/
|
|
39
|
+
export declare function getSourceNodes(sourceFile: ts.SourceFile): ts.Node[];
|
|
40
|
+
export declare function findNode(node: ts.Node, kind: ts.SyntaxKind, text: string): ts.Node | null;
|
|
41
|
+
/**
|
|
42
|
+
* Insert `toInsert` after the last occurence of `ts.SyntaxKind[nodes[i].kind]`
|
|
43
|
+
* or after the last of occurence of `syntaxKind` if the last occurence is a sub child
|
|
44
|
+
* of ts.SyntaxKind[nodes[i].kind] and save the changes in file.
|
|
45
|
+
*
|
|
46
|
+
* @param nodes insert after the last occurence of nodes
|
|
47
|
+
* @param toInsert string to insert
|
|
48
|
+
* @param file file to insert changes into
|
|
49
|
+
* @param fallbackPos position to insert if toInsert happens to be the first occurence
|
|
50
|
+
* @param syntaxKind the ts.SyntaxKind of the subchildren to insert after
|
|
51
|
+
* @return Change instance
|
|
52
|
+
* @throw Error if toInsert is first occurence but fall back is not set
|
|
53
|
+
*/
|
|
54
|
+
export declare function insertAfterLastOccurrence(nodes: ts.Node[] | ts.NodeArray<ts.Node>, toInsert: string, file: string, fallbackPos: number, syntaxKind?: ts.SyntaxKind): Change;
|
|
55
|
+
export declare function getDecoratorMetadata(source: ts.SourceFile, identifier: string, module: string): ts.Node[];
|
|
56
|
+
export declare function getMetadataField(node: ts.ObjectLiteralExpression, metadataField: string): ts.ObjectLiteralElement[];
|
|
57
|
+
export declare function addSymbolToNgModuleMetadata(source: ts.SourceFile, ngModulePath: string, metadataField: string, symbolName: string, importPath?: string | null): Change[];
|
|
58
|
+
/**
|
|
59
|
+
* Custom function to insert a declaration (component, pipe, directive)
|
|
60
|
+
* into NgModule declarations. It also imports the component.
|
|
61
|
+
*/
|
|
62
|
+
export declare function addDeclarationToModule(source: ts.SourceFile, modulePath: string, classifiedName: string, importPath: string): Change[];
|
|
63
|
+
/**
|
|
64
|
+
* Custom function to insert an NgModule into NgModule imports. It also imports the module.
|
|
65
|
+
*/
|
|
66
|
+
export declare function addImportToModule(source: ts.SourceFile, modulePath: string, classifiedName: string, importPath: string): Change[];
|
|
67
|
+
/**
|
|
68
|
+
* Custom function to insert a provider into NgModule. It also imports it.
|
|
69
|
+
*/
|
|
70
|
+
export declare function addProviderToModule(source: ts.SourceFile, modulePath: string, classifiedName: string, importPath: string): Change[];
|
|
71
|
+
/**
|
|
72
|
+
* Custom function to insert an export into NgModule. It also imports it.
|
|
73
|
+
*/
|
|
74
|
+
export declare function addExportToModule(source: ts.SourceFile, modulePath: string, classifiedName: string, importPath: string): Change[];
|
|
75
|
+
/**
|
|
76
|
+
* Custom function to insert an export into NgModule. It also imports it.
|
|
77
|
+
*/
|
|
78
|
+
export declare function addBootstrapToModule(source: ts.SourceFile, modulePath: string, classifiedName: string, importPath: string): Change[];
|
|
79
|
+
/**
|
|
80
|
+
* Determine if an import already exists.
|
|
81
|
+
*/
|
|
82
|
+
export declare function isImported(source: ts.SourceFile, classifiedName: string, importPath: string): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Returns the RouterModule declaration from NgModule metadata, if any.
|
|
85
|
+
*/
|
|
86
|
+
export declare function getRouterModuleDeclaration(source: ts.SourceFile): ts.Expression | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* Adds a new route declaration to a router module (i.e. has a RouterModule declaration)
|
|
89
|
+
*/
|
|
90
|
+
export declare function addRouteDeclarationToModule(source: ts.SourceFile, fileToAdd: string, routeLiteral: string): Change;
|
|
91
|
+
/**
|
|
92
|
+
* Determines if a SourceFile has a top-level declaration whose name matches a specific symbol.
|
|
93
|
+
* Can be used to avoid conflicts when inserting new imports into a file.
|
|
94
|
+
* @param sourceFile File in which to search.
|
|
95
|
+
* @param symbolName Name of the symbol to search for.
|
|
96
|
+
* @param skipModule Path of the module that the symbol may have been imported from. Used to
|
|
97
|
+
* avoid false positives where the same symbol we're looking for may have been imported.
|
|
98
|
+
*/
|
|
99
|
+
export declare function hasTopLevelIdentifier(sourceFile: ts.SourceFile, symbolName: string, skipModule?: string | null): boolean;
|