@o3r/localization 11.1.0-prerelease.20 → 11.1.0-prerelease.22

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.
@@ -0,0 +1,2 @@
1
+ export * from './localization-metadata-comparison.helper';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../builders/metadata-check/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,2CAA2C,CAAC"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./localization-metadata-comparison.helper"), exports);
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,14 @@
1
+ import type { JSONLocalization, LocalizationMetadata } from '@o3r/localization';
2
+ import type { MetadataComparator } from '@o3r/extractors';
3
+ /**
4
+ * Interface describing a localization migration element
5
+ */
6
+ export interface MigrationLocalizationMetadata {
7
+ /** Localization key */
8
+ key: string;
9
+ }
10
+ /**
11
+ * Comparator used to compare one version of localization metadata with another
12
+ */
13
+ export declare const localizationMetadataComparator: MetadataComparator<JSONLocalization, MigrationLocalizationMetadata, LocalizationMetadata>;
14
+ //# sourceMappingURL=localization-metadata-comparison.helper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"localization-metadata-comparison.helper.d.ts","sourceRoot":"","sources":["../../../../builders/metadata-check/helpers/localization-metadata-comparison.helper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAChF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C,uBAAuB;IACvB,GAAG,EAAE,MAAM,CAAC;CACb;AAaD;;GAEG;AACH,eAAO,MAAM,8BAA8B,EAAE,kBAAkB,CAAC,gBAAgB,EAAE,6BAA6B,EAAE,oBAAoB,CAIpI,CAAC"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.localizationMetadataComparator = void 0;
4
+ /**
5
+ * Returns an array of localization metadata from a metadata file.
6
+ * @param content Content of a migration metadata file
7
+ */
8
+ const getLocalizationArray = (content) => content;
9
+ const getLocalizationName = (localization) => localization.key;
10
+ const isMigrationLocalizationDataMatch = (localization, migrationData) => getLocalizationName(localization) === migrationData.key;
11
+ /**
12
+ * Comparator used to compare one version of localization metadata with another
13
+ */
14
+ exports.localizationMetadataComparator = {
15
+ getArray: getLocalizationArray,
16
+ getIdentifier: getLocalizationName,
17
+ isMigrationDataMatch: isMigrationLocalizationDataMatch
18
+ };
19
+ //# sourceMappingURL=localization-metadata-comparison.helper.js.map
@@ -0,0 +1,4 @@
1
+ import type { LocalizationMigrationMetadataCheckBuilderSchema } from './schema';
2
+ declare const _default: import("@angular-devkit/architect/src/internal").Builder<LocalizationMigrationMetadataCheckBuilderSchema & import("@angular-devkit/core").JsonObject>;
3
+ export default _default;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../builders/metadata-check/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,+CAA+C,EAAE,MAAM,UAAU,CAAC;;AAEhF,wBAEI"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const architect_1 = require("@angular-devkit/architect");
4
+ const extractors_1 = require("@o3r/extractors");
5
+ const helpers_1 = require("./helpers");
6
+ exports.default = (0, architect_1.createBuilder)((0, extractors_1.createBuilderWithMetricsIfInstalled)((options, context) => {
7
+ return (0, extractors_1.checkMetadataBuilder)(options, context, helpers_1.localizationMetadataComparator);
8
+ }));
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,5 @@
1
+ import type { MigrationMetadataCheckBuilderOptions } from '@o3r/extractors';
2
+ /** Migration metadata check builder schema */
3
+ export interface LocalizationMigrationMetadataCheckBuilderSchema extends MigrationMetadataCheckBuilderOptions {
4
+ }
5
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../builders/metadata-check/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oCAAoC,EAAE,MAAM,iBAAiB,CAAC;AAE5E,8CAA8C;AAC9C,MAAM,WAAW,+CAAgD,SAAQ,oCAAoC;CAC5G"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1,41 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
+ "type": "object",
4
+ "$id": "LocalizationMigrationMetadataCheckBuilderSchema",
5
+ "title": "Check localization migration metadata builder",
6
+ "description": "Check localization migration metadata builder",
7
+ "properties": {
8
+ "migrationDataPath": {
9
+ "type": ["string", "array"],
10
+ "items": {
11
+ "type": "string"
12
+ },
13
+ "description": "Glob of the migration files to use."
14
+ },
15
+ "granularity": {
16
+ "type": "string",
17
+ "description": "Granularity of the migration check.",
18
+ "default": "minor",
19
+ "enum": [
20
+ "major",
21
+ "minor"
22
+ ]
23
+ },
24
+ "allowBreakingChanges": {
25
+ "type": "boolean",
26
+ "description": "Are breaking changes allowed.",
27
+ "default": false
28
+ },
29
+ "packageManager": {
30
+ "type": "string",
31
+ "description": "Override of the package manager, otherwise it will be determined from the project."
32
+ },
33
+ "metadataPath": {
34
+ "type": "string",
35
+ "description": "Path of the localization metadata file.",
36
+ "default": "./localisation.metadata.json"
37
+ }
38
+ },
39
+ "additionalProperties": false,
40
+ "required": ["migrationDataPath"]
41
+ }
package/builders.json CHANGED
@@ -15,6 +15,11 @@
15
15
  "implementation": "./builders/localization/",
16
16
  "schema": "./builders/localization/schema.json",
17
17
  "description": "Generate the localizations"
18
+ },
19
+ "check-localization-migration-metadata": {
20
+ "implementation": "./builders/metadata-check/",
21
+ "schema": "./builders/metadata-check/schema.json",
22
+ "description": "Check for localization metadata breaking changes"
18
23
  }
19
24
  }
20
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@o3r/localization",
3
- "version": "11.1.0-prerelease.20",
3
+ "version": "11.1.0-prerelease.22",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -44,16 +44,22 @@
44
44
  "@formatjs/intl-numberformat": "^8.0.2",
45
45
  "@ngrx/store": "~18.0.0",
46
46
  "@ngx-translate/core": "~15.0.0",
47
- "@o3r/core": "^11.1.0-prerelease.20",
48
- "@o3r/dynamic-content": "^11.1.0-prerelease.20",
49
- "@o3r/extractors": "^11.1.0-prerelease.20",
50
- "@o3r/logger": "^11.1.0-prerelease.20",
51
- "@o3r/schematics": "^11.1.0-prerelease.20",
47
+ "@o3r/core": "^11.1.0-prerelease.22",
48
+ "@o3r/dynamic-content": "^11.1.0-prerelease.22",
49
+ "@o3r/extractors": "^11.1.0-prerelease.22",
50
+ "@o3r/logger": "^11.1.0-prerelease.22",
51
+ "@o3r/schematics": "^11.1.0-prerelease.22",
52
52
  "@schematics/angular": "~18.0.0",
53
+ "@yarnpkg/cli": "^4.3.1",
54
+ "@yarnpkg/core": "^4.1.1",
55
+ "@yarnpkg/fslib": "^3.1.0",
56
+ "@yarnpkg/plugin-npm": "^3.0.1",
57
+ "@yarnpkg/plugin-pack": "^4.0.0",
53
58
  "chokidar": "^3.5.2",
54
59
  "globby": "^11.1.0",
55
60
  "intl-messageformat": "~10.5.0",
56
61
  "rxjs": "^7.8.1",
62
+ "semver": "^7.5.2",
57
63
  "typescript": "~5.4.2"
58
64
  },
59
65
  "peerDependenciesMeta": {
@@ -75,12 +81,30 @@
75
81
  "@schematics/angular": {
76
82
  "optional": true
77
83
  },
84
+ "@yarnpkg/cli": {
85
+ "optional": true
86
+ },
87
+ "@yarnpkg/core": {
88
+ "optional": true
89
+ },
90
+ "@yarnpkg/fslib": {
91
+ "optional": true
92
+ },
93
+ "@yarnpkg/plugin-npm": {
94
+ "optional": true
95
+ },
96
+ "@yarnpkg/plugin-pack": {
97
+ "optional": true
98
+ },
78
99
  "chokidar": {
79
100
  "optional": true
80
101
  },
81
102
  "globby": {
82
103
  "optional": true
83
104
  },
105
+ "semver": {
106
+ "optional": true
107
+ },
84
108
  "typescript": {
85
109
  "optional": true
86
110
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/cms-adapter/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,IAAI,EAA0B,MAAM,4BAA4B,CAAC;AA+EvF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB;kBA3EwB,MAAM,GAAG,SAAS;UA2EkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/cms-adapter/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,IAAI,EAA0B,MAAM,4BAA4B,CAAC;AAqFvF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB;kBAjFwB,MAAM,GAAG,SAAS;UAiFkB,CAAC"}
@@ -36,6 +36,12 @@ function updateCmsAdapterFn(options) {
36
36
  libraries: []
37
37
  }
38
38
  };
39
+ workspaceProject.architect['check-localization-migration-metadata'] ||= {
40
+ builder: '@o3r/localization:check-localization-migration-metadata',
41
+ options: {
42
+ migrationDataPath: 'MIGRATION-*.json'
43
+ }
44
+ };
39
45
  workspace.projects[options.projectName] = workspaceProject;
40
46
  tree.overwrite('/angular.json', JSON.stringify(workspace, null, 2));
41
47
  return tree;