shakapacker 9.0.0.beta.7 → 9.0.0.beta.9

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 (55) hide show
  1. checksums.yaml +4 -4
  2. data/.eslintrc.fast.js +40 -0
  3. data/.eslintrc.js +48 -0
  4. data/.gitignore +1 -3
  5. data/.husky/pre-commit +2 -0
  6. data/.npmignore +1 -0
  7. data/CHANGELOG.md +25 -22
  8. data/CONTRIBUTING.md +75 -21
  9. data/Gemfile.lock +1 -1
  10. data/README.md +3 -2
  11. data/TODO.md +15 -16
  12. data/TODO_v9.md +5 -2
  13. data/conductor-setup.sh +12 -0
  14. data/docs/css-modules-export-mode.md +102 -8
  15. data/docs/v9_upgrade.md +57 -3
  16. data/lib/shakapacker/doctor.rb +94 -0
  17. data/lib/shakapacker/swc_migrator.rb +60 -2
  18. data/lib/shakapacker/version.rb +1 -1
  19. data/package/babel/preset.ts +56 -0
  20. data/package/esbuild/index.ts +42 -0
  21. data/package/optimization/rspack.ts +36 -0
  22. data/package/optimization/{webpack.js → webpack.ts} +12 -4
  23. data/package/plugins/{rspack.js → rspack.ts} +20 -5
  24. data/package/plugins/{webpack.js → webpack.ts} +2 -2
  25. data/package/rspack/{index.js → index.ts} +17 -10
  26. data/package/rules/{babel.js → babel.ts} +1 -1
  27. data/package/rules/{coffee.js → coffee.ts} +1 -1
  28. data/package/rules/{css.js → css.ts} +1 -1
  29. data/package/rules/{erb.js → erb.ts} +1 -1
  30. data/package/rules/{esbuild.js → esbuild.ts} +2 -2
  31. data/package/rules/{file.js → file.ts} +11 -6
  32. data/package/rules/{jscommon.js → jscommon.ts} +4 -4
  33. data/package/rules/{less.js → less.ts} +3 -3
  34. data/package/rules/raw.ts +25 -0
  35. data/package/rules/{rspack.js → rspack.ts} +21 -11
  36. data/package/rules/{sass.js → sass.ts} +1 -1
  37. data/package/rules/{stylus.js → stylus.ts} +3 -7
  38. data/package/rules/{swc.js → swc.ts} +2 -2
  39. data/package/rules/{webpack.js → webpack.ts} +1 -1
  40. data/package/swc/index.ts +54 -0
  41. data/package/utils/getStyleRule.ts +7 -2
  42. data/package.json +22 -2
  43. data/scripts/type-check-no-emit.js +27 -0
  44. data/test/package/rules/raw.test.js +40 -7
  45. data/test/package/rules/webpack.test.js +21 -2
  46. data/tools/README.md +2 -2
  47. data/tsconfig.eslint.json +16 -0
  48. data/tsconfig.json +9 -10
  49. data/yarn.lock +415 -6
  50. metadata +28 -24
  51. data/package/babel/preset.js +0 -48
  52. data/package/esbuild/index.js +0 -40
  53. data/package/optimization/rspack.js +0 -29
  54. data/package/rules/raw.js +0 -15
  55. data/package/swc/index.js +0 -50
data/tools/README.md CHANGED
@@ -104,7 +104,7 @@ const Button: React.FC = () => {
104
104
 
105
105
  ### Notes
106
106
 
107
- 1. **Kebab-case conversion**: CSS classes with kebab-case (e.g., `my-button`) are automatically converted to camelCase (`myButton`) for JavaScript files, matching css-loader's `exportLocalsConvention: 'camelCase'` setting.
107
+ 1. **Kebab-case conversion**: CSS classes with kebab-case (e.g., `my-button`) are automatically converted to camelCase (`myButton`) for JavaScript files, matching css-loader's `exportLocalsConvention: 'camelCaseOnly'` setting.
108
108
 
109
109
  2. **Unused imports**: The codemod only imports CSS classes that are actually used in JavaScript files. If you pass the entire styles object to a component, it will convert to namespace import for safety.
110
110
 
@@ -121,4 +121,4 @@ const Button: React.FC = () => {
121
121
  **Solution**: Ensure your TypeScript definitions are updated as shown in the [v9 Upgrade Guide](../docs/v9_upgrade.md).
122
122
 
123
123
  **Issue**: Runtime errors about missing CSS classes
124
- **Solution**: Check if you have kebab-case class names that need camelCase conversion.
124
+ **Solution**: Check if you have kebab-case class names that need camelCase conversion.
@@ -0,0 +1,16 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "noEmit": true,
5
+ "rootDir": "."
6
+ },
7
+ "include": [
8
+ "package/**/*.ts",
9
+ "package/**/*.tsx",
10
+ "package/**/*.test.ts",
11
+ "package/**/*.spec.ts",
12
+ "test/**/*.ts",
13
+ "test/**/*.tsx"
14
+ ],
15
+ "exclude": ["node_modules"]
16
+ }
data/tsconfig.json CHANGED
@@ -3,7 +3,12 @@
3
3
  "target": "ES2020",
4
4
  "module": "commonjs",
5
5
  "lib": ["ES2020"],
6
- "typeRoots": ["./node_modules/@types", "node_modules/@types", "../node_modules/@types"],
6
+ "importHelpers": false,
7
+ "typeRoots": [
8
+ "./node_modules/@types",
9
+ "node_modules/@types",
10
+ "../node_modules/@types"
11
+ ],
7
12
  "declaration": true,
8
13
  "declarationMap": true,
9
14
  "outDir": "./package",
@@ -22,18 +27,12 @@
22
27
  "strictBindCallApply": true,
23
28
  "strictPropertyInitialization": false,
24
29
  "noImplicitThis": true,
25
- "alwaysStrict": false,
30
+ "alwaysStrict": true,
26
31
  "allowSyntheticDefaultImports": true,
27
32
  "preserveConstEnums": true,
28
33
  "isolatedModules": true,
29
34
  "removeComments": false
30
35
  },
31
- "include": [
32
- "package/**/*.ts"
33
- ],
34
- "exclude": [
35
- "node_modules",
36
- "package/**/*.test.ts",
37
- "package/**/*.spec.ts"
38
- ]
36
+ "include": ["package/**/*.ts"],
37
+ "exclude": ["node_modules", "package/**/*.test.ts", "package/**/*.spec.ts"]
39
38
  }