@mutates/angular 0.2.0 → 1.0.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 (112) hide show
  1. package/package.json +2 -2
  2. package/src/index.d.ts +3 -0
  3. package/src/index.js +3 -0
  4. package/src/index.js.map +1 -1
  5. package/src/lib/bootstrap/get-bootstrap-application-fn.js +8 -3
  6. package/src/lib/bootstrap/get-bootstrap-application-fn.js.map +1 -1
  7. package/src/lib/bootstrap/get-bootstrap-module-fn.d.ts +2 -0
  8. package/src/lib/bootstrap/get-bootstrap-module-fn.js +17 -0
  9. package/src/lib/bootstrap/get-bootstrap-module-fn.js.map +1 -0
  10. package/src/lib/bootstrap/index.d.ts +1 -2
  11. package/src/lib/bootstrap/index.js +1 -2
  12. package/src/lib/bootstrap/index.js.map +1 -1
  13. package/src/lib/component/get-components.d.ts +4 -0
  14. package/src/lib/component/get-components.js +13 -0
  15. package/src/lib/component/get-components.js.map +1 -0
  16. package/src/lib/component/index.d.ts +1 -3
  17. package/src/lib/component/index.js +1 -3
  18. package/src/lib/component/index.js.map +1 -1
  19. package/src/lib/directive/get-directives.d.ts +4 -0
  20. package/src/lib/directive/get-directives.js +13 -0
  21. package/src/lib/directive/get-directives.js.map +1 -0
  22. package/src/lib/directive/index.d.ts +1 -1
  23. package/src/lib/directive/index.js +1 -1
  24. package/src/lib/directive/index.js.map +1 -1
  25. package/src/lib/helpers/index.d.ts +1 -6
  26. package/src/lib/helpers/index.js +1 -6
  27. package/src/lib/helpers/index.js.map +1 -1
  28. package/src/lib/helpers/is-standalone.d.ts +2 -0
  29. package/src/lib/helpers/is-standalone.js +27 -0
  30. package/src/lib/helpers/is-standalone.js.map +1 -0
  31. package/src/lib/injectable/get-injectables.d.ts +4 -0
  32. package/src/lib/injectable/get-injectables.js +13 -0
  33. package/src/lib/injectable/get-injectables.js.map +1 -0
  34. package/src/lib/injectable/index.d.ts +1 -0
  35. package/src/lib/injectable/index.js +5 -0
  36. package/src/lib/injectable/index.js.map +1 -0
  37. package/src/lib/metadata/get-metadata.d.ts +1 -1
  38. package/src/lib/metadata/get-metadata.js.map +1 -1
  39. package/src/lib/metadata/index.d.ts +1 -0
  40. package/src/lib/metadata/index.js +5 -0
  41. package/src/lib/metadata/index.js.map +1 -0
  42. package/src/lib/module/get-app-module.d.ts +2 -0
  43. package/src/lib/{helpers/get-main-module.js → module/get-app-module.js} +5 -5
  44. package/src/lib/module/get-app-module.js.map +1 -0
  45. package/src/lib/module/get-ng-modules.d.ts +4 -0
  46. package/src/lib/module/get-ng-modules.js +13 -0
  47. package/src/lib/module/get-ng-modules.js.map +1 -0
  48. package/src/lib/module/index.d.ts +2 -7
  49. package/src/lib/module/index.js +2 -7
  50. package/src/lib/module/index.js.map +1 -1
  51. package/src/lib/pipe/get-pipes.d.ts +4 -0
  52. package/src/lib/pipe/get-pipes.js +13 -0
  53. package/src/lib/pipe/get-pipes.js.map +1 -0
  54. package/src/lib/pipe/index.d.ts +1 -0
  55. package/src/lib/pipe/index.js +5 -0
  56. package/src/lib/pipe/index.js.map +1 -0
  57. package/src/lib/bootstrap/add-provider-to-bootstrap-application-fn.d.ts +0 -4
  58. package/src/lib/bootstrap/add-provider-to-bootstrap-application-fn.js +0 -23
  59. package/src/lib/bootstrap/add-provider-to-bootstrap-application-fn.js.map +0 -1
  60. package/src/lib/bootstrap/get-bootstrap-fn.d.ts +0 -2
  61. package/src/lib/bootstrap/get-bootstrap-fn.js +0 -15
  62. package/src/lib/bootstrap/get-bootstrap-fn.js.map +0 -1
  63. package/src/lib/component/add-import-to-component.d.ts +0 -4
  64. package/src/lib/component/add-import-to-component.js +0 -12
  65. package/src/lib/component/add-import-to-component.js.map +0 -1
  66. package/src/lib/component/add-provider-to-component.d.ts +0 -4
  67. package/src/lib/component/add-provider-to-component.js +0 -12
  68. package/src/lib/component/add-provider-to-component.js.map +0 -1
  69. package/src/lib/component/add-style-url-to-component.d.ts +0 -4
  70. package/src/lib/component/add-style-url-to-component.js +0 -11
  71. package/src/lib/component/add-style-url-to-component.js.map +0 -1
  72. package/src/lib/directive/add-provider-to-directive.d.ts +0 -4
  73. package/src/lib/directive/add-provider-to-directive.js +0 -12
  74. package/src/lib/directive/add-provider-to-directive.js.map +0 -1
  75. package/src/lib/helpers/get-main-module.d.ts +0 -2
  76. package/src/lib/helpers/get-main-module.js.map +0 -1
  77. package/src/lib/helpers/is-standalone-component.d.ts +0 -2
  78. package/src/lib/helpers/is-standalone-component.js +0 -22
  79. package/src/lib/helpers/is-standalone-component.js.map +0 -1
  80. package/src/lib/helpers/ng-component.d.ts +0 -3
  81. package/src/lib/helpers/ng-component.js +0 -9
  82. package/src/lib/helpers/ng-component.js.map +0 -1
  83. package/src/lib/helpers/ng-module.d.ts +0 -7
  84. package/src/lib/helpers/ng-module.js +0 -23
  85. package/src/lib/helpers/ng-module.js.map +0 -1
  86. package/src/lib/helpers/push-to-decorator-array-property.d.ts +0 -5
  87. package/src/lib/helpers/push-to-decorator-array-property.js +0 -22
  88. package/src/lib/helpers/push-to-decorator-array-property.js.map +0 -1
  89. package/src/lib/helpers/push-to-object-literal-array-property.d.ts +0 -5
  90. package/src/lib/helpers/push-to-object-literal-array-property.js +0 -25
  91. package/src/lib/helpers/push-to-object-literal-array-property.js.map +0 -1
  92. package/src/lib/module/add-bootstrap-to-ng-module.d.ts +0 -4
  93. package/src/lib/module/add-bootstrap-to-ng-module.js +0 -14
  94. package/src/lib/module/add-bootstrap-to-ng-module.js.map +0 -1
  95. package/src/lib/module/add-declaration-to-ng-module.d.ts +0 -4
  96. package/src/lib/module/add-declaration-to-ng-module.js +0 -12
  97. package/src/lib/module/add-declaration-to-ng-module.js.map +0 -1
  98. package/src/lib/module/add-entry-component-to-ng-module.d.ts +0 -4
  99. package/src/lib/module/add-entry-component-to-ng-module.js +0 -12
  100. package/src/lib/module/add-entry-component-to-ng-module.js.map +0 -1
  101. package/src/lib/module/add-export-to-ng-module.d.ts +0 -4
  102. package/src/lib/module/add-export-to-ng-module.js +0 -12
  103. package/src/lib/module/add-export-to-ng-module.js.map +0 -1
  104. package/src/lib/module/add-import-to-ng-module.d.ts +0 -4
  105. package/src/lib/module/add-import-to-ng-module.js +0 -12
  106. package/src/lib/module/add-import-to-ng-module.js.map +0 -1
  107. package/src/lib/module/add-provider-to-ng-module.d.ts +0 -4
  108. package/src/lib/module/add-provider-to-ng-module.js +0 -12
  109. package/src/lib/module/add-provider-to-ng-module.js.map +0 -1
  110. package/src/lib/module/add-schema-to-ng-module.d.ts +0 -4
  111. package/src/lib/module/add-schema-to-ng-module.js +0 -12
  112. package/src/lib/module/add-schema-to-ng-module.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mutates/angular",
3
- "version": "0.2.0",
3
+ "version": "1.0.0",
4
4
  "keywords": [
5
5
  "typescript",
6
6
  "ast",
@@ -18,7 +18,7 @@
18
18
  "main": "./src/index.js",
19
19
  "typings": "./src/index.d.ts",
20
20
  "dependencies": {
21
- "@mutates/core": "0.2.0",
21
+ "@mutates/core": "1.0.0",
22
22
  "multimatch": "^7.0.0",
23
23
  "ts-morph": "^22.0.0",
24
24
  "tslib": "^2.3.0"
package/src/index.d.ts CHANGED
@@ -2,7 +2,10 @@ export * from './lib/bootstrap';
2
2
  export * from './lib/component';
3
3
  export * from './lib/directive';
4
4
  export * from './lib/helpers';
5
+ export * from './lib/injectable';
6
+ export * from './lib/metadata';
5
7
  export * from './lib/module';
8
+ export * from './lib/pipe';
6
9
  export * from './lib/testing';
7
10
  export * from './lib/create-angular-project';
8
11
  export * from './lib/ng-tree-file-system';
package/src/index.js CHANGED
@@ -5,7 +5,10 @@ tslib_1.__exportStar(require("./lib/bootstrap"), exports);
5
5
  tslib_1.__exportStar(require("./lib/component"), exports);
6
6
  tslib_1.__exportStar(require("./lib/directive"), exports);
7
7
  tslib_1.__exportStar(require("./lib/helpers"), exports);
8
+ tslib_1.__exportStar(require("./lib/injectable"), exports);
9
+ tslib_1.__exportStar(require("./lib/metadata"), exports);
8
10
  tslib_1.__exportStar(require("./lib/module"), exports);
11
+ tslib_1.__exportStar(require("./lib/pipe"), exports);
9
12
  tslib_1.__exportStar(require("./lib/testing"), exports);
10
13
  tslib_1.__exportStar(require("./lib/create-angular-project"), exports);
11
14
  tslib_1.__exportStar(require("./lib/ng-tree-file-system"), exports);
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/angular/src/index.ts"],"names":[],"mappings":";;;AAAA,0DAAgC;AAChC,0DAAgC;AAChC,0DAAgC;AAChC,wDAA8B;AAC9B,uDAA6B;AAC7B,wDAA8B;AAC9B,uEAA6C;AAC7C,oEAA0C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/angular/src/index.ts"],"names":[],"mappings":";;;AAAA,0DAAgC;AAChC,0DAAgC;AAChC,0DAAgC;AAChC,wDAA8B;AAC9B,2DAAiC;AACjC,yDAA+B;AAC/B,uDAA6B;AAC7B,qDAA2B;AAC3B,wDAA8B;AAC9B,uEAA6C;AAC7C,oEAA0C"}
@@ -5,11 +5,16 @@ const ts_morph_1 = require("ts-morph");
5
5
  const core_1 = require("@mutates/core");
6
6
  function getBootstrapApplicationFn(mainFilePath) {
7
7
  var _a;
8
- const [bootstrapApplicationImport] = (0, core_1.getImports)(mainFilePath, {
8
+ const [namedImport] = (0, core_1.getNamedImports)((0, core_1.getImports)(mainFilePath, {
9
9
  moduleSpecifier: '@angular/platform-browser',
10
+ }), {
11
+ name: 'bootstrapApplication',
10
12
  });
11
- const namedImport = bootstrapApplicationImport === null || bootstrapApplicationImport === void 0 ? void 0 : bootstrapApplicationImport.getNamedImports().find((imp) => imp.getName() === 'bootstrapApplication');
12
- return (_a = namedImport === null || namedImport === void 0 ? void 0 : namedImport.getNameNode().findReferencesAsNodes().find((ref) => ts_morph_1.Node.isCallExpression(ref.getParent()))) === null || _a === void 0 ? void 0 : _a.getParentIfKind(ts_morph_1.SyntaxKind.CallExpression);
13
+ if (!namedImport) {
14
+ return;
15
+ }
16
+ return (_a = (0, core_1.getImportRefs)(namedImport)
17
+ .find((ref) => ts_morph_1.Node.isCallExpression(ref.getParent()))) === null || _a === void 0 ? void 0 : _a.getParentIfKind(ts_morph_1.SyntaxKind.CallExpression);
13
18
  }
14
19
  exports.getBootstrapApplicationFn = getBootstrapApplicationFn;
15
20
  //# sourceMappingURL=get-bootstrap-application-fn.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-bootstrap-application-fn.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/bootstrap/get-bootstrap-application-fn.ts"],"names":[],"mappings":";;;AACA,uCAA4C;AAE5C,wCAA2C;AAE3C,SAAgB,yBAAyB,CAAC,YAAoB;;IAC5D,MAAM,CAAC,0BAA0B,CAAC,GAAG,IAAA,iBAAU,EAAC,YAAY,EAAE;QAC5D,eAAe,EAAE,2BAA2B;KAC7C,CAAC,CAAC;IAEH,MAAM,WAAW,GAAG,0BAA0B,aAA1B,0BAA0B,uBAA1B,0BAA0B,CAC1C,eAAe,GAChB,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,sBAAsB,CAAC,CAAC;IAE3D,OAAO,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CACd,WAAW,GACZ,qBAAqB,GACrB,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,eAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,CAAC,0CACpD,eAAe,CAAC,qBAAU,CAAC,cAAc,CAAC,CAAC;AACjD,CAAC;AAdD,8DAcC"}
1
+ {"version":3,"file":"get-bootstrap-application-fn.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/bootstrap/get-bootstrap-application-fn.ts"],"names":[],"mappings":";;;AACA,uCAA4C;AAE5C,wCAA2E;AAE3E,SAAgB,yBAAyB,CAAC,YAAoB;;IAC5D,MAAM,CAAC,WAAW,CAAC,GAAG,IAAA,sBAAe,EACnC,IAAA,iBAAU,EAAC,YAAY,EAAE;QACvB,eAAe,EAAE,2BAA2B;KAC7C,CAAC,EACF;QACE,IAAI,EAAE,sBAAsB;KAC7B,CACF,CAAC;IAEF,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO;IACT,CAAC;IAED,OAAO,MAAA,IAAA,oBAAa,EAAC,WAAW,CAAC;SAC9B,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,eAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,CAAC,0CACpD,eAAe,CAAC,qBAAU,CAAC,cAAc,CAAC,CAAC;AACjD,CAAC;AAjBD,8DAiBC"}
@@ -0,0 +1,2 @@
1
+ import type { CallExpression } from 'ts-morph';
2
+ export declare function getBootstrapModuleFn(mainFilePath: string): CallExpression | undefined;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getBootstrapModuleFn = void 0;
4
+ const ts_morph_1 = require("ts-morph");
5
+ const core_1 = require("@mutates/core");
6
+ function getBootstrapModuleFn(mainFilePath) {
7
+ var _a, _b, _c;
8
+ const namedImport = (0, core_1.getNamedImports)((0, core_1.getImports)(mainFilePath, {
9
+ moduleSpecifier: '@angular/platform-browser-dynamic',
10
+ }), {
11
+ name: 'platformBrowserDynamic',
12
+ });
13
+ return (_c = (_b = (_a = (0, core_1.getImportRefs)(namedImport)
14
+ .find((ref) => ts_morph_1.Node.isCallExpression(ref.getParent()))) === null || _a === void 0 ? void 0 : _a.getParentIfKind(ts_morph_1.SyntaxKind.CallExpression)) === null || _b === void 0 ? void 0 : _b.getParentIfKind(ts_morph_1.SyntaxKind.PropertyAccessExpression)) === null || _c === void 0 ? void 0 : _c.getParentIfKind(ts_morph_1.SyntaxKind.CallExpression);
15
+ }
16
+ exports.getBootstrapModuleFn = getBootstrapModuleFn;
17
+ //# sourceMappingURL=get-bootstrap-module-fn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-bootstrap-module-fn.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/bootstrap/get-bootstrap-module-fn.ts"],"names":[],"mappings":";;;AACA,uCAA4C;AAE5C,wCAA2E;AAE3E,SAAgB,oBAAoB,CAAC,YAAoB;;IACvD,MAAM,WAAW,GAAG,IAAA,sBAAe,EACjC,IAAA,iBAAU,EAAC,YAAY,EAAE;QACvB,eAAe,EAAE,mCAAmC;KACrD,CAAC,EACF;QACE,IAAI,EAAE,wBAAwB;KAC/B,CACF,CAAC;IAEF,OAAO,MAAA,MAAA,MAAA,IAAA,oBAAa,EAAC,WAAW,CAAC;SAC9B,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,eAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,CAAC,0CACpD,eAAe,CAAC,qBAAU,CAAC,cAAc,CAAC,0CAC1C,eAAe,CAAC,qBAAU,CAAC,wBAAwB,CAAC,0CACpD,eAAe,CAAC,qBAAU,CAAC,cAAc,CAAC,CAAC;AACjD,CAAC;AAfD,oDAeC"}
@@ -1,3 +1,2 @@
1
- export * from './add-provider-to-bootstrap-application-fn';
2
1
  export * from './get-bootstrap-application-fn';
3
- export * from './get-bootstrap-fn';
2
+ export * from './get-bootstrap-module-fn';
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./add-provider-to-bootstrap-application-fn"), exports);
5
4
  tslib_1.__exportStar(require("./get-bootstrap-application-fn"), exports);
6
- tslib_1.__exportStar(require("./get-bootstrap-fn"), exports);
5
+ tslib_1.__exportStar(require("./get-bootstrap-module-fn"), exports);
7
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/bootstrap/index.ts"],"names":[],"mappings":";;;AAAA,qFAA2D;AAC3D,yEAA+C;AAC/C,6DAAmC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/bootstrap/index.ts"],"names":[],"mappings":";;;AAAA,yEAA+C;AAC/C,oEAA0C"}
@@ -0,0 +1,4 @@
1
+ import type { ClassDeclaration } from 'ts-morph';
2
+ import { Pattern, Query, StructureType } from '@mutates/core';
3
+ export declare function getComponents(pattern: Pattern, query?: Query<Omit<StructureType<ClassDeclaration>, 'kind'>>): ClassDeclaration[];
4
+ export declare function isComponent(declaration: ClassDeclaration): boolean;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isComponent = exports.getComponents = void 0;
4
+ const core_1 = require("@mutates/core");
5
+ function getComponents(pattern, query) {
6
+ return (0, core_1.getClasses)(pattern, query).filter(isComponent);
7
+ }
8
+ exports.getComponents = getComponents;
9
+ function isComponent(declaration) {
10
+ return !!declaration.getDecorator('Component');
11
+ }
12
+ exports.isComponent = isComponent;
13
+ //# sourceMappingURL=get-components.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-components.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/component/get-components.ts"],"names":[],"mappings":";;;AAEA,wCAA0E;AAE1E,SAAgB,aAAa,CAC3B,OAAgB,EAChB,KAA4D;IAE5D,OAAO,IAAA,iBAAU,EAAC,OAAO,EAAE,KAAK,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;AACxD,CAAC;AALD,sCAKC;AAED,SAAgB,WAAW,CAAC,WAA6B;IACvD,OAAO,CAAC,CAAC,WAAW,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;AACjD,CAAC;AAFD,kCAEC"}
@@ -1,3 +1 @@
1
- export * from './add-import-to-component';
2
- export * from './add-provider-to-component';
3
- export * from './add-style-url-to-component';
1
+ export * from './get-components';
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./add-import-to-component"), exports);
5
- tslib_1.__exportStar(require("./add-provider-to-component"), exports);
6
- tslib_1.__exportStar(require("./add-style-url-to-component"), exports);
4
+ tslib_1.__exportStar(require("./get-components"), exports);
7
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/component/index.ts"],"names":[],"mappings":";;;AAAA,oEAA0C;AAC1C,sEAA4C;AAC5C,uEAA6C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/component/index.ts"],"names":[],"mappings":";;;AAAA,2DAAiC"}
@@ -0,0 +1,4 @@
1
+ import type { ClassDeclaration } from 'ts-morph';
2
+ import { Pattern, Query, StructureType } from '@mutates/core';
3
+ export declare function getDirectives(pattern: Pattern, query?: Query<Omit<StructureType<ClassDeclaration>, 'kind'>>): ClassDeclaration[];
4
+ export declare function isDirective(declaration: ClassDeclaration): boolean;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isDirective = exports.getDirectives = void 0;
4
+ const core_1 = require("@mutates/core");
5
+ function getDirectives(pattern, query) {
6
+ return (0, core_1.getClasses)(pattern, query).filter(isDirective);
7
+ }
8
+ exports.getDirectives = getDirectives;
9
+ function isDirective(declaration) {
10
+ return !!declaration.getDecorator('Directive');
11
+ }
12
+ exports.isDirective = isDirective;
13
+ //# sourceMappingURL=get-directives.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-directives.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/directive/get-directives.ts"],"names":[],"mappings":";;;AAEA,wCAA0E;AAE1E,SAAgB,aAAa,CAC3B,OAAgB,EAChB,KAA4D;IAE5D,OAAO,IAAA,iBAAU,EAAC,OAAO,EAAE,KAAK,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;AACxD,CAAC;AALD,sCAKC;AAED,SAAgB,WAAW,CAAC,WAA6B;IACvD,OAAO,CAAC,CAAC,WAAW,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;AACjD,CAAC;AAFD,kCAEC"}
@@ -1 +1 @@
1
- export * from './add-provider-to-directive';
1
+ export * from './get-directives';
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./add-provider-to-directive"), exports);
4
+ tslib_1.__exportStar(require("./get-directives"), exports);
5
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/directive/index.ts"],"names":[],"mappings":";;;AAAA,sEAA4C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/directive/index.ts"],"names":[],"mappings":";;;AAAA,2DAAiC"}
@@ -1,6 +1 @@
1
- export * from './get-main-module';
2
- export * from './is-standalone-component';
3
- export * from './ng-component';
4
- export * from './ng-module';
5
- export * from './push-to-decorator-array-property';
6
- export * from './push-to-object-literal-array-property';
1
+ export * from './is-standalone';
@@ -1,10 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./get-main-module"), exports);
5
- tslib_1.__exportStar(require("./is-standalone-component"), exports);
6
- tslib_1.__exportStar(require("./ng-component"), exports);
7
- tslib_1.__exportStar(require("./ng-module"), exports);
8
- tslib_1.__exportStar(require("./push-to-decorator-array-property"), exports);
9
- tslib_1.__exportStar(require("./push-to-object-literal-array-property"), exports);
4
+ tslib_1.__exportStar(require("./is-standalone"), exports);
10
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/helpers/index.ts"],"names":[],"mappings":";;;AAAA,4DAAkC;AAClC,oEAA0C;AAC1C,yDAA+B;AAC/B,sDAA4B;AAC5B,6EAAmD;AACnD,kFAAwD"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/helpers/index.ts"],"names":[],"mappings":";;;AAAA,0DAAgC"}
@@ -0,0 +1,2 @@
1
+ import { ClassDeclaration } from 'ts-morph';
2
+ export declare function isStandalone(ngEntity: ClassDeclaration): boolean;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isStandalone = void 0;
4
+ const core_1 = require("@mutates/core");
5
+ const get_metadata_1 = require("../metadata/get-metadata");
6
+ function isStandalone(ngEntity) {
7
+ var _a;
8
+ const [metadata] = (0, get_metadata_1.getMetadata)(ngEntity, [
9
+ get_metadata_1.MetadataType.NgModule,
10
+ get_metadata_1.MetadataType.Component,
11
+ get_metadata_1.MetadataType.Directive,
12
+ get_metadata_1.MetadataType.Pipe,
13
+ get_metadata_1.MetadataType.Injectable,
14
+ ]);
15
+ if (!metadata) {
16
+ return false;
17
+ }
18
+ const [property] = (0, core_1.getObjectProperties)(metadata, {
19
+ name: 'standalone',
20
+ });
21
+ if (!property) {
22
+ return false;
23
+ }
24
+ return ((_a = property.getInitializer()) === null || _a === void 0 ? void 0 : _a.getText()) === 'true';
25
+ }
26
+ exports.isStandalone = isStandalone;
27
+ //# sourceMappingURL=is-standalone.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-standalone.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/helpers/is-standalone.ts"],"names":[],"mappings":";;;AAEA,wCAAoD;AAEpD,2DAAqE;AAErE,SAAgB,YAAY,CAAC,QAA0B;;IACrD,MAAM,CAAC,QAAQ,CAAC,GAAG,IAAA,0BAAW,EAAC,QAAQ,EAAE;QACvC,2BAAY,CAAC,QAAQ;QACrB,2BAAY,CAAC,SAAS;QACtB,2BAAY,CAAC,SAAS;QACtB,2BAAY,CAAC,IAAI;QACjB,2BAAY,CAAC,UAAU;KACxB,CAAC,CAAC;IAEH,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,GAAG,IAAA,0BAAmB,EAAC,QAAQ,EAAE;QAC/C,IAAI,EAAE,YAAY;KACnB,CAAC,CAAC;IAEH,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,CAAA,MAAA,QAAQ,CAAC,cAAc,EAAE,0CAAE,OAAO,EAAE,MAAK,MAAM,CAAC;AACzD,CAAC;AAtBD,oCAsBC"}
@@ -0,0 +1,4 @@
1
+ import { ClassDeclaration } from 'ts-morph';
2
+ import { Pattern, Query, StructureType } from '@mutates/core';
3
+ export declare function getInjectables(pattern: Pattern, query?: Query<Omit<StructureType<ClassDeclaration>, 'kind'>>): ClassDeclaration[];
4
+ export declare function isInjectable(declaration: ClassDeclaration): boolean;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isInjectable = exports.getInjectables = void 0;
4
+ const core_1 = require("@mutates/core");
5
+ function getInjectables(pattern, query) {
6
+ return (0, core_1.getClasses)(pattern, query).filter(isInjectable);
7
+ }
8
+ exports.getInjectables = getInjectables;
9
+ function isInjectable(declaration) {
10
+ return !!declaration.getDecorator('Injectable');
11
+ }
12
+ exports.isInjectable = isInjectable;
13
+ //# sourceMappingURL=get-injectables.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-injectables.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/injectable/get-injectables.ts"],"names":[],"mappings":";;;AAEA,wCAA0E;AAE1E,SAAgB,cAAc,CAC5B,OAAgB,EAChB,KAA4D;IAE5D,OAAO,IAAA,iBAAU,EAAC,OAAO,EAAE,KAAK,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;AACzD,CAAC;AALD,wCAKC;AAED,SAAgB,YAAY,CAAC,WAA6B;IACxD,OAAO,CAAC,CAAC,WAAW,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;AAClD,CAAC;AAFD,oCAEC"}
@@ -0,0 +1 @@
1
+ export * from './get-injectables';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./get-injectables"), exports);
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/injectable/index.ts"],"names":[],"mappings":";;;AAAA,4DAAkC"}
@@ -6,7 +6,7 @@ export declare enum MetadataType {
6
6
  Pipe = "Pipe",
7
7
  Injectable = "Injectable"
8
8
  }
9
- export declare function getMetadata(klass: ClassDeclaration | ClassDeclaration[], metadataType: MetadataType): ObjectLiteralExpression[];
9
+ export declare function getMetadata(klass: ClassDeclaration | ClassDeclaration[], metadataType: MetadataType | MetadataType[]): ObjectLiteralExpression[];
10
10
  export declare function getNgModuleMetadata(klass: ClassDeclaration | ClassDeclaration[]): ObjectLiteralExpression[];
11
11
  export declare function getComponentMetadata(klass: ClassDeclaration | ClassDeclaration[]): ObjectLiteralExpression[];
12
12
  export declare function getDirectiveMetadata(klass: ClassDeclaration | ClassDeclaration[]): ObjectLiteralExpression[];
@@ -1 +1 @@
1
- {"version":3,"file":"get-metadata.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/metadata/get-metadata.ts"],"names":[],"mappings":";;;AAAA,uCAA2E;AAE3E,wCAA8C;AAE9C,IAAY,YAMX;AAND,WAAY,YAAY;IACtB,qCAAqB,CAAA;IACrB,uCAAuB,CAAA;IACvB,uCAAuB,CAAA;IACvB,6BAAa,CAAA;IACb,yCAAyB,CAAA;AAC3B,CAAC,EANW,YAAY,4BAAZ,YAAY,QAMvB;AAED,SAAgB,WAAW,CACzB,KAA4C,EAC5C,YAA0B;IAE1B,MAAM,UAAU,GAAG,IAAA,oBAAa,EAAC,KAAK,EAAE;QACtC,IAAI,EAAE,YAAY;KACnB,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,YAAY,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAEjF,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAuC,EAAE,CACxE,eAAI,CAAC,yBAAyB,CAAC,QAAQ,CAAC,CACzC,CAAC;AACJ,CAAC;AAbD,kCAaC;AAED,SAAgB,mBAAmB,CACjC,KAA4C;IAE5C,OAAO,WAAW,CAAC,KAAK,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC;AACnD,CAAC;AAJD,kDAIC;AAED,SAAgB,oBAAoB,CAClC,KAA4C;IAE5C,OAAO,WAAW,CAAC,KAAK,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;AACpD,CAAC;AAJD,oDAIC;AAED,SAAgB,oBAAoB,CAClC,KAA4C;IAE5C,OAAO,WAAW,CAAC,KAAK,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;AACpD,CAAC;AAJD,oDAIC;AAED,SAAgB,eAAe,CAC7B,KAA4C;IAE5C,OAAO,WAAW,CAAC,KAAK,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;AAC/C,CAAC;AAJD,0CAIC;AAED,SAAgB,qBAAqB,CACnC,KAA4C;IAE5C,OAAO,WAAW,CAAC,KAAK,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC;AACrD,CAAC;AAJD,sDAIC"}
1
+ {"version":3,"file":"get-metadata.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/metadata/get-metadata.ts"],"names":[],"mappings":";;;AAAA,uCAA2E;AAE3E,wCAA8C;AAE9C,IAAY,YAMX;AAND,WAAY,YAAY;IACtB,qCAAqB,CAAA;IACrB,uCAAuB,CAAA;IACvB,uCAAuB,CAAA;IACvB,6BAAa,CAAA;IACb,yCAAyB,CAAA;AAC3B,CAAC,EANW,YAAY,4BAAZ,YAAY,QAMvB;AAED,SAAgB,WAAW,CACzB,KAA4C,EAC5C,YAA2C;IAE3C,MAAM,UAAU,GAAG,IAAA,oBAAa,EAAC,KAAK,EAAE;QACtC,IAAI,EAAE,YAAY;KACnB,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,YAAY,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAEjF,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAuC,EAAE,CACxE,eAAI,CAAC,yBAAyB,CAAC,QAAQ,CAAC,CACzC,CAAC;AACJ,CAAC;AAbD,kCAaC;AAED,SAAgB,mBAAmB,CACjC,KAA4C;IAE5C,OAAO,WAAW,CAAC,KAAK,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC;AACnD,CAAC;AAJD,kDAIC;AAED,SAAgB,oBAAoB,CAClC,KAA4C;IAE5C,OAAO,WAAW,CAAC,KAAK,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;AACpD,CAAC;AAJD,oDAIC;AAED,SAAgB,oBAAoB,CAClC,KAA4C;IAE5C,OAAO,WAAW,CAAC,KAAK,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;AACpD,CAAC;AAJD,oDAIC;AAED,SAAgB,eAAe,CAC7B,KAA4C;IAE5C,OAAO,WAAW,CAAC,KAAK,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;AAC/C,CAAC;AAJD,0CAIC;AAED,SAAgB,qBAAqB,CACnC,KAA4C;IAE5C,OAAO,WAAW,CAAC,KAAK,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC;AACrD,CAAC;AAJD,sDAIC"}
@@ -0,0 +1 @@
1
+ export * from './get-metadata';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./get-metadata"), exports);
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/metadata/index.ts"],"names":[],"mappings":";;;AAAA,yDAA+B"}
@@ -0,0 +1,2 @@
1
+ import type { ClassDeclaration } from 'ts-morph';
2
+ export declare function getAppModule(mainFilePath: string): ClassDeclaration;
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getMainModule = void 0;
3
+ exports.getAppModule = void 0;
4
4
  const bootstrap_1 = require("../bootstrap");
5
- function getMainModule(mainFilePath) {
6
- const bootstrapFn = (0, bootstrap_1.getBootstrapFn)(mainFilePath);
5
+ function getAppModule(mainFilePath) {
6
+ const bootstrapFn = (0, bootstrap_1.getBootstrapModuleFn)(mainFilePath);
7
7
  const [mainModuleIdentifier] = bootstrapFn === null || bootstrapFn === void 0 ? void 0 : bootstrapFn.getArguments();
8
8
  const [mainModuleClass] = mainModuleIdentifier.getDefinitionNodes();
9
9
  return mainModuleClass;
10
10
  }
11
- exports.getMainModule = getMainModule;
12
- //# sourceMappingURL=get-main-module.js.map
11
+ exports.getAppModule = getAppModule;
12
+ //# sourceMappingURL=get-app-module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-app-module.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/module/get-app-module.ts"],"names":[],"mappings":";;;AAEA,4CAAoD;AAEpD,SAAgB,YAAY,CAAC,YAAoB;IAC/C,MAAM,WAAW,GAAG,IAAA,gCAAoB,EAAC,YAAY,CAAC,CAAC;IAEvD,MAAM,CAAC,oBAAoB,CAAC,GAAG,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,YAAY,EAAkB,CAAC;IAE3E,MAAM,CAAC,eAAe,CAAC,GAAG,oBAAoB,CAAC,kBAAkB,EAAwB,CAAC;IAE1F,OAAO,eAAe,CAAC;AACzB,CAAC;AARD,oCAQC"}
@@ -0,0 +1,4 @@
1
+ import type { ClassDeclaration } from 'ts-morph';
2
+ import { Pattern, Query, StructureType } from '@mutates/core';
3
+ export declare function getNgModule(pattern: Pattern, query?: Query<Omit<StructureType<ClassDeclaration>, 'kind'>>): ClassDeclaration[];
4
+ export declare function isNgModule(declaration: ClassDeclaration): boolean;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isNgModule = exports.getNgModule = void 0;
4
+ const core_1 = require("@mutates/core");
5
+ function getNgModule(pattern, query) {
6
+ return (0, core_1.getClasses)(pattern, query).filter(isNgModule);
7
+ }
8
+ exports.getNgModule = getNgModule;
9
+ function isNgModule(declaration) {
10
+ return !!declaration.getDecorator('NgModule');
11
+ }
12
+ exports.isNgModule = isNgModule;
13
+ //# sourceMappingURL=get-ng-modules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-ng-modules.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/module/get-ng-modules.ts"],"names":[],"mappings":";;;AAEA,wCAA0E;AAE1E,SAAgB,WAAW,CACzB,OAAgB,EAChB,KAA4D;IAE5D,OAAO,IAAA,iBAAU,EAAC,OAAO,EAAE,KAAK,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;AACvD,CAAC;AALD,kCAKC;AAED,SAAgB,UAAU,CAAC,WAA6B;IACtD,OAAO,CAAC,CAAC,WAAW,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;AAChD,CAAC;AAFD,gCAEC"}
@@ -1,7 +1,2 @@
1
- export * from './add-bootstrap-to-ng-module';
2
- export * from './add-declaration-to-ng-module';
3
- export * from './add-entry-component-to-ng-module';
4
- export * from './add-export-to-ng-module';
5
- export * from './add-import-to-ng-module';
6
- export * from './add-provider-to-ng-module';
7
- export * from './add-schema-to-ng-module';
1
+ export * from './get-ng-modules';
2
+ export * from './get-app-module';
@@ -1,11 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./add-bootstrap-to-ng-module"), exports);
5
- tslib_1.__exportStar(require("./add-declaration-to-ng-module"), exports);
6
- tslib_1.__exportStar(require("./add-entry-component-to-ng-module"), exports);
7
- tslib_1.__exportStar(require("./add-export-to-ng-module"), exports);
8
- tslib_1.__exportStar(require("./add-import-to-ng-module"), exports);
9
- tslib_1.__exportStar(require("./add-provider-to-ng-module"), exports);
10
- tslib_1.__exportStar(require("./add-schema-to-ng-module"), exports);
4
+ tslib_1.__exportStar(require("./get-ng-modules"), exports);
5
+ tslib_1.__exportStar(require("./get-app-module"), exports);
11
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/module/index.ts"],"names":[],"mappings":";;;AAAA,uEAA6C;AAC7C,yEAA+C;AAC/C,6EAAmD;AACnD,oEAA0C;AAC1C,oEAA0C;AAC1C,sEAA4C;AAC5C,oEAA0C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/module/index.ts"],"names":[],"mappings":";;;AAAA,2DAAiC;AACjC,2DAAiC"}
@@ -0,0 +1,4 @@
1
+ import type { ClassDeclaration } from 'ts-morph';
2
+ import { Pattern, Query, StructureType } from '@mutates/core';
3
+ export declare function getPipes(pattern: Pattern, query?: Query<Omit<StructureType<ClassDeclaration>, 'kind'>>): ClassDeclaration[];
4
+ export declare function isPipe(declaration: ClassDeclaration): boolean;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isPipe = exports.getPipes = void 0;
4
+ const core_1 = require("@mutates/core");
5
+ function getPipes(pattern, query) {
6
+ return (0, core_1.getClasses)(pattern, query).filter(isPipe);
7
+ }
8
+ exports.getPipes = getPipes;
9
+ function isPipe(declaration) {
10
+ return !!declaration.getDecorator('Pipe');
11
+ }
12
+ exports.isPipe = isPipe;
13
+ //# sourceMappingURL=get-pipes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-pipes.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/pipe/get-pipes.ts"],"names":[],"mappings":";;;AAEA,wCAA0E;AAE1E,SAAgB,QAAQ,CACtB,OAAgB,EAChB,KAA4D;IAE5D,OAAO,IAAA,iBAAU,EAAC,OAAO,EAAE,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AACnD,CAAC;AALD,4BAKC;AAED,SAAgB,MAAM,CAAC,WAA6B;IAClD,OAAO,CAAC,CAAC,WAAW,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;AAC5C,CAAC;AAFD,wBAEC"}
@@ -0,0 +1 @@
1
+ export * from './get-pipes';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./get-pipes"), exports);
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/pipe/index.ts"],"names":[],"mappings":";;;AAAA,sDAA4B"}
@@ -1,4 +0,0 @@
1
- import type { CallExpression } from 'ts-morph';
2
- export declare function addProviderToBootstrapApplicationFn(callExpression: CallExpression, provider: string, { unique }?: {
3
- unique?: boolean;
4
- }): void;
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addProviderToBootstrapApplicationFn = void 0;
4
- const ts_morph_1 = require("ts-morph");
5
- const push_to_object_literal_array_property_1 = require("../helpers/push-to-object-literal-array-property");
6
- function addProviderToBootstrapApplicationFn(callExpression, provider, { unique = false } = {}) {
7
- const [, options = callExpression.addArgument('{providers: []}')] = callExpression.getArguments();
8
- if (!ts_morph_1.Node.isIdentifier(options) && !ts_morph_1.Node.isObjectLiteralExpression(options)) {
9
- return;
10
- }
11
- (0, push_to_object_literal_array_property_1.pushToObjectLiteralArrayProperty)(getOptionsObject(options), 'providers', provider, {
12
- unique,
13
- });
14
- }
15
- exports.addProviderToBootstrapApplicationFn = addProviderToBootstrapApplicationFn;
16
- function getOptionsObject(options) {
17
- if (ts_morph_1.Node.isObjectLiteralExpression(options)) {
18
- return options;
19
- }
20
- const definition = options.getDefinitionNodes()[0];
21
- return definition.getChildrenOfKind(ts_morph_1.SyntaxKind.ObjectLiteralExpression)[0];
22
- }
23
- //# sourceMappingURL=add-provider-to-bootstrap-application-fn.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"add-provider-to-bootstrap-application-fn.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/bootstrap/add-provider-to-bootstrap-application-fn.ts"],"names":[],"mappings":";;;AACA,uCAA4C;AAE5C,4GAAoG;AAEpG,SAAgB,mCAAmC,CACjD,cAA8B,EAC9B,QAAgB,EAChB,EAAE,MAAM,GAAG,KAAK,KAA2B,EAAE;IAE7C,MAAM,CAAC,EAAE,OAAO,GAAG,cAAc,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC,GAAG,cAAc,CAAC,YAAY,EAAE,CAAC;IAElG,IAAI,CAAC,eAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,eAAI,CAAC,yBAAyB,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5E,OAAO;IACT,CAAC;IAED,IAAA,wEAAgC,EAAC,gBAAgB,CAAC,OAAO,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE;QACjF,MAAM;KACP,CAAC,CAAC;AACL,CAAC;AAdD,kFAcC;AAED,SAAS,gBAAgB,CAAC,OAA6C;IACrE,IAAI,eAAI,CAAC,yBAAyB,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5C,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,MAAM,UAAU,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC,CAAC,CAAC;IAEnD,OAAO,UAAU,CAAC,iBAAiB,CAAC,qBAAU,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7E,CAAC"}
@@ -1,2 +0,0 @@
1
- import type { CallExpression } from 'ts-morph';
2
- export declare function getBootstrapFn(mainFilePath: string): CallExpression | undefined;
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getBootstrapFn = void 0;
4
- const ts_morph_1 = require("ts-morph");
5
- const core_1 = require("@mutates/core");
6
- function getBootstrapFn(mainFilePath) {
7
- var _a, _b, _c;
8
- const [platformBrowserImport] = (0, core_1.getImports)(mainFilePath, {
9
- moduleSpecifier: '@angular/platform-browser-dynamic',
10
- });
11
- const namedImport = platformBrowserImport === null || platformBrowserImport === void 0 ? void 0 : platformBrowserImport.getNamedImports().find((imp) => imp.getName() === 'platformBrowserDynamic');
12
- return (_c = (_b = (_a = namedImport === null || namedImport === void 0 ? void 0 : namedImport.getNameNode().findReferencesAsNodes().find((ref) => ts_morph_1.Node.isCallExpression(ref.getParent()))) === null || _a === void 0 ? void 0 : _a.getParentIfKind(ts_morph_1.SyntaxKind.CallExpression)) === null || _b === void 0 ? void 0 : _b.getParentIfKind(ts_morph_1.SyntaxKind.PropertyAccessExpression)) === null || _c === void 0 ? void 0 : _c.getParentIfKind(ts_morph_1.SyntaxKind.CallExpression);
13
- }
14
- exports.getBootstrapFn = getBootstrapFn;
15
- //# sourceMappingURL=get-bootstrap-fn.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-bootstrap-fn.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/bootstrap/get-bootstrap-fn.ts"],"names":[],"mappings":";;;AACA,uCAA4C;AAE5C,wCAA2C;AAE3C,SAAgB,cAAc,CAAC,YAAoB;;IACjD,MAAM,CAAC,qBAAqB,CAAC,GAAG,IAAA,iBAAU,EAAC,YAAY,EAAE;QACvD,eAAe,EAAE,mCAAmC;KACrD,CAAC,CAAC;IAEH,MAAM,WAAW,GAAG,qBAAqB,aAArB,qBAAqB,uBAArB,qBAAqB,CACrC,eAAe,GAChB,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,wBAAwB,CAAC,CAAC;IAE7D,OAAO,MAAA,MAAA,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CACd,WAAW,GACZ,qBAAqB,GACrB,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,eAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,CAAC,0CACpD,eAAe,CAAC,qBAAU,CAAC,cAAc,CAAC,0CAC1C,eAAe,CAAC,qBAAU,CAAC,wBAAwB,CAAC,0CACpD,eAAe,CAAC,qBAAU,CAAC,cAAc,CAAC,CAAC;AACjD,CAAC;AAhBD,wCAgBC"}
@@ -1,4 +0,0 @@
1
- import type { ClassDeclaration } from 'ts-morph';
2
- export declare function addImportToComponent(classDeclaration: ClassDeclaration, importName: string, { unique }?: {
3
- unique?: boolean;
4
- }): void;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addImportToComponent = void 0;
4
- const push_to_decorator_array_property_1 = require("../helpers/push-to-decorator-array-property");
5
- function addImportToComponent(classDeclaration, importName, { unique = false } = {}) {
6
- (0, push_to_decorator_array_property_1.pushToDecoratorArrayProperty)(classDeclaration, 'Component', 'imports', importName, {
7
- unique,
8
- forceToArray: true,
9
- });
10
- }
11
- exports.addImportToComponent = addImportToComponent;
12
- //# sourceMappingURL=add-import-to-component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"add-import-to-component.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/component/add-import-to-component.ts"],"names":[],"mappings":";;;AAEA,kGAA2F;AAE3F,SAAgB,oBAAoB,CAClC,gBAAkC,EAClC,UAAkB,EAClB,EAAE,MAAM,GAAG,KAAK,KAA2B,EAAE;IAE7C,IAAA,+DAA4B,EAAC,gBAAgB,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE;QACjF,MAAM;QACN,YAAY,EAAE,IAAI;KACnB,CAAC,CAAC;AACL,CAAC;AATD,oDASC"}
@@ -1,4 +0,0 @@
1
- import type { ClassDeclaration } from 'ts-morph';
2
- export declare function addProviderToComponent(classDeclaration: ClassDeclaration, provider: string, { unique }?: {
3
- unique?: boolean;
4
- }): void;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addProviderToComponent = void 0;
4
- const push_to_decorator_array_property_1 = require("../helpers/push-to-decorator-array-property");
5
- function addProviderToComponent(classDeclaration, provider, { unique = false } = {}) {
6
- (0, push_to_decorator_array_property_1.pushToDecoratorArrayProperty)(classDeclaration, 'Component', 'providers', provider, {
7
- unique,
8
- forceToArray: true,
9
- });
10
- }
11
- exports.addProviderToComponent = addProviderToComponent;
12
- //# sourceMappingURL=add-provider-to-component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"add-provider-to-component.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/component/add-provider-to-component.ts"],"names":[],"mappings":";;;AAEA,kGAA2F;AAE3F,SAAgB,sBAAsB,CACpC,gBAAkC,EAClC,QAAgB,EAChB,EAAE,MAAM,GAAG,KAAK,KAA2B,EAAE;IAE7C,IAAA,+DAA4B,EAAC,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE;QACjF,MAAM;QACN,YAAY,EAAE,IAAI;KACnB,CAAC,CAAC;AACL,CAAC;AATD,wDASC"}
@@ -1,4 +0,0 @@
1
- import type { ClassDeclaration } from 'ts-morph';
2
- export declare function addStyleUrlToComponent(classDeclaration: ClassDeclaration, styleUrl: string, { unique }?: {
3
- unique?: boolean;
4
- }): void;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addStyleUrlToComponent = void 0;
4
- const push_to_decorator_array_property_1 = require("../helpers/push-to-decorator-array-property");
5
- function addStyleUrlToComponent(classDeclaration, styleUrl, { unique = false } = {}) {
6
- (0, push_to_decorator_array_property_1.pushToDecoratorArrayProperty)(classDeclaration, 'Component', 'styleUrls', styleUrl, {
7
- unique,
8
- });
9
- }
10
- exports.addStyleUrlToComponent = addStyleUrlToComponent;
11
- //# sourceMappingURL=add-style-url-to-component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"add-style-url-to-component.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/component/add-style-url-to-component.ts"],"names":[],"mappings":";;;AAEA,kGAA2F;AAE3F,SAAgB,sBAAsB,CACpC,gBAAkC,EAClC,QAAgB,EAChB,EAAE,MAAM,GAAG,KAAK,KAA2B,EAAE;IAE7C,IAAA,+DAA4B,EAAC,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE;QACjF,MAAM;KACP,CAAC,CAAC;AACL,CAAC;AARD,wDAQC"}
@@ -1,4 +0,0 @@
1
- import type { ClassDeclaration } from 'ts-morph';
2
- export declare function addProviderToDirective(classDeclaration: ClassDeclaration, provider: string, { unique }?: {
3
- unique?: boolean;
4
- }): void;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addProviderToDirective = void 0;
4
- const push_to_decorator_array_property_1 = require("../helpers/push-to-decorator-array-property");
5
- function addProviderToDirective(classDeclaration, provider, { unique = false } = {}) {
6
- (0, push_to_decorator_array_property_1.pushToDecoratorArrayProperty)(classDeclaration, 'Directive', 'providers', provider, {
7
- unique,
8
- forceToArray: true,
9
- });
10
- }
11
- exports.addProviderToDirective = addProviderToDirective;
12
- //# sourceMappingURL=add-provider-to-directive.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"add-provider-to-directive.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/directive/add-provider-to-directive.ts"],"names":[],"mappings":";;;AAEA,kGAA2F;AAE3F,SAAgB,sBAAsB,CACpC,gBAAkC,EAClC,QAAgB,EAChB,EAAE,MAAM,GAAG,KAAK,KAA2B,EAAE;IAE7C,IAAA,+DAA4B,EAAC,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE;QACjF,MAAM;QACN,YAAY,EAAE,IAAI;KACnB,CAAC,CAAC;AACL,CAAC;AATD,wDASC"}
@@ -1,2 +0,0 @@
1
- import type { ClassDeclaration } from 'ts-morph';
2
- export declare function getMainModule(mainFilePath: string): ClassDeclaration;
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-main-module.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/helpers/get-main-module.ts"],"names":[],"mappings":";;;AAEA,4CAA8C;AAE9C,SAAgB,aAAa,CAAC,YAAoB;IAChD,MAAM,WAAW,GAAG,IAAA,0BAAc,EAAC,YAAY,CAAC,CAAC;IAEjD,MAAM,CAAC,oBAAoB,CAAC,GAAG,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,YAAY,EAAkB,CAAC;IAE3E,MAAM,CAAC,eAAe,CAAC,GAAG,oBAAoB,CAAC,kBAAkB,EAAwB,CAAC;IAE1F,OAAO,eAAe,CAAC;AACzB,CAAC;AARD,sCAQC"}
@@ -1,2 +0,0 @@
1
- import type { ClassDeclaration } from 'ts-morph';
2
- export declare function isStandaloneComponent(component: ClassDeclaration): boolean;
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isStandaloneComponent = void 0;
4
- const ts_morph_1 = require("ts-morph");
5
- function isStandaloneComponent(component) {
6
- var _a;
7
- const decorator = component.getDecorator('Component');
8
- if (!decorator) {
9
- return false;
10
- }
11
- const [metadata] = decorator.getArguments();
12
- if (!ts_morph_1.Node.isObjectLiteralExpression(metadata)) {
13
- return false;
14
- }
15
- const property = metadata.getProperty('standalone');
16
- if (!ts_morph_1.Node.isPropertyAssignment(property)) {
17
- return false;
18
- }
19
- return ((_a = property.getInitializer()) === null || _a === void 0 ? void 0 : _a.getText()) === 'true';
20
- }
21
- exports.isStandaloneComponent = isStandaloneComponent;
22
- //# sourceMappingURL=is-standalone-component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"is-standalone-component.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/helpers/is-standalone-component.ts"],"names":[],"mappings":";;;AACA,uCAAgC;AAEhC,SAAgB,qBAAqB,CAAC,SAA2B;;IAC/D,MAAM,SAAS,GAAG,SAAS,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;IAEtD,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAC,YAAY,EAAE,CAAC;IAE5C,IAAI,CAAC,eAAI,CAAC,yBAAyB,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC9C,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;IAEpD,IAAI,CAAC,eAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,EAAE,CAAC;QACzC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,CAAA,MAAA,QAAQ,CAAC,cAAc,EAAE,0CAAE,OAAO,EAAE,MAAK,MAAM,CAAC;AACzD,CAAC;AApBD,sDAoBC"}
@@ -1,3 +0,0 @@
1
- import type { ClassDeclaration } from 'ts-morph';
2
- import { Pattern, Query, StructureType } from '@mutates/core';
3
- export declare function getNgComponents(pattern: Pattern, query?: Query<Omit<StructureType<ClassDeclaration>, 'kind'>>): ClassDeclaration[];
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getNgComponents = void 0;
4
- const core_1 = require("@mutates/core");
5
- function getNgComponents(pattern, query) {
6
- return (0, core_1.getClasses)(pattern, query).filter((declaration) => !!declaration.getDecorator('Component'));
7
- }
8
- exports.getNgComponents = getNgComponents;
9
- //# sourceMappingURL=ng-component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ng-component.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/helpers/ng-component.ts"],"names":[],"mappings":";;;AAEA,wCAA0E;AAE1E,SAAgB,eAAe,CAC7B,OAAgB,EAChB,KAA4D;IAE5D,OAAO,IAAA,iBAAU,EAAC,OAAO,EAAE,KAAK,CAAC,CAAC,MAAM,CACtC,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,YAAY,CAAC,WAAW,CAAC,CACzD,CAAC;AACJ,CAAC;AAPD,0CAOC"}
@@ -1,7 +0,0 @@
1
- import type { ClassDeclaration } from 'ts-morph';
2
- import { Pattern, Query, StructureType } from '@mutates/core';
3
- export declare function getNgModules(pattern: Pattern, query?: Query<Omit<StructureType<ClassDeclaration>, 'kind'>>): ClassDeclaration[];
4
- /**
5
- * Find NgModule where the component was declared.
6
- */
7
- export declare function findNgModule(ngComponent: ClassDeclaration, pattern: Pattern): ClassDeclaration | null;
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.findNgModule = exports.getNgModules = void 0;
4
- const core_1 = require("@mutates/core");
5
- function getNgModules(pattern, query) {
6
- return (0, core_1.getClasses)(pattern, query).filter((declaration) => !!declaration.getDecorator('NgModule'));
7
- }
8
- exports.getNgModules = getNgModules;
9
- /**
10
- * Find NgModule where the component was declared.
11
- */
12
- function findNgModule(ngComponent, pattern) {
13
- const allNgModules = getNgModules(pattern);
14
- return (allNgModules.find((module) => {
15
- const moduleFile = module.getSourceFile();
16
- const imports = (0, core_1.getImports)(moduleFile.getFilePath(), {
17
- namedImports: ngComponent.getName(),
18
- });
19
- return imports.some((i) => i.getModuleSpecifierSourceFile() === ngComponent.getSourceFile());
20
- }) || null);
21
- }
22
- exports.findNgModule = findNgModule;
23
- //# sourceMappingURL=ng-module.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ng-module.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/helpers/ng-module.ts"],"names":[],"mappings":";;;AAEA,wCAAsF;AAEtF,SAAgB,YAAY,CAC1B,OAAgB,EAChB,KAA4D;IAE5D,OAAO,IAAA,iBAAU,EAAC,OAAO,EAAE,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC;AACpG,CAAC;AALD,oCAKC;AAED;;GAEG;AACH,SAAgB,YAAY,CAC1B,WAA6B,EAC7B,OAAgB;IAEhB,MAAM,YAAY,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;IAE3C,OAAO,CACL,YAAY,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;QAC3B,MAAM,UAAU,GAAG,MAAM,CAAC,aAAa,EAAE,CAAC;QAC1C,MAAM,OAAO,GAAG,IAAA,iBAAU,EAAC,UAAU,CAAC,WAAW,EAAE,EAAE;YACnD,YAAY,EAAE,WAAW,CAAC,OAAO,EAAE;SACpC,CAAC,CAAC;QAEH,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,4BAA4B,EAAE,KAAK,WAAW,CAAC,aAAa,EAAE,CAAC,CAAC;IAC/F,CAAC,CAAC,IAAI,IAAI,CACX,CAAC;AACJ,CAAC;AAhBD,oCAgBC"}
@@ -1,5 +0,0 @@
1
- import type { ClassDeclaration } from 'ts-morph';
2
- export declare function pushToDecoratorArrayProperty(classDeclaration: ClassDeclaration, decoratorName: string, propertyName: string, initializer: string, { unique, forceToArray }?: {
3
- unique?: boolean;
4
- forceToArray?: boolean;
5
- }): void;
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.pushToDecoratorArrayProperty = void 0;
4
- const ts_morph_1 = require("ts-morph");
5
- const core_1 = require("@mutates/core");
6
- const push_to_object_literal_array_property_1 = require("./push-to-object-literal-array-property");
7
- // TODO: investigate how to handle consts in descriptors that don't accept array of array type, like styleUrls
8
- function pushToDecoratorArrayProperty(classDeclaration, decoratorName, propertyName, initializer, { unique = false, forceToArray = false } = {}) {
9
- const [decorator] = (0, core_1.getDecorators)(classDeclaration, {
10
- name: decoratorName,
11
- });
12
- const [metadata = decorator.addArgument(`{${propertyName}: []}`)] = decorator.getArguments();
13
- if (!ts_morph_1.Node.isObjectLiteralExpression(metadata)) {
14
- return;
15
- }
16
- (0, push_to_object_literal_array_property_1.pushToObjectLiteralArrayProperty)(metadata, propertyName, initializer, {
17
- unique,
18
- forceToArray,
19
- });
20
- }
21
- exports.pushToDecoratorArrayProperty = pushToDecoratorArrayProperty;
22
- //# sourceMappingURL=push-to-decorator-array-property.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"push-to-decorator-array-property.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/helpers/push-to-decorator-array-property.ts"],"names":[],"mappings":";;;AACA,uCAAgC;AAEhC,wCAA8C;AAE9C,mGAA2F;AAE3F,8GAA8G;AAC9G,SAAgB,4BAA4B,CAC1C,gBAAkC,EAClC,aAAqB,EACrB,YAAoB,EACpB,WAAmB,EACnB,EAAE,MAAM,GAAG,KAAK,EAAE,YAAY,GAAG,KAAK,KAAmD,EAAE;IAE3F,MAAM,CAAC,SAAS,CAAC,GAAG,IAAA,oBAAa,EAAC,gBAAgB,EAAE;QAClD,IAAI,EAAE,aAAa;KACpB,CAAC,CAAC;IAEH,MAAM,CAAC,QAAQ,GAAG,SAAS,CAAC,WAAW,CAAC,IAAI,YAAY,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,YAAY,EAAE,CAAC;IAE7F,IAAI,CAAC,eAAI,CAAC,yBAAyB,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC9C,OAAO;IACT,CAAC;IAED,IAAA,wEAAgC,EAAC,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE;QACpE,MAAM;QACN,YAAY;KACb,CAAC,CAAC;AACL,CAAC;AArBD,oEAqBC"}
@@ -1,5 +0,0 @@
1
- import type { ObjectLiteralExpression } from 'ts-morph';
2
- export declare function pushToObjectLiteralArrayProperty(objectLiteral: ObjectLiteralExpression, propertyName: string, initializer: string, { unique, forceToArray }?: {
3
- unique?: boolean;
4
- forceToArray?: boolean;
5
- }): void;
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.pushToObjectLiteralArrayProperty = void 0;
4
- const ts_morph_1 = require("ts-morph");
5
- function pushToObjectLiteralArrayProperty(objectLiteral, propertyName, initializer, { unique = false, forceToArray = false } = {}) {
6
- var _a;
7
- const property = (_a = objectLiteral.getProperty(propertyName)) !== null && _a !== void 0 ? _a : objectLiteral.addProperty(`${propertyName}: []`);
8
- if (!ts_morph_1.Node.isPropertyAssignment(property)) {
9
- return;
10
- }
11
- if (forceToArray && !ts_morph_1.Node.isArrayLiteralExpression(property.getInitializer())) {
12
- property.setInitializer(`[${property.getInitializer().getText()}]`);
13
- }
14
- const importsInitializer = property.getInitializer();
15
- if (!ts_morph_1.Node.isArrayLiteralExpression(importsInitializer)) {
16
- return;
17
- }
18
- if (unique &&
19
- importsInitializer.getElements().some((element) => element.getText() === initializer)) {
20
- return;
21
- }
22
- importsInitializer.addElement(initializer);
23
- }
24
- exports.pushToObjectLiteralArrayProperty = pushToObjectLiteralArrayProperty;
25
- //# sourceMappingURL=push-to-object-literal-array-property.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"push-to-object-literal-array-property.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/helpers/push-to-object-literal-array-property.ts"],"names":[],"mappings":";;;AACA,uCAAgC;AAEhC,SAAgB,gCAAgC,CAC9C,aAAsC,EACtC,YAAoB,EACpB,WAAmB,EACnB,EAAE,MAAM,GAAG,KAAK,EAAE,YAAY,GAAG,KAAK,KAAmD,EAAE;;IAE3F,MAAM,QAAQ,GACZ,MAAA,aAAa,CAAC,WAAW,CAAC,YAAY,CAAC,mCAAI,aAAa,CAAC,WAAW,CAAC,GAAG,YAAY,MAAM,CAAC,CAAC;IAE9F,IAAI,CAAC,eAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,EAAE,CAAC;QACzC,OAAO;IACT,CAAC;IAED,IAAI,YAAY,IAAI,CAAC,eAAI,CAAC,wBAAwB,CAAC,QAAQ,CAAC,cAAc,EAAE,CAAC,EAAE,CAAC;QAC9E,QAAQ,CAAC,cAAc,CAAC,IAAI,QAAQ,CAAC,cAAc,EAAG,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IACvE,CAAC;IAED,MAAM,kBAAkB,GAAG,QAAQ,CAAC,cAAc,EAAE,CAAC;IAErD,IAAI,CAAC,eAAI,CAAC,wBAAwB,CAAC,kBAAkB,CAAC,EAAE,CAAC;QACvD,OAAO;IACT,CAAC;IAED,IACE,MAAM;QACN,kBAAkB,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,WAAW,CAAC,EACrF,CAAC;QACD,OAAO;IACT,CAAC;IAED,kBAAkB,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;AAC7C,CAAC;AA/BD,4EA+BC"}
@@ -1,4 +0,0 @@
1
- import type { ClassDeclaration } from 'ts-morph';
2
- export declare function addBootstrapToNgModule(classDeclaration: ClassDeclaration, component: string, { unique }?: {
3
- unique?: boolean;
4
- }): void;
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addBootstrapToNgModule = void 0;
4
- const core_1 = require("@mutates/core");
5
- const push_to_decorator_array_property_1 = require("../helpers/push-to-decorator-array-property");
6
- function addBootstrapToNgModule(classDeclaration, component, { unique = false } = {}) {
7
- (0, push_to_decorator_array_property_1.pushToDecoratorArrayProperty)(classDeclaration, 'NgModule', 'bootstrap', component, {
8
- unique,
9
- forceToArray: true,
10
- });
11
- (0, core_1.getDecorators)(classDeclaration, { name: 'NgModule' });
12
- }
13
- exports.addBootstrapToNgModule = addBootstrapToNgModule;
14
- //# sourceMappingURL=add-bootstrap-to-ng-module.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"add-bootstrap-to-ng-module.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/module/add-bootstrap-to-ng-module.ts"],"names":[],"mappings":";;;AAEA,wCAA8C;AAE9C,kGAA2F;AAE3F,SAAgB,sBAAsB,CACpC,gBAAkC,EAClC,SAAiB,EACjB,EAAE,MAAM,GAAG,KAAK,KAA2B,EAAE;IAE7C,IAAA,+DAA4B,EAAC,gBAAgB,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE;QACjF,MAAM;QACN,YAAY,EAAE,IAAI;KACnB,CAAC,CAAC;IAEH,IAAA,oBAAa,EAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;AACxD,CAAC;AAXD,wDAWC"}
@@ -1,4 +0,0 @@
1
- import type { ClassDeclaration } from 'ts-morph';
2
- export declare function addDeclarationToNgModule(classDeclaration: ClassDeclaration, declaration: string, { unique }?: {
3
- unique?: boolean;
4
- }): void;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addDeclarationToNgModule = void 0;
4
- const push_to_decorator_array_property_1 = require("../helpers/push-to-decorator-array-property");
5
- function addDeclarationToNgModule(classDeclaration, declaration, { unique = false } = {}) {
6
- (0, push_to_decorator_array_property_1.pushToDecoratorArrayProperty)(classDeclaration, 'NgModule', 'declarations', declaration, {
7
- unique,
8
- forceToArray: true,
9
- });
10
- }
11
- exports.addDeclarationToNgModule = addDeclarationToNgModule;
12
- //# sourceMappingURL=add-declaration-to-ng-module.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"add-declaration-to-ng-module.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/module/add-declaration-to-ng-module.ts"],"names":[],"mappings":";;;AAEA,kGAA2F;AAE3F,SAAgB,wBAAwB,CACtC,gBAAkC,EAClC,WAAmB,EACnB,EAAE,MAAM,GAAG,KAAK,KAA2B,EAAE;IAE7C,IAAA,+DAA4B,EAAC,gBAAgB,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE;QACtF,MAAM;QACN,YAAY,EAAE,IAAI;KACnB,CAAC,CAAC;AACL,CAAC;AATD,4DASC"}
@@ -1,4 +0,0 @@
1
- import type { ClassDeclaration } from 'ts-morph';
2
- export declare function addEntryComponentToNgModule(classDeclaration: ClassDeclaration, component: string, { unique }?: {
3
- unique?: boolean;
4
- }): void;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addEntryComponentToNgModule = void 0;
4
- const push_to_decorator_array_property_1 = require("../helpers/push-to-decorator-array-property");
5
- function addEntryComponentToNgModule(classDeclaration, component, { unique = false } = {}) {
6
- (0, push_to_decorator_array_property_1.pushToDecoratorArrayProperty)(classDeclaration, 'NgModule', 'entryComponents', component, {
7
- unique,
8
- forceToArray: true,
9
- });
10
- }
11
- exports.addEntryComponentToNgModule = addEntryComponentToNgModule;
12
- //# sourceMappingURL=add-entry-component-to-ng-module.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"add-entry-component-to-ng-module.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/module/add-entry-component-to-ng-module.ts"],"names":[],"mappings":";;;AAEA,kGAA2F;AAE3F,SAAgB,2BAA2B,CACzC,gBAAkC,EAClC,SAAiB,EACjB,EAAE,MAAM,GAAG,KAAK,KAA2B,EAAE;IAE7C,IAAA,+DAA4B,EAAC,gBAAgB,EAAE,UAAU,EAAE,iBAAiB,EAAE,SAAS,EAAE;QACvF,MAAM;QACN,YAAY,EAAE,IAAI;KACnB,CAAC,CAAC;AACL,CAAC;AATD,kEASC"}
@@ -1,4 +0,0 @@
1
- import type { ClassDeclaration } from 'ts-morph';
2
- export declare function addExportToNgModule(classDeclaration: ClassDeclaration, exportName: string, { unique }?: {
3
- unique?: boolean;
4
- }): void;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addExportToNgModule = void 0;
4
- const push_to_decorator_array_property_1 = require("../helpers/push-to-decorator-array-property");
5
- function addExportToNgModule(classDeclaration, exportName, { unique = false } = {}) {
6
- (0, push_to_decorator_array_property_1.pushToDecoratorArrayProperty)(classDeclaration, 'NgModule', 'exports', exportName, {
7
- unique,
8
- forceToArray: true,
9
- });
10
- }
11
- exports.addExportToNgModule = addExportToNgModule;
12
- //# sourceMappingURL=add-export-to-ng-module.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"add-export-to-ng-module.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/module/add-export-to-ng-module.ts"],"names":[],"mappings":";;;AAEA,kGAA2F;AAE3F,SAAgB,mBAAmB,CACjC,gBAAkC,EAClC,UAAkB,EAClB,EAAE,MAAM,GAAG,KAAK,KAA2B,EAAE;IAE7C,IAAA,+DAA4B,EAAC,gBAAgB,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE;QAChF,MAAM;QACN,YAAY,EAAE,IAAI;KACnB,CAAC,CAAC;AACL,CAAC;AATD,kDASC"}
@@ -1,4 +0,0 @@
1
- import type { ClassDeclaration } from 'ts-morph';
2
- export declare function addImportToNgModule(classDeclaration: ClassDeclaration, moduleName: string, { unique }?: {
3
- unique?: boolean;
4
- }): void;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addImportToNgModule = void 0;
4
- const push_to_decorator_array_property_1 = require("../helpers/push-to-decorator-array-property");
5
- function addImportToNgModule(classDeclaration, moduleName, { unique = false } = {}) {
6
- (0, push_to_decorator_array_property_1.pushToDecoratorArrayProperty)(classDeclaration, 'NgModule', 'imports', moduleName, {
7
- unique,
8
- forceToArray: true,
9
- });
10
- }
11
- exports.addImportToNgModule = addImportToNgModule;
12
- //# sourceMappingURL=add-import-to-ng-module.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"add-import-to-ng-module.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/module/add-import-to-ng-module.ts"],"names":[],"mappings":";;;AAEA,kGAA2F;AAE3F,SAAgB,mBAAmB,CACjC,gBAAkC,EAClC,UAAkB,EAClB,EAAE,MAAM,GAAG,KAAK,KAA2B,EAAE;IAE7C,IAAA,+DAA4B,EAAC,gBAAgB,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE;QAChF,MAAM;QACN,YAAY,EAAE,IAAI;KACnB,CAAC,CAAC;AACL,CAAC;AATD,kDASC"}
@@ -1,4 +0,0 @@
1
- import type { ClassDeclaration } from 'ts-morph';
2
- export declare function addProviderToNgModule(classDeclaration: ClassDeclaration, provider: string, { unique }?: {
3
- unique?: boolean;
4
- }): void;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addProviderToNgModule = void 0;
4
- const push_to_decorator_array_property_1 = require("../helpers/push-to-decorator-array-property");
5
- function addProviderToNgModule(classDeclaration, provider, { unique = false } = {}) {
6
- (0, push_to_decorator_array_property_1.pushToDecoratorArrayProperty)(classDeclaration, 'NgModule', 'providers', provider, {
7
- unique,
8
- forceToArray: true,
9
- });
10
- }
11
- exports.addProviderToNgModule = addProviderToNgModule;
12
- //# sourceMappingURL=add-provider-to-ng-module.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"add-provider-to-ng-module.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/module/add-provider-to-ng-module.ts"],"names":[],"mappings":";;;AAEA,kGAA2F;AAE3F,SAAgB,qBAAqB,CACnC,gBAAkC,EAClC,QAAgB,EAChB,EAAE,MAAM,GAAG,KAAK,KAA2B,EAAE;IAE7C,IAAA,+DAA4B,EAAC,gBAAgB,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE;QAChF,MAAM;QACN,YAAY,EAAE,IAAI;KACnB,CAAC,CAAC;AACL,CAAC;AATD,sDASC"}
@@ -1,4 +0,0 @@
1
- import type { ClassDeclaration } from 'ts-morph';
2
- export declare function addSchemaToNgModule(classDeclaration: ClassDeclaration, schema: string, { unique }?: {
3
- unique?: boolean;
4
- }): void;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addSchemaToNgModule = void 0;
4
- const push_to_decorator_array_property_1 = require("../helpers/push-to-decorator-array-property");
5
- function addSchemaToNgModule(classDeclaration, schema, { unique = false } = {}) {
6
- (0, push_to_decorator_array_property_1.pushToDecoratorArrayProperty)(classDeclaration, 'NgModule', 'schemas', schema, {
7
- unique,
8
- forceToArray: true,
9
- });
10
- }
11
- exports.addSchemaToNgModule = addSchemaToNgModule;
12
- //# sourceMappingURL=add-schema-to-ng-module.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"add-schema-to-ng-module.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/module/add-schema-to-ng-module.ts"],"names":[],"mappings":";;;AAEA,kGAA2F;AAE3F,SAAgB,mBAAmB,CACjC,gBAAkC,EAClC,MAAc,EACd,EAAE,MAAM,GAAG,KAAK,KAA2B,EAAE;IAE7C,IAAA,+DAA4B,EAAC,gBAAgB,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE;QAC5E,MAAM;QACN,YAAY,EAAE,IAAI;KACnB,CAAC,CAAC;AACL,CAAC;AATD,kDASC"}