create-signet-app 0.9.4 → 0.9.6

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.
@@ -102,7 +102,10 @@ export const templates = defineTemplates({
102
102
 
103
103
  /**
104
104
  * Where the client IP comes from: server.ts overwrites x-forwarded-for with the
105
- * socket's address, so one hop. Behind your own proxy, see server.ts.
105
+ * socket's address, so one hop. Behind your own proxy, see server.ts. Behind
106
+ * Cloudflare with the origin firewalled to Cloudflare's IP ranges, use
107
+ * `{ cloudflare: { originLocked: true } }`; plain `"cloudflare"` is believed only
108
+ * on Workers, because anywhere else a client can send `cf-connecting-ip` itself.
106
109
  */
107
110
  export const TRUST = { forwardedHops: 1 } as const
108
111
  // admin:begin
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-signet-app",
3
- "version": "0.9.4",
3
+ "version": "0.9.6",
4
4
  "license": "MIT",
5
5
  "description": "Scaffold a Vite + React + Tailwind app wired to Signet.",
6
6
  "keywords": [
@@ -41,6 +41,7 @@
41
41
  "typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.test.json",
42
42
  "test": "bun run test/scaffold.ts && bun run test/scaffold-api.ts && bun run test/scaffold-full.ts && bun run test/scaffold-cli.ts && bun run test/scaffold-extension.ts && bun run test/scaffold-desktop.ts && bun run test/scaffold-mobile.ts && bun run test/describe.ts && bun run test/picker.ts",
43
43
  "test:parts": "bun run test/scaffold-parts.ts",
44
+ "test:mix": "bun run test/scaffold-mix.ts",
44
45
  "test:pm": "bun run test/scaffold-pm.ts",
45
46
  "test:runtime": "bun run test/scaffold-runtime.ts"
46
47
  },
package/src/desktop.ts CHANGED
@@ -23,7 +23,7 @@ export const DESKTOP_PKG = {
23
23
  dependencies: {
24
24
  "@dapplelight/signet-lib": "^0.4.1",
25
25
  "@dapplelight/signet-tokens": "^0.4.0",
26
- "@dapplelight/signet-ui": "^0.5.0",
26
+ "@dapplelight/signet-ui": "^0.5.0 || ^0.6.0",
27
27
  "@tauri-apps/api": "^2.0.0",
28
28
  "@tauri-apps/plugin-opener": "^2.0.0",
29
29
  "@tauri-apps/plugin-store": "^2.0.0",
package/src/index.ts CHANGED
@@ -88,10 +88,6 @@ const YARN = "yarn@4.18.1"
88
88
  */
89
89
  const UI_PEERS: Record<string, string> = {
90
90
  "@base-ui/react": ">=1.3.0",
91
- "@radix-ui/react-checkbox": ">=1.0.0",
92
- "@radix-ui/react-dropdown-menu": ">=2.0.0",
93
- "@radix-ui/react-popover": ">=1.0.0",
94
- "@radix-ui/react-tooltip": ">=1.0.0",
95
91
  "@tanstack/react-table": ">=9.0.0",
96
92
  "class-variance-authority": ">=0.0.0",
97
93
  clsx: ">=2.0.0",
@@ -269,7 +265,7 @@ const DEPS = {
269
265
  "@dapplelight/signet-lib": "^0.4.0",
270
266
  "@dapplelight/signet-tokens": "^0.4.0",
271
267
  // LabelsProvider (src/components/signet-labels.tsx) since 0.3.2.
272
- "@dapplelight/signet-ui": "^0.5.0",
268
+ "@dapplelight/signet-ui": "^0.5.0 || ^0.6.0",
273
269
  "@tanstack/react-query": "^5.108.0",
274
270
  "@tanstack/react-router": "^1.170.39",
275
271
  "class-variance-authority": "^0.7.1",
@@ -65,6 +65,11 @@
65
65
  "addItem": "Add",
66
66
  "removeItem": "Remove",
67
67
  "chooseOption": "Choose…",
68
- "skipToContent": "Skip to content"
68
+ "skipToContent": "Skip to content",
69
+ "stageDone": "done",
70
+ "stageCurrent": "in progress",
71
+ "stageUpcoming": "not started",
72
+ "showMore": "Show more",
73
+ "showLess": "Show less"
69
74
  }
70
75
  }
@@ -2,6 +2,11 @@ import { expect, test } from "bun:test"
2
2
  import { memoryStore } from "@dapplelight/signet-server/middleware/rate-limit"
3
3
  import { createApp } from "../src/app.ts"
4
4
 
5
+ // trust "cloudflare" is believed only on Workers (a Node or Bun origin can be hit
6
+ // directly, where a client sets cf-connecting-ip itself). The cloudflare target
7
+ // runs there, so pose as Workers here.
8
+ Object.defineProperty(navigator, "userAgent", { value: "Cloudflare-Workers", configurable: true })
9
+
5
10
  // Requests that reach the app without cf-connecting-ip (a proxy that strips it,
6
11
  // a health checker, a local call) all share one bucket. Once it is full, the
7
12
  // next caller without the header is told to back off, whoever they are; callers
@@ -18,10 +18,15 @@ Mount `clientLoginRoutes` from `@dapplelight/signet-server/auth/hono` at
18
18
  `/auth/client-login` and register this CLI as a client:
19
19
 
20
20
  ```ts
21
+ import type { ClientIpTrust } from "@dapplelight/signet-server/middleware/rate-limit"
22
+
23
+ // "cloudflare": on Workers · { cloudflare: { originLocked: true } }: origin accepts only Cloudflare IPs · { forwardedHops: n }: behind n proxies (Vercel: 1) · "none": no proxy, one shared bucket
24
+ const TRUST: ClientIpTrust = "none"
25
+
21
26
  app.route(
22
27
  "/auth/client-login",
23
28
  clientLoginRoutes({
24
- trust: "cloudflare",
29
+ trust: TRUST,
25
30
  clients: { __APP_NAME__: {} },
26
31
  verificationUri: "https://your.app/device",
27
32
  }),