hono-takibi 0.3.4 → 0.4.0
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.
|
@@ -24,7 +24,7 @@ function generateApp(openAPISpec, config) {
|
|
|
24
24
|
const applyOpenapiRoutes = (0, generate_apply_openapi_routes_1.generateApplyOpenapiRoutes)(routeMappings);
|
|
25
25
|
const openAPIHono = config.app?.basePath ? `${APP}.basePath('${config.app.basePath}')` : APP;
|
|
26
26
|
const app = `app${applyOpenapiRoutes}`;
|
|
27
|
-
const api = `const api = ${app}`;
|
|
27
|
+
const api = `export const api = ${app}`;
|
|
28
28
|
const docs = (0, generate_docs_1.generateDocs)(openAPISpec);
|
|
29
29
|
const isDev = config?.app?.isDev
|
|
30
30
|
? `const isDev = ${config.app.isDev} === 'development'`
|
|
@@ -3,9 +3,8 @@ type HonoTakibiPluginOptions = {
|
|
|
3
3
|
output: string;
|
|
4
4
|
packageManager: 'pnpm' | 'npm' | 'yarn' | 'bun';
|
|
5
5
|
};
|
|
6
|
-
|
|
6
|
+
export default function honoTakibiPlugin(options: HonoTakibiPluginOptions): {
|
|
7
7
|
name: string;
|
|
8
8
|
configureServer(server: any): void;
|
|
9
9
|
};
|
|
10
|
-
export {
|
|
11
|
-
export default honoTakibiPlugin;
|
|
10
|
+
export {};
|
|
@@ -1,41 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// import { exec } from 'node:child_process'
|
|
3
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
5
|
-
// type HonoTakibiPluginOptions = {
|
|
6
|
-
// input: string
|
|
7
|
-
// output: string
|
|
8
|
-
// packageManager: 'pnpm' | 'npm' | 'yarn' | 'bun'
|
|
9
|
-
// }
|
|
10
|
-
// export default function honoTakibiPlugin(options: HonoTakibiPluginOptions) {
|
|
11
|
-
// return {
|
|
12
|
-
// name: 'hono-takibi-plugin',
|
|
13
|
-
// // biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
14
|
-
// configureServer(server: any) {
|
|
15
|
-
// server.watcher.add(options.input)
|
|
16
|
-
// server.watcher.on('change', () => {
|
|
17
|
-
// const commandPrefixMap: Record<'pnpm' | 'npm' | 'yarn' | 'bun', string> = {
|
|
18
|
-
// pnpm: 'pnpm',
|
|
19
|
-
// npm: 'npx',
|
|
20
|
-
// yarn: 'yarn',
|
|
21
|
-
// bun: 'bun run',
|
|
22
|
-
// }
|
|
23
|
-
// const commandPrefix = commandPrefixMap[options.packageManager]
|
|
24
|
-
// const command = `${commandPrefix} hono-takibi ${options.input} -o ${options.output}`
|
|
25
|
-
// exec(command, (error) => {
|
|
26
|
-
// if (error) {
|
|
27
|
-
// console.error(`[hono-takibi-plugin] error: ${error.message}`)
|
|
28
|
-
// return
|
|
29
|
-
// }
|
|
30
|
-
// // reload
|
|
31
|
-
// server.ws.send({ type: 'full-reload' })
|
|
32
|
-
// })
|
|
33
|
-
// })
|
|
34
|
-
// },
|
|
35
|
-
// }
|
|
36
|
-
// }
|
|
3
|
+
exports.default = honoTakibiPlugin;
|
|
37
4
|
const node_child_process_1 = require("node:child_process");
|
|
38
|
-
|
|
5
|
+
function honoTakibiPlugin(options) {
|
|
39
6
|
return {
|
|
40
7
|
name: 'hono-takibi-plugin',
|
|
41
8
|
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
@@ -43,24 +10,22 @@ const honoTakibiPlugin = (options) => {
|
|
|
43
10
|
server.watcher.add(options.input);
|
|
44
11
|
server.watcher.on('change', () => {
|
|
45
12
|
const commandPrefixMap = {
|
|
46
|
-
npm: 'npx',
|
|
47
13
|
pnpm: 'pnpm',
|
|
14
|
+
npm: 'npx',
|
|
48
15
|
yarn: 'yarn',
|
|
49
|
-
bun: 'bun',
|
|
16
|
+
bun: 'bun run',
|
|
50
17
|
};
|
|
51
18
|
const commandPrefix = commandPrefixMap[options.packageManager];
|
|
52
|
-
const command = `${commandPrefix} hono-takibi ${options.input} -o ${options.output}
|
|
19
|
+
const command = `${commandPrefix} hono-takibi ${options.input} -o ${options.output}`;
|
|
53
20
|
(0, node_child_process_1.exec)(command, (error) => {
|
|
54
21
|
if (error) {
|
|
55
22
|
console.error(`[hono-takibi-plugin] error: ${error.message}`);
|
|
56
23
|
return;
|
|
57
24
|
}
|
|
58
|
-
//
|
|
25
|
+
// reload
|
|
59
26
|
server.ws.send({ type: 'full-reload' });
|
|
60
27
|
});
|
|
61
28
|
});
|
|
62
29
|
},
|
|
63
30
|
};
|
|
64
|
-
}
|
|
65
|
-
exports.honoTakibiPlugin = honoTakibiPlugin;
|
|
66
|
-
exports.default = honoTakibiPlugin;
|
|
31
|
+
}
|