jsg 0.1.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.
@@ -0,0 +1,68 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title><%= project_name %></title>
7
+ <script src="assets/browser.script.iife.js"></script>
8
+ <style>
9
+ body {
10
+ background: #212121;
11
+ font-size: 30px;
12
+ color: whitesmoke;
13
+ padding: 20px;
14
+ }
15
+ a, a:link, a:visited {
16
+ color: #FF0000;
17
+ }
18
+
19
+ .spinner {
20
+ border: 4px solid rgba(0, 0, 0, 0.1);
21
+ width: 40px;
22
+ height: 40px;
23
+ border-radius: 50%;
24
+ border-left-color: #09f;
25
+ animation: spin 1s ease infinite;
26
+ }
27
+
28
+ @keyframes spin {
29
+ 0% {
30
+ transform: rotate(0deg);
31
+ }
32
+ 100% {
33
+ transform: rotate(360deg);
34
+ }
35
+ }
36
+ </style>
37
+ </head>
38
+ <body>
39
+ <h1><%= project_name %></h1>
40
+ <div id="spinner" class="spinner"></div>
41
+ <script type="text/ruby" data-eval="async">
42
+ require 'js'
43
+ require 'js/require_remote'
44
+ require 'jsg'
45
+
46
+ app_path = __FILE__
47
+ $0 = File::basename(app_path, ".rb") if app_path
48
+
49
+
50
+ # This is only needed if you want to use require_relative instead of JSG build
51
+ module Kernel
52
+ alias original_require_relative require_relative
53
+ def require_relative(path)
54
+ JS::RequireRemote.instance.load(path)
55
+ end
56
+ end
57
+
58
+ $window = JSG.global
59
+ $d = $window.document
60
+ $d.getElementById("spinner").style.display = "none"
61
+
62
+ puts "test"
63
+ JS.global[:console].log("test")
64
+ JS.global.console.log("yes")
65
+
66
+ </script>
67
+ </body>
68
+ </html>
data/template/serve.sh ADDED
@@ -0,0 +1 @@
1
+ ruby -run -e httpd . -p 8080
@@ -0,0 +1,3 @@
1
+ # Your code goes here and will be placed into the .wasm file after running "jsg build"
2
+ # If you don't want to use jsg build, you can use require_relative
3
+
metadata ADDED
@@ -0,0 +1,97 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jsg
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Andi
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2024-05-14 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: erb
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: js
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.6'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '2.6'
41
+ description: JSG helps setting up ruby.wasm projects and comes with a nicer syntax
42
+ email:
43
+ - largo@users.noreply.github.com
44
+ executables:
45
+ - jsg
46
+ extensions: []
47
+ extra_rdoc_files: []
48
+ files:
49
+ - ".idea/.gitignore"
50
+ - ".idea/jsg.iml"
51
+ - ".idea/misc.xml"
52
+ - ".idea/modules.xml"
53
+ - ".idea/vcs.xml"
54
+ - ".rspec"
55
+ - ".rubocop.yml"
56
+ - CHANGELOG.md
57
+ - LICENSE.txt
58
+ - README.md
59
+ - Rakefile
60
+ - exe/jsg
61
+ - jsg.rb
62
+ - lib/jsg/version.rb
63
+ - sig/jsg.rbs
64
+ - template/.gitignore
65
+ - template/Gemfile
66
+ - template/assets/browser.script.iife.js
67
+ - template/index.html.erb
68
+ - template/serve.sh
69
+ - template/src/main.rb
70
+ homepage: https://github.com/largo/jsg
71
+ licenses:
72
+ - MIT
73
+ metadata:
74
+ allowed_push_host: https://rubygems.org
75
+ homepage_uri: https://github.com/largo/jsg
76
+ source_code_uri: https://github.com/largo/jsg
77
+ changelog_uri: https://github.com/largo/jsg/CHANGELOG.md
78
+ post_install_message:
79
+ rdoc_options: []
80
+ require_paths:
81
+ - lib
82
+ required_ruby_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: 3.0.0
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ requirements: []
93
+ rubygems_version: 3.4.19
94
+ signing_key:
95
+ specification_version: 4
96
+ summary: JSG helps setting up ruby.wasm projects and comes with a nicer syntax
97
+ test_files: []