homura-runtime 0.2.24 → 0.2.25
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/CHANGELOG.md +13 -0
- data/exe/homura-build +8 -7
- data/lib/cloudflare_workers/build_support.rb +37 -11
- data/lib/cloudflare_workers/version.rb +1 -1
- 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: aa815fa7e02b0f798dd69003008576f264eb3a0e2532805a729fee6f4a5aca6b
|
|
4
|
+
data.tar.gz: e8af4871e543adc2ef6c6d8751272111c102987345ea6526ad1fa0e6e2192db8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c6f04b2b77f82131dd45148ff7d8467e0093ed005f49269ab2a2a37ab96ad957e6abd264c302331d37a4a95ac84885d9eef3882e51422fec7f6ed2f30aca25b1
|
|
7
|
+
data.tar.gz: ff80cbfcbc5b699eed8c7f79c1da2b40aab678163185b0471ec269c7fe55db06d14515aaa22ece20bbff019ff754bc38d398c3a812ea33a2df3716fbea395716
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.25 (2026-04-29)
|
|
4
|
+
|
|
5
|
+
- `BuildSupport`: factor `opal_gem_paths` out of the path:-only
|
|
6
|
+
`path_gemfile_entries`. The new method also picks up
|
|
7
|
+
RubyGems-installed gems that opt in via
|
|
8
|
+
`spec.metadata['homura.auto_await'] = 'true'`. Without this, a
|
|
9
|
+
RubyGems-installed pure-Ruby gem (e.g. `sinatra-inertia >= 0.1.1`)
|
|
10
|
+
was missing from both the Opal load path and the auto-await pass,
|
|
11
|
+
so `require 'sinatra/inertia'` failed during `homura build`.
|
|
12
|
+
- `homura-build` iterates `opal_gem_paths` instead of the old
|
|
13
|
+
path:-only list, so any opted-in gem (path: or RubyGems) gets the
|
|
14
|
+
same auto-await rewrite.
|
|
15
|
+
|
|
3
16
|
## 0.2.24 (2026-04-29)
|
|
4
17
|
|
|
5
18
|
- `BuildSupport.standalone_load_paths`: auto-discover `path:`-resolved
|
data/exe/homura-build
CHANGED
|
@@ -275,13 +275,14 @@ else
|
|
|
275
275
|
warn 'homura build: no app/ directory or top-level app.rb — skipping auto-await'
|
|
276
276
|
end
|
|
277
277
|
|
|
278
|
-
# Also run auto-await over
|
|
279
|
-
# consumer
|
|
280
|
-
#
|
|
281
|
-
#
|
|
282
|
-
#
|
|
283
|
-
#
|
|
284
|
-
|
|
278
|
+
# Also run auto-await over every gem we ship to Opal:
|
|
279
|
+
# `path:`-resolved gems in the consumer Gemfile *and* RubyGems-
|
|
280
|
+
# installed gems that opt in via
|
|
281
|
+
# `spec.metadata['homura.auto_await'] = 'true'`. Both go to
|
|
282
|
+
# `build/auto_await/gem_<basename>/<sub>` and
|
|
283
|
+
# `standalone_load_paths` puts those rewritten copies ahead of the
|
|
284
|
+
# gem's untransformed `lib/`.
|
|
285
|
+
CloudflareWorkers::BuildSupport.opal_gem_paths(root).each do |gem_path|
|
|
285
286
|
%w[lib].each do |sub|
|
|
286
287
|
src = gem_path.join(sub)
|
|
287
288
|
next unless src.directory?
|
|
@@ -86,18 +86,19 @@ module CloudflareWorkers
|
|
|
86
86
|
end
|
|
87
87
|
end
|
|
88
88
|
|
|
89
|
-
# Pick up any other
|
|
90
|
-
# Gemfile (e.g. `sinatra-inertia`). This keeps the build pipeline
|
|
91
|
-
# extensible: users can drop a pure-Ruby gem under `gems/foo`, list
|
|
92
|
-
# it as `gem 'foo', path: '../../gems/foo'`, and Opal will find its
|
|
93
|
-
# `lib/` automatically — no homura-runtime change required.
|
|
89
|
+
# Pick up any other gems that should ship in the Workers bundle:
|
|
94
90
|
#
|
|
95
|
-
#
|
|
96
|
-
#
|
|
97
|
-
#
|
|
98
|
-
#
|
|
99
|
-
#
|
|
100
|
-
|
|
91
|
+
# * `path:`-resolved gems in the consumer's Gemfile (monorepo
|
|
92
|
+
# dev mode), and
|
|
93
|
+
# * RubyGems-installed gems that opt in via
|
|
94
|
+
# `spec.metadata['homura.auto_await'] = 'true'`.
|
|
95
|
+
#
|
|
96
|
+
# Both go through the same auto-await pass during `homura-build`,
|
|
97
|
+
# and we prefer the rewritten copy under
|
|
98
|
+
# `build/auto_await/gem_<basename>/lib` if present so async chains
|
|
99
|
+
# inside gem code get `__await__` inserted just like consumer
|
|
100
|
+
# app code.
|
|
101
|
+
opal_gem_paths(root, loaded_specs: loaded_specs).each do |gem_path|
|
|
101
102
|
basename = gem_path.basename.to_s
|
|
102
103
|
rewritten_lib = root.join('build', 'auto_await', "gem_#{basename}", 'lib')
|
|
103
104
|
load_paths << rewritten_lib.to_s if rewritten_lib.directory?
|
|
@@ -133,6 +134,31 @@ module CloudflareWorkers
|
|
|
133
134
|
vend if vend.directory?
|
|
134
135
|
end
|
|
135
136
|
|
|
137
|
+
# Returns the union of `path_gemfile_entries(project_root)` and any
|
|
138
|
+
# bundled gems that opt in to the Opal pipeline via
|
|
139
|
+
# `spec.metadata['homura.auto_await']`. This is the single source
|
|
140
|
+
# of truth for both `standalone_load_paths` and the auto-await pass
|
|
141
|
+
# that `homura-build` runs. Returns `Pathname` objects pointing at
|
|
142
|
+
# each gem's root directory.
|
|
143
|
+
def opal_gem_paths(project_root, loaded_specs: Gem.loaded_specs)
|
|
144
|
+
wired = [RUNTIME_GEM_NAME, SINATRA_GEM_NAME, SEQUEL_D1_GEM_NAME]
|
|
145
|
+
out = []
|
|
146
|
+
out.concat(path_gemfile_entries(project_root))
|
|
147
|
+
|
|
148
|
+
loaded_specs.each_value do |spec|
|
|
149
|
+
next if wired.include?(spec.name)
|
|
150
|
+
meta = spec.metadata
|
|
151
|
+
next unless meta.is_a?(Hash)
|
|
152
|
+
flag = meta['homura.auto_await']
|
|
153
|
+
next unless flag == 'true' || flag == true
|
|
154
|
+
next if spec.full_gem_path.nil?
|
|
155
|
+
gem_path = Pathname(spec.full_gem_path)
|
|
156
|
+
out << gem_path if gem_path.directory?
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
out.uniq
|
|
160
|
+
end
|
|
161
|
+
|
|
136
162
|
# Returns absolute Pathnames for every `path:`-declared gem in the
|
|
137
163
|
# project's Gemfile that should ship in the Workers bundle.
|
|
138
164
|
#
|