create-vesk 0.1.14 → 0.2.9

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +29 -32
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-vesk",
3
- "version": "0.1.14",
3
+ "version": "0.2.9",
4
4
  "type": "module",
5
5
  "description": "Create a new Vesk project with zero configuration",
6
6
  "bin": {
package/src/index.js CHANGED
@@ -38,35 +38,26 @@ const dirs = [
38
38
  for (const d of dirs) mkdirSync(d, { recursive: true })
39
39
 
40
40
  // ── package.json ──
41
- // haul is the default engine: `haul dev` / `haul build` / `haul start` run the
42
- // native binary (embedded compiler sidecar, no VESK_SIDECAR needed). The
43
- // `vesk` package provides both the `haul` dispatcher and the JS `vesk` CLI.
41
+ // `vesk dev` / `vesk build` / `vesk start` run the pure-TypeScript pipeline.
42
+ // esbuild is an optionalDependency: when its native binary cannot run on a
43
+ // machine, vesk falls back to esbuild-wasm automatically.
44
44
  writeFileSync(join(targetDir, 'package.json'), JSON.stringify({
45
45
  name: pkgName,
46
46
  private: true,
47
47
  type: 'module',
48
48
  scripts: {
49
- dev: 'haul dev',
50
- build: 'haul build',
51
- start: 'haul start',
49
+ dev: 'vesk dev',
50
+ build: 'vesk build',
51
+ start: 'vesk start',
52
52
  typecheck: 'tsc --noEmit',
53
- 'dev:vesk': 'vesk dev',
54
- 'build:vesk': 'vesk build',
55
- 'start:vesk': 'vesk start',
56
53
  },
57
54
  dependencies: {
58
- '@vesk/compiler': '^0.1.14',
59
- '@vesk/runtime': '^0.1.14',
60
- '@vesk/vesk-cli': '^0.1.14',
61
- '@vesk/adapter': '^0.1.14',
62
- '@vesk/plugin-tailwind': '^0.1.14',
63
- },
64
- optionalDependencies: {
65
- '@vesk/haul-darwin-arm64': '^0.1.14',
66
- '@vesk/haul-darwin-x64': '^0.1.14',
67
- '@vesk/haul-linux-arm64': '^0.1.14',
68
- '@vesk/haul-linux-x64': '^0.1.14',
69
- '@vesk/haul-win32-x64': '^0.1.14',
55
+ '@vesk/compiler': '^0.2.9',
56
+ '@vesk/runtime': '^0.2.9',
57
+ '@vesk/types': '^0.2.9',
58
+ '@vesk/vesk-cli': '^0.2.9',
59
+ '@vesk/adapter': '^0.2.9',
60
+ '@vesk/plugin-tailwind': '^0.2.9',
70
61
  },
71
62
  devDependencies: {
72
63
  tailwindcss: '^4.0.0',
@@ -115,7 +106,6 @@ writeFileSync(join(targetDir, 'tsconfig.json'), JSON.stringify({
115
106
  jsx: 'preserve',
116
107
  jsxImportSource: '@vesk/compiler',
117
108
  lib: ['ES2022', 'DOM', 'DOM.Iterable'],
118
- baseUrl: '.',
119
109
  paths: {
120
110
  '@/*': ['./src/*'],
121
111
  '@app/*': ['./app/*'],
@@ -137,9 +127,14 @@ writeFileSync(join(srcDir, 'global.css'), [
137
127
 
138
128
  // ── app/layout.vsk ──
139
129
  writeFileSync(join(appDirPath, 'layout.vsk'), [
140
- `import { NavLink } from '@vesk/runtime';`,
141
- ``,
142
- `component Layout(props) {`,
130
+ `import type { Component } from '@vesk/types';`,
131
+ `import { NavLink } from '@vesk/runtime/router';`,
132
+ '',
133
+ `interface LayoutProps {`,
134
+ `\tchildren?: Component`,
135
+ `}`,
136
+ '',
137
+ `component Layout(props: LayoutProps) {`,
143
138
  `\t<nav class="flex gap-6 px-8 py-4 border-b border-gray-200 bg-white">`,
144
139
  `\t\t<NavLink href="/" class="text-gray-500 hover:text-black font-medium no-underline">Home</NavLink>`,
145
140
  `\t\t<NavLink href="/about" class="text-gray-500 hover:text-black font-medium no-underline">About</NavLink>`,
@@ -198,7 +193,7 @@ writeFileSync(join(appDirPath, 'about', 'page.vsk'), [
198
193
 
199
194
  // ── app/blog/page.vsk ──
200
195
  writeFileSync(join(appDirPath, 'blog', 'page.vsk'), [
201
- `import { Link } from '@vesk/runtime';`,
196
+ `import { Link } from '@vesk/runtime/router';`,
202
197
  ``,
203
198
  `component Blog {`,
204
199
  `\t<h1 class="text-3xl font-bold mb-4">Blog</h1>`,
@@ -220,7 +215,7 @@ writeFileSync(join(appDirPath, 'blog', 'page.vsk'), [
220
215
 
221
216
  // ── app/blog/[slug]/page.vsk ──
222
217
  writeFileSync(join(appDirPath, 'blog', '[slug]', 'page.vsk'), [
223
- `import { Link } from '@vesk/runtime';`,
218
+ `import { Link } from '@vesk/runtime/router';`,
224
219
  ``,
225
220
  `component BlogPost(props: { params: { slug: string } }) {`,
226
221
  `\t<Link href="/blog" class="inline-block mb-6 text-blue-600 no-underline hover:underline">`,
@@ -373,6 +368,7 @@ writeFileSync(join(appDirPath, 'middleware.ts'), [
373
368
  `// next() — passes to next middleware or page render`,
374
369
  `// next('/rewrite') — rewrites URL in place`,
375
370
  `// Short-circuit: return Response without calling next()`,
371
+ `// Types come from @vesk/types (import type { MiddlewareContext }).`,
376
372
  ``,
377
373
  `export async function middleware(ctx, next) {`,
378
374
  `\tctx.set('startTime', Date.now());`,
@@ -383,7 +379,7 @@ writeFileSync(join(appDirPath, 'middleware.ts'), [
383
379
 
384
380
  // ── app/not-found.vsk ──
385
381
  writeFileSync(join(appDirPath, 'not-found.vsk'), [
386
- `import { Link } from '@vesk/runtime';`,
382
+ `import { Link } from '@vesk/runtime/router';`,
387
383
  ``,
388
384
  `component NotFound404(props) {`,
389
385
  `\t<main class="max-w-3xl mx-auto my-16 px-4 text-center">`,
@@ -413,7 +409,8 @@ writeFileSync(join(appDirPath, 'error.vsk'), [
413
409
 
414
410
  // ── app/api/posts/route.ts ──
415
411
  writeFileSync(join(appDirPath, 'api', 'posts', 'route.ts'), [
416
- `import { VeskRequest, VeskResponse } from '@vesk/runtime/server';`,
412
+ `import type { VeskRequest } from '@vesk/types';`,
413
+ `import { VeskResponse } from '@vesk/runtime/server';`,
417
414
  ``,
418
415
  `export interface Post {`,
419
416
  `\tid: number;`,
@@ -469,7 +466,8 @@ writeFileSync(join(appDirPath, 'api', 'posts', 'route.ts'), [
469
466
 
470
467
  // ── app/api/hello/route.ts ──
471
468
  writeFileSync(join(appDirPath, 'api', 'hello', 'route.ts'), [
472
- `import { VeskRequest, VeskResponse } from '@vesk/runtime/server';`,
469
+ `import type { VeskRequest } from '@vesk/types';`,
470
+ `import { VeskResponse } from '@vesk/runtime/server';`,
473
471
  ``,
474
472
  `export async function GET(req: VeskRequest) {`,
475
473
  `\treturn VeskResponse.json({ message: 'Hello from Vesk!' })`,
@@ -541,11 +539,10 @@ writeFileSync(join(targetDir, 'README.md'), [
541
539
  '',
542
540
  '## Scripts',
543
541
  '',
544
- `- \`npm run dev\` — dev server with HMR at http://localhost:3000 (native \`haul\` engine)`,
542
+ `- \`npm run dev\` — dev server with HMR at http://localhost:3000`,
545
543
  `- \`npm run build\` — production build (SSG + SSR) into \`.vesk/\``,
546
544
  `- \`npm run start\` — run the production server`,
547
545
  `- \`npm run typecheck\` — typecheck \`app/\` and \`src/\``,
548
- `- \`npm run dev:vesk\` / \`build:vesk\` / \`start:vesk\` — same commands via the JS \`vesk\` CLI instead of \`haul\``,
549
546
  '',
550
547
  '## Project structure',
551
548
  '',