create-jant 0.3.15 → 0.3.17

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 CHANGED
@@ -9,7 +9,7 @@ import path from "path";
9
9
  import { fileURLToPath } from "url";
10
10
  var __filename = fileURLToPath(import.meta.url);
11
11
  var __dirname = path.dirname(__filename);
12
- var CORE_VERSION = "0.3.15";
12
+ var CORE_VERSION = "0.3.17";
13
13
  var TEMPLATE_DIR = fs.existsSync(path.resolve(__dirname, "../template")) ? path.resolve(__dirname, "../template") : path.resolve(__dirname, "../../../templates/jant-site");
14
14
  function isValidProjectName(name) {
15
15
  return /^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/.test(name);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-jant",
3
- "version": "0.3.15",
3
+ "version": "0.3.17",
4
4
  "description": "Create a new Jant project",
5
5
  "type": "module",
6
6
  "bin": {
@@ -2,29 +2,45 @@
2
2
 
3
3
  A personal website/blog powered by [Jant](https://github.com/jant-me/jant).
4
4
 
5
- ## Local Development
5
+ ## Getting Started
6
+
7
+ ### Option A: One-Click Deploy
8
+
9
+ Deploy to Cloudflare instantly — no local setup required:
10
+
11
+ [![Deploy to Cloudflare](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/jant-me/jant-starter)
12
+
13
+ Your site will be live with automatic CI/CD. To develop locally:
6
14
 
7
15
  ```bash
8
- pnpm dev
16
+ # Clone the repo that was created for you
17
+ git clone git@github.com:<your-username>/<your-repo>.git
18
+ cd <your-repo>
19
+ npm install
20
+ npm run dev
9
21
  ```
10
22
 
11
- Visit http://localhost:9019 to see your site.
23
+ Visit http://localhost:9019. Changes pushed to `main` will auto-deploy.
12
24
 
13
- ## Deploy to Cloudflare
25
+ > If you used this option, skip ahead to [Commands](#commands) — the deployment and CI/CD sections below don't apply to you.
14
26
 
15
- ### Option A: One-Click Deploy
27
+ ### Option B: Create with CLI
16
28
 
17
- [![Deploy to Cloudflare](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/jant-me/jant-starter)
29
+ Set up a new project locally, then deploy manually:
18
30
 
19
- Click the button, name your Worker, D1 database, and R2 bucket, set `AUTH_SECRET` (32+ random characters), and you're done!
31
+ ```bash
32
+ npm create jant my-site
33
+ cd my-site
34
+ npm run dev
35
+ ```
20
36
 
21
- After deploying, set `SITE_URL` in Cloudflare dashboard your Worker Settings Variables.
37
+ Visit http://localhost:9019. When you're ready to go live, continue with [Deploy to Cloudflare](#deploy-to-cloudflare) below.
22
38
 
23
- > If you deployed via the button, skip to [Custom Domain](#custom-domain-optional).
39
+ ## Deploy to Cloudflare
24
40
 
25
- ### Option B: Manual Deployment
41
+ > This section is for **CLI-created projects** (Option B). One-click deploy users already have this set up.
26
42
 
27
- #### 1. Prerequisites
43
+ ### 1. Prerequisites
28
44
 
29
45
  Install [Wrangler CLI](https://developers.cloudflare.com/workers/wrangler/install-and-update/) and log in:
30
46
 
@@ -32,7 +48,7 @@ Install [Wrangler CLI](https://developers.cloudflare.com/workers/wrangler/instal
32
48
  wrangler login
33
49
  ```
34
50
 
35
- #### 2. Create D1 Database
51
+ ### 2. Create D1 Database
36
52
 
37
53
  Check the `database_name` in your `wrangler.toml` (defaults to `<your-project>-db`), then create it:
38
54
 
@@ -41,7 +57,7 @@ wrangler d1 create <your-project>-db
41
57
  # Copy the database_id from the output!
42
58
  ```
43
59
 
44
- #### 3. Update Configuration
60
+ ### 3. Update Configuration
45
61
 
46
62
  Edit `wrangler.toml`:
47
63
 
@@ -52,7 +68,7 @@ Edit `wrangler.toml`:
52
68
  >
53
69
  > **Note:** Changing `database_id` resets your local development database (local data is stored per database ID). If you've already started local development, you'll need to go through the setup wizard again to create your admin account.
54
70
 
55
- #### 4. Set Production Secrets
71
+ ### 4. Set Production Secrets
56
72
 
57
73
  Generate a production secret and save it somewhere safe (you'll need it again for CI):
58
74
 
@@ -65,18 +81,18 @@ wrangler secret put AUTH_SECRET
65
81
  # Paste the generated value when prompted
66
82
  ```
67
83
 
68
- > **Important:** This is separate from the `AUTH_SECRET` in `.dev.vars` (which is for local development only). Do not change the production secret after your site is live — it will invalidate all sessions. If you get locked out, use `pnpm reset-password` to generate a password reset link.
84
+ > **Important:** This is separate from the `AUTH_SECRET` in `.dev.vars` (which is for local development only). Do not change the production secret after your site is live — it will invalidate all sessions. If you get locked out, use `npm run reset-password` to generate a password reset link.
69
85
 
70
- #### 5. Deploy
86
+ ### 5. Deploy
71
87
 
72
88
  ```bash
73
89
  # Apply database migrations and deploy
74
- pnpm run deploy
90
+ npm run deploy
75
91
  ```
76
92
 
77
93
  Your site is now live at `https://<your-project>.<your-subdomain>.workers.dev`!
78
94
 
79
- ### Custom Domain (Optional)
95
+ ### 6. Custom Domain (Optional)
80
96
 
81
97
  1. Go to [Cloudflare Dashboard](https://dash.cloudflare.com) → Workers & Pages
82
98
  2. Select your worker → Settings → Domains & Routes
@@ -84,7 +100,9 @@ Your site is now live at `https://<your-project>.<your-subdomain>.workers.dev`!
84
100
 
85
101
  ## GitHub Actions (CI/CD)
86
102
 
87
- A workflow file is included at `.github/workflows/deploy.yml`. Complete the [manual deployment](#option-b-manual-deployment) first, then set up CI for automatic deployments.
103
+ > This section is for **CLI-created projects** (Option B). One-click deploy users already have CI/CD configured.
104
+
105
+ A workflow file is included at `.github/workflows/deploy.yml`. Complete the [deployment](#deploy-to-cloudflare) first, then set up CI for automatic deployments.
88
106
 
89
107
  > Runtime secrets (`AUTH_SECRET`, S3 keys, etc.) are already stored in Cloudflare from the manual deployment step. CI only needs deployment credentials.
90
108
 
@@ -157,22 +175,16 @@ jobs:
157
175
  CF_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
158
176
  ```
159
177
 
160
- ### Cloudflare Workers Builds (Alternative CI/CD)
161
-
162
- Workers Builds is auto-configured if you used the [One-Click Deploy](#option-a-one-click-deploy) button. To enable auto-deploy on push, go to Cloudflare dashboard → Workers → your worker → Settings → Builds.
163
-
164
178
  ## Commands
165
179
 
166
- | Command | Description |
167
- | ------------------------ | ---------------------------------- |
168
- | `pnpm dev` | Start development server |
169
- | `pnpm build` | Build for production |
170
- | `pnpm run deploy` | Migrate, build, and deploy |
171
- | `pnpm preview` | Preview production build |
172
- | `pnpm typecheck` | Run TypeScript checks |
173
- | `pnpm db:migrate:remote` | Apply database migrations (remote) |
174
-
175
- > `deploy` uses `pnpm run deploy` because `pnpm deploy` is a built-in pnpm command. All other scripts work with or without `run`.
180
+ | Command | Description |
181
+ | --------------------------- | ---------------------------------- |
182
+ | `npm run dev` | Start development server |
183
+ | `npm run build` | Build for production |
184
+ | `npm run deploy` | Migrate, build, and deploy |
185
+ | `npm run preview` | Preview production build |
186
+ | `npm run typecheck` | Run TypeScript checks |
187
+ | `npm run db:migrate:remote` | Apply database migrations (remote) |
176
188
 
177
189
  ## Environment Variables
178
190
 
@@ -235,7 +247,7 @@ Add custom CSS in `src/theme/styles/`:
235
247
  ### Using Third-Party Themes
236
248
 
237
249
  ```bash
238
- pnpm add @jant-themes/minimal
250
+ npm install @jant-themes/minimal
239
251
  ```
240
252
 
241
253
  ```typescript
@@ -251,13 +263,13 @@ export default createApp({
251
263
 
252
264
  ```bash
253
265
  # Update @jant/core to latest version
254
- pnpm add @jant/core@latest
266
+ npm install @jant/core@latest
255
267
 
256
268
  # Start dev server (auto-applies migrations locally)
257
- pnpm dev
269
+ npm run dev
258
270
 
259
271
  # Deploy (includes remote migrations)
260
- pnpm run deploy
272
+ npm run deploy
261
273
  ```
262
274
 
263
275
  > New versions of `@jant/core` may include database migrations. Check the [release notes](https://github.com/jant-me/jant/releases) for any breaking changes.