railpack 1.2.4 → 1.2.5
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/CHANGELOG.md +12 -4
- data/lib/railpack/version.rb +1 -1
- data/test/railpack_test.rb +49 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b13af1329c7192e2a8fd5c83eb0cc9ff07a0edec87b7311dedae0f26b4710975
|
|
4
|
+
data.tar.gz: 757f2eedf1421e59d9ae165f13a353918cdad3bad8cee83cdf0bc60078ede4d1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f14bb9cb2f37592089c517a4c8dcd16185bf9fa6d5029344031c58e9f54baa1cea24a0542bb8059f96acc59d54d0aec00b3c783f787ba5188743553b63864777
|
|
7
|
+
data.tar.gz: 17748f4d280fbfebefec259db9525daf4609285886a98a0027cd29a53a1c5a8aa0ff3007e05ffed4c96802a048d58cceae3ec2d056ab50f9c953f7d3e276ad40
|
data/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
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
|
|
9
|
+
|
|
3
10
|
## [1.2.4] - 2026-01-26
|
|
4
11
|
|
|
5
|
-
- Add comprehensive test suite (
|
|
6
|
-
- Test config system
|
|
7
|
-
- Test
|
|
8
|
-
- Test bundle size calculation
|
|
12
|
+
- Add comprehensive test suite (19 tests, 72 assertions)
|
|
13
|
+
- Test config system including YAML file loading from Rails.root
|
|
14
|
+
- Test bundler implementations, manager features, event hooks
|
|
15
|
+
- Test error handling, asset manifest generation, bundle size calculation
|
|
16
|
+
- Test Rails integration and environment overrides
|
|
9
17
|
- Add default logger with Logger.new($stdout)
|
|
10
18
|
- Fix logger nil issues in manager
|
|
11
19
|
|
data/lib/railpack/version.rb
CHANGED
data/test/railpack_test.rb
CHANGED
|
@@ -56,6 +56,55 @@ class RailpackTest < Minitest::Test
|
|
|
56
56
|
assert_equal './app/javascript/application.js', config.entrypoint
|
|
57
57
|
end
|
|
58
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
|
+
|
|
59
108
|
def test_config_environment_overrides
|
|
60
109
|
# Test environment override logic with default config
|
|
61
110
|
config = Railpack::Config.new
|