railpack 1.2.5 → 1.2.6

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: b13af1329c7192e2a8fd5c83eb0cc9ff07a0edec87b7311dedae0f26b4710975
4
- data.tar.gz: 757f2eedf1421e59d9ae165f13a353918cdad3bad8cee83cdf0bc60078ede4d1
3
+ metadata.gz: 30e7e6b4dbbc67e8442766655424ad14dacc36f1e5a3cc6e58211ad6ba0f1442
4
+ data.tar.gz: af9393a87f9030d6da531c365d69cfb9c2e8bca4798b8889e8c4e6cb2c461f99
5
5
  SHA512:
6
- metadata.gz: f14bb9cb2f37592089c517a4c8dcd16185bf9fa6d5029344031c58e9f54baa1cea24a0542bb8059f96acc59d54d0aec00b3c783f787ba5188743553b63864777
7
- data.tar.gz: 17748f4d280fbfebefec259db9525daf4609285886a98a0027cd29a53a1c5a8aa0ff3007e05ffed4c96802a048d58cceae3ec2d056ab50f9c953f7d3e276ad40
6
+ metadata.gz: 503ae2cfc7ac3372396c300dae41d921c06f776d8cf3b18debaf815719db1d86483907832fe849682bcc50fa39e24496f21db3fe352cc20a3180429e58e250e5
7
+ data.tar.gz: b818edd2afb5d9b1c6b608227aec6e93729eb2210c0dbc597124e68103e0ce049758081e08590e66cf674540d57a307d7f61dceabad61a2d571f50b89b1ee4f5
data/CHANGELOG.md CHANGED
@@ -1,11 +1,13 @@
1
1
  ## [Unreleased]
2
2
 
3
- ## [1.2.5] - 2026-01-26
4
-
5
- - Add test_config_yaml_file_loading test for YAML config file loading
6
- - Test that Railpack correctly reads config/railpack.yml from Rails.root
7
- - Test bundler selection, environment overrides, and config merging
8
- - All 19 tests passing with 72 assertions
3
+ ## [1.2.6] - 2026-01-26
4
+
5
+ - Add dedicated config_test.rb file for Config class unit tests
6
+ - Comprehensive Config class testing with 12 focused unit tests
7
+ - Test initialization, default values, build flags/args, environment overrides
8
+ - Test YAML file loading, error handling, and dynamic method access
9
+ - Improved test organization with separate test files per class
10
+ - All 24 tests passing with 86 assertions
9
11
 
10
12
  ## [1.2.4] - 2026-01-26
11
13
 
@@ -1,3 +1,3 @@
1
1
  module Railpack
2
- VERSION = "1.2.5"
2
+ VERSION = "1.2.6"
3
3
  end
@@ -49,93 +49,7 @@ class RailpackTest < Minitest::Test
49
49
  assert_equal Railpack::WebpackBundler, Railpack::Manager::BUNDLERS['webpack']
50
50
  end
51
51
 
52
- def test_config_loading_without_rails
53
- # Test config loading without Rails.root
54
- config = Railpack::Config.new
55
- assert_equal 'bun', config.bundler
56
- assert_equal './app/javascript/application.js', config.entrypoint
57
- end
58
-
59
- def test_config_yaml_file_loading
60
- # Test that Railpack can load config from a YAML file
61
- config_dir = File.join(@temp_dir, 'config')
62
- FileUtils.mkdir_p(config_dir)
63
- config_file = File.join(config_dir, 'railpack.yml')
64
-
65
- File.write(config_file, <<~YAML)
66
- default:
67
- bundler: rollup
68
- target: node
69
- format: cjs
70
- entrypoint: "./server.js"
71
- outdir: "dist"
72
- minify: false
73
- development:
74
- sourcemap: true
75
- production:
76
- minify: true
77
- sourcemap: false
78
- YAML
79
-
80
- # Verify the file was created
81
- assert File.exist?(config_file), "Config file should exist at #{config_file}"
82
-
83
- # Mock Rails.root to point to our temp directory
84
- mock_rails_root(@temp_dir)
85
-
86
- # Create a fresh config instance to test file loading
87
- config = Railpack::Config.new
88
-
89
-
90
-
91
- # Test that the YAML file was loaded correctly
92
- assert_equal 'rollup', config.bundler
93
- assert_equal './server.js', config.entrypoint
94
- assert_equal 'dist', config.outdir
95
- assert_equal 'node', config.target
96
- assert_equal 'cjs', config.format
97
- assert_equal false, config.minify
98
-
99
- # Test environment overrides
100
- dev_config = config.for_environment('development')
101
- prod_config = config.for_environment('production')
102
-
103
- assert_equal true, dev_config['sourcemap']
104
- assert_equal true, prod_config['minify']
105
- assert_equal false, prod_config['sourcemap']
106
- end
107
-
108
- def test_config_environment_overrides
109
- # Test environment override logic with default config
110
- config = Railpack::Config.new
111
- dev_config = config.for_environment('development')
112
- prod_config = config.for_environment('production')
113
-
114
- # Development should have sourcemap enabled by default
115
- assert_equal true, dev_config['sourcemap']
116
- # Production should have minify enabled by default
117
- assert_equal true, prod_config['minify']
118
- end
119
52
 
120
- def test_config_build_flags
121
- # Test build flags generation with default config
122
- config = Railpack::Config.new
123
- flags = config.build_flags
124
-
125
- assert_includes flags, '--target=browser'
126
- assert_includes flags, '--format=esm'
127
- end
128
-
129
- def test_config_build_args
130
- # Test build args generation with default config
131
- config = Railpack::Config.new
132
- args = config.build_args
133
-
134
- assert_includes args, './app/javascript/application.js'
135
- assert_includes args, '--outdir=app/assets/builds'
136
- assert_includes args, '--target=browser'
137
- assert_includes args, '--format=esm'
138
- end
139
53
 
140
54
  def test_manager_bundle_size_calculation
141
55
  # Create test output directory with fake assets
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.5
4
+ version: 1.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - 21tycoons LLC