@powerlines/plugin-i18next 0.1.65 → 0.1.67
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/helpers/config-utils.d.cts +14 -0
- package/dist/helpers/config-utils.d.mts +14 -0
- package/dist/index.cjs +2 -2
- package/dist/types/i18n.cjs +0 -0
- package/dist/types/i18n.mjs +1 -0
- package/dist/types/index.cjs +0 -0
- package/dist/types/index.d.cts +3 -0
- package/dist/types/index.d.mts +2 -1
- package/dist/types/index.mjs +1 -0
- package/dist/types/plugin.cjs +0 -0
- package/dist/types/plugin.mjs +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/helpers/config-utils.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Resolve an output template (string or function) into an actual path string.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* - If `outputTemplate` is a function, call it with (language, namespace)
|
|
7
|
+
* - If it's a string, replace placeholders:
|
|
8
|
+
* - \{\{language\}\} or \{\{lng\}\} -\> language
|
|
9
|
+
* - \{\{namespace\}\} -\> namespace (or removed if namespace is undefined)
|
|
10
|
+
* - Normalizes duplicate slashes and returns a platform-correct path.
|
|
11
|
+
*/
|
|
12
|
+
declare function getOutputPath(outputTemplate: string | ((language: string, namespace?: string) => string) | undefined, language: string, namespace?: string): string;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { getOutputPath };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/helpers/config-utils.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Resolve an output template (string or function) into an actual path string.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* - If `outputTemplate` is a function, call it with (language, namespace)
|
|
7
|
+
* - If it's a string, replace placeholders:
|
|
8
|
+
* - \{\{language\}\} or \{\{lng\}\} -\> language
|
|
9
|
+
* - \{\{namespace\}\} -\> namespace (or removed if namespace is undefined)
|
|
10
|
+
* - Normalizes duplicate slashes and returns a platform-correct path.
|
|
11
|
+
*/
|
|
12
|
+
declare function getOutputPath(outputTemplate: string | ((language: string, namespace?: string) => string) | undefined, language: string, namespace?: string): string;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { getOutputPath };
|
package/dist/index.cjs
CHANGED
|
@@ -3,7 +3,7 @@ const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
|
3
3
|
const require_is_set = require('./node_modules/.pnpm/@stryke_type-checks@0.5.17/node_modules/@stryke/type-checks/dist/is-set.cjs');
|
|
4
4
|
const require_is_set_object = require('./node_modules/.pnpm/@stryke_type-checks@0.5.17/node_modules/@stryke/type-checks/dist/is-set-object.cjs');
|
|
5
5
|
const require_is_string = require('./node_modules/.pnpm/@stryke_type-checks@0.5.17/node_modules/@stryke/type-checks/dist/is-string.cjs');
|
|
6
|
-
const
|
|
6
|
+
const require_helpers_config_utils = require('./helpers/config-utils.cjs');
|
|
7
7
|
let __stryke_fs_list_files = require("@stryke/fs/list-files");
|
|
8
8
|
let __stryke_path_append = require("@stryke/path/append");
|
|
9
9
|
let __stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
|
|
@@ -75,7 +75,7 @@ const plugin = (options = {}) => {
|
|
|
75
75
|
},
|
|
76
76
|
async types(code) {
|
|
77
77
|
const resources = [];
|
|
78
|
-
for (const file of await (0, __stryke_fs_list_files.listFiles)(
|
|
78
|
+
for (const file of await (0, __stryke_fs_list_files.listFiles)(require_helpers_config_utils.getOutputPath(this.config.i18next.extract.output, this.config.i18next.extract.primaryLanguage, "*"))) {
|
|
79
79
|
const namespace = (0, __stryke_path_file_path_fns.findFileName)(file, { withExtension: false });
|
|
80
80
|
const parsedContent = await this.resolver.import(file);
|
|
81
81
|
if (this.config.i18next.extract.mergeNamespaces && require_is_set_object.t(parsedContent)) {
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
File without changes
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { I18NextPluginContext, I18NextPluginOptions, I18NextPluginResolvedConfig, I18NextPluginUserConfig } from "./plugin.cjs";
|
|
2
|
+
import { Resource, ResourceContent } from "./i18n.cjs";
|
|
3
|
+
export { I18NextPluginContext, I18NextPluginOptions, I18NextPluginResolvedConfig, I18NextPluginUserConfig, Resource, ResourceContent };
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { I18NextPluginContext, I18NextPluginOptions, I18NextPluginResolvedConfig, I18NextPluginUserConfig } from "./plugin.mjs";
|
|
2
|
-
import { Resource, ResourceContent } from "./i18n.mjs";
|
|
2
|
+
import { Resource, ResourceContent } from "./i18n.mjs";
|
|
3
|
+
export { I18NextPluginContext, I18NextPluginOptions, I18NextPluginResolvedConfig, I18NextPluginUserConfig, Resource, ResourceContent };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-i18next",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.67",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A Powerlines plugin to use i18next for internationalization.",
|
|
6
6
|
"repository": {
|
|
@@ -123,12 +123,12 @@
|
|
|
123
123
|
"defu": "^6.1.4",
|
|
124
124
|
"i18next-cli": "^1.36.1",
|
|
125
125
|
"i18next-resources-for-ts": "^2.0.0",
|
|
126
|
-
"powerlines": "^0.37.
|
|
126
|
+
"powerlines": "^0.37.44"
|
|
127
127
|
},
|
|
128
128
|
"devDependencies": {
|
|
129
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
129
|
+
"@powerlines/plugin-plugin": "^0.12.122",
|
|
130
130
|
"@types/node": "^24.10.9"
|
|
131
131
|
},
|
|
132
132
|
"publishConfig": { "access": "public" },
|
|
133
|
-
"gitHead": "
|
|
133
|
+
"gitHead": "e4860aa4ebc657acfef8a8f2399108f0badc520c"
|
|
134
134
|
}
|