@netrojs/create-vono 0.0.1 → 0.1.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/dist/index.js +8 -2
- package/files/_package.json +1 -1
- package/files/app/routes.ts +1 -9
- package/files/vite.config.ts +4 -1
- package/package.json +1 -1
- package/LICENSE +0 -21
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { execSync } from "child_process";
|
|
|
7
7
|
import { fileURLToPath } from "url";
|
|
8
8
|
import prompts from "prompts";
|
|
9
9
|
import { bold, cyan, dim, green, red } from "kolorist";
|
|
10
|
-
var VONO_VERSION = "0.
|
|
10
|
+
var VONO_VERSION = "0.1.1";
|
|
11
11
|
var FILES_DIR = join(dirname(fileURLToPath(import.meta.url)), "..", "files");
|
|
12
12
|
function banner() {
|
|
13
13
|
console.log();
|
|
@@ -82,11 +82,17 @@ function scaffold(dir, a) {
|
|
|
82
82
|
bun: "bun --bun vite build",
|
|
83
83
|
deno: "deno run -A npm:vite build"
|
|
84
84
|
};
|
|
85
|
+
const startCmds = {
|
|
86
|
+
node: "node dist/server/server.js",
|
|
87
|
+
bun: "bun dist/server/server.js",
|
|
88
|
+
deno: "deno run -A dist/server/server.js"
|
|
89
|
+
};
|
|
85
90
|
const vars = {
|
|
86
91
|
PROJECT_NAME: a.projectName,
|
|
87
92
|
VONO_VERSION,
|
|
88
93
|
DEV_CMD: devCmds[a.runtime],
|
|
89
|
-
BUILD_CMD: buildCmds[a.runtime]
|
|
94
|
+
BUILD_CMD: buildCmds[a.runtime],
|
|
95
|
+
START_CMD: startCmds[a.runtime]
|
|
90
96
|
};
|
|
91
97
|
mkdirSync(dir, { recursive: true });
|
|
92
98
|
for (const srcPath of walk(FILES_DIR)) {
|
package/files/_package.json
CHANGED
package/files/app/routes.ts
CHANGED
|
@@ -92,14 +92,6 @@ const postsApi = defineApiRoute('/api/posts', (app) => {
|
|
|
92
92
|
})
|
|
93
93
|
|
|
94
94
|
const statsApi = defineApiRoute('/api/stats', (app) => {
|
|
95
|
-
app.get('/', (_c) => c.json({
|
|
96
|
-
totalUsers: 4200,
|
|
97
|
-
totalPosts: POSTS.length,
|
|
98
|
-
totalViews: POSTS.reduce((s, p) => s + p.views, 0),
|
|
99
|
-
}))
|
|
100
|
-
})
|
|
101
|
-
// (Fix the accidental `c` → use the handler param)
|
|
102
|
-
const statsApiFixed = defineApiRoute('/api/stats', (app) => {
|
|
103
95
|
app.get('/', (c) => c.json({
|
|
104
96
|
totalUsers: 4200,
|
|
105
97
|
totalPosts: POSTS.length,
|
|
@@ -263,7 +255,7 @@ export { default as NotFoundPage } from './pages/404.vue'
|
|
|
263
255
|
|
|
264
256
|
export const routes = [
|
|
265
257
|
postsApi,
|
|
266
|
-
|
|
258
|
+
statsApi,
|
|
267
259
|
homePage,
|
|
268
260
|
blogListPage,
|
|
269
261
|
blogPostPage,
|
package/files/vite.config.ts
CHANGED
|
@@ -32,7 +32,10 @@ export default defineConfig({
|
|
|
32
32
|
}),
|
|
33
33
|
|
|
34
34
|
// Routes all dev-mode requests through the Vono Hono app (app.ts default export)
|
|
35
|
-
|
|
35
|
+
// injectClientScript: false — Vono injects the client script itself
|
|
36
|
+
// via buildShellParts(); letting the dev server inject a second copy
|
|
37
|
+
// causes a double-hydration error.
|
|
38
|
+
devServer({ entry: 'app.ts', injectClientScript: false }),
|
|
36
39
|
],
|
|
37
40
|
|
|
38
41
|
server: {
|
package/package.json
CHANGED
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Netro Solutions
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|