create-jant 0.1.23 → 0.2.0
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/package.json +1 -1
- package/template/wrangler.demo.toml +1 -1
- package/template/wrangler.toml +1 -1
- package/template/scripts/README.md +0 -124
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import path from "path";
|
|
|
8
8
|
import { fileURLToPath } from "url";
|
|
9
9
|
var __filename = fileURLToPath(import.meta.url);
|
|
10
10
|
var __dirname = path.dirname(__filename);
|
|
11
|
-
var CORE_VERSION = "0.
|
|
11
|
+
var CORE_VERSION = "0.3.0";
|
|
12
12
|
var TEMPLATE_DIR = fs.existsSync(path.resolve(__dirname, "../template")) ? path.resolve(__dirname, "../template") : path.resolve(__dirname, "../../../templates/jant-site");
|
|
13
13
|
function isValidProjectName(name) {
|
|
14
14
|
return /^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/.test(name);
|
package/package.json
CHANGED
package/template/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"deploy": "pnpm build && wrangler deploy",
|
|
12
12
|
"preview": "vite preview",
|
|
13
13
|
"typecheck": "tsc --noEmit",
|
|
14
|
-
"db:migrate:local": "wrangler d1 migrations apply DB --local
|
|
14
|
+
"db:migrate:local": "yes | wrangler d1 migrations apply DB --local",
|
|
15
15
|
"db:migrate:remote": "wrangler d1 migrations apply DB --remote",
|
|
16
16
|
"jant": "jant",
|
|
17
17
|
"reset-password": "node scripts/reset-password.mjs"
|
|
@@ -14,7 +14,7 @@ DEMO_PASSWORD = "demodemo"
|
|
|
14
14
|
[[d1_databases]]
|
|
15
15
|
binding = "DB"
|
|
16
16
|
database_name = "jant-demo-db"
|
|
17
|
-
database_id = "
|
|
17
|
+
database_id = "76329154-291d-4580-af73-aa77397649f1"
|
|
18
18
|
migrations_dir = "migrations"
|
|
19
19
|
|
|
20
20
|
[[r2_buckets]]
|
package/template/wrangler.toml
CHANGED
|
@@ -22,7 +22,7 @@ SITE_URL = "http://localhost:9019"
|
|
|
22
22
|
# Optional: Site configuration
|
|
23
23
|
# These can be overridden in dashboard settings (/dash/settings)
|
|
24
24
|
# If not set, values from database settings table are used
|
|
25
|
-
SITE_NAME = "My Blog
|
|
25
|
+
# SITE_NAME = "My Blog"
|
|
26
26
|
# SITE_DESCRIPTION = "A personal blog powered by Jant"
|
|
27
27
|
# SITE_LANGUAGE = "en"
|
|
28
28
|
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
# Demo Deployment Scripts
|
|
2
|
-
|
|
3
|
-
This directory contains scripts for managing the demo site at demo.jant.me.
|
|
4
|
-
|
|
5
|
-
## Setup
|
|
6
|
-
|
|
7
|
-
### 1. Create Cloudflare Resources
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
# Create D1 database
|
|
11
|
-
wrangler d1 create jant-demo-db
|
|
12
|
-
# Output: Created database 'jant-demo-db' with id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
|
13
|
-
|
|
14
|
-
# Create R2 bucket
|
|
15
|
-
wrangler r2 bucket create jant-demo-media
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
### 2. Update wrangler.demo.toml
|
|
19
|
-
|
|
20
|
-
Edit `templates/jant-site/wrangler.demo.toml` and replace the placeholder database_id:
|
|
21
|
-
|
|
22
|
-
```toml
|
|
23
|
-
[[d1_databases]]
|
|
24
|
-
binding = "DB"
|
|
25
|
-
database_name = "jant-demo-db"
|
|
26
|
-
database_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" # <-- Your actual ID
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
### 3. Set Secrets
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
# Set AUTH_SECRET for the demo worker
|
|
33
|
-
wrangler secret put AUTH_SECRET --config wrangler.demo.toml
|
|
34
|
-
# Enter a random string (32+ characters)
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
### 4. Configure GitHub Secrets
|
|
38
|
-
|
|
39
|
-
Add the following secrets to your GitHub repository:
|
|
40
|
-
|
|
41
|
-
| Secret | Description |
|
|
42
|
-
| ------------------ | --------------------------------------------------------- |
|
|
43
|
-
| `CF_API_TOKEN` | Cloudflare API token with Workers, D1, and R2 permissions |
|
|
44
|
-
| `CF_ACCOUNT_ID` | Your Cloudflare account ID |
|
|
45
|
-
| `DEMO_AUTH_SECRET` | Same value as AUTH_SECRET above |
|
|
46
|
-
|
|
47
|
-
### 5. Set Custom Domain
|
|
48
|
-
|
|
49
|
-
In the Cloudflare dashboard:
|
|
50
|
-
|
|
51
|
-
1. Go to Workers & Pages > jant-demo
|
|
52
|
-
2. Settings > Triggers > Custom Domains
|
|
53
|
-
3. Add `demo.jant.me`
|
|
54
|
-
|
|
55
|
-
## Scripts
|
|
56
|
-
|
|
57
|
-
### `reset.sql`
|
|
58
|
-
|
|
59
|
-
Clears all user-created data:
|
|
60
|
-
|
|
61
|
-
- Posts, media, collections, redirects
|
|
62
|
-
- Sessions and verifications
|
|
63
|
-
- Preserves settings and user accounts
|
|
64
|
-
|
|
65
|
-
### `seed.sql`
|
|
66
|
-
|
|
67
|
-
Inserts demo data:
|
|
68
|
-
|
|
69
|
-
- Site settings (name, description, etc.)
|
|
70
|
-
- Sample posts (article, note, link, quote)
|
|
71
|
-
- Sample collection
|
|
72
|
-
|
|
73
|
-
## Workflows
|
|
74
|
-
|
|
75
|
-
### Deploy Demo (`.github/workflows/deploy-demo.yml`)
|
|
76
|
-
|
|
77
|
-
Triggers:
|
|
78
|
-
|
|
79
|
-
- Push to `main` branch (when core or template changes)
|
|
80
|
-
- Manual dispatch
|
|
81
|
-
|
|
82
|
-
Actions:
|
|
83
|
-
|
|
84
|
-
- Builds the project
|
|
85
|
-
- Deploys to Cloudflare Workers
|
|
86
|
-
- Runs database migrations
|
|
87
|
-
|
|
88
|
-
### Reset Demo (`.github/workflows/reset-demo.yml`)
|
|
89
|
-
|
|
90
|
-
Triggers:
|
|
91
|
-
|
|
92
|
-
- Daily at 00:00 UTC (cron)
|
|
93
|
-
- Manual dispatch (requires "reset" confirmation)
|
|
94
|
-
|
|
95
|
-
Actions:
|
|
96
|
-
|
|
97
|
-
- Clears all user data
|
|
98
|
-
- Re-inserts seed data
|
|
99
|
-
|
|
100
|
-
## Manual Operations
|
|
101
|
-
|
|
102
|
-
### Deploy manually
|
|
103
|
-
|
|
104
|
-
```bash
|
|
105
|
-
cd templates/jant-site
|
|
106
|
-
pnpm build
|
|
107
|
-
wrangler deploy --config wrangler.demo.toml
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
### Reset data manually
|
|
111
|
-
|
|
112
|
-
```bash
|
|
113
|
-
# Clear data
|
|
114
|
-
wrangler d1 execute jant-demo-db --remote --file=scripts/reset.sql
|
|
115
|
-
|
|
116
|
-
# Insert seed data
|
|
117
|
-
wrangler d1 execute jant-demo-db --remote --file=scripts/seed.sql
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
### Run migrations manually
|
|
121
|
-
|
|
122
|
-
```bash
|
|
123
|
-
wrangler d1 migrations apply jant-demo-db --remote
|
|
124
|
-
```
|