vona-cli-set-api 1.1.11 → 1.1.13

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.
@@ -38,3 +38,4 @@ onlyBuiltDependencies:
38
38
  overrides:
39
39
  '@types/mime': '3.0.4'
40
40
  '@types/react': 'npm:@cabloy/types-react@^19.2.13'
41
+ 'zod': 'npm:@cabloy/zod@4.3.6'
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vona-suite-cabloy-basic",
3
- "version": "5.1.6",
3
+ "version": "5.1.7",
4
4
  "gitHead": "a79189b882c17af5911573896a781bbb0046d37d",
5
5
  "description": "",
6
6
  "author": "",
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "vona-module-basic-siteadmin": "workspace:^",
14
- "vona-suite-a-cabloy": "^5.1.4"
14
+ "vona-suite-a-cabloy": "^5.1.5"
15
15
  },
16
16
  "title": "cabloy-basic"
17
17
  }
@@ -38,3 +38,4 @@ onlyBuiltDependencies:
38
38
  overrides:
39
39
  '@types/mime': '3.0.4'
40
40
  '@types/react': 'npm:@cabloy/types-react@^19.2.13'
41
+ 'zod': 'npm:@cabloy/zod@4.3.6'
package/dist/index.js CHANGED
@@ -163,45 +163,7 @@ function resolveTemplatePath(file) {
163
163
  return fileURLToPath(url);
164
164
  }
165
165
 
166
- const __ImportZodCore = 'zod/v4/core';
167
- async function generateZod(configOptions) {
168
- await __generateZodCoreUtil(configOptions);
169
- await __generateZodCoreSchemas(configOptions);
170
- }
171
- async function __generateZodCoreUtil(configOptions) {
172
- const pathZodCore = parseZodCorePath(configOptions.appDir);
173
- const fileSrc = path.join(pathZodCore, 'util.js');
174
- const fileSrcBak = path.join(pathZodCore, 'util-origin.js');
175
- copyTemplateIfNeed(fileSrc, fileSrcBak);
176
- const content = fse.readFileSync(fileSrcBak).toString();
177
- const contentNew = content.replace('export function finalizeIssue', `let __localeAdapterFn;
178
- export function setLocaleAdapter(localeAdapterFn) {
179
- __localeAdapterFn=localeAdapterFn;
180
- }
181
- export function finalizeIssue`).replace('const message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ??', `const msg = unwrapMessage(iss.inst?._zod.def?.error?.(iss));
182
- const message = (__localeAdapterFn?__localeAdapterFn(msg, iss):msg) ??`);
183
- fse.writeFileSync(fileSrc, contentNew);
184
- }
185
- async function __generateZodCoreSchemas(configOptions) {
186
- const pathZodCore = parseZodCorePath(configOptions.appDir);
187
- const fileSrc = path.join(pathZodCore, 'schemas.js');
188
- const fileSrcBak = path.join(pathZodCore, 'schemas-origin.js');
189
- copyTemplateIfNeed(fileSrc, fileSrcBak);
190
- const content = fse.readFileSync(fileSrcBak).toString();
191
- const contentNew = content.replace('export const $ZodType =', `let __parseAdapterFn;
192
- export function setParseAdapter(parseAdapterFn) {
193
- __parseAdapterFn = parseAdapterFn;
194
- }
195
- export const $ZodType =`).replace('inst._zod.run = inst._zod.parse;', 'inst._zod.run = __parseAdapterFn ? __parseAdapterFn(inst, inst._zod.parse) : inst._zod.parse;').replace(/inst._zod.run = (\(payload, ctx\) => \{[\s\S]*?return runChecks\(result, checks, ctx\);\s*\};)/, (_, $0) => {
196
- return `const __run = ${$0}\ninst._zod.run = __parseAdapterFn ? __parseAdapterFn(inst, __run) : __run;`;
197
- });
198
- fse.writeFileSync(fileSrc, contentNew);
199
- }
200
- function parseZodCorePath(appDir) {
201
- const require = createRequire(pathToHref(path.join(appDir, '/')));
202
- const fileCoreIndex = require.resolve(__ImportZodCore);
203
- return path.dirname(fileCoreIndex);
204
- }
166
+ // import { generateZod } from './generateZod.ts';
205
167
 
206
168
  async function generateEntryFiles(configMeta, configOptions, modulesMeta, env) {
207
169
  // config
@@ -215,7 +177,7 @@ async function generateEntryFiles(configMeta, configOptions, modulesMeta, env) {
215
177
  // others
216
178
  await __generateOthers();
217
179
  // zod
218
- await generateZod(configOptions);
180
+ // await generateZod(configOptions);
219
181
 
220
182
  //////////////////////////////
221
183
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vona-cli-set-api",
3
- "version": "1.1.11",
3
+ "version": "1.1.13",
4
4
  "gitHead": "a79189b882c17af5911573896a781bbb0046d37d",
5
5
  "description": "vona cli-set-api",
6
6
  "keywords": [
@@ -63,9 +63,9 @@
63
63
  "why-is-node-running": "^3.2.2",
64
64
  "yargs-parser": "^22.0.0",
65
65
  "@cabloy/cli": "^3.1.4",
66
+ "@cabloy/dotenv": "^1.2.4",
66
67
  "@cabloy/extend": "^3.2.4",
67
68
  "@cabloy/module-glob": "^5.3.4",
68
- "@cabloy/dotenv": "^1.2.4",
69
69
  "@cabloy/utils": "^2.1.4",
70
70
  "babel-plugin-vona-bean-module": "^1.1.4",
71
71
  "vona-core": "^5.1.4"