picoruby-cloudflare-template 0.1.0.rc3 → 0.1.0.rc4
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.
- checksums.yaml +4 -4
- data/README.ja.md +4 -4
- data/README.md +4 -4
- data/lib/picoruby/cloudflare/build.rb +2 -2
- data/lib/picoruby/cloudflare/template/version.rb +1 -1
- data/templates/project/app.rb.erb +4 -4
- data/templates/runtime/index.js +1 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a17030cc4e442b4be0807812997d7507509820f6e9858a6b4b43a990858e1d44
|
|
4
|
+
data.tar.gz: bc178c44ec5f71bab3c0ecf210ba685801a2956985936558ad24bdf65f1ac5a0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f3455f622daade658cd979bd58bb34d75cb95ea3b937291b01e6fcad6d3395134a5140c1b061712ddbfd1f11f62c3c9de3b3b6ce66e4468eaa23d917391d8987
|
|
7
|
+
data.tar.gz: 23b2d4027d0f51eb281c1bc82ed3488a61b19c62a027df2130c3d10cf669d4090fa7aaa3faad8f7703222b104379d1c0a4db0fe13248697125d5199fb855edae
|
data/README.ja.md
CHANGED
|
@@ -91,8 +91,8 @@ Sinatra等のフレームワークはアプリ側で追加します。ABI固有
|
|
|
91
91
|
revision属性のデフォルトはこのgemに組み込まれた値です。`nil` を代入するとデフォルトに戻ります。
|
|
92
92
|
取得先の選択で `PICORUBY_WORKER_WASM_GEM_DIR` / `MRUBY_RACK_GEM_DIR` は参照せず、`worker:` / `rack:` 引数も受け取りません。
|
|
93
93
|
|
|
94
|
-
既定のWorker取得先は `
|
|
95
|
-
Rackは `
|
|
94
|
+
既定のWorker取得先は `5f81f33b75630b7fcf4ae177834240a1300df221` に固定しています。
|
|
95
|
+
Rackは `afd805f1991b46639ce1fbb778820fe586155bc2` に固定しています。
|
|
96
96
|
再現可能な依存関係が必要な場合は、Worker revisionをタグまたはcommit SHAで上書きしてください。
|
|
97
97
|
gem公開前には、新規チェックアウトから両方の固定取得先を取得できることを確認します。
|
|
98
98
|
|
|
@@ -183,8 +183,8 @@ JWT署名・アプリケーションのaudienceをローカル検証する機能
|
|
|
183
183
|
通信・レスポンスの異常なら502を返し、後続アプリを呼びません。
|
|
184
184
|
生成例では `/access` だけにミドルウェアを適用し、他のサンプル経路は公開のままです。
|
|
185
185
|
|
|
186
|
-
Workerの `
|
|
187
|
-
mruby-rackの `
|
|
186
|
+
Workerの `5f81f33b75630b7fcf4ae177834240a1300df221` はAccess・Durable Objectに対応しています。
|
|
187
|
+
mruby-rackの `afd805f1991b46639ce1fbb778820fe586155bc2` はAccessミドルウェアに対応し、このテンプレートは両方を標準で使用します。
|
|
188
188
|
ローカルmrbgem checkoutの指定は不要です。
|
|
189
189
|
|
|
190
190
|
`npm run dev` / `npm run deploy` ではWranglerのcustom buildがRakeを実行します。
|
data/README.md
CHANGED
|
@@ -91,8 +91,8 @@ A directory takes precedence over its revision, and relative directory paths are
|
|
|
91
91
|
Revision attributes default to the values bundled in this gem; assigning `nil` restores those defaults.
|
|
92
92
|
Dependency source selection no longer reads `PICORUBY_WORKER_WASM_GEM_DIR` or `MRUBY_RACK_GEM_DIR`, or accepts `worker:` / `rack:` arguments.
|
|
93
93
|
|
|
94
|
-
The default Worker source is pinned to `
|
|
95
|
-
Rack is pinned to `
|
|
94
|
+
The default Worker source is pinned to `5f81f33b75630b7fcf4ae177834240a1300df221`.
|
|
95
|
+
Rack is pinned to `afd805f1991b46639ce1fbb778820fe586155bc2`.
|
|
96
96
|
Override the Worker revision with a tag or commit SHA when a reproducible dependency is required.
|
|
97
97
|
Before publishing this gem, verify that a fresh checkout can fetch both pinned sources.
|
|
98
98
|
|
|
@@ -184,8 +184,8 @@ The middleware returns 503 for missing/invalid configuration, 401 for a missing/
|
|
|
184
184
|
or an Access 401/403 response, and 502 for upstream/protocol failures, without calling the application.
|
|
185
185
|
The generated example applies middleware only to `/access`; other example routes remain public.
|
|
186
186
|
|
|
187
|
-
Worker commit `
|
|
188
|
-
mruby-rack commit `
|
|
187
|
+
Worker commit `5f81f33b75630b7fcf4ae177834240a1300df221` includes Access and Durable Object support.
|
|
188
|
+
mruby-rack commit `afd805f1991b46639ce1fbb778820fe586155bc2` includes Access middleware support. This template uses both by default.
|
|
189
189
|
No local mrbgem checkout overrides are required.
|
|
190
190
|
|
|
191
191
|
With `npm run dev` / `npm run deploy`, Wrangler's custom build runs Rake.
|
|
@@ -8,8 +8,8 @@ end
|
|
|
8
8
|
|
|
9
9
|
module Picoruby::Cloudflare::Template
|
|
10
10
|
module CrossBuild
|
|
11
|
-
WORKER_REVISION = "
|
|
12
|
-
RACK_REVISION = "
|
|
11
|
+
WORKER_REVISION = "5f81f33b75630b7fcf4ae177834240a1300df221".freeze
|
|
12
|
+
RACK_REVISION = "afd805f1991b46639ce1fbb778820fe586155bc2".freeze
|
|
13
13
|
CORE_GEMS = %w[mruby-array-ext mruby-catch mruby-class-ext mruby-enum-ext
|
|
14
14
|
mruby-hash-ext mruby-kernel-ext mruby-metaprog mruby-method
|
|
15
15
|
mruby-numeric-ext mruby-object-ext mruby-pack mruby-proc-ext mruby-sprintf
|
|
@@ -21,13 +21,13 @@ app = lambda do |env|
|
|
|
21
21
|
end
|
|
22
22
|
[200, { "content-type" => "text/plain; charset=utf-8" }, [value + "\n"]]
|
|
23
23
|
<% else -%>
|
|
24
|
-
#
|
|
25
|
-
#
|
|
24
|
+
# Enable Cloudflare bindings by regenerating the app with --bindings option
|
|
25
|
+
# env["cloudflare.env"].CACHE_KV
|
|
26
26
|
message = ENV["GREETING"] || "Hello from PicoRuby on Cloudflare!"
|
|
27
27
|
[200, { "content-type" => "text/plain; charset=utf-8" }, [message + "\n"]]
|
|
28
28
|
<% end -%>
|
|
29
|
-
rescue
|
|
30
|
-
[500, { "content-type" => "text/plain; charset=utf-8" }, ["Internal Server Error\n"]]
|
|
29
|
+
rescue => e
|
|
30
|
+
[500, { "content-type" => "text/plain; charset=utf-8" }, ["Internal Server Error:\n\t#{e.message}\n"]]
|
|
31
31
|
end
|
|
32
32
|
end
|
|
33
33
|
|
data/templates/runtime/index.js
CHANGED
|
@@ -8,11 +8,10 @@ export function createWorker({ app, bindingTypes }) {
|
|
|
8
8
|
try {
|
|
9
9
|
return await handleRequest(createPicoRuby, wasm, app, request, createCloudflareBindings(env, bindingTypes));
|
|
10
10
|
} catch (error) {
|
|
11
|
-
|
|
11
|
+
console.error("PicoRuby Worker request failed", error);
|
|
12
12
|
if (error instanceof RequestBodyTooLargeError) {
|
|
13
13
|
return new Response("Request body too large", { status: 413 });
|
|
14
14
|
}
|
|
15
|
-
console.error("PicoRuby Worker request failed");
|
|
16
15
|
return new Response("PicoRuby Worker runtime error", { status: 500 });
|
|
17
16
|
}
|
|
18
17
|
},
|