@o3r/schematics 9.1.0-alpha.30 → 9.1.0-alpha.34

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@o3r/schematics",
3
- "version": "9.1.0-alpha.30",
3
+ "version": "9.1.0-alpha.34",
4
4
  "description": "Schematics module of the Otter framework",
5
5
  "main": "./src/index.js",
6
6
  "keywords": [
@@ -58,9 +58,9 @@
58
58
  "@nx/jest": "~16.5.0",
59
59
  "@nx/js": "~16.5.0",
60
60
  "@nx/linter": "~16.5.0",
61
- "@o3r/build-helpers": "^9.1.0-alpha.30",
62
- "@o3r/dev-tools": "^9.1.0-alpha.30",
63
- "@o3r/eslint-plugin": "^9.1.0-alpha.30",
61
+ "@o3r/build-helpers": "^9.1.0-alpha.34",
62
+ "@o3r/dev-tools": "^9.1.0-alpha.34",
63
+ "@o3r/eslint-plugin": "^9.1.0-alpha.34",
64
64
  "@schematics/angular": "~16.0.5",
65
65
  "@types/jest": "~29.5.2",
66
66
  "@types/node": "^18.0.0",
@@ -7,4 +7,17 @@ import type { WorkspaceSchema } from '../interfaces';
7
7
  * @returns the updated workspace
8
8
  */
9
9
  export declare function registerCollectionSchematics(workspace: WorkspaceSchema, collection: string): WorkspaceSchema;
10
+ /**
11
+ * Get default options for a schematic
12
+ * This will look inside angular.json file for schematics with keys containing wildcards like `*:ng-add` or `@o3r/core:*`
13
+ *
14
+ * @param workspace
15
+ * @param collection
16
+ * @param schematicName
17
+ * @param options
18
+ * @param options.projectName
19
+ */
20
+ export declare function getDefaultOptionsForSchematic(workspace: WorkspaceSchema | null, collection: string, schematicName: string, options: {
21
+ projectName: string | undefined;
22
+ }): Record<string, string>;
10
23
  //# sourceMappingURL=collection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../../../src/utility/collection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAAC,SAAS,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,GAAG,eAAe,CAO5G"}
1
+ {"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../../../src/utility/collection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAAC,SAAS,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,GAAG,eAAe,CAO5G;AAED;;;;;;;;;GASG;AACH,wBAAgB,6BAA6B,CAAC,SAAS,EAAE,eAAe,GAAG,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE;IAAC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;CAAC,0BAcrK"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.registerCollectionSchematics = void 0;
3
+ exports.getDefaultOptionsForSchematic = exports.registerCollectionSchematics = void 0;
4
4
  /**
5
5
  * Register the collection schematic to the workspace
6
6
  *
@@ -17,4 +17,29 @@ function registerCollectionSchematics(workspace, collection) {
17
17
  return workspace;
18
18
  }
19
19
  exports.registerCollectionSchematics = registerCollectionSchematics;
20
+ /**
21
+ * Get default options for a schematic
22
+ * This will look inside angular.json file for schematics with keys containing wildcards like `*:ng-add` or `@o3r/core:*`
23
+ *
24
+ * @param workspace
25
+ * @param collection
26
+ * @param schematicName
27
+ * @param options
28
+ * @param options.projectName
29
+ */
30
+ function getDefaultOptionsForSchematic(workspace, collection, schematicName, options) {
31
+ if (!workspace) {
32
+ return {};
33
+ }
34
+ const schematicsDefaultParams = [
35
+ workspace.schematics,
36
+ ...options.projectName ? [workspace.projects[options.projectName]?.schematics] : []
37
+ ];
38
+ return schematicsDefaultParams.flatMap((schematics) => schematics ?
39
+ Object.entries(schematics)
40
+ .filter(([key, _]) => key === `*:${schematicName}` || key === `${collection}:*`)
41
+ .map(([_, value]) => value) :
42
+ []).reduce((out, defaultParams) => ({ ...out, ...defaultParams }), {});
43
+ }
44
+ exports.getDefaultOptionsForSchematic = getDefaultOptionsForSchematic;
20
45
  //# sourceMappingURL=collection.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"collection.js","sourceRoot":"","sources":["../../../src/utility/collection.ts"],"names":[],"mappings":";;;AAEA;;;;;;GAMG;AACH,SAAgB,4BAA4B,CAAC,SAA0B,EAAE,UAAkB;IACzF,SAAS,CAAC,GAAG,KAAK,EAAE,CAAC;IACrB,SAAS,CAAC,GAAG,CAAC,oBAAoB,KAAK,CAAC,qBAAqB,CAAC,CAAC;IAC/D,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,oBAAoB,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;QAC5D,SAAS,CAAC,GAAG,CAAC,oBAAoB,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;KACxD;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAPD,oEAOC"}
1
+ {"version":3,"file":"collection.js","sourceRoot":"","sources":["../../../src/utility/collection.ts"],"names":[],"mappings":";;;AAEA;;;;;;GAMG;AACH,SAAgB,4BAA4B,CAAC,SAA0B,EAAE,UAAkB;IACzF,SAAS,CAAC,GAAG,KAAK,EAAE,CAAC;IACrB,SAAS,CAAC,GAAG,CAAC,oBAAoB,KAAK,CAAC,qBAAqB,CAAC,CAAC;IAC/D,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,oBAAoB,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;QAC5D,SAAS,CAAC,GAAG,CAAC,oBAAoB,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;KACxD;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAPD,oEAOC;AAED;;;;;;;;;GASG;AACH,SAAgB,6BAA6B,CAAC,SAAiC,EAAE,UAAkB,EAAE,aAAqB,EAAE,OAA0C;IACpK,IAAI,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