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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d1e94aeb373291700f0509904e30eb78d209a4515eab57d8f2b062e51a73b1d3
4
- data.tar.gz: d5c5a48c99963645d76396dac918e0a361fb76d1f27b8b05f4d025b9736b901a
3
+ metadata.gz: a17030cc4e442b4be0807812997d7507509820f6e9858a6b4b43a990858e1d44
4
+ data.tar.gz: bc178c44ec5f71bab3c0ecf210ba685801a2956985936558ad24bdf65f1ac5a0
5
5
  SHA512:
6
- metadata.gz: ee3311b2386d5c2b10dddafdf80f93c07a5b53ab600867c7bf97a06f9f6de5aa57f61653a3cf584b92c88acb9eb85b0d118fa7a804cf63113f2d03d6d29be2d6
7
- data.tar.gz: 6eee502c73767aba791d4f05c2d7eff0e882943e615418084b65ae2d2966ce1e3f865cea1c4bed1ce57c365a12939227857fa985356ff00dd47d69cc1f5be792
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取得先は `5590e3ff32714ebcec35c53e1fad63156540e425` に固定しています。
95
- Rackは `30802024e263a0dde1f3a8467e648a70625adfd4` に固定しています。
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の `5590e3ff32714ebcec35c53e1fad63156540e425` はAccess・Durable Objectに対応しています。
187
- mruby-rackの `30802024e263a0dde1f3a8467e648a70625adfd4` はAccessミドルウェアに対応し、このテンプレートは両方を標準で使用します。
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 `5590e3ff32714ebcec35c53e1fad63156540e425`.
95
- Rack is pinned to `30802024e263a0dde1f3a8467e648a70625adfd4`.
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 `5590e3ff32714ebcec35c53e1fad63156540e425` includes Access and Durable Object support.
188
- mruby-rack commit `30802024e263a0dde1f3a8467e648a70625adfd4` includes Access middleware support. This template uses both by default.
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 = "5590e3ff32714ebcec35c53e1fad63156540e425".freeze
12
- RACK_REVISION = "30802024e263a0dde1f3a8467e648a70625adfd4".freeze
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
@@ -3,7 +3,7 @@
3
3
  module Picoruby
4
4
  module Cloudflare
5
5
  module Template
6
- VERSION = "0.1.0.rc3"
6
+ VERSION = "0.1.0.rc4"
7
7
  end
8
8
  end
9
9
  end
@@ -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
- # env["cloudflare.env"].CACHE_KV and
25
- # Cloudflare::KV.from_env(env, "CACHE_KV") refer to the same binding.
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
 
@@ -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
- // Do not log host error messages: upstream services may include secrets.
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
  },
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: picoruby-cloudflare-template
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.rc3
4
+ version: 0.1.0.rc4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Uchio Kondo