shakapacker 9.2.0 → 9.3.0.beta.1

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.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/.github/ISSUE_TEMPLATE/bug_report.md +6 -9
  3. data/.github/ISSUE_TEMPLATE/feature_request.md +6 -8
  4. data/.github/workflows/claude-code-review.yml +4 -5
  5. data/.github/workflows/claude.yml +1 -2
  6. data/.github/workflows/dummy.yml +4 -4
  7. data/.github/workflows/generator.yml +9 -9
  8. data/.github/workflows/node.yml +11 -2
  9. data/.github/workflows/ruby.yml +16 -16
  10. data/.github/workflows/test-bundlers.yml +9 -9
  11. data/.gitignore +4 -0
  12. data/CHANGELOG.md +74 -5
  13. data/CLAUDE.md +6 -1
  14. data/CONTRIBUTING.md +0 -1
  15. data/Gemfile.lock +1 -1
  16. data/README.md +14 -14
  17. data/TODO.md +10 -2
  18. data/TODO_v9.md +13 -3
  19. data/bin/export-bundler-config +1 -1
  20. data/conductor-setup.sh +1 -1
  21. data/conductor.json +1 -1
  22. data/docs/cdn_setup.md +13 -8
  23. data/docs/common-upgrades.md +2 -1
  24. data/docs/configuration.md +630 -0
  25. data/docs/css-modules-export-mode.md +120 -100
  26. data/docs/customizing_babel_config.md +16 -16
  27. data/docs/deployment.md +18 -0
  28. data/docs/developing_shakapacker.md +6 -0
  29. data/docs/optional-peer-dependencies.md +9 -4
  30. data/docs/peer-dependencies.md +17 -6
  31. data/docs/precompile_hook.md +342 -0
  32. data/docs/react.md +57 -47
  33. data/docs/releasing.md +0 -2
  34. data/docs/rspack.md +25 -21
  35. data/docs/rspack_migration_guide.md +335 -8
  36. data/docs/sprockets.md +1 -0
  37. data/docs/style_loader_vs_mini_css.md +12 -12
  38. data/docs/subresource_integrity.md +13 -7
  39. data/docs/transpiler-performance.md +40 -19
  40. data/docs/troubleshooting.md +141 -3
  41. data/docs/typescript-migration.md +48 -39
  42. data/docs/typescript.md +12 -8
  43. data/docs/using_esbuild_loader.md +10 -10
  44. data/docs/v6_upgrade.md +33 -20
  45. data/docs/v7_upgrade.md +8 -6
  46. data/docs/v8_upgrade.md +13 -12
  47. data/docs/v9_upgrade.md +2 -1
  48. data/eslint.config.fast.js +134 -0
  49. data/eslint.config.js +140 -0
  50. data/jest.config.js +8 -1
  51. data/knip.ts +54 -0
  52. data/lib/install/bin/export-bundler-config +1 -1
  53. data/lib/install/config/shakapacker.yml +16 -5
  54. data/lib/shakapacker/compiler.rb +80 -0
  55. data/lib/shakapacker/configuration.rb +33 -5
  56. data/lib/shakapacker/dev_server_runner.rb +140 -1
  57. data/lib/shakapacker/doctor.rb +294 -65
  58. data/lib/shakapacker/instance.rb +8 -3
  59. data/lib/shakapacker/runner.rb +244 -8
  60. data/lib/shakapacker/version.rb +1 -1
  61. data/lib/tasks/shakapacker/doctor.rake +42 -2
  62. data/package/babel/preset.ts +7 -4
  63. data/package/config.ts +42 -30
  64. data/package/configExporter/buildValidator.ts +883 -0
  65. data/package/configExporter/cli.ts +972 -210
  66. data/package/configExporter/configFile.ts +520 -0
  67. data/package/configExporter/fileWriter.ts +12 -8
  68. data/package/configExporter/index.ts +11 -1
  69. data/package/configExporter/types.ts +54 -2
  70. data/package/configExporter/yamlSerializer.ts +22 -8
  71. data/package/dev_server.ts +1 -1
  72. data/package/environments/__type-tests__/rspack-plugin-compatibility.ts +11 -5
  73. data/package/environments/base.ts +18 -13
  74. data/package/environments/development.ts +1 -1
  75. data/package/environments/production.ts +4 -1
  76. data/package/index.d.ts +50 -3
  77. data/package/index.d.ts.template +50 -0
  78. data/package/index.ts +7 -7
  79. data/package/loaders.d.ts +2 -2
  80. data/package/optimization/rspack.ts +1 -1
  81. data/package/plugins/rspack.ts +15 -4
  82. data/package/plugins/webpack.ts +7 -3
  83. data/package/rspack/index.ts +10 -2
  84. data/package/rules/raw.ts +3 -2
  85. data/package/rules/sass.ts +1 -1
  86. data/package/types/README.md +15 -13
  87. data/package/types/index.ts +5 -5
  88. data/package/types.ts +0 -1
  89. data/package/utils/defaultConfigPath.ts +4 -1
  90. data/package/utils/errorCodes.ts +129 -100
  91. data/package/utils/errorHelpers.ts +34 -29
  92. data/package/utils/getStyleRule.ts +5 -2
  93. data/package/utils/helpers.ts +21 -11
  94. data/package/utils/pathValidation.ts +43 -35
  95. data/package/utils/requireOrError.ts +1 -1
  96. data/package/utils/snakeToCamelCase.ts +1 -1
  97. data/package/utils/typeGuards.ts +132 -83
  98. data/package/utils/validateDependencies.ts +1 -1
  99. data/package/webpack-types.d.ts +3 -3
  100. data/package/webpackDevServerConfig.ts +22 -10
  101. data/package-lock.json +2 -2
  102. data/package.json +25 -16
  103. data/scripts/type-check-no-emit.js +1 -1
  104. data/test/configExporter/buildValidator.test.js +1292 -0
  105. data/test/configExporter/configFile.test.js +392 -0
  106. data/test/configExporter/integration.test.js +275 -0
  107. data/test/helpers.js +1 -1
  108. data/test/package/configExporter.test.js +154 -0
  109. data/test/package/environments/base.test.js +6 -3
  110. data/test/package/helpers.test.js +2 -2
  111. data/test/package/rules/babel.test.js +61 -51
  112. data/test/package/rules/esbuild.test.js +12 -3
  113. data/test/package/rules/file.test.js +3 -1
  114. data/test/package/rules/sass-version-parsing.test.js +71 -0
  115. data/test/package/rules/sass.test.js +11 -6
  116. data/test/package/rules/sass1.test.js +4 -5
  117. data/test/package/rules/sass16.test.js +24 -0
  118. data/test/package/rules/swc.test.js +48 -38
  119. data/tools/README.md +15 -5
  120. data/tsconfig.eslint.json +2 -9
  121. data/yarn.lock +1954 -1493
  122. metadata +22 -3
  123. data/.eslintignore +0 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5ac40ff5ddf8db373b1de0efaf805a033d7ba87641d84bde529669761b8e64d2
4
- data.tar.gz: 5d0abb49ede8ad2aa37c94e9148e4def579c3eabb8c6e8d94a127796941ed559
3
+ metadata.gz: c503694d35261163ce77ef2efb38c85b5365c7e0c817f06d0c3a9b7e9cd8ce0e
4
+ data.tar.gz: 6bea7b663bdb25fc2428bba429ec2f773a4298e91c2fdf2af9b8d0be5f089dd1
5
5
  SHA512:
6
- metadata.gz: 5309f5d9beef93aaa0434e0e8ab93118545ecad507ade518ab56a332980d804536e36762670d21245d67d6c60e126367b1ea4edd8e4766daf20c294871ea1263
7
- data.tar.gz: 4fb22afab6e203194018a1be9096aac472bffdbc08d58fc7a5b04a23c5e5d8c52084a17830d8ffb5156a6e4798de061f6f671474638616b7ffecd6c6348916f5
6
+ metadata.gz: dca52dbb54ea99fd8ad7b3e5cc9de4f0c5446a5c7a2f855032355d5b224fc91e74055784e92733ac6b41548e9676b4ed76c1bf8f4e88d024d6984ddae79f49dd
7
+ data.tar.gz: 702f88a69f5116ab0bc2bbfbff2d650cc5d542dd71a4716e4083e1ef79785a0a1a3eeb734924f1753ecafbe633a9bc21d29d86c60911caa6fe6e14acc4531d95
@@ -1,24 +1,21 @@
1
1
  ---
2
2
  name: Bug report
3
3
  about: Create a report for a crash or unexpected behavior.
4
- title: ''
4
+ title: ""
5
5
  labels: bug
6
- assignees: ''
7
-
6
+ assignees: ""
8
7
  ---
9
8
 
10
9
  _Notice: A bug is a crash or incorrect behavior. If you have a debugging or troubleshooting question, please open a discussion on the [Discussions Tab](https://github.com/shakacode/shakapacker/discussions). Otherwise, remove this line and fill out the following sections._
11
10
 
12
11
  ## Expected behavior:
13
12
 
14
-
15
13
  ## Actual behavior:
16
14
 
17
-
18
15
  ## Small, reproducible repo:
19
16
 
20
-
21
17
  ## Setup environment:
22
- - Ruby version:
23
- - Rails version:
24
- - Shakapacker version:
18
+
19
+ - Ruby version:
20
+ - Rails version:
21
+ - Shakapacker version:
@@ -1,21 +1,19 @@
1
1
  ---
2
2
  name: Feature request
3
3
  about: Create a request for new functionality
4
- title: ''
4
+ title: ""
5
5
  labels: enhancement
6
- assignees: ''
7
-
6
+ assignees: ""
8
7
  ---
9
8
 
10
9
  _Notice: A feature request describes a suggested improvement. If you have a debugging or troubleshooting question, please open a discussion on the [Discussions Tab](https://github.com/shakacode/shakapacker/discussions). Otherwise, remove this line and fill out the following sections._
11
10
 
12
11
  ## Desired behavior:
13
12
 
14
-
15
13
  ## Actual behavior:
16
14
 
17
-
18
15
  ## Setup environment:
19
- - Ruby version:
20
- - Rails version:
21
- - Shakapacker version:
16
+
17
+ - Ruby version:
18
+ - Rails version:
19
+ - Shakapacker version:
@@ -17,14 +17,14 @@ jobs:
17
17
  # github.event.pull_request.user.login == 'external-contributor' ||
18
18
  # github.event.pull_request.user.login == 'new-developer' ||
19
19
  # github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
20
-
20
+
21
21
  runs-on: ubuntu-latest
22
22
  permissions:
23
23
  contents: read
24
24
  pull-requests: read
25
25
  issues: read
26
26
  id-token: write
27
-
27
+
28
28
  steps:
29
29
  - name: Checkout repository
30
30
  uses: actions/checkout@v4
@@ -43,12 +43,11 @@ jobs:
43
43
  - Performance considerations
44
44
  - Security concerns
45
45
  - Test coverage
46
-
46
+
47
47
  Use the repository's CLAUDE.md for guidance on style and conventions. Be constructive and helpful in your feedback.
48
48
 
49
49
  Use `gh pr comment` with your Bash tool to leave your review as a comment on the PR.
50
-
50
+
51
51
  # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
52
52
  # or https://docs.claude.com/en/docs/claude-code/sdk#command-line for available options
53
53
  claude_args: '--model claude-sonnet-4-5-20250929 --allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"'
54
-
@@ -35,7 +35,7 @@ jobs:
35
35
  uses: anthropics/claude-code-action@v1
36
36
  with:
37
37
  claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
38
-
38
+
39
39
  # This is an optional setting that allows Claude to read CI results on PRs
40
40
  additional_permissions: |
41
41
  actions: read
@@ -47,4 +47,3 @@ jobs:
47
47
  # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
48
48
  # or https://docs.claude.com/en/docs/claude-code/sdk#command-line for available options
49
49
  # claude_args: '--model claude-opus-4-1-20250805 --allowed-tools Bash(gh pr:*)'
50
-
@@ -3,7 +3,7 @@ name: Dummy specs
3
3
  on:
4
4
  push:
5
5
  branches:
6
- - 'main'
6
+ - "main"
7
7
  pull_request:
8
8
 
9
9
  concurrency:
@@ -21,10 +21,10 @@ jobs:
21
21
  persist-credentials: false
22
22
  - uses: actions/setup-node@v4
23
23
  with:
24
- node-version: '20'
24
+ node-version: "20"
25
25
  - uses: ruby/setup-ruby@v1
26
26
  with:
27
- ruby-version: '3.2'
27
+ ruby-version: "3.2"
28
28
  rubygems: latest
29
29
  - name: Install dependencies
30
30
  run: |
@@ -32,7 +32,7 @@ jobs:
32
32
  yarn install --frozen-lockfile --production=false
33
33
  npm install -g yalc
34
34
  cd spec/dummy && npm install
35
-
35
+
36
36
  - name: Build TypeScript
37
37
  run: yarn build
38
38
 
@@ -3,7 +3,7 @@ name: Generator specs
3
3
  on:
4
4
  push:
5
5
  branches:
6
- - 'main'
6
+ - "main"
7
7
  pull_request:
8
8
 
9
9
  concurrency:
@@ -18,7 +18,7 @@ jobs:
18
18
  strategy:
19
19
  matrix:
20
20
  os: [ubuntu-latest]
21
- ruby: ['2.7', '3.0', '3.1', '3.2', '3.3', '3.4']
21
+ ruby: ["2.7", "3.0", "3.1", "3.2", "3.3", "3.4"]
22
22
  gemfile:
23
23
  - gemfiles/Gemfile-rails.7.0.x
24
24
  - gemfiles/Gemfile-rails.7.1.x
@@ -28,17 +28,17 @@ jobs:
28
28
  # upcomming Rails versions, maybe before a release.
29
29
  #- gemfiles/Gemfile-rails-edge
30
30
  exclude:
31
- - ruby: '2.7'
31
+ - ruby: "2.7"
32
32
  gemfile: gemfiles/Gemfile-rails.7.2.x
33
- - ruby: '2.7'
33
+ - ruby: "2.7"
34
34
  gemfile: gemfiles/Gemfile-rails.8.0.x
35
- - ruby: '3.0'
35
+ - ruby: "3.0"
36
36
  gemfile: gemfiles/Gemfile-rails.7.2.x
37
- - ruby: '3.0'
37
+ - ruby: "3.0"
38
38
  gemfile: gemfiles/Gemfile-rails.8.0.x
39
- - ruby: '3.1'
39
+ - ruby: "3.1"
40
40
  gemfile: gemfiles/Gemfile-rails.8.0.x
41
- - ruby: '3.4'
41
+ - ruby: "3.4"
42
42
  gemfile: gemfiles/Gemfile-rails.7.0.x
43
43
 
44
44
  env:
@@ -57,7 +57,7 @@ jobs:
57
57
  with:
58
58
  node-version: 20.x
59
59
  cache: yarn
60
-
60
+
61
61
  - name: Install Node dependencies
62
62
  run: yarn install --frozen-lockfile --production=false
63
63
 
@@ -3,7 +3,7 @@ name: Node based checks
3
3
  on:
4
4
  push:
5
5
  branches:
6
- - 'main'
6
+ - "main"
7
7
  pull_request:
8
8
 
9
9
  concurrency:
@@ -31,6 +31,15 @@ jobs:
31
31
  - name: Node eslint
32
32
  run: yarn lint
33
33
 
34
+ - name: Prettier format check
35
+ run: yarn prettier --check .
36
+
37
+ - name: Detect dead code
38
+ run: yarn knip
39
+
40
+ - name: Detect dead code in production
41
+ run: yarn knip:production
42
+
34
43
  type-check:
35
44
  name: TypeScript Type Checking
36
45
  runs-on: ubuntu-latest
@@ -54,7 +63,7 @@ jobs:
54
63
  strategy:
55
64
  matrix:
56
65
  os: [ubuntu-latest]
57
- node: [18.x, 20.x, 22.x]
66
+ node: [20.x, 22.x]
58
67
 
59
68
  runs-on: ${{ matrix.os }}
60
69
 
@@ -3,7 +3,7 @@ name: Ruby based checks
3
3
  on:
4
4
  push:
5
5
  branches:
6
- - 'main'
6
+ - "main"
7
7
  pull_request:
8
8
 
9
9
  concurrency:
@@ -23,7 +23,7 @@ jobs:
23
23
  run: rm -f Gemfile.lock
24
24
  - uses: ruby/setup-ruby@v1
25
25
  with:
26
- ruby-version: '3.4'
26
+ ruby-version: "3.4"
27
27
  rubygems: latest
28
28
  bundler-cache: true
29
29
 
@@ -36,7 +36,7 @@ jobs:
36
36
  strategy:
37
37
  matrix:
38
38
  os: [ubuntu-latest]
39
- ruby: ['2.7', '3.0', '3.1', '3.2', '3.3', '3.4']
39
+ ruby: ["2.7", "3.0", "3.1", "3.2", "3.3", "3.4"]
40
40
  gemfile:
41
41
  - gemfiles/Gemfile-rails.6.0.x
42
42
  - gemfiles/Gemfile-rails.6.1.x
@@ -48,29 +48,29 @@ jobs:
48
48
  # upcomming Rails versions, maybe before a release.
49
49
  #- gemfiles/Gemfile-rails-edge
50
50
  exclude:
51
- - ruby: '2.7'
51
+ - ruby: "2.7"
52
52
  gemfile: gemfiles/Gemfile-rails.7.2.x
53
- - ruby: '2.7'
53
+ - ruby: "2.7"
54
54
  gemfile: gemfiles/Gemfile-rails.8.0.x
55
- - ruby: '3.0'
55
+ - ruby: "3.0"
56
56
  gemfile: gemfiles/Gemfile-rails.7.2.x
57
- - ruby: '3.0'
57
+ - ruby: "3.0"
58
58
  gemfile: gemfiles/Gemfile-rails.8.0.x
59
- - ruby: '3.1'
59
+ - ruby: "3.1"
60
60
  gemfile: gemfiles/Gemfile-rails.6.0.x
61
- - ruby: '3.1'
61
+ - ruby: "3.1"
62
62
  gemfile: gemfiles/Gemfile-rails.8.0.x
63
- - ruby: '3.2'
63
+ - ruby: "3.2"
64
64
  gemfile: gemfiles/Gemfile-rails.6.0.x
65
- - ruby: '3.3'
65
+ - ruby: "3.3"
66
66
  gemfile: gemfiles/Gemfile-rails.6.0.x
67
- - ruby: '3.3'
67
+ - ruby: "3.3"
68
68
  gemfile: gemfiles/Gemfile-rails.6.1.x
69
- - ruby: '3.4'
69
+ - ruby: "3.4"
70
70
  gemfile: gemfiles/Gemfile-rails.6.0.x
71
- - ruby: '3.4'
71
+ - ruby: "3.4"
72
72
  gemfile: gemfiles/Gemfile-rails.6.1.x
73
- - ruby: '3.4'
73
+ - ruby: "3.4"
74
74
  gemfile: gemfiles/Gemfile-rails.7.0.x
75
75
 
76
76
  env:
@@ -85,7 +85,7 @@ jobs:
85
85
  ruby-version: ${{ matrix.ruby }}
86
86
  rubygems: latest
87
87
  bundler-cache: true
88
-
88
+
89
89
  - uses: actions/setup-node@v4
90
90
  with:
91
91
  node-version: 20.x
@@ -19,15 +19,15 @@ jobs:
19
19
  - name: Setup Ruby
20
20
  uses: ruby/setup-ruby@v1
21
21
  with:
22
- ruby-version: '3.2'
22
+ ruby-version: "3.2"
23
23
  bundler-cache: true
24
24
  working-directory: spec/dummy
25
25
 
26
26
  - name: Setup Node
27
27
  uses: actions/setup-node@v4
28
28
  with:
29
- node-version: '20'
30
- cache: 'yarn'
29
+ node-version: "20"
30
+ cache: "yarn"
31
31
  cache-dependency-path: spec/dummy/yarn.lock
32
32
 
33
33
  - name: Install yalc
@@ -72,15 +72,15 @@ jobs:
72
72
  - name: Setup Ruby
73
73
  uses: ruby/setup-ruby@v1
74
74
  with:
75
- ruby-version: '3.2'
75
+ ruby-version: "3.2"
76
76
  bundler-cache: true
77
77
  working-directory: spec/dummy
78
78
 
79
79
  - name: Setup Node
80
80
  uses: actions/setup-node@v4
81
81
  with:
82
- node-version: '20'
83
- cache: 'yarn'
82
+ node-version: "20"
83
+ cache: "yarn"
84
84
  cache-dependency-path: spec/dummy/yarn.lock
85
85
 
86
86
  - name: Install yalc
@@ -125,15 +125,15 @@ jobs:
125
125
  - name: Setup Ruby
126
126
  uses: ruby/setup-ruby@v1
127
127
  with:
128
- ruby-version: '3.2'
128
+ ruby-version: "3.2"
129
129
  bundler-cache: true
130
130
  working-directory: spec/dummy
131
131
 
132
132
  - name: Setup Node
133
133
  uses: actions/setup-node@v4
134
134
  with:
135
- node-version: '20'
136
- cache: 'yarn'
135
+ node-version: "20"
136
+ cache: "yarn"
137
137
  cache-dependency-path: spec/dummy/yarn.lock
138
138
 
139
139
  - name: Install yalc
data/.gitignore CHANGED
@@ -5,6 +5,7 @@
5
5
  node_modules
6
6
  .byebug_history
7
7
  /spec/test_app/tmp
8
+ /test/tmp
8
9
  yarn-debug.log*
9
10
  yarn-error.log*
10
11
  .yarn-integrity
@@ -16,6 +17,9 @@ gemfiles/*.lock
16
17
  .yalc
17
18
  yalc.lock
18
19
 
20
+ # npm pack tarballs
21
+ *.tgz
22
+
19
23
  # Config exporter output directory
20
24
  shakapacker-config-exports/
21
25
 
data/CHANGELOG.md CHANGED
@@ -11,7 +11,76 @@
11
11
 
12
12
  Changes since the last non-beta release.
13
13
 
14
- ## [v9.1.1] - October 9, 2025
14
+ ## [v9.3.0-beta.0] - October 13, 2025
15
+
16
+ ### Added
17
+
18
+ - **New `precompile_hook` configuration option** to run custom commands during asset precompilation. [PR #678](https://github.com/shakacode/shakapacker/pull/678) by [justin808](https://github.com/justin808).
19
+ - Allows executing custom scripts or tasks during the precompile process
20
+ - Configure in `shakapacker.yml` with `precompile_hook: "command to run"`
21
+ - **New `assets_bundler_config_path` configuration option** for custom bundler config locations. [PR #710](https://github.com/shakacode/shakapacker/pull/710) by [justin808](https://github.com/justin808).
22
+ - Allows specifying a custom path for webpack/rspack configuration files
23
+ - Useful for complex project structures or shared configurations
24
+ - **YAML output format support for `bin/export-bundler-config`**. [PR #704](https://github.com/shakacode/shakapacker/pull/704) by [justin808](https://github.com/justin808).
25
+ - New `--format yaml` option exports bundler configuration as YAML
26
+ - Easier to read than JSON for debugging and documentation
27
+ - **Custom help messages for `bin/shakapacker` commands**. [PR #702](https://github.com/shakacode/shakapacker/pull/702) by [justin808](https://github.com/justin808).
28
+ - Improved help output for better command discoverability
29
+ - Clear usage examples and option descriptions
30
+ - **HMR client config export in doctor mode**. [PR #701](https://github.com/shakacode/shakapacker/pull/701) by [justin808](https://github.com/justin808).
31
+ - `bin/export-bundler-config --doctor` now includes HMR client configuration
32
+ - Helps debug Hot Module Replacement issues
33
+ - **Build timing logs** for webpack and rspack. [PR #706](https://github.com/shakacode/shakapacker/pull/706) by [justin808](https://github.com/justin808).
34
+ - Shows duration of build operations
35
+ - Helps identify performance bottlenecks
36
+ - Added Knip for detecting dead code to CI. [PR #675](https://github.com/shakacode/shakapacker/pull/675) by [justin808](https://github.com/justin808).
37
+
38
+ ### Changed
39
+
40
+ - **Migrated to ESLint v9 with flat config format**. [PR #677](https://github.com/shakacode/shakapacker/pull/677) by [justin808](https://github.com/justin808).
41
+ - Updated all ESLint plugins to latest versions
42
+ - Uses new flat config format for better maintainability
43
+ - **Replaced custom argument parser with yargs**. [PR #692](https://github.com/shakacode/shakapacker/pull/692) by [justin808](https://github.com/justin808).
44
+ - More robust command-line argument parsing
45
+ - Better error messages and help output
46
+ - Replaced `require` with `import` in package/index.ts. [PR #674](https://github.com/shakacode/shakapacker/pull/674) by [justin808](https://github.com/justin808).
47
+ - Updated @rspack dependencies to 1.5.8. [PR #700](https://github.com/shakacode/shakapacker/pull/700) by [justin808](https://github.com/justin808).
48
+
49
+ ### Improved
50
+
51
+ - **Enhanced rspack migration documentation** with real-world lessons. [PR #713](https://github.com/shakacode/shakapacker/pull/713) by [justin808](https://github.com/justin808).
52
+ - Added practical migration guidance based on actual project experiences
53
+ - Common pitfalls and solutions documented
54
+ - **Consolidated duplicate configuration documentation**. [PR #714](https://github.com/shakacode/shakapacker/pull/714) by [justin808](https://github.com/justin808).
55
+ - Removed redundant documentation
56
+ - Single source of truth for configuration options
57
+ - **Improved error messages** to suggest `assets_bundler_config_path`. [PR #712](https://github.com/shakacode/shakapacker/pull/712) by [justin808](https://github.com/justin808).
58
+ - More helpful error messages when bundler config is not found
59
+ - Suggests using `assets_bundler_config_path` for custom locations
60
+ - **Improved doctor command output** clarity and accuracy. [PR #682](https://github.com/shakacode/shakapacker/pull/682) by [justin808](https://github.com/justin808).
61
+ - Better formatting and organization of diagnostic information
62
+ - More actionable recommendations
63
+ - Formatted all markdown files with prettier. [PR #673](https://github.com/shakacode/shakapacker/pull/673) by [justin808](https://github.com/justin808).
64
+
65
+ ### Fixed
66
+
67
+ - Fixed rspack native bindings installation issue when switching bundlers. [PR #672](https://github.com/shakacode/shakapacker/pull/672) by [justin808](https://github.com/justin808).
68
+ - Running `rake shakapacker:switch_bundler rspack -- --install-deps` now properly installs platform-specific native bindings
69
+ - Fixes "Cannot find native binding" error when switching to rspack
70
+ - Fixed Rails constant error when using custom environments like staging. [PR #681](https://github.com/shakacode/shakapacker/pull/681) by [justin808](https://github.com/justin808).
71
+ - `RAILS_ENV=staging` no longer causes "uninitialized constant Shakapacker::Instance::Rails" error
72
+ - Shakapacker now works in non-Rails contexts (like standalone runner)
73
+ - Fixed TypeScript type definitions to export proper types instead of `any`. [PR #684](https://github.com/shakacode/shakapacker/pull/684) by [justin808](https://github.com/justin808).
74
+ - Previously `package/index.d.ts` was exporting all types as `any`, breaking IDE autocomplete
75
+ - Now properly exports typed interfaces for `WebpackConfig`, `RspackConfig`, etc.
76
+ - Fixed integrity config handling and sass-loader version check. [PR #688](https://github.com/shakacode/shakapacker/pull/688) by [justin808](https://github.com/justin808).
77
+ - Properly handles subresource integrity configuration
78
+ - Correctly detects sass-loader version for conditional logic
79
+ - Prevented index.d.ts confusion in build process. [PR #698](https://github.com/shakacode/shakapacker/pull/698) by [justin808](https://github.com/justin808).
80
+ - TypeScript declaration files no longer interfere with build output
81
+ - Fixed yarn.lock formatting changes in Conductor setup. [PR #683](https://github.com/shakacode/shakapacker/pull/683) by [justin808](https://github.com/justin808).
82
+
83
+ ## [v9.2.0] - October 9, 2025
15
84
 
16
85
  ### Added
17
86
 
@@ -116,7 +185,6 @@ See the [v9 Upgrade Guide](https://github.com/shakacode/shakapacker/blob/main/do
116
185
  ### ⚠️ Breaking Changes
117
186
 
118
187
  1. **SWC is now the default JavaScript transpiler instead of Babel** ([PR 603](https://github.com/shakacode/shakapacker/pull/603) by [justin808](https://github.com/justin808))
119
-
120
188
  - Babel dependencies are no longer included as peer dependencies
121
189
  - Improves compilation speed by 20x
122
190
  - **Migration for existing projects:**
@@ -133,7 +201,6 @@ See the [v9 Upgrade Guide](https://github.com/shakacode/shakapacker/blob/main/do
133
201
  ```
134
202
 
135
203
  2. **CSS Modules now use named exports by default** ([PR 599](https://github.com/shakacode/shakapacker/pull/599))
136
-
137
204
  - **JavaScript:** Use named imports: `import { className } from './styles.module.css'`
138
205
  - **TypeScript:** Use namespace imports: `import * as styles from './styles.module.css'`
139
206
  - To keep the old behavior with default imports, see [CSS Modules Export Mode documentation](./docs/css-modules-export-mode.md) for configuration instructions
@@ -399,7 +466,6 @@ See the [v8 Upgrade Guide](https://github.com/shakacode/shakapacker/blob/main/do
399
466
 
400
467
  - Set `source_entry_path` to `packs` and `nested_entries` to `true` in`shakapacker.yml` [PR 284](https://github.com/shakacode/shakapacker/pull/284) by [ahangarha](https://github.com/ahangarha).
401
468
  - Dev server configuration is modified to follow [webpack recommended configurations](https://webpack.js.org/configuration/dev-server/) for dev server. [PR276](https://github.com/shakacode/shakapacker/pull/276) by [ahangarha](https://github.com/ahangarha):
402
-
403
469
  - Deprecated `https` entry is removed from the default configuration file, allowing to set `server` or `https` as per the project requirements. For more detail, check webpack documentation. The `https` entry can be effective only if there is no `server` entry in the config file.
404
470
  - `allowed_hosts` is now set to `auto` instead of `all` by default.
405
471
 
@@ -666,7 +732,10 @@ Note: [Rubygem is 6.3.0.pre.rc.1](https://rubygems.org/gems/shakapacker/versions
666
732
 
667
733
  See [CHANGELOG.md in rails/webpacker (up to v5.4.3)](https://github.com/rails/webpacker/blob/master/CHANGELOG.md)
668
734
 
669
- [Unreleased]: https://github.com/shakacode/shakapacker/compare/v9.0.0...main
735
+ [Unreleased]: https://github.com/shakacode/shakapacker/compare/v9.3.0-beta.0...main
736
+ [v9.3.0-beta.0]: https://github.com/shakacode/shakapacker/compare/v9.2.0...v9.3.0-beta.0
737
+ [v9.2.0]: https://github.com/shakacode/shakapacker/compare/v9.1.0...v9.2.0
738
+ [v9.1.0]: https://github.com/shakacode/shakapacker/compare/v9.0.0...v9.1.0
670
739
  [v9.0.0]: https://github.com/shakacode/shakapacker/compare/v8.4.0...v9.0.0
671
740
  [v8.4.0]: https://github.com/shakacode/shakapacker/compare/v8.3.0...v8.4.0
672
741
  [v8.3.0]: https://github.com/shakacode/shakapacker/compare/v8.2.0...v8.3.0
data/CLAUDE.md CHANGED
@@ -1,29 +1,34 @@
1
1
  # Shakapacker Project Guidelines
2
2
 
3
3
  ## Critical Requirements
4
+
4
5
  - **ALWAYS end all files with a trailing newline character.** This is required by the project's linting rules.
5
6
  - **ALWAYS use `bundle exec` prefix when running Ruby commands** (rubocop, rspec, rake, etc.)
6
7
  - **ALWAYS run `bundle exec rubocop` before committing Ruby changes**
7
8
  - **ALWAYS run `yarn lint` before committing JavaScript changes**
8
9
 
9
10
  ## Testing
11
+
10
12
  - Run corresponding RSpec tests when changing source files
11
13
  - For example, when changing `lib/shakapacker/foo.rb`, run `spec/shakapacker/foo_spec.rb`
12
14
  - Run the full test suite with `bundle exec rspec` before pushing
13
15
 
14
16
  ## Code Style
17
+
15
18
  - Follow existing code conventions in the file you're editing
16
19
  - Use the project's existing patterns and utilities
17
20
  - No unnecessary comments unless requested
18
21
  - Keep changes focused and minimal - avoid extraneous diffs
19
22
 
20
23
  ## Git Workflow
24
+
21
25
  - Create feature branches for all changes
22
26
  - Never push directly to main branch
23
27
  - Create small, focused PRs that are easy to review
24
28
  - Always create a PR immediately after pushing changes
25
29
 
26
30
  ## Shakapacker-Specific
31
+
27
32
  - This gem supports both webpack and rspack configurations
28
33
  - Test changes with both bundlers when modifying core functionality
29
- - Be aware of the dual package.json/Gemfile dependency management
34
+ - Be aware of the dual package.json/Gemfile dependency management
data/CONTRIBUTING.md CHANGED
@@ -72,7 +72,6 @@ yarn lint --cache
72
72
 
73
73
  1. Install [Yarn](https://classic.yarnpkg.com/)
74
74
  2. To test your changes on a Rails test project do the following steps:
75
-
76
75
  - For Ruby gem, update `Gemfile` and point the `shakapacker` to the locally developing Shakapacker project:
77
76
  ```ruby
78
77
  gem 'shakapacker', path: "relative_or_absolute_path_to_local_shakapacker"
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shakapacker (9.2.0)
4
+ shakapacker (9.3.0.beta.1)
5
5
  activesupport (>= 5.2)
6
6
  package_json
7
7
  rack-proxy (>= 0.6.1)
data/README.md CHANGED
@@ -70,6 +70,7 @@ Read the [full review here](https://clutch.co/profile/shakacode#reviews?sort_by=
70
70
  - [Concepts](#concepts)
71
71
  - [Usage](#usage)
72
72
  - [Configuration and Code](#configuration-and-code)
73
+ - [Configuration Guide](./docs/configuration.md)
73
74
  - [View Helpers](#view-helpers)
74
75
  - [View Helpers `javascript_pack_tag` and `stylesheet_pack_tag`](#view-helpers-javascript_pack_tag-and-stylesheet_pack_tag)
75
76
  - [View Helpers `append_javascript_pack_tag`, `prepend_javascript_pack_tag` and `append_stylesheet_pack_tag`](#view-helper-append_javascript_pack_tag-prepend_javascript_pack_tag-and-append_stylesheet_pack_tag)
@@ -314,6 +315,8 @@ At its core, Shakapacker's essential function is to:
314
315
 
315
316
  ### Configuration and Code
316
317
 
318
+ **📖 For a comprehensive guide to all configuration options, see [Configuration Guide](./docs/configuration.md)**
319
+
317
320
  You will need your file system to correspond to the setup of your `config/shakapacker.yml` file.
318
321
 
319
322
  Suppose you have the following configuration:
@@ -348,13 +351,20 @@ public/packs # webpack output
348
351
 
349
352
  Webpack intelligently includes only necessary files. In this example, the file `packs/application.js` would reference `../src/my_component.js`
350
353
 
351
- `nested_entries` allows you to have webpack entry points nested in subdirectories. This defaults to true as of shakapacker v7. With `nested_entries: false`, you can have your entire `source_path` used for your source (using the `source_entry_path: /`) and you place files at the top level that you want as entry points. `nested_entries: true` allows you to have entries that are in subdirectories. This is useful if you have entries that are generated, so you can have a `generated` subdirectory and easily separate generated files from the rest of your codebase.
354
+ The `nested_entries` option allows webpack entry points in subdirectories (defaults to `true`). See the [Configuration Guide](./docs/configuration.md#nested_entries) for details.
355
+
356
+ The `useContentHash` option enables content-based cache busting. It's disabled by default (except in production) to speed up development builds. See the [Configuration Guide](./docs/configuration.md#usecontenthash) for details.
357
+
358
+ #### Precompile Hook
359
+
360
+ Shakapacker supports running custom commands before compilation via the `precompile_hook` configuration option.
352
361
 
353
- To enable/disable the usage of contentHash in any node environment (specified using the `NODE_ENV` environment variable), add/modify `useContentHash` with a boolean value in `config/shakapacker.yml`. This feature is disabled for all environments except production by default. You may not disable the content hash for a `NODE_ENV` of production as that would break the browser caching of assets. Notice that despite the possibility of enabling this option for the development environment, [it is not recommended](https://webpack.js.org/guides/build-performance/#avoid-production-specific-tooling).
362
+ For configuration details, see [precompile_hook in the Configuration Guide](./docs/configuration.md#precompile_hook).
363
+ For complete usage guide, see the [Precompile Hook Guide](./docs/precompile_hook.md).
354
364
 
355
365
  #### Setting custom config path
356
366
 
357
- You can use the environment variable `SHAKAPACKER_CONFIG` to enforce a particular path to the config file rather than the default `config/shakapacker.yml`.
367
+ You can use the `SHAKAPACKER_CONFIG` environment variable to specify a custom config file path. See [Environment Variables in the Configuration Guide](./docs/configuration.md#environment-variables) for this and other configuration options.
358
368
 
359
369
  ### View Helpers
360
370
 
@@ -583,11 +593,7 @@ Shakapacker ships with two different strategies that are used to determine wheth
583
593
  - `digest` - This strategy calculates SHA1 digest of files in your watched paths (see below). The calculated digest is then stored in a temp file. To check whether the assets need to be recompiled, Shakapacker calculates the SHA1 of the watched files and compares it with the one stored. If the digests are equal, no recompilation occurs. If the digests are different or the temp file is missing, files are recompiled.
584
594
  - `mtime` - This strategy looks at the last "modified at" timestamps of both files AND directories in your watched paths. The timestamp of the most recent file or directory is then compared with the timestamp of `manifest.json` file generated. If the manifest file timestamp is newer than one of the most recently modified files or directories in the watched paths, no recompilation occurs. If the manifest file is older, files are recompiled.
585
595
 
586
- The `mtime` strategy is generally faster than the `digest` one, but it requires stable timestamps, this makes it perfect for a development environment, such as needing to rebuild bundles for tests, or if you're not changing frontend assets much.
587
-
588
- In production or CI environments, the `digest` strategy is more suitable, unless you are using incremental builds or caching and can guarantee that the timestamps will not change after e.g. cache restore. However, many production or CI environments will explicitly compile assets, so `compile: false` is more appropriate. Otherwise, you'll waste time either checking file timestamps or computing digests.
589
-
590
- You can control what strategy is used by the `compiler_strategy` option in `shakapacker.yml` config file. By default `mtime` strategy is used in development environment, `digest` is used elsewhere.
596
+ The `compiler_strategy` option determines how Shakapacker checks if assets need recompilation (`mtime` for development, `digest` for production). See the [Configuration Guide](./docs/configuration.md#compiler_strategy) for detailed comparison and recommendations.
591
597
 
592
598
  > [!NOTE]
593
599
  >
@@ -1241,12 +1247,6 @@ The following companies support our Open Source projects, and ShakaCode uses the
1241
1247
  <img alt="BrowserStack" src="https://user-images.githubusercontent.com/4244251/184881129-e1edf4b7-3ae1-4ea8-9e6d-3595cf01609e.png" height="55px">
1242
1248
  </picture>
1243
1249
  </a>
1244
- <a href="https://railsautoscale.com">
1245
- <img src="https://user-images.githubusercontent.com/4244251/184881144-95c2c25c-9879-4069-864d-4e67d6ed39d2.png" alt="Rails Autoscale" height="55px">
1246
- </a>
1247
1250
  <a href="https://www.honeybadger.io">
1248
1251
  <img src="https://user-images.githubusercontent.com/4244251/184881133-79ee9c3c-8165-4852-958e-31687b9536f4.png" alt="Honeybadger" height="55px">
1249
1252
  </a>
1250
- <a href="https://reviewable.io">
1251
- <img src="https://user-images.githubusercontent.com/20628911/230848305-c94510a4-82d7-468f-bf9f-eeb81d3f2ce0.png" alt="Reviewable" height="55px">
1252
- </a>