@ngrx/entity 20.0.1 → 21.0.0-beta.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.
Files changed (47) hide show
  1. package/migrations/6_0_0/index.js +3 -6
  2. package/migrations/6_0_0/index.js.map +1 -1
  3. package/package.json +5 -5
  4. package/schematics/ng-add/index.js +8 -11
  5. package/schematics/ng-add/index.js.map +1 -1
  6. package/schematics/ng-add/schema.js +0 -2
  7. package/schematics-core/index.js +24 -75
  8. package/schematics-core/index.js.map +1 -1
  9. package/schematics-core/utility/ast-utils.js +28 -44
  10. package/schematics-core/utility/ast-utils.js.map +1 -1
  11. package/schematics-core/utility/change.js +8 -15
  12. package/schematics-core/utility/change.js.map +1 -1
  13. package/schematics-core/utility/config.js +4 -8
  14. package/schematics-core/utility/config.js.map +1 -1
  15. package/schematics-core/utility/find-component.js +17 -22
  16. package/schematics-core/utility/find-component.js.map +1 -1
  17. package/schematics-core/utility/find-module.js +19 -24
  18. package/schematics-core/utility/find-module.js.map +1 -1
  19. package/schematics-core/utility/json-utilts.js +1 -4
  20. package/schematics-core/utility/json-utilts.js.map +1 -1
  21. package/schematics-core/utility/libs-version.js +1 -4
  22. package/schematics-core/utility/libs-version.js.map +1 -1
  23. package/schematics-core/utility/ngrx-utils.js +28 -36
  24. package/schematics-core/utility/ngrx-utils.js.map +1 -1
  25. package/schematics-core/utility/package.js +1 -4
  26. package/schematics-core/utility/package.js.map +1 -1
  27. package/schematics-core/utility/parse-name.js +5 -8
  28. package/schematics-core/utility/parse-name.js.map +1 -1
  29. package/schematics-core/utility/project.js +9 -15
  30. package/schematics-core/utility/project.js.map +1 -1
  31. package/schematics-core/utility/strings.js +9 -20
  32. package/schematics-core/utility/strings.js.map +1 -1
  33. package/schematics-core/utility/update.js +4 -7
  34. package/schematics-core/utility/update.js.map +1 -1
  35. package/schematics-core/utility/visitors.js +16 -30
  36. package/schematics-core/utility/visitors.js.map +1 -1
  37. package/{src/models.d.ts → types/ngrx-entity.d.ts} +28 -23
  38. package/index.d.ts +0 -6
  39. package/public_api.d.ts +0 -1
  40. package/src/create_adapter.d.ts +0 -5
  41. package/src/entity_state.d.ts +0 -8
  42. package/src/index.d.ts +0 -2
  43. package/src/sorted_state_adapter.d.ts +0 -2
  44. package/src/state_adapter.d.ts +0 -7
  45. package/src/state_selectors.d.ts +0 -7
  46. package/src/unsorted_state_adapter.d.ts +0 -2
  47. package/src/utils.d.ts +0 -2
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = default_1;
4
- var schematics_core_1 = require("../../schematics-core");
5
- function default_1() {
6
- return (0, schematics_core_1.updatePackage)('entity');
1
+ import { updatePackage } from '../../schematics-core';
2
+ export default function () {
3
+ return updatePackage('entity');
7
4
  }
8
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../modules/entity/migrations/6_0_0/index.ts"],"names":[],"mappings":";;AAGA,4BAEC;AAJD,yDAAsD;AAEtD;IACE,OAAO,IAAA,+BAAa,EAAC,QAAQ,CAAC,CAAC;AACjC,CAAC","sourcesContent":["import { Rule } from '@angular-devkit/schematics';\nimport { updatePackage } from '../../schematics-core';\n\nexport default function (): Rule {\n return updatePackage('entity');\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../modules/entity/migrations/6_0_0/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,MAAM,CAAC,OAAO;IACZ,OAAO,aAAa,CAAC,QAAQ,CAAC,CAAC;AACjC,CAAC","sourcesContent":["import { Rule } from '@angular-devkit/schematics';\nimport { updatePackage } from '../../schematics-core';\n\nexport default function (): Rule {\n return updatePackage('entity');\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ngrx/entity",
3
- "version": "20.0.1",
3
+ "version": "21.0.0-beta.0",
4
4
  "description": "Common utilities for entity reducers",
5
5
  "repository": {
6
6
  "type": "git",
@@ -20,8 +20,8 @@
20
20
  },
21
21
  "homepage": "https://github.com/ngrx/platform#readme",
22
22
  "peerDependencies": {
23
- "@angular/core": "^20.0.0",
24
- "@ngrx/store": "20.0.1",
23
+ "@angular/core": "^21.0.0",
24
+ "@ngrx/store": "21.0.0-beta.0",
25
25
  "rxjs": "^6.5.3 || ^7.5.0"
26
26
  },
27
27
  "schematics": "./schematics/collection.json",
@@ -48,13 +48,13 @@
48
48
  "tslib": "^2.0.0"
49
49
  },
50
50
  "module": "fesm2022/ngrx-entity.mjs",
51
- "typings": "index.d.ts",
51
+ "typings": "types/ngrx-entity.d.ts",
52
52
  "exports": {
53
53
  "./package.json": {
54
54
  "default": "./package.json"
55
55
  },
56
56
  ".": {
57
- "types": "./index.d.ts",
57
+ "types": "./types/ngrx-entity.d.ts",
58
58
  "default": "./fesm2022/ngrx-entity.mjs"
59
59
  }
60
60
  }
@@ -1,21 +1,18 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = default_1;
4
- var schematics_1 = require("@angular-devkit/schematics");
5
- var tasks_1 = require("@angular-devkit/schematics/tasks");
6
- var schematics_core_1 = require("../../schematics-core");
1
+ import { chain, noop, } from '@angular-devkit/schematics';
2
+ import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks';
3
+ import { addPackageToPackageJson, platformVersion, } from '../../schematics-core';
7
4
  function addNgRxEntityToPackageJson() {
8
5
  return function (host, context) {
9
- (0, schematics_core_1.addPackageToPackageJson)(host, 'dependencies', '@ngrx/entity', schematics_core_1.platformVersion);
10
- context.addTask(new tasks_1.NodePackageInstallTask());
6
+ addPackageToPackageJson(host, 'dependencies', '@ngrx/entity', platformVersion);
7
+ context.addTask(new NodePackageInstallTask());
11
8
  return host;
12
9
  };
13
10
  }
14
- function default_1(options) {
11
+ export default function (options) {
15
12
  return function (host, context) {
16
- return (0, schematics_1.chain)([
13
+ return chain([
17
14
  options && options.skipPackageJson
18
- ? (0, schematics_1.noop)()
15
+ ? noop()
19
16
  : addNgRxEntityToPackageJson(),
20
17
  ])(host, context);
21
18
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../modules/entity/schematics/ng-add/index.ts"],"names":[],"mappings":";;AA2BA,4BAQC;AAnCD,yDAMoC;AACpC,0DAA0E;AAC1E,yDAG+B;AAG/B,SAAS,0BAA0B;IACjC,OAAO,UAAC,IAAU,EAAE,OAAyB;QAC3C,IAAA,yCAAuB,EACrB,IAAI,EACJ,cAAc,EACd,cAAc,EACd,iCAAe,CAChB,CAAC;QACF,OAAO,CAAC,OAAO,CAAC,IAAI,8BAAsB,EAAE,CAAC,CAAC;QAC9C,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC;AAED,mBAAyB,OAAsB;IAC7C,OAAO,UAAC,IAAU,EAAE,OAAyB;QAC3C,OAAO,IAAA,kBAAK,EAAC;YACX,OAAO,IAAI,OAAO,CAAC,eAAe;gBAChC,CAAC,CAAC,IAAA,iBAAI,GAAE;gBACR,CAAC,CAAC,0BAA0B,EAAE;SACjC,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import {\n Rule,\n SchematicContext,\n Tree,\n chain,\n noop,\n} from '@angular-devkit/schematics';\nimport { NodePackageInstallTask } from '@angular-devkit/schematics/tasks';\nimport {\n addPackageToPackageJson,\n platformVersion,\n} from '../../schematics-core';\nimport { Schema as EntityOptions } from './schema';\n\nfunction addNgRxEntityToPackageJson() {\n return (host: Tree, context: SchematicContext) => {\n addPackageToPackageJson(\n host,\n 'dependencies',\n '@ngrx/entity',\n platformVersion\n );\n context.addTask(new NodePackageInstallTask());\n return host;\n };\n}\n\nexport default function (options: EntityOptions): Rule {\n return (host: Tree, context: SchematicContext) => {\n return chain([\n options && options.skipPackageJson\n ? noop()\n : addNgRxEntityToPackageJson(),\n ])(host, context);\n };\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../modules/entity/schematics/ng-add/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,EACL,IAAI,GACL,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EACL,uBAAuB,EACvB,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAG/B,SAAS,0BAA0B;IACjC,OAAO,UAAC,IAAU,EAAE,OAAyB;QAC3C,uBAAuB,CACrB,IAAI,EACJ,cAAc,EACd,cAAc,EACd,eAAe,CAChB,CAAC;QACF,OAAO,CAAC,OAAO,CAAC,IAAI,sBAAsB,EAAE,CAAC,CAAC;QAC9C,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,OAAO,WAAW,OAAsB;IAC7C,OAAO,UAAC,IAAU,EAAE,OAAyB;QAC3C,OAAO,KAAK,CAAC;YACX,OAAO,IAAI,OAAO,CAAC,eAAe;gBAChC,CAAC,CAAC,IAAI,EAAE;gBACR,CAAC,CAAC,0BAA0B,EAAE;SACjC,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import {\n Rule,\n SchematicContext,\n Tree,\n chain,\n noop,\n} from '@angular-devkit/schematics';\nimport { NodePackageInstallTask } from '@angular-devkit/schematics/tasks';\nimport {\n addPackageToPackageJson,\n platformVersion,\n} from '../../schematics-core';\nimport { Schema as EntityOptions } from './schema';\n\nfunction addNgRxEntityToPackageJson() {\n return (host: Tree, context: SchematicContext) => {\n addPackageToPackageJson(\n host,\n 'dependencies',\n '@ngrx/entity',\n platformVersion\n );\n context.addTask(new NodePackageInstallTask());\n return host;\n };\n}\n\nexport default function (options: EntityOptions): Rule {\n return (host: Tree, context: SchematicContext) => {\n return chain([\n options && options.skipPackageJson\n ? noop()\n : addNgRxEntityToPackageJson(),\n ])(host, context);\n };\n}\n"]}
@@ -1,3 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
1
  //# sourceMappingURL=schema.js.map
@@ -1,77 +1,26 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.visitTemplates = exports.visitNgModules = exports.visitDecorator = exports.visitComponents = exports.visitNgModuleExports = exports.visitNgModuleImports = exports.visitTSSourceFiles = exports.platformVersion = exports.addPackageToPackageJson = exports.parseName = exports.updatePackage = exports.stringUtils = exports.isLib = exports.getProject = exports.getProjectPath = exports.getPrefix = exports.omit = exports.addReducerToActionReducerMap = exports.addReducerImportToNgModule = exports.addReducerToStateInterface = exports.addReducerToState = exports.findPropertyInAstObject = exports.buildRelativePath = exports.findModuleFromOptions = exports.findModule = exports.findComponentFromOptions = exports.getWorkspacePath = exports.getWorkspace = exports.commitChanges = exports.createChangeRecorder = exports.createReplaceChange = exports.ReplaceChange = exports.RemoveChange = exports.InsertChange = exports.NoopChange = exports.containsProperty = exports.replaceImport = exports.addProviderToModule = exports.addProviderToComponent = exports.addImportToModule = exports.addExportToModule = exports.addDeclarationToModule = exports.addBootstrapToModule = exports.insertImport = exports.insertAfterLastOccurrence = exports.getContentOfKeyLiteral = exports.getDecoratorMetadata = exports.getSourceNodes = exports.findNodes = void 0;
4
- var strings_1 = require("./utility/strings");
5
- var ast_utils_1 = require("./utility/ast-utils");
6
- Object.defineProperty(exports, "findNodes", { enumerable: true, get: function () { return ast_utils_1.findNodes; } });
7
- Object.defineProperty(exports, "getSourceNodes", { enumerable: true, get: function () { return ast_utils_1.getSourceNodes; } });
8
- Object.defineProperty(exports, "getDecoratorMetadata", { enumerable: true, get: function () { return ast_utils_1.getDecoratorMetadata; } });
9
- Object.defineProperty(exports, "getContentOfKeyLiteral", { enumerable: true, get: function () { return ast_utils_1.getContentOfKeyLiteral; } });
10
- Object.defineProperty(exports, "insertAfterLastOccurrence", { enumerable: true, get: function () { return ast_utils_1.insertAfterLastOccurrence; } });
11
- Object.defineProperty(exports, "insertImport", { enumerable: true, get: function () { return ast_utils_1.insertImport; } });
12
- Object.defineProperty(exports, "addBootstrapToModule", { enumerable: true, get: function () { return ast_utils_1.addBootstrapToModule; } });
13
- Object.defineProperty(exports, "addDeclarationToModule", { enumerable: true, get: function () { return ast_utils_1.addDeclarationToModule; } });
14
- Object.defineProperty(exports, "addExportToModule", { enumerable: true, get: function () { return ast_utils_1.addExportToModule; } });
15
- Object.defineProperty(exports, "addImportToModule", { enumerable: true, get: function () { return ast_utils_1.addImportToModule; } });
16
- Object.defineProperty(exports, "addProviderToComponent", { enumerable: true, get: function () { return ast_utils_1.addProviderToComponent; } });
17
- Object.defineProperty(exports, "addProviderToModule", { enumerable: true, get: function () { return ast_utils_1.addProviderToModule; } });
18
- Object.defineProperty(exports, "replaceImport", { enumerable: true, get: function () { return ast_utils_1.replaceImport; } });
19
- Object.defineProperty(exports, "containsProperty", { enumerable: true, get: function () { return ast_utils_1.containsProperty; } });
20
- var change_1 = require("./utility/change");
21
- Object.defineProperty(exports, "NoopChange", { enumerable: true, get: function () { return change_1.NoopChange; } });
22
- Object.defineProperty(exports, "InsertChange", { enumerable: true, get: function () { return change_1.InsertChange; } });
23
- Object.defineProperty(exports, "RemoveChange", { enumerable: true, get: function () { return change_1.RemoveChange; } });
24
- Object.defineProperty(exports, "ReplaceChange", { enumerable: true, get: function () { return change_1.ReplaceChange; } });
25
- Object.defineProperty(exports, "createReplaceChange", { enumerable: true, get: function () { return change_1.createReplaceChange; } });
26
- Object.defineProperty(exports, "createChangeRecorder", { enumerable: true, get: function () { return change_1.createChangeRecorder; } });
27
- Object.defineProperty(exports, "commitChanges", { enumerable: true, get: function () { return change_1.commitChanges; } });
28
- var config_1 = require("./utility/config");
29
- Object.defineProperty(exports, "getWorkspace", { enumerable: true, get: function () { return config_1.getWorkspace; } });
30
- Object.defineProperty(exports, "getWorkspacePath", { enumerable: true, get: function () { return config_1.getWorkspacePath; } });
31
- var find_component_1 = require("./utility/find-component");
32
- Object.defineProperty(exports, "findComponentFromOptions", { enumerable: true, get: function () { return find_component_1.findComponentFromOptions; } });
33
- var find_module_1 = require("./utility/find-module");
34
- Object.defineProperty(exports, "findModule", { enumerable: true, get: function () { return find_module_1.findModule; } });
35
- Object.defineProperty(exports, "findModuleFromOptions", { enumerable: true, get: function () { return find_module_1.findModuleFromOptions; } });
36
- Object.defineProperty(exports, "buildRelativePath", { enumerable: true, get: function () { return find_module_1.buildRelativePath; } });
37
- var json_utilts_1 = require("./utility/json-utilts");
38
- Object.defineProperty(exports, "findPropertyInAstObject", { enumerable: true, get: function () { return json_utilts_1.findPropertyInAstObject; } });
39
- var ngrx_utils_1 = require("./utility/ngrx-utils");
40
- Object.defineProperty(exports, "addReducerToState", { enumerable: true, get: function () { return ngrx_utils_1.addReducerToState; } });
41
- Object.defineProperty(exports, "addReducerToStateInterface", { enumerable: true, get: function () { return ngrx_utils_1.addReducerToStateInterface; } });
42
- Object.defineProperty(exports, "addReducerImportToNgModule", { enumerable: true, get: function () { return ngrx_utils_1.addReducerImportToNgModule; } });
43
- Object.defineProperty(exports, "addReducerToActionReducerMap", { enumerable: true, get: function () { return ngrx_utils_1.addReducerToActionReducerMap; } });
44
- Object.defineProperty(exports, "omit", { enumerable: true, get: function () { return ngrx_utils_1.omit; } });
45
- Object.defineProperty(exports, "getPrefix", { enumerable: true, get: function () { return ngrx_utils_1.getPrefix; } });
46
- var project_1 = require("./utility/project");
47
- Object.defineProperty(exports, "getProjectPath", { enumerable: true, get: function () { return project_1.getProjectPath; } });
48
- Object.defineProperty(exports, "getProject", { enumerable: true, get: function () { return project_1.getProject; } });
49
- Object.defineProperty(exports, "isLib", { enumerable: true, get: function () { return project_1.isLib; } });
50
- exports.stringUtils = {
51
- dasherize: strings_1.dasherize,
52
- decamelize: strings_1.decamelize,
53
- camelize: strings_1.camelize,
54
- classify: strings_1.classify,
55
- underscore: strings_1.underscore,
56
- group: strings_1.group,
57
- capitalize: strings_1.capitalize,
58
- featurePath: strings_1.featurePath,
59
- pluralize: strings_1.pluralize,
1
+ import { dasherize, decamelize, camelize, classify, underscore, group, capitalize, featurePath, pluralize, } from './utility/strings';
2
+ export { findNodes, getSourceNodes, getDecoratorMetadata, getContentOfKeyLiteral, insertAfterLastOccurrence, insertImport, addBootstrapToModule, addDeclarationToModule, addExportToModule, addImportToModule, addProviderToComponent, addProviderToModule, replaceImport, containsProperty, } from './utility/ast-utils';
3
+ export { NoopChange, InsertChange, RemoveChange, ReplaceChange, createReplaceChange, createChangeRecorder, commitChanges, } from './utility/change';
4
+ export { getWorkspace, getWorkspacePath } from './utility/config';
5
+ export { findComponentFromOptions } from './utility/find-component';
6
+ export { findModule, findModuleFromOptions, buildRelativePath, } from './utility/find-module';
7
+ export { findPropertyInAstObject } from './utility/json-utilts';
8
+ export { addReducerToState, addReducerToStateInterface, addReducerImportToNgModule, addReducerToActionReducerMap, omit, getPrefix, } from './utility/ngrx-utils';
9
+ export { getProjectPath, getProject, isLib } from './utility/project';
10
+ export var stringUtils = {
11
+ dasherize: dasherize,
12
+ decamelize: decamelize,
13
+ camelize: camelize,
14
+ classify: classify,
15
+ underscore: underscore,
16
+ group: group,
17
+ capitalize: capitalize,
18
+ featurePath: featurePath,
19
+ pluralize: pluralize,
60
20
  };
61
- var update_1 = require("./utility/update");
62
- Object.defineProperty(exports, "updatePackage", { enumerable: true, get: function () { return update_1.updatePackage; } });
63
- var parse_name_1 = require("./utility/parse-name");
64
- Object.defineProperty(exports, "parseName", { enumerable: true, get: function () { return parse_name_1.parseName; } });
65
- var package_1 = require("./utility/package");
66
- Object.defineProperty(exports, "addPackageToPackageJson", { enumerable: true, get: function () { return package_1.addPackageToPackageJson; } });
67
- var libs_version_1 = require("./utility/libs-version");
68
- Object.defineProperty(exports, "platformVersion", { enumerable: true, get: function () { return libs_version_1.platformVersion; } });
69
- var visitors_1 = require("./utility/visitors");
70
- Object.defineProperty(exports, "visitTSSourceFiles", { enumerable: true, get: function () { return visitors_1.visitTSSourceFiles; } });
71
- Object.defineProperty(exports, "visitNgModuleImports", { enumerable: true, get: function () { return visitors_1.visitNgModuleImports; } });
72
- Object.defineProperty(exports, "visitNgModuleExports", { enumerable: true, get: function () { return visitors_1.visitNgModuleExports; } });
73
- Object.defineProperty(exports, "visitComponents", { enumerable: true, get: function () { return visitors_1.visitComponents; } });
74
- Object.defineProperty(exports, "visitDecorator", { enumerable: true, get: function () { return visitors_1.visitDecorator; } });
75
- Object.defineProperty(exports, "visitNgModules", { enumerable: true, get: function () { return visitors_1.visitNgModules; } });
76
- Object.defineProperty(exports, "visitTemplates", { enumerable: true, get: function () { return visitors_1.visitTemplates; } });
21
+ export { updatePackage } from './utility/update';
22
+ export { parseName } from './utility/parse-name';
23
+ export { addPackageToPackageJson } from './utility/package';
24
+ export { platformVersion } from './utility/libs-version';
25
+ export { visitTSSourceFiles, visitNgModuleImports, visitNgModuleExports, visitComponents, visitDecorator, visitNgModules, visitTemplates, } from './utility/visitors';
77
26
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../modules/entity/schematics-core/index.ts"],"names":[],"mappings":";;;AAAA,6CAU2B;AAE3B,iDAe6B;AAd3B,sGAAA,SAAS,OAAA;AACT,2GAAA,cAAc,OAAA;AACd,iHAAA,oBAAoB,OAAA;AACpB,mHAAA,sBAAsB,OAAA;AACtB,sHAAA,yBAAyB,OAAA;AACzB,yGAAA,YAAY,OAAA;AACZ,iHAAA,oBAAoB,OAAA;AACpB,mHAAA,sBAAsB,OAAA;AACtB,8GAAA,iBAAiB,OAAA;AACjB,8GAAA,iBAAiB,OAAA;AACjB,mHAAA,sBAAsB,OAAA;AACtB,gHAAA,mBAAmB,OAAA;AACnB,0GAAA,aAAa,OAAA;AACb,6GAAA,gBAAgB,OAAA;AAGlB,2CAU0B;AAPxB,oGAAA,UAAU,OAAA;AACV,sGAAA,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AA","sourcesContent":["import {\n dasherize,\n decamelize,\n camelize,\n classify,\n underscore,\n group,\n capitalize,\n featurePath,\n pluralize,\n} from './utility/strings';\n\nexport {\n findNodes,\n getSourceNodes,\n getDecoratorMetadata,\n getContentOfKeyLiteral,\n insertAfterLastOccurrence,\n insertImport,\n addBootstrapToModule,\n addDeclarationToModule,\n addExportToModule,\n addImportToModule,\n addProviderToComponent,\n addProviderToModule,\n replaceImport,\n containsProperty,\n} from './utility/ast-utils';\n\nexport {\n Host,\n Change,\n NoopChange,\n InsertChange,\n RemoveChange,\n ReplaceChange,\n createReplaceChange,\n createChangeRecorder,\n commitChanges,\n} from './utility/change';\n\nexport { AppConfig, getWorkspace, getWorkspacePath } from './utility/config';\n\nexport { findComponentFromOptions } from './utility/find-component';\n\nexport {\n findModule,\n findModuleFromOptions,\n buildRelativePath,\n ModuleOptions,\n} from './utility/find-module';\n\nexport { findPropertyInAstObject } from './utility/json-utilts';\n\nexport {\n addReducerToState,\n addReducerToStateInterface,\n addReducerImportToNgModule,\n addReducerToActionReducerMap,\n omit,\n getPrefix,\n} from './utility/ngrx-utils';\n\nexport { getProjectPath, getProject, isLib } from './utility/project';\n\nexport const stringUtils = {\n dasherize,\n decamelize,\n camelize,\n classify,\n underscore,\n group,\n capitalize,\n featurePath,\n pluralize,\n};\n\nexport { updatePackage } from './utility/update';\n\nexport { parseName } from './utility/parse-name';\n\nexport { addPackageToPackageJson } from './utility/package';\n\nexport { platformVersion } from './utility/libs-version';\n\nexport {\n visitTSSourceFiles,\n visitNgModuleImports,\n visitNgModuleExports,\n visitComponents,\n visitDecorator,\n visitNgModules,\n visitTemplates,\n} from './utility/visitors';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../modules/entity/schematics-core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,KAAK,EACL,UAAU,EACV,WAAW,EACX,SAAS,GACV,MA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;AAEzD,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EACf,cAAc,EACd,cAAc,EACd,cAAc,GACf,MAAM,oBAAoB,CAAC","sourcesContent":["import {\n dasherize,\n decamelize,\n camelize,\n classify,\n underscore,\n group,\n capitalize,\n featurePath,\n pluralize,\n} from './utility/strings';\n\nexport {\n findNodes,\n getSourceNodes,\n getDecoratorMetadata,\n getContentOfKeyLiteral,\n insertAfterLastOccurrence,\n insertImport,\n addBootstrapToModule,\n addDeclarationToModule,\n addExportToModule,\n addImportToModule,\n addProviderToComponent,\n addProviderToModule,\n replaceImport,\n containsProperty,\n} from './utility/ast-utils';\n\nexport {\n Host,\n Change,\n NoopChange,\n InsertChange,\n RemoveChange,\n ReplaceChange,\n createReplaceChange,\n createChangeRecorder,\n commitChanges,\n} from './utility/change';\n\nexport { AppConfig, getWorkspace, getWorkspacePath } from './utility/config';\n\nexport { findComponentFromOptions } from './utility/find-component';\n\nexport {\n findModule,\n findModuleFromOptions,\n buildRelativePath,\n ModuleOptions,\n} from './utility/find-module';\n\nexport { findPropertyInAstObject } from './utility/json-utilts';\n\nexport {\n addReducerToState,\n addReducerToStateInterface,\n addReducerImportToNgModule,\n addReducerToActionReducerMap,\n omit,\n getPrefix,\n} from './utility/ngrx-utils';\n\nexport { getProjectPath, getProject, isLib } from './utility/project';\n\nexport const stringUtils = {\n dasherize,\n decamelize,\n camelize,\n classify,\n underscore,\n group,\n capitalize,\n featurePath,\n pluralize,\n};\n\nexport { updatePackage } from './utility/update';\n\nexport { parseName } from './utility/parse-name';\n\nexport { addPackageToPackageJson } from './utility/package';\n\nexport { platformVersion } from './utility/libs-version';\n\nexport {\n visitTSSourceFiles,\n visitNgModuleImports,\n visitNgModuleExports,\n visitComponents,\n visitDecorator,\n visitNgModules,\n visitTemplates,\n} from './utility/visitors';\n"]}
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __values = (this && this.__values) || function(o) {
3
2
  var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
4
3
  if (m) return m.call(o);
@@ -35,21 +34,6 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
35
34
  }
36
35
  return to.concat(ar || Array.prototype.slice.call(from));
37
36
  };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.findNodes = findNodes;
40
- exports.getSourceNodes = getSourceNodes;
41
- exports.insertAfterLastOccurrence = insertAfterLastOccurrence;
42
- exports.getContentOfKeyLiteral = getContentOfKeyLiteral;
43
- exports.getDecoratorMetadata = getDecoratorMetadata;
44
- exports.addDeclarationToModule = addDeclarationToModule;
45
- exports.addImportToModule = addImportToModule;
46
- exports.addProviderToModule = addProviderToModule;
47
- exports.addProviderToComponent = addProviderToComponent;
48
- exports.addExportToModule = addExportToModule;
49
- exports.addBootstrapToModule = addBootstrapToModule;
50
- exports.insertImport = insertImport;
51
- exports.replaceImport = replaceImport;
52
- exports.containsProperty = containsProperty;
53
37
  /* istanbul ignore file */
54
38
  /**
55
39
  * @license
@@ -58,8 +42,8 @@ exports.containsProperty = containsProperty;
58
42
  * Use of this source code is governed by an MIT-style license that can be
59
43
  * found in the LICENSE file at https://angular.io/license
60
44
  */
61
- var ts = require("typescript");
62
- var change_1 = require("./change");
45
+ import * as ts from 'typescript';
46
+ import { InsertChange, NoopChange, createReplaceChange, createRemoveChange, } from './change';
63
47
  /**
64
48
  * Find all nodes from the AST in the subtree of node of SyntaxKind kind.
65
49
  * @param node
@@ -67,7 +51,7 @@ var change_1 = require("./change");
67
51
  * @param max The maximum number of items to return.
68
52
  * @return all nodes of kind, or [] if none is found
69
53
  */
70
- function findNodes(node, kind, max) {
54
+ export function findNodes(node, kind, max) {
71
55
  var e_1, _a;
72
56
  if (max === void 0) { max = Infinity; }
73
57
  if (!node || max == 0) {
@@ -108,7 +92,7 @@ function findNodes(node, kind, max) {
108
92
  * @param sourceFile The source file object.
109
93
  * @returns {Observable<ts.Node>} An observable of all the nodes in the source.
110
94
  */
111
- function getSourceNodes(sourceFile) {
95
+ export function getSourceNodes(sourceFile) {
112
96
  var nodes = [sourceFile];
113
97
  var result = [];
114
98
  while (nodes.length > 0) {
@@ -142,7 +126,7 @@ function nodesByPosition(first, second) {
142
126
  * @return Change instance
143
127
  * @throw Error if toInsert is first occurence but fall back is not set
144
128
  */
145
- function insertAfterLastOccurrence(nodes, toInsert, file, fallbackPos, syntaxKind) {
129
+ export function insertAfterLastOccurrence(nodes, toInsert, file, fallbackPos, syntaxKind) {
146
130
  var lastItem = nodes.sort(nodesByPosition).pop();
147
131
  if (!lastItem) {
148
132
  throw new Error();
@@ -154,9 +138,9 @@ function insertAfterLastOccurrence(nodes, toInsert, file, fallbackPos, syntaxKin
154
138
  throw new Error("tried to insert ".concat(toInsert, " as first occurence with no fallback position"));
155
139
  }
156
140
  var lastItemPosition = lastItem ? lastItem.end : fallbackPos;
157
- return new change_1.InsertChange(file, lastItemPosition, toInsert);
141
+ return new InsertChange(file, lastItemPosition, toInsert);
158
142
  }
159
- function getContentOfKeyLiteral(_source, node) {
143
+ export function getContentOfKeyLiteral(_source, node) {
160
144
  if (node.kind == ts.SyntaxKind.Identifier) {
161
145
  return node.text;
162
146
  }
@@ -214,7 +198,7 @@ function _angularImportsFromNode(node, _sourceFile) {
214
198
  return {};
215
199
  }
216
200
  }
217
- function getDecoratorMetadata(source, identifier, module) {
201
+ export function getDecoratorMetadata(source, identifier, module) {
218
202
  var angularImports = findNodes(source, ts.SyntaxKind.ImportDeclaration)
219
203
  .map(function (node) {
220
204
  return _angularImportsFromNode(node, source);
@@ -315,7 +299,7 @@ function _addSymbolToNgModuleMetadata(source, ngModulePath, metadataField, symbo
315
299
  toInsert_1 = ", ".concat(metadataField, ": [").concat(symbolName, "]");
316
300
  }
317
301
  }
318
- var newMetadataProperty = new change_1.InsertChange(ngModulePath, position_1, toInsert_1);
302
+ var newMetadataProperty = new InsertChange(ngModulePath, position_1, toInsert_1);
319
303
  var newMetadataImport = insertImport(source, ngModulePath, symbolName.replace(/\..*$/, ''), importPath);
320
304
  return [newMetadataProperty, newMetadataImport];
321
305
  }
@@ -359,7 +343,7 @@ function _addSymbolToNgModuleMetadata(source, ngModulePath, metadataField, symbo
359
343
  var epos = void 0;
360
344
  if (effectsElements.length === 0) {
361
345
  epos = effectsArgs.getStart() + 1;
362
- return [new change_1.InsertChange(ngModulePath, epos, effectsSymbol)];
346
+ return [new InsertChange(ngModulePath, epos, effectsSymbol)];
363
347
  }
364
348
  else {
365
349
  var lastEffect = effectsElements[effectsElements.length - 1];
@@ -373,7 +357,7 @@ function _addSymbolToNgModuleMetadata(source, ngModulePath, metadataField, symbo
373
357
  else {
374
358
  effectInsert = ", ".concat(effectsSymbol);
375
359
  }
376
- return [new change_1.InsertChange(ngModulePath, epos, effectInsert)];
360
+ return [new InsertChange(ngModulePath, epos, effectInsert)];
377
361
  }
378
362
  }
379
363
  else {
@@ -419,7 +403,7 @@ function _addSymbolToNgModuleMetadata(source, ngModulePath, metadataField, symbo
419
403
  toInsert = ", ".concat(symbolName);
420
404
  }
421
405
  }
422
- var insert = new change_1.InsertChange(ngModulePath, position, toInsert);
406
+ var insert = new InsertChange(ngModulePath, position, toInsert);
423
407
  var importInsert = insertImport(source, ngModulePath, symbolName.replace(/\..*$/, ''), importPath);
424
408
  return [insert, importInsert];
425
409
  }
@@ -471,7 +455,7 @@ function _addSymbolToComponentMetadata(source, componentPath, metadataField, sym
471
455
  toInsert_2 = ", ".concat(metadataField, ": [").concat(symbolName, "]");
472
456
  }
473
457
  }
474
- var newMetadataProperty = new change_1.InsertChange(componentPath, position_2, toInsert_2);
458
+ var newMetadataProperty = new InsertChange(componentPath, position_2, toInsert_2);
475
459
  var newMetadataImport = insertImport(source, componentPath, symbolName.replace(/\..*$/, ''), importPath);
476
460
  return [newMetadataProperty, newMetadataImport];
477
461
  }
@@ -538,7 +522,7 @@ function _addSymbolToComponentMetadata(source, componentPath, metadataField, sym
538
522
  toInsert = ", ".concat(symbolName);
539
523
  }
540
524
  }
541
- var insert = new change_1.InsertChange(componentPath, position, toInsert);
525
+ var insert = new InsertChange(componentPath, position, toInsert);
542
526
  var importInsert = insertImport(source, componentPath, symbolName.replace(/\..*$/, ''), importPath);
543
527
  return [insert, importInsert];
544
528
  }
@@ -546,38 +530,38 @@ function _addSymbolToComponentMetadata(source, componentPath, metadataField, sym
546
530
  * Custom function to insert a declaration (component, pipe, directive)
547
531
  * into NgModule declarations. It also imports the component.
548
532
  */
549
- function addDeclarationToModule(source, modulePath, classifiedName, importPath) {
533
+ export function addDeclarationToModule(source, modulePath, classifiedName, importPath) {
550
534
  return _addSymbolToNgModuleMetadata(source, modulePath, 'declarations', classifiedName, importPath);
551
535
  }
552
536
  /**
553
537
  * Custom function to insert a declaration (component, pipe, directive)
554
538
  * into NgModule declarations. It also imports the component.
555
539
  */
556
- function addImportToModule(source, modulePath, classifiedName, importPath) {
540
+ export function addImportToModule(source, modulePath, classifiedName, importPath) {
557
541
  return _addSymbolToNgModuleMetadata(source, modulePath, 'imports', classifiedName, importPath);
558
542
  }
559
543
  /**
560
544
  * Custom function to insert a provider into NgModule. It also imports it.
561
545
  */
562
- function addProviderToModule(source, modulePath, classifiedName, importPath) {
546
+ export function addProviderToModule(source, modulePath, classifiedName, importPath) {
563
547
  return _addSymbolToNgModuleMetadata(source, modulePath, 'providers', classifiedName, importPath);
564
548
  }
565
549
  /**
566
550
  * Custom function to insert a provider into Component. It also imports it.
567
551
  */
568
- function addProviderToComponent(source, componentPath, classifiedName, importPath) {
552
+ export function addProviderToComponent(source, componentPath, classifiedName, importPath) {
569
553
  return _addSymbolToComponentMetadata(source, componentPath, 'providers', classifiedName, importPath);
570
554
  }
571
555
  /**
572
556
  * Custom function to insert an export into NgModule. It also imports it.
573
557
  */
574
- function addExportToModule(source, modulePath, classifiedName, importPath) {
558
+ export function addExportToModule(source, modulePath, classifiedName, importPath) {
575
559
  return _addSymbolToNgModuleMetadata(source, modulePath, 'exports', classifiedName, importPath);
576
560
  }
577
561
  /**
578
562
  * Custom function to insert an export into NgModule. It also imports it.
579
563
  */
580
- function addBootstrapToModule(source, modulePath, classifiedName, importPath) {
564
+ export function addBootstrapToModule(source, modulePath, classifiedName, importPath) {
581
565
  return _addSymbolToNgModuleMetadata(source, modulePath, 'bootstrap', classifiedName, importPath);
582
566
  }
583
567
  /**
@@ -589,7 +573,7 @@ function addBootstrapToModule(source, modulePath, classifiedName, importPath) {
589
573
  * @param isDefault (if true, import follows style for importing default exports)
590
574
  * @return Change
591
575
  */
592
- function insertImport(source, fileToEdit, symbolName, fileName, isDefault) {
576
+ export function insertImport(source, fileToEdit, symbolName, fileName, isDefault) {
593
577
  if (isDefault === void 0) { isDefault = false; }
594
578
  var rootNode = source;
595
579
  var allImports = findNodes(rootNode, ts.SyntaxKind.ImportDeclaration);
@@ -614,7 +598,7 @@ function insertImport(source, fileToEdit, symbolName, fileName, isDefault) {
614
598
  });
615
599
  // if imports * from fileName, don't add symbolName
616
600
  if (importsAsterisk_1) {
617
- return new change_1.NoopChange();
601
+ return new NoopChange();
618
602
  }
619
603
  var importTextNodes = imports_1.filter(function (n) { return n.text === symbolName; });
620
604
  // insert import if it's not there
@@ -623,7 +607,7 @@ function insertImport(source, fileToEdit, symbolName, fileName, isDefault) {
623
607
  findNodes(relevantImports[0], ts.SyntaxKind.FromKeyword)[0].getStart();
624
608
  return insertAfterLastOccurrence(imports_1, ", ".concat(symbolName), fileToEdit, fallbackPos_1);
625
609
  }
626
- return new change_1.NoopChange();
610
+ return new NoopChange();
627
611
  }
628
612
  // no such import declaration exists
629
613
  var useStrict = findNodes(rootNode, ts.SyntaxKind.StringLiteral).filter(function (n) { return n.getText() === 'use strict'; });
@@ -640,7 +624,7 @@ function insertImport(source, fileToEdit, symbolName, fileName, isDefault) {
640
624
  " from '".concat(fileName, "'").concat(insertAtBeginning ? ';\n' : '');
641
625
  return insertAfterLastOccurrence(allImports, toInsert, fileToEdit, fallbackPos, ts.SyntaxKind.StringLiteral);
642
626
  }
643
- function replaceImport(sourceFile, path, importFrom, importAsIs, importToBe) {
627
+ export function replaceImport(sourceFile, path, importFrom, importAsIs, importToBe) {
644
628
  var imports = sourceFile.statements
645
629
  .filter(ts.isImportDeclaration)
646
630
  .filter(function (_a) {
@@ -679,21 +663,21 @@ function replaceImport(sourceFile, path, importFrom, importAsIs, importToBe) {
679
663
  }
680
664
  // identifier has not been imported, simply replace the old text with the new text
681
665
  if (!isAlreadyImported) {
682
- return (0, change_1.createReplaceChange)(sourceFile, specifier, importAsIs, importToBe);
666
+ return createReplaceChange(sourceFile, specifier, importAsIs, importToBe);
683
667
  }
684
668
  var nextIdentifier = importSpecifiers[index + 1];
685
669
  // identifer is not the last, also clean up the comma
686
670
  if (nextIdentifier) {
687
- return (0, change_1.createRemoveChange)(sourceFile, specifier, specifier.getStart(sourceFile), nextIdentifier.getStart(sourceFile));
671
+ return createRemoveChange(sourceFile, specifier, specifier.getStart(sourceFile), nextIdentifier.getStart(sourceFile));
688
672
  }
689
673
  // there are no imports following, just remove it
690
- return (0, change_1.createRemoveChange)(sourceFile, specifier, specifier.getStart(sourceFile), specifier.getEnd());
674
+ return createRemoveChange(sourceFile, specifier, specifier.getStart(sourceFile), specifier.getEnd());
691
675
  });
692
676
  return importChanges.filter(Boolean);
693
677
  });
694
678
  return changes.reduce(function (imports, curr) { return imports.concat(curr); }, []);
695
679
  }
696
- function containsProperty(objectLiteral, propertyName) {
680
+ export function containsProperty(objectLiteral, propertyName) {
697
681
  return (objectLiteral &&
698
682
  objectLiteral.properties.some(function (prop) {
699
683
  return ts.isPropertyAssignment(prop) &&