Repository navigation
Expand file tree
/
Copy pathpackage.json
More file actions
149 lines (149 loc) · 6.11 KB
/
Copy pathpackage.json
File metadata and controls
149 lines (149 loc) · 6.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
{
"name": "shorthop",
"version": "2.0.3",
"description": "Short links, website analytics and revenue attribution on your own domain, in one Cloudflare Worker you own.",
"license": "MIT",
"author": "Jan Tegze (https://jantegze.com)",
"repository": {
"type": "git",
"url": "https://github.com/jntegz/shorthop.git"
},
"private": true,
"type": "module",
"engines": {
"node": ">=22.12"
},
"cloudflare": {
"bindings": {
"ADMIN_PASSWORD": {
"description": "The admin password, at least 9 characters. Use a long random one (a password manager can make one): without Cloudflare Access, it alone protects the admin at `/_admin`. Change it later under the Worker's **Settings → Variables and Secrets**."
},
"LINKS": {
"description": "KV namespace holding the published links, read on every redirect."
},
"DB": {
"description": "D1 database: links, history, daily statistics, settings. Its migrations run on every deploy."
},
"CLICKS": {
"description": "Analytics Engine dataset with one data point per click. To read it, add `CF_ACCOUNT_ID` and a `CF_ANALYTICS_TOKEN` secret later ([docs/SETUP.md](https://github.com/jntegz/shorthop/blob/main/docs/SETUP.md#analytics))."
},
"WEB": {
"description": "Analytics Engine dataset for website visits (Websites in the admin). Read with the same `CF_ACCOUNT_ID` and `CF_ANALYTICS_TOKEN` as the click dataset."
},
"CLICK_CAPS": {
"description": "Durable Object counting clicks exactly, used only by links with a click limit."
},
"ADMIN_AUTH": {
"description": "Leave it as `password`. Any other value locks the admin until Cloudflare Access is set up ([docs/SETUP.md](https://github.com/jntegz/shorthop/blob/main/docs/SETUP.md#access))."
},
"ACCESS_TEAM_DOMAIN": {
"description": "Leave it empty. Only for Cloudflare Access, which you can add later."
},
"ACCESS_AUD": {
"description": "Leave it empty. Only for Cloudflare Access, which you can add later."
},
"ADMIN_EMAIL": {
"description": "Leave it empty. Only for Cloudflare Access, which you can add later."
},
"CF_ACCOUNT_ID": {
"description": "Optional: your Cloudflare account ID, to read click statistics once you also add a `CF_ANALYTICS_TOKEN` secret. Leave it empty if unsure; you can add it later."
},
"SHORT_DOMAINS": {
"description": "Leave it empty for now. After the deploy you add your domain here, together with a route ([how](https://github.com/jntegz/shorthop/blob/main/docs/SETUP.md#deploy-button))."
},
"ADMIN_HOST": {
"description": "Leave it empty: the admin then lives on your short domain."
},
"FALLBACK_URL": {
"description": "Your own website, such as `https://www.example.com`. People who open the short domain itself go there. You can change it later."
},
"KV_CACHE_TTL": {
"description": "Leave it at `60` (seconds): how long a link stays cached at the edge, so edits reach everyone within a minute."
},
"AE_DATASET": {
"description": "Leave it as it is: the name of the click dataset above."
},
"AE_WEB_DATASET": {
"description": "Leave it as it is: the name of the website dataset above."
},
"WORKERS_PLAN": {
"description": "`free`, unless you pay for Workers ($5/month): then `paid`. It sizes bulk jobs to your plan's limits."
},
"API_TOKEN_SCOPE": {
"description": "Leave it as `create`. Only for the older API token; new installs use API keys from the admin."
},
"WORKERS_DEV_ADMIN": {
"description": "Leave it empty. `off` stops this workers.dev address serving the admin once you have your own domain."
},
"DIGEST_PROVIDER": {
"description": "Leave it as `off`. You can turn email on later in the admin: Settings → Statistics & email → Set up email."
},
"DIGEST_FROM": {
"description": "Leave it empty. Email is set up later in the admin."
},
"DIGEST_TO": {
"description": "Leave it empty. Email is set up later in the admin."
},
"DEV_AUTH_BYPASS": {
"description": "Leave it empty. Only for local development."
},
"DEV_AUTH_EMAIL": {
"description": "Leave it empty. Only for local development."
}
}
},
"scripts": {
"setup": "tsx scripts/setup/index.ts",
"dev": "vite dev",
"build": "vite build",
"preview": "npm run build && vite preview",
"deploy": "tsx scripts/setup/check-deploy.ts && npm run build && wrangler deploy",
"types": "wrangler types --strict-vars=false -c wrangler.example.jsonc",
"config:example": "tsx scripts/setup/example.ts",
"typecheck": "tsc -b",
"test": "vitest run && tsx --test test/node/*.test.ts",
"db:migrate:local": "tsx scripts/setup/wrangler-local.ts d1 migrations apply DB --local",
"db:migrate:remote": "wrangler d1 migrations apply DB --remote",
"seed:dev": "tsx scripts/seed-dev.ts"
},
"dependencies": {
"@hono/zod-validator": "^0.9.1",
"@tanstack/react-query": "^5.104.4",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"cobe": "^2.0.1",
"fflate": "^0.8.3",
"hono": "^4.13.18",
"jose": "^6.2.12",
"jsqr": "^1.4.0",
"lucide-react": "^1.59.0",
"papaparse": "^5.7.0",
"qrcode": "^1.5.4",
"radix-ui": "^1.8.1",
"react": "^19.3.1",
"react-dom": "^19.3.1",
"react-router": "^7.18.4",
"sonner": "^2.0.8",
"tailwind-merge": "^3.7.0",
"zod": "^4.6.7"
},
"devDependencies": {
"@cloudflare/vite-plugin": "^1.64.0",
"@cloudflare/vitest-plugin": "^1.4.5",
"@tailwindcss/vite": "^4.3.3",
"@types/node": "^22.20.5",
"@types/papaparse": "^5.5.2",
"@types/qrcode": "^1.5.6",
"@types/react": "^19.3.0",
"@types/react-dom": "^19.3.0",
"@vitejs/plugin-react": "^6.1.2",
"jsonc-parser": "^3.3.1",
"smol-toml": "^1.9.1",
"tailwindcss": "^4.3.3",
"tsx": "^4.23.15",
"typescript": "~6.0.3",
"vite": "^8.3.4",
"vitest": "~4.1.12",
"wrangler": "^4.151.2"
}
}