Skip to content

Commit

Permalink
Merge branch 'web-infra-dev:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
wChenonly authored Oct 9, 2024
2 parents 3375bbd + 4586fd9 commit b9a5411
Show file tree
Hide file tree
Showing 1,541 changed files with 41,120 additions and 23,526 deletions.
3 changes: 2 additions & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ rustflags = [
"-Wclippy::same_name_method",

"-Aclippy::default_constructed_unit_structs",
"-C", "symbol-mangling-version=v0"
"-C", "symbol-mangling-version=v0",
"--cfg", "tokio_unstable"
]

# Fix napi breaking in test environment <https://github.com/napi-rs/napi-rs/issues/1005#issuecomment-1011034770>
Expand Down
17 changes: 0 additions & 17 deletions .eslintignore

This file was deleted.

5 changes: 0 additions & 5 deletions .eslintrc.json

This file was deleted.

1 change: 0 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ pnpm-lock.yaml
/packages/rspack
/packages/rspack-cli
/packages/rspack-dev-middleware
/packages/rspack-dev-server
/packages/rspack-plugin-html
/packages/rspack-plugin-minify
/packages/rspack-plugin-node-polyfill
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
open_collective: rspack
open_collective: rspack
52 changes: 52 additions & 0 deletions .github/actions/clean/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Clean Repository

inputs:
target:
required: true
type: string

runs:
using: composite
steps:
- name: Git Clean
shell: bash
run: |
git config --system core.longpaths true
rm -rf node_modules
git clean -ffdx -e target
git reset --hard HEAD
- name: Clean Large Directories by Size
if: ${{ !contains(inputs.target, 'windows') }}
shell: bash
run: |
if [ -d "target" ]; then
TARGET_SIZE=$(du -s target | awk '{print $1}')
MAX_SIZE=$((50 * 1024 * 1024))
echo "MAX_SIZE = $MAX_SIZE"
if [ "$TARGET_SIZE" -gt "$MAX_SIZE" ]; then
echo "`target` directory size is greater than 50GB, deleting..."
rm -rf target
else
echo "`target` directory size is within limits."
fi
fi
- name: Clean Large Directories by Time
if: ${{ contains(inputs.target, 'windows') }}
shell: bash
run: |
if [ -d "target" ]; then
TARGET_CREATION_TIME=$(powershell -Command "(Get-Item 'target').CreationTime")
TWO_WEEKS_AGO=$(date -d '2 weeks ago' +%s)
echo "TARGET_CREATION_TIME = $TARGET_CREATION_TIME"
if [ "$TARGET_CREATION_TIME" -lt "$TWO_WEEKS_AGO" ]; then
echo "'target' directory is older than 2 weeks, deleting..."
rm -rf target
else
echo "'target' directory is within 2 weeks."
fi
fi
2 changes: 1 addition & 1 deletion .github/actions/docker-run/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ inputs:
required: true
type: string
options:
description: 'Options for docker'
description: "Options for docker"
default: ""
required: false
type: string
Expand Down
12 changes: 6 additions & 6 deletions .github/actions/download-artifact/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ description: Download file to local or artifact to quickly share files between j

inputs:
name:
description: 'Artifact name'
default: 'artifact'
description: "Artifact name"
default: "artifact"
path:
description: 'Destination path'
description: "Destination path"
required: true
try-local-cache:
description: 'Try use local cache to save artifact'
description: "Try use local cache to save artifact"
default: false
required: false
type: boolean
link-when-local:
description: 'Link file instead of copy file'
description: "Link file instead of copy file"
default: false
type: boolean
required: false
Expand All @@ -24,7 +24,7 @@ runs:
using: composite
steps:
- name: Download artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4.1.7
if: ${{ startsWith(runner.name, 'GitHub Actions') || inputs.try-local-cache == 'false' }}
with:
name: ${{ inputs.name }}
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/rustup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ inputs:
required: false
type: boolean
shared-key:
default: 'check'
default: "check"
required: false
type: string

Expand Down
13 changes: 7 additions & 6 deletions .github/actions/upload-artifact/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ description: Upload file to local or artifact to quickly share files between job

inputs:
name:
description: 'Artifact name'
default: 'artifact'
description: "Artifact name"
default: "artifact"
path:
description: 'A file, directory or wildcard pattern that describes what to upload'
description: "A file, directory or wildcard pattern that describes what to upload"
required: true
try-local-cache:
description: 'Try use local cache to save artifact'
description: "Try use local cache to save artifact"
default: false
required: false
type: boolean
mv-when-local:
description: 'Move file instead of copy file'
description: "Move file instead of copy file"
default: false
type: boolean
required: false
Expand All @@ -29,12 +29,13 @@ runs:
using: composite
steps:
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: ${{ startsWith(runner.name, 'GitHub Actions') || inputs.try-local-cache == 'false' }}
with:
name: ${{ inputs.name }}
path: ${{ inputs.path }}
if-no-files-found: error
overwrite: true
- name: Upload local
id: upload-local
if: ${{ !startsWith(runner.name, 'GitHub Actions') && inputs.try-local-cache == 'true' }}
Expand Down
9 changes: 4 additions & 5 deletions .github/actions/webpack-test-metric-diff/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ runs:
id: previous-comment
with:
issue-number: ${{ steps.pr-number.outputs.pr }}
body-includes: Test Compatibility Diff
body-includes: Test Compatibility Diff

- name: Update existing comment
if: github.event_name == 'pull_request' && steps.previous-comment.outputs.comment-id
uses: peter-evans/create-or-update-comment@v4
continue-on-error: true
with:
comment-id: ${{ steps.previous-comment.outputs.comment-id }}
body-path: 'output.md'

body-path: "output.md"
# body: |
# ${{ steps.pr-diff.outputs.comment }}
edit-mode: replace
Expand All @@ -52,5 +52,4 @@ runs:
with:
issue-number: ${{ steps.pr-number.outputs.pr }}

body-path: 'output.md'

body-path: "output.md"
44 changes: 23 additions & 21 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"timezone": "Asia/Shanghai",
"extends": [":dependencyDashboard"],
"extends": [
":dependencyDashboard"
],
"schedule": [
"before 8am on wednesday"
],
Expand Down Expand Up @@ -116,15 +118,17 @@
"devDependencies"
],
"excludePackagePrefixes": [
"webpack",
"sass"
"webpack"
],
"excludePackageNames": [
"@playwright/test",
"react",
"react-dom",
"typescript",
"pnpm"
"pnpm",
"@playwright/test"
],
// bump major in a separate PR
"matchUpdateTypes": [
"patch",
"minor"
]
},
{
Expand All @@ -135,32 +139,30 @@
"matchDepTypes": [
"dependencies"
],
"enabled": false
// bump major in a separate PR
"matchUpdateTypes": [
"patch",
"minor"
]
},
{
"groupName": "npm ignored dependencies",
"groupName": "webpack",
"matchManagers": [
"npm"
],
"matchPackageNames": [
"@playwright/test",
"react",
"react-dom",
"typescript",
"pnpm",
"sass"
"matchPackagePrefixes": [
"webpack"
],
"enabled": false
},
{
"groupName": "webpack",
"groupName": "playwright",
"matchManagers": [
"npm"
],
"matchPackagePrefixes": [
"webpack"
],
"enabled": false
"@playwright/test"
]
}
]
}
}
5 changes: 3 additions & 2 deletions .github/teams.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ team:
- "@h-a-n-a"
- "@bvanjoi"
- "@ahabhgk"
- "@hyf0"
- "@underfin"
- "@jerrykingxyz"
- "@chenjiahan"
- "@JSerFeng"
Expand All @@ -18,3 +16,6 @@ team:
- "@LingyuCoder"
- "@yuyutaotao"
- "@SyMind"
- "@SoonIter"
- "@fi3ework"
- "@Timeless0911"
16 changes: 14 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: crate-ci/typos@v1.23.6
- uses: crate-ci/typos@v1.26.0
with:
files: .

Expand Down Expand Up @@ -288,7 +288,7 @@ jobs:
- uses: ./.github/actions/rustup
with:
shared-key: check
- uses: cargo-bins/cargo-binstall@v1.9.0
- uses: cargo-bins/cargo-binstall@v1.10.7
- run: cargo binstall --no-confirm cargo-shear
- run: cargo shear

Expand Down Expand Up @@ -388,3 +388,15 @@ jobs:
commitID: [${{github.sha}}](${{github.server_url}}/${{github.repository}}/commit/${{github.sha}})
URL: ${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}
LARK_WEBHOOK_URL: ${{secrets.LARK_WEBHOOK_URL}}

pkg-preview:
name: Pkg Preview
needs:
- test-linux
- test-windows
- cargo-deny
- lint
- rust_check
- rust_test
if: ${{ (success() || cancelled()) && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: ./.github/workflows/preview-commit.yml
4 changes: 2 additions & 2 deletions .github/workflows/issue-mark-assignee.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ jobs:
- name: mark assignee
uses: actions-cool/issues-helper@v3
with:
actions: 'mark-assignees'
actions: "mark-assignees"
token: ${{ secrets.GITHUB_TOKEN }}
require-permission: "none"
require-permission: "none"
3 changes: 1 addition & 2 deletions .github/workflows/issue-pr-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
node-version: "20"
- name: Check if triggered by project member
id: check_member
if: github.event.sender.type == 'User' && github.actor != 'renovate'
Expand Down Expand Up @@ -47,4 +47,3 @@ jobs:
URL: ${{ github.server_url }}/${{ github.repository }}/pull/${{ github.event.pull_request.number }}
run: |
SHORT_BODY=$(echo "$BODY" | head -n 3) TITLE="New PR Opened: $PR_TITLE" DESCRIPTION="PR by @$AUTHOR_ID: $SHORT_BODY. Check it out at $URL" TPL_COLOR="blue" TPL_BTN_TYPE="primary" ./scripts/alert/lark.js
Loading

0 comments on commit b9a5411

Please sign in to comment.