@o3r/localization 12.5.0-prerelease.2 → 12.5.0-prerelease.20
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/localization",
|
|
3
|
-
"version": "12.5.0-prerelease.
|
|
3
|
+
"version": "12.5.0-prerelease.20",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"@formatjs/intl-numberformat": "^8.0.2",
|
|
45
45
|
"@ngrx/store": "^19.0.0",
|
|
46
46
|
"@ngx-translate/core": "~16.0.4",
|
|
47
|
-
"@o3r/core": "^12.5.0-prerelease.
|
|
48
|
-
"@o3r/dynamic-content": "^12.5.0-prerelease.
|
|
49
|
-
"@o3r/extractors": "^12.5.0-prerelease.
|
|
50
|
-
"@o3r/logger": "^12.5.0-prerelease.
|
|
51
|
-
"@o3r/schematics": "^12.5.0-prerelease.
|
|
47
|
+
"@o3r/core": "^12.5.0-prerelease.20",
|
|
48
|
+
"@o3r/dynamic-content": "^12.5.0-prerelease.20",
|
|
49
|
+
"@o3r/extractors": "^12.5.0-prerelease.20",
|
|
50
|
+
"@o3r/logger": "^12.5.0-prerelease.20",
|
|
51
|
+
"@o3r/schematics": "^12.5.0-prerelease.20",
|
|
52
52
|
"@schematics/angular": "^19.0.0",
|
|
53
53
|
"@yarnpkg/cli": "^4.3.1",
|
|
54
54
|
"@yarnpkg/core": "^4.1.1",
|
|
@@ -115,12 +115,9 @@
|
|
|
115
115
|
}
|
|
116
116
|
},
|
|
117
117
|
"dependencies": {
|
|
118
|
-
"@o3r/schematics": "^12.5.0-prerelease.
|
|
118
|
+
"@o3r/schematics": "^12.5.0-prerelease.20",
|
|
119
119
|
"tslib": "^2.6.2"
|
|
120
120
|
},
|
|
121
|
-
"generatorDependencies": {
|
|
122
|
-
"@angular/cdk": "~19.2.0"
|
|
123
|
-
},
|
|
124
121
|
"engines": {
|
|
125
122
|
"node": "^20.11.1 || >=22.0.0"
|
|
126
123
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/localization-base/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/localization-base/index.ts"],"names":[],"mappings":"AACA,OAAO,EAQL,IAAI,EAKL,MAAM,4BAA4B,CAAC;AA4BpC;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;CAAE,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAqY/G;AA4CD,eAAO,MAAM,UAAU,wBAAqC,CAAC"}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.updateI18n = void 0;
|
|
4
4
|
exports.updateLocalization = updateLocalization;
|
|
5
|
-
const fs = require("node:fs");
|
|
6
5
|
const path = require("node:path");
|
|
7
6
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
8
7
|
const schematics_2 = require("@o3r/schematics");
|
|
@@ -10,8 +9,6 @@ const utility_1 = require("@schematics/angular/utility");
|
|
|
10
9
|
const ast_utils_1 = require("@schematics/angular/utility/ast-utils");
|
|
11
10
|
const change_1 = require("@schematics/angular/utility/change");
|
|
12
11
|
const ts = require("typescript");
|
|
13
|
-
const packageJsonPath = path.resolve(__dirname, '..', '..', 'package.json');
|
|
14
|
-
const ownPackageJson = JSON.parse(fs.readFileSync(packageJsonPath, { encoding: 'utf8' }));
|
|
15
12
|
/**
|
|
16
13
|
* Add Otter localization support
|
|
17
14
|
* @param options @see RuleFactory.options
|
|
@@ -301,28 +298,6 @@ function updateLocalization(options, rootPath) {
|
|
|
301
298
|
tree.commitUpdate(recorder);
|
|
302
299
|
return tree;
|
|
303
300
|
};
|
|
304
|
-
/**
|
|
305
|
-
* Add location required dependencies
|
|
306
|
-
* @param tree
|
|
307
|
-
*/
|
|
308
|
-
const addDependencies = (tree) => {
|
|
309
|
-
const workspaceProject = options.projectName ? (0, schematics_2.getWorkspaceConfig)(tree)?.projects[options.projectName] : undefined;
|
|
310
|
-
const types = (0, schematics_2.getProjectNewDependenciesTypes)(workspaceProject);
|
|
311
|
-
const generatorDependencies = ['@ngx-translate/core', 'intl-messageformat', '@formatjs/intl-numberformat', '@angular/cdk'];
|
|
312
|
-
const dependencies = generatorDependencies.reduce((acc, dep) => {
|
|
313
|
-
acc[dep] = {
|
|
314
|
-
inManifest: [{
|
|
315
|
-
range: ownPackageJson.peerDependencies[dep],
|
|
316
|
-
types
|
|
317
|
-
}]
|
|
318
|
-
};
|
|
319
|
-
return acc;
|
|
320
|
-
}, {});
|
|
321
|
-
return (0, schematics_2.setupDependencies)({
|
|
322
|
-
projectName: options.projectName || undefined,
|
|
323
|
-
dependencies
|
|
324
|
-
});
|
|
325
|
-
};
|
|
326
301
|
// Ignore generated CMS metadata
|
|
327
302
|
const ignoreDevResourcesFiles = (tree, _context) => {
|
|
328
303
|
const workingDirectory = (options.projectName && (0, schematics_2.getWorkspaceConfig)(tree)?.projects[options.projectName]?.root) || '.';
|
|
@@ -338,7 +313,6 @@ function updateLocalization(options, rootPath) {
|
|
|
338
313
|
generateLocalesFolder,
|
|
339
314
|
updateAngularJson,
|
|
340
315
|
updatePackageJson,
|
|
341
|
-
addDependencies,
|
|
342
316
|
setDefaultLanguage,
|
|
343
317
|
addMockTranslationModule,
|
|
344
318
|
ignoreDevResourcesFiles
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,IAAI,EACL,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,IAAI,EACL,MAAM,4BAA4B,CAAC;AAsBpC,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,UAAU,CAAC;AAqFlB;;;GAGG;AACH,eAAO,MAAM,KAAK,GAAI,SAAS,qBAAqB,SAA2C,CAAC"}
|
|
@@ -7,7 +7,25 @@ const schematics_1 = require("@angular-devkit/schematics");
|
|
|
7
7
|
const schematics_2 = require("@o3r/schematics");
|
|
8
8
|
const cms_adapter_1 = require("../cms-adapter");
|
|
9
9
|
const devtools_registration_1 = require("./helpers/devtools-registration");
|
|
10
|
+
/**
|
|
11
|
+
* List of external dependencies to be added to the project as peer dependencies
|
|
12
|
+
*/
|
|
10
13
|
const dependenciesToInstall = [
|
|
14
|
+
'@angular/cdk',
|
|
15
|
+
'@angular/common',
|
|
16
|
+
'@angular/core',
|
|
17
|
+
'@angular/platform-browser-dynamic',
|
|
18
|
+
'@formatjs/intl-numberformat',
|
|
19
|
+
'@ngrx/store',
|
|
20
|
+
'@ngx-translate/core',
|
|
21
|
+
'intl-messageformat',
|
|
22
|
+
'rxjs'
|
|
23
|
+
];
|
|
24
|
+
/**
|
|
25
|
+
* List of external dependencies to be added to the project as dev dependencies
|
|
26
|
+
*/
|
|
27
|
+
const devDependenciesToInstall = [
|
|
28
|
+
'@angular-devkit/core',
|
|
11
29
|
'chokidar',
|
|
12
30
|
'globby'
|
|
13
31
|
];
|
|
@@ -20,11 +38,12 @@ function ngAddFn(options) {
|
|
|
20
38
|
const { updateI18n, updateLocalization } = await Promise.resolve().then(() => require('../localization-base'));
|
|
21
39
|
const packageJsonPath = path.resolve(__dirname, '..', '..', 'package.json');
|
|
22
40
|
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, { encoding: 'utf8' }));
|
|
41
|
+
const workspaceProject = options.projectName ? (0, schematics_2.getWorkspaceConfig)(tree)?.projects[options.projectName] : undefined;
|
|
42
|
+
const projectDirectory = workspaceProject?.root || '.';
|
|
43
|
+
const projectPackageJson = tree.readJson(path.posix.join(projectDirectory, 'package.json'));
|
|
23
44
|
const depsInfo = (0, schematics_2.getO3rPeerDeps)(packageJsonPath);
|
|
24
45
|
context.logger.info(`The package ${depsInfo.packageName} comes with a debug mechanism`);
|
|
25
46
|
context.logger.info('Get information on https://github.com/AmadeusITGroup/otter/tree/main/docs/localization/LOCALIZATION.md#Debugging');
|
|
26
|
-
const { NodeDependencyType } = await Promise.resolve().then(() => require('@schematics/angular/utility/dependencies'));
|
|
27
|
-
const workspaceProject = options.projectName ? (0, schematics_2.getWorkspaceConfig)(tree)?.projects[options.projectName] : undefined;
|
|
28
47
|
const dependencies = depsInfo.o3rPeerDeps.reduce((acc, dep) => {
|
|
29
48
|
acc[dep] = {
|
|
30
49
|
inManifest: [{
|
|
@@ -35,14 +54,13 @@ function ngAddFn(options) {
|
|
|
35
54
|
};
|
|
36
55
|
return acc;
|
|
37
56
|
}, (0, schematics_2.getPackageInstallConfig)(packageJsonPath, tree, options.projectName, false, !!options.exactO3rVersion));
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
});
|
|
57
|
+
const externalDependenciesInfo = (0, schematics_2.getExternalDependenciesInfo)({
|
|
58
|
+
devDependenciesToInstall,
|
|
59
|
+
dependenciesToInstall,
|
|
60
|
+
projectType: workspaceProject?.projectType,
|
|
61
|
+
projectPackageJson,
|
|
62
|
+
o3rPackageJsonPath: packageJsonPath
|
|
63
|
+
}, context.logger);
|
|
46
64
|
const registerDevtoolRule = (0, devtools_registration_1.registerDevtools)(options);
|
|
47
65
|
return (0, schematics_1.chain)([
|
|
48
66
|
updateLocalization(options, __dirname),
|
|
@@ -50,7 +68,10 @@ function ngAddFn(options) {
|
|
|
50
68
|
options.skipLinter ? (0, schematics_1.noop)() : (0, schematics_2.applyEsLintFix)(),
|
|
51
69
|
(0, schematics_2.setupDependencies)({
|
|
52
70
|
projectName: options.projectName,
|
|
53
|
-
dependencies
|
|
71
|
+
dependencies: {
|
|
72
|
+
...dependencies,
|
|
73
|
+
...externalDependenciesInfo
|
|
74
|
+
},
|
|
54
75
|
ngAddToRun: depsInfo.o3rPeerDeps
|
|
55
76
|
}),
|
|
56
77
|
(0, cms_adapter_1.updateCmsAdapter)(options),
|