@o3r/rules-engine 12.3.0-prerelease.48 → 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 +6 -5
- package/schematics/ng-add/helpers/devtools-registration.d.ts +1 -2
- package/schematics/ng-add/helpers/devtools-registration.d.ts.map +1 -1
- package/schematics/ng-add/helpers/devtools-registration.js +4 -4
- package/schematics/ng-add/index.d.ts.map +1 -1
- package/schematics/ng-add/index.js +17 -27
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@o3r/rules-engine",
|
|
3
|
-
"version": "12.3.0-prerelease.
|
|
3
|
+
"version": "12.3.0-prerelease.49",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -48,10 +48,10 @@
|
|
|
48
48
|
"@ngrx/entity": "^19.0.0",
|
|
49
49
|
"@ngrx/store": "^19.0.0",
|
|
50
50
|
"@ngx-translate/core": "~16.0.4",
|
|
51
|
-
"@o3r/core": "^12.3.0-prerelease.
|
|
52
|
-
"@o3r/extractors": "^12.3.0-prerelease.
|
|
53
|
-
"@o3r/logger": "^12.3.0-prerelease.
|
|
54
|
-
"@o3r/schematics": "^12.3.0-prerelease.
|
|
51
|
+
"@o3r/core": "^12.3.0-prerelease.49",
|
|
52
|
+
"@o3r/extractors": "^12.3.0-prerelease.49",
|
|
53
|
+
"@o3r/logger": "^12.3.0-prerelease.49",
|
|
54
|
+
"@o3r/schematics": "^12.3.0-prerelease.49",
|
|
55
55
|
"@schematics/angular": "^19.0.0",
|
|
56
56
|
"globby": "^11.1.0",
|
|
57
57
|
"jasmine": "^5.0.0",
|
|
@@ -91,6 +91,7 @@
|
|
|
91
91
|
}
|
|
92
92
|
},
|
|
93
93
|
"dependencies": {
|
|
94
|
+
"@o3r/schematics": "^12.3.0-prerelease.49",
|
|
94
95
|
"tslib": "^2.6.2"
|
|
95
96
|
},
|
|
96
97
|
"engines": {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { Rule } from '@angular-devkit/schematics';
|
|
2
1
|
import type { NgAddSchematicsSchema } from '../schema';
|
|
3
2
|
/**
|
|
4
3
|
* Register Devtools to the application
|
|
5
4
|
* @param options
|
|
6
5
|
* @param options.projectName
|
|
7
6
|
*/
|
|
8
|
-
export declare const registerDevtools: (options: NgAddSchematicsSchema) =>
|
|
7
|
+
export declare const registerDevtools: (options: NgAddSchematicsSchema) => import("@angular-devkit/schematics").Rule;
|
|
9
8
|
//# sourceMappingURL=devtools-registration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devtools-registration.d.ts","sourceRoot":"","sources":["../../../../schematics/ng-add/helpers/devtools-registration.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"devtools-registration.d.ts","sourceRoot":"","sources":["../../../../schematics/ng-add/helpers/devtools-registration.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,WAAW,CAAC;AAOnB;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAAI,SAAS,qBAAqB,8CAe9D,CAAC"}
|
|
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const node_fs_1 = require("node:fs");
|
|
6
6
|
const path = tslib_1.__importStar(require("node:path"));
|
|
7
7
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
8
|
+
const schematics_2 = require("@o3r/schematics");
|
|
8
9
|
const DEVTOOL_MODULE_NAME = 'RulesEngineDevtoolsModule';
|
|
9
10
|
const MESSAGE_DEVTOOL_SERVICE_NAME = 'RulesEngineDevtoolsMessageService';
|
|
10
11
|
const CONSOLE_DEVTOOL_SERVICE_NAME = 'RulesEngineDevtoolsConsoleService';
|
|
@@ -14,16 +15,15 @@ const PACKAGE_NAME = JSON.parse((0, node_fs_1.readFileSync)(path.resolve(__dirna
|
|
|
14
15
|
* @param options
|
|
15
16
|
* @param options.projectName
|
|
16
17
|
*/
|
|
17
|
-
const registerDevtools =
|
|
18
|
-
const { registerDevtoolsToApplication } = await Promise.resolve().then(() => tslib_1.__importStar(require('@o3r/schematics')));
|
|
18
|
+
const registerDevtools = (options) => {
|
|
19
19
|
return (0, schematics_1.chain)([
|
|
20
|
-
registerDevtoolsToApplication({
|
|
20
|
+
(0, schematics_2.registerDevtoolsToApplication)({
|
|
21
21
|
moduleName: DEVTOOL_MODULE_NAME,
|
|
22
22
|
packageName: PACKAGE_NAME,
|
|
23
23
|
serviceName: MESSAGE_DEVTOOL_SERVICE_NAME,
|
|
24
24
|
projectName: options.projectName
|
|
25
25
|
}),
|
|
26
|
-
registerDevtoolsToApplication({
|
|
26
|
+
(0, schematics_2.registerDevtoolsToApplication)({
|
|
27
27
|
moduleName: DEVTOOL_MODULE_NAME,
|
|
28
28
|
packageName: PACKAGE_NAME,
|
|
29
29
|
serviceName: CONSOLE_DEVTOOL_SERVICE_NAME,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,IAAI,EACV,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,IAAI,EACV,MAAM,4BAA4B,CAAC;AA4BpC,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,UAAU,CAAC;AA2FlB;;;GAGG;AACH,eAAO,MAAM,KAAK,GAAI,SAAS,qBAAqB,SAA2C,CAAC"}
|
|
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const fs = tslib_1.__importStar(require("node:fs"));
|
|
6
6
|
const path = tslib_1.__importStar(require("node:path"));
|
|
7
7
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
8
|
+
const schematics_2 = require("@o3r/schematics");
|
|
8
9
|
const utility_1 = require("@schematics/angular/utility");
|
|
9
10
|
const ast_utils_1 = require("@schematics/angular/utility/ast-utils");
|
|
10
11
|
const ts = tslib_1.__importStar(require("typescript"));
|
|
@@ -13,15 +14,8 @@ const devtools_registration_1 = require("./helpers/devtools-registration");
|
|
|
13
14
|
const devDependenciesToInstall = [
|
|
14
15
|
'jsonpath-plus'
|
|
15
16
|
];
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
If the error is related to missing @o3r dependencies you need to install '@o3r/core' to be able to use the rules-engine package. Please run 'ng add @o3r/core' .
|
|
19
|
-
Otherwise, use the error message as guidance.`);
|
|
20
|
-
throw reason;
|
|
21
|
-
};
|
|
22
|
-
const updateAppModuleOrAppConfig = (projectName) => async (tree, context) => {
|
|
23
|
-
const { getAppModuleFilePath } = await Promise.resolve().then(() => tslib_1.__importStar(require('@o3r/schematics')));
|
|
24
|
-
const moduleFilePath = getAppModuleFilePath(tree, context, projectName);
|
|
17
|
+
const updateAppModuleOrAppConfig = (projectName) => (tree, context) => {
|
|
18
|
+
const moduleFilePath = (0, schematics_2.getAppModuleFilePath)(tree, context, projectName);
|
|
25
19
|
if (!moduleFilePath) {
|
|
26
20
|
return () => tree;
|
|
27
21
|
}
|
|
@@ -38,32 +32,31 @@ const updateAppModuleOrAppConfig = (projectName) => async (tree, context) => {
|
|
|
38
32
|
*/
|
|
39
33
|
function ngAddFn(options) {
|
|
40
34
|
/* ng add rules */
|
|
41
|
-
return
|
|
42
|
-
|
|
43
|
-
options = { ...getDefaultOptionsForSchematic(getWorkspaceConfig(tree), '@o3r/rules-engine', 'ng-add', options), ...options };
|
|
35
|
+
return (tree, context) => {
|
|
36
|
+
options = { ...(0, schematics_2.getDefaultOptionsForSchematic)((0, schematics_2.getWorkspaceConfig)(tree), '@o3r/rules-engine', 'ng-add', options), ...options };
|
|
44
37
|
const packageJsonPath = path.resolve(__dirname, '..', '..', 'package.json');
|
|
45
38
|
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, { encoding: 'utf8' }));
|
|
46
|
-
const depsInfo = getO3rPeerDeps(packageJsonPath);
|
|
39
|
+
const depsInfo = (0, schematics_2.getO3rPeerDeps)(packageJsonPath);
|
|
47
40
|
if (options.enableMetadataExtract) {
|
|
48
41
|
depsInfo.o3rPeerDeps = [...depsInfo.o3rPeerDeps, '@o3r/extractors'];
|
|
49
42
|
}
|
|
50
|
-
const workspaceProject = options.projectName ? getWorkspaceConfig(tree)?.projects[options.projectName] : undefined;
|
|
43
|
+
const workspaceProject = options.projectName ? (0, schematics_2.getWorkspaceConfig)(tree)?.projects[options.projectName] : undefined;
|
|
51
44
|
const dependencies = depsInfo.o3rPeerDeps.reduce((acc, dep) => {
|
|
52
45
|
acc[dep] = {
|
|
53
46
|
inManifest: [{
|
|
54
47
|
range: `${options.exactO3rVersion ? '' : '~'}${depsInfo.packageVersion}`,
|
|
55
|
-
types: getProjectNewDependenciesTypes(workspaceProject)
|
|
48
|
+
types: (0, schematics_2.getProjectNewDependenciesTypes)(workspaceProject)
|
|
56
49
|
}],
|
|
57
50
|
ngAddOptions: { exactO3rVersion: options.exactO3rVersion }
|
|
58
51
|
};
|
|
59
52
|
return acc;
|
|
60
|
-
}, getPackageInstallConfig(packageJsonPath, tree, options.projectName, false, !!options.exactO3rVersion));
|
|
61
|
-
Object.entries(getExternalDependenciesVersionRange(devDependenciesToInstall, packageJsonPath, context.logger))
|
|
53
|
+
}, (0, schematics_2.getPackageInstallConfig)(packageJsonPath, tree, options.projectName, false, !!options.exactO3rVersion));
|
|
54
|
+
Object.entries((0, schematics_2.getExternalDependenciesVersionRange)(devDependenciesToInstall, packageJsonPath, context.logger))
|
|
62
55
|
.forEach(([dep, range]) => {
|
|
63
56
|
dependencies[dep] = {
|
|
64
57
|
inManifest: [{
|
|
65
58
|
range,
|
|
66
|
-
types: getProjectNewDependenciesTypes(workspaceProject)
|
|
59
|
+
types: (0, schematics_2.getProjectNewDependenciesTypes)(workspaceProject)
|
|
67
60
|
}]
|
|
68
61
|
};
|
|
69
62
|
});
|
|
@@ -71,19 +64,19 @@ function ngAddFn(options) {
|
|
|
71
64
|
useRulesEngine: undefined
|
|
72
65
|
};
|
|
73
66
|
const rule = (0, schematics_1.chain)([
|
|
74
|
-
registerPackageCollectionSchematics(packageJson),
|
|
75
|
-
setupSchematicsParamsForProject({
|
|
67
|
+
(0, schematics_2.registerPackageCollectionSchematics)(packageJson),
|
|
68
|
+
(0, schematics_2.setupSchematicsParamsForProject)({
|
|
76
69
|
'@o3r/core:component': schematicsDefaultOptions,
|
|
77
70
|
'@o3r/core:component-container': schematicsDefaultOptions
|
|
78
71
|
}, options.projectName),
|
|
79
|
-
removePackages(['@otter/rules-engine', '@otter/rules-engine-core']),
|
|
80
|
-
setupDependencies({
|
|
72
|
+
(0, schematics_2.removePackages)(['@otter/rules-engine', '@otter/rules-engine-core']),
|
|
73
|
+
(0, schematics_2.setupDependencies)({
|
|
81
74
|
projectName: options.projectName,
|
|
82
75
|
dependencies,
|
|
83
76
|
ngAddToRun: depsInfo.o3rPeerDeps
|
|
84
77
|
}),
|
|
85
78
|
...(options.enableMetadataExtract ? [(0, cms_adapter_1.updateCmsAdapter)(options)] : []),
|
|
86
|
-
|
|
79
|
+
(0, devtools_registration_1.registerDevtools)(options),
|
|
87
80
|
updateAppModuleOrAppConfig(options.projectName)
|
|
88
81
|
]);
|
|
89
82
|
context.logger.info(`The package ${depsInfo.packageName} comes with a debug mechanism`);
|
|
@@ -95,9 +88,6 @@ function ngAddFn(options) {
|
|
|
95
88
|
* Add Otter rules-engine to an Angular Project
|
|
96
89
|
* @param options
|
|
97
90
|
*/
|
|
98
|
-
const ngAdd = (options) =>
|
|
99
|
-
const { createOtterSchematic } = await Promise.resolve().then(() => tslib_1.__importStar(require('@o3r/schematics'))).catch(reportMissingSchematicsDep(logger));
|
|
100
|
-
return createOtterSchematic(ngAddFn)(options);
|
|
101
|
-
};
|
|
91
|
+
const ngAdd = (options) => (0, schematics_2.createOtterSchematic)(ngAddFn)(options);
|
|
102
92
|
exports.ngAdd = ngAdd;
|
|
103
93
|
//# sourceMappingURL=index.js.map
|