Skip to content

Commit 84c4efa

Browse files
authored
refactor: move test dirs to tests (#6973)
* refactor: move test dirs to tests * refactor: move test dirs to tests * refactor: move test dirs to tests * refactor: move test dirs to tests * refactor: move test dirs to tests * refactor: move test dirs to tests
1 parent e7ff748 commit 84c4efa

File tree

8,968 files changed

+1745
-2321
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

8,968 files changed

+1745
-2321
lines changed

.eslintignore

+2-5
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,9 @@ packages/rspack-plugin-preact-refresh/client
1111
packages/playground
1212
packages/rspack/src/stats/DefaultStatsPrinterPlugin.ts
1313
packages/rspack-test-tools/template
14-
webpack-examples
15-
webpack-test
16-
webpack-cli-test
1714
examples
18-
diffcases
1915
scripts/test/diff.cjs
2016
scripts/test/binary-path.cjs
21-
plugin-test
2217
scripts
18+
19+
tests/**/*

.gitattributes

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
webpack-examples/**/*.js linguist-detectable=false
2-
webpack-test/**/*.js linguist-detectable=false
1+
tests/**/*.js linguist-detectable=false
32
**/tests/**/*.js linguist-detectable=false
43
**/tests/** eol=lf
54
*.snap.txt text -eol=lf diff=markdown linguist-language=Markdown -linguist-documentation=false -linguist-detectable=false

.github/CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pnpm-lock.yaml
2020

2121
# Webpack Tests
2222

23-
/webpack-test
23+
/tests/webpack-test
2424

2525
# Crates in alphabetical order
2626

.github/actions/webpack-test-metric-diff/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ runs:
1616
shell: bash
1717
run: |
1818
echo "## Test Compatibility Diff" > output.md
19-
node ./webpack-test/scripts/pr-diff.js ${{ inputs.github-token }} ${{ inputs.sha }}
19+
node ./tests/webpack-test/scripts/pr-diff.js ${{ inputs.github-token }} ${{ inputs.sha }}
2020
2121
echo "comment=$comment" >> $GITHUB_OUTPUT
2222

.github/renovate.json

+114-32
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,164 @@
11
{
22
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
33
"timezone": "Asia/Shanghai",
4-
"schedule": ["before 8am on wednesday"],
5-
"enabledManagers": ["github-actions", "cargo", "npm"],
4+
"schedule": [
5+
"before 8am on wednesday"
6+
],
7+
"enabledManagers": [
8+
"github-actions",
9+
"cargo",
10+
"npm"
11+
],
612
"ignorePaths": [
713
"**/fixtures/**",
814
"**/tests/**",
915
"npm/**",
10-
"webpack-examples/**",
11-
"webpack-test/**"
16+
"tests/webpack-examples/**",
17+
"tests/webpack-test/**"
1218
],
1319
"assignees": [],
1420
"packageRules": [
1521
{
1622
"groupName": "github-actions",
17-
"matchManagers": ["github-actions"],
18-
"excludePackageNames": ["actions/upload-artifact", "actions/download-artifact"]
23+
"matchManagers": [
24+
"github-actions"
25+
],
26+
"excludePackageNames": [
27+
"actions/upload-artifact",
28+
"actions/download-artifact"
29+
]
1930
},
2031
{
2132
"groupName": "upload-download-actions",
22-
"matchManagers": ["github-actions"],
23-
"matchPackageNames": ["actions/upload-artifact", "actions/download-artifact"],
33+
"matchManagers": [
34+
"github-actions"
35+
],
36+
"matchPackageNames": [
37+
"actions/upload-artifact",
38+
"actions/download-artifact"
39+
],
2440
"enabled": false
2541
},
2642
{
2743
"groupName": "crates",
28-
"matchManagers": ["cargo"],
29-
"excludePackagePrefixes": ["swc", "napi"],
30-
"excludePackageNames": ["ustr", "textwrap", "styled_components", "owo-colors", "miette", "rkyv"]
44+
"matchManagers": [
45+
"cargo"
46+
],
47+
"excludePackagePrefixes": [
48+
"swc",
49+
"napi"
50+
],
51+
"excludePackageNames": [
52+
"ustr",
53+
"textwrap",
54+
"styled_components",
55+
"owo-colors",
56+
"miette",
57+
"rkyv"
58+
]
3159
},
3260
{
3361
"groupName": "swc",
34-
"matchManagers": ["cargo"],
35-
"matchPackagePrefixes": ["swc"],
36-
"matchPackageNames": ["styled_components"]
62+
"matchManagers": [
63+
"cargo"
64+
],
65+
"matchPackagePrefixes": [
66+
"swc"
67+
],
68+
"matchPackageNames": [
69+
"styled_components"
70+
]
3771
},
3872
{
3973
"groupName": "napi",
40-
"matchManagers": ["cargo"],
41-
"matchPackagePrefixes": ["napi"]
74+
"matchManagers": [
75+
"cargo"
76+
],
77+
"matchPackagePrefixes": [
78+
"napi"
79+
]
4280
},
4381
{
4482
"groupName": "ignored crates",
45-
"matchManagers": ["cargo"],
46-
"matchPackageNames": ["ustr", "textwrap", "owo-colors", "miette", "rkyv"],
83+
"matchManagers": [
84+
"cargo"
85+
],
86+
"matchPackageNames": [
87+
"ustr",
88+
"textwrap",
89+
"owo-colors",
90+
"miette",
91+
"rkyv"
92+
],
4793
"enabled": false
4894
},
4995
{
5096
"groupName": "ignored indexmap",
51-
"matchManagers": ["cargo"],
52-
"matchFileNames": ["crates/rspack_plugin_css/Cargo.toml"],
53-
"matchPackageNames": ["indexmap"],
97+
"matchManagers": [
98+
"cargo"
99+
],
100+
"matchFileNames": [
101+
"crates/rspack_plugin_css/Cargo.toml"
102+
],
103+
"matchPackageNames": [
104+
"indexmap"
105+
],
54106
"enabled": false
55107
},
56108
{
57109
"groupName": "npm dev dependencies",
58-
"matchManagers": ["npm"],
59-
"matchDepTypes": ["devDependencies"],
60-
"excludePackagePrefixes": ["webpack", "sass"],
61-
"excludePackageNames": ["@playwright/test", "react", "react-dom", "typescript", "pnpm"]
110+
"matchManagers": [
111+
"npm"
112+
],
113+
"matchDepTypes": [
114+
"devDependencies"
115+
],
116+
"excludePackagePrefixes": [
117+
"webpack",
118+
"sass"
119+
],
120+
"excludePackageNames": [
121+
"@playwright/test",
122+
"react",
123+
"react-dom",
124+
"typescript",
125+
"pnpm"
126+
]
62127
},
63128
{
64129
"groupName": "npm dependencies",
65-
"matchManagers": ["npm"],
66-
"matchDepTypes": ["dependencies"],
130+
"matchManagers": [
131+
"npm"
132+
],
133+
"matchDepTypes": [
134+
"dependencies"
135+
],
67136
"enabled": false
68137
},
69138
{
70139
"groupName": "npm ignored dependencies",
71-
"matchManagers": ["npm"],
72-
"matchPackageNames": ["@playwright/test", "react", "react-dom", "typescript", "pnpm", "sass"],
140+
"matchManagers": [
141+
"npm"
142+
],
143+
"matchPackageNames": [
144+
"@playwright/test",
145+
"react",
146+
"react-dom",
147+
"typescript",
148+
"pnpm",
149+
"sass"
150+
],
73151
"enabled": false
74152
},
75153
{
76154
"groupName": "webpack",
77-
"matchManagers": ["npm"],
78-
"matchPackagePrefixes": ["webpack"],
155+
"matchManagers": [
156+
"npm"
157+
],
158+
"matchPackagePrefixes": [
159+
"webpack"
160+
],
79161
"enabled": false
80162
}
81163
]
82-
}
164+
}

.github/workflows/reusable-build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ jobs:
314314
### Note that, We can't merge this script, because this script only runs on main branch
315315
- name: Update main branch test compatibility metric
316316
if: ${{ github.repository_owner == 'web-infra-dev' && inputs.target == 'x86_64-unknown-linux-gnu' && github.ref_name == 'main' && matrix.node == '18' && !inputs.skipable }}
317-
run: node ./webpack-test/scripts/generate.js ${{ secrets.GITHUB_TOKEN }} ${{ github.sha }}
317+
run: node ./tests/webpack-test/scripts/generate.js ${{ secrets.GITHUB_TOKEN }} ${{ github.sha }}
318318

319319
# ### update metric diff against main branch when pull request change
320320
- name: Update

.gitignore

+13-13
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ build/Release
5858
# Dependency directories
5959
node_modules/
6060
!scripts/node_modules/
61-
!webpack-examples/*/node_modules
62-
!webpack-test/*/**/node_modules
61+
!tests/webpack-examples/*/node_modules
62+
!tests/webpack-test/*/**/node_modules
6363
!packages/rspack-cli/tests/**/node_modules
6464
!packages/rspack-test-tools/tests/**/node_modules
6565
jspm_packages/
@@ -209,17 +209,17 @@ justfile
209209
## Angular Incremental Build Cache
210210
**/.angular/
211211
# align to webpack
212-
/webpack-test/js
213-
/webpack-test/browsertest/js
214-
/webpack-test/fixtures/temp-*
215-
/webpack-test/temp
216-
/webpack-test/ChangesAndRemovals
217-
/webpack-test/**/dev-defaults.webpack.lock
218-
!/webpack-test/**/target
219-
!/webpack-test/cases/**/node_modules
220-
221-
/plugin-test/css-extract/js
222-
!/plugin-test/css-extract/**/node_modules
212+
tests/webpack-test/js
213+
tests/webpack-test/browsertest/js
214+
tests/webpack-test/fixtures/temp-*
215+
tests/webpack-test/temp
216+
tests/webpack-test/ChangesAndRemovals
217+
tests/webpack-test/**/dev-defaults.webpack.lock
218+
!tests/webpack-test/**/target
219+
!tests/webpack-test/cases/**/node_modules
220+
221+
tests/plugin-test/css-extract/js
222+
!tests/plugin-test/css-extract/**/node_modules
223223

224224
/webpack-examples/**/dist
225225

.prettierignore

+1-6
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ packages/rspack-test-tools/tests/**/*
1515
packages/rspack-test-preact-refresh/tests/**/*
1616
packages/rspack-plugin-mini-css-extract/test/cases/**/*
1717

18-
plugin-test/**/*
19-
2018
crates/**/*
2119
target/**/*
22-
23-
webpack-test/**/*
24-
webpack-cli-test/**/*
25-
webpack-examples/**/*
20+
tests/**/*

.typos.toml

+1-4
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@ extend-exclude = [
99
"**/mock/**",
1010
"packages/rspack-test-tools",
1111
"packages/rspack/src/util/hash",
12-
"webpack-examples",
13-
"webpack-test",
14-
"plugin-test",
15-
"webpack-cli-test",
12+
"tests/**",
1613
"**/CHANGELOG.md",
1714
"GOVERNANCE.md",
1815
"pnpm-lock.yaml",

biome.json

+2-5
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,8 @@
99
"packages/rspack/src/config/schema.check.js",
1010
"packages/**/etc/**/*",
1111
"packages/**/compiled/**/*",
12-
"plugin-test/**/*",
1312
"crates/**/*",
14-
"webpack-test/**/*",
15-
"webpack-cli-test/**/*",
16-
"webpack-examples/**/*",
13+
"tests/**/*",
1714
"packages/playground/**/*",
1815
"packages/rspack-dev-server/client",
1916
"packages/rspack-plugin-react-refresh/client",
@@ -33,4 +30,4 @@
3330
"clientKind": "git",
3431
"useIgnoreFile": true
3532
}
36-
}
33+
}

crates/rspack_core/src/concatenated_module.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ impl Module for ConcatenatedModule {
702702
continue;
703703
}
704704
// deconflict naming from inner scope, the module level deconflict will be finished
705-
// you could see webpack-test/cases/scope-hoisting/renaming-4967 as a example
705+
// you could see tests/webpack-test/cases/scope-hoisting/renaming-4967 as a example
706706
// during module eval phase.
707707
if ident.id.span.ctxt != info.module_ctxt {
708708
all_used_names.insert(ident.id.sym.to_string());

crates/rspack_plugin_javascript/src/dependency/commonjs/module_decorator_dependency.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl DependencyTemplate for ModuleDecoratorDependency {
5252
.expect("should have mgm");
5353
let module_argument = module.get_module_argument();
5454

55-
// ref: webpack-test/cases/scope-hoisting/issue-5096 will return a `null` as module id
55+
// ref: tests/webpack-test/cases/scope-hoisting/issue-5096 will return a `null` as module id
5656
let module_id = compilation
5757
.chunk_graph
5858
.get_module_id(module.identifier())

packages/playground/package.json

+5-3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
"url": "https://github.com/web-infra-dev/rspack",
1212
"directory": "packages/playground"
1313
},
14+
"dependencies": {
15+
"react": "18.3.1",
16+
"react-dom": "18.3.1"
17+
},
1418
"devDependencies": {
1519
"@babel/core": "^7.22.20",
1620
"@babel/preset-react": "^7.22.15",
@@ -25,13 +29,11 @@
2529
"fs-extra": "11.2.0",
2630
"postcss": "^8.4.21",
2731
"postcss-loader": "^8.0.0",
28-
"react": "^18.2.0",
29-
"react-dom": "^18.2.0",
3032
"react-refresh": "^0.14.0",
3133
"tailwindcss": "^3.3.0",
3234
"vue": "3.4.21",
3335
"vue-loader": "^17.3.1",
3436
"webpack-dev-server": "4.13.1",
3537
"ws": "8.17.1"
3638
}
37-
}
39+
}

0 commit comments

Comments
 (0)