@povio/openapi-codegen-cli 3.1.0-rc.2 → 3.1.0-rc.4
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/metro.d.mts +4 -2
- package/dist/metro.mjs +3 -1
- package/dist/{openapi-D9apjIRy.d.mts → openapi-source.runner-BSIrB6ny.d.mts} +32 -8
- package/dist/openapi-source.runner-wLs5vqw6.mjs +705 -0
- package/dist/sh.mjs +1 -1
- package/dist/tiny.d.mts +3 -20
- package/dist/tiny.mjs +2 -634
- package/dist/vite.d.mts +4 -2
- package/dist/vite.mjs +3 -1
- package/package.json +1 -1
- package/dist/openapi-source.runner-D19XnvMe.mjs +0 -39
package/package.json
CHANGED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import path from "path";
|
|
2
|
-
|
|
3
|
-
//#region src/tiny/openapi-source.runner.ts
|
|
4
|
-
function createTinyOpenApiSourceRunner(config) {
|
|
5
|
-
let queue = Promise.resolve();
|
|
6
|
-
const getOutputPath = () => getLocalInputPath(config.input, config.root);
|
|
7
|
-
const runGenerate = async () => {
|
|
8
|
-
const outputPath = getOutputPath();
|
|
9
|
-
if (!outputPath) return;
|
|
10
|
-
await config.generateOpenApiFile({
|
|
11
|
-
argv: ["--output", outputPath],
|
|
12
|
-
cwd: config.cwd ?? config.root,
|
|
13
|
-
defaultOutput: outputPath,
|
|
14
|
-
env: config.env ?? process.env
|
|
15
|
-
});
|
|
16
|
-
};
|
|
17
|
-
const enqueueGenerate = () => {
|
|
18
|
-
const run = queue.catch(() => void 0).then(runGenerate);
|
|
19
|
-
queue = run.then(() => void 0, () => void 0);
|
|
20
|
-
return run;
|
|
21
|
-
};
|
|
22
|
-
return {
|
|
23
|
-
enqueueGenerate,
|
|
24
|
-
getOutputPath
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
function isTinyOpenApiFakeMode(apiMode = process.env.VITE_PUBLIC_API_MODE ?? process.env.EXPO_PUBLIC_API_MODE) {
|
|
28
|
-
return apiMode !== "real";
|
|
29
|
-
}
|
|
30
|
-
function getLocalInputPath(input, root) {
|
|
31
|
-
if (typeof input !== "string" || /^https?:\/\//i.test(input)) return;
|
|
32
|
-
return path.resolve(root, input);
|
|
33
|
-
}
|
|
34
|
-
function normalizeWatchFolders(root, watchFolders = []) {
|
|
35
|
-
return watchFolders.map((folder) => path.isAbsolute(folder) ? folder : path.resolve(root, folder));
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
//#endregion
|
|
39
|
-
export { normalizeWatchFolders as i, getLocalInputPath as n, isTinyOpenApiFakeMode as r, createTinyOpenApiSourceRunner as t };
|