@ttoss/i18n-cli 0.4.4 → 0.4.6
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/index.js +21 -1
- package/package.json +6 -5
package/dist/index.js
CHANGED
|
@@ -53,7 +53,27 @@ var getTtossExtractedTranslations = async () => {
|
|
|
53
53
|
const ttossExtractedTranslations = {};
|
|
54
54
|
for (const dependency of ttossDependencies) {
|
|
55
55
|
try {
|
|
56
|
-
const
|
|
56
|
+
const dependencyPathFromCwd = path.join(process.cwd(), "node_modules", dependency);
|
|
57
|
+
const checkIfDependencyIsSymlink = await fs.promises.readlink(dependencyPathFromCwd);
|
|
58
|
+
const requirePath = (() => {
|
|
59
|
+
if (checkIfDependencyIsSymlink) {
|
|
60
|
+
return path.join(dependencyPathFromCwd,
|
|
61
|
+
/**
|
|
62
|
+
* We need to go up one level because the symlink is pointing to
|
|
63
|
+
* the folder that lists dependencies, not the actual dependency.
|
|
64
|
+
* For example, `dependencyPathFromCwd` is
|
|
65
|
+
* /ttoss/terezinha-farm/app/node_modules/@ttoss/react-auth and
|
|
66
|
+
* `checkIfDependencyIsSymlink` is ../../../../packages/react-auth.
|
|
67
|
+
* If we don't go up one level, we will get:
|
|
68
|
+
* /ttoss/terezinha-farm/packages/react-auth/i18n/lang/en.json
|
|
69
|
+
* instead of:
|
|
70
|
+
* /ttoss/packages/react-auth/i18n/lang/en.json
|
|
71
|
+
*/
|
|
72
|
+
"..", checkIfDependencyIsSymlink, EXTRACT_FILE);
|
|
73
|
+
}
|
|
74
|
+
return path.join(dependency, EXTRACT_FILE);
|
|
75
|
+
})();
|
|
76
|
+
const extractedTranslations = require(requirePath);
|
|
57
77
|
const extractedTranslationsWithModule = Object.keys(extractedTranslations).reduce((acc, key) => {
|
|
58
78
|
return {
|
|
59
79
|
...acc,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/i18n-cli",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.6",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"author": "ttoss",
|
|
6
6
|
"contributors": [
|
|
@@ -17,14 +17,15 @@
|
|
|
17
17
|
"build": "tsup-node"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@formatjs/cli-lib": "^6.0
|
|
21
|
-
"glob": "^
|
|
20
|
+
"@formatjs/cli-lib": "^6.1.0",
|
|
21
|
+
"glob": "^10.1.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@ttoss/config": "^1.29.
|
|
24
|
+
"@ttoss/config": "^1.29.5",
|
|
25
|
+
"tsup": "^6.7.0"
|
|
25
26
|
},
|
|
26
27
|
"publishConfig": {
|
|
27
28
|
"access": "public"
|
|
28
29
|
},
|
|
29
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "f30779a5ea50d60cf3099e5fde712e1ef7b7882c"
|
|
30
31
|
}
|