homura-runtime 0.2.20 → 0.2.22
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/exe/compile-erb +9 -5
- data/exe/homura-build +26 -8
- 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: cff255ad823986df011ec56a290aafb83c08a148aee51a0e5f614f9ca80f2d41
|
|
4
|
+
data.tar.gz: 9e3cb0a22c2a6c497fea120d38111d9cc299cd43213bfeb7d9f52ff2cd6cda3c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1ff4f7099815079d7e3c284b32935c99afb1cabc64a31e0115f69dcda7a72bdb56f9ffb11dee82a2ae37b809112319651fba79d03c7ec7dc7d00210634672641
|
|
7
|
+
data.tar.gz: 5f2cc557b7c0484d35fbe4bb08dedcc26044b0c537f57b93f68ddd648b5e665ae32613704052f590bc73005d7730954062e091c429c6afb9ded204d6ae268fc8
|
data/exe/compile-erb
CHANGED
|
@@ -512,14 +512,18 @@ inputs =
|
|
|
512
512
|
|
|
513
513
|
template_root = positional.find { |a| File.directory?(a) } || options[:input_dir]
|
|
514
514
|
|
|
515
|
-
if inputs.empty?
|
|
516
|
-
warn "bin/compile-erb: no .erb files found (under #{options[:input_dir]}/ or from args)"
|
|
517
|
-
exit 1
|
|
518
|
-
end
|
|
519
|
-
|
|
520
515
|
write_file = !options[:stdout] && (positional.empty? || options[:output])
|
|
521
516
|
out_path = options[:output]
|
|
522
517
|
|
|
518
|
+
# An app with zero ERB templates (e.g. an example that builds HTML
|
|
519
|
+
# inline with Ruby heredocs) is a valid case: still emit the registry
|
|
520
|
+
# header + Sinatra dispatcher patch so `erb :foo` raises a clear error
|
|
521
|
+
# at runtime instead of silently disappearing, and so the build
|
|
522
|
+
# pipeline doesn't fail when there is nothing to compile.
|
|
523
|
+
if inputs.empty?
|
|
524
|
+
warn "compile-erb: no .erb files under #{options[:input_dir]}/ — writing empty registry"
|
|
525
|
+
end
|
|
526
|
+
|
|
523
527
|
if write_file
|
|
524
528
|
FileUtils.mkdir_p(File.dirname(out_path))
|
|
525
529
|
File.open(out_path, 'w') do |io|
|
data/exe/homura-build
CHANGED
|
@@ -245,14 +245,32 @@ else
|
|
|
245
245
|
],
|
|
246
246
|
chdir: root
|
|
247
247
|
)
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
248
|
+
# auto-await pass: project layouts that don't have an `app/`
|
|
249
|
+
# directory (e.g. a single-file classic Sinatra example with a
|
|
250
|
+
# top-level `app.rb`) are still valid — feed the lone file to
|
|
251
|
+
# auto-await so its `db.execute` / `kv.get` / etc. still get
|
|
252
|
+
# `__await__` inserted.
|
|
253
|
+
if root.join('app').directory?
|
|
254
|
+
run!(
|
|
255
|
+
[
|
|
256
|
+
'ruby', CloudflareWorkersBuild.exe_path('auto-await').to_s,
|
|
257
|
+
'--input', 'app',
|
|
258
|
+
'--output', 'build/auto_await/app'
|
|
259
|
+
],
|
|
260
|
+
chdir: root
|
|
261
|
+
)
|
|
262
|
+
elsif root.join('app.rb').file?
|
|
263
|
+
run!(
|
|
264
|
+
[
|
|
265
|
+
'ruby', CloudflareWorkersBuild.exe_path('auto-await').to_s,
|
|
266
|
+
'--input', 'app.rb',
|
|
267
|
+
'--output', 'build/auto_await/app.rb'
|
|
268
|
+
],
|
|
269
|
+
chdir: root
|
|
270
|
+
)
|
|
271
|
+
else
|
|
272
|
+
warn 'homura build: no app/ directory or top-level app.rb — skipping auto-await'
|
|
273
|
+
end
|
|
256
274
|
|
|
257
275
|
opal_in = Pathname(resolve_opal_input(root, options[:opal_input]))
|
|
258
276
|
opal_out = Pathname(options[:opal_output])
|