zova-cli-set-front 1.2.72 → 1.2.73
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
CHANGED
|
@@ -2780,7 +2780,7 @@ import { constants } from '../config/constants.js';
|
|
|
2780
2780
|
`;
|
|
2781
2781
|
return content;
|
|
2782
2782
|
}
|
|
2783
|
-
async function generateLocale1(modulePath
|
|
2783
|
+
async function generateLocale1(modulePath) {
|
|
2784
2784
|
const files = await globby('src/config/locale/*.ts', {
|
|
2785
2785
|
cwd: modulePath
|
|
2786
2786
|
});
|
|
@@ -2795,21 +2795,11 @@ async function generateLocale1(modulePath, moduleName) {
|
|
|
2795
2795
|
contentLocales.push(` '${localeName}': ${className},`);
|
|
2796
2796
|
}
|
|
2797
2797
|
// combine
|
|
2798
|
-
const content =
|
|
2799
|
-
import { useApp, useComputed } from 'zova';
|
|
2800
|
-
${contentImports.join('\n')}
|
|
2798
|
+
const content = `${contentImports.join('\n')}
|
|
2801
2799
|
|
|
2802
2800
|
export const locales = {
|
|
2803
2801
|
${contentLocales.join('\n')}
|
|
2804
2802
|
};
|
|
2805
|
-
|
|
2806
|
-
export function $useLocale<K extends keyof (typeof locales)[TypeLocaleBase]>(key: K, ...args: any[]) {
|
|
2807
|
-
const app = useApp();
|
|
2808
|
-
const str = \`${moduleName}::\${key}\`;
|
|
2809
|
-
return useComputed(() => {
|
|
2810
|
-
return app.meta.text(str, ...args);
|
|
2811
|
-
});
|
|
2812
|
-
}
|
|
2813
2803
|
`;
|
|
2814
2804
|
return content;
|
|
2815
2805
|
}
|
|
@@ -3473,7 +3463,7 @@ class CliToolsMetadata extends BeanCliBase {
|
|
|
3473
3463
|
const contentConstants = await generateConstant(modulePath);
|
|
3474
3464
|
content += contentConstants;
|
|
3475
3465
|
// locale
|
|
3476
|
-
const contentLocales1 = await generateLocale1(modulePath
|
|
3466
|
+
const contentLocales1 = await generateLocale1(modulePath);
|
|
3477
3467
|
const contentLocales2 = await generateLocale2(contentLocales1);
|
|
3478
3468
|
content += contentLocales2;
|
|
3479
3469
|
// error
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare function generateConfig(modulePath: string): Promise<"" | "/** config: begin */\nexport * from '../config/config.js';\nimport { config } from '../config/config.js';\n/** config: end */\n">;
|
|
2
2
|
export declare function generateConstant(modulePath: string): Promise<"" | "/** constant: begin */\nexport * from '../config/constants.js';\nimport { constants } from '../config/constants.js';\n/** constant: end */\n">;
|
|
3
|
-
export declare function generateLocale1(modulePath: string
|
|
3
|
+
export declare function generateLocale1(modulePath: string): Promise<string>;
|
|
4
4
|
export declare function generateLocale2(contentLocales: string): Promise<"" | "/** locale: begin */\nimport { locales } from './locales.js';\n/** locale: end */\n">;
|
|
5
5
|
export declare function generateError(modulePath: string): Promise<"" | "/** error: begin */\nexport * from '../config/errors.js';\nimport { errors } from '../config/errors.js';\n/** error: end */\n">;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-cli-set-front",
|
|
3
|
-
"version": "1.2.
|
|
4
|
-
"gitHead": "
|
|
3
|
+
"version": "1.2.73",
|
|
4
|
+
"gitHead": "b2879af32ebdecaf6687854b0f7c1d94918919ef",
|
|
5
5
|
"description": "zova cli-set-front",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"framework",
|
|
@@ -65,6 +65,6 @@
|
|
|
65
65
|
"vite": "^8.0.14",
|
|
66
66
|
"yaml": "^2.8.3",
|
|
67
67
|
"zova-openapi": "^1.1.14",
|
|
68
|
-
"zova-vite": "^1.1.
|
|
68
|
+
"zova-vite": "^1.1.35"
|
|
69
69
|
}
|
|
70
70
|
}
|