@abp/ng.schematics 9.2.0-rc.2 → 9.2.0-rc.4

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 (117) hide show
  1. package/commands/change-theme/index.d.ts +8 -3
  2. package/commands/change-theme/index.js +300 -71
  3. package/commands/change-theme/index.js.map +1 -1
  4. package/commands/change-theme/style-map.d.ts +2 -0
  5. package/commands/change-theme/style-map.js +96 -9
  6. package/commands/change-theme/style-map.js.map +1 -1
  7. package/commands/create-lib/files-package-standalone/__libraryName@kebab__/.eslintrc.json.template +44 -0
  8. package/commands/create-lib/files-package-standalone/__libraryName@kebab__/config/ng-package.json.template +7 -0
  9. package/commands/create-lib/files-package-standalone/__libraryName@kebab__/config/src/enums/index.ts.template +1 -0
  10. package/commands/create-lib/files-package-standalone/__libraryName@kebab__/config/src/enums/route-names.ts.template +3 -0
  11. package/commands/create-lib/files-package-standalone/__libraryName@kebab__/config/src/providers/index.ts.template +1 -0
  12. package/commands/create-lib/files-package-standalone/__libraryName@kebab__/config/src/providers/route.provider.ts.template +30 -0
  13. package/commands/create-lib/files-package-standalone/__libraryName@kebab__/config/src/public-api.ts.template +2 -0
  14. package/commands/create-lib/files-package-standalone/__libraryName@kebab__/karma.conf.js.template +44 -0
  15. package/commands/create-lib/files-package-standalone/__libraryName@kebab__/ng-package.json.template +7 -0
  16. package/commands/create-lib/files-package-standalone/__libraryName@kebab__/package.json.template +11 -0
  17. package/commands/create-lib/files-package-standalone/__libraryName@kebab__/src/lib/__libraryName@kebab__.component.ts.template +11 -0
  18. package/commands/create-lib/files-package-standalone/__libraryName@kebab__/src/lib/__libraryName@kebab__.routes.ts.template +9 -0
  19. package/commands/create-lib/files-package-standalone/__libraryName@kebab__/src/lib/index.ts.template +1 -0
  20. package/commands/create-lib/files-package-standalone/__libraryName@kebab__/src/public-api.ts.template +4 -0
  21. package/commands/create-lib/files-package-standalone/__libraryName@kebab__/src/test.ts.template +26 -0
  22. package/commands/create-lib/files-package-standalone/__libraryName@kebab__/tsconfig.lib.json.template +20 -0
  23. package/commands/create-lib/files-package-standalone/__libraryName@kebab__/tsconfig.lib.prod.json.template +10 -0
  24. package/commands/create-lib/files-package-standalone/__libraryName@kebab__/tsconfig.spec.json.template +17 -0
  25. package/commands/create-lib/files-secondary-entrypoint-standalone/__libraryName@kebab__/ng-package.json.template +6 -0
  26. package/commands/create-lib/files-secondary-entrypoint-standalone/__libraryName@kebab__/src/lib/__target@kebab__-__libraryName@kebab__.ts.template +7 -0
  27. package/commands/create-lib/files-secondary-entrypoint-standalone/__libraryName@kebab__/src/lib/index.ts.template +1 -0
  28. package/commands/create-lib/files-secondary-entrypoint-standalone/__libraryName@kebab__/src/public-api.ts.template +1 -0
  29. package/commands/create-lib/index.d.ts +7 -3
  30. package/commands/create-lib/index.js +161 -58
  31. package/commands/create-lib/index.js.map +1 -1
  32. package/commands/create-lib/models/generate-lib-schema.d.ts +8 -1
  33. package/commands/create-lib/models/generate-lib-schema.js +6 -0
  34. package/commands/create-lib/models/generate-lib-schema.js.map +1 -1
  35. package/commands/create-lib/schema.json +13 -9
  36. package/package.json +1 -1
  37. package/utils/angular/add-declaration-to-ng-module.d.ts +2 -1
  38. package/utils/angular/add-declaration-to-ng-module.js +4 -4
  39. package/utils/angular/add-declaration-to-ng-module.js.map +1 -1
  40. package/utils/angular/ast-utils.d.ts +18 -8
  41. package/utils/angular/ast-utils.js +70 -41
  42. package/utils/angular/ast-utils.js.map +1 -1
  43. package/utils/angular/change.d.ts +1 -1
  44. package/utils/angular/change.js +4 -4
  45. package/utils/angular/change.js.map +1 -1
  46. package/utils/angular/dependencies.d.ts +1 -1
  47. package/utils/angular/dependencies.js +1 -1
  48. package/utils/angular/dependency.d.ts +1 -1
  49. package/utils/angular/dependency.js +2 -2
  50. package/utils/angular/dependency.js.map +1 -1
  51. package/utils/angular/eol.d.ts +8 -0
  52. package/utils/angular/eol.js +24 -0
  53. package/utils/angular/eol.js.map +1 -0
  54. package/utils/angular/find-module.d.ts +1 -1
  55. package/utils/angular/find-module.js +5 -5
  56. package/utils/angular/find-module.js.map +1 -1
  57. package/utils/angular/generate-from-files.d.ts +3 -1
  58. package/utils/angular/generate-from-files.js +15 -2
  59. package/utils/angular/generate-from-files.js.map +1 -1
  60. package/utils/angular/index.d.ts +1 -0
  61. package/utils/angular/index.js +1 -0
  62. package/utils/angular/index.js.map +1 -1
  63. package/utils/angular/json-file.d.ts +3 -2
  64. package/utils/angular/json-file.js +6 -3
  65. package/utils/angular/json-file.js.map +1 -1
  66. package/utils/angular/ng-ast-utils.d.ts +2 -2
  67. package/utils/angular/ng-ast-utils.js +19 -7
  68. package/utils/angular/ng-ast-utils.js.map +1 -1
  69. package/utils/angular/parse-name.d.ts +1 -1
  70. package/utils/angular/parse-name.js +1 -1
  71. package/utils/angular/paths.d.ts +1 -1
  72. package/utils/angular/paths.js +4 -7
  73. package/utils/angular/paths.js.map +1 -1
  74. package/utils/angular/project-targets.d.ts +3 -1
  75. package/utils/angular/project-targets.js +9 -2
  76. package/utils/angular/project-targets.js.map +1 -1
  77. package/utils/angular/standalone/app_component.d.ts +29 -0
  78. package/utils/angular/standalone/app_component.js +108 -0
  79. package/utils/angular/standalone/app_component.js.map +1 -0
  80. package/utils/angular/standalone/app_config.d.ts +23 -0
  81. package/utils/angular/standalone/app_config.js +90 -0
  82. package/utils/angular/standalone/app_config.js.map +1 -0
  83. package/utils/angular/standalone/code_block.d.ts +53 -0
  84. package/utils/angular/standalone/code_block.js +80 -0
  85. package/utils/angular/standalone/code_block.js.map +1 -0
  86. package/utils/angular/standalone/index.d.ts +9 -0
  87. package/utils/angular/standalone/index.js +14 -0
  88. package/utils/angular/standalone/index.js.map +1 -0
  89. package/utils/angular/standalone/rules.d.ts +45 -0
  90. package/utils/angular/standalone/rules.js +189 -0
  91. package/utils/angular/standalone/rules.js.map +1 -0
  92. package/utils/angular/standalone/util.d.ts +35 -0
  93. package/utils/angular/standalone/util.js +136 -0
  94. package/utils/angular/standalone/util.js.map +1 -0
  95. package/utils/angular/validation.d.ts +1 -1
  96. package/utils/angular/validation.js +2 -2
  97. package/utils/angular/validation.js.map +1 -1
  98. package/utils/angular/workspace-models.d.ts +12 -6
  99. package/utils/angular/workspace-models.js +11 -3
  100. package/utils/angular/workspace-models.js.map +1 -1
  101. package/utils/angular/workspace.d.ts +12 -1
  102. package/utils/angular/workspace.js +6 -6
  103. package/utils/angular/workspace.js.map +1 -1
  104. package/utils/ast.d.ts +1 -0
  105. package/utils/ast.js +6 -1
  106. package/utils/ast.js.map +1 -1
  107. package/utils/index.d.ts +2 -0
  108. package/utils/index.js +2 -0
  109. package/utils/index.js.map +1 -1
  110. package/utils/ng-module.d.ts +46 -0
  111. package/utils/ng-module.js +126 -0
  112. package/utils/ng-module.js.map +1 -0
  113. package/utils/standalone.d.ts +59 -0
  114. package/utils/standalone.js +146 -0
  115. package/utils/standalone.js.map +1 -0
  116. package/utils/workspace.js +1 -1
  117. package/utils/workspace.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../../../../packages/schematics/src/utils/angular/workspace.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,+CAAwD;AACxD,2DAA8D;AAC9D,yDAAiD;AAEjD,MAAM,sBAAsB,GAAG,eAAe,CAAC;AAO/C;;GAEG;AACH,MAAM,iBAAiB;IACrB,YAA6B,IAAU;QAAV,SAAI,GAAJ,IAAI,CAAM;IAAG,CAAC;IAE3C,KAAK,CAAC,QAAQ,CAAC,IAAY;QACzB,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,IAAY,EAAE,IAAY;QACxC,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;YAC1B,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;SAC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E,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;SAClD;KACF;AACH,CAAC;AARD,kDAQC;AAED,QAAe,CAAC,CAAC,gBAAgB,CAC/B,MAAmC,EACnC,eAAe,GAAG,KAAK;IAEvB,IAAI,CAAC,eAAe,IAAI,MAAM,CAAC,OAAO,EAAE;QACtC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;KACnC;IAED,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE;QAC1B,OAAO;KACR;IAED,KAAK,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE;QACnE,IAAI,OAAO,KAAK,SAAS,EAAE;YACzB,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;SACvB;KACF;AACH,CAAC;AAjBD,4CAiBC"}
1
+ {"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../../../../packages/schematics/src/utils/angular/workspace.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,+CAAwD;AACxD,2DAA8D;AAC9D,yDAAiD;AAEjD,MAAM,sBAAsB,GAAG,eAAe,CAAC;AAO/C;;GAEG;AACH,MAAa,iBAAiB;IAC5B,YAA6B,IAAU;QAAV,SAAI,GAAJ,IAAI,CAAM;IAAG,CAAC;IAE3C,KAAK,CAAC,QAAQ,CAAC,IAAY;QACzB,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,IAAY,EAAE,IAAY;QACxC,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;YAC1B,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;SACjC;aAAM;YACL,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CA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G,KAAK;IAEvB,IAAI,CAAC,eAAe,IAAI,MAAM,CAAC,OAAO,EAAE;QACtC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;KACnC;IAED,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE;QAC1B,OAAO;KACR;IAED,KAAK,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE;QACnE,IAAI,OAAO,KAAK,SAAS,EAAE;YACzB,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;SACvB;KACF;AACH,CAAC;AAjBD,4CAiBC"}
package/utils/ast.d.ts CHANGED
@@ -2,3 +2,4 @@ import * as ts from 'typescript';
2
2
  export declare function findEnvironmentExpression(source: ts.SourceFile): ts.ObjectLiteralExpression | undefined;
3
3
  export declare function getAssignedPropertyFromObjectliteral(expression: ts.ObjectLiteralExpression, variableSelector: string[]): string | undefined;
4
4
  export declare function isBooleanStringOrNumberLiteral(node: ts.Node): node is ts.StringLiteral | ts.NumericLiteral | ts.BooleanLiteral;
5
+ export declare function removeEmptyElementsFromArrayLiteral(array: ts.ArrayLiteralExpression): ts.ArrayLiteralExpression;
package/utils/ast.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isBooleanStringOrNumberLiteral = exports.getAssignedPropertyFromObjectliteral = exports.findEnvironmentExpression = void 0;
3
+ exports.removeEmptyElementsFromArrayLiteral = exports.isBooleanStringOrNumberLiteral = exports.getAssignedPropertyFromObjectliteral = exports.findEnvironmentExpression = void 0;
4
4
  const ts = require("typescript");
5
5
  const ast_utils_1 = require("./angular/ast-utils");
6
6
  function findEnvironmentExpression(source) {
@@ -21,4 +21,9 @@ function isBooleanStringOrNumberLiteral(node) {
21
21
  node.kind === ts.SyntaxKind.FalseKeyword);
22
22
  }
23
23
  exports.isBooleanStringOrNumberLiteral = isBooleanStringOrNumberLiteral;
24
+ function removeEmptyElementsFromArrayLiteral(array) {
25
+ const cleaned = array.elements.filter(el => el.kind !== ts.SyntaxKind.OmittedExpression);
26
+ return ts.factory.updateArrayLiteralExpression(array, ts.factory.createNodeArray(cleaned));
27
+ }
28
+ exports.removeEmptyElementsFromArrayLiteral = removeEmptyElementsFromArrayLiteral;
24
29
  //# sourceMappingURL=ast.js.map
package/utils/ast.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"ast.js","sourceRoot":"","sources":["../../../../packages/schematics/src/utils/ast.ts"],"names":[],"mappings":";;;AAAA,iCAAiC;AACjC,mDAAgD;AAEhD,SAAgB,yBAAyB,CAAC,MAAqB;IAC7D,MAAM,WAAW,GAAG,IAAA,qBAAS,EAAC,MAAM,EAAE,EAAE,CAAC,yBAAyB,CAAC,CAAC;IACpE,OAAO,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC;AACzE,CAAC;AAHD,8DAGC;AAED,SAAgB,oCAAoC,CAClD,UAAsC,EACtC,gBAA0B;IAE1B,MAAM,WAAW,GAAG,IAAA,qBAAS,EAAC,UAAU,EAAE,8BAA8B,CAAC,CAAC;IAE1E,MAAM,OAAO,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACtC,OAAO,CACL,gBAAgB,CAAC,WAAW,CAC1B,CAAC,GAA0B,EAAE,GAAG,EAAE,EAAE,CAClC,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAC9D,IAAI,CAAC,MAAM,CACZ,CACF,CACF,CAAC;IAEF,OAAO,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AACjD,CAAC;AAjB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CAAC;AAjBD,oFAiBC;AAED,SAAgB,8BAA8B,CAC5C,IAAa;IAEb,OAAO,CACL,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC;QACxB,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC;QACzB,IAAI,CAAC,IAAI,KAAK,EAAE,CAAC,UAAU,CAAC,WAAW;QACvC,IAAI,CAAC,IAAI,KAAK,EAAE,CAAC,UAAU,CAAC,YAAY,CACzC,CAAC;AACJ,CAAC;AATD,wEASC;AAED,SAAgB,mCAAmC,CACjD,KAAgC;IAEhC,MAAM,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,KAAK,EAAE,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC;IACzF,OAAO,EAAE,CAAC,OAAO,CAAC,4BAA4B,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC;AAC7F,CAAC;AALD,kFAKC"}
package/utils/index.d.ts CHANGED
@@ -18,3 +18,5 @@ export * from './text';
18
18
  export * from './tree';
19
19
  export * from './type';
20
20
  export * from './workspace';
21
+ export * from './standalone';
22
+ export * from './ng-module';
package/utils/index.js CHANGED
@@ -34,4 +34,6 @@ __exportStar(require("./text"), exports);
34
34
  __exportStar(require("./tree"), exports);
35
35
  __exportStar(require("./type"), exports);
36
36
  __exportStar(require("./workspace"), exports);
37
+ __exportStar(require("./standalone"), exports);
38
+ __exportStar(require("./ng-module"), exports);
37
39
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/schematics/src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,wCAAsB;AACtB,wCAAsB;AACtB,2CAAyB;AACzB,2CAAyB;AACzB,yCAAuB;AACvB,yCAAuB;AACvB,6CAA2B;AAC3B,2CAAyB;AACzB,4CAA0B;AAC1B,0CAAwB;AACxB,8CAA4B;AAC5B,yCAAuB;AACvB,yCAAuB;AACvB,4CAA0B;AAC1B,2CAAyB;AACzB,yCAAuB;AACvB,yCAAuB;AACvB,yCAAuB;AACvB,8CAA4B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/schematics/src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,wCAAsB;AACtB,wCAAsB;AACtB,2CAAyB;AACzB,2CAAyB;AACzB,yCAAuB;AACvB,yCAAuB;AACvB,6CAA2B;AAC3B,2CAAyB;AACzB,4CAA0B;AAC1B,0CAAwB;AACxB,8CAA4B;AAC5B,yCAAuB;AACvB,yCAAuB;AACvB,4CAA0B;AAC1B,2CAAyB;AACzB,yCAAuB;AACvB,yCAAuB;AACvB,yCAAuB;AACvB,8CAA4B;AAC5B,+CAA6B;AAC7B,8CAA4B"}
@@ -0,0 +1,46 @@
1
+ import { Tree, UpdateRecorder } from '@angular-devkit/schematics';
2
+ import * as ts from 'typescript';
3
+ import { Path } from '@angular-devkit/core';
4
+ /**
5
+ * Checks whether a specific import or provider exists in the specified metadata
6
+ * array (`imports`, `providers`, etc.) of the `NgModule` decorator in the AppModule.
7
+ *
8
+ * This function locates the AppModule file of the given Angular project,
9
+ * parses its AST, and inspects the specified metadata array to determine
10
+ * if it includes an element matching the provided string (e.g., `CommonModule`, `HttpClientModule`).
11
+ *
12
+ * @param host - The virtual file system tree used by Angular schematics.
13
+ * @param projectName - The name of the Angular project.
14
+ * @param metadataFn - The name (string) to match against the elements of the metadata array.
15
+ * @param metadataName - The metadata field to search in (e.g., 'imports', 'providers'). Defaults to 'imports'.
16
+ * @returns A promise that resolves to `true` if the metadata function is found, or `false` otherwise.
17
+ * @throws SchematicsException if the AppModule file or expected metadata is not found or malformed.
18
+ */
19
+ export declare const hasImportInNgModule: (host: Tree, projectName: string, metadataFn: string, metadataName?: string) => Promise<boolean>;
20
+ /**
21
+ * Attempts to locate the path of the `AppRoutingModule` file that is imported
22
+ * within the root AppModule file of an Angular application.
23
+ *
24
+ * This function reads the AppModule file (resolved from the main file path),
25
+ * parses its AST, and searches for an import declaration that imports
26
+ * `AppRoutingModule`. Once found, it resolves the import path to a normalized
27
+ * file path relative to the workspace root.
28
+ *
29
+ * @param tree - The virtual file system tree used by Angular schematics.
30
+ * @param mainFilePath - The path to the main entry file of the Angular application (typically `main.ts`).
31
+ * @returns A normalized workspace-relative path to the AppRoutingModule file if found, or `null` otherwise.
32
+ * @throws If the route file path is resolved but the file does not exist in the tree.
33
+ */
34
+ export declare function findAppRoutesModulePath(tree: Tree, mainFilePath: string): Promise<Path | null>;
35
+ /**
36
+ * Cleans up empty or invalid expressions (e.g., extra commas) from the `imports` and `providers`
37
+ * arrays in the NgModule decorator of an Angular module file.
38
+ *
39
+ * This function parses the source file's AST, locates the `NgModule` decorator, and processes
40
+ * the `imports` and `providers` metadata fields. If these fields contain array literals with
41
+ * empty slots (such as trailing or double commas), they are removed and the array is rewritten.
42
+ *
43
+ * @param source - The TypeScript source file containing the Angular module.
44
+ * @param recorder - The recorder used to apply changes to the source file.
45
+ */
46
+ export declare function cleanEmptyExprFromModule(source: ts.SourceFile, recorder: UpdateRecorder): void;
@@ -0,0 +1,126 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.cleanEmptyExprFromModule = exports.findAppRoutesModulePath = exports.hasImportInNgModule = void 0;
4
+ const schematics_1 = require("@angular-devkit/schematics");
5
+ const util_1 = require("./angular/standalone/util");
6
+ const ts = require("typescript");
7
+ const angular_1 = require("./angular");
8
+ const index_1 = require("../commands/change-theme/index");
9
+ const core_1 = require("@angular-devkit/core");
10
+ const path = require("path");
11
+ const ast_1 = require("./ast");
12
+ /**
13
+ * Checks whether a specific import or provider exists in the specified metadata
14
+ * array (`imports`, `providers`, etc.) of the `NgModule` decorator in the AppModule.
15
+ *
16
+ * This function locates the AppModule file of the given Angular project,
17
+ * parses its AST, and inspects the specified metadata array to determine
18
+ * if it includes an element matching the provided string (e.g., `CommonModule`, `HttpClientModule`).
19
+ *
20
+ * @param host - The virtual file system tree used by Angular schematics.
21
+ * @param projectName - The name of the Angular project.
22
+ * @param metadataFn - The name (string) to match against the elements of the metadata array.
23
+ * @param metadataName - The metadata field to search in (e.g., 'imports', 'providers'). Defaults to 'imports'.
24
+ * @returns A promise that resolves to `true` if the metadata function is found, or `false` otherwise.
25
+ * @throws SchematicsException if the AppModule file or expected metadata is not found or malformed.
26
+ */
27
+ const hasImportInNgModule = async (host, projectName, metadataFn, metadataName = 'imports') => {
28
+ const mainFilePath = await (0, util_1.getMainFilePath)(host, projectName);
29
+ const appModulePath = (0, angular_1.getAppModulePath)(host, mainFilePath);
30
+ const buffer = host.read(appModulePath);
31
+ if (!buffer) {
32
+ throw new schematics_1.SchematicsException(`Could not read file: ${appModulePath}`);
33
+ }
34
+ const source = (0, index_1.createSourceFile)(host, appModulePath);
35
+ // Get the NgModule decorator metadata
36
+ const ngModuleDecorator = (0, angular_1.getDecoratorMetadata)(source, 'NgModule', '@angular/core')[0];
37
+ if (!ngModuleDecorator) {
38
+ throw new schematics_1.SchematicsException('The app module does not found');
39
+ }
40
+ const matchingProperties = (0, angular_1.getMetadataField)(ngModuleDecorator, metadataName);
41
+ const assignment = matchingProperties[0];
42
+ const assignmentInit = assignment.initializer;
43
+ const elements = assignmentInit.elements;
44
+ if (!elements || elements.length < 1) {
45
+ throw new schematics_1.SchematicsException(`Elements could not found: ${elements}`);
46
+ }
47
+ return elements.some(f => f.getText().match(metadataFn));
48
+ };
49
+ exports.hasImportInNgModule = hasImportInNgModule;
50
+ /**
51
+ * Attempts to locate the path of the `AppRoutingModule` file that is imported
52
+ * within the root AppModule file of an Angular application.
53
+ *
54
+ * This function reads the AppModule file (resolved from the main file path),
55
+ * parses its AST, and searches for an import declaration that imports
56
+ * `AppRoutingModule`. Once found, it resolves the import path to a normalized
57
+ * file path relative to the workspace root.
58
+ *
59
+ * @param tree - The virtual file system tree used by Angular schematics.
60
+ * @param mainFilePath - The path to the main entry file of the Angular application (typically `main.ts`).
61
+ * @returns A normalized workspace-relative path to the AppRoutingModule file if found, or `null` otherwise.
62
+ * @throws If the route file path is resolved but the file does not exist in the tree.
63
+ */
64
+ async function findAppRoutesModulePath(tree, mainFilePath) {
65
+ const appModulePath = (0, angular_1.getAppModulePath)(tree, mainFilePath);
66
+ if (!appModulePath || !tree.exists(appModulePath))
67
+ return null;
68
+ const buffer = tree.read(appModulePath);
69
+ if (!buffer)
70
+ return null;
71
+ const source = ts.createSourceFile(appModulePath, buffer.toString('utf-8'), ts.ScriptTarget.Latest, true);
72
+ for (const stmt of source.statements) {
73
+ if (!ts.isImportDeclaration(stmt))
74
+ continue;
75
+ const importClause = stmt.importClause;
76
+ if (!importClause?.namedBindings || !ts.isNamedImports(importClause.namedBindings))
77
+ continue;
78
+ const isRoutesImport = importClause.namedBindings.elements.some(el => el.name.getText() === 'AppRoutingModule');
79
+ if (!isRoutesImport || !ts.isStringLiteral(stmt.moduleSpecifier))
80
+ continue;
81
+ let importPath = stmt.moduleSpecifier.text;
82
+ if (!importPath.endsWith('.ts')) {
83
+ importPath += '.ts';
84
+ }
85
+ const configDir = path.dirname(appModulePath);
86
+ const resolvedFsPath = path.resolve(configDir, importPath);
87
+ const workspaceRelativePath = path.relative(process.cwd(), resolvedFsPath).replace(/\\/g, '/');
88
+ const normalizedPath = (0, core_1.normalize)(workspaceRelativePath);
89
+ if (!tree.exists(normalizedPath)) {
90
+ throw new Error(`Cannot find routes file: ${normalizedPath}`);
91
+ }
92
+ return normalizedPath;
93
+ }
94
+ return null;
95
+ }
96
+ exports.findAppRoutesModulePath = findAppRoutesModulePath;
97
+ /**
98
+ * Cleans up empty or invalid expressions (e.g., extra commas) from the `imports` and `providers`
99
+ * arrays in the NgModule decorator of an Angular module file.
100
+ *
101
+ * This function parses the source file's AST, locates the `NgModule` decorator, and processes
102
+ * the `imports` and `providers` metadata fields. If these fields contain array literals with
103
+ * empty slots (such as trailing or double commas), they are removed and the array is rewritten.
104
+ *
105
+ * @param source - The TypeScript source file containing the Angular module.
106
+ * @param recorder - The recorder used to apply changes to the source file.
107
+ */
108
+ function cleanEmptyExprFromModule(source, recorder) {
109
+ const ngModuleNode = (0, angular_1.getDecoratorMetadata)(source, 'NgModule', '@angular/core')[0];
110
+ if (!ngModuleNode)
111
+ return;
112
+ const printer = ts.createPrinter();
113
+ const metadataKeys = ['imports', 'providers'];
114
+ for (const key of metadataKeys) {
115
+ const metadataField = (0, angular_1.getMetadataField)(ngModuleNode, key);
116
+ if (!metadataField.length)
117
+ continue;
118
+ const assignment = metadataField[0];
119
+ const arrayLiteral = assignment.initializer;
120
+ const cleanedArray = (0, ast_1.removeEmptyElementsFromArrayLiteral)(arrayLiteral);
121
+ recorder.remove(arrayLiteral.getStart(), arrayLiteral.getWidth());
122
+ recorder.insertLeft(arrayLiteral.getStart(), printer.printNode(ts.EmitHint.Expression, cleanedArray, source));
123
+ }
124
+ }
125
+ exports.cleanEmptyExprFromModule = cleanEmptyExprFromModule;
126
+ //# sourceMappingURL=ng-module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ng-module.js","sourceRoot":"","sources":["../../../../packages/schematics/src/utils/ng-module.ts"],"names":[],"mappings":";;;AAAA,2DAAuF;AACvF,oDAA4D;AAC5D,iCAAiC;AACjC,uCAAqF;AACrF,0DAAkE;AAClE,+CAAuD;AACvD,6BAA6B;AAC7B,+BAA4D;AAE5D;;;;;;;;;;;;;;GAcG;AACI,MAAM,mBAAmB,GAAG,KAAK,EACtC,IAAU,EACV,WAAmB,EACnB,UAAkB,EAClB,YAAY,GAAG,SAAS,EACN,EAAE;IACpB,MAAM,YAAY,GAAG,MAAM,IAAA,sBAAe,EAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IAC9D,MAAM,aAAa,GAAG,IAAA,0BAAgB,EAAC,IAAI,EAAE,YAAY,CAAC,CAAC;IAC3D,M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,CAChE,CAAC;KACH;AACH,CAAC;AArBD,4DAqBC"}
@@ -0,0 +1,59 @@
1
+ import { Tree, UpdateRecorder } from '@angular-devkit/schematics';
2
+ import * as ts from 'typescript';
3
+ import { Path } from '@angular-devkit/core';
4
+ /**
5
+ * Retrieves the file path of the application's configuration used in a standalone
6
+ * Angular application setup.
7
+ *
8
+ * This function locates the `bootstrapApplication` call in the main entry file and
9
+ * resolves the path to the configuration object passed to it (typically `appConfig`).
10
+ *
11
+ * @param host - The virtual file system tree used by Angular schematics.
12
+ * @param mainFilePath - The path to the main entry file of the Angular application (e.g., `main.ts`).
13
+ * @returns The resolved file path of the application's configuration, or an empty string if not found.
14
+ */
15
+ export declare const getAppConfigPath: (host: Tree, mainFilePath: string) => string;
16
+ /**
17
+ * Attempts to locate the file path of the `routes` array used in a standalone
18
+ * Angular application configuration.
19
+ *
20
+ * This function resolves the application's config file (typically where `routes` is defined or imported),
21
+ * parses the file, and inspects its import declarations to find the import associated with `routes`.
22
+ * It then resolves and normalizes the file path of the `routes` definition and returns it.
23
+ *
24
+ * @param tree - The virtual file system tree used by Angular schematics.
25
+ * @param mainFilePath - The path to the main entry file of the Angular application (e.g., `main.ts`).
26
+ * @returns The normalized workspace-relative path to the file where `routes` is defined, or `null` if not found.
27
+ * @throws If the `routes` import path is found but the file does not exist in the tree.
28
+ */
29
+ export declare function findAppRoutesPath(tree: Tree, mainFilePath: string): Path | null;
30
+ /**
31
+ * Checks whether a specific provider is registered in the `providers` array of the
32
+ * standalone application configuration (typically within `app.config.ts`) in an Angular project.
33
+ *
34
+ * This function reads and parses the application configuration file, looks for the
35
+ * `providers` property in the configuration object, and checks whether it includes
36
+ * the specified provider name.
37
+ *
38
+ * @param host - The virtual file system tree used by Angular schematics.
39
+ * @param projectName - The name of the Angular project.
40
+ * @param providerName - The name of the provider to search for (as a string match).
41
+ * @returns A promise that resolves to `true` if the provider is found, otherwise `false`.
42
+ * @throws SchematicsException if the app config file cannot be read.
43
+ */
44
+ export declare const hasProviderInStandaloneAppConfig: (host: Tree, projectName: string, providerName: string) => Promise<boolean>;
45
+ /**
46
+ * Cleans up empty or invalid expressions (e.g., extra or trailing commas) from the
47
+ * `providers` array within a standalone Angular application configuration object.
48
+ *
49
+ * This function parses the source file's AST to locate variable declarations that
50
+ * define an object literal. It then searches for a `providers` property and removes
51
+ * any empty elements from its array literal, replacing it with a cleaned version.
52
+ *
53
+ * Typically used in Angular schematics to ensure the `providers` array in `app.config.ts`
54
+ * is free of empty slots after modifications.
55
+ *
56
+ * @param source - The TypeScript source file containing the app configuration.
57
+ * @param recorder - The recorder used to apply changes to the source file.
58
+ */
59
+ export declare function cleanEmptyExprFromProviders(source: ts.SourceFile, recorder: UpdateRecorder): void;
@@ -0,0 +1,146 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.cleanEmptyExprFromProviders = exports.hasProviderInStandaloneAppConfig = exports.findAppRoutesPath = exports.getAppConfigPath = void 0;
4
+ const schematics_1 = require("@angular-devkit/schematics");
5
+ const util_1 = require("./angular/standalone/util");
6
+ const app_config_1 = require("./angular/standalone/app_config");
7
+ const ts = require("typescript");
8
+ const core_1 = require("@angular-devkit/core");
9
+ const path = require("path");
10
+ const angular_1 = require("./angular");
11
+ const ast_1 = require("./ast");
12
+ /**
13
+ * Retrieves the file path of the application's configuration used in a standalone
14
+ * Angular application setup.
15
+ *
16
+ * This function locates the `bootstrapApplication` call in the main entry file and
17
+ * resolves the path to the configuration object passed to it (typically `appConfig`).
18
+ *
19
+ * @param host - The virtual file system tree used by Angular schematics.
20
+ * @param mainFilePath - The path to the main entry file of the Angular application (e.g., `main.ts`).
21
+ * @returns The resolved file path of the application's configuration, or an empty string if not found.
22
+ */
23
+ const getAppConfigPath = (host, mainFilePath) => {
24
+ const bootstrapCall = (0, util_1.findBootstrapApplicationCall)(host, mainFilePath);
25
+ const appConfig = (0, app_config_1.findAppConfig)(bootstrapCall, host, mainFilePath);
26
+ return appConfig?.filePath || '';
27
+ };
28
+ exports.getAppConfigPath = getAppConfigPath;
29
+ /**
30
+ * Attempts to locate the file path of the `routes` array used in a standalone
31
+ * Angular application configuration.
32
+ *
33
+ * This function resolves the application's config file (typically where `routes` is defined or imported),
34
+ * parses the file, and inspects its import declarations to find the import associated with `routes`.
35
+ * It then resolves and normalizes the file path of the `routes` definition and returns it.
36
+ *
37
+ * @param tree - The virtual file system tree used by Angular schematics.
38
+ * @param mainFilePath - The path to the main entry file of the Angular application (e.g., `main.ts`).
39
+ * @returns The normalized workspace-relative path to the file where `routes` is defined, or `null` if not found.
40
+ * @throws If the `routes` import path is found but the file does not exist in the tree.
41
+ */
42
+ function findAppRoutesPath(tree, mainFilePath) {
43
+ const appConfigPath = (0, exports.getAppConfigPath)(tree, mainFilePath);
44
+ if (!appConfigPath || !tree.exists(appConfigPath))
45
+ return null;
46
+ const buffer = tree.read(appConfigPath);
47
+ if (!buffer)
48
+ return null;
49
+ const source = ts.createSourceFile(appConfigPath, buffer.toString('utf-8'), ts.ScriptTarget.Latest, true);
50
+ for (const stmt of source.statements) {
51
+ if (!ts.isImportDeclaration(stmt))
52
+ continue;
53
+ const importClause = stmt.importClause;
54
+ if (!importClause?.namedBindings || !ts.isNamedImports(importClause.namedBindings))
55
+ continue;
56
+ const isRoutesImport = importClause.namedBindings.elements.some(el => el.name.getText() === 'routes');
57
+ if (!isRoutesImport || !ts.isStringLiteral(stmt.moduleSpecifier))
58
+ continue;
59
+ let importPath = stmt.moduleSpecifier.text;
60
+ if (!importPath.endsWith('.ts')) {
61
+ importPath += '.ts';
62
+ }
63
+ const configDir = path.dirname(appConfigPath);
64
+ const resolvedFsPath = path.resolve(configDir, importPath);
65
+ const workspaceRelativePath = path.relative(process.cwd(), resolvedFsPath).replace(/\\/g, '/');
66
+ const normalizedPath = (0, core_1.normalize)(workspaceRelativePath);
67
+ if (!tree.exists(normalizedPath)) {
68
+ throw new Error(`Cannot find routes file: ${normalizedPath}`);
69
+ }
70
+ return normalizedPath;
71
+ }
72
+ return null;
73
+ }
74
+ exports.findAppRoutesPath = findAppRoutesPath;
75
+ /**
76
+ * Checks whether a specific provider is registered in the `providers` array of the
77
+ * standalone application configuration (typically within `app.config.ts`) in an Angular project.
78
+ *
79
+ * This function reads and parses the application configuration file, looks for the
80
+ * `providers` property in the configuration object, and checks whether it includes
81
+ * the specified provider name.
82
+ *
83
+ * @param host - The virtual file system tree used by Angular schematics.
84
+ * @param projectName - The name of the Angular project.
85
+ * @param providerName - The name of the provider to search for (as a string match).
86
+ * @returns A promise that resolves to `true` if the provider is found, otherwise `false`.
87
+ * @throws SchematicsException if the app config file cannot be read.
88
+ */
89
+ const hasProviderInStandaloneAppConfig = async (host, projectName, providerName) => {
90
+ const mainFilePath = await (0, util_1.getMainFilePath)(host, projectName);
91
+ const appConfigPath = (0, exports.getAppConfigPath)(host, mainFilePath);
92
+ const buffer = host.read(appConfigPath);
93
+ if (!buffer) {
94
+ throw new schematics_1.SchematicsException(`Could not read file: ${appConfigPath}`);
95
+ }
96
+ const source = ts.createSourceFile(appConfigPath, buffer.toString('utf-8'), ts.ScriptTarget.Latest, true);
97
+ const callExpressions = source.statements
98
+ .flatMap(stmt => (ts.isVariableStatement(stmt) ? stmt.declarationList.declarations : []))
99
+ .flatMap(decl => decl.initializer && ts.isObjectLiteralExpression(decl.initializer)
100
+ ? decl.initializer.properties
101
+ : [])
102
+ .filter(ts.isPropertyAssignment)
103
+ .filter(prop => prop.name.getText() === 'providers');
104
+ if (callExpressions.length === 0)
105
+ return false;
106
+ const providersArray = callExpressions[0].initializer;
107
+ return providersArray.elements.some(el => el.getText().includes(providerName));
108
+ };
109
+ exports.hasProviderInStandaloneAppConfig = hasProviderInStandaloneAppConfig;
110
+ /**
111
+ * Cleans up empty or invalid expressions (e.g., extra or trailing commas) from the
112
+ * `providers` array within a standalone Angular application configuration object.
113
+ *
114
+ * This function parses the source file's AST to locate variable declarations that
115
+ * define an object literal. It then searches for a `providers` property and removes
116
+ * any empty elements from its array literal, replacing it with a cleaned version.
117
+ *
118
+ * Typically used in Angular schematics to ensure the `providers` array in `app.config.ts`
119
+ * is free of empty slots after modifications.
120
+ *
121
+ * @param source - The TypeScript source file containing the app configuration.
122
+ * @param recorder - The recorder used to apply changes to the source file.
123
+ */
124
+ function cleanEmptyExprFromProviders(source, recorder) {
125
+ const varStatements = (0, angular_1.findNodes)(source, ts.isVariableStatement);
126
+ const printer = ts.createPrinter();
127
+ for (const stmt of varStatements) {
128
+ const declList = stmt.declarationList;
129
+ for (const decl of declList.declarations) {
130
+ if (!decl.initializer || !ts.isObjectLiteralExpression(decl.initializer))
131
+ continue;
132
+ const obj = decl.initializer;
133
+ const providersProp = obj.properties.find(prop => ts.isPropertyAssignment(prop) &&
134
+ ts.isIdentifier(prop.name) &&
135
+ prop.name.text === 'providers');
136
+ if (!providersProp || !ts.isArrayLiteralExpression(providersProp.initializer))
137
+ continue;
138
+ const arrayLiteral = providersProp.initializer;
139
+ const cleanedArray = (0, ast_1.removeEmptyElementsFromArrayLiteral)(arrayLiteral);
140
+ recorder.remove(arrayLiteral.getStart(), arrayLiteral.getWidth());
141
+ recorder.insertLeft(arrayLiteral.getStart(), printer.printNode(ts.EmitHint.Expression, cleanedArray, source));
142
+ }
143
+ }
144
+ }
145
+ exports.cleanEmptyExprFromProviders = cleanEmptyExprFromProviders;
146
+ //# sourceMappingURL=standalone.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"standalone.js","sourceRoot":"","sources":["../../../../packages/schematics/src/utils/standalone.ts"],"names":[],"mappings":";;;AAAA,2DAAuF;AACvF,oDAA0F;AAC1F,gEAAgE;AAChE,iCAAiC;AACjC,+CAAuD;AACvD,6BAA6B;AAC7B,uCAAsC;AACtC,+BAA4D;AAE5D;;;;;;;;;;GAUG;AACI,MAAM,gBAAgB,GAAG,CAAC,IAAU,EAAE,YAAoB,EAAU,EAAE;IAC3E,MAAM,aAAa,GAAG,IAAA,mCAA4B,EAAC,IAAI,EAAE,YAAY,CAAC,CA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AQ,GAAG,IAAI,CAAC,eAAe,CAAC;QACtC,KAAK,MAAM,IAAI,IAAI,QAAQ,CAAC,YAAY,EAAE;YACxC,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,EAAE,CAAC,yBAAyB,CAAC,IAAI,CAAC,WAAW,CAAC;gBAAE,SAAS;YAEnF,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC;YAE7B,MAAM,aAAa,GAAG,GAAG,CAAC,UAAU,CAAC,IAAI,CACvC,IAAI,CAAC,EAAE,CACL,EAAE,CAAC,oBAAoB,CAAC,IAAI,CAAC;gBAC7B,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC;gBAC1B,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,WAAW,CACR,CAAC;YAE3B,IAAI,CAAC,aAAa,IAAI,CAAC,EAAE,CAAC,wBAAwB,CAAC,aAAa,CAAC,WAAW,CAAC;gBAAE,SAAS;YAExF,MAAM,YAAY,GAAG,aAAa,CAAC,WAAW,CAAC;YAC/C,MAAM,YAAY,GAAG,IAAA,yCAAmC,EAAC,YAAY,CAAC,CAAC;YAEvE,QAAQ,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,EAAE,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC;YAClE,QAAQ,CAAC,UAAU,CACjB,YAAY,CAAC,QAAQ,EAAE,EACvB,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,QAAQ,CAAC,UAAU,EAAE,YAAY,EAAE,MAAM,CAAC,CAChE,CAAC;SACH;KACF;AACH,CAAC;AA9BD,kEA8BC"}
@@ -47,7 +47,7 @@ async function resolveProject(tree, name,
47
47
  // eslint-disable-next-line
48
48
  // @typescript-eslint/no-explicit-any
49
49
  notFoundValue = symbols_1.NOT_FOUND_VALUE) {
50
- name = name || readWorkspaceSchema(tree).defaultProject || getFirstApplication(tree).name;
50
+ name = name || getFirstApplication(tree).name;
51
51
  const workspace = await (0, angular_1.getWorkspace)(tree);
52
52
  let definition;
53
53
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../../../packages/schematics/src/utils/workspace.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAC7B,+CAA2D;AAC3D,2DAAuE;AAGvE,uCAAyF;AACzF,+BAAkD;AAClD,qCAA0C;AAC1C,kDAAuD;AACvD,oEAAiE;AAEjE,SAAgB,SAAS,CAAC,OAAqC;IAC7D,OAAO,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,qBAAW,CAAC,OAAO,CAAC;AACnE,CAAC;AAFD,8BAEC;AAED,SAAgB,eAAe,CAAC,IAAU,EAAE,OAAqC;IAC/E,IAAI,SAAS,CAAC,OAAO,CAAC;QAAE,OAAO,SAAS,CAAC;IAEzC,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,IAAI,GAAG,OAAO,CAAC,IAAI,MAAM,CAAC;IAC5D,MAAM,OAAO,GAAG,OAAO,GAAG,8BAA8B,CAAC;IACzD,MAAM,MAAM,GAAG,IAAA,uBAAc,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC7C,OAAO,IAAA,+BAAyB,EAAC,MAAM,CAAC,CAAC;AAC3C,CAAC;AAPD,0CAOC;AACD,SAAgB,mBAAmB,CAAC,IAAU;IAC5C,MAAM,SAAS,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAC5C,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GACnB,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,IAAI,CACrC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,KAAK,qBAAW,CAAC,WAAW,CAClE,IAAI,EAAE,CAAC;IACV,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAC3B,CAAC;AAPD,kDAOC;AAED,SAAgB,mBAAmB,CAAC,IAAU;IAC5C,IAAI,C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