create-jant 0.3.15 → 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/dist/index.js +1 -1
- package/package.json +1 -1
- package/template/README.md +17 -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.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,19 +20,9 @@ Visit http://localhost:9019 to see your site.
|
|
|
12
20
|
|
|
13
21
|
## Deploy to Cloudflare
|
|
14
22
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
[](https://deploy.workers.cloudflare.com/?url=https://github.com/jant-me/jant-starter)
|
|
18
|
-
|
|
19
|
-
Click the button, name your Worker, D1 database, and R2 bucket, set `AUTH_SECRET` (32+ random characters), and you're done!
|
|
20
|
-
|
|
21
|
-
After deploying, set `SITE_URL` in Cloudflare dashboard → your Worker → Settings → Variables.
|
|
22
|
-
|
|
23
|
-
> If you deployed via the button, skip to [Custom Domain](#custom-domain-optional).
|
|
23
|
+
Once you've run `pnpm create jant my-site`, follow these steps to deploy it.
|
|
24
24
|
|
|
25
|
-
###
|
|
26
|
-
|
|
27
|
-
#### 1. Prerequisites
|
|
25
|
+
### 1. Prerequisites
|
|
28
26
|
|
|
29
27
|
Install [Wrangler CLI](https://developers.cloudflare.com/workers/wrangler/install-and-update/) and log in:
|
|
30
28
|
|
|
@@ -32,7 +30,7 @@ Install [Wrangler CLI](https://developers.cloudflare.com/workers/wrangler/instal
|
|
|
32
30
|
wrangler login
|
|
33
31
|
```
|
|
34
32
|
|
|
35
|
-
|
|
33
|
+
### 2. Create D1 Database
|
|
36
34
|
|
|
37
35
|
Check the `database_name` in your `wrangler.toml` (defaults to `<your-project>-db`), then create it:
|
|
38
36
|
|
|
@@ -41,7 +39,7 @@ wrangler d1 create <your-project>-db
|
|
|
41
39
|
# Copy the database_id from the output!
|
|
42
40
|
```
|
|
43
41
|
|
|
44
|
-
|
|
42
|
+
### 3. Update Configuration
|
|
45
43
|
|
|
46
44
|
Edit `wrangler.toml`:
|
|
47
45
|
|
|
@@ -52,7 +50,7 @@ Edit `wrangler.toml`:
|
|
|
52
50
|
>
|
|
53
51
|
> **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
52
|
|
|
55
|
-
|
|
53
|
+
### 4. Set Production Secrets
|
|
56
54
|
|
|
57
55
|
Generate a production secret and save it somewhere safe (you'll need it again for CI):
|
|
58
56
|
|
|
@@ -67,7 +65,7 @@ wrangler secret put AUTH_SECRET
|
|
|
67
65
|
|
|
68
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 `pnpm reset-password` to generate a password reset link.
|
|
69
67
|
|
|
70
|
-
|
|
68
|
+
### 5. Deploy
|
|
71
69
|
|
|
72
70
|
```bash
|
|
73
71
|
# Apply database migrations and deploy
|
|
@@ -76,7 +74,7 @@ pnpm run deploy
|
|
|
76
74
|
|
|
77
75
|
Your site is now live at `https://<your-project>.<your-subdomain>.workers.dev`!
|
|
78
76
|
|
|
79
|
-
### Custom Domain (Optional)
|
|
77
|
+
### 6. Custom Domain (Optional)
|
|
80
78
|
|
|
81
79
|
1. Go to [Cloudflare Dashboard](https://dash.cloudflare.com) → Workers & Pages
|
|
82
80
|
2. Select your worker → Settings → Domains & Routes
|
|
@@ -84,7 +82,7 @@ Your site is now live at `https://<your-project>.<your-subdomain>.workers.dev`!
|
|
|
84
82
|
|
|
85
83
|
## GitHub Actions (CI/CD)
|
|
86
84
|
|
|
87
|
-
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.
|
|
88
86
|
|
|
89
87
|
> Runtime secrets (`AUTH_SECRET`, S3 keys, etc.) are already stored in Cloudflare from the manual deployment step. CI only needs deployment credentials.
|
|
90
88
|
|
|
@@ -157,10 +155,6 @@ jobs:
|
|
|
157
155
|
CF_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
|
|
158
156
|
```
|
|
159
157
|
|
|
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
158
|
## Commands
|
|
165
159
|
|
|
166
160
|
| Command | Description |
|