@o3r/mobile 10.2.0-prerelease.14 → 10.2.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/mobile",
3
- "version": "10.2.0-prerelease.14",
3
+ "version": "10.2.0-prerelease.16",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -43,10 +43,10 @@
43
43
  "@capacitor/device": "^5.0.0",
44
44
  "@capacitor/preferences": "^5.0.0",
45
45
  "@ngrx/store": "~17.1.0",
46
- "@o3r/core": "^10.2.0-prerelease.14",
47
- "@o3r/logger": "^10.2.0-prerelease.14",
48
- "@o3r/schematics": "^10.2.0-prerelease.14",
49
- "@o3r/store-sync": "^10.2.0-prerelease.14",
46
+ "@o3r/core": "^10.2.0-prerelease.16",
47
+ "@o3r/logger": "^10.2.0-prerelease.16",
48
+ "@o3r/schematics": "^10.2.0-prerelease.16",
49
+ "@o3r/store-sync": "^10.2.0-prerelease.16",
50
50
  "@schematics/angular": "~17.2.0",
51
51
  "fast-deep-equal": "^3.1.3",
52
52
  "rxjs": "^7.8.1"
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,IAAI,EAA0B,MAAM,4BAA4B,CAAC;AAGjF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AA4CtD;;;GAGG;AACH,eAAO,MAAM,KAAK,0CAAiD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAEzD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AA0CtD;;;GAGG;AACH,eAAO,MAAM,KAAK,YAAa,qBAAqB,KAAG,IAGtD,CAAC"}
@@ -2,51 +2,51 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ngAdd = void 0;
4
4
  const schematics_1 = require("@angular-devkit/schematics");
5
- const schematics_2 = require("@o3r/schematics");
6
5
  const path = require("node:path");
7
6
  const packageJsonPath = path.resolve(__dirname, '..', '..', 'package.json');
7
+ const reportMissingSchematicsDep = (logger) => (reason) => {
8
+ logger.error(`[ERROR]: Adding @o3r/mobile has failed.
9
+ If the error is related to missing @o3r dependencies you need to install '@o3r/core' to be able to use the mobile package. Please run 'ng add @o3r/core' .
10
+ Otherwise, use the error message as guidance.`);
11
+ throw reason;
12
+ };
8
13
  /**
9
14
  * Add Otter mobile to an Angular Project
10
15
  * @param options ng add options
11
16
  */
12
17
  function ngAddFn(options) {
13
18
  /* ng add rules */
14
- return async (tree, context) => {
15
- try {
16
- const { getPackageInstallConfig, getProjectNewDependenciesTypes, setupDependencies, getO3rPeerDeps, getWorkspaceConfig, removePackages } = await Promise.resolve().then(() => require('@o3r/schematics'));
17
- const depsInfo = getO3rPeerDeps(path.resolve(__dirname, '..', '..', 'package.json'));
18
- const workspaceProject = options.projectName ? getWorkspaceConfig(tree)?.projects[options.projectName] : undefined;
19
- const dependencies = depsInfo.o3rPeerDeps.reduce((acc, dep) => {
20
- acc[dep] = {
21
- inManifest: [{
22
- range: `${options.exactO3rVersion ? '' : '~'}${depsInfo.packageVersion}`,
23
- types: getProjectNewDependenciesTypes(workspaceProject)
24
- }],
25
- ngAddOptions: { exactO3rVersion: options.exactO3rVersion }
26
- };
27
- return acc;
28
- }, getPackageInstallConfig(packageJsonPath, tree, options.projectName, false, !!options.exactO3rVersion));
29
- return () => (0, schematics_1.chain)([
30
- removePackages(['@otter/mobile']),
31
- setupDependencies({
32
- projectName: options.projectName,
33
- dependencies,
34
- ngAddToRun: depsInfo.o3rPeerDeps
35
- })
36
- ])(tree, context);
37
- }
38
- catch (e) {
39
- // o3r mobile needs o3r/core as peer dep. o3r/core will install o3r/schematics
40
- context.logger.error(`[ERROR]: Adding @o3r/mobile has failed.
41
- If the error is related to missing @o3r dependencies you need to install '@o3r/core' to be able to use the mobile package. Please run 'ng add @o3r/core' .
42
- Otherwise, use the error message as guidance.`);
43
- throw (e);
44
- }
19
+ return async (tree) => {
20
+ const { getPackageInstallConfig, getProjectNewDependenciesTypes, setupDependencies, getO3rPeerDeps, getWorkspaceConfig, removePackages } = await Promise.resolve().then(() => require('@o3r/schematics'));
21
+ const depsInfo = getO3rPeerDeps(path.resolve(__dirname, '..', '..', 'package.json'));
22
+ const workspaceProject = options.projectName ? getWorkspaceConfig(tree)?.projects[options.projectName] : undefined;
23
+ const dependencies = depsInfo.o3rPeerDeps.reduce((acc, dep) => {
24
+ acc[dep] = {
25
+ inManifest: [{
26
+ range: `${options.exactO3rVersion ? '' : '~'}${depsInfo.packageVersion}`,
27
+ types: getProjectNewDependenciesTypes(workspaceProject)
28
+ }],
29
+ ngAddOptions: { exactO3rVersion: options.exactO3rVersion }
30
+ };
31
+ return acc;
32
+ }, getPackageInstallConfig(packageJsonPath, tree, options.projectName, false, !!options.exactO3rVersion));
33
+ return (0, schematics_1.chain)([
34
+ removePackages(['@otter/mobile']),
35
+ setupDependencies({
36
+ projectName: options.projectName,
37
+ dependencies,
38
+ ngAddToRun: depsInfo.o3rPeerDeps
39
+ })
40
+ ]);
45
41
  };
46
42
  }
47
43
  /**
48
44
  * Add Otter mobile to an Angular Project
49
45
  * @param options ng add options
50
46
  */
51
- exports.ngAdd = (0, schematics_2.createSchematicWithMetricsIfInstalled)(ngAddFn);
47
+ const ngAdd = (options) => async (_, { logger }) => {
48
+ const { createSchematicWithMetricsIfInstalled } = await Promise.resolve().then(() => require('@o3r/schematics')).catch(reportMissingSchematicsDep(logger));
49
+ return createSchematicWithMetricsIfInstalled(ngAddFn)(options);
50
+ };
51
+ exports.ngAdd = ngAdd;
52
52
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3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