vela 0.10.0 → 0.10.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vela",
3
- "version": "0.10.0",
3
+ "version": "0.10.2",
4
4
  "type": "module",
5
5
  "description": "A CLI for creating and updating SvelteKit projects",
6
6
  "license": "MIT",
@@ -26,8 +26,8 @@
26
26
  "@tailwindcss/typography": "^0.5.19",
27
27
  "@tailwindcss/vite": "^4.3.0",
28
28
  "@types/supertest": "^6.0.3",
29
- "@velastack/kit": "^0.1.0",
30
- "@velastack/pocketbase": "^0.2.0",
29
+ "@velastack/kit": "^0.2.0",
30
+ "@velastack/pocketbase": "^0.2.2",
31
31
  "clsx": "^2.1.1",
32
32
  "formsnap": "^2.0.1",
33
33
  "mode-watcher": "^1.1.0",
@@ -17,24 +17,27 @@
17
17
  </a>
18
18
 
19
19
  <h1 class="mt-6 text-4xl font-semibold tracking-tight sm:text-5xl">
20
- A modern way to get things done
20
+ {data.meta.appName} is running on VelaStack
21
21
  </h1>
22
22
  <p class="text-muted-foreground mt-4 text-lg">
23
- Everything you need to launch faster, collaborate better, and stay focused.
23
+ A SvelteKit app with a PocketBase backend already migrated behind it, and types synced from
24
+ your schema as it changes. This page is
25
+ <code class="bg-muted rounded px-1.5 py-0.5 font-mono text-base">src/routes/(public)/+page.svelte</code>,
26
+ and it is yours to delete.
24
27
  </p>
25
28
 
26
29
  <div class="mt-8 flex items-center justify-center gap-3">
27
30
  <a
28
- href="/signup"
31
+ href="https://docs.velastack.dev"
29
32
  class="bg-primary text-primary-foreground inline-flex items-center rounded-md px-5 py-2.5"
30
33
  >
31
- Get started
34
+ Read the docs
32
35
  </a>
33
36
  <a
34
- href="/login"
37
+ href="https://velastack.dev/patterns"
35
38
  class="border border-border text-foreground inline-flex items-center rounded-md px-5 py-2.5"
36
39
  >
37
- Sign in
40
+ Browse patterns
38
41
  </a>
39
42
  </div>
40
43
  </div>
@@ -43,22 +46,35 @@
43
46
  <section class="px-6 pb-16 md:pb-24">
44
47
  <div class="mx-auto grid max-w-5xl gap-6 sm:grid-cols-2 lg:grid-cols-3">
45
48
  <div class="bg-card text-card-foreground rounded-lg border p-6">
46
- <h3 class="font-medium">Fast</h3>
49
+ <h3 class="font-medium">Your data</h3>
47
50
  <p class="text-muted-foreground mt-2">
48
- Simple workflows that help you move from idea to done.
51
+ Describe a model once. The collection, migration, forms and CRUD pages come with it.
49
52
  </p>
53
+ <code
54
+ class="bg-muted text-muted-foreground mt-4 block overflow-x-auto rounded-md px-3 py-2 font-mono text-xs"
55
+ >vela generate scaffold post title:text body:editor</code
56
+ >
50
57
  </div>
51
58
  <div class="bg-card text-card-foreground rounded-lg border p-6">
52
- <h3 class="font-medium">Flexible</h3>
59
+ <h3 class="font-medium">Your users</h3>
53
60
  <p class="text-muted-foreground mt-2">
54
- Works for teams of any size and adapts to your process.
61
+ Sign-in, sessions and OAuth, generated into your project as code you own.
55
62
  </p>
63
+ <code
64
+ class="bg-muted text-muted-foreground mt-4 block overflow-x-auto rounded-md px-3 py-2 font-mono text-xs"
65
+ >vela enable auth</code
66
+ >
56
67
  </div>
57
68
  <div class="bg-card text-card-foreground rounded-lg border p-6">
58
- <h3 class="font-medium">Secure</h3>
69
+ <h3 class="font-medium">Your interface</h3>
59
70
  <p class="text-muted-foreground mt-2">
60
- Built with best practices and modern standards in mind.
71
+ shadcn components, copied into your project. Yours to restyle, with no dependency
72
+ to fight.
61
73
  </p>
74
+ <code
75
+ class="bg-muted text-muted-foreground mt-4 block overflow-x-auto rounded-md px-3 py-2 font-mono text-xs"
76
+ >vela ui add button card dialog</code
77
+ >
62
78
  </div>
63
79
  </div>
64
80
  </section>
@@ -39,6 +39,7 @@
39
39
  <Button onclick={toggleMode} variant="ghost" size="icon">
40
40
  <Navbar.Mode />
41
41
  </Button>
42
+ <!-- Neither route exists yet: `vela legal privacy` and `vela legal terms` generate them. -->
42
43
  <a href="/privacy" class="underline-offset-4 hover:underline">Privacy</a>
43
44
  <a href="/terms" class="underline-offset-4 hover:underline">Terms</a>
44
45
  </nav>
@@ -4,6 +4,14 @@
4
4
  import RootLayout from './(public)/root-layout.svelte';
5
5
 
6
6
  let { data } = $props();
7
+
8
+ let notFound = $derived(page.status === 404);
9
+ let heading = $derived(notFound ? 'Page not found' : 'Something went wrong');
10
+ let detail = $derived(
11
+ notFound
12
+ ? 'That page does not exist. The link may be wrong, or the page may have moved.'
13
+ : (page.error?.message ?? 'The request could not be completed.')
14
+ );
7
15
  </script>
8
16
 
9
17
  <RootLayout {data}>
@@ -14,15 +22,14 @@
14
22
  </div>
15
23
  <div class="relative">
16
24
  <h1 class="text-4xl font-bold relative inline-block bg-background">
17
- Oops! Something went wrong
25
+ {heading}
18
26
  </h1>
19
27
  </div>
20
28
  <p class="text-xl text-muted-foreground max-w-lg mx-auto">
21
- {page.error?.message ||
22
- "We couldn't find what you were looking for. Let's get you back on track!"}
29
+ {detail}
23
30
  </p>
24
31
  <div>
25
- <Button href="/" variant="default" size="lg">Take me home</Button>
32
+ <Button href="/" variant="default" size="lg">Back to home</Button>
26
33
  </div>
27
34
  </div>
28
35
  </main>
@@ -7,9 +7,9 @@
7
7
  "node": "^20.19.0 || >=22.12.0"
8
8
  },
9
9
  "scripts": {
10
- "dev": "vite dev",
11
- "build": "vite build",
12
- "preview": "vite preview",
10
+ "dev": "vela dev",
11
+ "build": "vela build",
12
+ "preview": "vela preview",
13
13
  "prepare": "svelte-kit sync || echo \"\"",
14
14
  "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
15
15
  "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
@@ -24,6 +24,7 @@
24
24
  "@tailwindcss/forms": "^0.5.11",
25
25
  "@tailwindcss/typography": "^0.5.19",
26
26
  "@tailwindcss/vite": "^4.3.0",
27
+ "@velastack/kit": "^0.2.0",
27
28
  "clsx": "^2.1.1",
28
29
  "mode-watcher": "^1.1.0",
29
30
  "prettier": "^3.9.6",
@@ -1,26 +1,10 @@
1
- import { dev } from '$app/environment';
2
- import { error, type Handle } from '@sveltejs/kit';
3
-
4
- /** Pages a `vela` command generates, and the command that generates them. */
5
- const GENERATED_PAGES: Record<string, string> = {
6
- '/privacy': 'vela legal privacy',
7
- '/terms': 'vela legal terms'
8
- };
1
+ import { handleStatic } from '@velastack/kit';
9
2
 
10
3
  /**
11
- * The footer links to these before they exist. In dev, say which command creates
12
- * the page instead of showing a bare 404.
4
+ * The footer links to `/privacy` and `/terms` before they exist. In dev, this
5
+ * answers a 404 there with the `vela legal` command that creates the page
6
+ * instead of a bare "page not found".
13
7
  *
14
- * Server hooks run in dev and at prerender time; a static build has no server, so
15
- * the `dev` guard also keeps this out of the prerendered output.
8
+ * A static build has no server, so nothing here reaches the deployed site.
16
9
  */
17
- export const handle: Handle = async ({ event, resolve }) => {
18
- const response = await resolve(event);
19
-
20
- if (dev && response.status === 404) {
21
- const command = GENERATED_PAGES[event.url.pathname];
22
- if (command) error(404, `Run \`${command}\` to create this page.`);
23
- }
24
-
25
- return response;
26
- };
10
+ export const handle = handleStatic();
@@ -17,48 +17,65 @@
17
17
  </a>
18
18
 
19
19
  <h1 class="mt-6 text-4xl font-semibold tracking-tight sm:text-5xl">
20
- A modern way to get things done
20
+ {data.meta.appName} is running on VelaStack
21
21
  </h1>
22
22
  <p class="text-muted-foreground mt-4 text-lg">
23
- Everything you need to launch faster, collaborate better, and stay focused.
23
+ A SvelteKit site that prerenders to static HTML, so there is no server to run and nothing to
24
+ keep alive. This page is
25
+ <code class="bg-muted rounded px-1.5 py-0.5 font-mono text-base">src/routes/(public)/+page.svelte</code>,
26
+ and it is yours to delete.
24
27
  </p>
25
28
 
26
29
  <div class="mt-8 flex items-center justify-center gap-3">
27
30
  <a
28
- href="#features"
31
+ href="https://docs.velastack.dev"
29
32
  class="bg-primary text-primary-foreground inline-flex items-center rounded-md px-5 py-2.5"
30
33
  >
31
- Get started
34
+ Read the docs
32
35
  </a>
33
36
  <a
34
- href="https://svelte.dev/docs/kit"
37
+ href="https://velastack.dev/templates"
35
38
  class="border border-border text-foreground inline-flex items-center rounded-md px-5 py-2.5"
36
39
  >
37
- Read the docs
40
+ Browse templates
38
41
  </a>
39
42
  </div>
40
43
  </div>
41
44
  </section>
42
45
 
43
- <section id="features" class="px-6 pb-16 md:pb-24">
46
+ <section class="px-6 pb-16 md:pb-24">
44
47
  <div class="mx-auto grid max-w-5xl gap-6 sm:grid-cols-2 lg:grid-cols-3">
45
48
  <div class="bg-card text-card-foreground rounded-lg border p-6">
46
- <h3 class="font-medium">Fast</h3>
49
+ <h3 class="font-medium">Your address</h3>
47
50
  <p class="text-muted-foreground mt-2">
48
- Simple workflows that help you move from idea to done.
51
+ Canonical links and Open Graph images are built from one value at prerender time. Set it
52
+ before you ship.
49
53
  </p>
54
+ <code
55
+ class="bg-muted text-muted-foreground mt-4 block overflow-x-auto rounded-md px-3 py-2 font-mono text-xs"
56
+ >src/lib/site.ts</code
57
+ >
50
58
  </div>
51
59
  <div class="bg-card text-card-foreground rounded-lg border p-6">
52
- <h3 class="font-medium">Flexible</h3>
60
+ <h3 class="font-medium">Your interface</h3>
53
61
  <p class="text-muted-foreground mt-2">
54
- Works for teams of any size and adapts to your process.
62
+ shadcn components, copied into your project. Yours to restyle, with no dependency
63
+ to fight.
55
64
  </p>
65
+ <code
66
+ class="bg-muted text-muted-foreground mt-4 block overflow-x-auto rounded-md px-3 py-2 font-mono text-xs"
67
+ >vela ui add button card dialog</code
68
+ >
56
69
  </div>
57
70
  <div class="bg-card text-card-foreground rounded-lg border p-6">
58
- <h3 class="font-medium">Secure</h3>
71
+ <h3 class="font-medium">Your deploy</h3>
59
72
  <p class="text-muted-foreground mt-2">
60
- Built with best practices and modern standards in mind.
73
+ Every route built to plain HTML, ready for any CDN or static host.
61
74
  </p>
75
+ <code
76
+ class="bg-muted text-muted-foreground mt-4 block overflow-x-auto rounded-md px-3 py-2 font-mono text-xs"
77
+ >vela build &amp;&amp; vela deploy</code
78
+ >
62
79
  </div>
63
80
  </div>
64
81
  </section>
@@ -39,6 +39,7 @@
39
39
  <Button onclick={toggleMode} variant="ghost" size="icon">
40
40
  <Navbar.Mode />
41
41
  </Button>
42
+ <!-- Neither route exists yet: `vela legal privacy` and `vela legal terms` generate them. -->
42
43
  <a href="/privacy" class="underline-offset-4 hover:underline">Privacy</a>
43
44
  <a href="/terms" class="underline-offset-4 hover:underline">Terms</a>
44
45
  </nav>
@@ -4,6 +4,14 @@
4
4
  import RootLayout from './(public)/root-layout.svelte';
5
5
 
6
6
  let { data } = $props();
7
+
8
+ let notFound = $derived(page.status === 404);
9
+ let heading = $derived(notFound ? 'Page not found' : 'Something went wrong');
10
+ let detail = $derived(
11
+ notFound
12
+ ? 'That page does not exist. The link may be wrong, or the page may have moved.'
13
+ : (page.error?.message ?? 'The request could not be completed.')
14
+ );
7
15
  </script>
8
16
 
9
17
  <RootLayout {data}>
@@ -14,15 +22,14 @@
14
22
  </div>
15
23
  <div class="relative">
16
24
  <h1 class="text-4xl font-bold relative inline-block bg-background">
17
- Oops! Something went wrong
25
+ {heading}
18
26
  </h1>
19
27
  </div>
20
28
  <p class="text-xl text-muted-foreground max-w-lg mx-auto">
21
- {page.error?.message ||
22
- "We couldn't find what you were looking for. Let's get you back on track!"}
29
+ {detail}
23
30
  </p>
24
31
  <div>
25
- <Button href="/" variant="default" size="lg">Take me home</Button>
32
+ <Button href="/" variant="default" size="lg">Back to home</Button>
26
33
  </div>
27
34
  </div>
28
35
  </main>
@@ -14,18 +14,6 @@ export default defineConfig({
14
14
  adapter: adapter({
15
15
  fallback: '200.html'
16
16
  }),
17
- prerender: {
18
- handleHttpError: ({ path, message }) => {
19
- // The footer links to these before they exist; `vela legal privacy`
20
- // and `vela legal terms` generate them. Warn rather than fail the
21
- // build, but keep every other broken link fatal.
22
- if (path === '/privacy' || path === '/terms') {
23
- console.warn(`${path} not generated yet — run \`vela legal ${path.slice(1)}\``);
24
- return;
25
- }
26
- throw new Error(message);
27
- }
28
- }
29
17
  })
30
18
  ]
31
19
  });