@o3r/configuration 10.2.0-prerelease.13 → 10.2.0-prerelease.15
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/configuration",
|
|
3
|
-
"version": "10.2.0-prerelease.
|
|
3
|
+
"version": "10.2.0-prerelease.15",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -51,10 +51,10 @@
|
|
|
51
51
|
"@angular/platform-browser-dynamic": "~17.2.0",
|
|
52
52
|
"@ngrx/entity": "~17.1.0",
|
|
53
53
|
"@ngrx/store": "~17.1.0",
|
|
54
|
-
"@o3r/core": "^10.2.0-prerelease.
|
|
55
|
-
"@o3r/logger": "^10.2.0-prerelease.
|
|
56
|
-
"@o3r/schematics": "^10.2.0-prerelease.
|
|
57
|
-
"@o3r/testing": "^10.2.0-prerelease.
|
|
54
|
+
"@o3r/core": "^10.2.0-prerelease.15",
|
|
55
|
+
"@o3r/logger": "^10.2.0-prerelease.15",
|
|
56
|
+
"@o3r/schematics": "^10.2.0-prerelease.15",
|
|
57
|
+
"@o3r/testing": "^10.2.0-prerelease.15",
|
|
58
58
|
"@schematics/angular": "~17.2.0",
|
|
59
59
|
"cheerio": "^1.0.0-rc.10",
|
|
60
60
|
"express-interceptor": "^1.2.0",
|
|
@@ -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;
|
|
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;AAqEtD;;;GAGG;AACH,eAAO,MAAM,KAAK,YAAa,qBAAqB,KAAG,IAGtD,CAAC"}
|
|
@@ -2,11 +2,15 @@
|
|
|
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 fs = require("node:fs");
|
|
7
6
|
const path = require("node:path");
|
|
8
7
|
const devtools_registration_1 = require("./helpers/devtools-registration");
|
|
9
|
-
const
|
|
8
|
+
const reportMissingSchematicsDep = (logger) => (reason) => {
|
|
9
|
+
logger.error(`[ERROR]: Adding @o3r/configuration has failed.
|
|
10
|
+
If the error is related to missing @o3r dependencies you need to install '@o3r/core' to be able to use the configuration package. Please run 'ng add @o3r/core' .
|
|
11
|
+
Otherwise, use the error message as guidance.`);
|
|
12
|
+
throw reason;
|
|
13
|
+
};
|
|
10
14
|
/**
|
|
11
15
|
* Add Otter configuration to an Angular Project
|
|
12
16
|
* @param options The options to pass to ng-add execution
|
|
@@ -14,60 +18,55 @@ const schematics_3 = require("@o3r/schematics");
|
|
|
14
18
|
function ngAddFn(options) {
|
|
15
19
|
/* ng add rules */
|
|
16
20
|
return async (tree, context) => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
])(tree, context);
|
|
58
|
-
}
|
|
59
|
-
catch (e) {
|
|
60
|
-
// configuration needs o3r/core as peer dep. o3r/core will install o3r/schematics
|
|
61
|
-
context.logger.error(`[ERROR]: Adding @o3r/configuration has failed.
|
|
62
|
-
If the error is related to missing @o3r dependencies you need to install '@o3r/core' to be able to use the configuration package. Please run 'ng add @o3r/core' .
|
|
63
|
-
Otherwise, use the error message as guidance.`);
|
|
64
|
-
throw (e);
|
|
65
|
-
}
|
|
21
|
+
const { setupDependencies, getProjectNewDependenciesTypes, getWorkspaceConfig, getO3rPeerDeps, registerPackageCollectionSchematics, setupSchematicsDefaultParams, getPackageInstallConfig } = await Promise.resolve().then(() => require('@o3r/schematics'));
|
|
22
|
+
const packageJsonPath = path.resolve(__dirname, '..', '..', 'package.json');
|
|
23
|
+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, { encoding: 'utf-8' }));
|
|
24
|
+
const depsInfo = getO3rPeerDeps(packageJsonPath);
|
|
25
|
+
const workspaceProject = options.projectName ? getWorkspaceConfig(tree)?.projects[options.projectName] : undefined;
|
|
26
|
+
const dependencies = depsInfo.o3rPeerDeps.reduce((acc, dep) => {
|
|
27
|
+
acc[dep] = {
|
|
28
|
+
inManifest: [{
|
|
29
|
+
range: `${options.exactO3rVersion ? '' : '~'}${depsInfo.packageVersion}`,
|
|
30
|
+
types: getProjectNewDependenciesTypes(workspaceProject)
|
|
31
|
+
}],
|
|
32
|
+
ngAddOptions: { exactO3rVersion: options.exactO3rVersion }
|
|
33
|
+
};
|
|
34
|
+
return acc;
|
|
35
|
+
}, getPackageInstallConfig(packageJsonPath, tree, options.projectName, false, !!options.exactO3rVersion));
|
|
36
|
+
context.logger.info(`The package ${depsInfo.packageName} comes with a debug mechanism`);
|
|
37
|
+
context.logger.info('Get more information on the following page: https://github.com/AmadeusITGroup/otter/tree/main/docs/configuration/OVERVIEW.md#Runtime-debugging');
|
|
38
|
+
return () => (0, schematics_1.chain)([
|
|
39
|
+
registerPackageCollectionSchematics(packageJson),
|
|
40
|
+
setupSchematicsDefaultParams({
|
|
41
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
42
|
+
'@o3r/core:component': {
|
|
43
|
+
useOtterConfig: undefined
|
|
44
|
+
},
|
|
45
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
46
|
+
'@o3r/core:component-container': {
|
|
47
|
+
useOtterConfig: undefined
|
|
48
|
+
},
|
|
49
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
50
|
+
'@o3r/core:component-presenter': {
|
|
51
|
+
useOtterConfig: undefined
|
|
52
|
+
}
|
|
53
|
+
}),
|
|
54
|
+
setupDependencies({
|
|
55
|
+
projectName: options.projectName,
|
|
56
|
+
dependencies,
|
|
57
|
+
ngAddToRun: depsInfo.o3rPeerDeps
|
|
58
|
+
}),
|
|
59
|
+
() => (0, devtools_registration_1.registerDevtools)(options)
|
|
60
|
+
])(tree, context);
|
|
66
61
|
};
|
|
67
62
|
}
|
|
68
63
|
/**
|
|
69
64
|
* Add Otter configuration to an Angular Project
|
|
70
65
|
* @param options The options to pass to ng-add execution
|
|
71
66
|
*/
|
|
72
|
-
|
|
67
|
+
const ngAdd = (options) => async (_, { logger }) => {
|
|
68
|
+
const { createSchematicWithMetricsIfInstalled } = await Promise.resolve().then(() => require('@o3r/schematics')).catch(reportMissingSchematicsDep(logger));
|
|
69
|
+
return createSchematicWithMetricsIfInstalled(ngAddFn)(options);
|
|
70
|
+
};
|
|
71
|
+
exports.ngAdd = ngAdd;
|
|
73
72
|
//# sourceMappingURL=index.js.map
|