@povio/openapi-codegen-cli 3.2.0-rc.8 → 3.3.0-rc.1
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/README.md +2 -51
- package/dist/acl.d.mts +19 -6
- package/dist/acl.mjs +7 -6
- package/dist/{auth.context-YFWzkwoN.mjs → auth.context-BAz8frX9.mjs} +1 -2
- package/dist/{config-DgrOddSC.d.mts → config-BQqze8rU.d.mts} +2 -1
- package/dist/{error-handling-BMXC5P08.mjs → error-handling-CsnufAil.mjs} +12 -22
- package/dist/{error-handling-CNOHs4Fc.d.mts → error-handling-D6ZYITQ3.d.mts} +4 -1
- package/dist/generate.runner-BeCGJ1ar.mjs +87 -0
- package/dist/{generateCodeFromOpenAPIDoc-CZT3sThI.cjs → generateCodeFromOpenAPIDoc-KQT4kYxY.mjs} +2375 -1403
- package/dist/generator.d.mts +10 -3
- package/dist/generator.mjs +4 -6
- package/dist/index.d.mts +47 -12
- package/dist/index.mjs +3 -6
- package/dist/metro.cjs +4861 -112
- package/dist/metro.d.mts +4 -3
- package/dist/metro.mjs +3 -3
- package/dist/{openapi-codegen.runner-C93V7SGj.mjs → openapi-codegen.runner-nPBssrBL.mjs} +2 -2
- package/dist/{openapi-source.runner-BZ6ZLgRO.mjs → openapi-source.runner-8kCe-g9S.mjs} +6 -18
- package/dist/{openapi-source.runner-ykstqlPC.d.mts → openapi-source.runner-B6KKrXw7.d.mts} +8 -2
- package/dist/{options-KPf-Fti5.d.mts → options-DdQJ9BSc.d.mts} +1 -6
- package/dist/sh.d.mts +1 -1
- package/dist/sh.mjs +53 -36
- package/dist/tiny.d.mts +1 -1
- package/dist/tiny.mjs +1 -1
- package/dist/vite.d.mts +4 -3
- package/dist/vite.mjs +4 -5
- package/dist/zod.d.mts +7 -2
- package/dist/zod.mjs +1 -1
- package/package.json +22 -32
- package/dist/generate.runner-BvSprH6D.mjs +0 -1683
- package/dist/generate.utils-CH2U2Dpr.cjs +0 -2314
- package/dist/generateCodeFromOpenAPIDoc-glAKBEGP.mjs +0 -2036
- package/dist/getDataFromOpenAPIDoc-7RxjULpB.mjs +0 -2011
- package/dist/native-rest-interceptor-CAWR8H5Y.mjs +0 -208
- package/dist/native-rest-interceptor-Cz6saoq5.d.mts +0 -46
- package/dist/native.d.mts +0 -3
- package/dist/native.mjs +0 -3
- package/dist/openapi-codegen-native-darwin-arm64.node +0 -0
- package/dist/openapi-codegen-native-linux-x64.node +0 -0
- package/dist/openapi-codegen-native-win32-x64.node +0 -0
- package/dist/rest-transport.types-DM5-qyOJ.d.mts +0 -66
- package/dist/rest-transport.types-DxitRtsB.mjs +0 -11
- package/dist/rest.d.mts +0 -2
- package/dist/rest.mjs +0 -2
package/dist/metro.d.mts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { r as GenerateFileFormatter } from "./options-
|
|
2
|
-
import { t as OpenAPICodegenConfig } from "./config-
|
|
3
|
-
import { d as GenerateOpenApiFile, m as GenerateOpenApiSpec, n as TinyOpenApiSpecModuleConfig } from "./openapi-source.runner-
|
|
1
|
+
import { r as GenerateFileFormatter } from "./options-DdQJ9BSc.mjs";
|
|
2
|
+
import { t as OpenAPICodegenConfig } from "./config-BQqze8rU.mjs";
|
|
3
|
+
import { d as GenerateOpenApiFile, m as GenerateOpenApiSpec, n as TinyOpenApiSpecModuleConfig } from "./openapi-source.runner-B6KKrXw7.mjs";
|
|
4
4
|
import { IncomingMessage, ServerResponse } from "http";
|
|
5
|
+
|
|
5
6
|
//#region src/metro/openapi-codegen.plugin.d.ts
|
|
6
7
|
type OpenApiCodegenMetroConfig = OpenAPICodegenConfig & {
|
|
7
8
|
formatGeneratedFile?: GenerateFileFormatter;
|
package/dist/metro.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as createOpenApiCodegenRunner } from "./openapi-codegen.runner-
|
|
2
|
-
import { i as normalizeWatchFolders, r as isTinyOpenApiFakeMode, t as createTinyOpenApiSourceRunner } from "./openapi-source.runner-
|
|
1
|
+
import { t as createOpenApiCodegenRunner } from "./openapi-codegen.runner-nPBssrBL.mjs";
|
|
2
|
+
import { i as normalizeWatchFolders, r as isTinyOpenApiFakeMode, t as createTinyOpenApiSourceRunner } from "./openapi-source.runner-8kCe-g9S.mjs";
|
|
3
3
|
import fs from "fs";
|
|
4
4
|
import path from "path";
|
|
5
5
|
//#region src/metro/openapi-codegen.plugin.ts
|
|
@@ -83,7 +83,7 @@ function reportWatcherError$1(error) {
|
|
|
83
83
|
}
|
|
84
84
|
//#endregion
|
|
85
85
|
//#region src/metro/tiny-openapi-codegen.plugin.ts
|
|
86
|
-
const watchedEvents =
|
|
86
|
+
const watchedEvents = new Set(["change", "rename"]);
|
|
87
87
|
function tinyOpenApiCodegenMetro(metroConfig, codegenConfig, options) {
|
|
88
88
|
if (isPromiseLike(metroConfig)) return metroConfig.then((resolvedConfig) => withResolvedTinyOpenApiCodegen(resolvedConfig, codegenConfig, options));
|
|
89
89
|
return withResolvedTinyOpenApiCodegen(metroConfig, codegenConfig, options);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { x as Profiler } from "./generateCodeFromOpenAPIDoc-KQT4kYxY.mjs";
|
|
2
|
+
import { t as runGenerate } from "./generate.runner-BeCGJ1ar.mjs";
|
|
2
3
|
import path from "path";
|
|
3
4
|
//#region src/plugins/openapi-codegen.runner.ts
|
|
4
5
|
function createOpenApiCodegenRunner(config, options = {}) {
|
|
@@ -12,7 +13,6 @@ function createOpenApiCodegenRunner(config, options = {}) {
|
|
|
12
13
|
formatGeneratedFile,
|
|
13
14
|
profiler
|
|
14
15
|
});
|
|
15
|
-
for (const line of profiler.formatLines()) console.info(`[openapi-codegen] ${line}`);
|
|
16
16
|
options.onGenerated?.();
|
|
17
17
|
});
|
|
18
18
|
queue = run.then(() => void 0, () => void 0);
|
|
@@ -19,7 +19,7 @@ const PAGINATION_PROPERTY_NAMES = [
|
|
|
19
19
|
"limit",
|
|
20
20
|
"totalItems"
|
|
21
21
|
];
|
|
22
|
-
const OPENAPI_31_ONLY_KEYS =
|
|
22
|
+
const OPENAPI_31_ONLY_KEYS = new Set([
|
|
23
23
|
"$schema",
|
|
24
24
|
"$id",
|
|
25
25
|
"$vocabulary",
|
|
@@ -585,18 +585,13 @@ function toOpenAPI30Document(spec) {
|
|
|
585
585
|
return converted;
|
|
586
586
|
}
|
|
587
587
|
async function generateORPCOpenAPISpec(options) {
|
|
588
|
-
const
|
|
589
|
-
const
|
|
590
|
-
const
|
|
591
|
-
const
|
|
588
|
+
const [{ OpenAPIGenerator }, { ZodToJsonSchemaConverter }] = await Promise.all([importRuntimeModule("@orpc/openapi"), importRuntimeModule("@orpc/zod/zod4")]);
|
|
589
|
+
const generator = new OpenAPIGenerator({ schemaConverters: [new ZodToJsonSchemaConverter()] });
|
|
590
|
+
const explicitSchemaName = options.getOpenApiSchemaName ?? getOpenApiSchemaName;
|
|
591
|
+
const modelSchemas = await collectModelSchemaExports({
|
|
592
592
|
apiRoot: options.apiRoot,
|
|
593
593
|
dbTablesRoot: options.dbTablesRoot
|
|
594
594
|
});
|
|
595
|
-
const [[{ OpenAPIGenerator }, { ZodToJsonSchemaConverter }], modelSchemas] = await Promise.all([runtimePromise, modelSchemasPromise]);
|
|
596
|
-
const generator = new OpenAPIGenerator({ schemaConverters: [new ZodToJsonSchemaConverter()] });
|
|
597
|
-
const afterRuntime = performance.now();
|
|
598
|
-
const explicitSchemaName = options.getOpenApiSchemaName ?? getOpenApiSchemaName;
|
|
599
|
-
const afterModels = performance.now();
|
|
600
595
|
const getSchemaName = createModelSchemaNameGetter(modelSchemas, explicitSchemaName);
|
|
601
596
|
const operationMeta = collectOperationMeta(options.contract);
|
|
602
597
|
const extraSchemas = collectExtraSchemas(options.apiModules);
|
|
@@ -612,7 +607,6 @@ async function generateORPCOpenAPISpec(options) {
|
|
|
612
607
|
...extraSchemas,
|
|
613
608
|
...reachableModelSchemas
|
|
614
609
|
};
|
|
615
|
-
const afterCollection = performance.now();
|
|
616
610
|
const spec = await generator.generate(options.contract, {
|
|
617
611
|
info: options.info ?? {
|
|
618
612
|
title: "Tiny Template Fake API",
|
|
@@ -626,7 +620,6 @@ async function generateORPCOpenAPISpec(options) {
|
|
|
626
620
|
...Object.keys(commonSchemas).length > 0 ? { commonSchemas } : {}
|
|
627
621
|
});
|
|
628
622
|
const jsonSpec = spec;
|
|
629
|
-
const afterGeneration = performance.now();
|
|
630
623
|
const sortableSchemaNames = options.realBackendSortableSchemaNames instanceof Map ? options.realBackendSortableSchemaNames : new Map(Object.entries(options.realBackendSortableSchemaNames ?? {}));
|
|
631
624
|
applyOperationMeta(jsonSpec, operationMeta, options.apiModules);
|
|
632
625
|
applyEnumExtensions(spec);
|
|
@@ -649,12 +642,7 @@ async function generateORPCOpenAPISpec(options) {
|
|
|
649
642
|
}
|
|
650
643
|
applyRobodevModuleExtensions(jsonSpec, robodevModuleExtensions, options.apiModules);
|
|
651
644
|
applyRobodevUserRolesExtension(jsonSpec, userRoles);
|
|
652
|
-
|
|
653
|
-
if (profile) {
|
|
654
|
-
const finished = performance.now();
|
|
655
|
-
console.error(`tiny openapi profile runtime=${(afterRuntime - started).toFixed(1)}ms models=${(afterModels - afterRuntime).toFixed(1)}ms collection=${(afterCollection - afterModels).toFixed(1)}ms orpc=${(afterGeneration - afterCollection).toFixed(1)}ms post=${(finished - afterGeneration).toFixed(1)}ms total=${(finished - started).toFixed(1)}ms`);
|
|
656
|
-
}
|
|
657
|
-
return output;
|
|
645
|
+
return toOpenAPI30Document(jsonSpec);
|
|
658
646
|
}
|
|
659
647
|
//#endregion
|
|
660
648
|
//#region src/tiny/openapi-source.runner.ts
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { t as OpenAPICodegenConfig } from "./config-
|
|
1
|
+
import { t as OpenAPICodegenConfig } from "./config-BQqze8rU.mjs";
|
|
2
|
+
|
|
2
3
|
//#region src/tiny/openapi.d.ts
|
|
3
4
|
interface GenerateOpenApiFileOptions {
|
|
4
5
|
argv?: readonly string[];
|
|
@@ -78,7 +79,12 @@ interface OrpcContractProcedureData {
|
|
|
78
79
|
successStatus?: number;
|
|
79
80
|
};
|
|
80
81
|
}
|
|
81
|
-
declare function resolveOpenApiOutputPath({
|
|
82
|
+
declare function resolveOpenApiOutputPath({
|
|
83
|
+
argv,
|
|
84
|
+
cwd,
|
|
85
|
+
defaultOutput,
|
|
86
|
+
env
|
|
87
|
+
}: GenerateOpenApiFileOptions): string;
|
|
82
88
|
declare function generateOpenApiFile(options: GenerateTinyOpenApiFileOptions): Promise<GenerateOpenApiFileResult>;
|
|
83
89
|
declare function defineOpenApiSchemas<const TSchemas extends OpenApiSchemaRegistry>(schemas: TSchemas): TSchemas;
|
|
84
90
|
declare function collectExtraSchemas<TModules extends Record<string, {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { OpenAPIV3 } from "openapi-types";
|
|
2
|
+
|
|
2
3
|
//#region src/generators/types/generate.d.ts
|
|
3
4
|
declare enum GenerateType {
|
|
4
5
|
Models = "models",
|
|
@@ -18,7 +19,6 @@ interface ZodGenerateOptions {
|
|
|
18
19
|
schemaSuffix: string;
|
|
19
20
|
enumSuffix: string;
|
|
20
21
|
modelsInCommon?: boolean;
|
|
21
|
-
modelsInModules?: boolean;
|
|
22
22
|
withImplicitRequiredProps?: boolean;
|
|
23
23
|
withDefaultValues?: boolean;
|
|
24
24
|
withDescription?: boolean;
|
|
@@ -27,9 +27,7 @@ interface ZodGenerateOptions {
|
|
|
27
27
|
replaceOptionalWithNullish?: boolean;
|
|
28
28
|
}
|
|
29
29
|
interface EndpointsGenerateOptions {
|
|
30
|
-
restClient: "axios" | "native";
|
|
31
30
|
restClientImportPath: string;
|
|
32
|
-
zodImportPath: string;
|
|
33
31
|
errorHandlingImportPath?: string;
|
|
34
32
|
withDeprecatedEndpoints?: boolean;
|
|
35
33
|
removeOperationPrefixEndingWith?: string;
|
|
@@ -39,7 +37,6 @@ interface EndpointsGenerateOptions {
|
|
|
39
37
|
}
|
|
40
38
|
interface QueriesGenerateOptions {
|
|
41
39
|
queryTypesImportPath: string;
|
|
42
|
-
mutationEffectsImportPath: string;
|
|
43
40
|
axiosRequestConfig?: boolean;
|
|
44
41
|
mutationEffects?: boolean;
|
|
45
42
|
mutationDefaultOnError?: boolean;
|
|
@@ -67,7 +64,6 @@ interface ACLGenerateOptions {
|
|
|
67
64
|
checkAcl?: boolean;
|
|
68
65
|
abilityContextGenericAppAbilities: boolean;
|
|
69
66
|
abilityContextImportPath?: string;
|
|
70
|
-
aclCheckImportPath: string;
|
|
71
67
|
}
|
|
72
68
|
interface BuilderConfigsGenerateOptions {
|
|
73
69
|
builderConfigs?: boolean;
|
|
@@ -92,7 +88,6 @@ interface BaseGenerateOptions {
|
|
|
92
88
|
excludePathRegex: string;
|
|
93
89
|
excludeRedundantZodSchemas: boolean;
|
|
94
90
|
tsNamespaces: boolean;
|
|
95
|
-
treeShakeableNamespaces?: boolean;
|
|
96
91
|
tsPath: string;
|
|
97
92
|
importPath: "ts" | "relative" | "absolute";
|
|
98
93
|
configs: Record<GenerateType, GenerateConfig>;
|
package/dist/sh.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {}
|
|
1
|
+
export { };
|
package/dist/sh.mjs
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { S as VALIDATION_ERROR_TYPE_TITLE, a as getDataFromOpenAPIDoc, m as groupByType, n as getOutputFileName, u as getTagFileName, x as Profiler } from "./generateCodeFromOpenAPIDoc-KQT4kYxY.mjs";
|
|
3
|
+
import { n as resolveConfig, t as runGenerate } from "./generate.runner-BeCGJ1ar.mjs";
|
|
4
|
+
import { createRequire } from "node:module";
|
|
4
5
|
import yargs from "yargs";
|
|
5
6
|
import { hideBin } from "yargs/helpers";
|
|
6
7
|
import { styleText } from "node:util";
|
|
7
|
-
import fs from "fs";
|
|
8
|
+
import fs, { existsSync, rmSync, writeFileSync } from "fs";
|
|
8
9
|
import "reflect-metadata";
|
|
9
10
|
import path from "path";
|
|
11
|
+
import SwaggerParser from "@apidevtools/swagger-parser";
|
|
10
12
|
import { exec } from "child_process";
|
|
13
|
+
//#region \0rolldown/runtime.js
|
|
14
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
15
|
+
//#endregion
|
|
11
16
|
//#region src/helpers/cli.helper.ts
|
|
12
17
|
function log(message) {
|
|
13
18
|
console.log(message);
|
|
@@ -31,7 +36,7 @@ function logBanner(message) {
|
|
|
31
36
|
* Fetch the version from package.json
|
|
32
37
|
*/
|
|
33
38
|
function getVersion() {
|
|
34
|
-
return "3.
|
|
39
|
+
return "3.3.0-rc.1";
|
|
35
40
|
}
|
|
36
41
|
//#endregion
|
|
37
42
|
//#region src/helpers/yargs.helper.ts
|
|
@@ -125,16 +130,50 @@ async function loadConfigFromPath(filePath) {
|
|
|
125
130
|
const ext = path.extname(absolutePath).toLowerCase();
|
|
126
131
|
if (ext === ".mjs") return loadMjsConfig(absolutePath);
|
|
127
132
|
if (ext !== ".ts") throw new Error(`Only ESM (.mjs) and TypeScript (.ts) configuration files are supported. Found: ${ext}`);
|
|
128
|
-
return
|
|
133
|
+
return loadTsConfig(absolutePath);
|
|
129
134
|
}
|
|
130
135
|
async function loadMjsConfig(filePath) {
|
|
131
|
-
return loadModuleConfig(filePath, "ESM");
|
|
132
|
-
}
|
|
133
|
-
async function loadModuleConfig(filePath, format) {
|
|
134
136
|
const imported = await import(`${pathToFileURL(filePath).href}?t=${Date.now()}`);
|
|
135
|
-
if (!imported.default) throw new Error(
|
|
137
|
+
if (!imported.default) throw new Error(`ESM config must have a default export: ${filePath}`);
|
|
136
138
|
return imported.default;
|
|
137
139
|
}
|
|
140
|
+
let importFresh;
|
|
141
|
+
const loadJsSync = function loadJsSync(filepath) {
|
|
142
|
+
if (importFresh === void 0) importFresh = __require("import-fresh");
|
|
143
|
+
return importFresh(filepath);
|
|
144
|
+
};
|
|
145
|
+
let typescript;
|
|
146
|
+
async function loadTsConfig(filePath) {
|
|
147
|
+
if (typescript === void 0) typescript = __require("typescript");
|
|
148
|
+
const transpiledFilepath = `${filePath.slice(0, -2)}cjs`;
|
|
149
|
+
try {
|
|
150
|
+
const tsConfig = resolveTsConfig(path.dirname(filePath)) ?? {};
|
|
151
|
+
tsConfig.compilerOptions = Object.assign({}, tsConfig.compilerOptions, {
|
|
152
|
+
module: typescript.ModuleKind.NodeNext,
|
|
153
|
+
moduleResolution: typescript.ModuleResolutionKind.NodeNext,
|
|
154
|
+
target: typescript.ScriptTarget.ES2022,
|
|
155
|
+
noEmit: false
|
|
156
|
+
});
|
|
157
|
+
const fileContent = fs.readFileSync(filePath, "utf-8");
|
|
158
|
+
const transpiledFileContent = typescript.transpileModule(fileContent, tsConfig).outputText;
|
|
159
|
+
writeFileSync(transpiledFilepath, transpiledFileContent);
|
|
160
|
+
return loadJsSync(transpiledFilepath).default;
|
|
161
|
+
} catch (error) {
|
|
162
|
+
error.message = `TypeScript Error in ${filePath}:\n${error.message}`;
|
|
163
|
+
throw error;
|
|
164
|
+
} finally {
|
|
165
|
+
if (existsSync(transpiledFilepath)) rmSync(transpiledFilepath);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
function resolveTsConfig(directory) {
|
|
169
|
+
const filePath = typescript.findConfigFile(directory, (fileName) => {
|
|
170
|
+
return typescript.sys.fileExists(fileName);
|
|
171
|
+
});
|
|
172
|
+
if (filePath === void 0) return;
|
|
173
|
+
const { config, error } = typescript.readConfigFile(filePath, (path) => typescript.sys.readFile(path));
|
|
174
|
+
if (error) throw new Error(`Error in ${filePath}: ${error.messageText.toString()}`);
|
|
175
|
+
return config;
|
|
176
|
+
}
|
|
138
177
|
function pathToFileURL(filePath) {
|
|
139
178
|
const normalizedPath = path.resolve(filePath).replace(/\\/g, "/");
|
|
140
179
|
return { href: normalizedPath.startsWith("/") ? `file://${normalizedPath}` : `file:///${normalizedPath}` };
|
|
@@ -144,25 +183,24 @@ function pathToFileURL(filePath) {
|
|
|
144
183
|
async function check({ verbose, config: configParam, includeTags: _includeTagsParam, excludeTags: _excludeTagsParam, ...params }) {
|
|
145
184
|
const start = Date.now();
|
|
146
185
|
if (verbose) logInfo("Resolving config...");
|
|
147
|
-
const fileConfig = await loadConfig(configParam);
|
|
148
186
|
const config = resolveConfig({
|
|
149
|
-
fileConfig,
|
|
187
|
+
fileConfig: await loadConfig(configParam),
|
|
150
188
|
params
|
|
151
189
|
});
|
|
152
190
|
if (verbose) logInfo("Parsing OpenAPI spec...");
|
|
153
|
-
const openApiDoc = await
|
|
191
|
+
const openApiDoc = await SwaggerParser.bundle(config.input);
|
|
154
192
|
if (verbose) logInfo("Running check...");
|
|
155
193
|
const errorMessages = checkOpenAPIDoc(openApiDoc, config);
|
|
156
194
|
if (errorMessages.length === 0) logSuccess(`Time: ${Date.now() - start}ms`);
|
|
157
195
|
else throw new Error(`Found ${errorMessages.length} issues. Time: ${Date.now() - start}ms`);
|
|
158
196
|
}
|
|
159
197
|
//#endregion
|
|
160
|
-
//#region \0@oxc-project+runtime@0.
|
|
198
|
+
//#region \0@oxc-project+runtime@0.127.0/helpers/decorateMetadata.js
|
|
161
199
|
function __decorateMetadata(k, v) {
|
|
162
200
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
163
201
|
}
|
|
164
202
|
//#endregion
|
|
165
|
-
//#region \0@oxc-project+runtime@0.
|
|
203
|
+
//#region \0@oxc-project+runtime@0.127.0/helpers/decorate.js
|
|
166
204
|
function __decorate(decorators, target, key, desc) {
|
|
167
205
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
168
206
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -253,7 +291,6 @@ var GenerateOptions = class {
|
|
|
253
291
|
clearOutput;
|
|
254
292
|
incremental;
|
|
255
293
|
tsNamespaces;
|
|
256
|
-
treeShakeableNamespaces;
|
|
257
294
|
tsPath;
|
|
258
295
|
splitByTags;
|
|
259
296
|
defaultTag;
|
|
@@ -264,11 +301,6 @@ var GenerateOptions = class {
|
|
|
264
301
|
importPath;
|
|
265
302
|
extractEnums;
|
|
266
303
|
modelsInCommon;
|
|
267
|
-
modelsInModules;
|
|
268
|
-
zodImportPath;
|
|
269
|
-
restClient;
|
|
270
|
-
mutationEffectsImportPath;
|
|
271
|
-
aclCheckImportPath;
|
|
272
304
|
removeOperationPrefixEndingWith;
|
|
273
305
|
acl;
|
|
274
306
|
checkAcl;
|
|
@@ -303,10 +335,6 @@ __decorate([YargOption({
|
|
|
303
335
|
envAlias: "tsNamespaces",
|
|
304
336
|
type: "boolean"
|
|
305
337
|
}), __decorateMetadata("design:type", Boolean)], GenerateOptions.prototype, "tsNamespaces", void 0);
|
|
306
|
-
__decorate([YargOption({
|
|
307
|
-
envAlias: "treeShakeableNamespaces",
|
|
308
|
-
type: "boolean"
|
|
309
|
-
}), __decorateMetadata("design:type", Boolean)], GenerateOptions.prototype, "treeShakeableNamespaces", void 0);
|
|
310
338
|
__decorate([YargOption({ envAlias: "tsPath" }), __decorateMetadata("design:type", String)], GenerateOptions.prototype, "tsPath", void 0);
|
|
311
339
|
__decorate([YargOption({
|
|
312
340
|
envAlias: "splitByTags",
|
|
@@ -329,17 +357,6 @@ __decorate([YargOption({
|
|
|
329
357
|
envAlias: "modelsInCommon",
|
|
330
358
|
type: "boolean"
|
|
331
359
|
}), __decorateMetadata("design:type", Boolean)], GenerateOptions.prototype, "modelsInCommon", void 0);
|
|
332
|
-
__decorate([YargOption({
|
|
333
|
-
envAlias: "modelsInModules",
|
|
334
|
-
type: "boolean"
|
|
335
|
-
}), __decorateMetadata("design:type", Boolean)], GenerateOptions.prototype, "modelsInModules", void 0);
|
|
336
|
-
__decorate([YargOption({ envAlias: "zodImportPath" }), __decorateMetadata("design:type", String)], GenerateOptions.prototype, "zodImportPath", void 0);
|
|
337
|
-
__decorate([YargOption({
|
|
338
|
-
envAlias: "restClient",
|
|
339
|
-
choices: ["axios", "native"]
|
|
340
|
-
}), __decorateMetadata("design:type", String)], GenerateOptions.prototype, "restClient", void 0);
|
|
341
|
-
__decorate([YargOption({ envAlias: "mutationEffectsImportPath" }), __decorateMetadata("design:type", String)], GenerateOptions.prototype, "mutationEffectsImportPath", void 0);
|
|
342
|
-
__decorate([YargOption({ envAlias: "aclCheckImportPath" }), __decorateMetadata("design:type", String)], GenerateOptions.prototype, "aclCheckImportPath", void 0);
|
|
343
360
|
__decorate([YargOption({ envAlias: "removeOperationPrefixEndingWith" }), __decorateMetadata("design:type", String)], GenerateOptions.prototype, "removeOperationPrefixEndingWith", void 0);
|
|
344
361
|
__decorate([YargOption({
|
|
345
362
|
envAlias: "acl",
|
package/dist/tiny.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as getModuleOpenApiTag, A as collectApiModelSchemaExports, At as toOpenAPI30Document, B as collectReachableModelSchemas, C as applyEnumExtensions, Ct as procedureSchemaName, D as applyRobodevModuleExtensions, Dt as schemaExportName, E as applyParameterExtensions, Et as schemaComponentRef, F as collectExtraSchemas, G as findComponentEnumNames, H as compactTagName, I as collectModelSchemaExports, J as generateOpenApiFile, K as findEnumNames, L as collectModuleModelSchemaExports, M as collectContractSchemas, Mt as toOpenAPIAclRule, N as collectDbTableModelSchemaExport, Nt as toPascalCase, O as applyRobodevUserRolesExtension, Ot as sharedSchemaExportName, P as collectDbTableModelSchemaExports, Pt as visitZodSchema, Q as getModuleOpenApiController, R as collectOperationMeta, S as addContractSchema, St as operationKey, T as applyPaginatedItemSchemas, Tt as routeHasPathParameters, U as createModelSchemaNameGetter, V as collectSchemaRegistryRoots, W as defineOpenApiSchemas, X as getContractProcedureData, Y as getComponentSchemas, Z as getDerivedOperationId, _ as OpenApiSchemaRegistry, _t as namedControllerActionSchema, a as isTinyOpenApiFakeMode, at as getProcedureInputSchemaRole, b as TinyOpenApiUserRole, bt as namedOpenApiResponseSchema, c as AnyContractRouter, ct as isContractProcedure, d as GenerateOpenApiFile, dt as isObject, et as getObjectPropertySchema, f as GenerateOpenApiFileOptions, ft as isProcedureMeta, g as JsonObject, gt as namedControllerActionInputDtoSchema, h as GenerateTinyOpenApiFileOptions, ht as modelSchemaNameEntries, i as getLocalInputPath, it as getPaginatedItemSchema, j as collectContractSchemaRoots, jt as toOpenAPI30Schema, k as asStringArray, kt as stripNoContentResponseBodies, l as AnySchema, lt as isNullSchema, m as GenerateOpenApiSpec, mt as modelSchemaExportName, nt as getOperationAction, o as normalizeWatchFolders, ot as getRobodevModuleRoles, p as GenerateOpenApiFileResult, pt as isZodSchema, q as generateORPCOpenAPISpec, r as createTinyOpenApiSourceRunner, rt as getOperationController, s as AclRule, st as getStringEnumValues, t as TinyOpenApiSourceRunnerConfig, tt as getOpenApiSchemaName, u as GenerateORPCOpenAPISpecOptions, ut as isNullableOnlySchema, v as ProcedureMeta, vt as namedOpenApiOutputSchema, w as applyOperationMeta, wt as resolveOpenApiOutputPath, x as ZodSchema, xt as namedOpenApiSchema, y as TinyOpenApiModule, yt as namedOpenApiRequestSchema, z as collectOperationTags } from "./openapi-source.runner-
|
|
1
|
+
import { $ as getModuleOpenApiTag, A as collectApiModelSchemaExports, At as toOpenAPI30Document, B as collectReachableModelSchemas, C as applyEnumExtensions, Ct as procedureSchemaName, D as applyRobodevModuleExtensions, Dt as schemaExportName, E as applyParameterExtensions, Et as schemaComponentRef, F as collectExtraSchemas, G as findComponentEnumNames, H as compactTagName, I as collectModelSchemaExports, J as generateOpenApiFile, K as findEnumNames, L as collectModuleModelSchemaExports, M as collectContractSchemas, Mt as toOpenAPIAclRule, N as collectDbTableModelSchemaExport, Nt as toPascalCase, O as applyRobodevUserRolesExtension, Ot as sharedSchemaExportName, P as collectDbTableModelSchemaExports, Pt as visitZodSchema, Q as getModuleOpenApiController, R as collectOperationMeta, S as addContractSchema, St as operationKey, T as applyPaginatedItemSchemas, Tt as routeHasPathParameters, U as createModelSchemaNameGetter, V as collectSchemaRegistryRoots, W as defineOpenApiSchemas, X as getContractProcedureData, Y as getComponentSchemas, Z as getDerivedOperationId, _ as OpenApiSchemaRegistry, _t as namedControllerActionSchema, a as isTinyOpenApiFakeMode, at as getProcedureInputSchemaRole, b as TinyOpenApiUserRole, bt as namedOpenApiResponseSchema, c as AnyContractRouter, ct as isContractProcedure, d as GenerateOpenApiFile, dt as isObject, et as getObjectPropertySchema, f as GenerateOpenApiFileOptions, ft as isProcedureMeta, g as JsonObject, gt as namedControllerActionInputDtoSchema, h as GenerateTinyOpenApiFileOptions, ht as modelSchemaNameEntries, i as getLocalInputPath, it as getPaginatedItemSchema, j as collectContractSchemaRoots, jt as toOpenAPI30Schema, k as asStringArray, kt as stripNoContentResponseBodies, l as AnySchema, lt as isNullSchema, m as GenerateOpenApiSpec, mt as modelSchemaExportName, nt as getOperationAction, o as normalizeWatchFolders, ot as getRobodevModuleRoles, p as GenerateOpenApiFileResult, pt as isZodSchema, q as generateORPCOpenAPISpec, r as createTinyOpenApiSourceRunner, rt as getOperationController, s as AclRule, st as getStringEnumValues, t as TinyOpenApiSourceRunnerConfig, tt as getOpenApiSchemaName, u as GenerateORPCOpenAPISpecOptions, ut as isNullableOnlySchema, v as ProcedureMeta, vt as namedOpenApiOutputSchema, w as applyOperationMeta, wt as resolveOpenApiOutputPath, x as ZodSchema, xt as namedOpenApiSchema, y as TinyOpenApiModule, yt as namedOpenApiRequestSchema, z as collectOperationTags } from "./openapi-source.runner-B6KKrXw7.mjs";
|
|
2
2
|
export { AclRule, AnyContractRouter, AnySchema, GenerateORPCOpenAPISpecOptions, GenerateOpenApiFile, GenerateOpenApiFileOptions, GenerateOpenApiFileResult, GenerateOpenApiSpec, GenerateTinyOpenApiFileOptions, JsonObject, OpenApiSchemaRegistry, ProcedureMeta, TinyOpenApiModule, type TinyOpenApiSourceRunnerConfig, TinyOpenApiUserRole, ZodSchema, addContractSchema, applyEnumExtensions, applyOperationMeta, applyPaginatedItemSchemas, applyParameterExtensions, applyRobodevModuleExtensions, applyRobodevUserRolesExtension, asStringArray, collectApiModelSchemaExports, collectContractSchemaRoots, collectContractSchemas, collectDbTableModelSchemaExport, collectDbTableModelSchemaExports, collectExtraSchemas, collectModelSchemaExports, collectModuleModelSchemaExports, collectOperationMeta, collectOperationTags, collectReachableModelSchemas, collectSchemaRegistryRoots, compactTagName, createModelSchemaNameGetter, createTinyOpenApiSourceRunner, defineOpenApiSchemas, findComponentEnumNames, findEnumNames, generateORPCOpenAPISpec, generateOpenApiFile, getComponentSchemas, getContractProcedureData, getDerivedOperationId, getModuleOpenApiController, getModuleOpenApiTag, getObjectPropertySchema, getOpenApiSchemaName, getOperationAction, getOperationController, getPaginatedItemSchema, getProcedureInputSchemaRole, getRobodevModuleRoles, getStringEnumValues, getLocalInputPath as getTinyOpenApiLocalInputPath, isContractProcedure, isNullSchema, isNullableOnlySchema, isObject, isProcedureMeta, isTinyOpenApiFakeMode, isZodSchema, modelSchemaExportName, modelSchemaNameEntries, namedControllerActionInputDtoSchema, namedControllerActionSchema, namedOpenApiOutputSchema, namedOpenApiRequestSchema, namedOpenApiResponseSchema, namedOpenApiSchema, normalizeWatchFolders as normalizeTinyOpenApiWatchFolders, operationKey, procedureSchemaName, resolveOpenApiOutputPath, routeHasPathParameters, schemaComponentRef, schemaExportName, sharedSchemaExportName, stripNoContentResponseBodies, toOpenAPI30Document, toOpenAPI30Schema, toOpenAPIAclRule, toPascalCase, visitZodSchema };
|
package/dist/tiny.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as namedControllerActionInputDtoSchema, A as generateORPCOpenAPISpec, B as getOperationController, C as collectReachableModelSchemas, D as defineOpenApiSchemas, E as createModelSchemaNameGetter, F as getModuleOpenApiController, G as isContractProcedure, H as getProcedureInputSchemaRole, I as getModuleOpenApiTag, J as isObject, K as isNullSchema, L as getObjectPropertySchema, M as getComponentSchemas, N as getContractProcedureData, O as findComponentEnumNames, P as getDerivedOperationId, Q as modelSchemaNameEntries, R as getOpenApiSchemaName, S as collectOperationTags, T as compactTagName, U as getRobodevModuleRoles, V as getPaginatedItemSchema, W as getStringEnumValues, X as isZodSchema, Y as isProcedureMeta, Z as modelSchemaExportName, _ as collectDbTableModelSchemaExports, _t as visitZodSchema, a as addContractSchema, at as operationKey, b as collectModuleModelSchemaExports, c as applyPaginatedItemSchemas, ct as routeHasPathParameters, d as applyRobodevUserRolesExtension, dt as sharedSchemaExportName, et as namedControllerActionSchema, f as asStringArray, ft as stripNoContentResponseBodies, g as collectDbTableModelSchemaExport, gt as toPascalCase, h as collectContractSchemas, ht as toOpenAPIAclRule, i as normalizeWatchFolders, it as namedOpenApiSchema, j as generateOpenApiFile, k as findEnumNames, l as applyParameterExtensions, lt as schemaComponentRef, m as collectContractSchemaRoots, mt as toOpenAPI30Schema, n as getLocalInputPath, nt as namedOpenApiRequestSchema, o as applyEnumExtensions, ot as procedureSchemaName, p as collectApiModelSchemaExports, pt as toOpenAPI30Document, q as isNullableOnlySchema, r as isTinyOpenApiFakeMode, rt as namedOpenApiResponseSchema, s as applyOperationMeta, st as resolveOpenApiOutputPath, t as createTinyOpenApiSourceRunner, tt as namedOpenApiOutputSchema, u as applyRobodevModuleExtensions, ut as schemaExportName, v as collectExtraSchemas, w as collectSchemaRegistryRoots, x as collectOperationMeta, y as collectModelSchemaExports, z as getOperationAction } from "./openapi-source.runner-
|
|
1
|
+
import { $ as namedControllerActionInputDtoSchema, A as generateORPCOpenAPISpec, B as getOperationController, C as collectReachableModelSchemas, D as defineOpenApiSchemas, E as createModelSchemaNameGetter, F as getModuleOpenApiController, G as isContractProcedure, H as getProcedureInputSchemaRole, I as getModuleOpenApiTag, J as isObject, K as isNullSchema, L as getObjectPropertySchema, M as getComponentSchemas, N as getContractProcedureData, O as findComponentEnumNames, P as getDerivedOperationId, Q as modelSchemaNameEntries, R as getOpenApiSchemaName, S as collectOperationTags, T as compactTagName, U as getRobodevModuleRoles, V as getPaginatedItemSchema, W as getStringEnumValues, X as isZodSchema, Y as isProcedureMeta, Z as modelSchemaExportName, _ as collectDbTableModelSchemaExports, _t as visitZodSchema, a as addContractSchema, at as operationKey, b as collectModuleModelSchemaExports, c as applyPaginatedItemSchemas, ct as routeHasPathParameters, d as applyRobodevUserRolesExtension, dt as sharedSchemaExportName, et as namedControllerActionSchema, f as asStringArray, ft as stripNoContentResponseBodies, g as collectDbTableModelSchemaExport, gt as toPascalCase, h as collectContractSchemas, ht as toOpenAPIAclRule, i as normalizeWatchFolders, it as namedOpenApiSchema, j as generateOpenApiFile, k as findEnumNames, l as applyParameterExtensions, lt as schemaComponentRef, m as collectContractSchemaRoots, mt as toOpenAPI30Schema, n as getLocalInputPath, nt as namedOpenApiRequestSchema, o as applyEnumExtensions, ot as procedureSchemaName, p as collectApiModelSchemaExports, pt as toOpenAPI30Document, q as isNullableOnlySchema, r as isTinyOpenApiFakeMode, rt as namedOpenApiResponseSchema, s as applyOperationMeta, st as resolveOpenApiOutputPath, t as createTinyOpenApiSourceRunner, tt as namedOpenApiOutputSchema, u as applyRobodevModuleExtensions, ut as schemaExportName, v as collectExtraSchemas, w as collectSchemaRegistryRoots, x as collectOperationMeta, y as collectModelSchemaExports, z as getOperationAction } from "./openapi-source.runner-8kCe-g9S.mjs";
|
|
2
2
|
export { addContractSchema, applyEnumExtensions, applyOperationMeta, applyPaginatedItemSchemas, applyParameterExtensions, applyRobodevModuleExtensions, applyRobodevUserRolesExtension, asStringArray, collectApiModelSchemaExports, collectContractSchemaRoots, collectContractSchemas, collectDbTableModelSchemaExport, collectDbTableModelSchemaExports, collectExtraSchemas, collectModelSchemaExports, collectModuleModelSchemaExports, collectOperationMeta, collectOperationTags, collectReachableModelSchemas, collectSchemaRegistryRoots, compactTagName, createModelSchemaNameGetter, createTinyOpenApiSourceRunner, defineOpenApiSchemas, findComponentEnumNames, findEnumNames, generateORPCOpenAPISpec, generateOpenApiFile, getComponentSchemas, getContractProcedureData, getDerivedOperationId, getModuleOpenApiController, getModuleOpenApiTag, getObjectPropertySchema, getOpenApiSchemaName, getOperationAction, getOperationController, getPaginatedItemSchema, getProcedureInputSchemaRole, getRobodevModuleRoles, getStringEnumValues, getLocalInputPath as getTinyOpenApiLocalInputPath, isContractProcedure, isNullSchema, isNullableOnlySchema, isObject, isProcedureMeta, isTinyOpenApiFakeMode, isZodSchema, modelSchemaExportName, modelSchemaNameEntries, namedControllerActionInputDtoSchema, namedControllerActionSchema, namedOpenApiOutputSchema, namedOpenApiRequestSchema, namedOpenApiResponseSchema, namedOpenApiSchema, normalizeWatchFolders as normalizeTinyOpenApiWatchFolders, operationKey, procedureSchemaName, resolveOpenApiOutputPath, routeHasPathParameters, schemaComponentRef, schemaExportName, sharedSchemaExportName, stripNoContentResponseBodies, toOpenAPI30Document, toOpenAPI30Schema, toOpenAPIAclRule, toPascalCase, visitZodSchema };
|
package/dist/vite.d.mts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { r as GenerateFileFormatter } from "./options-
|
|
2
|
-
import { t as OpenAPICodegenConfig } from "./config-
|
|
3
|
-
import { d as GenerateOpenApiFile, m as GenerateOpenApiSpec, n as TinyOpenApiSpecModuleConfig } from "./openapi-source.runner-
|
|
1
|
+
import { r as GenerateFileFormatter } from "./options-DdQJ9BSc.mjs";
|
|
2
|
+
import { t as OpenAPICodegenConfig } from "./config-BQqze8rU.mjs";
|
|
3
|
+
import { d as GenerateOpenApiFile, m as GenerateOpenApiSpec, n as TinyOpenApiSpecModuleConfig } from "./openapi-source.runner-B6KKrXw7.mjs";
|
|
4
4
|
import { Plugin, PluginOption } from "vite";
|
|
5
|
+
|
|
5
6
|
//#region src/plugins/openapi-codegen.runner.d.ts
|
|
6
7
|
type OpenApiCodegenPluginConfig = OpenAPICodegenConfig & {
|
|
7
8
|
formatGeneratedFile?: GenerateFileFormatter;
|
package/dist/vite.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as createOpenApiCodegenRunner } from "./openapi-codegen.runner-
|
|
2
|
-
import { i as normalizeWatchFolders, r as isTinyOpenApiFakeMode, t as createTinyOpenApiSourceRunner } from "./openapi-source.runner-
|
|
1
|
+
import { t as createOpenApiCodegenRunner } from "./openapi-codegen.runner-nPBssrBL.mjs";
|
|
2
|
+
import { i as normalizeWatchFolders, r as isTinyOpenApiFakeMode, t as createTinyOpenApiSourceRunner } from "./openapi-source.runner-8kCe-g9S.mjs";
|
|
3
3
|
import path from "path";
|
|
4
4
|
//#region src/vite/openapi-codegen.plugin.ts
|
|
5
5
|
function openApiCodegen(config) {
|
|
@@ -36,7 +36,7 @@ function openApiCodegen(config) {
|
|
|
36
36
|
}
|
|
37
37
|
//#endregion
|
|
38
38
|
//#region src/vite/tiny-openapi-codegen.plugin.ts
|
|
39
|
-
const watchedEvents =
|
|
39
|
+
const watchedEvents = new Set([
|
|
40
40
|
"add",
|
|
41
41
|
"change",
|
|
42
42
|
"unlink"
|
|
@@ -75,8 +75,7 @@ function tinyOpenApiCodegenPlugin(codegenConfig, options) {
|
|
|
75
75
|
}, debounceMs);
|
|
76
76
|
};
|
|
77
77
|
const setupWatcher = (server) => {
|
|
78
|
-
const
|
|
79
|
-
const watchFolders = normalizeWatchFolders(root, options.watchFolders);
|
|
78
|
+
const watchFolders = normalizeWatchFolders(resolvedConfig?.root ?? server.config.root, options.watchFolders);
|
|
80
79
|
server.watcher.add(watchFolders);
|
|
81
80
|
server.watcher.on("all", (event, changedPath) => {
|
|
82
81
|
if (watchedEvents.has(event) && isPathInWatchFolders(changedPath, watchFolders)) scheduleGenerate(server);
|
package/dist/zod.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { a as ErrorHandler } from "./error-handling-
|
|
1
|
+
import { a as ErrorHandler } from "./error-handling-D6ZYITQ3.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
+
|
|
3
4
|
//#region src/zod.d.ts
|
|
4
5
|
declare namespace ZodExtended {
|
|
5
6
|
interface ParseOptions {
|
|
@@ -7,7 +8,11 @@ declare namespace ZodExtended {
|
|
|
7
8
|
name?: string;
|
|
8
9
|
errorHandler?: ErrorHandler<never>;
|
|
9
10
|
}
|
|
10
|
-
export function parse<ZOutput, ZInput>(schema: z.ZodType<ZOutput, ZInput>, data: unknown, {
|
|
11
|
+
export function parse<ZOutput, ZInput>(schema: z.ZodType<ZOutput, ZInput>, data: unknown, {
|
|
12
|
+
type,
|
|
13
|
+
name,
|
|
14
|
+
errorHandler
|
|
15
|
+
}?: ParseOptions): ZOutput;
|
|
11
16
|
export const sortExp: (enumSchema: z.ZodEnum) => z.ZodString;
|
|
12
17
|
export {};
|
|
13
18
|
}
|
package/dist/zod.mjs
CHANGED
package/package.json
CHANGED
|
@@ -54,26 +54,14 @@
|
|
|
54
54
|
"./zod": {
|
|
55
55
|
"types": "./dist/zod.d.mts",
|
|
56
56
|
"import": "./dist/zod.mjs"
|
|
57
|
-
},
|
|
58
|
-
"./native": {
|
|
59
|
-
"types": "./dist/native.d.mts",
|
|
60
|
-
"import": "./dist/native.mjs"
|
|
61
|
-
},
|
|
62
|
-
"./rest": {
|
|
63
|
-
"types": "./dist/rest.d.mts",
|
|
64
|
-
"import": "./dist/rest.mjs"
|
|
65
57
|
}
|
|
66
58
|
},
|
|
67
59
|
"scripts": {
|
|
68
|
-
"start": "
|
|
69
|
-
"test": "
|
|
70
|
-
"test:ts": "OPENAPI_CODEGEN_NATIVE=0 vitest run",
|
|
71
|
-
"test:native": "OPENAPI_CODEGEN_NATIVE=1 OPENAPI_CODEGEN_REQUIRE_FULL_NATIVE=1 vitest run",
|
|
60
|
+
"start": "node --import tsx ./src/sh.ts",
|
|
61
|
+
"test": "vitest run",
|
|
72
62
|
"test:watch": "vitest",
|
|
73
|
-
"build": "tsdown
|
|
74
|
-
"
|
|
75
|
-
"build:native": "bun ./scripts/build-native.mjs",
|
|
76
|
-
"start:dist": "bun ./dist/sh.mjs",
|
|
63
|
+
"build": "tsdown",
|
|
64
|
+
"start:dist": "node ./dist/sh.mjs",
|
|
77
65
|
"gen:base": "rm -rf ./test/generated/base && mkdir -p ./test/generated/base && bun run start generate --config ./test/config.mjs --output ./test/generated/base --no-prettier",
|
|
78
66
|
"gen:next": "rm -rf ./test/generated/next && mkdir -p ./test/generated/next && bun run start generate --config ./test/config.mjs --output ./test/generated/next --no-prettier",
|
|
79
67
|
"test:generated-eq": "vitest run ./src/generators/generated-output-eq.test.ts",
|
|
@@ -84,44 +72,46 @@
|
|
|
84
72
|
"format": "oxfmt",
|
|
85
73
|
"format:check": "oxfmt --check",
|
|
86
74
|
"check": "bun run typecheck && bun run lint && bun run test",
|
|
87
|
-
"push": "
|
|
75
|
+
"push": "node ./scripts/publish.mjs",
|
|
88
76
|
"dev:generate": "rm -rf ./output && bun run start generate --config ./test/config.mjs",
|
|
89
77
|
"dev:check": "bun run start check --config ./test/config.mjs",
|
|
90
|
-
"snapshot:openapi-localhost": "
|
|
91
|
-
"bench:vite-codegen": "
|
|
78
|
+
"snapshot:openapi-localhost": "node ./scripts/snapshot-openapi-localhost.mjs",
|
|
79
|
+
"bench:vite-codegen": "node ./scripts/benchmark-vite-codegen.mjs"
|
|
92
80
|
},
|
|
93
81
|
"dependencies": {
|
|
82
|
+
"@apidevtools/swagger-parser": "^10.1.0",
|
|
94
83
|
"@orpc/contract": "^1.14.3",
|
|
95
84
|
"@orpc/openapi": "^1.14.3",
|
|
96
85
|
"@orpc/zod": "^1.14.3",
|
|
86
|
+
"import-fresh": "^3.3.1",
|
|
97
87
|
"openapi-types": "^12.1.3",
|
|
98
88
|
"prompt-sync": "^4.2.0",
|
|
99
89
|
"reflect-metadata": "^0.2.2",
|
|
100
|
-
"
|
|
90
|
+
"ts-pattern": "^5.9.0",
|
|
91
|
+
"typescript": "^5.9.3",
|
|
101
92
|
"yargs": "^18.0.0"
|
|
102
93
|
},
|
|
103
94
|
"devDependencies": {
|
|
104
|
-
"@casl/ability": "6.8.0",
|
|
105
|
-
"@casl/react": "5.0.1",
|
|
95
|
+
"@casl/ability": "^6.8.0",
|
|
96
|
+
"@casl/react": "^5.0.1",
|
|
106
97
|
"@tanstack/react-query": "~5.90.21",
|
|
107
|
-
"@types/bun": "1.3.14",
|
|
108
98
|
"@types/node": "^25.3.0",
|
|
109
99
|
"@types/prompt-sync": "^4.2.3",
|
|
110
100
|
"@types/react": "^19.2.14",
|
|
111
101
|
"@types/yargs": "^17.0.35",
|
|
112
102
|
"@vitejs/plugin-react": "^5.1.4",
|
|
113
103
|
"oxfmt": "^0.34.0",
|
|
114
|
-
"oxlint": "1.50.0",
|
|
104
|
+
"oxlint": "^1.50.0",
|
|
115
105
|
"oxlint-tsgolint": "^0.15.0",
|
|
116
106
|
"react": "^19.2.4",
|
|
117
|
-
"tsdown": "^0.
|
|
107
|
+
"tsdown": "^0.21.0-beta.1",
|
|
118
108
|
"tsx": "^4.21.0",
|
|
119
109
|
"type-fest": "^5.4.4",
|
|
120
|
-
"typescript": "^7.0.2",
|
|
121
110
|
"vite": "npm:rolldown-vite@^7.3.1",
|
|
122
111
|
"vite-plugin-dts": "^4.5.4",
|
|
123
112
|
"vitest": "4.0.18",
|
|
124
|
-
"
|
|
113
|
+
"yargs": "^17.7.2",
|
|
114
|
+
"zod": "^4.5.0"
|
|
125
115
|
},
|
|
126
116
|
"peerDependencies": {
|
|
127
117
|
"@casl/ability": "^6.7.3",
|
|
@@ -131,7 +121,7 @@
|
|
|
131
121
|
"i18next": "^25.8.11",
|
|
132
122
|
"react": "^19.1.0",
|
|
133
123
|
"vite": "^6.0.0 || ^7.0.0 || ^8.0.0",
|
|
134
|
-
"zod": "^4.
|
|
124
|
+
"zod": "^4.5.0"
|
|
135
125
|
},
|
|
136
126
|
"peerDependenciesMeta": {
|
|
137
127
|
"@casl/ability": {
|
|
@@ -145,9 +135,9 @@
|
|
|
145
135
|
}
|
|
146
136
|
},
|
|
147
137
|
"engines": {
|
|
148
|
-
"bun": ">= 1.
|
|
149
|
-
"node": ">=
|
|
138
|
+
"bun": ">= 1.4",
|
|
139
|
+
"node": ">= 14"
|
|
150
140
|
},
|
|
151
|
-
"packageManager": "bun@1.
|
|
152
|
-
"version": "3.
|
|
141
|
+
"packageManager": "bun@1.4.0",
|
|
142
|
+
"version": "3.3.0-rc.1"
|
|
153
143
|
}
|