homura-runtime 0.1.0 → 0.1.1
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 +6 -0
- data/bin/cloudflare-workers-build +7 -17
- data/exe/auto-await +3 -3
- data/lib/cloudflare_workers/build_support.rb +42 -0
- data/lib/cloudflare_workers/version.rb +1 -1
- data/runtime/wrangler.toml.example +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e6be075dbd944ef333e509df1dce30614231a25eb96e8384fcce5ed5e6e3e58c
|
|
4
|
+
data.tar.gz: 908dd2b9cc441b2b45946446a7e011deffb94bf2f5f16f649fc0a5c0ee352584
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 32bb2576d6a2b1cde36f0cc4cac86fac4e797e3628714564d9c337b0c18ebb36166f53f6008e708f36ce250423f6da01dbbae1ed3b6d5c2dc1dcc5acd0643386
|
|
7
|
+
data.tar.gz: 02166fe7dcb152895f9af50163a7a80bf2c9e3cabdb5d16de7fbd0712bcbf26731264b17b4d7819444ee71034dfce7db5bcb51211d0ae5b7983098b008e7fed8
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.1 (2026-04-23)
|
|
4
|
+
|
|
5
|
+
- Fix `cloudflare-workers-build --standalone` and `exe/auto-await` to resolve only
|
|
6
|
+
the published gem names `homura-runtime` / `sinatra-homura`.
|
|
7
|
+
- Add regression coverage for gem name resolution and Gemfile path detection.
|
|
8
|
+
|
|
3
9
|
## 0.1.0 (2026-04-20)
|
|
4
10
|
|
|
5
11
|
- Initial extraction from homura as `homura-runtime` (Phase 15-B).
|
|
@@ -8,13 +8,12 @@ require 'fileutils'
|
|
|
8
8
|
require 'open3'
|
|
9
9
|
require 'optparse'
|
|
10
10
|
require 'pathname'
|
|
11
|
+
require_relative '../lib/cloudflare_workers/build_support'
|
|
11
12
|
|
|
12
13
|
module CloudflareWorkersBuild
|
|
13
14
|
class << self
|
|
14
15
|
def gem_root
|
|
15
|
-
|
|
16
|
-
return Pathname(spec.full_gem_path) if spec
|
|
17
|
-
Pathname(__FILE__).expand_path.join('../..')
|
|
16
|
+
CloudflareWorkers::BuildSupport.runtime_root(current_file: __FILE__)
|
|
18
17
|
end
|
|
19
18
|
|
|
20
19
|
def runtime_dir
|
|
@@ -25,9 +24,8 @@ module CloudflareWorkersBuild
|
|
|
25
24
|
gem_root.join('exe', name)
|
|
26
25
|
end
|
|
27
26
|
|
|
28
|
-
def gem_lib(
|
|
29
|
-
|
|
30
|
-
File.join(s.full_gem_path, 'lib')
|
|
27
|
+
def gem_lib(*names)
|
|
28
|
+
CloudflareWorkers::BuildSupport.gem_lib(*names)
|
|
31
29
|
end
|
|
32
30
|
end
|
|
33
31
|
end
|
|
@@ -109,15 +107,7 @@ def run_opal_homura!(root, opal_input, opal_output)
|
|
|
109
107
|
end
|
|
110
108
|
|
|
111
109
|
def homura_vendor_from_gemfile(project_root)
|
|
112
|
-
|
|
113
|
-
return unless gf.file?
|
|
114
|
-
|
|
115
|
-
txt = gf.read
|
|
116
|
-
return unless (m = txt.match(/cloudflare-workers-runtime['"]\s*,\s*path:\s*['"]([^'"]+)['"]/))
|
|
117
|
-
|
|
118
|
-
runtime_path = Pathname.new(m[1]).expand_path(project_root)
|
|
119
|
-
vend = runtime_path.join('..', '..', 'vendor').expand_path
|
|
120
|
-
vend if vend.directory?
|
|
110
|
+
CloudflareWorkers::BuildSupport.vendor_from_gemfile(project_root)
|
|
121
111
|
end
|
|
122
112
|
|
|
123
113
|
def run_opal_standalone!(root, opal_input, opal_output, with_db:)
|
|
@@ -126,8 +116,8 @@ def run_opal_standalone!(root, opal_input, opal_output, with_db:)
|
|
|
126
116
|
load_paths << hv.to_s if hv
|
|
127
117
|
load_paths += [
|
|
128
118
|
'build/auto_await/app', 'app',
|
|
129
|
-
CloudflareWorkersBuild.gem_lib(
|
|
130
|
-
CloudflareWorkersBuild.gem_lib(
|
|
119
|
+
CloudflareWorkersBuild.gem_lib(CloudflareWorkers::BuildSupport::RUNTIME_GEM_NAME),
|
|
120
|
+
CloudflareWorkersBuild.gem_lib(CloudflareWorkers::BuildSupport::SINATRA_GEM_NAME)
|
|
131
121
|
]
|
|
132
122
|
load_paths << CloudflareWorkersBuild.gem_lib('sequel-d1') if with_db
|
|
133
123
|
load_paths << 'vendor' if root.join('vendor').directory?
|
data/exe/auto-await
CHANGED
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
|
|
16
16
|
require 'fileutils'
|
|
17
17
|
require 'pathname'
|
|
18
|
+
require_relative '../lib/cloudflare_workers/build_support'
|
|
18
19
|
|
|
19
|
-
#
|
|
20
|
+
# homura-runtime lib path resolution (with legacy alias fallback)
|
|
20
21
|
runtime_lib = ENV['CFW_RUNTIME_LIB']
|
|
21
22
|
unless runtime_lib
|
|
22
|
-
|
|
23
|
-
runtime_lib = spec ? File.join(spec.full_gem_path, 'lib') : File.expand_path('../lib', __dir__)
|
|
23
|
+
runtime_lib = CloudflareWorkers::BuildSupport.runtime_root(current_file: __FILE__).join('lib').to_s
|
|
24
24
|
end
|
|
25
25
|
$LOAD_PATH.unshift(runtime_lib) unless $LOAD_PATH.include?(runtime_lib)
|
|
26
26
|
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'pathname'
|
|
4
|
+
|
|
5
|
+
module CloudflareWorkers
|
|
6
|
+
module BuildSupport
|
|
7
|
+
RUNTIME_GEM_NAME = 'homura-runtime'
|
|
8
|
+
SINATRA_GEM_NAME = 'sinatra-homura'
|
|
9
|
+
|
|
10
|
+
class << self
|
|
11
|
+
def loaded_spec(name, loaded_specs: Gem.loaded_specs)
|
|
12
|
+
loaded_specs[name]
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def runtime_root(current_file:, loaded_specs: Gem.loaded_specs)
|
|
16
|
+
spec = loaded_spec(RUNTIME_GEM_NAME, loaded_specs: loaded_specs)
|
|
17
|
+
return Pathname(spec.full_gem_path) if spec
|
|
18
|
+
|
|
19
|
+
Pathname(current_file).expand_path.join('../..')
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def gem_lib(name, loaded_specs: Gem.loaded_specs)
|
|
23
|
+
spec = loaded_spec(name, loaded_specs: loaded_specs)
|
|
24
|
+
return File.join(spec.full_gem_path, 'lib') if spec
|
|
25
|
+
|
|
26
|
+
raise("cloudflare-workers-build: gem #{name} not loaded; use bundle exec from app root")
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def vendor_from_gemfile(project_root)
|
|
30
|
+
gf = Pathname(project_root).join('Gemfile')
|
|
31
|
+
return unless gf.file?
|
|
32
|
+
|
|
33
|
+
txt = gf.read
|
|
34
|
+
return unless (m = txt.match(/#{Regexp.escape(RUNTIME_GEM_NAME)}['"]\s*,\s*path:\s*['"]([^'"]+)['"]/))
|
|
35
|
+
|
|
36
|
+
runtime_path = Pathname.new(m[1]).expand_path(project_root)
|
|
37
|
+
vend = runtime_path.join('..', '..', 'vendor').expand_path
|
|
38
|
+
vend if vend.directory?
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Example wrangler fragment for apps using
|
|
1
|
+
# Example wrangler fragment for apps using homura-runtime.
|
|
2
2
|
# Copy patterns into your own wrangler.toml and set:
|
|
3
3
|
# main = "gems/homura-runtime/runtime/worker.mjs"
|
|
4
4
|
# (adjust path if you vendor the gem elsewhere.)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: homura-runtime
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kazuhiro NISHIYAMA
|
|
@@ -59,6 +59,7 @@ files:
|
|
|
59
59
|
- lib/cloudflare_workers/async_registry.rb
|
|
60
60
|
- lib/cloudflare_workers/auto_await/analyzer.rb
|
|
61
61
|
- lib/cloudflare_workers/auto_await/transformer.rb
|
|
62
|
+
- lib/cloudflare_workers/build_support.rb
|
|
62
63
|
- lib/cloudflare_workers/cache.rb
|
|
63
64
|
- lib/cloudflare_workers/durable_object.rb
|
|
64
65
|
- lib/cloudflare_workers/email.rb
|
|
@@ -84,6 +85,7 @@ metadata:
|
|
|
84
85
|
bug_tracker_uri: https://github.com/kazuph/homura/issues
|
|
85
86
|
changelog_uri: https://github.com/kazuph/homura/blob/main/gems/homura-runtime/CHANGELOG.md
|
|
86
87
|
readme_uri: https://github.com/kazuph/homura/blob/main/gems/homura-runtime/README.md
|
|
88
|
+
documentation_uri: https://homura.kazu-san.workers.dev/docs/runtime
|
|
87
89
|
rdoc_options: []
|
|
88
90
|
require_paths:
|
|
89
91
|
- lib
|