@powerlines/plugin-i18next 0.1.250 → 0.1.251
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/{src/helpers → helpers}/config-utils.cjs +1 -1
- package/dist/helpers/config-utils.mjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +5 -5
- package/dist/src/helpers/config-utils.mjs.map +0 -1
- /package/dist/{src/helpers → helpers}/config-utils.mjs +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-utils.mjs","names":[],"sources":["../../src/helpers/config-utils.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { correctPath } from \"@stryke/path/correct-path\";\n\n/**\n * Resolve an output template (string or function) into an actual path string.\n *\n * @remarks\n * - If `outputTemplate` is a function, call it with (language, namespace)\n * - If it's a string, replace placeholders:\n * - \\{\\{language\\}\\} or \\{\\{lng\\}\\} -\\> language\n * - \\{\\{namespace\\}\\} -\\> namespace (or removed if namespace is undefined)\n * - Normalizes duplicate slashes and returns a platform-correct path.\n */\nexport function getOutputPath(\n outputTemplate:\n | string\n | ((language: string, namespace?: string) => string)\n | undefined,\n language: string,\n namespace?: string\n): string {\n if (!outputTemplate) {\n // Fallback to a sensible default\n return correctPath(\n `locales/${language}/${namespace ?? \"translation\"}.json`\n );\n }\n\n if (typeof outputTemplate === \"function\") {\n try {\n const result = String(outputTemplate(language, namespace));\n\n return correctPath(result.replace(/\\/{2,}/g, \"/\"));\n } catch {\n // If user function throws, fallback to default path\n return correctPath(\n `locales/${language}/${namespace ?? \"translation\"}.json`\n );\n }\n }\n\n // It's a string template\n let out = String(outputTemplate);\n out = out.replace(/\\{\\{language\\}\\}|\\{\\{lng\\}\\}/g, language);\n\n if (namespace !== undefined && namespace !== null) {\n out = out.replace(/\\{\\{namespace\\}\\}/g, namespace);\n } else {\n // remove any occurrences of /{{namespace}} or {{namespace}} (keeping surrounding slashes tidy)\n out = out.replace(/\\/?\\{\\{namespace\\}\\}/g, \"\");\n }\n\n // collapse duplicate slashes and normalize to platform-specific separators\n out = out.replace(/\\/{2,}/g, \"/\");\n return correctPath(out);\n}\n"],"mappings":";;;;;;;;;;;;;AA8BA,SAAgB,cACd,gBAIA,UACA,WACQ;AACR,KAAI,CAAC,eAEH,QAAO,YACL,WAAW,SAAS,GAAG,aAAa,cAAc,OACnD;AAGH,KAAI,OAAO,mBAAmB,WAC5B,KAAI;AAGF,SAAO,YAFQ,OAAO,eAAe,UAAU,UAAU,CAAC,CAEhC,QAAQ,WAAW,IAAI,CAAC;SAC5C;AAEN,SAAO,YACL,WAAW,SAAS,GAAG,aAAa,cAAc,OACnD;;CAKL,IAAI,MAAM,OAAO,eAAe;AAChC,OAAM,IAAI,QAAQ,iCAAiC,SAAS;AAE5D,KAAI,cAAc,UAAa,cAAc,KAC3C,OAAM,IAAI,QAAQ,sBAAsB,UAAU;KAGlD,OAAM,IAAI,QAAQ,yBAAyB,GAAG;AAIhD,OAAM,IAAI,QAAQ,WAAW,IAAI;AACjC,QAAO,YAAY,IAAI"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
2
2
|
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
const require_config_utils = require('./
|
|
3
|
+
const require_config_utils = require('./helpers/config-utils.cjs');
|
|
4
4
|
let _stryke_fs_list_files = require("@stryke/fs/list-files");
|
|
5
5
|
let _stryke_path_append = require("@stryke/path/append");
|
|
6
6
|
let _stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getOutputPath } from "./
|
|
1
|
+
import { getOutputPath } from "./helpers/config-utils.mjs";
|
|
2
2
|
import { listFiles } from "@stryke/fs/list-files";
|
|
3
3
|
import { appendPath } from "@stryke/path/append";
|
|
4
4
|
import { findFileName } from "@stryke/path/file-path-fns";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-i18next",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.251",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A Powerlines plugin to use i18next for internationalization.",
|
|
6
6
|
"keywords": ["i18next", "powerlines", "storm-software", "powerlines-plugin"],
|
|
@@ -104,19 +104,19 @@
|
|
|
104
104
|
"typings": "dist/index.d.mts",
|
|
105
105
|
"files": ["dist/**/*"],
|
|
106
106
|
"dependencies": {
|
|
107
|
-
"@stryke/fs": "^0.33.
|
|
107
|
+
"@stryke/fs": "^0.33.61",
|
|
108
108
|
"@stryke/path": "^0.27.0",
|
|
109
109
|
"@stryke/type-checks": "^0.5.39",
|
|
110
110
|
"@stryke/types": "^0.10.53",
|
|
111
111
|
"defu": "^6.1.4",
|
|
112
112
|
"i18next-cli": "^1.50.1",
|
|
113
113
|
"i18next-resources-for-ts": "^2.0.1",
|
|
114
|
-
"powerlines": "^0.41.
|
|
114
|
+
"powerlines": "^0.41.19"
|
|
115
115
|
},
|
|
116
116
|
"devDependencies": {
|
|
117
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
117
|
+
"@powerlines/plugin-plugin": "^0.12.305",
|
|
118
118
|
"@types/node": "^25.5.0"
|
|
119
119
|
},
|
|
120
120
|
"publishConfig": { "access": "public" },
|
|
121
|
-
"gitHead": "
|
|
121
|
+
"gitHead": "29199b27f839c67fb95529a47dea5dc1b3fff1c1"
|
|
122
122
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config-utils.mjs","names":[],"sources":["../../../src/helpers/config-utils.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { correctPath } from \"@stryke/path/correct-path\";\n\n/**\n * Resolve an output template (string or function) into an actual path string.\n *\n * @remarks\n * - If `outputTemplate` is a function, call it with (language, namespace)\n * - If it's a string, replace placeholders:\n * - \\{\\{language\\}\\} or \\{\\{lng\\}\\} -\\> language\n * - \\{\\{namespace\\}\\} -\\> namespace (or removed if namespace is undefined)\n * - Normalizes duplicate slashes and returns a platform-correct path.\n */\nexport function getOutputPath(\n outputTemplate:\n | string\n | ((language: string, namespace?: string) => string)\n | undefined,\n language: string,\n namespace?: string\n): string {\n if (!outputTemplate) {\n // Fallback to a sensible default\n return correctPath(\n `locales/${language}/${namespace ?? \"translation\"}.json`\n );\n }\n\n if (typeof outputTemplate === \"function\") {\n try {\n const result = String(outputTemplate(language, namespace));\n\n return correctPath(result.replace(/\\/{2,}/g, \"/\"));\n } catch {\n // If user function throws, fallback to default path\n return correctPath(\n `locales/${language}/${namespace ?? \"translation\"}.json`\n );\n }\n }\n\n // It's a string template\n let out = String(outputTemplate);\n out = out.replace(/\\{\\{language\\}\\}|\\{\\{lng\\}\\}/g, language);\n\n if (namespace !== undefined && namespace !== null) {\n out = out.replace(/\\{\\{namespace\\}\\}/g, namespace);\n } else {\n // remove any occurrences of /{{namespace}} or {{namespace}} (keeping surrounding slashes tidy)\n out = out.replace(/\\/?\\{\\{namespace\\}\\}/g, \"\");\n }\n\n // collapse duplicate slashes and normalize to platform-specific separators\n out = out.replace(/\\/{2,}/g, \"/\");\n return correctPath(out);\n}\n"],"mappings":";;;;;;;;;;;;;AA8BA,SAAgB,cACd,gBAIA,UACA,WACQ;AACR,KAAI,CAAC,eAEH,QAAO,YACL,WAAW,SAAS,GAAG,aAAa,cAAc,OACnD;AAGH,KAAI,OAAO,mBAAmB,WAC5B,KAAI;AAGF,SAAO,YAFQ,OAAO,eAAe,UAAU,UAAU,CAAC,CAEhC,QAAQ,WAAW,IAAI,CAAC;SAC5C;AAEN,SAAO,YACL,WAAW,SAAS,GAAG,aAAa,cAAc,OACnD;;CAKL,IAAI,MAAM,OAAO,eAAe;AAChC,OAAM,IAAI,QAAQ,iCAAiC,SAAS;AAE5D,KAAI,cAAc,UAAa,cAAc,KAC3C,OAAM,IAAI,QAAQ,sBAAsB,UAAU;KAGlD,OAAM,IAAI,QAAQ,yBAAyB,GAAG;AAIhD,OAAM,IAAI,QAAQ,WAAW,IAAI;AACjC,QAAO,YAAY,IAAI"}
|
|
File without changes
|