@o3r/schematics 12.1.0-prerelease.15 → 12.1.0-prerelease.16

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@o3r/schematics",
3
- "version": "12.1.0-prerelease.15",
3
+ "version": "12.1.0-prerelease.16",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -30,8 +30,8 @@
30
30
  "@angular-devkit/core": "^19.0.0",
31
31
  "@angular-devkit/schematics": "^19.0.0",
32
32
  "@angular/cli": "^19.0.0",
33
- "@o3r/core": "^12.1.0-prerelease.15",
34
- "@o3r/telemetry": "^12.1.0-prerelease.15",
33
+ "@o3r/core": "^12.1.0-prerelease.16",
34
+ "@o3r/telemetry": "^12.1.0-prerelease.16",
35
35
  "@schematics/angular": "^19.0.0",
36
36
  "eslint": "^9.14.0",
37
37
  "rxjs": "^7.8.1",
@@ -93,9 +93,9 @@
93
93
  "@nx/eslint-plugin": "~20.2.0",
94
94
  "@nx/jest": "~20.2.0",
95
95
  "@nx/js": "~20.2.0",
96
- "@o3r/build-helpers": "^12.1.0-prerelease.15",
97
- "@o3r/eslint-plugin": "^12.1.0-prerelease.15",
98
- "@o3r/telemetry": "^12.1.0-prerelease.15",
96
+ "@o3r/build-helpers": "^12.1.0-prerelease.16",
97
+ "@o3r/eslint-plugin": "^12.1.0-prerelease.16",
98
+ "@o3r/telemetry": "^12.1.0-prerelease.16",
99
99
  "@schematics/angular": "~19.0.0",
100
100
  "@stylistic/eslint-plugin": "~3.0.0",
101
101
  "@swc/helpers": "~0.5.0",
@@ -4,6 +4,7 @@ export * from './dev-tools/index';
4
4
  export * from './eslint-fix/index';
5
5
  export * from './get-test-frameworks/index';
6
6
  export * from './ng-add/index';
7
+ export * from './options/index';
7
8
  export * from './remove-packages/index';
8
9
  export * from './update-imports/index';
9
10
  export * from './vscode-extensions/index';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/rule-factories/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/rule-factories/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC"}
@@ -7,6 +7,7 @@ tslib_1.__exportStar(require("./dev-tools/index"), exports);
7
7
  tslib_1.__exportStar(require("./eslint-fix/index"), exports);
8
8
  tslib_1.__exportStar(require("./get-test-frameworks/index"), exports);
9
9
  tslib_1.__exportStar(require("./ng-add/index"), exports);
10
+ tslib_1.__exportStar(require("./options/index"), exports);
10
11
  tslib_1.__exportStar(require("./remove-packages/index"), exports);
11
12
  tslib_1.__exportStar(require("./update-imports/index"), exports);
12
13
  tslib_1.__exportStar(require("./vscode-extensions/index"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rule-factories/index.ts"],"names":[],"mappings":";;;AAAA,8DAAoC;AACpC,uEAA6C;AAC7C,4DAAkC;AAClC,6DAAmC;AACnC,sEAA4C;AAC5C,yDAA+B;AAC/B,kEAAwC;AACxC,iEAAuC;AACvC,oEAA0C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rule-factories/index.ts"],"names":[],"mappings":";;;AAAA,8DAAoC;AACpC,uEAA6C;AAC7C,4DAAkC;AAClC,6DAAmC;AACnC,sEAA4C;AAC5C,yDAA+B;AAC/B,0DAAgC;AAChC,kEAAwC;AACxC,iEAAuC;AACvC,oEAA0C"}
@@ -0,0 +1,13 @@
1
+ import type { Rule } from '@angular-devkit/schematics';
2
+ /**
3
+ * Factory of the schematic to wrap
4
+ * @param options Options of the factory
5
+ */
6
+ type SchematicWrapperFn<S extends Record<string, any>> = (options: S) => Rule;
7
+ /**
8
+ * Wrapper method of a schematic to retrieve options from workspace and merge it with the one from the run of the schematic
9
+ * @param schematicFn
10
+ */
11
+ export declare function createSchematicWithOptionsFromWorkspace<S extends Record<string, any>>(schematicFn: SchematicWrapperFn<S>): SchematicWrapperFn<S>;
12
+ export {};
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/rule-factories/options/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EACL,MAAM,4BAA4B,CAAC;AAMpC;;;GAGG;AACH,KAAK,kBAAkB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,IAAI,CAAC;AAE9E;;;GAGG;AACH,wBAAgB,uCAAuC,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,WAAW,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAqBhJ"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createSchematicWithOptionsFromWorkspace = createSchematicWithOptionsFromWorkspace;
4
+ const utility_1 = require("../../utility");
5
+ /**
6
+ * Wrapper method of a schematic to retrieve options from workspace and merge it with the one from the run of the schematic
7
+ * @param schematicFn
8
+ */
9
+ function createSchematicWithOptionsFromWorkspace(schematicFn) {
10
+ return (options) => (tree, context) => {
11
+ const workspace = (0, utility_1.getWorkspaceConfig)(tree);
12
+ const workspaceOptions = (0, utility_1.getDefaultOptionsForSchematic)(workspace, context.schematic.description.collection.name, context.schematic.description.name, { projectName: undefined, ...options });
13
+ const schematicOptionsWithoutUndefined = Object.entries(options).reduce((acc, [key, value]) => {
14
+ if (typeof value !== 'undefined') {
15
+ acc[key] = value;
16
+ }
17
+ return acc;
18
+ }, {});
19
+ const schematicOptions = {
20
+ ...workspaceOptions,
21
+ ...schematicOptionsWithoutUndefined
22
+ };
23
+ return schematicFn(schematicOptions);
24
+ };
25
+ }
26
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/rule-factories/options/index.ts"],"names":[],"mappings":";;AAkBA,0FAqBC;AApCD,2CAGuB;AAQvB;;;GAGG;AACH,SAAgB,uCAAuC,CAAgC,WAAkC;IACvH,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE;QACpC,MAAM,SAAS,GAAG,IAAA,4BAAkB,EAAC,IAAI,CAAC,CAAC;QAC3C,MAAM,gBAAgB,GAAG,IAAA,uCAA6B,EACpD,SAAS,EACT,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,UAAU,CAAC,IAAI,EAC7C,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,EAClC,EAAE,WAAW,EAAE,SAAS,EAAE,GAAG,OAAO,EAAE,CACvC,CAAC;QACF,MAAM,gCAAgC,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,GAAwB,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;YACjH,IAAI,OAAO,KAAK,KAAK,WAAW,EAAE,CAAC;gBACjC,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;YACnB,CAAC;YACD,OAAO,GAAG,CAAC;QACb,CAAC,EAAE,EAAE,CAAM,CAAC;QACZ,MAAM,gBAAgB,GAAG;YACvB,GAAG,gBAAgB;YACnB,GAAG,gCAAgC;SACpC,CAAC;QACF,OAAO,WAAW,CAAC,gBAA4B,CAAC,CAAC;IACnD,CAAC,CAAC;AACJ,CAAC"}