@kununu/phraseapp-cli 4.0.3 → 4.0.4
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/SECURITY.md +2 -5
- package/check-translations.js +16 -10
- package/index.js +1 -1
- package/package.json +6 -6
- package/composer.json +0 -4
package/SECURITY.md
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
# Security Policy
|
|
2
2
|
|
|
3
|
-
|
|
4
3
|
## Reporting a Vulnerability
|
|
5
4
|
|
|
6
5
|
Jira is our entrypoint to report security vulnerabilities. Having this mind a KUNSECU user story (type Vulnerability) needs to be created.
|
|
7
6
|
|
|
8
7
|
### How to fill the user story?
|
|
9
8
|
|
|
10
|
-
Follow this [documentation]
|
|
11
|
-
|
|
9
|
+
Follow this [documentation]<https://new-work.atlassian.net/wiki/spaces/kununu/pages/47845636/Jira+KUNSECU)>.
|
|
12
10
|
|
|
13
11
|
### To which team do I assign the user story?
|
|
14
12
|
|
|
15
|
-
Follow the [component ownership matrix](https://
|
|
16
|
-
|
|
13
|
+
Follow the [component ownership matrix](https://new-work.atlassian.net/wiki/spaces/kununu/pages/47847211/Component+ownership+and+support) and assign it to the corresponding team.
|
|
17
14
|
|
|
18
15
|
## Reporting the update of dependencies
|
|
19
16
|
|
package/check-translations.js
CHANGED
|
@@ -8,9 +8,8 @@ const {
|
|
|
8
8
|
|
|
9
9
|
const {parse} = require('@babel/parser');
|
|
10
10
|
const traverse = require('@babel/traverse');
|
|
11
|
-
const {sync} = require('glob');
|
|
12
|
-
|
|
13
11
|
const colors = require('colors'); // eslint-disable-line no-unused-vars
|
|
12
|
+
const {sync} = require('glob');
|
|
14
13
|
|
|
15
14
|
const FOLDER_REPORT_CHECK_TRANSLATIONS = `${process.cwd()}/report-check-translations`;
|
|
16
15
|
const UNUSED_KEYS_FILE = `${FOLDER_REPORT_CHECK_TRANSLATIONS}/not_used_keys.json`;
|
|
@@ -22,7 +21,7 @@ function extractTranslationKeys() {
|
|
|
22
21
|
`${process.cwd()}/${process.env.SOURCE_DIR}/**/**/*.{js,jsx,ts,tsx}`,
|
|
23
22
|
{
|
|
24
23
|
ignore: [`**/*.spec.{js,jsx,ts,tsx}`],
|
|
25
|
-
}
|
|
24
|
+
},
|
|
26
25
|
);
|
|
27
26
|
const keys = new Set();
|
|
28
27
|
const possibleDynamicKeys = {};
|
|
@@ -85,7 +84,8 @@ function extractTranslationKeys() {
|
|
|
85
84
|
|
|
86
85
|
if (Object.keys(possibleDynamicKeys).length > 0) {
|
|
87
86
|
console.log(
|
|
88
|
-
`${Object.keys(possibleDynamicKeys).length} files contain possible dynamic keys were saved in ${POSSIBLE_DYNAMIC_KEYS_FILE}
|
|
87
|
+
`${Object.keys(possibleDynamicKeys).length} files contain possible dynamic keys were saved in ${POSSIBLE_DYNAMIC_KEYS_FILE}`
|
|
88
|
+
.yellow.bold,
|
|
89
89
|
);
|
|
90
90
|
writeFileSync(
|
|
91
91
|
POSSIBLE_DYNAMIC_KEYS_FILE,
|
|
@@ -94,7 +94,8 @@ function extractTranslationKeys() {
|
|
|
94
94
|
} else if (existsSync(POSSIBLE_DYNAMIC_KEYS_FILE)) {
|
|
95
95
|
unlinkSync(POSSIBLE_DYNAMIC_KEYS_FILE);
|
|
96
96
|
console.log(
|
|
97
|
-
`${POSSIBLE_DYNAMIC_KEYS_FILE} was deleted as there are no possible dynamic keys
|
|
97
|
+
`${POSSIBLE_DYNAMIC_KEYS_FILE} was deleted as there are no possible dynamic keys.`
|
|
98
|
+
.green.bold,
|
|
98
99
|
);
|
|
99
100
|
}
|
|
100
101
|
|
|
@@ -118,7 +119,8 @@ function compareKeys() {
|
|
|
118
119
|
|
|
119
120
|
const allValidKeys = new Set(Object.keys(translations));
|
|
120
121
|
|
|
121
|
-
const missingKeys = [...appKeys]
|
|
122
|
+
const missingKeys = [...appKeys]
|
|
123
|
+
.filter(key => !allValidKeys.has(key))
|
|
122
124
|
.filter(key => key != null && key !== undefined);
|
|
123
125
|
|
|
124
126
|
// Check if there are keys in dynamicKeys that are missing from allValidKeys.
|
|
@@ -136,25 +138,29 @@ function compareKeys() {
|
|
|
136
138
|
if (missingKeys.length > 0) {
|
|
137
139
|
writeFileSync(MISSING_KEYS_FILE, JSON.stringify(missingKeys, null, 2));
|
|
138
140
|
console.error(
|
|
139
|
-
`${missingKeys.length} missing keys were found. Please check ${MISSING_KEYS_FILE} for details
|
|
141
|
+
`${missingKeys.length} missing keys were found. Please check ${MISSING_KEYS_FILE} for details.`
|
|
142
|
+
.red.bold,
|
|
140
143
|
);
|
|
141
144
|
process.exit(1);
|
|
142
145
|
} else if (existsSync(MISSING_KEYS_FILE)) {
|
|
143
146
|
unlinkSync(MISSING_KEYS_FILE);
|
|
144
147
|
console.log(
|
|
145
|
-
`${MISSING_KEYS_FILE} was deleted as there are no missing keys.`.green
|
|
148
|
+
`${MISSING_KEYS_FILE} was deleted as there are no missing keys.`.green
|
|
149
|
+
.bold,
|
|
146
150
|
);
|
|
147
151
|
}
|
|
148
152
|
|
|
149
153
|
if (unusedKeys.length > 0) {
|
|
150
154
|
writeFileSync(UNUSED_KEYS_FILE, JSON.stringify(unusedKeys, null, 2));
|
|
151
155
|
console.log(
|
|
152
|
-
`${unusedKeys.length} unused keys were saved in ${UNUSED_KEYS_FILE}
|
|
156
|
+
`${unusedKeys.length} unused keys were saved in ${UNUSED_KEYS_FILE}`
|
|
157
|
+
.yellow.bold,
|
|
153
158
|
);
|
|
154
159
|
} else if (existsSync(UNUSED_KEYS_FILE)) {
|
|
155
160
|
unlinkSync(UNUSED_KEYS_FILE);
|
|
156
161
|
console.log(
|
|
157
|
-
`${UNUSED_KEYS_FILE} was deleted as there are no unused keys.`.green
|
|
162
|
+
`${UNUSED_KEYS_FILE} was deleted as there are no unused keys.`.green
|
|
163
|
+
.bold,
|
|
158
164
|
);
|
|
159
165
|
}
|
|
160
166
|
} catch (error) {
|
package/index.js
CHANGED
|
@@ -157,7 +157,7 @@ function downloadLocaleFile(phrase, locale) {
|
|
|
157
157
|
} else {
|
|
158
158
|
// Handle any errors
|
|
159
159
|
console.error(
|
|
160
|
-
`Error: locale file ${getFileName(filePrefix, localeId)}. Message: ${error.
|
|
160
|
+
`Error: locale file ${getFileName(filePrefix, localeId)}. Message: ${error.message}`
|
|
161
161
|
.red,
|
|
162
162
|
);
|
|
163
163
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kununu/phraseapp-cli",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "kununu",
|
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
"lint": "eslint . --ext jsx --ext js --ext tsx --ext ts --ignore-path .eslintignore --max-warnings 10"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@babel/parser": "
|
|
13
|
-
"@babel/traverse": "
|
|
12
|
+
"@babel/parser": "7.28.4",
|
|
13
|
+
"@babel/traverse": "7.28.4",
|
|
14
14
|
"colors": "1.4.0",
|
|
15
|
-
"dotenv": "
|
|
16
|
-
"glob": "
|
|
15
|
+
"dotenv": "17.2.2",
|
|
16
|
+
"glob": "11.0.3"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@kununu/eslint-config": "5.
|
|
19
|
+
"@kununu/eslint-config": "5.10.1"
|
|
20
20
|
}
|
|
21
21
|
}
|
package/composer.json
DELETED