shakapacker 9.0.0.beta.6 → 9.0.0.beta.8

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 (72) hide show
  1. checksums.yaml +4 -4
  2. data/.eslintrc.fast.js +40 -0
  3. data/.eslintrc.js +48 -0
  4. data/.github/workflows/generator.yml +6 -0
  5. data/.gitignore +1 -4
  6. data/.npmignore +56 -0
  7. data/CHANGELOG.md +64 -1
  8. data/CONTRIBUTING.md +75 -21
  9. data/Gemfile.lock +1 -1
  10. data/README.md +4 -0
  11. data/TODO.md +15 -16
  12. data/docs/transpiler-migration.md +191 -0
  13. data/docs/typescript-migration.md +378 -0
  14. data/lib/install/template.rb +54 -7
  15. data/lib/shakapacker/version.rb +1 -1
  16. data/package/.npmignore +4 -0
  17. data/package/babel/preset.ts +56 -0
  18. data/package/config.ts +23 -10
  19. data/package/env.ts +15 -2
  20. data/package/environments/{development.js → development.ts} +30 -8
  21. data/package/environments/{production.js → production.ts} +18 -4
  22. data/package/environments/test.ts +53 -0
  23. data/package/environments/types.ts +90 -0
  24. data/package/esbuild/index.ts +42 -0
  25. data/package/optimization/rspack.ts +36 -0
  26. data/package/optimization/{webpack.js → webpack.ts} +12 -4
  27. data/package/plugins/{rspack.js → rspack.ts} +20 -5
  28. data/package/plugins/{webpack.js → webpack.ts} +2 -2
  29. data/package/rspack/{index.js → index.ts} +17 -10
  30. data/package/rules/{babel.js → babel.ts} +1 -1
  31. data/package/rules/{coffee.js → coffee.ts} +1 -1
  32. data/package/rules/{css.js → css.ts} +1 -1
  33. data/package/rules/{erb.js → erb.ts} +1 -1
  34. data/package/rules/{esbuild.js → esbuild.ts} +2 -2
  35. data/package/rules/{file.js → file.ts} +11 -6
  36. data/package/rules/{jscommon.js → jscommon.ts} +4 -4
  37. data/package/rules/{less.js → less.ts} +3 -3
  38. data/package/rules/raw.ts +25 -0
  39. data/package/rules/{rspack.js → rspack.ts} +21 -11
  40. data/package/rules/{sass.js → sass.ts} +1 -1
  41. data/package/rules/{stylus.js → stylus.ts} +3 -7
  42. data/package/rules/{swc.js → swc.ts} +2 -2
  43. data/package/rules/{webpack.js → webpack.ts} +1 -1
  44. data/package/swc/index.ts +54 -0
  45. data/package/types/README.md +87 -0
  46. data/package/types/index.ts +60 -0
  47. data/package/utils/errorCodes.ts +219 -0
  48. data/package/utils/errorHelpers.ts +68 -2
  49. data/package/utils/pathValidation.ts +139 -0
  50. data/package/utils/typeGuards.ts +161 -47
  51. data/package.json +26 -4
  52. data/scripts/remove-use-strict.js +45 -0
  53. data/scripts/type-check-no-emit.js +27 -0
  54. data/test/package/rules/raw.test.js +40 -7
  55. data/test/package/rules/webpack.test.js +21 -2
  56. data/test/package/transpiler-defaults.test.js +127 -0
  57. data/test/scripts/remove-use-strict.test.js +125 -0
  58. data/test/typescript/build.test.js +3 -2
  59. data/test/typescript/environments.test.js +107 -0
  60. data/test/typescript/pathValidation.test.js +142 -0
  61. data/test/typescript/securityValidation.test.js +182 -0
  62. data/tsconfig.eslint.json +16 -0
  63. data/tsconfig.json +9 -10
  64. data/yarn.lock +415 -6
  65. metadata +50 -28
  66. data/package/babel/preset.js +0 -48
  67. data/package/environments/base.js +0 -103
  68. data/package/environments/test.js +0 -19
  69. data/package/esbuild/index.js +0 -40
  70. data/package/optimization/rspack.js +0 -29
  71. data/package/rules/raw.js +0 -15
  72. data/package/swc/index.js +0 -50
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 65a49f86249eeb2035e56d7f21da2d8e4edbe5a26da50b0a63a9534a720a84cf
4
- data.tar.gz: 153cb1df867355c881a3a7fe31b3aed526355ff30f7eaaacb497d231cb5f3bcc
3
+ metadata.gz: 6b968c57e16cafe6ddb6fb317b442db6b96682ee075498f3b8bc60f43f87d7bd
4
+ data.tar.gz: a3bf4f39a4c6b869e3301723423387577a78a0818403c1bb31efd42f9bc0ac7c
5
5
  SHA512:
6
- metadata.gz: c237ee4221a14f19ae86067632ad00baaf1f05d3464c21804b8aa3fa7029429bc8d678d630f1762f940ea780f4ff81023c26d26342aa27380a461f1485f50b3d
7
- data.tar.gz: b37633ed02a416c423bfb410b189b1ca7c508a162339e9def8401622c2ac198b4649ad0392795a9eb3301d6fc3d9858c2e39f1130b8c6bbd219887566126b91e
6
+ metadata.gz: ebfa33ceea921c0c66f9a9affb4eb1c736c981696d87523e4a55f82311e6779a28b3b9ca0b8b8a270fb00dbd04302be57928091f4b7c7b580ee66d2585c98f4f
7
+ data.tar.gz: 61a683b023eec46e7beb3a294db371b28ac1d8668744d7212ab938eb5a0a1fe53dba7763f5f9e90374ed329cb2f6ae07a232f3b0970e3bb4d504f4b79ea9eaeb
data/.eslintrc.fast.js ADDED
@@ -0,0 +1,40 @@
1
+ // Fast ESLint config for quick development feedback
2
+ // Skips type-aware rules that require TypeScript compilation
3
+
4
+ const baseConfig = require("./.eslintrc.js")
5
+
6
+ module.exports = {
7
+ ...baseConfig,
8
+ overrides: [
9
+ ...baseConfig.overrides.filter((o) => !o.files.includes("**/*.{ts,tsx}")),
10
+ {
11
+ files: ["**/*.{ts,tsx}"],
12
+ parser: "@typescript-eslint/parser",
13
+ parserOptions: {
14
+ // No project specified - disables type-aware linting
15
+ ecmaVersion: 2020,
16
+ sourceType: "module"
17
+ },
18
+ extends: [
19
+ "plugin:@typescript-eslint/recommended",
20
+ // Skip the "recommended-requiring-type-checking" preset
21
+ "plugin:prettier/recommended"
22
+ ],
23
+ plugins: ["@typescript-eslint"],
24
+ rules: {
25
+ // Same rules as main config minus type-aware ones
26
+ "import/no-unresolved": "off",
27
+ "import/no-extraneous-dependencies": "off",
28
+ "import/extensions": "off",
29
+ "no-use-before-define": "off",
30
+ "@typescript-eslint/no-use-before-define": ["error"],
31
+ "@typescript-eslint/no-unused-vars": [
32
+ "error",
33
+ { argsIgnorePattern: "^_" }
34
+ ],
35
+ "@typescript-eslint/no-explicit-any": "error",
36
+ "@typescript-eslint/explicit-module-boundary-types": "off"
37
+ }
38
+ }
39
+ ]
40
+ }
data/.eslintrc.js CHANGED
@@ -1,11 +1,22 @@
1
1
  module.exports = {
2
+ root: true, // Prevent ESLint from looking in parent directories
2
3
  extends: ["airbnb", "plugin:prettier/recommended"],
3
4
  rules: {
5
+ // Webpack handles module resolution, not ESLint
4
6
  "import/no-unresolved": "off",
7
+ // Allow importing devDependencies in config/test files
5
8
  "import/no-extraneous-dependencies": "off",
9
+ // TypeScript handles extensions, not needed for JS imports
6
10
  "import/extensions": "off",
7
11
  indent: ["error", 2]
8
12
  },
13
+ settings: {
14
+ react: {
15
+ // Suppress "react package not installed" warning
16
+ // This project doesn't use React but airbnb config requires react-plugin
17
+ version: "999.999.999"
18
+ }
19
+ },
9
20
  env: {
10
21
  browser: true,
11
22
  node: true
@@ -31,6 +42,43 @@ module.exports = {
31
42
  "jest/prefer-strict-equal": "error",
32
43
  "jest/prefer-todo": "error"
33
44
  }
45
+ },
46
+ {
47
+ files: ["**/*.{ts,tsx}"],
48
+ parser: "@typescript-eslint/parser",
49
+ parserOptions: {
50
+ // Enables type-aware linting for better type safety
51
+ // Note: This can slow down linting on large codebases
52
+ // Consider using --cache flag with ESLint if performance degrades
53
+ project: "./tsconfig.eslint.json",
54
+ tsconfigRootDir: __dirname
55
+ },
56
+ extends: [
57
+ "plugin:@typescript-eslint/recommended",
58
+ "plugin:@typescript-eslint/recommended-requiring-type-checking",
59
+ "plugin:prettier/recommended"
60
+ ],
61
+ plugins: ["@typescript-eslint"],
62
+ rules: {
63
+ // TypeScript compiler handles module resolution
64
+ "import/no-unresolved": "off",
65
+ // Allow importing devDependencies in TypeScript files
66
+ "import/no-extraneous-dependencies": "off",
67
+ // TypeScript handles file extensions via moduleResolution
68
+ "import/extensions": "off",
69
+ // Disable base rule in favor of TypeScript version
70
+ "no-use-before-define": "off",
71
+ "@typescript-eslint/no-use-before-define": ["error"],
72
+ // Allow unused vars if they start with underscore (convention for ignored params)
73
+ "@typescript-eslint/no-unused-vars": [
74
+ "error",
75
+ { argsIgnorePattern: "^_" }
76
+ ],
77
+ // Strict: no 'any' types allowed - use 'unknown' or specific types instead
78
+ "@typescript-eslint/no-explicit-any": "error",
79
+ // Allow implicit return types - TypeScript can infer them
80
+ "@typescript-eslint/explicit-module-boundary-types": "off"
81
+ }
34
82
  }
35
83
  ]
36
84
  }
@@ -64,4 +64,10 @@ jobs:
64
64
  - name: Build TypeScript
65
65
  run: yarn build
66
66
 
67
+ - name: Pack npm package for testing
68
+ run: |
69
+ TARBALL=$(npm pack)
70
+ echo "SHAKAPACKER_NPM_PACKAGE=$(pwd)/$TARBALL" >> $GITHUB_ENV
71
+ echo "Created package: $TARBALL"
72
+
67
73
  - run: bundle exec rake run_spec:generator
data/.gitignore CHANGED
@@ -11,6 +11,7 @@ yarn-error.log*
11
11
  /log
12
12
  gemfiles/*.lock
13
13
  .DS_Store
14
+ .eslintcache
14
15
 
15
16
  .yalc
16
17
  yalc.lock
@@ -25,12 +26,8 @@ package/**/*.js
25
26
  !package/index.d.ts
26
27
  !package/loaders.d.ts
27
28
  !package/webpack-types.d.ts
28
- !package/babel/preset.js
29
29
  !package/babel/preset-react.js
30
- !package/environments/*.js
31
- !package/rules/*.js
32
30
  !package/loaders/*.js
33
- !package/plugins/*.js
34
31
  !package/__mocks__/*.js
35
32
  !package/utils/get_style_rule.js
36
33
  !package/utils/node_modules.js
data/.npmignore ADDED
@@ -0,0 +1,56 @@
1
+ # .npmignore
2
+ # This file controls what gets published to npm
3
+ # It overrides .gitignore for npm publishing
4
+
5
+ # Exclude development and test files
6
+ /.bundle
7
+ /pkg
8
+ /spec
9
+ /test
10
+ /gemfiles
11
+ /.github
12
+ /.circleci
13
+ /.husky
14
+ /.byebug_history
15
+ .DS_Store
16
+ yarn-debug.log*
17
+ yarn-error.log*
18
+ .yarn-integrity
19
+ .yalc
20
+ yalc.lock
21
+ .yalcignore
22
+
23
+ # Exclude Ruby files not needed for npm package
24
+ Gemfile
25
+ Gemfile.lock
26
+ Rakefile
27
+ *.gemspec
28
+ .rubocop.yml
29
+ .ruby-version
30
+
31
+ # Exclude TypeScript config
32
+ tsconfig.json
33
+
34
+ # Exclude source maps (optional - remove these lines to include source maps)
35
+ *.js.map
36
+ *.d.ts.map
37
+
38
+ # Exclude git and editor files
39
+ .git
40
+ .gitignore
41
+ .gitattributes
42
+ .editorconfig
43
+ .vscode
44
+ .idea
45
+
46
+ # Exclude CI/CD files
47
+ .travis.yml
48
+ appveyor.yml
49
+
50
+ # Exclude documentation source files (keep compiled docs if any)
51
+ docs/
52
+
53
+ # CRITICAL: Exclude TypeScript source files (must be at the end)
54
+ # Only include compiled .js and .d.ts files
55
+ *.ts
56
+ !*.d.ts
data/CHANGELOG.md CHANGED
@@ -9,7 +9,70 @@
9
9
  ## [Unreleased]
10
10
  Changes since the last non-beta release.
11
11
 
12
- ## [v9.0.0-beta.4] - Unreleased
12
+ ### Added
13
+ - **Phase 5 TypeScript Migration - Framework-Specific Modules** by [justin808](https://github.com/justin808)
14
+ - Converted framework-specific modules to TypeScript
15
+ - Migrated package/rspack/index.js to TypeScript
16
+ - Migrated package/swc/index.js to TypeScript
17
+ - Migrated package/esbuild/index.js to TypeScript
18
+ - Migrated package/babel/preset.js to TypeScript
19
+ - Added @types/babel__core for enhanced type safety
20
+ - All 130 tests passing
21
+ - **Phase 6 TypeScript Migration - Final Cleanup** (by [justin808](https://github.com/justin808))
22
+ - Added TypeScript ESLint support with @typescript-eslint/parser and @typescript-eslint/eslint-plugin
23
+ - Configured TypeScript-specific linting rules for improved code quality
24
+ - Verified strict mode is enabled in TypeScript configuration
25
+ - Enhanced developer experience with TypeScript linting across the entire codebase
26
+
27
+ ## [v9.0.0-beta.7] - October 1, 2025
28
+
29
+ ### Added
30
+ - **Phase 2 TypeScript Migration - Core Modules** ([PR 608](https://github.com/shakacode/shakapacker/pull/608) by [justin808](https://github.com/justin808))
31
+ - Converted core modules to TypeScript: config.ts, env.ts, and utilities
32
+ - Enhanced type safety across the codebase
33
+ - Better IDE support and autocomplete
34
+ - **Phase 3 TypeScript Migration - Environment Files** ([PR 614](https://github.com/shakacode/shakapacker/pull/614) by [justin808](https://github.com/justin808))
35
+ - Converted all environment configuration files to TypeScript (development, production, test)
36
+ - Added centralized type exports for consumer use (import from "shakapacker/types")
37
+ - Created shared TypeScript interfaces for environment configurations
38
+ - Introduced structured error codes for programmatic error handling
39
+ - Exported shared types: WebpackConfig, RspackConfig, EnvironmentConfig
40
+ - **Optional Peer Dependencies** ([PR 615](https://github.com/shakacode/shakapacker/pull/615) by [justin808](https://github.com/justin808))
41
+ - Restored peer dependencies as optional to improve package version tracking
42
+ - Added peerDependenciesMeta marking all peers as optional
43
+ - Moved webpack-merge to direct dependencies (required at runtime)
44
+ - Prevents installation warnings while maintaining upgrade visibility
45
+ - **Migration Tooling Improvements** ([PR 613](https://github.com/shakacode/shakapacker/pull/613) by [justin808](https://github.com/justin808))
46
+ - Added SWC migration helper: rake shakapacker:migrate:to_swc
47
+ - Enhanced error messages for missing dependencies
48
+ - Improved doctor command output
49
+
50
+ ### Security
51
+ - **Path Validation Utilities** ([PR 614](https://github.com/shakacode/shakapacker/pull/614) by [justin808](https://github.com/justin808))
52
+ - Added validation to prevent directory traversal attacks
53
+ - Implemented environment variable sanitization to prevent injection
54
+ - Enforced strict port validation (reject strings with non-digits)
55
+ - Added SHAKAPACKER_NPM_PACKAGE path validation (only .tgz/.tar.gz allowed)
56
+ - Path traversal security checks now run regardless of validation mode
57
+
58
+ ### Changed
59
+ - **Build Process Improvements** ([PR 614](https://github.com/shakacode/shakapacker/pull/614) by [justin808](https://github.com/justin808))
60
+ - Environment JS files now generated during npm publish (not committed to git)
61
+ - Prevents TypeScript source and compiled JS from getting out of sync
62
+ - Auto-format compiled JavaScript during build process
63
+ - Enhanced .npmignore to exclude TypeScript sources, include compiled JS
64
+
65
+ ### Performance
66
+ - **Validation Caching** ([PR 614](https://github.com/shakacode/shakapacker/pull/614) by [justin808](https://github.com/justin808))
67
+ - Implemented TTL-based validation caching (5s watch, 1min dev, infinite prod)
68
+ - Made cache TTL configurable via SHAKAPACKER_CACHE_TTL environment variable
69
+ - Lazy-loaded and cached watch mode detection
70
+
71
+ ### Fixed
72
+ - Fixed clearValidationCache() to actually clear the cache ([PR 614](https://github.com/shakacode/shakapacker/pull/614) by [justin808](https://github.com/justin808))
73
+ - Fixed private_output_path configuration edge cases ([PR 604](https://github.com/shakacode/shakapacker/pull/604) by [justin808](https://github.com/justin808))
74
+
75
+ ## [v9.0.0-beta.4] - September 15, 2025
13
76
 
14
77
  ### ⚠️ Breaking Changes
15
78
 
data/CONTRIBUTING.md CHANGED
@@ -3,6 +3,7 @@
3
3
  Thank you for your interest in contributing to Shakapacker! We welcome all contributions that align with our project goals and values. To ensure a smooth and productive collaboration, please follow these guidelines.
4
4
 
5
5
  ## Contents
6
+
6
7
  - [Reporting Issues](#reporting-issues)
7
8
  - [Submitting Pull Requests](#submitting-pull-requests)
8
9
  - [Setting Up a Development Environment](#setting-up-a-development-environment)
@@ -10,44 +11,89 @@ Thank you for your interest in contributing to Shakapacker! We welcome all contr
10
11
  - [Testing the generator](#testing-the-generator)
11
12
 
12
13
  ## Reporting Issues
14
+
13
15
  If you encounter any issues with the project, please first check the existing issues (including closed ones). If the issues is not reported before, please opening an issue on our GitHub repository. Please provide a clear and detailed description of the issue, including steps to reproduce it. Creating a demo repository to demonstrate the issue would be ideal (and in some cases necessary).
14
16
 
15
17
  If looking to contribute to the project by fixing existing issues, we recommend looking at issues, particularly with the "[help wanted](https://github.com/shakacode/shakapacker/issues?q=is%3Aissue+label%3A%22help+wanted%22)" label.
16
18
 
17
19
  ## Submitting Pull Requests
20
+
18
21
  We welcome pull requests that fix bugs, add new features, or improve existing ones. Before submitting a pull request, please make sure to:
19
22
 
20
- - Open an issue about what you want to propose before start working on.
21
- - Fork the repository and create a new branch for your changes.
22
- - Write clear and concise commit messages.
23
- - Follow our code style guidelines.
24
- - Write tests for your changes and [make sure all tests pass](#making-sure-your-changes-pass-all-tests).
25
- - Update the documentation as needed.
26
- - Update CHANGELOG.md if the changes affect public behavior of the project.
23
+ - Open an issue about what you want to propose before start working on.
24
+ - Fork the repository and create a new branch for your changes.
25
+ - Write clear and concise commit messages.
26
+ - Follow our code style guidelines.
27
+ - Write tests for your changes and [make sure all tests pass](#making-sure-your-changes-pass-all-tests).
28
+ - Update the documentation as needed.
29
+ - Update CHANGELOG.md if the changes affect public behavior of the project.
27
30
 
28
31
  ---
32
+
33
+ ## Git Hooks (Optional)
34
+
35
+ This project includes configuration for git hooks via `husky` and `lint-staged`, but they are **opt-in for contributors**.
36
+
37
+ **Why are hooks optional?** As a library project, we don't enforce git hooks because:
38
+
39
+ - Different contributors may have different workflows
40
+ - Forcing hooks can interfere with contributor tooling
41
+ - CI/CD handles the final validation
42
+
43
+ To enable pre-commit hooks locally:
44
+
45
+ ```bash
46
+ npx husky install
47
+ npx husky add .husky/pre-commit "npx lint-staged"
48
+ ```
49
+
50
+ ---
51
+
52
+ ## Linting and Code Quality
53
+
54
+ ### Running Linters
55
+
56
+ ```bash
57
+ # Full linting with type checking (slower but thorough)
58
+ yarn lint
59
+
60
+ # Fast linting without type checking (for quick feedback)
61
+ yarn lint:fast
62
+
63
+ # With caching for better performance
64
+ yarn lint --cache
65
+ ```
66
+
67
+ **Performance Note:** TypeScript ESLint uses type-aware linting for better type safety, which can be slower on large codebases. Use `yarn lint:fast` during development for quick feedback.
68
+
69
+ ---
70
+
29
71
  ## Setting Up a Development Environment
30
72
 
31
73
  1. Install [Yarn](https://classic.yarnpkg.com/)
32
74
  2. To test your changes on a Rails test project do the following steps:
75
+
33
76
  - For Ruby gem, update `Gemfile` and point the `shakapacker` to the locally developing Shakapacker project:
34
- ```ruby
35
- gem 'shakapacker', path: "relative_or_absolute_path_to_local_shakapacker"
36
- ```
77
+ ```ruby
78
+ gem 'shakapacker', path: "relative_or_absolute_path_to_local_shakapacker"
79
+ ```
37
80
  - For npm package, use `yalc` with following steps:
38
- ```bash
39
- # In Shakapacker root directory
40
- yalc publish
41
- # In Rails app for testing
42
- yalc link shakapacker
43
-
44
- # After every change in shakapacker, run the following in Shakapacker directory
45
- yalc push # or yalc publish --push
46
- ```
81
+
82
+ ```bash
83
+ # In Shakapacker root directory
84
+ yalc publish
85
+ # In Rails app for testing
86
+ yalc link shakapacker
87
+
88
+ # After every change in shakapacker, run the following in Shakapacker directory
89
+ yalc push # or yalc publish --push
90
+ ```
91
+
47
92
  3. Run the following commands to set up the development environment.
48
93
  ```
49
94
  bundle install
50
95
  yarn install
96
+ yarn prepare:husky # Set up pre-commit hooks for linting
51
97
  ```
52
98
 
53
99
  ## Understanding Optional Peer Dependencies
@@ -59,11 +105,13 @@ Shakapacker uses optional peer dependencies (via `peerDependenciesMeta`) for max
59
105
  - **Version constraints still apply** - When a package is installed, version compatibility is enforced
60
106
 
61
107
  ### When modifying dependencies:
108
+
62
109
  1. Add new peer dependencies to both `peerDependencies` and `peerDependenciesMeta` (marking as optional)
63
110
  2. Keep version ranges synchronized between `devDependencies` and `peerDependencies`
64
111
  3. Test with multiple package managers: `npm`, `yarn`, and `pnpm`
65
112
 
66
113
  ### Testing peer dependency changes:
114
+
67
115
  ```bash
68
116
  # Test with npm (no warnings expected)
69
117
  cd /tmp && mkdir test-npm && cd test-npm
@@ -129,6 +177,7 @@ bundle exec rake run_spec:gem
129
177
  ```
130
178
 
131
179
  #### 4.4 Run only Shakapacker gem specs for backward compatibility
180
+
132
181
  These specs are to check Shakapacker v7 backward compatibility with v6.x
133
182
 
134
183
  ```
@@ -136,6 +185,7 @@ bundle exec rake run_spec:gem_bc
136
185
  ```
137
186
 
138
187
  #### 4.5 Run dummy app test
188
+
139
189
  For this, you need `yalc` to be installed on your local machine
140
190
 
141
191
  ```
@@ -143,6 +193,7 @@ bundle exec rake run_spec:dummy
143
193
  ```
144
194
 
145
195
  #### 4.6 Testing the installer
196
+
146
197
  To ensure that your installer works as expected, either you can run `bundle exec rake run_spec:install`, or take the following manual testing steps:
147
198
 
148
199
  1. Update the `Gemfile` so that gem `shakapacker` has a line like this, pointing to your developing Shakapacker:
@@ -152,7 +203,7 @@ To ensure that your installer works as expected, either you can run `bundle exec
152
203
  2. Run `bundle install` to install the updated gem.
153
204
  3. Run `bundle exec rails shakapacker:install` to confirm that you got the right changes.
154
205
 
155
- **Note:** Ensure that you use bundle exec otherwise the installed shakapacker gem will run and not the one you are working on.
206
+ **Note:** Ensure that you use bundle exec otherwise the installed shakapacker gem will run and not the one you are working on.
156
207
 
157
208
  ## CI Workflows
158
209
 
@@ -161,6 +212,7 @@ Shakapacker uses GitHub Actions for continuous integration. The CI workflows use
161
212
  ### Package Manager Choice
162
213
 
163
214
  The project uses Yarn in CI workflows for the following reasons:
215
+
164
216
  - Deterministic dependency resolution with `yarn.lock`
165
217
  - Faster installation with offline mirror support
166
218
  - Better workspace support for monorepo-style testing
@@ -174,14 +226,16 @@ The project uses Yarn in CI workflows for the following reasons:
174
226
  - `.github/workflows/generator.yml` - Generator installation tests
175
227
 
176
228
  All workflows use:
229
+
177
230
  ```yaml
178
231
  - uses: actions/setup-node@v4
179
232
  with:
180
- cache: 'yarn'
233
+ cache: "yarn"
181
234
  cache-dependency-path: spec/dummy/yarn.lock
182
235
  ```
183
236
 
184
237
  And install dependencies with:
238
+
185
239
  ```bash
186
240
  yarn install
187
241
  ```
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shakapacker (9.0.0.beta.6)
4
+ shakapacker (9.0.0.beta.8)
5
5
  activesupport (>= 5.2)
6
6
  package_json
7
7
  rack-proxy (>= 0.6.1)
data/README.md CHANGED
@@ -722,6 +722,10 @@ You can try out experimental integration with the esbuild-loader. You can read m
722
722
 
723
723
  Please note that if you want opt-in to use esbuild-loader, you can skip [React](#react) integration instructions as it is supported out of the box.
724
724
 
725
+ ### Switching between transpilers
726
+
727
+ To switch between Babel, SWC, or esbuild, or to configure environment-specific transpiler settings, see the [Transpiler Migration Guide](./docs/transpiler-migration.md).
728
+
725
729
  ### Integrations
726
730
 
727
731
  Shakapacker out of the box supports JS and static assets (fonts, images etc.) compilation. To enable support for CoffeeScript or TypeScript install relevant packages:
data/TODO.md CHANGED
@@ -22,22 +22,21 @@
22
22
  - [ ] Convert dev_server.js
23
23
  - [ ] Convert webpackDevServerConfig.js
24
24
 
25
- ### Phase 4: Rules & Loaders
26
- - [ ] Convert all files in `package/rules/`
27
- - [ ] Convert all files in `package/plugins/`
28
- - [ ] Convert all files in `package/optimization/`
29
-
30
- ### Phase 5: Framework-Specific Modules
31
- - [ ] Convert rspack support files
32
- - [ ] Convert swc support files
33
- - [ ] Convert esbuild support files
34
- - [ ] Convert babel preset
35
-
36
- ### Phase 6: Final Cleanup
37
- - [ ] Convert remaining utilities
38
- - [ ] Add TypeScript linting
39
- - [ ] Enable strict mode
40
- - [ ] Update documentation
25
+ ### Phase 4: Rules & Loaders (PR #620) ✅
26
+ - [x] Convert all files in `package/rules/`
27
+ - [x] Convert all files in `package/plugins/`
28
+ - [x] Convert all files in `package/optimization/`
29
+
30
+ ### Phase 5: Framework-Specific Modules
31
+ - [x] Convert rspack support files
32
+ - [x] Convert swc support files
33
+ - [x] Convert esbuild support files
34
+ - [x] Convert babel preset
35
+
36
+ ### Phase 6: Final Cleanup
37
+ - [x] Add TypeScript linting with @typescript-eslint
38
+ - [x] Verify strict mode is enabled (already configured)
39
+ - [x] Update documentation
41
40
 
42
41
  ## Why Gradual Migration?
43
42
  - **Lower risk**: Each phase can be tested independently