@o3r/core 12.3.0-prerelease.47 → 12.3.0-prerelease.49

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/core",
3
- "version": "12.3.0-prerelease.47",
3
+ "version": "12.3.0-prerelease.49",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -39,7 +39,7 @@
39
39
  "@ngrx/entity": "^19.0.0",
40
40
  "@ngrx/store": "^19.0.0",
41
41
  "@nx/angular": "~20.8.0",
42
- "@o3r/telemetry": "^12.3.0-prerelease.47",
42
+ "@o3r/telemetry": "^12.3.0-prerelease.49",
43
43
  "@schematics/angular": "^19.0.0",
44
44
  "chokidar": "^4.0.3",
45
45
  "globby": "^11.1.0",
@@ -78,7 +78,7 @@
78
78
  }
79
79
  },
80
80
  "dependencies": {
81
- "@o3r/schematics": "^12.3.0-prerelease.47",
81
+ "@o3r/schematics": "^12.3.0-prerelease.49",
82
82
  "tslib": "^2.6.2",
83
83
  "uuid": "^11.0.5"
84
84
  },
@@ -91,14 +91,14 @@
91
91
  "@ngrx/store": "~19.1.0",
92
92
  "@ngrx/store-devtools": "~19.1.0",
93
93
  "@nx/eslint-plugin": "~20.8.0",
94
- "@o3r/store-sync": "^12.3.0-prerelease.47",
94
+ "@o3r/store-sync": "^12.3.0-prerelease.49",
95
95
  "@stylistic/eslint-plugin": "~3.1.0",
96
96
  "@types/jest": "~29.5.2",
97
97
  "@typescript-eslint/eslint-plugin": "~8.30.0",
98
98
  "@typescript-eslint/parser": "~8.30.0",
99
99
  "angular-eslint": "~19.3.0",
100
100
  "cpy-cli": "^5.0.0",
101
- "eslint": "~9.24.0",
101
+ "eslint": "~9.25.0",
102
102
  "eslint-import-resolver-node": "~0.3.9",
103
103
  "eslint-import-resolver-typescript": "~3.10.0",
104
104
  "eslint-plugin-import": "~2.31.0",
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/ng-add/component-decorator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EAEL,MAAM,4BAA4B,CAAC;AA6BpC;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAE,IA8DvC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/ng-add/component-decorator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACL,MAAM,4BAA4B,CAAC;AAgCpC;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAE,IA6DvC,CAAC"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.updateComponentDecorators = void 0;
4
+ const schematics_1 = require("@o3r/schematics");
4
5
  const ast_utils_1 = require("@schematics/angular/utility/ast-utils");
5
6
  const change_1 = require("@schematics/angular/utility/change");
6
7
  const ts = require("typescript");
@@ -17,9 +18,8 @@ const removeImport = (source, symbolName, fileName) => {
17
18
  * Update component file with new decorators for otter devtools
18
19
  * @param tree Tree
19
20
  */
20
- const updateComponentDecorators = async (tree) => {
21
- const { getFilesInFolderFromWorkspaceProjectsInTree } = await Promise.resolve().then(() => require('@o3r/schematics'));
22
- const componentFiles = new Set(getFilesInFolderFromWorkspaceProjectsInTree(tree, '', 'component.ts'));
21
+ const updateComponentDecorators = (tree) => {
22
+ const componentFiles = new Set((0, schematics_1.getFilesInFolderFromWorkspaceProjectsInTree)(tree, '', 'component.ts'));
23
23
  componentFiles.forEach((filePath) => {
24
24
  const source = ts.createSourceFile(filePath, tree.readText(filePath), ts.ScriptTarget.ES2015, true);
25
25
  const recorder = tree.beginUpdate(filePath);
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add-create/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAOL,IAAI,EAKL,MAAM,4BAA4B,CAAC;AAuEpC;;;GAGG;AACH,eAAO,MAAM,eAAe,wBAA0C,CAAC;AAYvE;;;GAGG;AACH,eAAO,MAAM,WAAW,wBAAsC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add-create/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAOL,IAAI,EAKL,MAAM,4BAA4B,CAAC;AAwEpC;;;GAGG;AACH,eAAO,MAAM,eAAe,wBAA0C,CAAC;AAYvE;;;GAGG;AACH,eAAO,MAAM,WAAW,wBAAsC,CAAC"}
@@ -40,8 +40,9 @@ function updateTemplatesFn(options) {
40
40
  packageJson.peerDependenciesMeta['@o3r/schematics'] = { optional: true };
41
41
  packageJson.devDependencies['@angular-devkit/schematics'] = angularVersion;
42
42
  packageJson.devDependencies['@angular-devkit/core'] = angularVersion;
43
- packageJson.devDependencies['@o3r/schematics'] = otterVersion;
44
43
  packageJson.devDependencies['cpy-cli'] = o3rCorePackageJson.generatorDependencies['cpy-cli'];
44
+ packageJson.dependencies ||= {};
45
+ packageJson.dependencies['@o3r/schematics'] = otterVersion;
45
46
  tree.overwrite(packageJsonPath, JSON.stringify(packageJson, null, 2));
46
47
  }
47
48
  // generate skeleton
@@ -2,6 +2,14 @@ import { chain, noop, Rule } from '@angular-devkit/schematics';
2
2
  import type { NgAddSchematicsSchema } from './schema';
3
3
  import * as fs from 'node:fs';
4
4
  import * as path from 'node:path';
5
+ import {
6
+ createOtterSchematic,
7
+ getProjectNewDependenciesTypes,
8
+ getPackageInstallConfig,
9
+ applyEsLintFix,
10
+ getWorkspaceConfig,
11
+ setupDependencies,
12
+ } from '@o3r/schematics';
5
13
 
6
14
  const packageJsonPath = path.resolve(__dirname, '..', '..', 'package.json');
7
15
 
@@ -18,13 +26,6 @@ const dependenciesToNgAdd: string[] = [
18
26
  // Add the dependencies to install with NgAdd here
19
27
  ];
20
28
 
21
- const reportMissingSchematicsDep = (logger: { error: (message: string) => any }) => (reason: any) => {
22
- logger.error(`[ERROR]: Adding <%= featureName %> has failed.
23
- If the error is related to missing @o3r dependencies you need to install '@o3r/core' to be able to use the <%= featureName %> package. Please run 'ng add @o3r/core' .
24
- Otherwise, use the error message as guidance.`);
25
- throw reason;
26
- };
27
-
28
29
  /**
29
30
  * Add Otter <%= featureName %> to an Otter Project
30
31
  *
@@ -32,8 +33,6 @@ Otherwise, use the error message as guidance.`);
32
33
  */
33
34
  function ngAddFn(options: NgAddSchematicsSchema): Rule {
34
35
  return async (tree) => {
35
- // use dynamic import to properly raise an exception if it is not an Otter project.
36
- const { getProjectNewDependenciesTypes, getPackageInstallConfig, applyEsLintFix, getWorkspaceConfig, setupDependencies } = await import('@o3r/schematics');
37
36
  // current package version
38
37
  const version = JSON.parse(fs.readFileSync(packageJsonPath, {encoding: 'utf8'})).version;
39
38
  const workspaceProject = options.projectName ? getWorkspaceConfig(tree)?.projects[options.projectName] : undefined;
@@ -64,9 +63,4 @@ function ngAddFn(options: NgAddSchematicsSchema): Rule {
64
63
  * Add module to an Angular Project
65
64
  * @param options ng add options
66
65
  */
67
- export const ngAdd = (options: NgAddSchematicsSchema): Rule => async (_, { logger }) => {
68
- const {
69
- createOtterSchematic
70
- } = await import('@o3r/schematics').catch(reportMissingSchematicsDep(logger));
71
- return createOtterSchematic(ngAddFn)(options);
72
- };
66
+ export const ngAdd = (options: NgAddSchematicsSchema) => createOtterSchematic(ngAddFn)(options);