@sap-ux/project-input-validator 0.2.1 → 0.2.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/dist/i18n.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export declare const PROJECT_INPUT_VALIDATOR_NS = "project-input-validator";
|
|
|
3
3
|
/**
|
|
4
4
|
* Initialize i18next with the translations for this module.
|
|
5
5
|
*/
|
|
6
|
-
export declare function
|
|
6
|
+
export declare function initI18nProjectValidators(): Promise<void>;
|
|
7
7
|
/**
|
|
8
8
|
* Helper function facading the call to i18next. Unless a namespace option is provided the local namespace will be used.
|
|
9
9
|
*
|
package/dist/i18n.js
CHANGED
|
@@ -12,29 +12,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.t = exports.
|
|
15
|
+
exports.t = exports.initI18nProjectValidators = exports.PROJECT_INPUT_VALIDATOR_NS = void 0;
|
|
16
16
|
const i18next_1 = __importDefault(require("i18next"));
|
|
17
17
|
const project_input_validator_i18n_json_1 = __importDefault(require("./translations/project-input-validator.i18n.json"));
|
|
18
18
|
exports.PROJECT_INPUT_VALIDATOR_NS = 'project-input-validator';
|
|
19
19
|
/**
|
|
20
20
|
* Initialize i18next with the translations for this module.
|
|
21
21
|
*/
|
|
22
|
-
function
|
|
22
|
+
function initI18nProjectValidators() {
|
|
23
23
|
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
-
yield i18next_1.default.init({
|
|
25
|
-
resources: {
|
|
26
|
-
en: {
|
|
27
|
-
[exports.PROJECT_INPUT_VALIDATOR_NS]: project_input_validator_i18n_json_1.default
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
lng: 'en',
|
|
31
|
-
fallbackLng: 'en',
|
|
32
|
-
defaultNS: exports.PROJECT_INPUT_VALIDATOR_NS,
|
|
33
|
-
ns: [exports.PROJECT_INPUT_VALIDATOR_NS]
|
|
34
|
-
});
|
|
24
|
+
yield i18next_1.default.init({ lng: 'en', fallbackLng: 'en' }, () => i18next_1.default.addResourceBundle('en', exports.PROJECT_INPUT_VALIDATOR_NS, project_input_validator_i18n_json_1.default));
|
|
35
25
|
});
|
|
36
26
|
}
|
|
37
|
-
exports.
|
|
27
|
+
exports.initI18nProjectValidators = initI18nProjectValidators;
|
|
38
28
|
/**
|
|
39
29
|
* Helper function facading the call to i18next. Unless a namespace option is provided the local namespace will be used.
|
|
40
30
|
*
|
|
@@ -49,7 +39,7 @@ function t(key, options) {
|
|
|
49
39
|
return i18next_1.default.t(key, options);
|
|
50
40
|
}
|
|
51
41
|
exports.t = t;
|
|
52
|
-
|
|
42
|
+
initI18nProjectValidators().catch(() => {
|
|
53
43
|
// needed by lint
|
|
54
44
|
});
|
|
55
45
|
//# sourceMappingURL=i18n.js.map
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"nameContainsSpecialCharacters": "Module name cannot contain special characters (\"~'!()*)",
|
|
41
41
|
"nameNotUrlFriendly": "Module name can only contain URL-friendly characters",
|
|
42
42
|
"invalidModuleName": "Invalid module name",
|
|
43
|
-
"moduleAlreadyExists": "The folder: {{folderName}} already exists at the specified path"
|
|
43
|
+
"moduleAlreadyExists": "The module folder named: {{folderName}} already exists at the specified path"
|
|
44
44
|
},
|
|
45
45
|
"general": {
|
|
46
46
|
"invalidUrl": "Invalid URL: [{{-input}}]",
|
package/dist/ui5/validators.js
CHANGED
|
@@ -134,11 +134,11 @@ function validateModuleName(moduleName) {
|
|
|
134
134
|
[moduleName + ' is a blocklisted name']: (0, i18n_1.t)('ui5.nameBlocklisted', { moduleName }),
|
|
135
135
|
[moduleName + ' is a core module name']: (0, i18n_1.t)('ui5.nameIsCoreModule', { moduleName }),
|
|
136
136
|
'name can no longer contain more than 214 characters': (0, i18n_1.t)('ui5.nameTooLong', { length: 214 }),
|
|
137
|
-
'name can no longer contain capital letters': (0, i18n_1.t)('ui5.
|
|
137
|
+
'name can no longer contain capital letters': (0, i18n_1.t)('ui5.inputValueContainsCapital', {
|
|
138
138
|
promptName: 'Module'
|
|
139
139
|
}),
|
|
140
|
-
'name can no longer contain special characters ("~\'!()*")': (0, i18n_1.t)('ui5.
|
|
141
|
-
'name can only contain URL-friendly characters': (0, i18n_1.t)('ui5.
|
|
140
|
+
'name can no longer contain special characters ("~\'!()*")': (0, i18n_1.t)('ui5.nameContainsSpecialCharacters'),
|
|
141
|
+
'name can only contain URL-friendly characters': (0, i18n_1.t)('ui5.nameNotUrlFriendly')
|
|
142
142
|
};
|
|
143
143
|
const valid = (0, validate_npm_package_name_1.default)(moduleName);
|
|
144
144
|
if (valid.validForNewPackages && valid.validForOldPackages) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ux/project-input-validator",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Library to validate Fiori project input formats",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"private": false,
|
|
15
15
|
"main": "dist/index.js",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"i18next": "
|
|
17
|
+
"i18next": "23.5.1",
|
|
18
18
|
"validate-npm-package-name": "5.0.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
"!dist/**/*.map"
|
|
30
30
|
],
|
|
31
31
|
"engines": {
|
|
32
|
-
"pnpm": ">=6.26.1 < 7.0.0 || >=7.1.0",
|
|
33
32
|
"node": ">=18.x"
|
|
34
33
|
},
|
|
35
34
|
"scripts": {
|