@o3r/apis-manager 13.0.0-prerelease.3 → 13.0.0-prerelease.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@o3r/apis-manager",
3
- "version": "13.0.0-prerelease.3",
3
+ "version": "13.0.0-prerelease.4",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -11,12 +11,12 @@
11
11
  "otter-module"
12
12
  ],
13
13
  "peerDependencies": {
14
- "@ama-sdk/client-fetch": "^13.0.0-prerelease.3",
15
- "@ama-sdk/core": "^13.0.0-prerelease.3",
14
+ "@ama-sdk/client-fetch": "^13.0.0-prerelease.4",
15
+ "@ama-sdk/core": "^13.0.0-prerelease.4",
16
16
  "@angular-devkit/schematics": "^20.0.0",
17
17
  "@angular/common": "^20.0.0",
18
18
  "@angular/core": "^20.0.0",
19
- "@o3r/schematics": "^13.0.0-prerelease.3",
19
+ "@o3r/schematics": "^13.0.0-prerelease.4",
20
20
  "@schematics/angular": "^20.0.0",
21
21
  "rxjs": "^7.8.1",
22
22
  "ts-node": "~10.9.2",
@@ -41,7 +41,7 @@
41
41
  }
42
42
  },
43
43
  "dependencies": {
44
- "@o3r/schematics": "^13.0.0-prerelease.3",
44
+ "@o3r/schematics": "^13.0.0-prerelease.4",
45
45
  "tslib": "^2.6.2"
46
46
  },
47
47
  "schematics": "./collection.json",
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,IAAI,EACV,MAAM,4BAA4B,CAAC;AAcpC,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,UAAU,CAAC;AAwElB;;;GAGG;AACH,eAAO,MAAM,KAAK,GAAI,SAAS,qBAAqB,SAA2C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,IAAI,EACV,MAAM,4BAA4B,CAAC;AAUpC,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,UAAU,CAAC;AAwClB;;;GAGG;AACH,eAAO,MAAM,KAAK,GAAI,SAAS,qBAAqB,SAA2C,CAAC"}
@@ -4,6 +4,7 @@ exports.ngAdd = void 0;
4
4
  const path = require("node:path");
5
5
  const schematics_1 = require("@angular-devkit/schematics");
6
6
  const schematics_2 = require("@o3r/schematics");
7
+ const update_api_deps_1 = require("../helpers/update-api-deps");
7
8
  /**
8
9
  * List of external dependencies to be added to the project as peer dependencies
9
10
  */
@@ -21,48 +22,21 @@ const devDependenciesToInstall = [];
21
22
  * @param options
22
23
  */
23
24
  function ngAddFn(options) {
24
- return async (tree, context) => {
25
- const { updateApiDependencies } = await Promise.resolve().then(() => require('../helpers/update-api-deps'));
26
- const packageJsonPath = path.resolve(__dirname, '..', '..', 'package.json');
27
- const depsInfo = (0, schematics_2.getO3rPeerDeps)(packageJsonPath);
28
- const rulesToExecute = [];
29
- const workspaceProject = options.projectName ? (0, schematics_2.getWorkspaceConfig)(tree)?.projects[options.projectName] : undefined;
30
- const projectType = workspaceProject?.projectType || 'application';
31
- if (projectType === 'application') {
32
- rulesToExecute.push(updateApiDependencies(options));
33
- }
34
- if (!options.skipCodeSample) {
35
- depsInfo.o3rPeerDeps.push('@ama-sdk/client-fetch');
36
- }
37
- const projectDirectory = workspaceProject?.root || '.';
38
- const projectPackageJson = tree.readJson(path.posix.join(projectDirectory, 'package.json'));
39
- const externalDependenciesInfo = (0, schematics_2.getExternalDependenciesInfo)({
40
- dependenciesToInstall,
41
- devDependenciesToInstall,
42
- projectType: workspaceProject?.projectType,
43
- o3rPackageJsonPath: packageJsonPath,
44
- projectPackageJson
45
- }, context.logger);
46
- const dependencies = depsInfo.o3rPeerDeps.reduce((acc, dep) => {
47
- acc[dep] = {
48
- inManifest: [{
49
- range: `${options.exactO3rVersion ? '' : '~'}${depsInfo.packageVersion}`,
50
- types: (0, schematics_2.getProjectNewDependenciesTypes)(workspaceProject)
51
- }],
52
- ngAddOptions: { exactO3rVersion: options.exactO3rVersion }
53
- };
54
- return acc;
55
- }, (0, schematics_2.getPackageInstallConfig)(packageJsonPath, tree, options.projectName, false, !!options.exactO3rVersion));
56
- return () => (0, schematics_1.chain)([
57
- ...rulesToExecute,
58
- options.skipLinter ? schematics_1.noop : (0, schematics_2.applyEsLintFix)(),
59
- (0, schematics_2.setupDependencies)({
60
- projectName: options.projectName,
61
- dependencies: { ...dependencies, ...externalDependenciesInfo },
62
- ngAddToRun: depsInfo.o3rPeerDeps
63
- })
64
- ]);
65
- };
25
+ const packageJsonPath = path.resolve(__dirname, '..', '..', 'package.json');
26
+ return (0, schematics_1.chain)([
27
+ (tree) => {
28
+ const workspaceProject = options.projectName ? (0, schematics_2.getWorkspaceConfig)(tree)?.projects[options.projectName] : undefined;
29
+ const projectType = workspaceProject?.projectType || 'application';
30
+ if (projectType === 'application') {
31
+ return (0, update_api_deps_1.updateApiDependencies)(options);
32
+ }
33
+ },
34
+ options.skipLinter ? schematics_1.noop : (0, schematics_2.applyEsLintFix)(),
35
+ (0, schematics_2.ngAddDependenciesRule)(options, packageJsonPath, {
36
+ dependenciesToInstall: dependenciesToInstall.concat(options.skipCodeSample ? [] : ['@ama-sdk/client-fetch']),
37
+ devDependenciesToInstall
38
+ })
39
+ ]);
66
40
  }
67
41
  /**
68
42
  * Add Otter apis manager to an Angular Project
@@ -1,13 +1,7 @@
1
- import type { SchematicOptionObject } from '@o3r/schematics';
2
- export interface NgAddSchematicsSchema extends SchematicOptionObject {
3
- /** Project name */
4
- projectName?: string | undefined;
1
+ import type { NgAddOptions, SchematicOptionObject } from '@o3r/schematics';
2
+ export interface NgAddSchematicsSchema extends NgAddOptions, SchematicOptionObject {
5
3
  /** Skip the linter process which includes the run of EsLint and EditorConfig rules */
6
4
  skipLinter: boolean;
7
- /** Skip the install process */
8
- skipInstall: boolean;
9
- /** Use a pinned version for otter packages */
10
- exactO3rVersion?: boolean;
11
5
  /**
12
6
  * Skip the code sample generated in application to register the ApiManager
13
7
  * If `false`, a dependency to @ama-sdk/client-fetch will be added
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,qBAAsB,SAAQ,qBAAqB;IAClE,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjC,sFAAsF;IACtF,UAAU,EAAE,OAAO,CAAC;IAEpB,+BAA+B;IAC/B,WAAW,EAAE,OAAO,CAAC;IAErB,8CAA8C;IAC9C,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,qBAAsB,SAAQ,YAAY,EAAE,qBAAqB;IAChF,sFAAsF;IACtF,UAAU,EAAE,OAAO,CAAC;IAEpB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B"}