@ngrx/store-devtools 21.0.0-beta.0 → 21.0.0-rc.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 (40) hide show
  1. package/migrations/17_0_0-beta/index.js +66 -68
  2. package/migrations/17_0_0-beta/index.js.map +1 -1
  3. package/migrations/6_0_0/index.js +6 -3
  4. package/migrations/6_0_0/index.js.map +1 -1
  5. package/package.json +2 -2
  6. package/schematics/ng-add/index.js +86 -99
  7. package/schematics/ng-add/index.js.map +1 -1
  8. package/schematics/ng-add/schema.js +2 -0
  9. package/schematics-core/index.js +75 -24
  10. package/schematics-core/index.js.map +1 -1
  11. package/schematics-core/utility/ast-utils.js +234 -260
  12. package/schematics-core/utility/ast-utils.js.map +1 -1
  13. package/schematics-core/utility/change.js +82 -92
  14. package/schematics-core/utility/change.js.map +1 -1
  15. package/schematics-core/utility/config.js +13 -9
  16. package/schematics-core/utility/config.js.map +1 -1
  17. package/schematics-core/utility/find-component.js +35 -30
  18. package/schematics-core/utility/find-component.js.map +1 -1
  19. package/schematics-core/utility/find-module.js +38 -33
  20. package/schematics-core/utility/find-module.js.map +1 -1
  21. package/schematics-core/utility/json-utilts.js +8 -27
  22. package/schematics-core/utility/json-utilts.js.map +1 -1
  23. package/schematics-core/utility/libs-version.js +4 -1
  24. package/schematics-core/utility/libs-version.js.map +1 -1
  25. package/schematics-core/utility/ngrx-utils.js +129 -152
  26. package/schematics-core/utility/ngrx-utils.js.map +1 -1
  27. package/schematics-core/utility/package.js +6 -4
  28. package/schematics-core/utility/package.js.map +1 -1
  29. package/schematics-core/utility/parse-name.js +8 -5
  30. package/schematics-core/utility/parse-name.js.map +1 -1
  31. package/schematics-core/utility/project.js +23 -17
  32. package/schematics-core/utility/project.js.map +1 -1
  33. package/schematics-core/utility/standalone.js +141 -214
  34. package/schematics-core/utility/standalone.js.map +1 -1
  35. package/schematics-core/utility/strings.js +32 -21
  36. package/schematics-core/utility/strings.js.map +1 -1
  37. package/schematics-core/utility/update.js +18 -15
  38. package/schematics-core/utility/update.js.map +1 -1
  39. package/schematics-core/utility/visitors.js +104 -192
  40. package/schematics-core/utility/visitors.js.map +1 -1
@@ -1,3 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.findComponentFromOptions = findComponentFromOptions;
4
+ exports.findComponent = findComponent;
5
+ exports.buildRelativePath = buildRelativePath;
1
6
  /**
2
7
  * @license
3
8
  * Copyright Google Inc. All Rights Reserved.
@@ -5,49 +10,49 @@
5
10
  * Use of this source code is governed by an MIT-style license that can be
6
11
  * found in the LICENSE file at https://angular.io/license
7
12
  */
8
- import { join, normalize, relative, strings, basename, extname, dirname, } from '@angular-devkit/core';
13
+ const core_1 = require("@angular-devkit/core");
9
14
  /**
10
15
  * Find the component referred by a set of options passed to the schematics.
11
16
  */
12
- export function findComponentFromOptions(host, options) {
17
+ function findComponentFromOptions(host, options) {
13
18
  if (options.hasOwnProperty('skipImport') && options.skipImport) {
14
19
  return undefined;
15
20
  }
16
21
  if (!options.component) {
17
- var pathToCheck = (options.path || '') +
18
- (options.flat ? '' : '/' + strings.dasherize(options.name));
19
- return normalize(findComponent(host, pathToCheck));
22
+ const pathToCheck = (options.path || '') +
23
+ (options.flat ? '' : '/' + core_1.strings.dasherize(options.name));
24
+ return (0, core_1.normalize)(findComponent(host, pathToCheck));
20
25
  }
21
26
  else {
22
- var componentPath = normalize('/' + options.path + '/' + options.component);
23
- var componentBaseName = normalize(componentPath).split('/').pop();
27
+ const componentPath = (0, core_1.normalize)('/' + options.path + '/' + options.component);
28
+ const componentBaseName = (0, core_1.normalize)(componentPath).split('/').pop();
24
29
  if (host.exists(componentPath)) {
25
- return normalize(componentPath);
30
+ return (0, core_1.normalize)(componentPath);
26
31
  }
27
32
  else if (host.exists(componentPath + '.ts')) {
28
- return normalize(componentPath + '.ts');
33
+ return (0, core_1.normalize)(componentPath + '.ts');
29
34
  }
30
35
  else if (host.exists(componentPath + '.component.ts')) {
31
- return normalize(componentPath + '.component.ts');
36
+ return (0, core_1.normalize)(componentPath + '.component.ts');
32
37
  }
33
38
  else if (host.exists(componentPath + '/' + componentBaseName + '.component.ts')) {
34
- return normalize(componentPath + '/' + componentBaseName + '.component.ts');
39
+ return (0, core_1.normalize)(componentPath + '/' + componentBaseName + '.component.ts');
35
40
  }
36
41
  else {
37
- throw new Error("Specified component path ".concat(componentPath, " does not exist"));
42
+ throw new Error(`Specified component path ${componentPath} does not exist`);
38
43
  }
39
44
  }
40
45
  }
41
46
  /**
42
47
  * Function to find the "closest" component to a generated file's path.
43
48
  */
44
- export function findComponent(host, generateDir) {
45
- var dir = host.getDir('/' + generateDir);
46
- var componentRe = /\.component\.ts$/;
49
+ function findComponent(host, generateDir) {
50
+ let dir = host.getDir('/' + generateDir);
51
+ const componentRe = /\.component\.ts$/;
47
52
  while (dir) {
48
- var matches = dir.subfiles.filter(function (p) { return componentRe.test(p); });
53
+ const matches = dir.subfiles.filter((p) => componentRe.test(p));
49
54
  if (matches.length == 1) {
50
- return join(dir.path, matches[0]);
55
+ return (0, core_1.join)(dir.path, matches[0]);
51
56
  }
52
57
  else if (matches.length > 1) {
53
58
  throw new Error('More than one component matches. Use skip-import option to skip importing ' +
@@ -61,27 +66,27 @@ export function findComponent(host, generateDir) {
61
66
  /**
62
67
  * Build a relative path from one file path to another file path.
63
68
  */
64
- export function buildRelativePath(from, to) {
65
- var _a = parsePath(from), fromPath = _a.path, fromFileName = _a.filename, fromDirectory = _a.directory;
66
- var _b = parsePath(to), toPath = _b.path, toFileName = _b.filename, toDirectory = _b.directory;
67
- var relativePath = relative(fromDirectory, toDirectory);
68
- var fixedRelativePath = relativePath.startsWith('.')
69
+ function buildRelativePath(from, to) {
70
+ const { path: fromPath, filename: fromFileName, directory: fromDirectory, } = parsePath(from);
71
+ const { path: toPath, filename: toFileName, directory: toDirectory, } = parsePath(to);
72
+ const relativePath = (0, core_1.relative)(fromDirectory, toDirectory);
73
+ const fixedRelativePath = relativePath.startsWith('.')
69
74
  ? relativePath
70
- : "./".concat(relativePath);
75
+ : `./${relativePath}`;
71
76
  return !toFileName || toFileName === 'index.ts'
72
77
  ? fixedRelativePath
73
- : "".concat(fixedRelativePath.endsWith('/')
78
+ : `${fixedRelativePath.endsWith('/')
74
79
  ? fixedRelativePath
75
- : fixedRelativePath + '/').concat(convertToTypeScriptFileName(toFileName));
80
+ : fixedRelativePath + '/'}${convertToTypeScriptFileName(toFileName)}`;
76
81
  }
77
82
  function parsePath(path) {
78
- var pathNormalized = normalize(path);
79
- var filename = extname(pathNormalized) ? basename(pathNormalized) : '';
80
- var directory = filename ? dirname(pathNormalized) : pathNormalized;
83
+ const pathNormalized = (0, core_1.normalize)(path);
84
+ const filename = (0, core_1.extname)(pathNormalized) ? (0, core_1.basename)(pathNormalized) : '';
85
+ const directory = filename ? (0, core_1.dirname)(pathNormalized) : pathNormalized;
81
86
  return {
82
87
  path: pathNormalized,
83
- filename: filename,
84
- directory: directory,
88
+ filename,
89
+ directory,
85
90
  };
86
91
  }
87
92
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"find-component.js","sourceRoot":"","sources":["../../../../../modules/store-devtools/schematics-core/utility/find-component.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAEL,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,OAAO,EACP,OAAO,GACR,MAAM,sBAAsB,CAAC;AAW9B;;GAEG;AACH,MAAM,UAAU,wBAAwB,CACtC,IAAU,EACV,OAAyB;IAEzB,IAAI,OAAO,CAAC,cAAc,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;QAC/D,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;QACvB,IAAM,WAAW,GACf,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC;YACpB,CAAC,OAAO,CAAC,IAA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AAC,QAAQ,CAAC,GAAG,CAAC;YAC7B,CAAC,CAAC,iBAAiB;YACnB,CAAC,CAAC,iBAAiB,GAAG,GAAG,SAC1B,2BAA2B,CAAC,UAAU,CAAC,CAAE,CAAC;AACnD,CAAC;AAED,SAAS,SAAS,CAAC,IAAY;IAC7B,IAAM,cAAc,GAAG,SAAS,CAAC,IAAI,CAAS,CAAC;IAC/C,IAAM,QAAQ,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACzE,IAAM,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC;IACtE,OAAO;QACL,IAAI,EAAE,cAAc;QACpB,QAAQ,UAAA;QACR,SAAS,WAAA;KACV,CAAC;AACJ,CAAC;AACD;;;;GAIG;AACH,SAAS,2BAA2B,CAAC,QAA4B;IAC/D,OAAO,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,qBAAqB,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACrE,CAAC","sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {\n Path,\n join,\n normalize,\n relative,\n strings,\n basename,\n extname,\n dirname,\n} from '@angular-devkit/core';\nimport { DirEntry, Tree } from '@angular-devkit/schematics';\n\nexport interface ComponentOptions {\n component?: string;\n name: string;\n flat?: boolean;\n path?: string;\n skipImport?: boolean;\n}\n\n/**\n * Find the component referred by a set of options passed to the schematics.\n */\nexport function findComponentFromOptions(\n host: Tree,\n options: ComponentOptions\n): Path | undefined {\n if (options.hasOwnProperty('skipImport') && options.skipImport) {\n return undefined;\n }\n\n if (!options.component) {\n const pathToCheck =\n (options.path || '') +\n (options.flat ? '' : '/' + strings.dasherize(options.name));\n\n return normalize(findComponent(host, pathToCheck));\n } else {\n const componentPath = normalize(\n '/' + options.path + '/' + options.component\n );\n const componentBaseName = normalize(componentPath).split('/').pop();\n\n if (host.exists(componentPath)) {\n return normalize(componentPath);\n } else if (host.exists(componentPath + '.ts')) {\n return normalize(componentPath + '.ts');\n } else if (host.exists(componentPath + '.component.ts')) {\n return normalize(componentPath + '.component.ts');\n } else if (\n host.exists(componentPath + '/' + componentBaseName + '.component.ts')\n ) {\n return normalize(\n componentPath + '/' + componentBaseName + '.component.ts'\n );\n } else {\n throw new Error(\n `Specified component path ${componentPath} does not exist`\n );\n }\n }\n}\n\n/**\n * Function to find the \"closest\" component to a generated file's path.\n */\nexport function findComponent(host: Tree, generateDir: string): Path {\n let dir: DirEntry | null = host.getDir('/' + generateDir);\n\n const componentRe = /\\.component\\.ts$/;\n\n while (dir) {\n const matches = dir.subfiles.filter((p) => componentRe.test(p));\n\n if (matches.length == 1) {\n return join(dir.path, matches[0]);\n } else if (matches.length > 1) {\n throw new Error(\n 'More than one component matches. Use skip-import option to skip importing ' +\n 'the component store into the closest component.'\n );\n }\n\n dir = dir.parent;\n }\n\n throw new Error(\n 'Could not find an Component. Use the skip-import ' +\n 'option to skip importing in Component.'\n );\n}\n\n/**\n * Build a relative path from one file path to another file path.\n */\nexport function buildRelativePath(from: string, to: string): string {\n const {\n path: fromPath,\n filename: fromFileName,\n directory: fromDirectory,\n } = parsePath(from);\n const {\n path: toPath,\n filename: toFileName,\n directory: toDirectory,\n } = parsePath(to);\n const relativePath = relative(fromDirectory, toDirectory);\n const fixedRelativePath = relativePath.startsWith('.')\n ? relativePath\n : `./${relativePath}`;\n\n return !toFileName || toFileName === 'index.ts'\n ? fixedRelativePath\n : `${\n fixedRelativePath.endsWith('/')\n ? fixedRelativePath\n : fixedRelativePath + '/'\n }${convertToTypeScriptFileName(toFileName)}`;\n}\n\nfunction parsePath(path: string) {\n const pathNormalized = normalize(path) as Path;\n const filename = extname(pathNormalized) ? basename(pathNormalized) : '';\n const directory = filename ? dirname(pathNormalized) : pathNormalized;\n return {\n path: pathNormalized,\n filename,\n directory,\n };\n}\n/**\n * Strips the typescript extension and clears index filenames\n * foo.ts -> foo\n * index.ts -> empty\n */\nfunction convertToTypeScriptFileName(filename: string | undefined) {\n return filename ? filename.replace(/(\\.ts)|(index\\.ts)$/, '') : '';\n}\n"]}
1
+ {"version":3,"file":"find-component.js","sourceRoot":"","sources":["../../../../../modules/store-devtools/schematics-core/utility/find-component.ts"],"names":[],"mappings":";;AA8BA,4DAsCC;AAKD,sCAwBC;AAKD,8CAuBC;AA7HD;;;;;;GAMG;AACH,+CAS8B;AAW9B;;GAEG;AACH,SAAgB,wBAAwB,CACtC,IAAU,EACV,OAAyB;IAEzB,IAAI,OAAO,CAAC,cAAc,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;QAC/D,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;QACvB,MAAM,WAAW,GACf,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC;YACpB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,cAAO,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QAE9D,OAAO,IAAA,gBAAS,EAAC,aAAa,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC;IACrD,CAAC;SAAM,CAAC;QACN,MAAM,aAAa,GAAG,IAAA,gBAAS,EAC7B,GAAG,GAAG,OAAO,CAAC,IAAI,GAAG,GAAG,GAAG,OAAO,CAAC,SAAS,CAC7C,CAAC;QACF,MAAM,iBAAiB,GAAG,IAAA,gBAAS,EAAC,aAAa,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;QAEpE,IAAI,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CA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,CAAC,CAAC,CAAC,IAAA,cAAO,EAAC,cAAc,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC;IACtE,OAAO;QACL,IAAI,EAAE,cAAc;QACpB,QAAQ;QACR,SAAS;KACV,CAAC;AACJ,CAAC;AACD;;;;GAIG;AACH,SAAS,2BAA2B,CAAC,QAA4B;IAC/D,OAAO,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,qBAAqB,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACrE,CAAC","sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {\n Path,\n join,\n normalize,\n relative,\n strings,\n basename,\n extname,\n dirname,\n} from '@angular-devkit/core';\nimport { DirEntry, Tree } from '@angular-devkit/schematics';\n\nexport interface ComponentOptions {\n component?: string;\n name: string;\n flat?: boolean;\n path?: string;\n skipImport?: boolean;\n}\n\n/**\n * Find the component referred by a set of options passed to the schematics.\n */\nexport function findComponentFromOptions(\n host: Tree,\n options: ComponentOptions\n): Path | undefined {\n if (options.hasOwnProperty('skipImport') && options.skipImport) {\n return undefined;\n }\n\n if (!options.component) {\n const pathToCheck =\n (options.path || '') +\n (options.flat ? '' : '/' + strings.dasherize(options.name));\n\n return normalize(findComponent(host, pathToCheck));\n } else {\n const componentPath = normalize(\n '/' + options.path + '/' + options.component\n );\n const componentBaseName = normalize(componentPath).split('/').pop();\n\n if (host.exists(componentPath)) {\n return normalize(componentPath);\n } else if (host.exists(componentPath + '.ts')) {\n return normalize(componentPath + '.ts');\n } else if (host.exists(componentPath + '.component.ts')) {\n return normalize(componentPath + '.component.ts');\n } else if (\n host.exists(componentPath + '/' + componentBaseName + '.component.ts')\n ) {\n return normalize(\n componentPath + '/' + componentBaseName + '.component.ts'\n );\n } else {\n throw new Error(\n `Specified component path ${componentPath} does not exist`\n );\n }\n }\n}\n\n/**\n * Function to find the \"closest\" component to a generated file's path.\n */\nexport function findComponent(host: Tree, generateDir: string): Path {\n let dir: DirEntry | null = host.getDir('/' + generateDir);\n\n const componentRe = /\\.component\\.ts$/;\n\n while (dir) {\n const matches = dir.subfiles.filter((p) => componentRe.test(p));\n\n if (matches.length == 1) {\n return join(dir.path, matches[0]);\n } else if (matches.length > 1) {\n throw new Error(\n 'More than one component matches. Use skip-import option to skip importing ' +\n 'the component store into the closest component.'\n );\n }\n\n dir = dir.parent;\n }\n\n throw new Error(\n 'Could not find an Component. Use the skip-import ' +\n 'option to skip importing in Component.'\n );\n}\n\n/**\n * Build a relative path from one file path to another file path.\n */\nexport function buildRelativePath(from: string, to: string): string {\n const {\n path: fromPath,\n filename: fromFileName,\n directory: fromDirectory,\n } = parsePath(from);\n const {\n path: toPath,\n filename: toFileName,\n directory: toDirectory,\n } = parsePath(to);\n const relativePath = relative(fromDirectory, toDirectory);\n const fixedRelativePath = relativePath.startsWith('.')\n ? relativePath\n : `./${relativePath}`;\n\n return !toFileName || toFileName === 'index.ts'\n ? fixedRelativePath\n : `${\n fixedRelativePath.endsWith('/')\n ? fixedRelativePath\n : fixedRelativePath + '/'\n }${convertToTypeScriptFileName(toFileName)}`;\n}\n\nfunction parsePath(path: string) {\n const pathNormalized = normalize(path) as Path;\n const filename = extname(pathNormalized) ? basename(pathNormalized) : '';\n const directory = filename ? dirname(pathNormalized) : pathNormalized;\n return {\n path: pathNormalized,\n filename,\n directory,\n };\n}\n/**\n * Strips the typescript extension and clears index filenames\n * foo.ts -> foo\n * index.ts -> empty\n */\nfunction convertToTypeScriptFileName(filename: string | undefined) {\n return filename ? filename.replace(/(\\.ts)|(index\\.ts)$/, '') : '';\n}\n"]}
@@ -1,3 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.findModuleFromOptions = findModuleFromOptions;
4
+ exports.findModule = findModule;
5
+ exports.buildRelativePath = buildRelativePath;
1
6
  /**
2
7
  * @license
3
8
  * Copyright Google Inc. All Rights Reserved.
@@ -5,56 +10,56 @@
5
10
  * Use of this source code is governed by an MIT-style license that can be
6
11
  * found in the LICENSE file at https://angular.io/license
7
12
  */
8
- import { join, normalize, relative, strings, basename, extname, dirname, } from '@angular-devkit/core';
13
+ const core_1 = require("@angular-devkit/core");
9
14
  /**
10
15
  * Find the module referred by a set of options passed to the schematics.
11
16
  */
12
- export function findModuleFromOptions(host, options) {
17
+ function findModuleFromOptions(host, options) {
13
18
  if (options.hasOwnProperty('skipImport') && options.skipImport) {
14
19
  return undefined;
15
20
  }
16
21
  if (!options.module) {
17
- var pathToCheck = (options.path || '') +
18
- (options.flat ? '' : '/' + strings.dasherize(options.name));
19
- return normalize(findModule(host, pathToCheck));
22
+ const pathToCheck = (options.path || '') +
23
+ (options.flat ? '' : '/' + core_1.strings.dasherize(options.name));
24
+ return (0, core_1.normalize)(findModule(host, pathToCheck));
20
25
  }
21
26
  else {
22
- var modulePath = normalize('/' + options.path + '/' + options.module);
23
- var moduleBaseName = normalize(modulePath).split('/').pop();
27
+ const modulePath = (0, core_1.normalize)('/' + options.path + '/' + options.module);
28
+ const moduleBaseName = (0, core_1.normalize)(modulePath).split('/').pop();
24
29
  if (host.exists(modulePath)) {
25
- return normalize(modulePath);
30
+ return (0, core_1.normalize)(modulePath);
26
31
  }
27
32
  else if (host.exists(modulePath + '.ts')) {
28
- return normalize(modulePath + '.ts');
33
+ return (0, core_1.normalize)(modulePath + '.ts');
29
34
  }
30
35
  else if (host.exists(modulePath + '.module.ts')) {
31
- return normalize(modulePath + '.module.ts');
36
+ return (0, core_1.normalize)(modulePath + '.module.ts');
32
37
  }
33
38
  else if (host.exists(modulePath + '/' + moduleBaseName + '.module.ts')) {
34
- return normalize(modulePath + '/' + moduleBaseName + '.module.ts');
39
+ return (0, core_1.normalize)(modulePath + '/' + moduleBaseName + '.module.ts');
35
40
  }
36
41
  else if (host.exists(modulePath + '-module.ts')) {
37
- return normalize(modulePath + '-module.ts');
42
+ return (0, core_1.normalize)(modulePath + '-module.ts');
38
43
  }
39
44
  else if (host.exists(modulePath + '/' + moduleBaseName + '-module.ts')) {
40
- return normalize(modulePath + '/' + moduleBaseName + '-module.ts');
45
+ return (0, core_1.normalize)(modulePath + '/' + moduleBaseName + '-module.ts');
41
46
  }
42
47
  else {
43
- throw new Error("Specified module path ".concat(modulePath, " does not exist"));
48
+ throw new Error(`Specified module path ${modulePath} does not exist`);
44
49
  }
45
50
  }
46
51
  }
47
52
  /**
48
53
  * Function to find the "closest" module to a generated file's path.
49
54
  */
50
- export function findModule(host, generateDir) {
51
- var dir = host.getDir('/' + generateDir);
52
- var moduleRe = /(\.|-)module\.ts$/;
53
- var routingModuleRe = /-routing(\.|-)module\.ts/;
55
+ function findModule(host, generateDir) {
56
+ let dir = host.getDir('/' + generateDir);
57
+ const moduleRe = /(\.|-)module\.ts$/;
58
+ const routingModuleRe = /-routing(\.|-)module\.ts/;
54
59
  while (dir) {
55
- var matches = dir.subfiles.filter(function (p) { return moduleRe.test(p) && !routingModuleRe.test(p); });
60
+ const matches = dir.subfiles.filter((p) => moduleRe.test(p) && !routingModuleRe.test(p));
56
61
  if (matches.length == 1) {
57
- return join(dir.path, matches[0]);
62
+ return (0, core_1.join)(dir.path, matches[0]);
58
63
  }
59
64
  else if (matches.length > 1) {
60
65
  throw new Error('More than one module matches. Use skip-import option to skip importing ' +
@@ -68,27 +73,27 @@ export function findModule(host, generateDir) {
68
73
  /**
69
74
  * Build a relative path from one file path to another file path.
70
75
  */
71
- export function buildRelativePath(from, to) {
72
- var _a = parsePath(from), fromPath = _a.path, fromFileName = _a.filename, fromDirectory = _a.directory;
73
- var _b = parsePath(to), toPath = _b.path, toFileName = _b.filename, toDirectory = _b.directory;
74
- var relativePath = relative(fromDirectory, toDirectory);
75
- var fixedRelativePath = relativePath.startsWith('.')
76
+ function buildRelativePath(from, to) {
77
+ const { path: fromPath, filename: fromFileName, directory: fromDirectory, } = parsePath(from);
78
+ const { path: toPath, filename: toFileName, directory: toDirectory, } = parsePath(to);
79
+ const relativePath = (0, core_1.relative)(fromDirectory, toDirectory);
80
+ const fixedRelativePath = relativePath.startsWith('.')
76
81
  ? relativePath
77
- : "./".concat(relativePath);
82
+ : `./${relativePath}`;
78
83
  return !toFileName || toFileName === 'index.ts'
79
84
  ? fixedRelativePath
80
- : "".concat(fixedRelativePath.endsWith('/')
85
+ : `${fixedRelativePath.endsWith('/')
81
86
  ? fixedRelativePath
82
- : fixedRelativePath + '/').concat(convertToTypeScriptFileName(toFileName));
87
+ : fixedRelativePath + '/'}${convertToTypeScriptFileName(toFileName)}`;
83
88
  }
84
89
  function parsePath(path) {
85
- var pathNormalized = normalize(path);
86
- var filename = extname(pathNormalized) ? basename(pathNormalized) : '';
87
- var directory = filename ? dirname(pathNormalized) : pathNormalized;
90
+ const pathNormalized = (0, core_1.normalize)(path);
91
+ const filename = (0, core_1.extname)(pathNormalized) ? (0, core_1.basename)(pathNormalized) : '';
92
+ const directory = filename ? (0, core_1.dirname)(pathNormalized) : pathNormalized;
88
93
  return {
89
94
  path: pathNormalized,
90
- filename: filename,
91
- directory: directory,
95
+ filename,
96
+ directory,
92
97
  };
93
98
  }
94
99
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"find-module.js","sourceRoot":"","sources":["../../../../../modules/store-devtools/schematics-core/utility/find-module.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAEL,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,OAAO,EACP,OAAO,GACR,MAAM,sBAAsB,CAAC;AAW9B;;GAEG;AACH,MAAM,UAAU,qBAAqB,CACnC,IAAU,EACV,OAAsB;IAEtB,IAAI,OAAO,CAAC,cAAc,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;QAC/D,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QACpB,IAAM,WAAW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/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {\n Path,\n join,\n normalize,\n relative,\n strings,\n basename,\n extname,\n dirname,\n} from '@angular-devkit/core';\nimport { DirEntry, Tree } from '@angular-devkit/schematics';\n\nexport interface ModuleOptions {\n module?: string;\n name: string;\n flat?: boolean;\n path?: string;\n skipImport?: boolean;\n}\n\n/**\n * Find the module referred by a set of options passed to the schematics.\n */\nexport function findModuleFromOptions(\n host: Tree,\n options: ModuleOptions\n): Path | undefined {\n if (options.hasOwnProperty('skipImport') && options.skipImport) {\n return undefined;\n }\n\n if (!options.module) {\n const pathToCheck =\n (options.path || '') +\n (options.flat ? '' : '/' + strings.dasherize(options.name));\n\n return normalize(findModule(host, pathToCheck));\n } else {\n const modulePath = normalize('/' + options.path + '/' + options.module);\n const moduleBaseName = normalize(modulePath).split('/').pop();\n\n if (host.exists(modulePath)) {\n return normalize(modulePath);\n } else if (host.exists(modulePath + '.ts')) {\n return normalize(modulePath + '.ts');\n } else if (host.exists(modulePath + '.module.ts')) {\n return normalize(modulePath + '.module.ts');\n } else if (host.exists(modulePath + '/' + moduleBaseName + '.module.ts')) {\n return normalize(modulePath + '/' + moduleBaseName + '.module.ts');\n } else if (host.exists(modulePath + '-module.ts')) {\n return normalize(modulePath + '-module.ts');\n } else if (host.exists(modulePath + '/' + moduleBaseName + '-module.ts')) {\n return normalize(modulePath + '/' + moduleBaseName + '-module.ts');\n } else {\n throw new Error(`Specified module path ${modulePath} does not exist`);\n }\n }\n}\n\n/**\n * Function to find the \"closest\" module to a generated file's path.\n */\nexport function findModule(host: Tree, generateDir: string): Path {\n let dir: DirEntry | null = host.getDir('/' + generateDir);\n\n const moduleRe = /(\\.|-)module\\.ts$/;\n const routingModuleRe = /-routing(\\.|-)module\\.ts/;\n\n while (dir) {\n const matches = dir.subfiles.filter(\n (p) => moduleRe.test(p) && !routingModuleRe.test(p)\n );\n\n if (matches.length == 1) {\n return join(dir.path, matches[0]);\n } else if (matches.length > 1) {\n throw new Error(\n 'More than one module matches. Use skip-import option to skip importing ' +\n 'the component into the closest module.'\n );\n }\n\n dir = dir.parent;\n }\n\n throw new Error(\n 'Could not find an NgModule. Use the skip-import ' +\n 'option to skip importing in NgModule.'\n );\n}\n\n/**\n * Build a relative path from one file path to another file path.\n */\nexport function buildRelativePath(from: string, to: string): string {\n const {\n path: fromPath,\n filename: fromFileName,\n directory: fromDirectory,\n } = parsePath(from);\n const {\n path: toPath,\n filename: toFileName,\n directory: toDirectory,\n } = parsePath(to);\n const relativePath = relative(fromDirectory, toDirectory);\n const fixedRelativePath = relativePath.startsWith('.')\n ? relativePath\n : `./${relativePath}`;\n\n return !toFileName || toFileName === 'index.ts'\n ? fixedRelativePath\n : `${\n fixedRelativePath.endsWith('/')\n ? fixedRelativePath\n : fixedRelativePath + '/'\n }${convertToTypeScriptFileName(toFileName)}`;\n}\n\nfunction parsePath(path: string) {\n const pathNormalized = normalize(path) as Path;\n const filename = extname(pathNormalized) ? basename(pathNormalized) : '';\n const directory = filename ? dirname(pathNormalized) : pathNormalized;\n return {\n path: pathNormalized,\n filename,\n directory,\n };\n}\n/**\n * Strips the typescript extension and clears index filenames\n * foo.ts -> foo\n * index.ts -> empty\n */\nfunction convertToTypeScriptFileName(filename: string | undefined) {\n return filename ? filename.replace(/(\\.ts)|(index\\.ts)$/, '') : '';\n}\n"]}
1
+ {"version":3,"file":"find-module.js","sourceRoot":"","sources":["../../../../../modules/store-devtools/schematics-core/utility/find-module.ts"],"names":[],"mappings":";;AA8BA,sDAkCC;AAKD,gCA2BC;AAKD,8CAuBC;AA5HD;;;;;;GAMG;AACH,+CAS8B;AAW9B;;GAEG;AACH,SAAgB,qBAAqB,CACnC,IAAU,EACV,OAAsB;IAEtB,IAAI,OAAO,CAAC,cAAc,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;QAC/D,OAAO,SAAS,CA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,CAAC;AACJ,CAAC;AACD;;;;GAIG;AACH,SAAS,2BAA2B,CAAC,QAA4B;IAC/D,OAAO,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,qBAAqB,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACrE,CAAC","sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {\n Path,\n join,\n normalize,\n relative,\n strings,\n basename,\n extname,\n dirname,\n} from '@angular-devkit/core';\nimport { DirEntry, Tree } from '@angular-devkit/schematics';\n\nexport interface ModuleOptions {\n module?: string;\n name: string;\n flat?: boolean;\n path?: string;\n skipImport?: boolean;\n}\n\n/**\n * Find the module referred by a set of options passed to the schematics.\n */\nexport function findModuleFromOptions(\n host: Tree,\n options: ModuleOptions\n): Path | undefined {\n if (options.hasOwnProperty('skipImport') && options.skipImport) {\n return undefined;\n }\n\n if (!options.module) {\n const pathToCheck =\n (options.path || '') +\n (options.flat ? '' : '/' + strings.dasherize(options.name));\n\n return normalize(findModule(host, pathToCheck));\n } else {\n const modulePath = normalize('/' + options.path + '/' + options.module);\n const moduleBaseName = normalize(modulePath).split('/').pop();\n\n if (host.exists(modulePath)) {\n return normalize(modulePath);\n } else if (host.exists(modulePath + '.ts')) {\n return normalize(modulePath + '.ts');\n } else if (host.exists(modulePath + '.module.ts')) {\n return normalize(modulePath + '.module.ts');\n } else if (host.exists(modulePath + '/' + moduleBaseName + '.module.ts')) {\n return normalize(modulePath + '/' + moduleBaseName + '.module.ts');\n } else if (host.exists(modulePath + '-module.ts')) {\n return normalize(modulePath + '-module.ts');\n } else if (host.exists(modulePath + '/' + moduleBaseName + '-module.ts')) {\n return normalize(modulePath + '/' + moduleBaseName + '-module.ts');\n } else {\n throw new Error(`Specified module path ${modulePath} does not exist`);\n }\n }\n}\n\n/**\n * Function to find the \"closest\" module to a generated file's path.\n */\nexport function findModule(host: Tree, generateDir: string): Path {\n let dir: DirEntry | null = host.getDir('/' + generateDir);\n\n const moduleRe = /(\\.|-)module\\.ts$/;\n const routingModuleRe = /-routing(\\.|-)module\\.ts/;\n\n while (dir) {\n const matches = dir.subfiles.filter(\n (p) => moduleRe.test(p) && !routingModuleRe.test(p)\n );\n\n if (matches.length == 1) {\n return join(dir.path, matches[0]);\n } else if (matches.length > 1) {\n throw new Error(\n 'More than one module matches. Use skip-import option to skip importing ' +\n 'the component into the closest module.'\n );\n }\n\n dir = dir.parent;\n }\n\n throw new Error(\n 'Could not find an NgModule. Use the skip-import ' +\n 'option to skip importing in NgModule.'\n );\n}\n\n/**\n * Build a relative path from one file path to another file path.\n */\nexport function buildRelativePath(from: string, to: string): string {\n const {\n path: fromPath,\n filename: fromFileName,\n directory: fromDirectory,\n } = parsePath(from);\n const {\n path: toPath,\n filename: toFileName,\n directory: toDirectory,\n } = parsePath(to);\n const relativePath = relative(fromDirectory, toDirectory);\n const fixedRelativePath = relativePath.startsWith('.')\n ? relativePath\n : `./${relativePath}`;\n\n return !toFileName || toFileName === 'index.ts'\n ? fixedRelativePath\n : `${\n fixedRelativePath.endsWith('/')\n ? fixedRelativePath\n : fixedRelativePath + '/'\n }${convertToTypeScriptFileName(toFileName)}`;\n}\n\nfunction parsePath(path: string) {\n const pathNormalized = normalize(path) as Path;\n const filename = extname(pathNormalized) ? basename(pathNormalized) : '';\n const directory = filename ? dirname(pathNormalized) : pathNormalized;\n return {\n path: pathNormalized,\n filename,\n directory,\n };\n}\n/**\n * Strips the typescript extension and clears index filenames\n * foo.ts -> foo\n * index.ts -> empty\n */\nfunction convertToTypeScriptFileName(filename: string | undefined) {\n return filename ? filename.replace(/(\\.ts)|(index\\.ts)$/, '') : '';\n}\n"]}
@@ -1,32 +1,13 @@
1
- var __values = (this && this.__values) || function(o) {
2
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
3
- if (m) return m.call(o);
4
- if (o && typeof o.length === "number") return {
5
- next: function () {
6
- if (o && i >= o.length) o = void 0;
7
- return { value: o && o[i++], done: !o };
8
- }
9
- };
10
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
11
- };
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.findPropertyInAstObject = findPropertyInAstObject;
12
4
  // https://github.com/angular/angular-cli/blob/master/packages/schematics/angular/utility/json-utils.ts
13
- export function findPropertyInAstObject(node, propertyName) {
14
- var e_1, _a;
15
- var maybeNode = null;
16
- try {
17
- for (var _b = __values(node.properties), _c = _b.next(); !_c.done; _c = _b.next()) {
18
- var property = _c.value;
19
- if (property.key.value == propertyName) {
20
- maybeNode = property.value;
21
- }
22
- }
23
- }
24
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
25
- finally {
26
- try {
27
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
5
+ function findPropertyInAstObject(node, propertyName) {
6
+ let maybeNode = null;
7
+ for (const property of node.properties) {
8
+ if (property.key.value == propertyName) {
9
+ maybeNode = property.value;
28
10
  }
29
- finally { if (e_1) throw e_1.error; }
30
11
  }
31
12
  return maybeNode;
32
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"json-utilts.js","sourceRoot":"","sources":["../../../../../modules/store-devtools/schematics-core/utility/json-utilts.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,uGAAuG;AACvG,MAAM,UAAU,uBAAuB,CACrC,IAAS,EACT,YAAoB;;IAEpB,IAAI,SAAS,GAAe,IAAI,CAAC;;QACjC,KAAuB,IAAA,KAAA,SAAA,IAAI,CAAC,UAAU,CAAA,gBAAA,4BAAE,CAAC;YAApC,IAAM,QAAQ,WAAA;YACjB,IAAI,QAAQ,CAAC,GAAG,CAAC,KAAK,IAAI,YAAY,EAAE,CAAC;gBACvC,SAAS,GAAG,QAAQ,CAAC,KAAK,CAAC;YAC7B,CAAC;QACH,CAAC;;;;;;;;;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["// https://github.com/angular/angular-cli/blob/master/packages/schematics/angular/utility/json-utils.ts\nexport function findPropertyInAstObject(\n node: any,\n propertyName: string\n): any | null {\n let maybeNode: any | null = null;\n for (const property of node.properties) {\n if (property.key.value == propertyName) {\n maybeNode = property.value;\n }\n }\n\n return maybeNode;\n}\n"]}
1
+ {"version":3,"file":"json-utilts.js","sourceRoot":"","sources":["../../../../../modules/store-devtools/schematics-core/utility/json-utilts.ts"],"names":[],"mappings":";;AACA,0DAYC;AAbD,uGAAuG;AACvG,SAAgB,uBAAuB,CACrC,IAAS,EACT,YAAoB;IAEpB,IAAI,SAAS,GAAe,IAAI,CAAC;IACjC,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;QACvC,IAAI,QAAQ,CAAC,GAAG,CAAC,KAAK,IAAI,YAAY,EAAE,CAAC;YACvC,SAAS,GAAG,QAAQ,CAAC,KAAK,CAAC;QAC7B,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["// https://github.com/angular/angular-cli/blob/master/packages/schematics/angular/utility/json-utils.ts\nexport function findPropertyInAstObject(\n node: any,\n propertyName: string\n): any | null {\n let maybeNode: any | null = null;\n for (const property of node.properties) {\n if (property.key.value == propertyName) {\n maybeNode = property.value;\n }\n }\n\n return maybeNode;\n}\n"]}
@@ -1,2 +1,5 @@
1
- export var platformVersion = '^21.0.0-beta.0';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.platformVersion = void 0;
4
+ exports.platformVersion = '^21.0.0-rc.0';
2
5
  //# sourceMappingURL=libs-version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"libs-version.js","sourceRoot":"","sources":["../../../../../modules/store-devtools/schematics-core/utility/libs-version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,eAAe,GAAG,gBAAgB,CAAC","sourcesContent":["export const platformVersion = '^21.0.0-beta.0';\n"]}
1
+ {"version":3,"file":"libs-version.js","sourceRoot":"","sources":["../../../../../modules/store-devtools/schematics-core/utility/libs-version.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG,cAAc,CAAC","sourcesContent":["export const platformVersion = '^21.0.0-rc.0';\n"]}