jsbundling-rails 1.2.1 → 1.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 +4 -4
- data/lib/install/dev +1 -1
- data/lib/install/esbuild/install.rb +1 -1
- data/lib/install/install.rb +2 -2
- data/lib/install/rollup/rollup.config.js +1 -1
- data/lib/install/webpack/webpack.config.js +1 -0
- data/lib/jsbundling/version.rb +1 -1
- data/lib/tasks/jsbundling/build.rake +4 -2
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3cd9756300244b2e031344a063f93d4e6ed124fc2cb324a6d70ee6e69385304f
|
4
|
+
data.tar.gz: 2618a978134e255ec4b69a6cefddeb593ba0c8dfba9d1e12fc37215b556968bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dbcf7c0772469872dfea9667f852a0dc64012b55896c3a8cef480a57ae49adbd7d8e001faee1b48c8b99de659e39e27c45e1b086470c4d7070fbec442735c8b8
|
7
|
+
data.tar.gz: 07d134a6c2b6765c83cac64b85314ceb91666ef6ca93c7d997c820e6c588f7085be61bbad3a0fae8c250be8cb29ed314dbf76890bb975b8b64b998b70fef7ebc
|
data/lib/install/dev
CHANGED
@@ -2,7 +2,7 @@ say "Install esbuild"
|
|
2
2
|
run "yarn add esbuild"
|
3
3
|
|
4
4
|
say "Add build script"
|
5
|
-
build_script = "esbuild app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds --public-path=/assets"
|
5
|
+
build_script = "esbuild app/javascript/*.* --bundle --sourcemap --format=esm --outdir=app/assets/builds --public-path=/assets"
|
6
6
|
|
7
7
|
case `npx -v`.to_f
|
8
8
|
when 7.1...8.0
|
data/lib/install/install.rb
CHANGED
@@ -14,10 +14,10 @@ end
|
|
14
14
|
if (app_layout_path = Rails.root.join("app/views/layouts/application.html.erb")).exist?
|
15
15
|
say "Add JavaScript include tag in application layout"
|
16
16
|
insert_into_file app_layout_path.to_s,
|
17
|
-
%(\n <%= javascript_include_tag "application", "data-turbo-track": "reload",
|
17
|
+
%(\n <%= javascript_include_tag "application", "data-turbo-track": "reload", type: "module" %>), before: /\s*<\/head>/
|
18
18
|
else
|
19
19
|
say "Default application.html.erb is missing!", :red
|
20
|
-
say %( Add <%= javascript_include_tag "application", "data-turbo-track": "reload",
|
20
|
+
say %( Add <%= javascript_include_tag "application", "data-turbo-track": "reload", type: "module" %> within the <head> tag in your custom layout.)
|
21
21
|
end
|
22
22
|
|
23
23
|
unless (app_js_entrypoint_path = Rails.root.join("app/javascript/application.js")).exist?
|
data/lib/jsbundling/version.rb
CHANGED
@@ -24,13 +24,15 @@ module Jsbundling
|
|
24
24
|
|
25
25
|
def install_command
|
26
26
|
return "bun install" if File.exist?('bun.lockb') || (tool_exists?('bun') && !File.exist?('yarn.lock'))
|
27
|
-
return "yarn install" if File.exist?('yarn.lock') || tool_exists?('yarn')
|
27
|
+
return "yarn install" if File.exist?('yarn.lock') || (tool_exists?('yarn') && !File.exist?('package-lock.json'))
|
28
|
+
return "npm install" if File.exist?('package-lock.json') || tool_exists?('npm')
|
28
29
|
raise "jsbundling-rails: No suitable tool found for installing JavaScript dependencies"
|
29
30
|
end
|
30
31
|
|
31
32
|
def build_command
|
32
33
|
return "bun run build" if File.exist?('bun.lockb') || (tool_exists?('bun') && !File.exist?('yarn.lock'))
|
33
|
-
return "yarn build" if File.exist?('yarn.lock') || tool_exists?('yarn')
|
34
|
+
return "yarn build" if File.exist?('yarn.lock') || (tool_exists?('yarn') && !File.exist?('package-lock.json'))
|
35
|
+
return "npm run build" if File.exist?('package-lock.json') || tool_exists?('npm')
|
34
36
|
raise "jsbundling-rails: No suitable tool found for building JavaScript"
|
35
37
|
end
|
36
38
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jsbundling-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -71,8 +71,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
71
71
|
- !ruby/object:Gem::Version
|
72
72
|
version: '0'
|
73
73
|
requirements: []
|
74
|
-
rubygems_version: 3.4.
|
74
|
+
rubygems_version: 3.4.14
|
75
75
|
signing_key:
|
76
76
|
specification_version: 4
|
77
|
-
summary: Bundle and transpile JavaScript in Rails with esbuild, rollup.js, or
|
77
|
+
summary: Bundle and transpile JavaScript in Rails with bun, esbuild, rollup.js, or
|
78
|
+
Webpack.
|
78
79
|
test_files: []
|