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.
- checksums.yaml +4 -4
- data/.eslintrc.fast.js +40 -0
- data/.eslintrc.js +48 -0
- data/.gitignore +1 -3
- data/.husky/pre-commit +2 -0
- data/.npmignore +1 -0
- data/CHANGELOG.md +25 -22
- data/CONTRIBUTING.md +75 -21
- data/Gemfile.lock +1 -1
- data/README.md +3 -2
- data/TODO.md +15 -16
- data/TODO_v9.md +5 -2
- data/conductor-setup.sh +12 -0
- data/docs/css-modules-export-mode.md +102 -8
- data/docs/v9_upgrade.md +57 -3
- data/lib/shakapacker/doctor.rb +94 -0
- data/lib/shakapacker/swc_migrator.rb +60 -2
- data/lib/shakapacker/version.rb +1 -1
- data/package/babel/preset.ts +56 -0
- data/package/esbuild/index.ts +42 -0
- data/package/optimization/rspack.ts +36 -0
- data/package/optimization/{webpack.js → webpack.ts} +12 -4
- data/package/plugins/{rspack.js → rspack.ts} +20 -5
- data/package/plugins/{webpack.js → webpack.ts} +2 -2
- data/package/rspack/{index.js → index.ts} +17 -10
- data/package/rules/{babel.js → babel.ts} +1 -1
- data/package/rules/{coffee.js → coffee.ts} +1 -1
- data/package/rules/{css.js → css.ts} +1 -1
- data/package/rules/{erb.js → erb.ts} +1 -1
- data/package/rules/{esbuild.js → esbuild.ts} +2 -2
- data/package/rules/{file.js → file.ts} +11 -6
- data/package/rules/{jscommon.js → jscommon.ts} +4 -4
- data/package/rules/{less.js → less.ts} +3 -3
- data/package/rules/raw.ts +25 -0
- data/package/rules/{rspack.js → rspack.ts} +21 -11
- data/package/rules/{sass.js → sass.ts} +1 -1
- data/package/rules/{stylus.js → stylus.ts} +3 -7
- data/package/rules/{swc.js → swc.ts} +2 -2
- data/package/rules/{webpack.js → webpack.ts} +1 -1
- data/package/swc/index.ts +54 -0
- data/package/utils/getStyleRule.ts +7 -2
- data/package.json +22 -2
- data/scripts/type-check-no-emit.js +27 -0
- data/test/package/rules/raw.test.js +40 -7
- data/test/package/rules/webpack.test.js +21 -2
- data/tools/README.md +2 -2
- data/tsconfig.eslint.json +16 -0
- data/tsconfig.json +9 -10
- data/yarn.lock +415 -6
- metadata +28 -24
- data/package/babel/preset.js +0 -48
- data/package/esbuild/index.js +0 -40
- data/package/optimization/rspack.js +0 -29
- data/package/rules/raw.js +0 -15
- 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: '
|
|
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
|
-
"
|
|
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":
|
|
30
|
+
"alwaysStrict": true,
|
|
26
31
|
"allowSyntheticDefaultImports": true,
|
|
27
32
|
"preserveConstEnums": true,
|
|
28
33
|
"isolatedModules": true,
|
|
29
34
|
"removeComments": false
|
|
30
35
|
},
|
|
31
|
-
"include": [
|
|
32
|
-
|
|
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
|
}
|