railpack 1.2.1 → 1.2.3

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: 65190ba06f3b41df3783655f29f50d8bddfc9e3380698a0c76f4c29f5e1b4841
4
- data.tar.gz: e417b5906674f996132cdf84b92ee66cfad9c9e2d5e8b2917a2125dd5dc58965
3
+ metadata.gz: 269e75f35771ec905394623faa61366d3c7208ea4f21cb867c8a10dc733ff9cc
4
+ data.tar.gz: 925c4070f7f2888cc7e260cab0ff3617d1ac0151dfc190c6b9ccd1d7a4baf9bf
5
5
  SHA512:
6
- metadata.gz: fbec7a17d5c6dcb309fc30d5880206ec0507d771b5f08c01bbed97bdaf4a35ba0402da65956723c6824ce5087f973b84c8dc2accf736d292d692b22cd44aee81
7
- data.tar.gz: d064a8f46b8e517ee119ccb29ecbc13c9ab87f67291529dc5b3aae02a9cc6fe7a36b0652f604dbfb34ee7df813aef2e6a1987bff0348f130db9743b23cc29c04
6
+ metadata.gz: fa4ef98d5320a341ef6fb6c0d103ef83aee393b2efd346c132299c842046f17b885f1ea5da84e549dc91fc0de5d83fac00a20c3155000f6f0b4cbb9da9b018a6
7
+ data.tar.gz: bd4178182819778bbd1d7716a660030904099eee0af4c3f127d906afa1a0c4cd49590903ab7ca9690042c1addfa190943452a79e01395d828294f194d3794ef8
data/CHANGELOG.md CHANGED
@@ -1,5 +1,42 @@
1
1
  ## [Unreleased]
2
2
 
3
- ## [0.1.0] - 2026-01-26
3
+ ## [1.2.2] - 2026-01-26
4
4
 
5
- - Initial release
5
+ - Fix asset manifest generation for Propshaft compatibility
6
+ - Generate `.manifest.json` instead of Sprockets format
7
+ - Update manifest structure with `logical_path`, `pathname`, `digest`
8
+ - Rails 7+ Propshaft compatibility
9
+
10
+ ## [1.2.1] - 2026-01-26
11
+
12
+ - Add comprehensive build performance monitoring
13
+ - Implement Propshaft-compatible asset manifest generation
14
+ - Enhanced logging with emojis and structured output
15
+ - Production-ready defaults (no sourcemaps, bundle analysis off)
16
+ - Better error handling and user feedback
17
+
18
+ ## [1.2.0] - 2026-01-26
19
+
20
+ - Add Webpack bundler support
21
+ - Implement WebpackBundler class with full command support
22
+ - Register webpack in Manager::BUNDLERS
23
+ - Add webpack config defaults (mode, target)
24
+ - Update tests to include webpack bundler
25
+
26
+ ## [1.1.0] - 2026-01-26
27
+
28
+ - Add Rollup bundler support
29
+ - Implement RollupBundler class with tree-shaking capabilities
30
+ - Register rollup in Manager::BUNDLERS
31
+ - Add rollup config defaults (format, sourcemap)
32
+ - Update tests to include rollup bundler
33
+
34
+ ## [1.0.0] - 2026-01-26
35
+
36
+ - Initial release with Bun and esbuild support
37
+ - Unified API for multiple bundlers
38
+ - Rails asset pipeline integration
39
+ - Configuration system with YAML support
40
+ - Event hooks for build lifecycle
41
+ - Rake tasks for Rails integration
42
+ - Comprehensive test suite
data/README.md CHANGED
@@ -19,6 +19,14 @@ Add to your Gemfile:
19
19
  gem 'railpack'
20
20
  ```
21
21
 
22
+ Then run the install generator:
23
+
24
+ ```bash
25
+ rails railpack:install
26
+ ```
27
+
28
+ This creates `config/railpack.yml` with sensible defaults for your Rails app.
29
+
22
30
  ## Configuration
23
31
 
24
32
  Create `config/railpack.yml`:
@@ -179,6 +187,10 @@ BUNDLERS = {
179
187
  3. Update documentation
180
188
  4. Submit a PR
181
189
 
190
+ ## Changelog
191
+
192
+ See [CHANGELOG.md](CHANGELOG.md) for version history.
193
+
182
194
  ## License
183
195
 
184
196
  MIT License - see LICENSE.txt
@@ -130,23 +130,31 @@ module Railpack
130
130
 
131
131
  manifest = {}
132
132
 
133
- # Find built assets
133
+ # Find built assets - Propshaft format
134
134
  Dir.glob("#{outdir}/**/*.{js,css}").each do |file|
135
135
  next unless File.file?(file)
136
136
  relative_path = Pathname.new(file).relative_path_from(Pathname.new(outdir)).to_s
137
137
 
138
- # Map logical names to physical files
138
+ # Map logical names to physical files (Propshaft style)
139
139
  if relative_path.include?('application') && relative_path.end_with?('.js')
140
- manifest['application.js'] = relative_path
140
+ manifest['application.js'] = {
141
+ 'logical_path' => 'application.js',
142
+ 'pathname' => Pathname.new(relative_path),
143
+ 'digest' => Digest::MD5.file(file).hexdigest
144
+ }
141
145
  elsif relative_path.include?('application') && relative_path.end_with?('.css')
142
- manifest['application.css'] = relative_path
146
+ manifest['application.css'] = {
147
+ 'logical_path' => 'application.css',
148
+ 'pathname' => Pathname.new(relative_path),
149
+ 'digest' => Digest::MD5.file(file).hexdigest
150
+ }
143
151
  end
144
152
  end
145
153
 
146
- # Write manifest for Rails asset pipeline
147
- manifest_path = "#{outdir}/.sprockets-manifest-#{Digest::MD5.hexdigest(manifest.to_s)}.json"
154
+ # Write manifest for Propshaft (Rails 7+ default)
155
+ manifest_path = "#{outdir}/.manifest.json"
148
156
  File.write(manifest_path, JSON.pretty_generate(manifest))
149
- Railpack.logger.debug "📄 Generated asset manifest: #{manifest_path}"
157
+ Railpack.logger.debug "📄 Generated Propshaft manifest: #{manifest_path}"
150
158
  rescue => error
151
159
  Railpack.logger.warn "⚠️ Failed to generate asset manifest: #{error.message}"
152
160
  end
@@ -1,3 +1,3 @@
1
1
  module Railpack
2
- VERSION = "1.2.1"
2
+ VERSION = "1.2.3"
3
3
  end
@@ -5,6 +5,28 @@ require "railpack"
5
5
  Railpack::Manager.enhance("build", "copy_assets")
6
6
 
7
7
  namespace :railpack do
8
+ desc "Install and setup Railpack with default configuration"
9
+ task :install do
10
+ config_path = Rails.root.join("config/railpack.yml")
11
+
12
+ if config_path.exist?
13
+ puts "Railpack config already exists at #{config_path}"
14
+ puts "Run 'rails railpack:install:force' to overwrite"
15
+ else
16
+ create_config_file(config_path)
17
+ puts "✅ Created Railpack configuration at #{config_path}"
18
+ puts "🎯 Run 'rails railpack:install' to install bundler dependencies"
19
+ end
20
+ end
21
+
22
+ desc "Force install Railpack configuration (overwrites existing)"
23
+ task "install:force" do
24
+ config_path = Rails.root.join("config/railpack.yml")
25
+ create_config_file(config_path)
26
+ puts "✅ Created/Updated Railpack configuration at #{config_path}"
27
+ puts "🎯 Run 'rails railpack:install' to install bundler dependencies"
28
+ end
29
+
8
30
  desc "Install Railpack dependencies"
9
31
  task :install do
10
32
  Railpack.install!
@@ -67,4 +89,51 @@ namespace :railpack do
67
89
  task :bundler do
68
90
  puts "Current bundler: #{Railpack.config.bundler}"
69
91
  end
70
- end
92
+ end
93
+
94
+ def create_config_file(config_path)
95
+ config_content = <<~YAML
96
+ # Railpack Configuration
97
+ # Choose your bundler: bun, esbuild, rollup, webpack
98
+
99
+ bundler: bun # Default bundler
100
+
101
+ # Global defaults
102
+ default:
103
+ target: browser
104
+ format: esm
105
+ minify: false
106
+ sourcemap: false
107
+ entrypoint: "./app/javascript/application.js"
108
+ outdir: "app/assets/builds"
109
+
110
+ # Bundler-specific configurations
111
+ bun:
112
+ target: browser
113
+ format: esm
114
+
115
+ esbuild:
116
+ target: browser
117
+ format: esm
118
+ platform: browser
119
+
120
+ rollup:
121
+ format: esm
122
+ sourcemap: true
123
+
124
+ webpack:
125
+ mode: production
126
+ target: web
127
+
128
+ # Environment-specific overrides
129
+ development:
130
+ sourcemap: true
131
+
132
+ production:
133
+ minify: true
134
+ sourcemap: false
135
+ analyze_bundle: false
136
+ YAML
137
+
138
+ File.write(config_path, config_content)
139
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: railpack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - 21tycoons LLC