@jsverse/transloco-optimize 7.0.1 → 8.0.1
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 +17 -3
- package/README.md +1 -1
- package/package.json +14 -15
- package/src/lib/transloco-optimize.js +4 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
## 8.0.1 (2025-09-26)
|
|
2
2
|
|
|
3
|
-
This
|
|
3
|
+
This was a version bump only for transloco-optimize to align it with other projects, there were no code changes.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
# 8.0.0 (2025-09-14)
|
|
6
|
+
|
|
7
|
+
### 💡 Refactor
|
|
8
|
+
|
|
9
|
+
- **optimize:** 💡 update node version ([d4d275ba](https://github.com/jsverse/transloco/commit/d4d275ba))
|
|
10
|
+
|
|
11
|
+
### ⚠ BREAKING CHANGES
|
|
12
|
+
|
|
13
|
+
- **optimize:** 🧨 Minimum node version is now 18
|
|
14
|
+
|
|
15
|
+
### ❤️ Thank You
|
|
16
|
+
|
|
17
|
+
- shaharkazaz @shaharkazaz
|
|
18
|
+
|
|
19
|
+
## [7.0.1](https://github.com/jsverse/transloco/compare/transloco-optimize-7.0.0...transloco-optimize-7.0.1) (2024-05-31)
|
|
6
20
|
|
|
7
21
|
# [7.0.0](https://github.com/jsverse/transloco/compare/transloco-optimize-6.0.0...transloco-optimize-7.0.0) (2024-03-23)
|
|
8
22
|
|
package/README.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
# Transloco Optimize
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Discover more about this plugin and how it can enhance your workflow in the [official Transloco documentation](https://jsverse.gitbook.io/transloco/tools/optimize).
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsverse/transloco-optimize",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.1",
|
|
4
4
|
"description": "Transloco optimization process for production environments",
|
|
5
|
-
"main": "
|
|
5
|
+
"main": "src/lib/transloco-optimize.js",
|
|
6
6
|
"engines": {
|
|
7
|
-
"node": ">=
|
|
7
|
+
"node": ">=18"
|
|
8
8
|
},
|
|
9
9
|
"bin": {
|
|
10
10
|
"transloco-optimize": "src/index.js"
|
|
@@ -15,22 +15,20 @@
|
|
|
15
15
|
"bugs": {
|
|
16
16
|
"url": "https://github.com/jsverse/transloco/issues"
|
|
17
17
|
},
|
|
18
|
-
"homepage": "https://jsverse.
|
|
18
|
+
"homepage": "https://jsverse.gitbook.io/transloco/tools/optimize",
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|
|
21
21
|
"url": "https://github.com/jsverse/transloco"
|
|
22
22
|
},
|
|
23
23
|
"keywords": [
|
|
24
|
-
"
|
|
25
|
-
"angular 2",
|
|
24
|
+
"Angular",
|
|
26
25
|
"i18n",
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"optimize"
|
|
26
|
+
"Translate",
|
|
27
|
+
"Angular Translate",
|
|
28
|
+
"Transloco",
|
|
29
|
+
"Translator Comments",
|
|
30
|
+
"Build",
|
|
31
|
+
"Optimize"
|
|
34
32
|
],
|
|
35
33
|
"license": "MIT",
|
|
36
34
|
"dependencies": {
|
|
@@ -38,5 +36,6 @@
|
|
|
38
36
|
"command-line-args": "^5.2.0",
|
|
39
37
|
"glob": "^10.0.0"
|
|
40
38
|
},
|
|
41
|
-
"type": "commonjs"
|
|
42
|
-
|
|
39
|
+
"type": "commonjs",
|
|
40
|
+
"types": "./src/index.d.ts"
|
|
41
|
+
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getTranslationsFolder = getTranslationsFolder;
|
|
4
|
+
exports.getTranslationFiles = getTranslationFiles;
|
|
5
|
+
exports.optimizeFiles = optimizeFiles;
|
|
4
6
|
const tslib_1 = require("tslib");
|
|
5
7
|
const node_fs_1 = tslib_1.__importDefault(require("node:fs"));
|
|
6
8
|
const node_path_1 = tslib_1.__importDefault(require("node:path"));
|
|
7
9
|
const glob_1 = require("glob");
|
|
8
10
|
const flat_1 = require("flat");
|
|
9
|
-
const isWindows = process.platform ===
|
|
11
|
+
const isWindows = process.platform === 'win32';
|
|
10
12
|
function removeComments(translation, commentsKey = 'comment') {
|
|
11
13
|
return Object.keys(translation).reduce((acc, key) => {
|
|
12
14
|
const lastKey = key.split('.').pop();
|
|
@@ -19,12 +21,10 @@ function removeComments(translation, commentsKey = 'comment') {
|
|
|
19
21
|
function getTranslationsFolder(dist) {
|
|
20
22
|
return node_path_1.default.resolve(process.cwd(), dist);
|
|
21
23
|
}
|
|
22
|
-
exports.getTranslationsFolder = getTranslationsFolder;
|
|
23
24
|
function getTranslationFiles(dist) {
|
|
24
25
|
const filesMatcher = node_path_1.default.resolve(getTranslationsFolder(dist), '**/*.json');
|
|
25
26
|
return (0, glob_1.glob)(filesMatcher, { windowsPathsNoEscape: isWindows });
|
|
26
27
|
}
|
|
27
|
-
exports.getTranslationFiles = getTranslationFiles;
|
|
28
28
|
function optimizeFiles(translationPaths, commentsKey) {
|
|
29
29
|
return new Promise((resolve, reject) => {
|
|
30
30
|
let error;
|
|
@@ -49,4 +49,3 @@ function optimizeFiles(translationPaths, commentsKey) {
|
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
|
-
exports.optimizeFiles = optimizeFiles;
|