funicular 0.0.1 → 0.2.0

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.
Files changed (115) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +79 -0
  3. data/README.md +66 -20
  4. data/Rakefile +103 -2
  5. data/demo/keymap_editor.html +582 -0
  6. data/demo/test_cable.html +179 -0
  7. data/demo/test_chartjs.html +235 -0
  8. data/demo/test_component.html +201 -0
  9. data/demo/test_diff_patch.html +146 -0
  10. data/demo/test_error_boundary.html +284 -0
  11. data/demo/test_router.html +257 -0
  12. data/demo/test_vdom.html +100 -0
  13. data/demo/tic-tac-toe.html +201 -0
  14. data/docs/architecture.md +118 -0
  15. data/exe/funicular +32 -0
  16. data/lib/funicular/assets/funicular.css +23 -0
  17. data/lib/funicular/assets/funicular.rb +21 -0
  18. data/lib/funicular/assets/funicular_debug.css +73 -0
  19. data/lib/funicular/assets/funicular_debug.js +183 -0
  20. data/lib/funicular/commands/routes.rb +69 -0
  21. data/lib/funicular/compiler.rb +143 -0
  22. data/lib/funicular/configuration.rb +76 -0
  23. data/lib/funicular/helpers/picoruby_helper.rb +112 -0
  24. data/lib/funicular/middleware.rb +123 -0
  25. data/lib/funicular/plugin.rb +147 -0
  26. data/lib/funicular/railtie.rb +26 -0
  27. data/lib/funicular/route_parser.rb +137 -0
  28. data/lib/funicular/schema.rb +167 -0
  29. data/lib/funicular/ssr/runtime.rb +101 -0
  30. data/lib/funicular/ssr.rb +51 -0
  31. data/lib/funicular/testing/node_runner.mjs +293 -0
  32. data/lib/funicular/testing/node_runner.rb +190 -0
  33. data/lib/funicular/testing.rb +22 -0
  34. data/lib/funicular/vendor/picorbc/VERSION +1 -0
  35. data/lib/funicular/vendor/picorbc/picorbc.js +5283 -0
  36. data/lib/funicular/vendor/picorbc/picorbc.wasm +0 -0
  37. data/lib/funicular/vendor/picoruby/VERSION +1 -0
  38. data/lib/funicular/vendor/picoruby/debug/init.iife.js +130 -0
  39. data/lib/funicular/vendor/picoruby/debug/picoruby.js +6423 -0
  40. data/lib/funicular/vendor/picoruby/debug/picoruby.wasm +0 -0
  41. data/lib/funicular/vendor/picoruby/dist/init.iife.js +130 -0
  42. data/lib/funicular/vendor/picoruby/dist/picoruby.js +2 -0
  43. data/lib/funicular/vendor/picoruby/dist/picoruby.wasm +0 -0
  44. data/lib/funicular/vendor/picoruby-test-node/VERSION +1 -0
  45. data/lib/funicular/vendor/picoruby-test-node/picoruby.js +6885 -0
  46. data/lib/funicular/vendor/picoruby-test-node/picoruby.wasm +0 -0
  47. data/lib/funicular/vendor/picoruby-test-node/picoruby.wasm.map +1 -0
  48. data/lib/funicular/version.rb +1 -1
  49. data/lib/funicular.rb +32 -1
  50. data/lib/generators/funicular/chat/chat_generator.rb +104 -0
  51. data/lib/generators/funicular/chat/templates/application_cable_channel.rb.tt +4 -0
  52. data/lib/generators/funicular/chat/templates/application_cable_connection.rb.tt +4 -0
  53. data/lib/generators/funicular/chat/templates/create_funicular_chat_messages.rb.tt +10 -0
  54. data/lib/generators/funicular/chat/templates/funicular_chat.css.tt +141 -0
  55. data/lib/generators/funicular/chat/templates/funicular_chat_channel.rb.tt +5 -0
  56. data/lib/generators/funicular/chat/templates/funicular_chat_component.rb.tt +135 -0
  57. data/lib/generators/funicular/chat/templates/funicular_chat_component_picotest.rb.tt +64 -0
  58. data/lib/generators/funicular/chat/templates/funicular_chat_controller.rb.tt +4 -0
  59. data/lib/generators/funicular/chat/templates/funicular_chat_message.rb.tt +13 -0
  60. data/lib/generators/funicular/chat/templates/funicular_chat_messages_controller.rb.tt +23 -0
  61. data/lib/generators/funicular/chat/templates/initializer.rb.tt +4 -0
  62. data/lib/generators/funicular/chat/templates/show.html.erb.tt +6 -0
  63. data/lib/tasks/funicular.rake +218 -0
  64. data/minitest/fixtures/funicular_app/components/greeting_component.rb +16 -0
  65. data/minitest/fixtures/funicular_app/initializer.rb +5 -0
  66. data/minitest/funicular_test.rb +13 -0
  67. data/minitest/hydration_test.rb +87 -0
  68. data/minitest/plugin_test.rb +51 -0
  69. data/minitest/schema_test.rb +106 -0
  70. data/minitest/ssr_test.rb +94 -0
  71. data/minitest/test_helper.rb +7 -0
  72. data/minitest/validations_test.rb +183 -0
  73. data/mrbgem.rake +16 -0
  74. data/mrblib/0_validations.rb +206 -0
  75. data/mrblib/1_validators.rb +180 -0
  76. data/mrblib/cable.rb +432 -0
  77. data/mrblib/component.rb +1050 -0
  78. data/mrblib/debug.rb +208 -0
  79. data/mrblib/differ.rb +254 -0
  80. data/mrblib/environment_inquirer.rb +34 -0
  81. data/mrblib/error_boundary.rb +125 -0
  82. data/mrblib/file_upload.rb +192 -0
  83. data/mrblib/form_builder.rb +300 -0
  84. data/mrblib/funicular.rb +245 -0
  85. data/mrblib/html_serializer.rb +121 -0
  86. data/mrblib/http.rb +183 -0
  87. data/mrblib/model.rb +196 -0
  88. data/mrblib/patcher.rb +269 -0
  89. data/mrblib/router.rb +266 -0
  90. data/mrblib/store.rb +304 -0
  91. data/mrblib/store_collection.rb +171 -0
  92. data/mrblib/store_singleton.rb +79 -0
  93. data/mrblib/styles.rb +83 -0
  94. data/mrblib/vdom.rb +273 -0
  95. data/sig/cable.rbs +66 -0
  96. data/sig/component.rbs +149 -0
  97. data/sig/debug.rbs +28 -0
  98. data/sig/differ.rbs +18 -0
  99. data/sig/environment_iquirer.rbs +10 -0
  100. data/sig/error_boundary.rbs +14 -0
  101. data/sig/file_upload.rbs +18 -0
  102. data/sig/form_builder.rbs +29 -0
  103. data/sig/funicular.rbs +24 -1
  104. data/sig/html_serializer.rbs +20 -0
  105. data/sig/http.rbs +37 -0
  106. data/sig/model.rbs +28 -0
  107. data/sig/patcher.rbs +18 -0
  108. data/sig/router.rbs +44 -0
  109. data/sig/store.rbs +89 -0
  110. data/sig/store_collection.rbs +43 -0
  111. data/sig/store_singleton.rbs +19 -0
  112. data/sig/styles.rbs +25 -0
  113. data/sig/validations.rbs +103 -0
  114. data/sig/vdom.rbs +59 -0
  115. metadata +154 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8d778a4d72fce90ad8e8403f40a32293431da06b47908e927a587ad725afa192
4
- data.tar.gz: 1ded05e84560d65c99119e6e8603c04a8f130e40949ca476d6ec1419ba19cc82
3
+ metadata.gz: 42012485f28870d0316fa30ba1fbebd4699c07cb8e61e5d201874d2eafd50d04
4
+ data.tar.gz: ab7f7e473a32d0a00b8bca5b0c67fc7e7b91a9a7860724e53631ea7d08dbcc41
5
5
  SHA512:
6
- metadata.gz: 843a50c979823f2a307107958dab03e4414ebf37978bb968857336c6ba4436f48ab47322f3bf7b37ce27f2bd8030696d668c20c3adc52df7b01eb7c443c01d6d
7
- data.tar.gz: 51f945d515798ee9804b4e11359f7ff7579024a8db8e392ef96c4bfa36867a0a6a52cedb8da8542abc7161be1fe256b3076ba345e39803407683e3523fbeef6f
6
+ metadata.gz: 5488c967e48dd01768dc05acba5a350e07fb2fb5fc9ede01f5e06dd1274c1c4ee1fd7f0f4e76a2c616b74b8eff10260f5a14108d83798a34e25c3f785c4be7c7
7
+ data.tar.gz: 653010659b471071850c77dd459ff17984b906485cfcc9b396c3ecf1558686c353ca2ec65cc3940dad4497c79318515b833ff4219f7f9e301e93a041abbfbb30
data/CHANGELOG.md CHANGED
@@ -1,5 +1,84 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ### Added
4
+
5
+ - **Funicular::Store DSL**: Declarative client-side stores backed by
6
+ IndexedDB. Subclass `Funicular::Store::Singleton` (one value per scope)
7
+ or `Funicular::Store::Collection` (ordered list per scope) and use
8
+ class-level DSL (`database`, `scope`, `limit`, `key`, `expires_in`,
9
+ `cleared_on`, `subscribes_to`) to wire up persistence, TTL, event-based
10
+ clearing, and ActionCable integration.
11
+ - `Funicular::Store.dispatch(:event)` for coordinated store clearing
12
+ (e.g., logout wipes all stores registered with `cleared_on :logout`)
13
+ - `subscribes_to` DSL for embedding Cable message handling directly in
14
+ store classes; scopes gain `subscribe!` / `unsubscribe!` / `subscribed?`
15
+ - Lazy KVS initialization: stores open IndexedDB on first access, removing
16
+ the need for explicit `init!` calls in application initializers
17
+ - `Funicular::Store::Scope#on_change` / `off_change` for reactive UI
18
+ updates when store data changes
19
+
20
+ ### Changed
21
+
22
+ - `Funicular::Cable::Consumer` now automatically resubscribes all active
23
+ subscriptions after WebSocket reconnect (`resubscribe_all`)
24
+
25
+ ## [0.1.0] - 2026-04-20
26
+
27
+ ### Added
28
+
29
+ - Consolidated with picoruby-funicular: merged the full PicoRuby frontend
30
+ framework into this gem, including Component, Cable, VDOM, Router,
31
+ FormBuilder, Model, HTTP, FileUpload, ErrorBoundary, Styles, Differ,
32
+ Patcher, Debug, and EnvironmentInquirer, along with RBS signatures and
33
+ comprehensive test suite
34
+ - Bundle PicoRuby.wasm and picorbc WASM artifacts into the gem via a
35
+ `rake copy_wasm` task; artifacts are vendored at build time so no
36
+ runtime npm lookup is required
37
+ - `Funicular::Configuration` with per-environment PicoRuby.wasm source
38
+ selection (`:local_debug`, `:local_dist`, `:cdn`) and optional
39
+ `cdn_version` override
40
+ - `picoruby_include_tag` view helper (auto-registered via Railtie) that
41
+ serves the appropriate PicoRuby.wasm build per environment
42
+ - `funicular:install:wasm` rake sub-task to copy dist/debug WASM builds
43
+ into `public/picoruby/`
44
+ - Rails Asset Pipeline integration: Rack middleware, compiler, and
45
+ `funicular:compile` / `funicular:install` rake tasks
46
+ - `funicular routes` CLI command and `Funicular::RouteParser` to inspect
47
+ Rails routes from the command line
48
+ - Component Debug Highlighter: CSS/JS assets (`funicular_debug.css`,
49
+ `funicular_debug.js`) that highlight the selected component in the
50
+ browser
51
+ - `ENV['FUNICULAR_ENV']` is now set from `Rails.env` in generated
52
+ `application.rb`
53
+
54
+ ### Changed
55
+
56
+ - picorbc is now resolved from a vendored WASM artifact; removed
57
+ npm-based picorbc lookup and all `PICORBC_VERSION` environment variable
58
+ logic
59
+ - Upgraded picorbc to the latest version
60
+ - Switched test framework from test/unit to minitest
61
+
62
+ ### Fixed
63
+
64
+ - Asset pipeline: middleware now detects whether `app.mrb` has actually
65
+ changed before recompiling, preventing unnecessary rebuilds
66
+ - XSS vulnerabilities in VDOM attribute handling: expanded
67
+ `URL_ATTRIBUTES` constant, applied case-insensitive `javascript:` URI
68
+ blocking, and added the same URL validation to `Patcher#update_props`
69
+ and `Patcher#create_element`
70
+ - XSS vulnerability in Debug module: replaced manual JSON string
71
+ concatenation with `JSON.generate` to eliminate escaping gaps
72
+ - `funicular:compile` rake task
73
+ - `funicular:install` rake task
74
+ - Rack middleware
75
+ - RBS type signatures
76
+
77
+ ### Removed
78
+
79
+ - Debugger Chrome extension (`debugger/` directory)
80
+ - `.ruby-version` file
81
+
3
82
  ## [0.0.1] - 2025-11-27
4
83
 
5
84
  - Initial release
data/README.md CHANGED
@@ -1,43 +1,89 @@
1
1
  # Funicular
2
2
 
3
- TODO: Delete this and the text below, and describe your gem
3
+ > 🎵Funicu-lì, Funicu-là!🚊🚊🚊
4
+ >
5
+ > 🎵Funicu-lì, Funicu-là!🚞🚞🚞
4
6
 
5
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/funicular`. To experiment with that code, run `bin/console` for an interactive prompt.
7
+ **Funicular** is a single-page application (SPA) framework powered by PicoRuby.wasm.
6
8
 
7
- ## Installation
9
+ ## Features
8
10
 
9
- TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
11
+ - Write client-side code in Ruby instead of JavaScript
12
+ - Seamless Rails integration
10
13
 
11
- Install the gem and add to the application's Gemfile by executing:
14
+ ## Combined Gem
12
15
 
13
- ```bash
14
- bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
16
+ This repository consists of three relevant projects:
17
+
18
+ - PicoGem "picoruby-funicular" ... Core implementation
19
+ - CRubyGem "funicular" ... Rails integration
20
+ - Chrome extension "PicoRuby Debugger"
21
+
22
+ ### PicoGem "picoruby-funicular"
23
+
24
+ ```console
25
+ .
26
+ ├── mrbgem.rake
27
+ ├── mrblib/
28
+ └── test/
29
+ ```
30
+
31
+ ### CRubyGem "funicular"
32
+
33
+ ```console
34
+ .
35
+ ├── bin/
36
+ ├── exe/
37
+ ├── funicular.gemspec
38
+ ├── Gemfile
39
+ ├── Gemfile.lock
40
+ ├── lib/
41
+ ├── minitest/
42
+ └── Rakefile
15
43
  ```
16
44
 
17
- If bundler is not being used to manage dependencies, install the gem by executing:
45
+ ### Chrome extention "PicoRuby.wasm debugger"
18
46
 
19
- ```bash
20
- gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
47
+ ```console
48
+ .
49
+ └── debugger/
21
50
  ```
22
51
 
23
- ## Usage
52
+ ----
53
+
54
+ The others are common resources.
55
+
56
+ ## Documentation
57
+
58
+ User documentation is hosted on **picoruby.org**:
24
59
 
25
- TODO: Write usage instructions here
60
+ - [Getting Started with Funicular](https://picoruby.org/funicular-getting-started) — a standalone, no-Rails tutorial
61
+ - [Funicular on Rails](https://picoruby.org/funicular-on-rails) — installation, the asset pipeline, and a feature-by-feature tutorial plus reference (components, routing, forms, data fetching, stores, realtime, SSR, styling, debugging)
62
+
63
+ For contributors working on the gem itself, see [docs/architecture.md](docs/architecture.md).
26
64
 
27
65
  ## Development
28
66
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
67
+ This repository is a submodule of [picoruby/picoruby](https://github.com/picoruby/picoruby).
68
+ Do not check it out standalone. Instead, clone the parent repository and work from there:
30
69
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
70
+ ```console
71
+ git clone --recurse-submodules https://github.com/picoruby/picoruby.git
72
+ cd picoruby/mrbgems/picoruby-funicular
73
+ ```
32
74
 
33
- ## Contributing
75
+ The CRubyGem side (`lib/`, `funicular.gemspec`, etc.) can be developed and tested independently inside that directory, but `rake copy_wasm` — which vendorsthe PicoRuby.wasm and picorbc wasm artifacts into the gem — relies on sibling directories within the picoruby repository (`mrbgems/picoruby-wasm/npm/`).
76
+ Running it from a standalone checkout will fail.
34
77
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/funicular. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/funicular/blob/master/CODE_OF_CONDUCT.md).
78
+ ## Testing
36
79
 
37
- ## License
80
+ - CRubygem (Rails integration) test: `rake test` in this repository
81
+ - PicoGem Funicular test: `rake test:gems:picoruby[picoruby-funicular]` in picoruby where mrbgems/picoruby-funicular exists as a submodule
38
82
 
39
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
83
+ ## Contributing
84
+
85
+ Bug reports and pull requests are welcome on GitHub at https://github.com/picoruby/funicular.
40
86
 
41
- ## Code of Conduct
87
+ ## License
42
88
 
43
- Everyone interacting in the Funicular project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/funicular/blob/master/CODE_OF_CONDUCT.md).
89
+ Copyright © 2025- HASUMI Hitoshi. See MIT-LICENSE for further details.
data/Rakefile CHANGED
@@ -4,9 +4,110 @@ require "bundler/gem_tasks"
4
4
  require "rake/testtask"
5
5
 
6
6
  Rake::TestTask.new(:test) do |t|
7
- t.libs << "test"
7
+ t.libs << "minitest"
8
8
  t.libs << "lib"
9
- t.test_files = FileList["test/**/*_test.rb"]
9
+ t.test_files = FileList["minitest/**/*_test.rb"]
10
10
  end
11
11
 
12
12
  task default: :test
13
+
14
+ desc "Copy picoruby and picorbc wasm artifacts from picoruby-wasm into the gem"
15
+ task :copy_wasm do
16
+ require "fileutils"
17
+ require "json"
18
+
19
+ vendor_root = File.expand_path("lib/funicular/vendor", __dir__)
20
+
21
+ # PICORUBY_WASM_NPM_DIR overrides the default search path.
22
+ # Default: picoruby-wasm is a sibling of picoruby-funicular under mrbgems/.
23
+ npm_root = ENV["PICORUBY_WASM_NPM_DIR"] ||
24
+ File.expand_path("../picoruby-wasm/npm", __dir__)
25
+
26
+ unless Dir.exist?(npm_root)
27
+ abort "picoruby-wasm npm directory not found: #{npm_root}\n" \
28
+ "Set PICORUBY_WASM_NPM_DIR to override, and ensure picoruby-wasm has been built."
29
+ end
30
+
31
+ # ------------------------------------------------------------------
32
+ # 1) PicoRuby runtime (browser): dist + debug
33
+ # ------------------------------------------------------------------
34
+ picoruby_src = File.join(npm_root, "picoruby")
35
+ picoruby_dest = File.join(vendor_root, "picoruby")
36
+ abort "Missing #{picoruby_src}" unless Dir.exist?(picoruby_src)
37
+
38
+ picoruby_version = JSON.parse(File.read(File.join(picoruby_src, "package.json"))).fetch("version")
39
+ picoruby_files = %w[picoruby.wasm picoruby.js init.iife.js]
40
+
41
+ %w[dist debug].each do |variant|
42
+ src = File.join(picoruby_src, variant)
43
+ dst = File.join(picoruby_dest, variant)
44
+ abort "Missing source variant: #{src}" unless Dir.exist?(src)
45
+
46
+ FileUtils.rm_rf(dst)
47
+ FileUtils.mkdir_p(dst)
48
+ picoruby_files.each do |fname|
49
+ src_file = File.join(src, fname)
50
+ abort "Missing file: #{src_file}" unless File.exist?(src_file)
51
+ # FileUtils.copy_file follows symlinks, so debug/init.iife.js
52
+ # (a symlink to ../dist/init.iife.js) is materialized.
53
+ FileUtils.copy_file(src_file, File.join(dst, fname))
54
+ end
55
+ puts " copied picoruby/#{variant}"
56
+ end
57
+
58
+ File.write(File.join(picoruby_dest, "VERSION"), "#{picoruby_version}\n")
59
+ puts " wrote picoruby/VERSION (#{picoruby_version})"
60
+
61
+ # ------------------------------------------------------------------
62
+ # 2) picorbc compiler (node CLI, run by Funicular::Compiler)
63
+ # ------------------------------------------------------------------
64
+ picorbc_src = File.join(npm_root, "picorbc", "debug")
65
+ picorbc_dest = File.join(vendor_root, "picorbc")
66
+ abort "Missing #{picorbc_src}" unless Dir.exist?(picorbc_src)
67
+
68
+ picorbc_version = JSON.parse(File.read(File.join(npm_root, "picorbc", "package.json"))).fetch("version")
69
+ picorbc_files = %w[picorbc.js picorbc.wasm]
70
+
71
+ FileUtils.rm_rf(picorbc_dest)
72
+ FileUtils.mkdir_p(picorbc_dest)
73
+ picorbc_files.each do |fname|
74
+ src_file = File.join(picorbc_src, fname)
75
+ abort "Missing file: #{src_file}" unless File.exist?(src_file)
76
+ FileUtils.copy_file(src_file, File.join(picorbc_dest, fname))
77
+ end
78
+ File.chmod(0755, File.join(picorbc_dest, "picorbc.js"))
79
+ File.write(File.join(picorbc_dest, "VERSION"), "#{picorbc_version}\n")
80
+ puts " copied picorbc (#{picorbc_version})"
81
+
82
+ # ------------------------------------------------------------------
83
+ # 3) PicoRuby runtime for DOM-backed Node.js tests
84
+ # ------------------------------------------------------------------
85
+ test_runtime_src = ENV["PICORUBY_WASM_TEST_DIR"] ||
86
+ File.expand_path("../../build/picoruby-wasm-test/bin", __dir__)
87
+ test_runtime_dest = File.join(vendor_root, "picoruby-test-node")
88
+ test_runtime_files = %w[picoruby.js picoruby.wasm]
89
+ optional_test_runtime_files = %w[picoruby.wasm.map]
90
+
91
+ unless Dir.exist?(test_runtime_src)
92
+ abort "PicoRuby WASM test runtime not found: #{test_runtime_src}\n" \
93
+ "Run `MRUBY_CONFIG=picoruby-wasm-test rake all` from the picoruby checkout, " \
94
+ "or set PICORUBY_WASM_TEST_DIR to the directory containing picoruby.js."
95
+ end
96
+
97
+ FileUtils.rm_rf(test_runtime_dest)
98
+ FileUtils.mkdir_p(test_runtime_dest)
99
+ test_runtime_files.each do |fname|
100
+ src_file = File.join(test_runtime_src, fname)
101
+ abort "Missing file: #{src_file}" unless File.exist?(src_file)
102
+ FileUtils.copy_file(src_file, File.join(test_runtime_dest, fname))
103
+ end
104
+ optional_test_runtime_files.each do |fname|
105
+ src_file = File.join(test_runtime_src, fname)
106
+ FileUtils.copy_file(src_file, File.join(test_runtime_dest, fname)) if File.exist?(src_file)
107
+ end
108
+ File.write(File.join(test_runtime_dest, "VERSION"), "#{picoruby_version}\n")
109
+ puts " copied picoruby-test-node (#{picoruby_version})"
110
+ end
111
+
112
+ # Make sure the wasm artifacts are refreshed before the gem is packaged for release.
113
+ Rake::Task["build"].enhance([:copy_wasm])