shakapacker 8.0.2 → 9.2.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.
- checksums.yaml +4 -4
- data/.eslintignore +1 -0
- data/.eslintrc.fast.js +40 -0
- data/.eslintrc.js +48 -0
- data/.github/STATUS.md +1 -0
- data/.github/workflows/claude-code-review.yml +54 -0
- data/.github/workflows/claude.yml +50 -0
- data/.github/workflows/dummy.yml +9 -4
- data/.github/workflows/generator.yml +32 -10
- data/.github/workflows/node.yml +23 -1
- data/.github/workflows/ruby.yml +33 -2
- data/.github/workflows/test-bundlers.yml +170 -0
- data/.gitignore +20 -0
- data/.husky/pre-commit +2 -0
- data/.npmignore +56 -0
- data/.prettierignore +3 -0
- data/.rubocop.yml +1 -0
- data/.yalcignore +26 -0
- data/CHANGELOG.md +302 -16
- data/CLAUDE.md +29 -0
- data/CONTRIBUTING.md +138 -20
- data/Gemfile.lock +83 -89
- data/README.md +343 -105
- data/Rakefile +39 -4
- data/TODO.md +50 -0
- data/TODO_v9.md +87 -0
- data/bin/export-bundler-config +11 -0
- data/conductor-setup.sh +70 -0
- data/conductor.json +7 -0
- data/docs/cdn_setup.md +379 -0
- data/docs/common-upgrades.md +615 -0
- data/docs/css-modules-export-mode.md +512 -0
- data/docs/deployment.md +62 -9
- data/docs/optional-peer-dependencies.md +198 -0
- data/docs/peer-dependencies.md +60 -0
- data/docs/react.md +6 -14
- data/docs/releasing.md +197 -0
- data/docs/rspack.md +190 -0
- data/docs/rspack_migration_guide.md +305 -0
- data/docs/subresource_integrity.md +54 -0
- data/docs/transpiler-migration.md +209 -0
- data/docs/transpiler-performance.md +179 -0
- data/docs/troubleshooting.md +157 -22
- data/docs/typescript-migration.md +379 -0
- data/docs/typescript.md +99 -0
- data/docs/using_esbuild_loader.md +3 -3
- data/docs/using_swc_loader.md +112 -10
- data/docs/v6_upgrade.md +10 -0
- data/docs/v8_upgrade.md +3 -5
- data/docs/v9_upgrade.md +458 -0
- data/gemfiles/Gemfile-rails.6.0.x +2 -1
- data/gemfiles/Gemfile-rails.6.1.x +1 -1
- data/gemfiles/Gemfile-rails.7.0.x +2 -2
- data/gemfiles/Gemfile-rails.7.1.x +1 -2
- data/gemfiles/Gemfile-rails.7.2.x +11 -0
- data/gemfiles/Gemfile-rails.8.0.x +11 -0
- data/lib/install/bin/export-bundler-config +11 -0
- data/lib/install/bin/shakapacker +4 -6
- data/lib/install/bin/shakapacker-dev-server +1 -1
- data/lib/install/config/rspack/rspack.config.js +6 -0
- data/lib/install/config/rspack/rspack.config.ts +7 -0
- data/lib/install/config/shakapacker.yml +25 -5
- data/lib/install/config/webpack/webpack.config.ts +7 -0
- data/lib/install/package.json +38 -0
- data/lib/install/template.rb +194 -44
- data/lib/shakapacker/bundler_switcher.rb +329 -0
- data/lib/shakapacker/compiler.rb +2 -1
- data/lib/shakapacker/compiler_strategy.rb +2 -2
- data/lib/shakapacker/configuration.rb +173 -2
- data/lib/shakapacker/dev_server_runner.rb +29 -8
- data/lib/shakapacker/digest_strategy.rb +2 -1
- data/lib/shakapacker/doctor.rb +905 -0
- data/lib/shakapacker/helper.rb +64 -16
- data/lib/shakapacker/manifest.rb +10 -3
- data/lib/shakapacker/mtime_strategy.rb +1 -1
- data/lib/shakapacker/railtie.rb +4 -4
- data/lib/shakapacker/rspack_runner.rb +19 -0
- data/lib/shakapacker/runner.rb +159 -10
- data/lib/shakapacker/swc_migrator.rb +384 -0
- data/lib/shakapacker/utils/manager.rb +15 -2
- data/lib/shakapacker/version.rb +1 -1
- data/lib/shakapacker/version_checker.rb +2 -2
- data/lib/shakapacker/webpack_runner.rb +6 -43
- data/lib/shakapacker.rb +22 -11
- data/lib/tasks/shakapacker/doctor.rake +8 -0
- data/lib/tasks/shakapacker/export_bundler_config.rake +72 -0
- data/lib/tasks/shakapacker/install.rake +12 -2
- data/lib/tasks/shakapacker/migrate_to_swc.rake +13 -0
- data/lib/tasks/shakapacker/switch_bundler.rake +82 -0
- data/lib/tasks/shakapacker.rake +2 -0
- data/package/.npmignore +4 -0
- data/package/babel/preset.ts +56 -0
- data/package/config.ts +175 -0
- data/package/configExporter/cli.ts +683 -0
- data/package/configExporter/configDocs.ts +102 -0
- data/package/configExporter/fileWriter.ts +92 -0
- data/package/configExporter/index.ts +5 -0
- data/package/configExporter/types.ts +36 -0
- data/package/configExporter/yamlSerializer.ts +266 -0
- data/package/{dev_server.js → dev_server.ts} +8 -5
- data/package/env.ts +92 -0
- data/package/environments/__type-tests__/rspack-plugin-compatibility.ts +30 -0
- data/package/environments/{base.js → base.ts} +56 -60
- data/package/environments/development.ts +90 -0
- data/package/environments/production.ts +80 -0
- data/package/environments/test.ts +53 -0
- data/package/environments/types.ts +98 -0
- data/package/esbuild/index.ts +42 -0
- data/package/index.d.ts +3 -60
- data/package/index.ts +55 -0
- data/package/loaders.d.ts +28 -0
- data/package/optimization/rspack.ts +36 -0
- data/package/optimization/webpack.ts +57 -0
- data/package/plugins/rspack.ts +103 -0
- data/package/plugins/webpack.ts +62 -0
- data/package/rspack/index.ts +64 -0
- data/package/rules/{babel.js → babel.ts} +2 -2
- data/package/rules/{coffee.js → coffee.ts} +1 -1
- data/package/rules/css.ts +3 -0
- data/package/rules/{erb.js → erb.ts} +1 -1
- data/package/rules/esbuild.ts +10 -0
- data/package/rules/file.ts +40 -0
- data/package/rules/{jscommon.js → jscommon.ts} +4 -4
- data/package/rules/{less.js → less.ts} +4 -4
- data/package/rules/raw.ts +25 -0
- data/package/rules/rspack.ts +176 -0
- data/package/rules/{sass.js → sass.ts} +7 -3
- data/package/rules/{stylus.js → stylus.ts} +4 -8
- data/package/rules/swc.ts +10 -0
- data/package/rules/webpack.ts +16 -0
- data/package/swc/index.ts +56 -0
- data/package/types/README.md +88 -0
- data/package/types/index.ts +61 -0
- data/package/types.ts +108 -0
- data/package/utils/configPath.ts +6 -0
- data/package/utils/debug.ts +49 -0
- data/package/utils/defaultConfigPath.ts +4 -0
- data/package/utils/errorCodes.ts +219 -0
- data/package/utils/errorHelpers.ts +143 -0
- data/package/utils/getStyleRule.ts +64 -0
- data/package/utils/helpers.ts +85 -0
- data/package/utils/{inliningCss.js → inliningCss.ts} +3 -3
- data/package/utils/pathValidation.ts +139 -0
- data/package/utils/requireOrError.ts +15 -0
- data/package/utils/snakeToCamelCase.ts +5 -0
- data/package/utils/typeGuards.ts +342 -0
- data/package/utils/validateDependencies.ts +61 -0
- data/package/webpack-types.d.ts +33 -0
- data/package/webpackDevServerConfig.ts +117 -0
- data/package-lock.json +13047 -0
- data/package.json +154 -18
- data/scripts/remove-use-strict.js +45 -0
- data/scripts/type-check-no-emit.js +27 -0
- data/test/helpers.js +1 -1
- data/test/package/config.test.js +43 -0
- data/test/package/env.test.js +42 -7
- data/test/package/environments/base.test.js +5 -1
- data/test/package/rules/babel.test.js +16 -0
- data/test/package/rules/esbuild.test.js +1 -1
- data/test/package/rules/raw.test.js +40 -7
- data/test/package/rules/swc.test.js +1 -1
- data/test/package/rules/webpack.test.js +35 -0
- data/test/package/staging.test.js +4 -3
- data/test/package/transpiler-defaults.test.js +127 -0
- data/test/peer-dependencies.sh +85 -0
- data/test/scripts/remove-use-strict.test.js +125 -0
- data/test/typescript/build.test.js +118 -0
- data/test/typescript/environments.test.js +107 -0
- data/test/typescript/pathValidation.test.js +142 -0
- data/test/typescript/securityValidation.test.js +182 -0
- data/tools/README.md +124 -0
- data/tools/css-modules-v9-codemod.js +179 -0
- data/tsconfig.eslint.json +16 -0
- data/tsconfig.json +38 -0
- data/yarn.lock +4165 -2706
- metadata +129 -41
- data/package/babel/preset.js +0 -37
- data/package/config.js +0 -54
- data/package/env.js +0 -48
- data/package/environments/development.js +0 -13
- data/package/environments/production.js +0 -88
- data/package/environments/test.js +0 -3
- data/package/esbuild/index.js +0 -40
- data/package/index.js +0 -40
- data/package/rules/css.js +0 -3
- data/package/rules/esbuild.js +0 -10
- data/package/rules/file.js +0 -29
- data/package/rules/index.js +0 -20
- data/package/rules/raw.js +0 -5
- data/package/rules/swc.js +0 -10
- data/package/swc/index.js +0 -50
- data/package/utils/configPath.js +0 -4
- data/package/utils/defaultConfigPath.js +0 -2
- data/package/utils/getStyleRule.js +0 -40
- data/package/utils/helpers.js +0 -58
- data/package/utils/snakeToCamelCase.js +0 -5
- data/package/webpackDevServerConfig.js +0 -71
- data/test/package/rules/index.test.js +0 -16
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5ac40ff5ddf8db373b1de0efaf805a033d7ba87641d84bde529669761b8e64d2
|
|
4
|
+
data.tar.gz: 5d0abb49ede8ad2aa37c94e9148e4def579c3eabb8c6e8d94a127796941ed559
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5309f5d9beef93aaa0434e0e8ab93118545ecad507ade518ab56a332980d804536e36762670d21245d67d6c60e126367b1ea4edd8e4766daf20c294871ea1263
|
|
7
|
+
data.tar.gz: 4fb22afab6e203194018a1be9096aac472bffdbc08d58fc7a5b04a23c5e5d8c52084a17830d8ffb5156a6e4798de061f6f671474638616b7ffecd6c6348916f5
|
data/.eslintignore
CHANGED
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
|
}
|
data/.github/STATUS.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# CI Status Update
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
name: Claude Code Review
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types: [opened, synchronize]
|
|
6
|
+
# Optional: Only run on specific file changes
|
|
7
|
+
# paths:
|
|
8
|
+
# - "src/**/*.ts"
|
|
9
|
+
# - "src/**/*.tsx"
|
|
10
|
+
# - "src/**/*.js"
|
|
11
|
+
# - "src/**/*.jsx"
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
claude-review:
|
|
15
|
+
# Optional: Filter by PR author
|
|
16
|
+
# if: |
|
|
17
|
+
# github.event.pull_request.user.login == 'external-contributor' ||
|
|
18
|
+
# github.event.pull_request.user.login == 'new-developer' ||
|
|
19
|
+
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
|
|
20
|
+
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
permissions:
|
|
23
|
+
contents: read
|
|
24
|
+
pull-requests: read
|
|
25
|
+
issues: read
|
|
26
|
+
id-token: write
|
|
27
|
+
|
|
28
|
+
steps:
|
|
29
|
+
- name: Checkout repository
|
|
30
|
+
uses: actions/checkout@v4
|
|
31
|
+
with:
|
|
32
|
+
fetch-depth: 1
|
|
33
|
+
|
|
34
|
+
- name: Run Claude Code Review
|
|
35
|
+
id: claude-review
|
|
36
|
+
uses: anthropics/claude-code-action@v1
|
|
37
|
+
with:
|
|
38
|
+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
|
39
|
+
prompt: |
|
|
40
|
+
Please review this pull request and provide feedback on:
|
|
41
|
+
- Code quality and best practices
|
|
42
|
+
- Potential bugs or issues
|
|
43
|
+
- Performance considerations
|
|
44
|
+
- Security concerns
|
|
45
|
+
- Test coverage
|
|
46
|
+
|
|
47
|
+
Use the repository's CLAUDE.md for guidance on style and conventions. Be constructive and helpful in your feedback.
|
|
48
|
+
|
|
49
|
+
Use `gh pr comment` with your Bash tool to leave your review as a comment on the PR.
|
|
50
|
+
|
|
51
|
+
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
|
|
52
|
+
# or https://docs.claude.com/en/docs/claude-code/sdk#command-line for available options
|
|
53
|
+
claude_args: '--model claude-sonnet-4-5-20250929 --allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"'
|
|
54
|
+
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
name: Claude Code
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
issue_comment:
|
|
5
|
+
types: [created]
|
|
6
|
+
pull_request_review_comment:
|
|
7
|
+
types: [created]
|
|
8
|
+
issues:
|
|
9
|
+
types: [opened, assigned]
|
|
10
|
+
pull_request_review:
|
|
11
|
+
types: [submitted]
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
claude:
|
|
15
|
+
if: |
|
|
16
|
+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
|
|
17
|
+
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
|
|
18
|
+
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
|
|
19
|
+
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
permissions:
|
|
22
|
+
contents: read
|
|
23
|
+
pull-requests: read
|
|
24
|
+
issues: read
|
|
25
|
+
id-token: write
|
|
26
|
+
actions: read # Required for Claude to read CI results on PRs
|
|
27
|
+
steps:
|
|
28
|
+
- name: Checkout repository
|
|
29
|
+
uses: actions/checkout@v4
|
|
30
|
+
with:
|
|
31
|
+
fetch-depth: 1
|
|
32
|
+
|
|
33
|
+
- name: Run Claude Code
|
|
34
|
+
id: claude
|
|
35
|
+
uses: anthropics/claude-code-action@v1
|
|
36
|
+
with:
|
|
37
|
+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
|
38
|
+
|
|
39
|
+
# This is an optional setting that allows Claude to read CI results on PRs
|
|
40
|
+
additional_permissions: |
|
|
41
|
+
actions: read
|
|
42
|
+
|
|
43
|
+
# Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
|
|
44
|
+
# prompt: 'Update the pull request description to include a summary of changes.'
|
|
45
|
+
|
|
46
|
+
# Optional: Add claude_args to customize behavior and configuration
|
|
47
|
+
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
|
|
48
|
+
# or https://docs.claude.com/en/docs/claude-code/sdk#command-line for available options
|
|
49
|
+
# claude_args: '--model claude-opus-4-1-20250805 --allowed-tools Bash(gh pr:*)'
|
|
50
|
+
|
data/.github/workflows/dummy.yml
CHANGED
|
@@ -21,15 +21,20 @@ jobs:
|
|
|
21
21
|
persist-credentials: false
|
|
22
22
|
- uses: actions/setup-node@v4
|
|
23
23
|
with:
|
|
24
|
-
node-version: '
|
|
24
|
+
node-version: '20'
|
|
25
25
|
- uses: ruby/setup-ruby@v1
|
|
26
26
|
with:
|
|
27
|
-
ruby-version: '3.
|
|
27
|
+
ruby-version: '3.2'
|
|
28
|
+
rubygems: latest
|
|
28
29
|
- name: Install dependencies
|
|
29
30
|
run: |
|
|
30
31
|
bundle install
|
|
31
|
-
yarn install
|
|
32
|
-
|
|
32
|
+
yarn install --frozen-lockfile --production=false
|
|
33
|
+
npm install -g yalc
|
|
34
|
+
cd spec/dummy && npm install
|
|
35
|
+
|
|
36
|
+
- name: Build TypeScript
|
|
37
|
+
run: yarn build
|
|
33
38
|
|
|
34
39
|
- name: Run tests
|
|
35
40
|
run: bundle exec rake run_spec:dummy
|
|
@@ -18,24 +18,28 @@ jobs:
|
|
|
18
18
|
strategy:
|
|
19
19
|
matrix:
|
|
20
20
|
os: [ubuntu-latest]
|
|
21
|
-
ruby: ['2.7', '3.0', '3.1', '3.2', '3.3']
|
|
21
|
+
ruby: ['2.7', '3.0', '3.1', '3.2', '3.3', '3.4']
|
|
22
22
|
gemfile:
|
|
23
|
-
- gemfiles/Gemfile-rails.6.0.x
|
|
24
|
-
- gemfiles/Gemfile-rails.6.1.x
|
|
25
23
|
- gemfiles/Gemfile-rails.7.0.x
|
|
26
24
|
- gemfiles/Gemfile-rails.7.1.x
|
|
25
|
+
- gemfiles/Gemfile-rails.7.2.x
|
|
26
|
+
- gemfiles/Gemfile-rails.8.0.x
|
|
27
27
|
# Uncomment the following line only to ensure compatibility with the
|
|
28
28
|
# upcomming Rails versions, maybe before a release.
|
|
29
29
|
#- gemfiles/Gemfile-rails-edge
|
|
30
30
|
exclude:
|
|
31
|
+
- ruby: '2.7'
|
|
32
|
+
gemfile: gemfiles/Gemfile-rails.7.2.x
|
|
33
|
+
- ruby: '2.7'
|
|
34
|
+
gemfile: gemfiles/Gemfile-rails.8.0.x
|
|
35
|
+
- ruby: '3.0'
|
|
36
|
+
gemfile: gemfiles/Gemfile-rails.7.2.x
|
|
37
|
+
- ruby: '3.0'
|
|
38
|
+
gemfile: gemfiles/Gemfile-rails.8.0.x
|
|
31
39
|
- ruby: '3.1'
|
|
32
|
-
gemfile: gemfiles/Gemfile-rails.
|
|
33
|
-
- ruby: '3.
|
|
34
|
-
gemfile: gemfiles/Gemfile-rails.
|
|
35
|
-
- ruby: '3.3'
|
|
36
|
-
gemfile: gemfiles/Gemfile-rails.6.0.x
|
|
37
|
-
- ruby: '3.3'
|
|
38
|
-
gemfile: gemfiles/Gemfile-rails.6.1.x
|
|
40
|
+
gemfile: gemfiles/Gemfile-rails.8.0.x
|
|
41
|
+
- ruby: '3.4'
|
|
42
|
+
gemfile: gemfiles/Gemfile-rails.7.0.x
|
|
39
43
|
|
|
40
44
|
env:
|
|
41
45
|
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
|
@@ -47,5 +51,23 @@ jobs:
|
|
|
47
51
|
- uses: ruby/setup-ruby@v1
|
|
48
52
|
with:
|
|
49
53
|
ruby-version: ${{ matrix.ruby }}
|
|
54
|
+
rubygems: latest
|
|
50
55
|
bundler-cache: true
|
|
56
|
+
- uses: actions/setup-node@v4
|
|
57
|
+
with:
|
|
58
|
+
node-version: 20.x
|
|
59
|
+
cache: yarn
|
|
60
|
+
|
|
61
|
+
- name: Install Node dependencies
|
|
62
|
+
run: yarn install --frozen-lockfile --production=false
|
|
63
|
+
|
|
64
|
+
- name: Build TypeScript
|
|
65
|
+
run: yarn build
|
|
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
|
+
|
|
51
73
|
- run: bundle exec rake run_spec:generator
|
data/.github/workflows/node.yml
CHANGED
|
@@ -30,12 +30,31 @@ jobs:
|
|
|
30
30
|
|
|
31
31
|
- name: Node eslint
|
|
32
32
|
run: yarn lint
|
|
33
|
+
|
|
34
|
+
type-check:
|
|
35
|
+
name: TypeScript Type Checking
|
|
36
|
+
runs-on: ubuntu-latest
|
|
37
|
+
|
|
38
|
+
steps:
|
|
39
|
+
- uses: actions/checkout@v4
|
|
40
|
+
with:
|
|
41
|
+
persist-credentials: false
|
|
42
|
+
- uses: actions/setup-node@v4
|
|
43
|
+
with:
|
|
44
|
+
node-version: 20.x
|
|
45
|
+
cache: yarn
|
|
46
|
+
|
|
47
|
+
- name: Install dependencies
|
|
48
|
+
run: yarn --frozen-lockfile --non-interactive --prefer-offline
|
|
49
|
+
|
|
50
|
+
- name: TypeScript type check
|
|
51
|
+
run: yarn type-check
|
|
33
52
|
test:
|
|
34
53
|
name: Testing
|
|
35
54
|
strategy:
|
|
36
55
|
matrix:
|
|
37
56
|
os: [ubuntu-latest]
|
|
38
|
-
node: [
|
|
57
|
+
node: [18.x, 20.x, 22.x]
|
|
39
58
|
|
|
40
59
|
runs-on: ${{ matrix.os }}
|
|
41
60
|
|
|
@@ -52,5 +71,8 @@ jobs:
|
|
|
52
71
|
- name: Install dependencies
|
|
53
72
|
run: yarn --frozen-lockfile --non-interactive --prefer-offline
|
|
54
73
|
|
|
74
|
+
- name: Build TypeScript
|
|
75
|
+
run: yarn build
|
|
76
|
+
|
|
55
77
|
- name: Jest Specs
|
|
56
78
|
run: yarn test
|
data/.github/workflows/ruby.yml
CHANGED
|
@@ -23,7 +23,8 @@ jobs:
|
|
|
23
23
|
run: rm -f Gemfile.lock
|
|
24
24
|
- uses: ruby/setup-ruby@v1
|
|
25
25
|
with:
|
|
26
|
-
ruby-version: '3.
|
|
26
|
+
ruby-version: '3.4'
|
|
27
|
+
rubygems: latest
|
|
27
28
|
bundler-cache: true
|
|
28
29
|
|
|
29
30
|
- name: Ruby rubocop
|
|
@@ -35,24 +36,42 @@ jobs:
|
|
|
35
36
|
strategy:
|
|
36
37
|
matrix:
|
|
37
38
|
os: [ubuntu-latest]
|
|
38
|
-
ruby: ['2.7', '3.0', '3.1', '3.2', '3.3']
|
|
39
|
+
ruby: ['2.7', '3.0', '3.1', '3.2', '3.3', '3.4']
|
|
39
40
|
gemfile:
|
|
40
41
|
- gemfiles/Gemfile-rails.6.0.x
|
|
41
42
|
- gemfiles/Gemfile-rails.6.1.x
|
|
42
43
|
- gemfiles/Gemfile-rails.7.0.x
|
|
43
44
|
- gemfiles/Gemfile-rails.7.1.x
|
|
45
|
+
- gemfiles/Gemfile-rails.7.2.x
|
|
46
|
+
- gemfiles/Gemfile-rails.8.0.x
|
|
44
47
|
# Uncomment the following line only to ensure compatibility with the
|
|
45
48
|
# upcomming Rails versions, maybe before a release.
|
|
46
49
|
#- gemfiles/Gemfile-rails-edge
|
|
47
50
|
exclude:
|
|
51
|
+
- ruby: '2.7'
|
|
52
|
+
gemfile: gemfiles/Gemfile-rails.7.2.x
|
|
53
|
+
- ruby: '2.7'
|
|
54
|
+
gemfile: gemfiles/Gemfile-rails.8.0.x
|
|
55
|
+
- ruby: '3.0'
|
|
56
|
+
gemfile: gemfiles/Gemfile-rails.7.2.x
|
|
57
|
+
- ruby: '3.0'
|
|
58
|
+
gemfile: gemfiles/Gemfile-rails.8.0.x
|
|
48
59
|
- ruby: '3.1'
|
|
49
60
|
gemfile: gemfiles/Gemfile-rails.6.0.x
|
|
61
|
+
- ruby: '3.1'
|
|
62
|
+
gemfile: gemfiles/Gemfile-rails.8.0.x
|
|
50
63
|
- ruby: '3.2'
|
|
51
64
|
gemfile: gemfiles/Gemfile-rails.6.0.x
|
|
52
65
|
- ruby: '3.3'
|
|
53
66
|
gemfile: gemfiles/Gemfile-rails.6.0.x
|
|
54
67
|
- ruby: '3.3'
|
|
55
68
|
gemfile: gemfiles/Gemfile-rails.6.1.x
|
|
69
|
+
- ruby: '3.4'
|
|
70
|
+
gemfile: gemfiles/Gemfile-rails.6.0.x
|
|
71
|
+
- ruby: '3.4'
|
|
72
|
+
gemfile: gemfiles/Gemfile-rails.6.1.x
|
|
73
|
+
- ruby: '3.4'
|
|
74
|
+
gemfile: gemfiles/Gemfile-rails.7.0.x
|
|
56
75
|
|
|
57
76
|
env:
|
|
58
77
|
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
|
@@ -64,7 +83,19 @@ jobs:
|
|
|
64
83
|
- uses: ruby/setup-ruby@v1
|
|
65
84
|
with:
|
|
66
85
|
ruby-version: ${{ matrix.ruby }}
|
|
86
|
+
rubygems: latest
|
|
67
87
|
bundler-cache: true
|
|
88
|
+
|
|
89
|
+
- uses: actions/setup-node@v4
|
|
90
|
+
with:
|
|
91
|
+
node-version: 20.x
|
|
92
|
+
cache: yarn
|
|
93
|
+
|
|
94
|
+
- name: Install Node dependencies
|
|
95
|
+
run: yarn install --frozen-lockfile --production=false
|
|
96
|
+
|
|
97
|
+
- name: Build TypeScript
|
|
98
|
+
run: yarn build
|
|
68
99
|
|
|
69
100
|
- name: Ruby specs
|
|
70
101
|
run: bundle exec rake run_spec:gem
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
name: Test Both Bundlers
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
branches: [master, main]
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
test-webpack:
|
|
10
|
+
name: Test with Webpack
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
defaults:
|
|
13
|
+
run:
|
|
14
|
+
working-directory: spec/dummy
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Setup Ruby
|
|
20
|
+
uses: ruby/setup-ruby@v1
|
|
21
|
+
with:
|
|
22
|
+
ruby-version: '3.2'
|
|
23
|
+
bundler-cache: true
|
|
24
|
+
working-directory: spec/dummy
|
|
25
|
+
|
|
26
|
+
- name: Setup Node
|
|
27
|
+
uses: actions/setup-node@v4
|
|
28
|
+
with:
|
|
29
|
+
node-version: '20'
|
|
30
|
+
cache: 'yarn'
|
|
31
|
+
cache-dependency-path: spec/dummy/yarn.lock
|
|
32
|
+
|
|
33
|
+
- name: Install yalc
|
|
34
|
+
run: npm install -g yalc
|
|
35
|
+
|
|
36
|
+
- name: Build TypeScript
|
|
37
|
+
run: |
|
|
38
|
+
cd ../..
|
|
39
|
+
yarn install --frozen-lockfile --production=false
|
|
40
|
+
yarn build
|
|
41
|
+
|
|
42
|
+
- name: Publish shakapacker to yalc
|
|
43
|
+
run: |
|
|
44
|
+
cd ../..
|
|
45
|
+
yalc publish
|
|
46
|
+
|
|
47
|
+
- name: Install dependencies
|
|
48
|
+
run: |
|
|
49
|
+
yalc link shakapacker
|
|
50
|
+
yarn install
|
|
51
|
+
|
|
52
|
+
- name: Switch to Webpack
|
|
53
|
+
run: bin/test-bundler webpack
|
|
54
|
+
|
|
55
|
+
- name: Build with Webpack
|
|
56
|
+
run: bin/shakapacker
|
|
57
|
+
|
|
58
|
+
- name: Run tests with Webpack
|
|
59
|
+
run: |
|
|
60
|
+
bundle exec rspec
|
|
61
|
+
|
|
62
|
+
test-rspack:
|
|
63
|
+
name: Test with RSpack
|
|
64
|
+
runs-on: ubuntu-latest
|
|
65
|
+
defaults:
|
|
66
|
+
run:
|
|
67
|
+
working-directory: spec/dummy
|
|
68
|
+
|
|
69
|
+
steps:
|
|
70
|
+
- uses: actions/checkout@v4
|
|
71
|
+
|
|
72
|
+
- name: Setup Ruby
|
|
73
|
+
uses: ruby/setup-ruby@v1
|
|
74
|
+
with:
|
|
75
|
+
ruby-version: '3.2'
|
|
76
|
+
bundler-cache: true
|
|
77
|
+
working-directory: spec/dummy
|
|
78
|
+
|
|
79
|
+
- name: Setup Node
|
|
80
|
+
uses: actions/setup-node@v4
|
|
81
|
+
with:
|
|
82
|
+
node-version: '20'
|
|
83
|
+
cache: 'yarn'
|
|
84
|
+
cache-dependency-path: spec/dummy/yarn.lock
|
|
85
|
+
|
|
86
|
+
- name: Install yalc
|
|
87
|
+
run: npm install -g yalc
|
|
88
|
+
|
|
89
|
+
- name: Build TypeScript
|
|
90
|
+
run: |
|
|
91
|
+
cd ../..
|
|
92
|
+
yarn install --frozen-lockfile --production=false
|
|
93
|
+
yarn build
|
|
94
|
+
|
|
95
|
+
- name: Publish shakapacker to yalc
|
|
96
|
+
run: |
|
|
97
|
+
cd ../..
|
|
98
|
+
yalc publish
|
|
99
|
+
|
|
100
|
+
- name: Install dependencies
|
|
101
|
+
run: |
|
|
102
|
+
yalc link shakapacker
|
|
103
|
+
yarn install
|
|
104
|
+
|
|
105
|
+
- name: Switch to RSpack
|
|
106
|
+
run: bin/test-bundler rspack
|
|
107
|
+
|
|
108
|
+
- name: Build with RSpack
|
|
109
|
+
run: bin/shakapacker
|
|
110
|
+
|
|
111
|
+
- name: Run tests with RSpack
|
|
112
|
+
run: |
|
|
113
|
+
bundle exec rspec
|
|
114
|
+
|
|
115
|
+
test-switching:
|
|
116
|
+
name: Test Bundler Switching
|
|
117
|
+
runs-on: ubuntu-latest
|
|
118
|
+
defaults:
|
|
119
|
+
run:
|
|
120
|
+
working-directory: spec/dummy
|
|
121
|
+
|
|
122
|
+
steps:
|
|
123
|
+
- uses: actions/checkout@v4
|
|
124
|
+
|
|
125
|
+
- name: Setup Ruby
|
|
126
|
+
uses: ruby/setup-ruby@v1
|
|
127
|
+
with:
|
|
128
|
+
ruby-version: '3.2'
|
|
129
|
+
bundler-cache: true
|
|
130
|
+
working-directory: spec/dummy
|
|
131
|
+
|
|
132
|
+
- name: Setup Node
|
|
133
|
+
uses: actions/setup-node@v4
|
|
134
|
+
with:
|
|
135
|
+
node-version: '20'
|
|
136
|
+
cache: 'yarn'
|
|
137
|
+
cache-dependency-path: spec/dummy/yarn.lock
|
|
138
|
+
|
|
139
|
+
- name: Install yalc
|
|
140
|
+
run: npm install -g yalc
|
|
141
|
+
|
|
142
|
+
- name: Build TypeScript
|
|
143
|
+
run: |
|
|
144
|
+
cd ../..
|
|
145
|
+
yarn install --frozen-lockfile --production=false
|
|
146
|
+
yarn build
|
|
147
|
+
|
|
148
|
+
- name: Publish shakapacker to yalc
|
|
149
|
+
run: |
|
|
150
|
+
cd ../..
|
|
151
|
+
yalc publish
|
|
152
|
+
|
|
153
|
+
- name: Install dependencies
|
|
154
|
+
run: |
|
|
155
|
+
yalc link shakapacker
|
|
156
|
+
yarn install
|
|
157
|
+
|
|
158
|
+
- name: Test switching between bundlers
|
|
159
|
+
run: |
|
|
160
|
+
# Start with webpack
|
|
161
|
+
bin/test-bundler webpack
|
|
162
|
+
bin/shakapacker
|
|
163
|
+
|
|
164
|
+
# Switch to rspack
|
|
165
|
+
bin/test-bundler rspack
|
|
166
|
+
bin/shakapacker
|
|
167
|
+
|
|
168
|
+
# Switch back to webpack
|
|
169
|
+
bin/test-bundler webpack
|
|
170
|
+
bin/shakapacker
|
data/.gitignore
CHANGED
|
@@ -11,6 +11,26 @@ 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
|
|
18
|
+
|
|
19
|
+
# Config exporter output directory
|
|
20
|
+
shakapacker-config-exports/
|
|
21
|
+
|
|
22
|
+
# TypeScript generated files
|
|
23
|
+
package/**/*.d.ts
|
|
24
|
+
package/**/*.d.ts.map
|
|
25
|
+
package/**/*.js.map
|
|
26
|
+
# Ignore compiled JS files from TypeScript sources
|
|
27
|
+
package/**/*.js
|
|
28
|
+
# Keep specific files that are not TypeScript-generated
|
|
29
|
+
!package/index.d.ts
|
|
30
|
+
!package/loaders.d.ts
|
|
31
|
+
!package/webpack-types.d.ts
|
|
32
|
+
!package/babel/preset-react.js
|
|
33
|
+
!package/loaders/*.js
|
|
34
|
+
!package/__mocks__/*.js
|
|
35
|
+
!package/utils/get_style_rule.js
|
|
36
|
+
!package/utils/node_modules.js
|
data/.husky/pre-commit
ADDED