shakapacker 9.3.0.beta.6 → 9.3.0

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 (62) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +46 -105
  3. data/ESLINT_TECHNICAL_DEBT.md +8 -2
  4. data/Gemfile.lock +1 -1
  5. data/README.md +53 -2
  6. data/docs/configuration.md +28 -0
  7. data/docs/rspack_migration_guide.md +238 -2
  8. data/docs/troubleshooting.md +21 -21
  9. data/eslint.config.fast.js +8 -0
  10. data/eslint.config.js +47 -10
  11. data/knip.ts +8 -1
  12. data/lib/install/config/shakapacker.yml +6 -6
  13. data/lib/shakapacker/configuration.rb +227 -4
  14. data/lib/shakapacker/dev_server.rb +88 -1
  15. data/lib/shakapacker/doctor.rb +129 -72
  16. data/lib/shakapacker/instance.rb +85 -1
  17. data/lib/shakapacker/manifest.rb +85 -11
  18. data/lib/shakapacker/runner.rb +12 -8
  19. data/lib/shakapacker/swc_migrator.rb +7 -7
  20. data/lib/shakapacker/version.rb +1 -1
  21. data/lib/shakapacker.rb +143 -3
  22. data/lib/tasks/shakapacker/doctor.rake +1 -1
  23. data/lib/tasks/shakapacker/export_bundler_config.rake +4 -4
  24. data/package/config.ts +0 -1
  25. data/package/configExporter/buildValidator.ts +53 -29
  26. data/package/configExporter/cli.ts +152 -118
  27. data/package/configExporter/configFile.ts +33 -26
  28. data/package/configExporter/fileWriter.ts +3 -3
  29. data/package/configExporter/types.ts +64 -0
  30. data/package/configExporter/yamlSerializer.ts +147 -36
  31. data/package/dev_server.ts +2 -1
  32. data/package/env.ts +1 -1
  33. data/package/environments/base.ts +4 -4
  34. data/package/environments/development.ts +7 -6
  35. data/package/environments/production.ts +6 -7
  36. data/package/environments/test.ts +2 -1
  37. data/package/index.ts +28 -4
  38. data/package/loaders.d.ts +2 -2
  39. data/package/optimization/webpack.ts +29 -31
  40. data/package/plugins/webpack.ts +2 -1
  41. data/package/rspack/index.ts +2 -1
  42. data/package/rules/file.ts +1 -0
  43. data/package/rules/jscommon.ts +1 -0
  44. data/package/utils/helpers.ts +0 -1
  45. data/package/utils/pathValidation.ts +68 -7
  46. data/package/utils/requireOrError.ts +10 -2
  47. data/package/utils/typeGuards.ts +43 -46
  48. data/package/webpack-types.d.ts +2 -2
  49. data/package/webpackDevServerConfig.ts +1 -0
  50. data/package.json +2 -3
  51. data/test/configExporter/integration.test.js +8 -8
  52. data/test/package/configExporter/cli.test.js +440 -0
  53. data/test/package/configExporter/types.test.js +163 -0
  54. data/test/package/configExporter.test.js +271 -7
  55. data/test/package/yamlSerializer.test.js +204 -0
  56. data/test/typescript/pathValidation.test.js +44 -0
  57. data/test/typescript/requireOrError.test.js +49 -0
  58. data/yarn.lock +0 -32
  59. metadata +11 -6
  60. data/.eslintrc.fast.js +0 -40
  61. data/.eslintrc.js +0 -84
  62. data/package-lock.json +0 -13047
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.6
4
+ version: 9.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
@@ -131,8 +131,6 @@ executables: []
131
131
  extensions: []
132
132
  extra_rdoc_files: []
133
133
  files:
134
- - ".eslintrc.fast.js"
135
- - ".eslintrc.js"
136
134
  - ".github/FUNDING.yml"
137
135
  - ".github/ISSUE_TEMPLATE/bug_report.md"
138
136
  - ".github/ISSUE_TEMPLATE/feature_request.md"
@@ -273,7 +271,6 @@ files:
273
271
  - lib/tasks/shakapacker/switch_bundler.rake
274
272
  - lib/tasks/shakapacker/verify_config.rake
275
273
  - lib/tasks/shakapacker/verify_install.rake
276
- - package-lock.json
277
274
  - package.json
278
275
  - package/.npmignore
279
276
  - package/babel/preset.ts
@@ -347,6 +344,8 @@ files:
347
344
  - test/helpers.js
348
345
  - test/package/config.test.js
349
346
  - test/package/configExporter.test.js
347
+ - test/package/configExporter/cli.test.js
348
+ - test/package/configExporter/types.test.js
350
349
  - test/package/dev_server.test.js
351
350
  - test/package/development.test.js
352
351
  - test/package/env.test.js
@@ -369,12 +368,14 @@ files:
369
368
  - test/package/staging.test.js
370
369
  - test/package/test.test.js
371
370
  - test/package/transpiler-defaults.test.js
371
+ - test/package/yamlSerializer.test.js
372
372
  - test/peer-dependencies.sh
373
373
  - test/resolver.js
374
374
  - test/scripts/remove-use-strict.test.js
375
375
  - test/typescript/build.test.js
376
376
  - test/typescript/environments.test.js
377
377
  - test/typescript/pathValidation.test.js
378
+ - test/typescript/requireOrError.test.js
378
379
  - test/typescript/securityValidation.test.js
379
380
  - tools/README.md
380
381
  - tools/css-modules-v9-codemod.js
@@ -385,7 +386,7 @@ homepage: https://github.com/shakacode/shakapacker
385
386
  licenses:
386
387
  - MIT
387
388
  metadata:
388
- source_code_uri: https://github.com/shakacode/shakapacker/tree/v9.3.0.beta.6
389
+ source_code_uri: https://github.com/shakacode/shakapacker/tree/v9.3.0
389
390
  rdoc_options: []
390
391
  require_paths:
391
392
  - lib
@@ -400,7 +401,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
400
401
  - !ruby/object:Gem::Version
401
402
  version: '0'
402
403
  requirements: []
403
- rubygems_version: 3.6.7
404
+ rubygems_version: 3.7.2
404
405
  specification_version: 4
405
406
  summary: Use webpack to manage app-like JavaScript modules in Rails
406
407
  test_files:
@@ -410,6 +411,8 @@ test_files:
410
411
  - test/helpers.js
411
412
  - test/package/config.test.js
412
413
  - test/package/configExporter.test.js
414
+ - test/package/configExporter/cli.test.js
415
+ - test/package/configExporter/types.test.js
413
416
  - test/package/dev_server.test.js
414
417
  - test/package/development.test.js
415
418
  - test/package/env.test.js
@@ -432,10 +435,12 @@ test_files:
432
435
  - test/package/staging.test.js
433
436
  - test/package/test.test.js
434
437
  - test/package/transpiler-defaults.test.js
438
+ - test/package/yamlSerializer.test.js
435
439
  - test/peer-dependencies.sh
436
440
  - test/resolver.js
437
441
  - test/scripts/remove-use-strict.test.js
438
442
  - test/typescript/build.test.js
439
443
  - test/typescript/environments.test.js
440
444
  - test/typescript/pathValidation.test.js
445
+ - test/typescript/requireOrError.test.js
441
446
  - 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
- }