@forge/manifest 13.8.1-next.1 → 13.9.0-next.3
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/CHANGELOG.md +12 -0
- package/out/utils/get-all-modules.d.ts.map +1 -1
- package/out/utils/get-all-modules.js +6 -1
- package/out/utils/module-references.d.ts.map +1 -1
- package/out/utils/module-references.js +6 -2
- package/out/validators/resources-validator.d.ts.map +1 -1
- package/out/validators/resources-validator.js +2 -0
- package/out/validators/runtime-version-validator.js +1 -1
- package/out/validators/storage-validator.d.ts.map +1 -1
- package/out/validators/storage-validator.js +22 -9
- package/out/validators/translations-validator.d.ts.map +1 -1
- package/out/validators/translations-validator.js +42 -21
- package/out/validators/yaml-validator.d.ts.map +1 -1
- package/out/validators/yaml-validator.js +2 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @forge/manifest
|
|
2
2
|
|
|
3
|
+
## 13.9.0-next.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 6193c2d: Populate typed manifest content during YAML parsing and prevent downstream validators from failing on malformed manifest values.
|
|
8
|
+
|
|
9
|
+
## 13.9.0-next.2
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 9fba45e: Surfacing server-side manifest errors
|
|
14
|
+
|
|
3
15
|
## 13.8.1-next.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-all-modules.d.ts","sourceRoot":"","sources":["../../src/utils/get-all-modules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,eAAO,MAAM,aAAa,GAAI,YAAY,OAAO,KAAG,GAAG,
|
|
1
|
+
{"version":3,"file":"get-all-modules.d.ts","sourceRoot":"","sources":["../../src/utils/get-all-modules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,eAAO,MAAM,aAAa,GAAI,YAAY,OAAO,KAAG,GAAG,EAK/C,CAAC"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getAllModules = void 0;
|
|
4
|
-
const getAllModules = (allModules) => Object.keys(allModules).reduce((acc, key) =>
|
|
4
|
+
const getAllModules = (allModules) => Object.keys(allModules).reduce((acc, key) => {
|
|
5
|
+
const modules = allModules[key];
|
|
6
|
+
if (!Array.isArray(modules))
|
|
7
|
+
return acc;
|
|
8
|
+
return acc.concat(...modules);
|
|
9
|
+
}, []);
|
|
5
10
|
exports.getAllModules = getAllModules;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-references.d.ts","sourceRoot":"","sources":["../../src/utils/module-references.ts"],"names":[],"mappings":"AAAA,UAAU,gBAAgB;IACxB,GAAG,EAAE,MAAM,CAAC;CACb;AAID,MAAM,MAAM,iBAAiB,GAAG;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,mBAAmB,MAAM,KAAG,iBAsBlE,CAAC;
|
|
1
|
+
{"version":3,"file":"module-references.d.ts","sourceRoot":"","sources":["../../src/utils/module-references.ts"],"names":[],"mappings":"AAAA,UAAU,gBAAgB;IACxB,GAAG,EAAE,MAAM,CAAC;CACb;AAID,MAAM,MAAM,iBAAiB,GAAG;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,mBAAmB,MAAM,KAAG,iBAsBlE,CAAC;AAwCF,eAAO,MAAM,6BAA6B,GAAI,QAAQ,GAAG,EAAE,YAAY,gBAAgB,EAAE,aAChC,CAAC;AAC1D,eAAO,MAAM,6BAA6B,GAAI,QAAQ,GAAG,EAAE,YAAY,gBAAgB,EAAE,aAChC,CAAC;AAC1D,eAAO,MAAM,6BAA6B,GAAI,QAAQ,GAAG,EAAE,YAAY,gBAAgB,EAAE,aAChC,CAAC;AAC1D,eAAO,MAAM,4BAA4B,GAAI,QAAQ,GAAG,EAAE,WAAW,gBAAgB,EAAE,aAChC,CAAC"}
|
|
@@ -30,7 +30,7 @@ const normalizeReferenceKey = (referenceProperty, entryKey) => referenceProperty
|
|
|
30
30
|
const findInvalidReferenceKeys = (property, module, references) => {
|
|
31
31
|
const invalidEntries = [];
|
|
32
32
|
const _checkModuleEntryKey = (entryKey) => {
|
|
33
|
-
if (!entryKey) {
|
|
33
|
+
if (typeof entryKey !== 'string' || !entryKey) {
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
36
|
const normalizedReference = normalizeReferenceKey(property, entryKey);
|
|
@@ -39,7 +39,11 @@ const findInvalidReferenceKeys = (property, module, references) => {
|
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
_checkModuleEntryKey(module[property]);
|
|
42
|
-
Object.keys(module).forEach((key) =>
|
|
42
|
+
Object.keys(module).forEach((key) => {
|
|
43
|
+
if (module[key] != null && typeof module[key] === 'object') {
|
|
44
|
+
_checkModuleEntryKey(module[key][property]);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
43
47
|
return invalidEntries;
|
|
44
48
|
};
|
|
45
49
|
const findInvalidFunctionReferences = (module, functions) => findInvalidReferenceKeys('function', module, functions);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resources-validator.d.ts","sourceRoot":"","sources":["../../src/validators/resources-validator.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAmB,MAAM,UAAU,CAAC;AAGrF,OAAO,EAAyB,cAAc,EAAmB,MAAM,oBAAoB,CAAC;AAC5F,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAUrC,qBAAa,kBACX,YAAW,kBAAkB,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG,SAAS,EAAE,cAAc,CAAC;IAEzF,OAAO,CAAC,eAAe;IAIvB,OAAO,CAAC,8BAA8B;IAqGtC,OAAO,CAAC,4BAA4B;IAwBpC,OAAO,CAAC,+BAA+B;IAwCjC,QAAQ,CACZ,QAAQ,EAAE,cAAc,CAAC,cAAc,CAAC,GAAG,SAAS,GACnD,OAAO,CAAC,wBAAwB,CAAC,cAAc,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"resources-validator.d.ts","sourceRoot":"","sources":["../../src/validators/resources-validator.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAmB,MAAM,UAAU,CAAC;AAGrF,OAAO,EAAyB,cAAc,EAAmB,MAAM,oBAAoB,CAAC;AAC5F,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAUrC,qBAAa,kBACX,YAAW,kBAAkB,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG,SAAS,EAAE,cAAc,CAAC;IAEzF,OAAO,CAAC,eAAe;IAIvB,OAAO,CAAC,8BAA8B;IAqGtC,OAAO,CAAC,4BAA4B;IAwBpC,OAAO,CAAC,+BAA+B;IAwCjC,QAAQ,CACZ,QAAQ,EAAE,cAAc,CAAC,cAAc,CAAC,GAAG,SAAS,GACnD,OAAO,CAAC,wBAAwB,CAAC,cAAc,CAAC,CAAC;CAuOrD"}
|
|
@@ -267,6 +267,8 @@ class ResourcesValidator {
|
|
|
267
267
|
const invalidDirectoryErrors = resources
|
|
268
268
|
.map((resource) => {
|
|
269
269
|
const { key, path } = resource;
|
|
270
|
+
if (typeof path !== 'string')
|
|
271
|
+
return undefined;
|
|
270
272
|
const manifestDir = (0, path_1.dirname)(filePath);
|
|
271
273
|
const resourceDirPath = (0, path_1.resolve)(manifestDir, path);
|
|
272
274
|
if (!fs_1.default.existsSync(resourceDirPath)) {
|
|
@@ -10,7 +10,7 @@ class RuntimeVersionValidator {
|
|
|
10
10
|
}
|
|
11
11
|
async validate(manifest) {
|
|
12
12
|
if (manifest?.typedContent) {
|
|
13
|
-
const runtimeName = manifest.typedContent.app
|
|
13
|
+
const runtimeName = manifest.typedContent.app?.runtime?.name;
|
|
14
14
|
const deprecatedRuntimes = this.lintOptions.deprecatedRuntimes ?? [];
|
|
15
15
|
if (deprecatedRuntimes.includes(runtimeName)) {
|
|
16
16
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage-validator.d.ts","sourceRoot":"","sources":["../../src/validators/storage-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAmB,MAAM,UAAU,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAIpD,qBAAa,gBACX,YAAW,kBAAkB,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG,SAAS,EAAE,cAAc,CAAC;IAEzF,OAAO,CAAC,wBAAwB,CAAM;IACtC,OAAO,CAAC,wBAAwB,CAAM;IACtC,OAAO,CAAC,qBAAqB,CAAK;IAClC,OAAO,CAAC,iBAAiB,CAAY;IAE/B,QAAQ,CACZ,QAAQ,EAAE,cAAc,CAAC,cAAc,CAAC,GAAG,SAAS,GACnD,OAAO,CAAC,wBAAwB,CAAC,cAAc,CAAC,CAAC;IAapD,OAAO,CAAC,kBAAkB;IAkB1B,OAAO,CAAC,iBAAiB;IAkBzB,OAAO,CAAC,sBAAsB;
|
|
1
|
+
{"version":3,"file":"storage-validator.d.ts","sourceRoot":"","sources":["../../src/validators/storage-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAmB,MAAM,UAAU,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAIpD,qBAAa,gBACX,YAAW,kBAAkB,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG,SAAS,EAAE,cAAc,CAAC;IAEzF,OAAO,CAAC,wBAAwB,CAAM;IACtC,OAAO,CAAC,wBAAwB,CAAM;IACtC,OAAO,CAAC,qBAAqB,CAAK;IAClC,OAAO,CAAC,iBAAiB,CAAY;IAE/B,QAAQ,CACZ,QAAQ,EAAE,cAAc,CAAC,cAAc,CAAC,GAAG,SAAS,GACnD,OAAO,CAAC,wBAAwB,CAAC,cAAc,CAAC,CAAC;IAapD,OAAO,CAAC,kBAAkB;IAkB1B,OAAO,CAAC,iBAAiB;IAkBzB,OAAO,CAAC,sBAAsB;CAwH/B"}
|
|
@@ -51,10 +51,19 @@ class StorageValidator {
|
|
|
51
51
|
}
|
|
52
52
|
validateCustomEntities(manifest) {
|
|
53
53
|
const validationErrors = [];
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
if (!manifest) {
|
|
55
|
+
return validationErrors;
|
|
56
|
+
}
|
|
57
|
+
const entities = manifest.typedContent?.app?.storage?.entities;
|
|
58
|
+
if (Array.isArray(entities)) {
|
|
56
59
|
entities.forEach((entity) => {
|
|
60
|
+
if (entity === null || typeof entity !== 'object' || Array.isArray(entity)) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
57
63
|
const { name, attributes } = entity;
|
|
64
|
+
if (attributes === null || typeof attributes !== 'object' || Array.isArray(attributes)) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
58
67
|
if (Object.keys(attributes).length > this.entityAttributesMaxCount) {
|
|
59
68
|
validationErrors.push({
|
|
60
69
|
message: text_1.errors.app.storage.entities.tooManyAttributes(name, this.entityAttributesMaxCount),
|
|
@@ -73,8 +82,8 @@ class StorageValidator {
|
|
|
73
82
|
});
|
|
74
83
|
}
|
|
75
84
|
});
|
|
76
|
-
|
|
77
|
-
|
|
85
|
+
const indexes = Array.isArray(entity.indexes) ? entity.indexes : [];
|
|
86
|
+
if (indexes.length > 0) {
|
|
78
87
|
if (indexes.length > this.entityIndexesMaxCount) {
|
|
79
88
|
validationErrors.push({
|
|
80
89
|
message: text_1.errors.app.storage.entities.tooManyIndexes(name, this.entityIndexesMaxCount),
|
|
@@ -90,11 +99,15 @@ class StorageValidator {
|
|
|
90
99
|
if (typeof index === 'string') {
|
|
91
100
|
indexRange.push(index);
|
|
92
101
|
}
|
|
93
|
-
else if (typeof index === 'object') {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
102
|
+
else if (index !== null && typeof index === 'object' && !Array.isArray(index)) {
|
|
103
|
+
if (typeof index.name === 'string') {
|
|
104
|
+
indexName.push(index.name);
|
|
105
|
+
}
|
|
106
|
+
if (Array.isArray(index.range)) {
|
|
107
|
+
indexRange.push(...index.range.filter((range) => typeof range === 'string'));
|
|
108
|
+
}
|
|
109
|
+
if (Array.isArray(index.partition)) {
|
|
110
|
+
indexPartition.push(...index.partition.filter((partition) => typeof partition === 'string'));
|
|
98
111
|
}
|
|
99
112
|
}
|
|
100
113
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translations-validator.d.ts","sourceRoot":"","sources":["../../src/validators/translations-validator.ts"],"names":[],"mappings":"AAOA,OAAO,EAA+C,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAItG,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAmB,MAAM,UAAU,CAAC;AACrF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"translations-validator.d.ts","sourceRoot":"","sources":["../../src/validators/translations-validator.ts"],"names":[],"mappings":"AAOA,OAAO,EAA+C,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAItG,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAmB,MAAM,UAAU,CAAC;AACrF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAW3D,qBAAa,qBACX,YAAW,kBAAkB,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG,SAAS,EAAE,cAAc,CAAC;IAEzF,OAAO,CAAC,aAAa,CAAa;IAClC,OAAO,CAAC,GAAG,CAA8D;IAEzE,OAAO,CAAC,8BAA8B;IAqDtC,OAAO,CAAC,6BAA6B;IA0CrC,OAAO,CAAC,mBAAmB;IA0B3B,OAAO,CAAC,gCAAgC;IAoBxC,OAAO,CAAC,UAAU;IAUlB,OAAO,CAAC,qBAAqB;IA4B7B,OAAO,CAAC,iBAAiB;IAWzB,OAAO,CAAC,wBAAwB;IAiDhC,OAAO,CAAC,oBAAoB;IA2B5B,OAAO,CAAC,uBAAuB;IAW/B,OAAO,CAAC,iCAAiC;IAwBzC,OAAO,CAAC,0BAA0B;IAuClC,OAAO,CAAC,4CAA4C;IAe9C,QAAQ,CACZ,QAAQ,EAAE,cAAc,CAAC,cAAc,CAAC,GAAG,SAAS,GACnD,OAAO,CAAC,wBAAwB,CAAC,cAAc,CAAC,CAAC;CA0BrD"}
|
|
@@ -14,11 +14,14 @@ const utils_1 = require("../utils");
|
|
|
14
14
|
class TranslationsValidator {
|
|
15
15
|
validateCache = new Map();
|
|
16
16
|
ajv = new ajv_1.default({ allErrors: true, verbose: true, strict: false });
|
|
17
|
-
ensureValidResourcesDefinition(validationErrors, manifest) {
|
|
18
|
-
const { resources } = manifest.yamlContent.translations;
|
|
17
|
+
ensureValidResourcesDefinition(validationErrors, manifest, resources) {
|
|
19
18
|
const resourcesMap = new Map();
|
|
19
|
+
const seenKeys = new Set();
|
|
20
20
|
for (const { key, path } of resources) {
|
|
21
|
-
if (
|
|
21
|
+
if (typeof key !== 'string') {
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
if (seenKeys.has(key)) {
|
|
22
25
|
validationErrors.push({
|
|
23
26
|
message: text_1.errors.translations.duplicateResourceKey(key),
|
|
24
27
|
reference: text_2.References.SchemaError,
|
|
@@ -27,6 +30,9 @@ class TranslationsValidator {
|
|
|
27
30
|
});
|
|
28
31
|
}
|
|
29
32
|
else {
|
|
33
|
+
seenKeys.add(key);
|
|
34
|
+
}
|
|
35
|
+
if (typeof path === 'string' && !resourcesMap.has(key)) {
|
|
30
36
|
resourcesMap.set(key, path);
|
|
31
37
|
}
|
|
32
38
|
}
|
|
@@ -50,13 +56,12 @@ class TranslationsValidator {
|
|
|
50
56
|
}
|
|
51
57
|
return allLanguageLookup;
|
|
52
58
|
}
|
|
53
|
-
ensureValidFallbackDefinition(validationErrors, manifest) {
|
|
54
|
-
const
|
|
55
|
-
const
|
|
56
|
-
const fallbackLocales = new Set(Object.values(fallback).flatMap((locales) => Array.isArray(locales) ? locales : [locales]));
|
|
59
|
+
ensureValidFallbackDefinition(validationErrors, manifest, resources, fallback) {
|
|
60
|
+
const resourcesSet = new Set(resources.map(({ key }) => key).filter((key) => typeof key === 'string'));
|
|
61
|
+
const fallbackLocales = new Set(Object.values(fallback).flatMap((locales) => (Array.isArray(locales) ? locales : [locales])));
|
|
57
62
|
for (const fallbackLocale of fallbackLocales) {
|
|
58
63
|
if (!resourcesSet.has(fallbackLocale)) {
|
|
59
|
-
const targetLocale = Object.entries(fallback).find(([, locales]) => locales === fallbackLocale || locales.includes(fallbackLocale))?.[0];
|
|
64
|
+
const targetLocale = Object.entries(fallback).find(([, locales]) => locales === fallbackLocale || (Array.isArray(locales) && locales.includes(fallbackLocale)))?.[0];
|
|
60
65
|
validationErrors.push({
|
|
61
66
|
message: text_1.errors.translations.missingTranslationsJsonFile(fallbackLocale),
|
|
62
67
|
reference: text_2.References.SchemaError,
|
|
@@ -77,17 +82,17 @@ class TranslationsValidator {
|
|
|
77
82
|
}
|
|
78
83
|
}
|
|
79
84
|
}
|
|
80
|
-
getAllLocalesLookup(validationErrors, i18nKeys, translationsLookup, manifest) {
|
|
81
|
-
const
|
|
82
|
-
const defaultLocaleCode =
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
const i18nMap = this.getI18nMap(i18nKeys, translationsLookup,
|
|
87
|
-
if (
|
|
88
|
-
this.ensureI18nKeysExistInDefaultJson(validationErrors, i18nKeys, translationsLookup,
|
|
85
|
+
getAllLocalesLookup(validationErrors, i18nKeys, translationsLookup, manifest, resources, fallback) {
|
|
86
|
+
const defaultLocale = fallback.default;
|
|
87
|
+
const defaultLocaleCode = typeof defaultLocale === 'string' ? defaultLocale : undefined;
|
|
88
|
+
const resourceList = resources.map(({ key }) => key).filter((key) => typeof key === 'string');
|
|
89
|
+
return resourceList.reduce((allLocalesLookup, locale) => {
|
|
90
|
+
const forgeLocale = locale;
|
|
91
|
+
const i18nMap = this.getI18nMap(i18nKeys, translationsLookup, forgeLocale);
|
|
92
|
+
if (forgeLocale === defaultLocaleCode) {
|
|
93
|
+
this.ensureI18nKeysExistInDefaultJson(validationErrors, i18nKeys, translationsLookup, forgeLocale, manifest);
|
|
89
94
|
}
|
|
90
|
-
allLocalesLookup.set(
|
|
95
|
+
allLocalesLookup.set(forgeLocale, i18nMap);
|
|
91
96
|
return allLocalesLookup;
|
|
92
97
|
}, new Map());
|
|
93
98
|
}
|
|
@@ -223,9 +228,25 @@ class TranslationsValidator {
|
|
|
223
228
|
}
|
|
224
229
|
validateManifestI18nConfig(manifest, i18nKeys, moduleI18nProperties) {
|
|
225
230
|
const validationErrors = [];
|
|
226
|
-
const
|
|
227
|
-
|
|
228
|
-
|
|
231
|
+
const rawResources = manifest.yamlContent.translations.resources;
|
|
232
|
+
const resources = Array.isArray(rawResources)
|
|
233
|
+
? rawResources.filter((resource) => resource !== null && typeof resource === 'object' && !Array.isArray(resource))
|
|
234
|
+
: [];
|
|
235
|
+
const rawFallback = manifest.yamlContent.translations.fallback;
|
|
236
|
+
const fallback = rawFallback !== null && typeof rawFallback === 'object' && !Array.isArray(rawFallback)
|
|
237
|
+
? Object.entries(rawFallback).reduce((normalizedFallback, [locale, value]) => {
|
|
238
|
+
if (typeof value === 'string') {
|
|
239
|
+
normalizedFallback[locale] = value;
|
|
240
|
+
}
|
|
241
|
+
else if (Array.isArray(value) && value.every((entry) => typeof entry === 'string')) {
|
|
242
|
+
normalizedFallback[locale] = value;
|
|
243
|
+
}
|
|
244
|
+
return normalizedFallback;
|
|
245
|
+
}, {})
|
|
246
|
+
: {};
|
|
247
|
+
const allLanguageLookup = this.ensureValidResourcesDefinition(validationErrors, manifest, resources);
|
|
248
|
+
this.ensureValidFallbackDefinition(validationErrors, manifest, resources, fallback);
|
|
249
|
+
const i18nMap = this.getAllLocalesLookup(validationErrors, i18nKeys, allLanguageLookup, manifest, resources, fallback);
|
|
229
250
|
this.ensureAllValidI18nValue(validationErrors, i18nMap, moduleI18nProperties, manifest);
|
|
230
251
|
return validationErrors;
|
|
231
252
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yaml-validator.d.ts","sourceRoot":"","sources":["../../src/validators/yaml-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAIpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAG3D,qBAAa,aAAa,CAAC,CAAC,CAAE,YAAW,kBAAkB,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,SAAS,EAAE,CAAC,CAAC;IACrF,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,SAAS,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"yaml-validator.d.ts","sourceRoot":"","sources":["../../src/validators/yaml-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAIpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAG3D,qBAAa,aAAa,CAAC,CAAC,CAAE,YAAW,kBAAkB,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,SAAS,EAAE,CAAC,CAAC;IACrF,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,SAAS,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC;CAqD9F"}
|