@o3r/forms 12.2.5 → 12.2.7

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/forms",
3
- "version": "12.2.5",
3
+ "version": "12.2.7",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -11,18 +11,19 @@
11
11
  "otter-module"
12
12
  ],
13
13
  "peerDependencies": {
14
- "@ama-sdk/core": "^12.2.5",
14
+ "@ama-sdk/core": "^12.2.7",
15
15
  "@angular-devkit/schematics": "^19.0.0",
16
16
  "@angular/common": "^19.0.0",
17
17
  "@angular/core": "^19.0.0",
18
18
  "@angular/forms": "^19.0.0",
19
19
  "@ngrx/entity": "^19.0.0",
20
20
  "@ngrx/store": "^19.0.0",
21
- "@o3r/core": "^12.2.5",
22
- "@o3r/schematics": "^12.2.5",
21
+ "@o3r/core": "^12.2.7",
22
+ "@o3r/schematics": "^12.2.7",
23
23
  "@schematics/angular": "^19.0.0",
24
24
  "rxjs": "^7.8.1",
25
- "ts-node": "~10.9.2"
25
+ "ts-node": "~10.9.2",
26
+ "type-fest": "^4.30.1"
26
27
  },
27
28
  "peerDependenciesMeta": {
28
29
  "@angular-devkit/schematics": {
@@ -33,6 +34,9 @@
33
34
  },
34
35
  "@schematics/angular": {
35
36
  "optional": true
37
+ },
38
+ "type-fest": {
39
+ "optional": true
36
40
  }
37
41
  },
38
42
  "dependencies": {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,IAAI,EACL,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,UAAU,CAAC;AAyBlB;;;GAGG;AACH,eAAO,MAAM,KAAK,GAAI,SAAS,qBAAqB,KAAG,IAKtD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,IAAI,EACL,MAAM,4BAA4B,CAAC;AAIpC,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,UAAU,CAAC;AAyDlB;;;GAGG;AACH,eAAO,MAAM,KAAK,GAAI,SAAS,qBAAqB,KAAG,IAKtD,CAAC"}
@@ -2,6 +2,21 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ngAdd = void 0;
4
4
  const path = require("node:path");
5
+ /**
6
+ * List of external dependencies to be added to the project as peer dependencies
7
+ */
8
+ const dependenciesToInstall = [
9
+ '@angular/common',
10
+ '@angular/core',
11
+ '@angular/forms',
12
+ '@ngrx/entity',
13
+ '@ngrx/store',
14
+ 'rxjs'
15
+ ];
16
+ /**
17
+ * List of external dependencies to be added to the project as dev dependencies
18
+ */
19
+ const devDependenciesToInstall = [];
5
20
  const packageJsonPath = path.resolve(__dirname, '..', '..', 'package.json');
6
21
  const reportMissingSchematicsDep = (logger) => (reason) => {
7
22
  logger.error(`[ERROR]: Adding @o3r/form has failed.
@@ -14,11 +29,24 @@ You need to install '@o3r/core' package to be able to use the form package. Plea
14
29
  */
15
30
  function ngAddFn(options) {
16
31
  /* ng add rules */
17
- return async (tree) => {
18
- const { getPackageInstallConfig, setupDependencies } = await Promise.resolve().then(() => require('@o3r/schematics'));
32
+ return async (tree, context) => {
33
+ const { getExternalDependenciesInfo, getPackageInstallConfig, getWorkspaceConfig, setupDependencies } = await Promise.resolve().then(() => require('@o3r/schematics'));
34
+ const workspaceProject = options.projectName ? getWorkspaceConfig(tree)?.projects[options.projectName] : undefined;
35
+ const projectDirectory = workspaceProject?.root || '.';
36
+ const projectPackageJson = tree.readJson(path.posix.join(projectDirectory, 'package.json'));
37
+ const externalDependenciesInfo = getExternalDependenciesInfo({
38
+ devDependenciesToInstall,
39
+ dependenciesToInstall,
40
+ o3rPackageJsonPath: packageJsonPath,
41
+ projectPackageJson,
42
+ projectType: workspaceProject?.projectType
43
+ }, context.logger);
19
44
  return setupDependencies({
20
45
  projectName: options.projectName,
21
- dependencies: getPackageInstallConfig(packageJsonPath, tree, options.projectName, false, !!options.exactO3rVersion)
46
+ dependencies: {
47
+ ...getPackageInstallConfig(packageJsonPath, tree, options.projectName, false, !!options.exactO3rVersion),
48
+ ...externalDependenciesInfo
49
+ }
22
50
  });
23
51
  };
24
52
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":";;;AAAA,kCAAkC;AAQlC,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;AAE5E,MAAM,0BAA0B,GAAG,CAAC,MAA2C,EAAE,EAAE,CAAC,CAAC,MAAW,EAAE,EAAE;IAClG,MAAM,CAAC,KAAK,CAAC;2GAC4F,CAAC,CAAC;IAC3G,MAAM,MAAM,CAAC;AACf,CAAC,CAAC;AAEF;;;GAGG;AACH,SAAS,OAAO,CAAC,OAA8B;IAC7C,kBAAkB;IAClB,OAAO,KAAK,EAAE,IAAI,EAAE,EAAE;QACpB,MAAM,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,GAAG,2CAAa,iBAAiB,EAAC,CAAC;QACvF,OAAO,iBAAiB,CAAC;YACvB,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,YAAY,EAAE,uBAAuB,CAAC,eAAe,EAAE,IAAI,EAAE,OAAO,CAAC,WAAW,EAAE,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC;SACpH,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAED;;;GAGG;AACI,MAAM,KAAK,GAAG,CAAC,OAA8B,EAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;IACrF,MAAM,EACJ,oBAAoB,EACr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