@kubohiroya/turbowarp-http-server 0.4.0 → 0.5.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/README.ja.md CHANGED
@@ -8,6 +8,21 @@ CLI で起動する HTTP ブリッジサーバと、そのサーバへ WebSocket
8
8
 
9
9
  **ユーザーガイド:** [English](https://kubohiroya.github.io/turbowarp-http-server/)
10
10
 
11
+ ## 最小デモ
12
+
13
+ [TurboWarp Editorで開く](https://turbowarp.org/editor?project_url=https%3A%2F%2Fkubohiroya.github.io%2Fturbowarp-http-server%2Fsamples%2Frespond-hello-http.sb3) · [SB3をダウンロード](https://kubohiroya.github.io/turbowarp-http-server/samples/respond-hello-http.sb3)
14
+
15
+ repoをcloneし依存install後 `node dist/cli.js --host 127.0.0.1 --port 8787`。SB3の緑旗→C→Sでtrue。別ターミナルで `curl http://127.0.0.1:8787/hello` とすると `Hello from TurboWarp`。Xで切断しCLIをCtrl+Cで停止。再実行は緑旗から。bridge URLは非表示変数に保存し、公開SB3にはloopbackだけを使用。
16
+
17
+ 要件: Node.js 24以上とこのrepoのCLI bridge(依存hono/@hono/node-server/wsをinstall)。別端末へ公開せず127.0.0.1で起動。Pages自体は静的ホスティングでHTTP serverを動かしません。HTTPS Editorからws loopbackへのアクセスはブラウザのローカルネットワーク許可/混在コンテンツ規則に従います。必要ならローカルEditorまたは信頼済みwss bridgeを使用。
18
+
19
+ 未検証: 外部ホスト・TLS/wss設定・各ブラウザのローカルネットワーク許可・認証・本番公開は未検証。
20
+
21
+ 既知の制約: 検証した既存distでは `when HTTP request received` hat経路でhandlerが開始せず504となりました。このデモは緑旗の待機ループから `current request ID` をポーリングし、未処理リクエストに `respond with text` で返します。hat経路の修正・検証は本PRの対象外です。
22
+
23
+
24
+ [編集・再生成手順](samples/README.md)
25
+
11
26
  ## できること
12
27
 
13
28
  - コマンドラインからローカル HTTP/WebSocket ブリッジサーバを起動できます。
@@ -320,7 +335,7 @@ end
320
335
  レビューした exact version をインストールします。
321
336
 
322
337
  ```bash
323
- pnpm add --save-exact @kubohiroya/turbowarp-http-server@0.4.0
338
+ pnpm add --save-exact @kubohiroya/turbowarp-http-server@0.5.0
324
339
  ```
325
340
 
326
341
  standalone bundle は次の場所から読み込めます。
@@ -332,7 +347,7 @@ node_modules/@kubohiroya/turbowarp-http-server/dist/turbowarp-http-server.js
332
347
  version 固定の CDN URL は次の形式です。
333
348
 
334
349
  ```text
335
- https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-http-server@0.4.0/dist/turbowarp-http-server.js
350
+ https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-http-server@0.5.0/dist/turbowarp-http-server.js
336
351
  ```
337
352
 
338
353
  ## 開発
package/README.md CHANGED
@@ -8,6 +8,17 @@ A companion package with both a CLI HTTP bridge server and a TurboWarp extension
8
8
 
9
9
  **User guide:** [English](https://kubohiroya.github.io/turbowarp-http-server/)
10
10
 
11
+ ## Minimal demo
12
+
13
+ [TurboWarp Editor — open demo](https://turbowarp.org/editor?project_url=https%3A%2F%2Fkubohiroya.github.io%2Fturbowarp-http-server%2Fsamples%2Frespond-hello-http.sb3) · [SB3 download](https://kubohiroya.github.io/turbowarp-http-server/samples/respond-hello-http.sb3)
14
+
15
+ Requires Node.js 24+ and this repository CLI bridge with dependencies installed. Run `node dist/cli.js --host 127.0.0.1 --port 8787`. Green flag resets without connecting; C connects, S reads state. `curl http://127.0.0.1:8787/hello` returns `Hello from TurboWarp`. X disconnects; Ctrl+C stops the CLI. Pages only hosts the project and does not run a server. HTTPS Editor to loopback ws depends on browser local-network/mixed-content policy; use a local Editor or trusted wss bridge if needed. External hosts, TLS/wss, cross-browser permissions, authentication and production hosting remain unverified.
16
+
17
+ Known limitation: with the reviewed existing dist, the `when HTTP request received` hat did not start its handler and the request timed out (504). This demo polls `current request ID` in its green-flag wait loop and uses `respond with text` for pending requests. Repair and validation of the hat path are outside this PR.
18
+
19
+
20
+ [Editable sources and rebuild instructions](samples/README.md)
21
+
11
22
  ## What it does
12
23
 
13
24
  - Starts a local HTTP/WebSocket bridge server from the command line.
@@ -107,7 +118,7 @@ The reviewed JavaScript build is committed to this repository, so users do not n
107
118
  Install an exact version that you have reviewed:
108
119
 
109
120
  ```bash
110
- pnpm add --save-exact @kubohiroya/turbowarp-http-server@0.4.0
121
+ pnpm add --save-exact @kubohiroya/turbowarp-http-server@0.5.0
111
122
  ```
112
123
 
113
124
  Load the standalone bundle from:
@@ -119,7 +130,7 @@ node_modules/@kubohiroya/turbowarp-http-server/dist/turbowarp-http-server.js
119
130
  A version-pinned CDN URL is:
120
131
 
121
132
  ```text
122
- https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-http-server@0.4.0/dist/turbowarp-http-server.js
133
+ https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-http-server@0.5.0/dist/turbowarp-http-server.js
123
134
  ```
124
135
 
125
136
  ## Quick start
@@ -20,7 +20,7 @@ var extensionConfig = {
20
20
  blockIconURI: "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0OCA0OCI+PHBhdGggZD0iTTI4LjAgMjcuMEwyOC4wIDUuME0yOC4wIDI3LjBMNDMuNiAxMS40TTI4LjAgMjcuMEw1MC4wIDI3LjBNMjguMCAyNy4wTDQzLjYgNDIuNk0yOC4wIDI3LjBMMjguMCA0OS4wTTI4LjAgMjcuMEwxMi40IDQyLjZNMjguMCAyNy4wTDYuMCAyNy4wTTI4LjAgMjcuMEwxMi40IDExLjQiIHN0cm9rZT0iIzI1NjNFQiIgc3Ryb2tlLXdpZHRoPSIxLjA0IiBzdHJva2UtbGluZWNhcD0icm91bmQiLz48cGF0aCBkPSJNMjguMCAxMC4wTDQwLjAgMTUuMEw0NS4wIDI3LjBMNDAuMCAzOS4wTDI4LjAgNDQuMEwxNi4wIDM5LjBMMTEuMCAyNy4wTDE2LjAgMTUuMFoiIGZp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VjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PGNpcmNsZSBjeD0iMTQiIGN5PSIxMC45IiByPSIzLjQiIGZpbGw9IiMxNjMwNUMiLz48Y2lyY2xlIGN4PSIxNCIgY3k9IjE1LjEiIHI9IjIuMyIgZmlsbD0iIzE2MzA1QyIvPjwvc3ZnPg=="
21
21
  };
22
22
  //#endregion
23
- //#region node_modules/.pnpm/@kubohiroya+turbowarp-extension-data-editor@0.4.0_react@18.3.1/node_modules/@kubohiroya/turbowarp-extension-data-editor/dist/fixed-input-schema.js
23
+ //#region node_modules/.pnpm/@kubohiroya+turbowarp-extension-data-editor@0.5.0_react@18.3.1/node_modules/@kubohiroya/turbowarp-extension-data-editor/dist/fixed-input-schema.js
24
24
  var numberToken = /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$/u;
25
25
  var invalidNumber = Object.freeze({
26
26
  kind: "invalid",
package/package.json CHANGED
@@ -1,8 +1,12 @@
1
1
  {
2
2
  "name": "@kubohiroya/turbowarp-http-server",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "A TurboWarp extension for connecting block programs to an HTTP bridge server.",
5
- "author": "Hiroya Kubo <hiroya@cuc.ac.jp>",
5
+ "author": {
6
+ "name": "Hiroya Kubo",
7
+ "email": "hiroya@cuc.ac.jp",
8
+ "url": "https://github.com/kubohiroya"
9
+ },
6
10
  "license": "MPL-2.0",
7
11
  "homepage": "https://github.com/kubohiroya/turbowarp-http-server#readme",
8
12
  "repository": {
@@ -60,7 +64,10 @@
60
64
  "pack:check": "npm pack --dry-run --ignore-scripts",
61
65
  "start": "node dist/cli.js",
62
66
  "check:dist": "pnpm run build && node scripts/check-dist.ts",
63
- "check": "pnpm run typecheck && pnpm run lint && pnpm run test && pnpm run examples:check && pnpm run docs:check && pnpm run check:dist && pnpm run pack:check"
67
+ "check": "pnpm run typecheck && pnpm run lint && pnpm run test && pnpm run examples:check && pnpm run docs:check && pnpm run check:dist && pnpm run pack:check && pnpm run samples:check",
68
+ "samples:build": "node scripts/build-samples.mjs",
69
+ "samples:check": "node scripts/build-samples.mjs --check && node --test scripts/verify-samples.mjs",
70
+ "pages:build": "node scripts/prepare-pages.mjs"
64
71
  },
65
72
  "dependencies": {
66
73
  "@hono/node-server": "^2.1.1",
@@ -68,14 +75,14 @@
68
75
  "ws": "^8.18.3"
69
76
  },
70
77
  "peerDependencies": {
71
- "@kubohiroya/turbowarp-named-data": "^0.6.0"
78
+ "@kubohiroya/turbowarp-named-data": "^0.7.0"
72
79
  },
73
80
  "devDependencies": {
74
81
  "@cloudflare/workers-types": "^5.20260919.1",
75
82
  "@eslint/js": "^9.39.5",
76
- "@kubohiroya/turbowarp-extension-manifest": "^0.4.0",
77
- "@kubohiroya/turbowarp-named-data": "^0.6.0",
78
- "@kubohiroya/vite-plugin-turbowarp-extension": "^0.9.0",
83
+ "@kubohiroya/turbowarp-extension-manifest": "^0.5.0",
84
+ "@kubohiroya/turbowarp-named-data": "^0.7.0",
85
+ "@kubohiroya/vite-plugin-turbowarp-extension": "^0.10.0",
79
86
  "@types/node": "^24.13.3",
80
87
  "@types/ws": "^8.18.1",
81
88
  "eslint": "^9.39.5",
@@ -89,7 +96,7 @@
89
96
  "vite": "^8.2.2",
90
97
  "vitest": "^4.1.10",
91
98
  "wrangler": "4.135.0",
92
- "@kubohiroya/turbowarp-extension-data-editor": "^0.4.0"
99
+ "@kubohiroya/turbowarp-extension-data-editor": "^0.5.0"
93
100
  },
94
101
  "gitHead": "a1bf89b8787f9270e591f43512b427ada69f85ef",
95
102
  "x-turbowarp-source": {