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 +4 -4
- data/CHANGELOG.md +8 -6
- data/lib/railpack/version.rb +1 -1
- data/test/railpack_test.rb +0 -86
- 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: 30e7e6b4dbbc67e8442766655424ad14dacc36f1e5a3cc6e58211ad6ba0f1442
|
|
4
|
+
data.tar.gz: af9393a87f9030d6da531c365d69cfb9c2e8bca4798b8889e8c4e6cb2c461f99
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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.
|
|
4
|
-
|
|
5
|
-
- Add
|
|
6
|
-
-
|
|
7
|
-
- Test
|
|
8
|
-
-
|
|
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
|
|
data/lib/railpack/version.rb
CHANGED
data/test/railpack_test.rb
CHANGED
|
@@ -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
|