create-jant 0.3.27 → 0.3.29

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.
@@ -1,27 +1,12 @@
1
- # Dependencies
2
1
  node_modules/
3
-
4
- # Build outputs
5
- dist/
6
- .swc/
7
-
8
- # Cloudflare
9
2
  .wrangler/
10
3
  .dev.vars
11
-
12
- # Environment
13
4
  .env
14
5
  .env.*
15
6
  !.env.example
16
-
17
- # IDE
18
7
  .idea/
19
8
  .vscode/*
20
9
  !.vscode/extensions.json
21
10
  !.vscode/settings.json
22
-
23
- # OS
24
11
  .DS_Store
25
-
26
- # Logs
27
12
  *.log
@@ -0,0 +1,3 @@
1
+ import { createApp } from "@jant/core";
2
+
3
+ export default createApp();
@@ -1,36 +1,16 @@
1
1
  {
2
- "name": "jant-site",
3
- "version": "0.0.1",
2
+ "name": "jant-demo",
4
3
  "private": true,
5
4
  "type": "module",
6
- "packageManager": "pnpm@10.28.2",
7
5
  "scripts": {
8
- "dev": "pnpm run db:migrate:local && vite dev",
9
- "dev:debug": "pnpm run db:migrate:local && vite dev --port 19019",
10
- "build": "vite build",
11
- "deploy": "pnpm run db:migrate:remote && pnpm run build && wrangler deploy",
12
- "preview": "vite preview",
13
- "typecheck": "tsc --noEmit",
14
- "db:migrate:local": "yes | wrangler d1 migrations apply DB --local",
15
- "db:migrate:remote": "wrangler d1 migrations apply DB --remote",
16
- "jant": "jant",
17
- "reset-password": "node scripts/reset-password.mjs"
6
+ "dev": "wrangler d1 migrations apply DB --local && wrangler dev",
7
+ "deploy": "wrangler d1 migrations apply DB --remote && wrangler deploy",
8
+ "reset-password": "jant-reset-password"
18
9
  },
19
10
  "dependencies": {
20
11
  "@jant/core": "workspace:*"
21
12
  },
22
13
  "devDependencies": {
23
- "@cloudflare/vite-plugin": "^1.22.1",
24
- "@cloudflare/workers-types": "^4.20260131.0",
25
- "@lingui/swc-plugin": "^5.10.1",
26
- "@swc/core": "^1.15.11",
27
- "@tailwindcss/vite": "^4.1.18",
28
- "@types/node": "^22.15.4",
29
- "hono": "^4.11.9",
30
- "tailwindcss": "^4.1.18",
31
- "typescript": "^5.9.3",
32
- "unplugin-swc": "^1.5.9",
33
- "vite": "^7.3.1",
34
14
  "wrangler": "^4.61.1"
35
15
  }
36
16
  }
@@ -1,11 +1,16 @@
1
- name = "jant-site" # @create-jant: "${name}"
2
- main = "src/index.ts"
1
+ name = "jant-demo" # @create-jant: "${name}"
2
+ main = "index.js"
3
3
  compatibility_date = "2026-01-20"
4
4
  compatibility_flags = ["nodejs_compat"]
5
5
  account_id = "03e7294bdb3750ed5a0d6afef6d770e4" # @create-jant: @remove
6
6
 
7
+ [assets]
8
+ directory = "./node_modules/@jant/core/dist/client"
9
+
10
+ # @create-jant: @remove-start
7
11
  [dev]
8
12
  port = 9019
13
+ # @create-jant: @remove-end
9
14
 
10
15
  # ============================================
11
16
  # Environment Variables
@@ -14,54 +19,56 @@ port = 9019
14
19
  # Sensitive secrets (like AUTH_SECRET) should be:
15
20
  # - Local dev: .dev.vars file (not committed)
16
21
  # - Production: wrangler secret put AUTH_SECRET
17
- # See docs/configuration.md for full details
22
+ # Full details: https://github.com/jant-me/jant/blob/main/docs/configuration.md
18
23
 
19
24
  [vars]
20
25
  # Required: Your site's public URL (e.g. https://my-blog.example.com)
21
- SITE_URL = ""
26
+ # https://github.com/jant-me/jant/blob/main/docs/configuration.md#required
27
+ SITE_URL = "https://demo.jant.me" # @create-jant: ""
22
28
 
23
29
  # Optional: Site configuration
24
- # These can be overridden in dashboard settings (/dash/settings)
25
- # If not set, values from database settings table are used
30
+ # You can also set these in the dashboard UI at /dash/settings
31
+ # https://github.com/jant-me/jant/blob/main/docs/configuration.md#dashboard-settings
26
32
  # SITE_NAME = "My Blog"
27
33
  # SITE_DESCRIPTION = "A personal blog powered by Jant"
28
34
  # SITE_LANGUAGE = "en"
29
35
 
30
36
  # Optional: Timeline page size (default: 20)
31
- # PAGE_SIZE = "5"
37
+ # PAGE_SIZE = "20"
32
38
 
33
- # Recommended: R2 public URL for media access
34
- # Without this, media files are proxied through your Worker (slower, uses more CPU).
35
- # With this, media is served directly from Cloudflare's CDN (faster, lower cost).
36
- # Set up: Cloudflare Dashboard → R2 → Your Bucket → Settings → Public access
39
+ # Optional: R2 Storage (for media uploads)
40
+ # https://github.com/jant-me/jant/blob/main/docs/configuration.md#r2-default
37
41
  # R2_PUBLIC_URL = "https://cdn.example.com"
38
42
  R2_PUBLIC_URL = "https://demo-media.jant.me" # @create-jant: @remove
39
43
 
40
44
  # Optional: Cloudflare Image Transformations
41
45
  # For automatic thumbnail generation and image optimization
42
- # Use the same domain as R2_PUBLIC_URL (or SITE_URL if R2_PUBLIC_URL is not set)
43
- # IMAGE_TRANSFORM_URL = "https://media.yourdomain.com/cdn-cgi/image"
46
+ # https://github.com/jant-me/jant/blob/main/docs/configuration.md#image-transformations-optional
47
+ # IMAGE_TRANSFORM_URL = "https://example.com/cdn-cgi/image"
48
+ IMAGE_TRANSFORM_URL = "https://demo-media.jant.me/cdn-cgi/image" # @create-jant: @remove
49
+
50
+ # @create-jant: @remove-start
51
+ DEMO_EMAIL = "demo@jant.me"
52
+ DEMO_PASSWORD = "demodemo"
53
+ # @create-jant: @remove-end
54
+
55
+ [[d1_databases]]
56
+ binding = "DB"
57
+ database_name = "jant-demo-db" # @create-jant: "${name}-db"
58
+ database_id = "76329154-291d-4580-af73-aa77397649f1" # @create-jant: "local"
59
+ migrations_dir = "node_modules/@jant/core/src/db/migrations"
44
60
 
45
- # Optional: Demo mode (pre-fill sign-in credentials)
46
- # DEMO_EMAIL = "demo@example.com"
47
- # DEMO_PASSWORD = "demo123"
61
+ [[r2_buckets]]
62
+ binding = "R2"
63
+ bucket_name = "jant-demo-media" # @create-jant: "${name}-media"
64
+ remote = true # @create-jant: @remove
48
65
 
49
66
  # Optional: S3-compatible storage (alternative to R2)
50
67
  # Set STORAGE_DRIVER = "s3" and configure the options below.
51
68
  # When using S3, the [[r2_buckets]] section can be removed.
69
+ # https://github.com/jant-me/jant/blob/main/docs/configuration.md#s3-compatible-storage
52
70
  # STORAGE_DRIVER = "s3"
53
71
  # S3_ENDPOINT = "https://s3.example.com"
54
72
  # S3_BUCKET = "my-bucket"
55
73
  # S3_REGION = "us-east-1"
56
74
  # S3_PUBLIC_URL = "https://cdn.example.com"
57
-
58
- [[d1_databases]]
59
- binding = "DB"
60
- database_name = "jant-site-db" # @create-jant: "${name}-db"
61
- database_id = "local"
62
- migrations_dir = "../../packages/core/src/db/migrations" # @create-jant: "node_modules/@jant/core/src/db/migrations"
63
-
64
- [[r2_buckets]]
65
- binding = "R2"
66
- bucket_name = "jant-demo-media" # @create-jant: "${name}-media"
67
- remote = true # @create-jant: @remove
@@ -1 +0,0 @@
1
- {}
@@ -1,21 +0,0 @@
1
- #!/bin/sh
2
- basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
-
4
- case `uname` in
5
- *CYGWIN*|*MINGW*|*MSYS*)
6
- if command -v cygpath > /dev/null 2>&1; then
7
- basedir=`cygpath -w "$basedir"`
8
- fi
9
- ;;
10
- esac
11
-
12
- if [ -z "$NODE_PATH" ]; then
13
- export NODE_PATH="/home/runner/work/jant/jant/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/home/runner/work/jant/jant/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/runner/work/jant/jant/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/runner/work/jant/jant/node_modules/.pnpm/node_modules"
14
- else
15
- export NODE_PATH="/home/runner/work/jant/jant/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/home/runner/work/jant/jant/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/runner/work/jant/jant/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/runner/work/jant/jant/node_modules/.pnpm/node_modules:$NODE_PATH"
16
- fi
17
- if [ -x "$basedir/node" ]; then
18
- exec "$basedir/node" "$basedir/../typescript/bin/tsc" "$@"
19
- else
20
- exec node "$basedir/../typescript/bin/tsc" "$@"
21
- fi
@@ -1,21 +0,0 @@
1
- #!/bin/sh
2
- basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
-
4
- case `uname` in
5
- *CYGWIN*|*MINGW*|*MSYS*)
6
- if command -v cygpath > /dev/null 2>&1; then
7
- basedir=`cygpath -w "$basedir"`
8
- fi
9
- ;;
10
- esac
11
-
12
- if [ -z "$NODE_PATH" ]; then
13
- export NODE_PATH="/home/runner/work/jant/jant/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/home/runner/work/jant/jant/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/runner/work/jant/jant/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/runner/work/jant/jant/node_modules/.pnpm/node_modules"
14
- else
15
- export NODE_PATH="/home/runner/work/jant/jant/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/home/runner/work/jant/jant/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/runner/work/jant/jant/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/runner/work/jant/jant/node_modules/.pnpm/node_modules:$NODE_PATH"
16
- fi
17
- if [ -x "$basedir/node" ]; then
18
- exec "$basedir/node" "$basedir/../typescript/bin/tsserver" "$@"
19
- else
20
- exec node "$basedir/../typescript/bin/tsserver" "$@"
21
- fi
@@ -1,21 +0,0 @@
1
- #!/bin/sh
2
- basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
-
4
- case `uname` in
5
- *CYGWIN*|*MINGW*|*MSYS*)
6
- if command -v cygpath > /dev/null 2>&1; then
7
- basedir=`cygpath -w "$basedir"`
8
- fi
9
- ;;
10
- esac
11
-
12
- if [ -z "$NODE_PATH" ]; then
13
- export NODE_PATH="/home/runner/work/jant/jant/node_modules/.pnpm/vite@7.3.1_@types+node@22.19.10_jiti@2.6.1_lightningcss@1.30.2_tsx@4.21.0_yaml@2.8.2/node_modules/vite/bin/node_modules:/home/runner/work/jant/jant/node_modules/.pnpm/vite@7.3.1_@types+node@22.19.10_jiti@2.6.1_lightningcss@1.30.2_tsx@4.21.0_yaml@2.8.2/node_modules/vite/node_modules:/home/runner/work/jant/jant/node_modules/.pnpm/vite@7.3.1_@types+node@22.19.10_jiti@2.6.1_lightningcss@1.30.2_tsx@4.21.0_yaml@2.8.2/node_modules:/home/runner/work/jant/jant/node_modules/.pnpm/node_modules"
14
- else
15
- export NODE_PATH="/home/runner/work/jant/jant/node_modules/.pnpm/vite@7.3.1_@types+node@22.19.10_jiti@2.6.1_lightningcss@1.30.2_tsx@4.21.0_yaml@2.8.2/node_modules/vite/bin/node_modules:/home/runner/work/jant/jant/node_modules/.pnpm/vite@7.3.1_@types+node@22.19.10_jiti@2.6.1_lightningcss@1.30.2_tsx@4.21.0_yaml@2.8.2/node_modules/vite/node_modules:/home/runner/work/jant/jant/node_modules/.pnpm/vite@7.3.1_@types+node@22.19.10_jiti@2.6.1_lightningcss@1.30.2_tsx@4.21.0_yaml@2.8.2/node_modules:/home/runner/work/jant/jant/node_modules/.pnpm/node_modules:$NODE_PATH"
16
- fi
17
- if [ -x "$basedir/node" ]; then
18
- exec "$basedir/node" "$basedir/../vite/bin/vite.js" "$@"
19
- else
20
- exec node "$basedir/../vite/bin/vite.js" "$@"
21
- fi
@@ -1,21 +0,0 @@
1
- #!/bin/sh
2
- basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
-
4
- case `uname` in
5
- *CYGWIN*|*MINGW*|*MSYS*)
6
- if command -v cygpath > /dev/null 2>&1; then
7
- basedir=`cygpath -w "$basedir"`
8
- fi
9
- ;;
10
- esac
11
-
12
- if [ -z "$NODE_PATH" ]; then
13
- export NODE_PATH="/home/runner/work/jant/jant/node_modules/.pnpm/wrangler@4.63.0_@cloudflare+workers-types@4.20260207.0/node_modules/wrangler/bin/node_modules:/home/runner/work/jant/jant/node_modules/.pnpm/wrangler@4.63.0_@cloudflare+workers-types@4.20260207.0/node_modules/wrangler/node_modules:/home/runner/work/jant/jant/node_modules/.pnpm/wrangler@4.63.0_@cloudflare+workers-types@4.20260207.0/node_modules:/home/runner/work/jant/jant/node_modules/.pnpm/node_modules"
14
- else
15
- export NODE_PATH="/home/runner/work/jant/jant/node_modules/.pnpm/wrangler@4.63.0_@cloudflare+workers-types@4.20260207.0/node_modules/wrangler/bin/node_modules:/home/runner/work/jant/jant/node_modules/.pnpm/wrangler@4.63.0_@cloudflare+workers-types@4.20260207.0/node_modules/wrangler/node_modules:/home/runner/work/jant/jant/node_modules/.pnpm/wrangler@4.63.0_@cloudflare+workers-types@4.20260207.0/node_modules:/home/runner/work/jant/jant/node_modules/.pnpm/node_modules:$NODE_PATH"
16
- fi
17
- if [ -x "$basedir/node" ]; then
18
- exec "$basedir/node" "$basedir/../wrangler/bin/wrangler.js" "$@"
19
- else
20
- exec node "$basedir/../wrangler/bin/wrangler.js" "$@"
21
- fi
@@ -1,21 +0,0 @@
1
- #!/bin/sh
2
- basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
-
4
- case `uname` in
5
- *CYGWIN*|*MINGW*|*MSYS*)
6
- if command -v cygpath > /dev/null 2>&1; then
7
- basedir=`cygpath -w "$basedir"`
8
- fi
9
- ;;
10
- esac
11
-
12
- if [ -z "$NODE_PATH" ]; then
13
- export NODE_PATH="/home/runner/work/jant/jant/node_modules/.pnpm/wrangler@4.63.0_@cloudflare+workers-types@4.20260207.0/node_modules/wrangler/bin/node_modules:/home/runner/work/jant/jant/node_modules/.pnpm/wrangler@4.63.0_@cloudflare+workers-types@4.20260207.0/node_modules/wrangler/node_modules:/home/runner/work/jant/jant/node_modules/.pnpm/wrangler@4.63.0_@cloudflare+workers-types@4.20260207.0/node_modules:/home/runner/work/jant/jant/node_modules/.pnpm/node_modules"
14
- else
15
- export NODE_PATH="/home/runner/work/jant/jant/node_modules/.pnpm/wrangler@4.63.0_@cloudflare+workers-types@4.20260207.0/node_modules/wrangler/bin/node_modules:/home/runner/work/jant/jant/node_modules/.pnpm/wrangler@4.63.0_@cloudflare+workers-types@4.20260207.0/node_modules/wrangler/node_modules:/home/runner/work/jant/jant/node_modules/.pnpm/wrangler@4.63.0_@cloudflare+workers-types@4.20260207.0/node_modules:/home/runner/work/jant/jant/node_modules/.pnpm/node_modules:$NODE_PATH"
16
- fi
17
- if [ -x "$basedir/node" ]; then
18
- exec "$basedir/node" "$basedir/../wrangler/bin/wrangler.js" "$@"
19
- else
20
- exec node "$basedir/../wrangler/bin/wrangler.js" "$@"
21
- fi
@@ -1,7 +0,0 @@
1
- # Allow native dependencies to run build scripts
2
- # Required for: workerd (Cloudflare Workers), esbuild, swc, sharp
3
- onlyBuiltDependencies:
4
- - "@swc/core"
5
- - esbuild
6
- - sharp
7
- - workerd
@@ -1,84 +0,0 @@
1
- import { execSync } from "child_process";
2
- import { readFileSync, writeFileSync } from "fs";
3
- import { resolve, dirname } from "path";
4
- import { fileURLToPath } from "url";
5
-
6
- const __dirname = dirname(fileURLToPath(import.meta.url));
7
-
8
- function sqlValue(v) {
9
- if (v === null) return "NULL";
10
- if (typeof v === "number") return String(v);
11
- return "'" + String(v).replaceAll("'", "''") + "'";
12
- }
13
-
14
- function queryRemote(sql) {
15
- let stdout;
16
- try {
17
- stdout = execSync(
18
- `pnpm exec wrangler d1 execute DB --remote --config wrangler.demo.toml --command "${sql}" --json`,
19
- { encoding: "utf-8", cwd: resolve(__dirname, "..") }
20
- );
21
- } catch (err) {
22
- // Wrangler returns JSON errors on stdout even with non-zero exit codes
23
- const output = err.stdout || err.stderr || "";
24
- try {
25
- const errJson = JSON.parse(output.trim());
26
- if (errJson.error?.text) {
27
- console.error(`Wrangler error: ${errJson.error.text}`);
28
- process.exit(1);
29
- }
30
- } catch {
31
- // Not JSON, fall through
32
- }
33
- console.error(`Failed to query remote database: ${output || err.message}`);
34
- process.exit(1);
35
- }
36
- const parsed = JSON.parse(stdout);
37
- if (parsed.error?.text) {
38
- console.error(`Wrangler error: ${parsed.error.text}`);
39
- process.exit(1);
40
- }
41
- return parsed[0]?.results || [];
42
- }
43
-
44
- function dumpTable(name, query) {
45
- const rows = queryRemote(query || `SELECT * FROM ${name}`);
46
- return rows
47
- .map(
48
- (row) =>
49
- `INSERT INTO ${name} VALUES(${Object.values(row).map(sqlValue).join(",")});`
50
- )
51
- .join("\n");
52
- }
53
-
54
- const header = `-- =============================================================================
55
- -- Demo seed data for Jant (demo.jant.me)
56
- -- Exported from remote demo D1 database via: mise run demo-export
57
- -- Usage: mise run demo-reset
58
- -- =============================================================================
59
- `;
60
-
61
- // Read reset-demo.sql and include it at the top
62
- const resetSql = readFileSync(resolve(__dirname, "reset-demo.sql"), "utf-8");
63
-
64
- const tables = [
65
- // settings, user, account are preserved by reset-demo.sql — don't export
66
- ["posts", "SELECT * FROM posts WHERE deleted_at IS NULL"],
67
- ["pages"],
68
- ["collections"],
69
- ["nav_items"],
70
- ["media"],
71
- ];
72
-
73
- let sql = header;
74
- sql += "\n-- Reset (clear existing content)\n";
75
- sql += resetSql.replace(/^--.*\n/gm, "").trim() + "\n";
76
-
77
- for (const [name, query] of tables) {
78
- const data = dumpTable(name, query);
79
- if (data) sql += `\n-- ${name}\n${data}\n`;
80
- }
81
-
82
- const out = resolve(__dirname, "seed-demo.sql");
83
- writeFileSync(out, sql);
84
- console.log("Exported demo database to templates/jant-site/scripts/seed-demo.sql");
@@ -1,89 +0,0 @@
1
- import { createRequire } from "module";
2
- import { readFileSync, readdirSync, writeFileSync } from "fs";
3
- import { resolve, dirname } from "path";
4
- import { fileURLToPath } from "url";
5
-
6
- // Parse flags
7
- const args = process.argv.slice(2);
8
- const noMedia = args.includes("--no-media");
9
- const noAuth = args.includes("--no-auth");
10
- const outputIndex = args.indexOf("--output");
11
- const outputFile =
12
- outputIndex !== -1 ? args[outputIndex + 1] : "seed-local.sql";
13
-
14
- // better-sqlite3 is installed in packages/core
15
- const __dirname = dirname(fileURLToPath(import.meta.url));
16
- const coreRequire = createRequire(
17
- resolve(__dirname, "../../../packages/core/package.json")
18
- );
19
- const Database = coreRequire("better-sqlite3");
20
-
21
- const dbDir = resolve(
22
- __dirname,
23
- "../.wrangler/state/v3/d1/miniflare-D1DatabaseObject"
24
- );
25
- const files = readdirSync(dbDir).filter((f) => f.endsWith(".sqlite"));
26
- if (!files.length) {
27
- console.error("No local D1 database found. Run mise run dev first.");
28
- process.exit(1);
29
- }
30
-
31
- const db = new Database(resolve(dbDir, files[0]), { readonly: true });
32
-
33
- function sqlValue(v) {
34
- if (v === null) return "NULL";
35
- if (typeof v === "number") return String(v);
36
- return "'" + String(v).replaceAll("'", "''") + "'";
37
- }
38
-
39
- function dumpTable(name, query) {
40
- const rows = db.prepare(query || `SELECT * FROM ${name}`).all();
41
- return rows
42
- .map(
43
- (row) =>
44
- `INSERT INTO ${name} VALUES(${Object.values(row).map(sqlValue).join(",")});`
45
- )
46
- .join("\n");
47
- }
48
-
49
- const header = `-- =============================================================================
50
- -- ${noMedia ? "Seed data (without media)" : "Local development seed data"} for Jant
51
- -- Exported from local D1 database
52
- -- Usage: mise run db-seed
53
- -- =============================================================================
54
- `;
55
-
56
- const tables = [
57
- ...(!noAuth ? [["settings"], ["user"], ["account"]] : []),
58
- ["pages"],
59
- ["collections"],
60
- [
61
- "posts",
62
- "SELECT * FROM posts WHERE deleted_at IS NULL",
63
- ],
64
- ["nav_items"],
65
- ];
66
-
67
- // Include media table only when --no-media is not set
68
- if (!noMedia) {
69
- tables.push(["media"]);
70
- }
71
-
72
- let sql = header;
73
-
74
- // When --no-auth, embed reset statements so everything runs in a single D1 import
75
- if (noAuth) {
76
- const resetSql = readFileSync(resolve(__dirname, "reset-demo.sql"), "utf-8");
77
- sql += "\n-- Reset (clear existing content)\n";
78
- sql += resetSql.replace(/^--.*\n/gm, "").trim() + "\n";
79
- }
80
-
81
- for (const [name, query] of tables) {
82
- const data = dumpTable(name, query);
83
- if (data) sql += `\n-- ${name}\n${data}\n`;
84
- }
85
-
86
- const out = resolve(__dirname, outputFile);
87
- writeFileSync(out, sql);
88
- db.close();
89
- console.log(`Exported to templates/jant-site/scripts/${outputFile}`);
@@ -1,20 +0,0 @@
1
- -- Reset script for Jant demo site (demo.jant.me) (v2 schema)
2
- -- Clears content data while preserving users/settings/schema
3
- -- Usage: mise run demo-reset (runs this then seed-demo.sql)
4
-
5
- -- Clear FTS index first (to avoid trigger issues)
6
- DELETE FROM posts_fts;
7
-
8
- -- Clear main tables (order matters for FK constraints)
9
- DELETE FROM nav_items;
10
- DELETE FROM media;
11
- DELETE FROM posts;
12
- DELETE FROM pages;
13
- DELETE FROM collections;
14
- DELETE FROM redirects;
15
-
16
- -- Sessions, users, accounts, and settings are preserved
17
- -- (seed-demo.sql only contains content data)
18
-
19
- -- Reset auto-increment counters
20
- DELETE FROM sqlite_sequence WHERE name IN ('posts', 'pages', 'collections', 'nav_items', 'redirects');
@@ -1,25 +0,0 @@
1
- -- Reset script for Jant local development (v2 schema)
2
- -- Clears all data so seed-local.sql can re-insert everything
3
- -- Usage: mise run db-seed (runs this then seed-local.sql)
4
-
5
- -- Clear FTS index first (to avoid trigger issues)
6
- DELETE FROM posts_fts;
7
-
8
- -- Clear main tables (order matters for FK constraints)
9
- DELETE FROM nav_items;
10
- DELETE FROM media;
11
- DELETE FROM posts;
12
- DELETE FROM pages;
13
- DELETE FROM collections;
14
- DELETE FROM redirects;
15
-
16
- -- Clear auth tables (order matters: session → account → user)
17
- DELETE FROM session;
18
- DELETE FROM account;
19
- DELETE FROM user;
20
-
21
- -- Clear settings
22
- DELETE FROM settings;
23
-
24
- -- Reset auto-increment counters
25
- DELETE FROM sqlite_sequence WHERE name IN ('posts', 'pages', 'collections', 'nav_items', 'redirects');
@@ -1,20 +0,0 @@
1
- import { randomBytes } from "crypto";
2
- import { execSync } from "child_process";
3
-
4
- const isRemote = process.argv.includes("--remote");
5
- const flag = isRemote ? "--remote" : "--local";
6
-
7
- const token = randomBytes(32).toString("hex");
8
- const expiry = Math.floor(Date.now() / 1000) + 15 * 60; // 15 minutes
9
- const value = `${token}:${expiry}`;
10
- const timestamp = Math.floor(Date.now() / 1000);
11
-
12
- const sql = `INSERT OR REPLACE INTO settings (key, value, updated_at) VALUES ('PASSWORD_RESET_TOKEN', '${value}', ${timestamp})`;
13
-
14
- execSync(`npx wrangler d1 execute DB ${flag} --command "${sql}"`, {
15
- stdio: "inherit",
16
- });
17
-
18
- console.log("");
19
- console.log("Password reset token generated (expires in 15 minutes).");
20
- console.log(`Visit: /reset?token=${token}`);