create-jant 0.3.16 → 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 +1 -1
- package/package.json +1 -1
- package/template/README.md +41 -23
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.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
package/template/README.md
CHANGED
|
@@ -2,25 +2,43 @@
|
|
|
2
2
|
|
|
3
3
|
A personal website/blog powered by [Jant](https://github.com/jant-me/jant).
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Getting Started
|
|
6
|
+
|
|
7
|
+
### Option A: One-Click Deploy
|
|
8
|
+
|
|
9
|
+
Deploy to Cloudflare instantly — no local setup required:
|
|
6
10
|
|
|
7
11
|
[](https://deploy.workers.cloudflare.com/?url=https://github.com/jant-me/jant-starter)
|
|
8
12
|
|
|
9
|
-
|
|
13
|
+
Your site will be live with automatic CI/CD. To develop locally:
|
|
10
14
|
|
|
11
|
-
|
|
15
|
+
```bash
|
|
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
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Visit http://localhost:9019. Changes pushed to `main` will auto-deploy.
|
|
24
|
+
|
|
25
|
+
> If you used this option, skip ahead to [Commands](#commands) — the deployment and CI/CD sections below don't apply to you.
|
|
26
|
+
|
|
27
|
+
### Option B: Create with CLI
|
|
28
|
+
|
|
29
|
+
Set up a new project locally, then deploy manually:
|
|
12
30
|
|
|
13
31
|
```bash
|
|
14
|
-
|
|
32
|
+
npm create jant my-site
|
|
15
33
|
cd my-site
|
|
16
|
-
|
|
34
|
+
npm run dev
|
|
17
35
|
```
|
|
18
36
|
|
|
19
|
-
Visit http://localhost:9019 to
|
|
37
|
+
Visit http://localhost:9019. When you're ready to go live, continue with [Deploy to Cloudflare](#deploy-to-cloudflare) below.
|
|
20
38
|
|
|
21
39
|
## Deploy to Cloudflare
|
|
22
40
|
|
|
23
|
-
|
|
41
|
+
> This section is for **CLI-created projects** (Option B). One-click deploy users already have this set up.
|
|
24
42
|
|
|
25
43
|
### 1. Prerequisites
|
|
26
44
|
|
|
@@ -63,13 +81,13 @@ wrangler secret put AUTH_SECRET
|
|
|
63
81
|
# Paste the generated value when prompted
|
|
64
82
|
```
|
|
65
83
|
|
|
66
|
-
> **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 `
|
|
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.
|
|
67
85
|
|
|
68
86
|
### 5. Deploy
|
|
69
87
|
|
|
70
88
|
```bash
|
|
71
89
|
# Apply database migrations and deploy
|
|
72
|
-
|
|
90
|
+
npm run deploy
|
|
73
91
|
```
|
|
74
92
|
|
|
75
93
|
Your site is now live at `https://<your-project>.<your-subdomain>.workers.dev`!
|
|
@@ -82,6 +100,8 @@ Your site is now live at `https://<your-project>.<your-subdomain>.workers.dev`!
|
|
|
82
100
|
|
|
83
101
|
## GitHub Actions (CI/CD)
|
|
84
102
|
|
|
103
|
+
> This section is for **CLI-created projects** (Option B). One-click deploy users already have CI/CD configured.
|
|
104
|
+
|
|
85
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.
|
|
86
106
|
|
|
87
107
|
> Runtime secrets (`AUTH_SECRET`, S3 keys, etc.) are already stored in Cloudflare from the manual deployment step. CI only needs deployment credentials.
|
|
@@ -157,16 +177,14 @@ jobs:
|
|
|
157
177
|
|
|
158
178
|
## Commands
|
|
159
179
|
|
|
160
|
-
| Command
|
|
161
|
-
|
|
|
162
|
-
| `
|
|
163
|
-
| `
|
|
164
|
-
| `
|
|
165
|
-
| `
|
|
166
|
-
| `
|
|
167
|
-
| `
|
|
168
|
-
|
|
169
|
-
> `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) |
|
|
170
188
|
|
|
171
189
|
## Environment Variables
|
|
172
190
|
|
|
@@ -229,7 +247,7 @@ Add custom CSS in `src/theme/styles/`:
|
|
|
229
247
|
### Using Third-Party Themes
|
|
230
248
|
|
|
231
249
|
```bash
|
|
232
|
-
|
|
250
|
+
npm install @jant-themes/minimal
|
|
233
251
|
```
|
|
234
252
|
|
|
235
253
|
```typescript
|
|
@@ -245,13 +263,13 @@ export default createApp({
|
|
|
245
263
|
|
|
246
264
|
```bash
|
|
247
265
|
# Update @jant/core to latest version
|
|
248
|
-
|
|
266
|
+
npm install @jant/core@latest
|
|
249
267
|
|
|
250
268
|
# Start dev server (auto-applies migrations locally)
|
|
251
|
-
|
|
269
|
+
npm run dev
|
|
252
270
|
|
|
253
271
|
# Deploy (includes remote migrations)
|
|
254
|
-
|
|
272
|
+
npm run deploy
|
|
255
273
|
```
|
|
256
274
|
|
|
257
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.
|