create-jant 0.3.14 → 0.3.16
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/README.md +9 -9
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/template/README.md +20 -14
- package/template/package.json +3 -3
package/README.md
CHANGED
|
@@ -71,16 +71,16 @@ my-site/
|
|
|
71
71
|
## Scripts
|
|
72
72
|
|
|
73
73
|
```bash
|
|
74
|
-
pnpm dev
|
|
75
|
-
pnpm build
|
|
74
|
+
pnpm dev # Start dev server (http://localhost:9019)
|
|
75
|
+
pnpm build # Build for production
|
|
76
76
|
pnpm run deploy # Build + deploy to Cloudflare Workers
|
|
77
|
-
pnpm typecheck
|
|
78
|
-
pnpm lint
|
|
79
|
-
pnpm format
|
|
80
|
-
pnpm db:generate
|
|
81
|
-
pnpm db:migrate:local
|
|
82
|
-
pnpm db:migrate:remote
|
|
83
|
-
pnpm i18n:build
|
|
77
|
+
pnpm typecheck # Run TypeScript checks
|
|
78
|
+
pnpm lint # Run ESLint
|
|
79
|
+
pnpm format # Format code with Prettier
|
|
80
|
+
pnpm db:generate # Generate Drizzle migrations
|
|
81
|
+
pnpm db:migrate:local # Apply migrations (local)
|
|
82
|
+
pnpm db:migrate:remote # Apply migrations (production)
|
|
83
|
+
pnpm i18n:build # Extract + compile translations
|
|
84
84
|
```
|
|
85
85
|
|
|
86
86
|
## License
|
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.
|
|
12
|
+
var CORE_VERSION = "0.3.16";
|
|
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
package/template/README.md
CHANGED
|
@@ -2,9 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
A personal website/blog powered by [Jant](https://github.com/jant-me/jant).
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**Want your own site?** Deploy to Cloudflare in one click:
|
|
6
|
+
|
|
7
|
+
[](https://deploy.workers.cloudflare.com/?url=https://github.com/jant-me/jant-starter)
|
|
8
|
+
|
|
9
|
+
> Already deployed? Your site is live with automatic CI/CD. You can clone your repo and run `pnpm dev` to customize or [update](#updating) your site locally.
|
|
10
|
+
|
|
11
|
+
## Getting Started
|
|
6
12
|
|
|
7
13
|
```bash
|
|
14
|
+
pnpm create jant my-site
|
|
15
|
+
cd my-site
|
|
8
16
|
pnpm dev
|
|
9
17
|
```
|
|
10
18
|
|
|
@@ -12,6 +20,8 @@ Visit http://localhost:9019 to see your site.
|
|
|
12
20
|
|
|
13
21
|
## Deploy to Cloudflare
|
|
14
22
|
|
|
23
|
+
Once you've run `pnpm create jant my-site`, follow these steps to deploy it.
|
|
24
|
+
|
|
15
25
|
### 1. Prerequisites
|
|
16
26
|
|
|
17
27
|
Install [Wrangler CLI](https://developers.cloudflare.com/workers/wrangler/install-and-update/) and log in:
|
|
@@ -34,7 +44,7 @@ wrangler d1 create <your-project>-db
|
|
|
34
44
|
Edit `wrangler.toml`:
|
|
35
45
|
|
|
36
46
|
- Replace `database_id = "local"` with the ID from step 2
|
|
37
|
-
- Set `SITE_URL` to your production URL
|
|
47
|
+
- Set `SITE_URL` to your production URL (e.g. `https://example.com`)
|
|
38
48
|
|
|
39
49
|
> R2 bucket is automatically created on first deploy — no manual setup needed.
|
|
40
50
|
>
|
|
@@ -58,10 +68,7 @@ wrangler secret put AUTH_SECRET
|
|
|
58
68
|
### 5. Deploy
|
|
59
69
|
|
|
60
70
|
```bash
|
|
61
|
-
# Apply database migrations
|
|
62
|
-
pnpm db:migrate:remote
|
|
63
|
-
|
|
64
|
-
# Build and deploy
|
|
71
|
+
# Apply database migrations and deploy
|
|
65
72
|
pnpm run deploy
|
|
66
73
|
```
|
|
67
74
|
|
|
@@ -75,7 +82,7 @@ Your site is now live at `https://<your-project>.<your-subdomain>.workers.dev`!
|
|
|
75
82
|
|
|
76
83
|
## GitHub Actions (CI/CD)
|
|
77
84
|
|
|
78
|
-
A workflow file is included at `.github/workflows/deploy.yml`. Complete the [
|
|
85
|
+
A workflow file is included at `.github/workflows/deploy.yml`. Complete the [deployment](#deploy-to-cloudflare) first, then set up CI for automatic deployments.
|
|
79
86
|
|
|
80
87
|
> Runtime secrets (`AUTH_SECRET`, S3 keys, etc.) are already stored in Cloudflare from the manual deployment step. CI only needs deployment credentials.
|
|
81
88
|
|
|
@@ -86,7 +93,7 @@ Create a new repository on [GitHub](https://github.com/new), then commit and pus
|
|
|
86
93
|
```bash
|
|
87
94
|
git add -A
|
|
88
95
|
git commit -m "Initial setup"
|
|
89
|
-
git remote add origin
|
|
96
|
+
git remote add origin git@github.com:<your-username>/<your-repo>.git
|
|
90
97
|
git push -u origin main
|
|
91
98
|
```
|
|
92
99
|
|
|
@@ -154,11 +161,13 @@ jobs:
|
|
|
154
161
|
| ------------------------ | ---------------------------------- |
|
|
155
162
|
| `pnpm dev` | Start development server |
|
|
156
163
|
| `pnpm build` | Build for production |
|
|
157
|
-
| `pnpm run deploy` |
|
|
164
|
+
| `pnpm run deploy` | Migrate, build, and deploy |
|
|
158
165
|
| `pnpm preview` | Preview production build |
|
|
159
166
|
| `pnpm typecheck` | Run TypeScript checks |
|
|
160
167
|
| `pnpm db:migrate:remote` | Apply database migrations (remote) |
|
|
161
168
|
|
|
169
|
+
> `deploy` uses `pnpm run deploy` because `pnpm deploy` is a built-in pnpm command. All other scripts work with or without `run`.
|
|
170
|
+
|
|
162
171
|
## Environment Variables
|
|
163
172
|
|
|
164
173
|
| Variable | Description | Location |
|
|
@@ -241,14 +250,11 @@ pnpm add @jant/core@latest
|
|
|
241
250
|
# Start dev server (auto-applies migrations locally)
|
|
242
251
|
pnpm dev
|
|
243
252
|
|
|
244
|
-
#
|
|
245
|
-
pnpm db:migrate:remote
|
|
246
|
-
|
|
247
|
-
# Deploy
|
|
253
|
+
# Deploy (includes remote migrations)
|
|
248
254
|
pnpm run deploy
|
|
249
255
|
```
|
|
250
256
|
|
|
251
|
-
> New versions of `@jant/core` may include database migrations.
|
|
257
|
+
> New versions of `@jant/core` may include database migrations. Check the [release notes](https://github.com/jant-me/jant/releases) for any breaking changes.
|
|
252
258
|
>
|
|
253
259
|
> **Dev dependencies** (vite, wrangler, tailwindcss, etc.) may also need updating. Compare your `devDependencies` with the [latest template](https://github.com/jant-me/jant/blob/main/templates/jant-site/package.json) and update if needed.
|
|
254
260
|
|
package/template/package.json
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "pnpm@10.28.2",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"dev": "pnpm db:migrate:local && vite dev",
|
|
9
|
-
"dev:debug": "pnpm db:migrate:local && vite dev --port 19019",
|
|
8
|
+
"dev": "pnpm run db:migrate:local && vite dev",
|
|
9
|
+
"dev:debug": "pnpm run db:migrate:local && vite dev --port 19019",
|
|
10
10
|
"build": "vite build",
|
|
11
|
-
"deploy": "pnpm build && wrangler deploy",
|
|
11
|
+
"deploy": "pnpm run db:migrate:remote && pnpm run build && wrangler deploy",
|
|
12
12
|
"preview": "vite preview",
|
|
13
13
|
"typecheck": "tsc --noEmit",
|
|
14
14
|
"db:migrate:local": "yes | wrangler d1 migrations apply DB --local",
|