wasmify-rails 0.2.0 → 0.2.2

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: 55efaa8fa8cd15d3eb906efe9342baa453af8e53d363f12bc72fb4c3f2afc1a8
4
- data.tar.gz: a20c26e0a6525f9f0bb183a4d59620895864c6f450739677d39e39a95c471a49
3
+ metadata.gz: 3b2a978cc93a769fd29e2cfa52a5c4c8aef4d6747ef05255fdd0b6be54618a98
4
+ data.tar.gz: 402d4df38fb308c5645dbd2b7379733bf6fe633c6d06cb0faa1504a85dc13cf5
5
5
  SHA512:
6
- metadata.gz: 78329c56067b9bf41c72bd46fb02686ceea78b12f9785f6f2623bf12558476d36d45db1e6ac0402be16f070fc83e2ce4490ef816d55626c1ea847762059d5fff
7
- data.tar.gz: 3e783be0989c85ba28841078b7f2ea7626f7b682d9c807fa411307a08988d73046c8f56aa8eecc1ad4a5c0c41d757c1003e0499378465616a46d04242002c22c
6
+ metadata.gz: e02c1a8081d57ea23f0efa5b6fe486cb0db7efab55bb3611337409703090cbbdb8f5cca667333de2874707d3d1eedfee524aa05cf8d59b83b5712439b85bd52b
7
+ data.tar.gz: 8a55254d6f625d54ac9757d94cfda2466d66bf8457d75f88cd8e0297e354caf4e27d60e4d94c51d761b40a79b4766098b13b65d2dd0833f5cc643f14647ab349
data/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 0.2.2
6
+
7
+ - Fix handling multipart uploads in Data URI middleware.
8
+
9
+ - PWA template improvements.
10
+
11
+ ## 0.2.1
12
+
13
+ - Minor generators updates.
14
+
5
15
  ## 0.2.0
6
16
 
7
17
  - Add pglite support.
@@ -89,6 +89,7 @@ class Wasmify::InstallGenerator < Rails::Generators::Base
89
89
  solid_cache
90
90
  jsbundling-rails
91
91
  cssbundling-rails
92
+ tailwindcss-rails
92
93
  thruster
93
94
  kamal
94
95
  byebug
@@ -7,6 +7,22 @@ class Wasmify::PwaGenerator < Rails::Generators::Base
7
7
  directory "pwa", "pwa"
8
8
  end
9
9
 
10
+ def configure_wasm_dist
11
+ prepend_to_file "config/wasmify.yml", <<~EOF
12
+ output_dir: pwa/public
13
+ EOF
14
+ end
15
+
16
+ def install_npm_deps
17
+ begin
18
+ in_root do
19
+ run "(cd pwa/ && yarn install)"
20
+ end
21
+ rescue
22
+ say "Please, make sure to run `yarn install` within the pwa/ folder", :red
23
+ end
24
+ end
25
+
10
26
  private
11
27
 
12
28
  def wasmify_rails_version = Wasmify::Rails::VERSION
@@ -1,102 +1,134 @@
1
1
  <!doctype html>
2
2
  <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <meta name="og:title" content="Rails on Wasm" />
7
- <meta name="og:description" content="Rails on Wasm launcher" />
8
- <title>Rails on Wasm | Launch</title>
9
- <script type="module" src="/boot.js"></script>
10
- <style>
11
- #boot-console-output {
12
- background-color: #0c0c0c;
13
- color: #f8f8f2;
14
- font-family: monospace;
15
- font-size: 0.8em;
16
- padding: 1em;
17
- white-space: pre-wrap;
18
- min-height: 200px;
19
- overflow-y: scroll;
20
- }
21
- #launch-button {
22
- background-color: #007bff;
23
- color: #fff;
24
- border: none;
25
- padding: 0.5em 1em;
26
- font-size: 1em;
27
- cursor: pointer;
28
- border: 1px solid #ccc;
29
- }
30
- #launch-button:disabled {
31
- background-color: #ccc;
32
- color: #666;
33
- }
34
- #reboot-button {
35
- background-color: #dc3545;
36
- color: #fff;
37
- border: none;
38
- padding: 0.5em 1em;
39
- font-size: 1em;
40
- cursor: pointer;
41
- border: 1px solid #ccc;
42
- }
43
- #reboot-button:disabled {
44
- background-color: #ccc;
45
- color: #666;
46
- }
47
- #reload-button {
48
- background-color: #eeeeee;
49
- color: #333;
50
- border: none;
51
- padding: 0.5em 1em;
52
- font-size: 1em;
53
- cursor: pointer;
54
- border: 1px solid #333;
55
- }
56
- #reload-button:disabled {
57
- background-color: #ccc;
58
- color: #666;
59
- }
60
- #reload-debug-button {
61
- background-color: rgb(159, 166, 40);
62
- color: #000;
63
- border: none;
64
- padding: 0.5em 1em;
65
- font-size: 1em;
66
- cursor: pointer;
67
- border: 1px solid #000;
68
- }
69
- #reload-debug-button:disabled {
70
- background-color: #ccc;
71
- color: #666;
72
- }
73
- </style>
74
- </head>
75
- <body>
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <meta name="og:title" content="Rails on Wasm" />
7
+ <meta name="og:description" content="Rails on Wasm launcher" />
8
+ <title>Rails on Wasm | Launch</title>
9
+ <script type="module" src="/boot.js"></script>
10
+ <style>
11
+ main {
12
+ max-width: 800px;
13
+ margin: 0 auto;
14
+ padding: 1em;
15
+ }
16
+
17
+ #boot-console-output {
18
+ background-color: #0c0c0c;
19
+ color: #f8f8f2;
20
+ font-family: monospace;
21
+ font-size: 0.8em;
22
+ padding: 1em;
23
+ white-space: pre-wrap;
24
+ min-height: 200px;
25
+ overflow-y: scroll;
26
+ margin-top: 0;
27
+ }
28
+
29
+ #buttons {
30
+ display: flex;
31
+ justify-content: flex-start;
32
+ gap: 0.5em;
33
+ }
34
+
35
+ #launch-button {
36
+ background-color: #007bff;
37
+ color: #fff;
38
+ border: none;
39
+ padding: 0.5em 1em;
40
+ font-size: 1em;
41
+ cursor: pointer;
42
+ border: 1px solid #007bff;
43
+ }
44
+ #launch-button:disabled {
45
+ background-color: #ccc;
46
+ border-color: #000;
47
+ color: #666;
48
+ }
49
+ #reboot-button {
50
+ background-color: #dc3545;
51
+ color: #fff;
52
+ border: none;
53
+ padding: 0.5em 1em;
54
+ font-size: 1em;
55
+ cursor: pointer;
56
+ border: 1px solid #dc3545;
57
+ }
58
+ #reboot-button:disabled {
59
+ background-color: #ccc;
60
+ color: #666;
61
+ border-color: #000;
62
+ }
63
+ #reload-button {
64
+ background-color: #eeeeee;
65
+ color: #333;
66
+ border: none;
67
+ padding: 0.5em 1em;
68
+ font-size: 1em;
69
+ cursor: pointer;
70
+ border: 1px solid #333;
71
+ }
72
+ #reload-button:disabled {
73
+ background-color: #ccc;
74
+ color: #666;
75
+ }
76
+ #reload-debug-button {
77
+ background-color: rgb(159, 166, 40);
78
+ color: #000;
79
+ border: none;
80
+ padding: 0.5em 1em;
81
+ font-size: 1em;
82
+ cursor: pointer;
83
+ border: 1px solid #000;
84
+ }
85
+ #reload-debug-button:disabled {
86
+ background-color: #ccc;
87
+ color: #666;
88
+ }
89
+
90
+ header {
91
+ display: flex;
92
+ justify-content: space-between;
93
+ align-items: center;
94
+ margin-bottom: 1em;
95
+ }
96
+
97
+ .header--links {
98
+ display: flex;
99
+ gap: 1em;
100
+ }
101
+ </style>
102
+ </head>
103
+ <body>
104
+ <main>
105
+ <header>
76
106
  <h1>Rails on Wasm 🚀</h1>
77
- <p>
78
- Wait for the Service Worker to install and boot the app. This may
79
- take a while.
80
- </p>
107
+ </header>
108
+ <p>
109
+ Wait for the Service Worker to install and boot the app, and then hit
110
+ the "Launch" button to run a Rails application in your browser!
111
+ </p>
81
112
 
82
- <p>
83
- <button id="launch-button" disabled>Launch</button>
84
- <button id="reload-button" disabled>Reload Rails</button>
85
- <button id="reload-debug-button" disabled>
86
- Reload Rails (debug mode)
87
- </button>
88
- <button id="reboot-button" disabled>Hard Reset*</button>
89
- </p>
113
+ <p id="buttons">
114
+ <button id="launch-button" disabled>Launch</button>
115
+ <button id="reload-button" disabled>Reload Rails</button>
116
+ <button id="reload-debug-button" disabled>
117
+ Reload Rails (debug mode)
118
+ </button>
119
+ <button id="reboot-button" disabled>Hard Reset*</button>
120
+ </p>
90
121
 
91
- <div id="boot-message"></div>
92
- <progress id="boot-progress" max="100" value="0"></progress>
93
- <pre id="boot-console-output"></pre>
94
- <hr />
95
- <p>
96
- <small>
97
- * Please ensure you close all tabs of this app before rebooting
98
- to unregister the old Service Worker.
99
- </small>
100
- </p>
101
- </body>
122
+ <div id="boot-message"></div>
123
+ <progress id="boot-progress" max="100" value="0"></progress>
124
+ <pre id="boot-console-output"></pre>
125
+ <hr />
126
+ <p>
127
+ <small>
128
+ * Please ensure you close all tabs of this app before rebooting to
129
+ unregister the old Service Worker.
130
+ </small>
131
+ </p>
132
+ </main>
133
+ </body>
102
134
  </html>
@@ -11,6 +11,14 @@ export default defineConfig({
11
11
  optimizeDeps: {
12
12
  exclude: ["@sqlite.org/sqlite-wasm"],
13
13
  },
14
+ build: {
15
+ rollupOptions: {
16
+ input: {
17
+ main: resolve(__dirname, 'index.html'),
18
+ boot: resolve(__dirname, 'boot.html'),
19
+ },
20
+ },
21
+ },
14
22
  plugins: [
15
23
  VitePWA({
16
24
  srcDir: ".",
@@ -21,6 +21,7 @@ module Rack
21
21
 
22
22
  if request.post? || request.put? || request.patch?
23
23
  transform_params(request.params)
24
+ env["action_dispatch.request.request_parameters"] = request.params
24
25
  end
25
26
 
26
27
  @app.call(env)
@@ -48,6 +49,8 @@ module Rack
48
49
  encoding = matches[2]
49
50
  data = matches[3]
50
51
 
52
+ return if data.empty?
53
+
51
54
  file_data = Base64.decode64(data)
52
55
 
53
56
  file = Tempfile.new(["upload", mime_to_extension(content_type)])
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Wasmify
4
4
  module Rails # :nodoc:
5
- VERSION = "0.2.0"
5
+ VERSION = "0.2.2"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wasmify-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vladimir Dementyev
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-11-18 00:00:00.000000000 Z
11
+ date: 2025-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -181,7 +181,7 @@ metadata:
181
181
  documentation_uri: https://github.com/palkan/wasmify-rails
182
182
  homepage_uri: https://github.com/palkan/wasmify-rails
183
183
  source_code_uri: https://github.com/palkan/wasmify-rails
184
- post_install_message:
184
+ post_install_message:
185
185
  rdoc_options: []
186
186
  require_paths:
187
187
  - lib
@@ -197,7 +197,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
197
197
  version: '0'
198
198
  requirements: []
199
199
  rubygems_version: 3.5.22
200
- signing_key:
200
+ signing_key:
201
201
  specification_version: 4
202
202
  summary: Tools and extensions to package Rails apps as Wasm modules
203
203
  test_files: []