hono-takibi 0.3.2 → 0.3.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.
|
@@ -3,8 +3,9 @@ type HonoTakibiPluginOptions = {
|
|
|
3
3
|
output: string;
|
|
4
4
|
packageManager: 'pnpm' | 'npm' | 'yarn' | 'bun';
|
|
5
5
|
};
|
|
6
|
-
|
|
6
|
+
declare const honoTakibiPlugin: (options: HonoTakibiPluginOptions) => {
|
|
7
7
|
name: string;
|
|
8
8
|
configureServer(server: any): void;
|
|
9
9
|
};
|
|
10
|
-
export {};
|
|
10
|
+
export { honoTakibiPlugin };
|
|
11
|
+
export default honoTakibiPlugin;
|
|
@@ -1,8 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
// import { exec } from 'node:child_process'
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
+
exports.honoTakibiPlugin = void 0;
|
|
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
|
+
// }
|
|
4
37
|
const node_child_process_1 = require("node:child_process");
|
|
5
|
-
|
|
38
|
+
const honoTakibiPlugin = (options) => {
|
|
6
39
|
return {
|
|
7
40
|
name: 'hono-takibi-plugin',
|
|
8
41
|
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
@@ -22,10 +55,12 @@ function honoTakibiPlugin(options) {
|
|
|
22
55
|
console.error(`[hono-takibi-plugin] error: ${error.message}`);
|
|
23
56
|
return;
|
|
24
57
|
}
|
|
25
|
-
//
|
|
58
|
+
// サーバーのリロード
|
|
26
59
|
server.ws.send({ type: 'full-reload' });
|
|
27
60
|
});
|
|
28
61
|
});
|
|
29
62
|
},
|
|
30
63
|
};
|
|
31
|
-
}
|
|
64
|
+
};
|
|
65
|
+
exports.honoTakibiPlugin = honoTakibiPlugin;
|
|
66
|
+
exports.default = honoTakibiPlugin;
|