shakapacker 9.3.0.beta.7 → 9.3.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 (85) hide show
  1. checksums.yaml +4 -4
  2. data/.claude/commands/update-changelog.md +224 -0
  3. data/.github/actionlint-matcher.json +17 -0
  4. data/.github/workflows/dummy.yml +9 -0
  5. data/.github/workflows/generator.yml +13 -0
  6. data/.github/workflows/node.yml +83 -0
  7. data/.github/workflows/ruby.yml +11 -0
  8. data/.github/workflows/test-bundlers.yml +10 -0
  9. data/CHANGELOG.md +55 -111
  10. data/CLAUDE.md +6 -10
  11. data/CONTRIBUTING.md +57 -0
  12. data/Gemfile.lock +1 -1
  13. data/README.md +84 -8
  14. data/docs/api-reference.md +519 -0
  15. data/docs/configuration.md +38 -4
  16. data/docs/css-modules-export-mode.md +40 -6
  17. data/docs/rspack_migration_guide.md +238 -2
  18. data/docs/transpiler-migration.md +12 -9
  19. data/docs/troubleshooting.md +21 -21
  20. data/docs/using_swc_loader.md +13 -10
  21. data/docs/v9_upgrade.md +11 -2
  22. data/eslint.config.fast.js +128 -8
  23. data/eslint.config.js +89 -33
  24. data/knip.ts +8 -1
  25. data/lib/install/config/shakapacker.yml +20 -7
  26. data/lib/shakapacker/configuration.rb +274 -8
  27. data/lib/shakapacker/dev_server.rb +88 -1
  28. data/lib/shakapacker/dev_server_runner.rb +4 -0
  29. data/lib/shakapacker/doctor.rb +5 -5
  30. data/lib/shakapacker/instance.rb +85 -1
  31. data/lib/shakapacker/manifest.rb +85 -11
  32. data/lib/shakapacker/version.rb +1 -1
  33. data/lib/shakapacker.rb +143 -3
  34. data/lib/tasks/shakapacker/doctor.rake +1 -1
  35. data/lib/tasks/shakapacker/export_bundler_config.rake +4 -4
  36. data/package/config.ts +2 -4
  37. data/package/configExporter/buildValidator.ts +53 -29
  38. data/package/configExporter/cli.ts +106 -76
  39. data/package/configExporter/configFile.ts +33 -26
  40. data/package/configExporter/types.ts +64 -0
  41. data/package/configExporter/yamlSerializer.ts +118 -43
  42. data/package/dev_server.ts +3 -2
  43. data/package/env.ts +2 -2
  44. data/package/environments/__type-tests__/rspack-plugin-compatibility.ts +6 -6
  45. data/package/environments/base.ts +6 -6
  46. data/package/environments/development.ts +7 -9
  47. data/package/environments/production.ts +7 -8
  48. data/package/environments/test.ts +4 -2
  49. data/package/esbuild/index.ts +0 -2
  50. data/package/index.d.ts +1 -0
  51. data/package/index.d.ts.template +1 -0
  52. data/package/index.ts +28 -5
  53. data/package/loaders.d.ts +2 -2
  54. data/package/optimization/webpack.ts +29 -31
  55. data/package/plugins/rspack.ts +3 -1
  56. data/package/plugins/webpack.ts +5 -3
  57. data/package/rspack/index.ts +5 -4
  58. data/package/rules/file.ts +2 -1
  59. data/package/rules/jscommon.ts +1 -0
  60. data/package/rules/raw.ts +3 -1
  61. data/package/rules/rspack.ts +0 -2
  62. data/package/rules/sass.ts +0 -2
  63. data/package/rules/webpack.ts +0 -1
  64. data/package/swc/index.ts +0 -2
  65. data/package/types.ts +8 -11
  66. data/package/utils/debug.ts +0 -4
  67. data/package/utils/getStyleRule.ts +17 -9
  68. data/package/utils/helpers.ts +8 -4
  69. data/package/utils/pathValidation.ts +78 -18
  70. data/package/utils/requireOrError.ts +14 -5
  71. data/package/utils/typeGuards.ts +43 -46
  72. data/package/webpack-types.d.ts +2 -2
  73. data/package/webpackDevServerConfig.ts +5 -4
  74. data/package.json +2 -3
  75. data/test/package/configExporter/cli.test.js +440 -0
  76. data/test/package/configExporter/types.test.js +163 -0
  77. data/test/package/configExporter.test.js +264 -0
  78. data/test/package/transpiler-defaults.test.js +42 -0
  79. data/test/package/yamlSerializer.test.js +204 -0
  80. data/test/typescript/pathValidation.test.js +44 -0
  81. data/test/typescript/requireOrError.test.js +49 -0
  82. data/yarn.lock +0 -32
  83. metadata +14 -5
  84. data/.eslintrc.fast.js +0 -40
  85. data/.eslintrc.js +0 -84
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shakapacker
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.3.0.beta.7
4
+ version: 9.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
@@ -131,13 +131,13 @@ executables: []
131
131
  extensions: []
132
132
  extra_rdoc_files: []
133
133
  files:
134
- - ".eslintrc.fast.js"
135
- - ".eslintrc.js"
134
+ - ".claude/commands/update-changelog.md"
136
135
  - ".github/FUNDING.yml"
137
136
  - ".github/ISSUE_TEMPLATE/bug_report.md"
138
137
  - ".github/ISSUE_TEMPLATE/feature_request.md"
139
138
  - ".github/PULL_REQUEST_TEMPLATE.md"
140
139
  - ".github/STATUS.md"
140
+ - ".github/actionlint-matcher.json"
141
141
  - ".github/workflows/claude-code-review.yml"
142
142
  - ".github/workflows/claude.yml"
143
143
  - ".github/workflows/dummy.yml"
@@ -173,6 +173,7 @@ files:
173
173
  - conductor.json
174
174
  - config/README.md
175
175
  - config/shakapacker.yml
176
+ - docs/api-reference.md
176
177
  - docs/cdn_setup.md
177
178
  - docs/common-upgrades.md
178
179
  - docs/configuration.md
@@ -346,6 +347,8 @@ files:
346
347
  - test/helpers.js
347
348
  - test/package/config.test.js
348
349
  - test/package/configExporter.test.js
350
+ - test/package/configExporter/cli.test.js
351
+ - test/package/configExporter/types.test.js
349
352
  - test/package/dev_server.test.js
350
353
  - test/package/development.test.js
351
354
  - test/package/env.test.js
@@ -368,12 +371,14 @@ files:
368
371
  - test/package/staging.test.js
369
372
  - test/package/test.test.js
370
373
  - test/package/transpiler-defaults.test.js
374
+ - test/package/yamlSerializer.test.js
371
375
  - test/peer-dependencies.sh
372
376
  - test/resolver.js
373
377
  - test/scripts/remove-use-strict.test.js
374
378
  - test/typescript/build.test.js
375
379
  - test/typescript/environments.test.js
376
380
  - test/typescript/pathValidation.test.js
381
+ - test/typescript/requireOrError.test.js
377
382
  - test/typescript/securityValidation.test.js
378
383
  - tools/README.md
379
384
  - tools/css-modules-v9-codemod.js
@@ -384,7 +389,7 @@ homepage: https://github.com/shakacode/shakapacker
384
389
  licenses:
385
390
  - MIT
386
391
  metadata:
387
- source_code_uri: https://github.com/shakacode/shakapacker/tree/v9.3.0.beta.7
392
+ source_code_uri: https://github.com/shakacode/shakapacker/tree/v9.3.1
388
393
  rdoc_options: []
389
394
  require_paths:
390
395
  - lib
@@ -399,7 +404,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
399
404
  - !ruby/object:Gem::Version
400
405
  version: '0'
401
406
  requirements: []
402
- rubygems_version: 3.6.7
407
+ rubygems_version: 3.7.2
403
408
  specification_version: 4
404
409
  summary: Use webpack to manage app-like JavaScript modules in Rails
405
410
  test_files:
@@ -409,6 +414,8 @@ test_files:
409
414
  - test/helpers.js
410
415
  - test/package/config.test.js
411
416
  - test/package/configExporter.test.js
417
+ - test/package/configExporter/cli.test.js
418
+ - test/package/configExporter/types.test.js
412
419
  - test/package/dev_server.test.js
413
420
  - test/package/development.test.js
414
421
  - test/package/env.test.js
@@ -431,10 +438,12 @@ test_files:
431
438
  - test/package/staging.test.js
432
439
  - test/package/test.test.js
433
440
  - test/package/transpiler-defaults.test.js
441
+ - test/package/yamlSerializer.test.js
434
442
  - test/peer-dependencies.sh
435
443
  - test/resolver.js
436
444
  - test/scripts/remove-use-strict.test.js
437
445
  - test/typescript/build.test.js
438
446
  - test/typescript/environments.test.js
439
447
  - test/typescript/pathValidation.test.js
448
+ - test/typescript/requireOrError.test.js
440
449
  - test/typescript/securityValidation.test.js
data/.eslintrc.fast.js DELETED
@@ -1,40 +0,0 @@
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 DELETED
@@ -1,84 +0,0 @@
1
- module.exports = {
2
- root: true, // Prevent ESLint from looking in parent directories
3
- extends: ["airbnb", "plugin:prettier/recommended"],
4
- rules: {
5
- // Webpack handles module resolution, not ESLint
6
- "import/no-unresolved": "off",
7
- // Allow importing devDependencies in config/test files
8
- "import/no-extraneous-dependencies": "off",
9
- // TypeScript handles extensions, not needed for JS imports
10
- "import/extensions": "off",
11
- indent: ["error", 2]
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
- },
20
- env: {
21
- browser: true,
22
- node: true
23
- },
24
- overrides: [
25
- {
26
- files: ["test/**"],
27
- extends: ["plugin:jest/recommended", "plugin:jest/style"],
28
- rules: {
29
- "global-require": "off",
30
- "jest/prefer-called-with": "error",
31
- "jest/no-conditional-in-test": "error",
32
- "jest/no-test-return-statement": "error",
33
- "jest/prefer-expect-resolves": "error",
34
- "jest/require-to-throw-message": "error",
35
- "jest/require-top-level-describe": "error",
36
- "jest/prefer-hooks-on-top": "error",
37
- "jest/prefer-lowercase-title": [
38
- "error",
39
- { ignoreTopLevelDescribe: true }
40
- ],
41
- "jest/prefer-spy-on": "error",
42
- "jest/prefer-strict-equal": "error",
43
- "jest/prefer-todo": "error"
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
- }
82
- }
83
- ]
84
- }