From 5afe7f2f9b04fad408d0fea98f5259a7383a4a7e Mon Sep 17 00:00:00 2001 From: harpsealjs Date: Thu, 25 Apr 2024 15:38:13 +0800 Subject: [PATCH] chore: migrate copy plugin cases (#6362) * chore: migrate copy plugin cases * chore: migrate copy plugin cases --- README.md | 1 + plugin-test/README.md | 8 ++++++-- .../copy-plugin}/CopyPlugin.test.js | 2 +- plugin-test/copy-plugin/README.md | 9 +++++++++ .../__snapshots__/CopyPlugin.test.js.snap | 0 .../copy-plugin}/build/.dottedfile | 0 .../copy-plugin}/build/.gitkeep | 0 .../copy-plugin}/build/_t1/dest1/tempfile1.txt | 0 .../build/_t1/dest2/directory/tempfile1.txt | 0 .../copy-plugin}/build/_t1/dest2/tempfile2.txt | 0 .../copy-plugin}/build/_t2/dest1/tempfile1.txt | 0 .../copy-plugin}/build/_t2/dest1/tempfile2.txt | 0 .../copy-plugin}/build/_t2/dest2/tempfile1.txt | 0 .../copy-plugin}/build/_t2/dest2/tempfile2.txt | 0 .../copy-plugin}/build/_t3/dest1/tempfile1.txt | 0 .../copy-plugin}/build/_t3/dest1/tempfile2.txt | 0 .../copy-plugin}/build/asset-modules/deepnested.txt | 0 .../copy-plugin}/build/binextension.bin | 0 .../copy-plugin}/build/directory/directoryfile.txt | 0 .../directory/nested/deep-nested/deepnested.txt | 0 .../build/directory/nested/nestedfile.txt | 0 .../copy-plugin}/build/directoryfile.txt | 0 .../copy-plugin}/build/file.txt | 0 .../copy-plugin}/build/first/file.txt | 0 .../copy-plugin}/build/main.js | 0 .../build/nested/deep-nested/deepnested.txt | 0 .../copy-plugin}/build/nested/nestedfile.txt | 0 .../copy-plugin}/build/newbinextension.bin | 0 .../copy-plugin}/build/newdirectory/.dottedfile | 0 .../build/newdirectory/deep-nested/deepnested.txt | 0 .../build/newdirectory/directory/directoryfile.txt | 0 .../directory/nested/deep-nested/deepnested.txt | 0 .../newdirectory/directory/nested/nestedfile.txt | 0 .../build/newdirectory/directoryfile.txt | 0 .../newdirectory/nested/deep-nested/deepnested.txt | 0 .../build/newdirectory/nested/nestedfile.txt | 0 .../copy-plugin}/build/newdirectory/nestedfile.txt | 0 .../copy-plugin}/build/newfile.txt | 0 .../copy-plugin}/build/noextension | 0 .../copy-plugin}/build/second/file.txt | 0 .../copy-plugin}/build/tempfile1.txt | 0 .../copy-plugin}/build/tempfile2.txt | 0 .../copy-plugin}/build/unoptimized.js | 0 .../copy-plugin}/fixtures/.file.txt | 0 .../copy-plugin}/fixtures/binextension.bin | 0 .../copy-plugin}/fixtures/directory/.dottedfile | 0 .../fixtures/directory/directoryfile.txt | 0 .../directory/nested/deep-nested/deepnested.txt | 0 .../fixtures/directory/nested/nestedfile.txt | 0 .../copy-plugin}/fixtures/file.txt | 0 .../copy-plugin}/fixtures/file.txt.gz | Bin .../copy-plugin}/fixtures/js/unoptimized.js | 0 .../copy-plugin}/fixtures/noextension | 0 .../copy-plugin}/fixtures/symlink/directory-ln | 0 .../fixtures/symlink/directory/file.txt | 0 .../nested-directory/file-in-nested-directory.txt | 0 .../copy-plugin}/fixtures/symlink/file-ln.txt | 0 .../copy-plugin}/fixtures/symlink/file.txt | 0 .../copy-plugin}/fixtures/watch/.gitkeep | 0 .../copy-plugin}/fixtures/watch/_t1/.gitkeep | 0 .../fixtures/watch/_t1/directory/.gitkeep | 0 .../copy-plugin}/fixtures/watch/_t2/.gitkeep | 0 .../fixtures/watch/_t2/directory/.gitkeep | 0 .../copy-plugin}/fixtures/watch/_t3/.gitkeep | 0 .../fixtures/watch/_t3/directory/.gitkeep | 0 .../copy-plugin}/fixtures/watch/_t4/.gitkeep | 0 .../fixtures/watch/_t4/directory/.gitkeep | 0 .../copy-plugin}/fixtures/watch/_t5/.gitkeep | 0 .../fixtures/watch/_t5/directory/.gitkeep | 0 .../copy-plugin}/fixtures/watch/directory/.gitkeep | 0 .../copy-plugin}/helpers/AsyncEventIterator.js | 0 .../copy-plugin}/helpers/built-in-modules/fs.js | 0 .../copy-plugin}/helpers/built-in-modules/path.js | 0 .../helpers/built-in-modules/process.js | 0 .../copy-plugin}/helpers/built-in-modules/stream.js | 0 .../copy-plugin}/helpers/built-in-modules/url.js | 0 .../copy-plugin}/helpers/built-in-modules/util.js | 0 .../copy-plugin}/helpers/compile.js | 0 .../helpers/enter-with-asset-modules.js | 0 .../copy-plugin}/helpers/enter.js | 0 .../copy-plugin}/helpers/getCompiler.js | 2 +- .../copy-plugin}/helpers/index.js | 0 .../copy-plugin}/helpers/readAsset.js | 0 .../copy-plugin}/helpers/readAssets.js | 0 .../helpers/removeIllegalCharacterForWindows.js | 0 .../copy-plugin}/helpers/run.js | 4 ++-- 86 files changed, 20 insertions(+), 6 deletions(-) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/CopyPlugin.test.js (99%) create mode 100644 plugin-test/copy-plugin/README.md rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/__snapshots__/CopyPlugin.test.js.snap (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/build/.dottedfile (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/build/.gitkeep (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/build/_t1/dest1/tempfile1.txt (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/build/_t1/dest2/directory/tempfile1.txt (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/build/_t1/dest2/tempfile2.txt (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/build/_t2/dest1/tempfile1.txt (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/build/_t2/dest1/tempfile2.txt (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/build/_t2/dest2/tempfile1.txt (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/build/_t2/dest2/tempfile2.txt (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/build/_t3/dest1/tempfile1.txt (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/build/_t3/dest1/tempfile2.txt (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/build/asset-modules/deepnested.txt (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/build/binextension.bin (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/build/directory/directoryfile.txt (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/build/directory/nested/deep-nested/deepnested.txt (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/build/directory/nested/nestedfile.txt (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/build/directoryfile.txt (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/build/file.txt (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/build/first/file.txt (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/build/main.js (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/build/nested/deep-nested/deepnested.txt (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/build/nested/nestedfile.txt (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/build/newbinextension.bin (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/build/newdirectory/.dottedfile (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/build/newdirectory/deep-nested/deepnested.txt (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/build/newdirectory/directory/directoryfile.txt (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/build/newdirectory/directory/nested/deep-nested/deepnested.txt (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/build/newdirectory/directory/nested/nestedfile.txt (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/build/newdirectory/directoryfile.txt (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/build/newdirectory/nested/deep-nested/deepnested.txt (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/build/newdirectory/nested/nestedfile.txt (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/build/newdirectory/nestedfile.txt (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/build/newfile.txt (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/build/noextension (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/build/second/file.txt (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/build/tempfile1.txt (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/build/tempfile2.txt (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/build/unoptimized.js (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/fixtures/.file.txt (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/fixtures/binextension.bin (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/fixtures/directory/.dottedfile (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/fixtures/directory/directoryfile.txt (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/fixtures/directory/nested/deep-nested/deepnested.txt (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/fixtures/directory/nested/nestedfile.txt (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/fixtures/file.txt (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/fixtures/file.txt.gz (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/fixtures/js/unoptimized.js (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/fixtures/noextension (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/fixtures/symlink/directory-ln (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/fixtures/symlink/directory/file.txt (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/fixtures/symlink/directory/nested-directory/file-in-nested-directory.txt (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/fixtures/symlink/file-ln.txt (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/fixtures/symlink/file.txt (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/fixtures/watch/.gitkeep (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/fixtures/watch/_t1/.gitkeep (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/fixtures/watch/_t1/directory/.gitkeep (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/fixtures/watch/_t2/.gitkeep (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/fixtures/watch/_t2/directory/.gitkeep (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/fixtures/watch/_t3/.gitkeep (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/fixtures/watch/_t3/directory/.gitkeep (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/fixtures/watch/_t4/.gitkeep (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/fixtures/watch/_t4/directory/.gitkeep (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/fixtures/watch/_t5/.gitkeep (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/fixtures/watch/_t5/directory/.gitkeep (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/fixtures/watch/directory/.gitkeep (100%) rename {packages/rspack/tests => plugin-test/copy-plugin}/helpers/AsyncEventIterator.js (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/helpers/built-in-modules/fs.js (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/helpers/built-in-modules/path.js (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/helpers/built-in-modules/process.js (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/helpers/built-in-modules/stream.js (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/helpers/built-in-modules/url.js (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/helpers/built-in-modules/util.js (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/helpers/compile.js (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/helpers/enter-with-asset-modules.js (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/helpers/enter.js (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/helpers/getCompiler.js (92%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/helpers/index.js (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/helpers/readAsset.js (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/helpers/readAssets.js (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/helpers/removeIllegalCharacterForWindows.js (100%) rename {packages/rspack/tests/copyPlugin => plugin-test/copy-plugin}/helpers/run.js (97%) diff --git a/README.md b/README.md index 22683b42382..1f4191febe9 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,7 @@ Thanks to: - The [Turbopack](https://github.com/vercel/turbo) project which inspired the AST path logic of Rspack. - The [react-refresh-webpack-plugin](https://github.com/pmmmwh/react-refresh-webpack-plugin) created by [@pmmmwh](https://github.com/pmmmwh), which inspires implement react refresh. - The [mini-css-extract-plugin] project created by [@sokra](https://github.com/sokra) which inspired implement css extract plugin. +- The [copy-webpack-plugin] project created by [@kevlened](https://github.com/kevlened) which inspired implement copy rspack plugin. ## License diff --git a/plugin-test/README.md b/plugin-test/README.md index 2d40f7d7397..bccb83047e8 100644 --- a/plugin-test/README.md +++ b/plugin-test/README.md @@ -1,8 +1,12 @@ >**Note** -> This package is heavily based on [mini-css-extract-plugin/test](https://github.com/webpack-contrib/mini-css-extract-plugin/tree/master/test) +> This package is heavily based on +> +> - [mini-css-extract-plugin/test](https://github.com/webpack-contrib/mini-css-extract-plugin/tree/master/test) +> - [copy-webpack-plugin](https://github.com/webpack-contrib/copy-webpack-plugin/tree/master/test) ## Credits Thanks to: -* The [mini-css-extract-plugin] project created by [@sokra](https://github.com/sokra) +- The [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin) project created by [@sokra](https://github.com/sokra) +- The [copy-webpack-plugin](https://github.com/webpack-contrib/copy-webpack-plugin) project created by [@kevlened](https://github.com/kevlened) diff --git a/packages/rspack/tests/copyPlugin/CopyPlugin.test.js b/plugin-test/copy-plugin/CopyPlugin.test.js similarity index 99% rename from packages/rspack/tests/copyPlugin/CopyPlugin.test.js rename to plugin-test/copy-plugin/CopyPlugin.test.js index aa28d41a3fc..3f7771d32e6 100644 --- a/packages/rspack/tests/copyPlugin/CopyPlugin.test.js +++ b/plugin-test/copy-plugin/CopyPlugin.test.js @@ -1,7 +1,7 @@ const path = require("path"); const fs = require("fs"); -const rspack = require("../../"); +const rspack = require("@rspack/core"); const { run, runEmit, runChange } = require("./helpers/run"); diff --git a/plugin-test/copy-plugin/README.md b/plugin-test/copy-plugin/README.md new file mode 100644 index 00000000000..409a3d8559f --- /dev/null +++ b/plugin-test/copy-plugin/README.md @@ -0,0 +1,9 @@ +/** + * The test code is modified based on + * https://github.com/webpack-contrib/copy-webpack-plugin/tree/master/test + * + * MIT Licensed + * Author Len Boyette @kevlened + * Copyright JS Foundation and other contributors + * https://github.com/webpack-contrib/copy-webpack-plugin/blob/master/LICENSE + */ \ No newline at end of file diff --git a/packages/rspack/tests/copyPlugin/__snapshots__/CopyPlugin.test.js.snap b/plugin-test/copy-plugin/__snapshots__/CopyPlugin.test.js.snap similarity index 100% rename from packages/rspack/tests/copyPlugin/__snapshots__/CopyPlugin.test.js.snap rename to plugin-test/copy-plugin/__snapshots__/CopyPlugin.test.js.snap diff --git a/packages/rspack/tests/copyPlugin/build/.dottedfile b/plugin-test/copy-plugin/build/.dottedfile similarity index 100% rename from packages/rspack/tests/copyPlugin/build/.dottedfile rename to plugin-test/copy-plugin/build/.dottedfile diff --git a/packages/rspack/tests/copyPlugin/build/.gitkeep b/plugin-test/copy-plugin/build/.gitkeep similarity index 100% rename from packages/rspack/tests/copyPlugin/build/.gitkeep rename to plugin-test/copy-plugin/build/.gitkeep diff --git a/packages/rspack/tests/copyPlugin/build/_t1/dest1/tempfile1.txt b/plugin-test/copy-plugin/build/_t1/dest1/tempfile1.txt similarity index 100% rename from packages/rspack/tests/copyPlugin/build/_t1/dest1/tempfile1.txt rename to plugin-test/copy-plugin/build/_t1/dest1/tempfile1.txt diff --git a/packages/rspack/tests/copyPlugin/build/_t1/dest2/directory/tempfile1.txt b/plugin-test/copy-plugin/build/_t1/dest2/directory/tempfile1.txt similarity index 100% rename from packages/rspack/tests/copyPlugin/build/_t1/dest2/directory/tempfile1.txt rename to plugin-test/copy-plugin/build/_t1/dest2/directory/tempfile1.txt diff --git a/packages/rspack/tests/copyPlugin/build/_t1/dest2/tempfile2.txt b/plugin-test/copy-plugin/build/_t1/dest2/tempfile2.txt similarity index 100% rename from packages/rspack/tests/copyPlugin/build/_t1/dest2/tempfile2.txt rename to plugin-test/copy-plugin/build/_t1/dest2/tempfile2.txt diff --git a/packages/rspack/tests/copyPlugin/build/_t2/dest1/tempfile1.txt b/plugin-test/copy-plugin/build/_t2/dest1/tempfile1.txt similarity index 100% rename from packages/rspack/tests/copyPlugin/build/_t2/dest1/tempfile1.txt rename to plugin-test/copy-plugin/build/_t2/dest1/tempfile1.txt diff --git a/packages/rspack/tests/copyPlugin/build/_t2/dest1/tempfile2.txt b/plugin-test/copy-plugin/build/_t2/dest1/tempfile2.txt similarity index 100% rename from packages/rspack/tests/copyPlugin/build/_t2/dest1/tempfile2.txt rename to plugin-test/copy-plugin/build/_t2/dest1/tempfile2.txt diff --git a/packages/rspack/tests/copyPlugin/build/_t2/dest2/tempfile1.txt b/plugin-test/copy-plugin/build/_t2/dest2/tempfile1.txt similarity index 100% rename from packages/rspack/tests/copyPlugin/build/_t2/dest2/tempfile1.txt rename to plugin-test/copy-plugin/build/_t2/dest2/tempfile1.txt diff --git a/packages/rspack/tests/copyPlugin/build/_t2/dest2/tempfile2.txt b/plugin-test/copy-plugin/build/_t2/dest2/tempfile2.txt similarity index 100% rename from packages/rspack/tests/copyPlugin/build/_t2/dest2/tempfile2.txt rename to plugin-test/copy-plugin/build/_t2/dest2/tempfile2.txt diff --git a/packages/rspack/tests/copyPlugin/build/_t3/dest1/tempfile1.txt b/plugin-test/copy-plugin/build/_t3/dest1/tempfile1.txt similarity index 100% rename from packages/rspack/tests/copyPlugin/build/_t3/dest1/tempfile1.txt rename to plugin-test/copy-plugin/build/_t3/dest1/tempfile1.txt diff --git a/packages/rspack/tests/copyPlugin/build/_t3/dest1/tempfile2.txt b/plugin-test/copy-plugin/build/_t3/dest1/tempfile2.txt similarity index 100% rename from packages/rspack/tests/copyPlugin/build/_t3/dest1/tempfile2.txt rename to plugin-test/copy-plugin/build/_t3/dest1/tempfile2.txt diff --git a/packages/rspack/tests/copyPlugin/build/asset-modules/deepnested.txt b/plugin-test/copy-plugin/build/asset-modules/deepnested.txt similarity index 100% rename from packages/rspack/tests/copyPlugin/build/asset-modules/deepnested.txt rename to plugin-test/copy-plugin/build/asset-modules/deepnested.txt diff --git a/packages/rspack/tests/copyPlugin/build/binextension.bin b/plugin-test/copy-plugin/build/binextension.bin similarity index 100% rename from packages/rspack/tests/copyPlugin/build/binextension.bin rename to plugin-test/copy-plugin/build/binextension.bin diff --git a/packages/rspack/tests/copyPlugin/build/directory/directoryfile.txt b/plugin-test/copy-plugin/build/directory/directoryfile.txt similarity index 100% rename from packages/rspack/tests/copyPlugin/build/directory/directoryfile.txt rename to plugin-test/copy-plugin/build/directory/directoryfile.txt diff --git a/packages/rspack/tests/copyPlugin/build/directory/nested/deep-nested/deepnested.txt b/plugin-test/copy-plugin/build/directory/nested/deep-nested/deepnested.txt similarity index 100% rename from packages/rspack/tests/copyPlugin/build/directory/nested/deep-nested/deepnested.txt rename to plugin-test/copy-plugin/build/directory/nested/deep-nested/deepnested.txt diff --git a/packages/rspack/tests/copyPlugin/build/directory/nested/nestedfile.txt b/plugin-test/copy-plugin/build/directory/nested/nestedfile.txt similarity index 100% rename from packages/rspack/tests/copyPlugin/build/directory/nested/nestedfile.txt rename to plugin-test/copy-plugin/build/directory/nested/nestedfile.txt diff --git a/packages/rspack/tests/copyPlugin/build/directoryfile.txt b/plugin-test/copy-plugin/build/directoryfile.txt similarity index 100% rename from packages/rspack/tests/copyPlugin/build/directoryfile.txt rename to plugin-test/copy-plugin/build/directoryfile.txt diff --git a/packages/rspack/tests/copyPlugin/build/file.txt b/plugin-test/copy-plugin/build/file.txt similarity index 100% rename from packages/rspack/tests/copyPlugin/build/file.txt rename to plugin-test/copy-plugin/build/file.txt diff --git a/packages/rspack/tests/copyPlugin/build/first/file.txt b/plugin-test/copy-plugin/build/first/file.txt similarity index 100% rename from packages/rspack/tests/copyPlugin/build/first/file.txt rename to plugin-test/copy-plugin/build/first/file.txt diff --git a/packages/rspack/tests/copyPlugin/build/main.js b/plugin-test/copy-plugin/build/main.js similarity index 100% rename from packages/rspack/tests/copyPlugin/build/main.js rename to plugin-test/copy-plugin/build/main.js diff --git a/packages/rspack/tests/copyPlugin/build/nested/deep-nested/deepnested.txt b/plugin-test/copy-plugin/build/nested/deep-nested/deepnested.txt similarity index 100% rename from packages/rspack/tests/copyPlugin/build/nested/deep-nested/deepnested.txt rename to plugin-test/copy-plugin/build/nested/deep-nested/deepnested.txt diff --git a/packages/rspack/tests/copyPlugin/build/nested/nestedfile.txt b/plugin-test/copy-plugin/build/nested/nestedfile.txt similarity index 100% rename from packages/rspack/tests/copyPlugin/build/nested/nestedfile.txt rename to plugin-test/copy-plugin/build/nested/nestedfile.txt diff --git a/packages/rspack/tests/copyPlugin/build/newbinextension.bin b/plugin-test/copy-plugin/build/newbinextension.bin similarity index 100% rename from packages/rspack/tests/copyPlugin/build/newbinextension.bin rename to plugin-test/copy-plugin/build/newbinextension.bin diff --git a/packages/rspack/tests/copyPlugin/build/newdirectory/.dottedfile b/plugin-test/copy-plugin/build/newdirectory/.dottedfile similarity index 100% rename from packages/rspack/tests/copyPlugin/build/newdirectory/.dottedfile rename to plugin-test/copy-plugin/build/newdirectory/.dottedfile diff --git a/packages/rspack/tests/copyPlugin/build/newdirectory/deep-nested/deepnested.txt b/plugin-test/copy-plugin/build/newdirectory/deep-nested/deepnested.txt similarity index 100% rename from packages/rspack/tests/copyPlugin/build/newdirectory/deep-nested/deepnested.txt rename to plugin-test/copy-plugin/build/newdirectory/deep-nested/deepnested.txt diff --git a/packages/rspack/tests/copyPlugin/build/newdirectory/directory/directoryfile.txt b/plugin-test/copy-plugin/build/newdirectory/directory/directoryfile.txt similarity index 100% rename from packages/rspack/tests/copyPlugin/build/newdirectory/directory/directoryfile.txt rename to plugin-test/copy-plugin/build/newdirectory/directory/directoryfile.txt diff --git a/packages/rspack/tests/copyPlugin/build/newdirectory/directory/nested/deep-nested/deepnested.txt b/plugin-test/copy-plugin/build/newdirectory/directory/nested/deep-nested/deepnested.txt similarity index 100% rename from packages/rspack/tests/copyPlugin/build/newdirectory/directory/nested/deep-nested/deepnested.txt rename to plugin-test/copy-plugin/build/newdirectory/directory/nested/deep-nested/deepnested.txt diff --git a/packages/rspack/tests/copyPlugin/build/newdirectory/directory/nested/nestedfile.txt b/plugin-test/copy-plugin/build/newdirectory/directory/nested/nestedfile.txt similarity index 100% rename from packages/rspack/tests/copyPlugin/build/newdirectory/directory/nested/nestedfile.txt rename to plugin-test/copy-plugin/build/newdirectory/directory/nested/nestedfile.txt diff --git a/packages/rspack/tests/copyPlugin/build/newdirectory/directoryfile.txt b/plugin-test/copy-plugin/build/newdirectory/directoryfile.txt similarity index 100% rename from packages/rspack/tests/copyPlugin/build/newdirectory/directoryfile.txt rename to plugin-test/copy-plugin/build/newdirectory/directoryfile.txt diff --git a/packages/rspack/tests/copyPlugin/build/newdirectory/nested/deep-nested/deepnested.txt b/plugin-test/copy-plugin/build/newdirectory/nested/deep-nested/deepnested.txt similarity index 100% rename from packages/rspack/tests/copyPlugin/build/newdirectory/nested/deep-nested/deepnested.txt rename to plugin-test/copy-plugin/build/newdirectory/nested/deep-nested/deepnested.txt diff --git a/packages/rspack/tests/copyPlugin/build/newdirectory/nested/nestedfile.txt b/plugin-test/copy-plugin/build/newdirectory/nested/nestedfile.txt similarity index 100% rename from packages/rspack/tests/copyPlugin/build/newdirectory/nested/nestedfile.txt rename to plugin-test/copy-plugin/build/newdirectory/nested/nestedfile.txt diff --git a/packages/rspack/tests/copyPlugin/build/newdirectory/nestedfile.txt b/plugin-test/copy-plugin/build/newdirectory/nestedfile.txt similarity index 100% rename from packages/rspack/tests/copyPlugin/build/newdirectory/nestedfile.txt rename to plugin-test/copy-plugin/build/newdirectory/nestedfile.txt diff --git a/packages/rspack/tests/copyPlugin/build/newfile.txt b/plugin-test/copy-plugin/build/newfile.txt similarity index 100% rename from packages/rspack/tests/copyPlugin/build/newfile.txt rename to plugin-test/copy-plugin/build/newfile.txt diff --git a/packages/rspack/tests/copyPlugin/build/noextension b/plugin-test/copy-plugin/build/noextension similarity index 100% rename from packages/rspack/tests/copyPlugin/build/noextension rename to plugin-test/copy-plugin/build/noextension diff --git a/packages/rspack/tests/copyPlugin/build/second/file.txt b/plugin-test/copy-plugin/build/second/file.txt similarity index 100% rename from packages/rspack/tests/copyPlugin/build/second/file.txt rename to plugin-test/copy-plugin/build/second/file.txt diff --git a/packages/rspack/tests/copyPlugin/build/tempfile1.txt b/plugin-test/copy-plugin/build/tempfile1.txt similarity index 100% rename from packages/rspack/tests/copyPlugin/build/tempfile1.txt rename to plugin-test/copy-plugin/build/tempfile1.txt diff --git a/packages/rspack/tests/copyPlugin/build/tempfile2.txt b/plugin-test/copy-plugin/build/tempfile2.txt similarity index 100% rename from packages/rspack/tests/copyPlugin/build/tempfile2.txt rename to plugin-test/copy-plugin/build/tempfile2.txt diff --git a/packages/rspack/tests/copyPlugin/build/unoptimized.js b/plugin-test/copy-plugin/build/unoptimized.js similarity index 100% rename from packages/rspack/tests/copyPlugin/build/unoptimized.js rename to plugin-test/copy-plugin/build/unoptimized.js diff --git a/packages/rspack/tests/copyPlugin/fixtures/.file.txt b/plugin-test/copy-plugin/fixtures/.file.txt similarity index 100% rename from packages/rspack/tests/copyPlugin/fixtures/.file.txt rename to plugin-test/copy-plugin/fixtures/.file.txt diff --git a/packages/rspack/tests/copyPlugin/fixtures/binextension.bin b/plugin-test/copy-plugin/fixtures/binextension.bin similarity index 100% rename from packages/rspack/tests/copyPlugin/fixtures/binextension.bin rename to plugin-test/copy-plugin/fixtures/binextension.bin diff --git a/packages/rspack/tests/copyPlugin/fixtures/directory/.dottedfile b/plugin-test/copy-plugin/fixtures/directory/.dottedfile similarity index 100% rename from packages/rspack/tests/copyPlugin/fixtures/directory/.dottedfile rename to plugin-test/copy-plugin/fixtures/directory/.dottedfile diff --git a/packages/rspack/tests/copyPlugin/fixtures/directory/directoryfile.txt b/plugin-test/copy-plugin/fixtures/directory/directoryfile.txt similarity index 100% rename from packages/rspack/tests/copyPlugin/fixtures/directory/directoryfile.txt rename to plugin-test/copy-plugin/fixtures/directory/directoryfile.txt diff --git a/packages/rspack/tests/copyPlugin/fixtures/directory/nested/deep-nested/deepnested.txt b/plugin-test/copy-plugin/fixtures/directory/nested/deep-nested/deepnested.txt similarity index 100% rename from packages/rspack/tests/copyPlugin/fixtures/directory/nested/deep-nested/deepnested.txt rename to plugin-test/copy-plugin/fixtures/directory/nested/deep-nested/deepnested.txt diff --git a/packages/rspack/tests/copyPlugin/fixtures/directory/nested/nestedfile.txt b/plugin-test/copy-plugin/fixtures/directory/nested/nestedfile.txt similarity index 100% rename from packages/rspack/tests/copyPlugin/fixtures/directory/nested/nestedfile.txt rename to plugin-test/copy-plugin/fixtures/directory/nested/nestedfile.txt diff --git a/packages/rspack/tests/copyPlugin/fixtures/file.txt b/plugin-test/copy-plugin/fixtures/file.txt similarity index 100% rename from packages/rspack/tests/copyPlugin/fixtures/file.txt rename to plugin-test/copy-plugin/fixtures/file.txt diff --git a/packages/rspack/tests/copyPlugin/fixtures/file.txt.gz b/plugin-test/copy-plugin/fixtures/file.txt.gz similarity index 100% rename from packages/rspack/tests/copyPlugin/fixtures/file.txt.gz rename to plugin-test/copy-plugin/fixtures/file.txt.gz diff --git a/packages/rspack/tests/copyPlugin/fixtures/js/unoptimized.js b/plugin-test/copy-plugin/fixtures/js/unoptimized.js similarity index 100% rename from packages/rspack/tests/copyPlugin/fixtures/js/unoptimized.js rename to plugin-test/copy-plugin/fixtures/js/unoptimized.js diff --git a/packages/rspack/tests/copyPlugin/fixtures/noextension b/plugin-test/copy-plugin/fixtures/noextension similarity index 100% rename from packages/rspack/tests/copyPlugin/fixtures/noextension rename to plugin-test/copy-plugin/fixtures/noextension diff --git a/packages/rspack/tests/copyPlugin/fixtures/symlink/directory-ln b/plugin-test/copy-plugin/fixtures/symlink/directory-ln similarity index 100% rename from packages/rspack/tests/copyPlugin/fixtures/symlink/directory-ln rename to plugin-test/copy-plugin/fixtures/symlink/directory-ln diff --git a/packages/rspack/tests/copyPlugin/fixtures/symlink/directory/file.txt b/plugin-test/copy-plugin/fixtures/symlink/directory/file.txt similarity index 100% rename from packages/rspack/tests/copyPlugin/fixtures/symlink/directory/file.txt rename to plugin-test/copy-plugin/fixtures/symlink/directory/file.txt diff --git a/packages/rspack/tests/copyPlugin/fixtures/symlink/directory/nested-directory/file-in-nested-directory.txt b/plugin-test/copy-plugin/fixtures/symlink/directory/nested-directory/file-in-nested-directory.txt similarity index 100% rename from packages/rspack/tests/copyPlugin/fixtures/symlink/directory/nested-directory/file-in-nested-directory.txt rename to plugin-test/copy-plugin/fixtures/symlink/directory/nested-directory/file-in-nested-directory.txt diff --git a/packages/rspack/tests/copyPlugin/fixtures/symlink/file-ln.txt b/plugin-test/copy-plugin/fixtures/symlink/file-ln.txt similarity index 100% rename from packages/rspack/tests/copyPlugin/fixtures/symlink/file-ln.txt rename to plugin-test/copy-plugin/fixtures/symlink/file-ln.txt diff --git a/packages/rspack/tests/copyPlugin/fixtures/symlink/file.txt b/plugin-test/copy-plugin/fixtures/symlink/file.txt similarity index 100% rename from packages/rspack/tests/copyPlugin/fixtures/symlink/file.txt rename to plugin-test/copy-plugin/fixtures/symlink/file.txt diff --git a/packages/rspack/tests/copyPlugin/fixtures/watch/.gitkeep b/plugin-test/copy-plugin/fixtures/watch/.gitkeep similarity index 100% rename from packages/rspack/tests/copyPlugin/fixtures/watch/.gitkeep rename to plugin-test/copy-plugin/fixtures/watch/.gitkeep diff --git a/packages/rspack/tests/copyPlugin/fixtures/watch/_t1/.gitkeep b/plugin-test/copy-plugin/fixtures/watch/_t1/.gitkeep similarity index 100% rename from packages/rspack/tests/copyPlugin/fixtures/watch/_t1/.gitkeep rename to plugin-test/copy-plugin/fixtures/watch/_t1/.gitkeep diff --git a/packages/rspack/tests/copyPlugin/fixtures/watch/_t1/directory/.gitkeep b/plugin-test/copy-plugin/fixtures/watch/_t1/directory/.gitkeep similarity index 100% rename from packages/rspack/tests/copyPlugin/fixtures/watch/_t1/directory/.gitkeep rename to plugin-test/copy-plugin/fixtures/watch/_t1/directory/.gitkeep diff --git a/packages/rspack/tests/copyPlugin/fixtures/watch/_t2/.gitkeep b/plugin-test/copy-plugin/fixtures/watch/_t2/.gitkeep similarity index 100% rename from packages/rspack/tests/copyPlugin/fixtures/watch/_t2/.gitkeep rename to plugin-test/copy-plugin/fixtures/watch/_t2/.gitkeep diff --git a/packages/rspack/tests/copyPlugin/fixtures/watch/_t2/directory/.gitkeep b/plugin-test/copy-plugin/fixtures/watch/_t2/directory/.gitkeep similarity index 100% rename from packages/rspack/tests/copyPlugin/fixtures/watch/_t2/directory/.gitkeep rename to plugin-test/copy-plugin/fixtures/watch/_t2/directory/.gitkeep diff --git a/packages/rspack/tests/copyPlugin/fixtures/watch/_t3/.gitkeep b/plugin-test/copy-plugin/fixtures/watch/_t3/.gitkeep similarity index 100% rename from packages/rspack/tests/copyPlugin/fixtures/watch/_t3/.gitkeep rename to plugin-test/copy-plugin/fixtures/watch/_t3/.gitkeep diff --git a/packages/rspack/tests/copyPlugin/fixtures/watch/_t3/directory/.gitkeep b/plugin-test/copy-plugin/fixtures/watch/_t3/directory/.gitkeep similarity index 100% rename from packages/rspack/tests/copyPlugin/fixtures/watch/_t3/directory/.gitkeep rename to plugin-test/copy-plugin/fixtures/watch/_t3/directory/.gitkeep diff --git a/packages/rspack/tests/copyPlugin/fixtures/watch/_t4/.gitkeep b/plugin-test/copy-plugin/fixtures/watch/_t4/.gitkeep similarity index 100% rename from packages/rspack/tests/copyPlugin/fixtures/watch/_t4/.gitkeep rename to plugin-test/copy-plugin/fixtures/watch/_t4/.gitkeep diff --git a/packages/rspack/tests/copyPlugin/fixtures/watch/_t4/directory/.gitkeep b/plugin-test/copy-plugin/fixtures/watch/_t4/directory/.gitkeep similarity index 100% rename from packages/rspack/tests/copyPlugin/fixtures/watch/_t4/directory/.gitkeep rename to plugin-test/copy-plugin/fixtures/watch/_t4/directory/.gitkeep diff --git a/packages/rspack/tests/copyPlugin/fixtures/watch/_t5/.gitkeep b/plugin-test/copy-plugin/fixtures/watch/_t5/.gitkeep similarity index 100% rename from packages/rspack/tests/copyPlugin/fixtures/watch/_t5/.gitkeep rename to plugin-test/copy-plugin/fixtures/watch/_t5/.gitkeep diff --git a/packages/rspack/tests/copyPlugin/fixtures/watch/_t5/directory/.gitkeep b/plugin-test/copy-plugin/fixtures/watch/_t5/directory/.gitkeep similarity index 100% rename from packages/rspack/tests/copyPlugin/fixtures/watch/_t5/directory/.gitkeep rename to plugin-test/copy-plugin/fixtures/watch/_t5/directory/.gitkeep diff --git a/packages/rspack/tests/copyPlugin/fixtures/watch/directory/.gitkeep b/plugin-test/copy-plugin/fixtures/watch/directory/.gitkeep similarity index 100% rename from packages/rspack/tests/copyPlugin/fixtures/watch/directory/.gitkeep rename to plugin-test/copy-plugin/fixtures/watch/directory/.gitkeep diff --git a/packages/rspack/tests/helpers/AsyncEventIterator.js b/plugin-test/copy-plugin/helpers/AsyncEventIterator.js similarity index 100% rename from packages/rspack/tests/helpers/AsyncEventIterator.js rename to plugin-test/copy-plugin/helpers/AsyncEventIterator.js diff --git a/packages/rspack/tests/copyPlugin/helpers/built-in-modules/fs.js b/plugin-test/copy-plugin/helpers/built-in-modules/fs.js similarity index 100% rename from packages/rspack/tests/copyPlugin/helpers/built-in-modules/fs.js rename to plugin-test/copy-plugin/helpers/built-in-modules/fs.js diff --git a/packages/rspack/tests/copyPlugin/helpers/built-in-modules/path.js b/plugin-test/copy-plugin/helpers/built-in-modules/path.js similarity index 100% rename from packages/rspack/tests/copyPlugin/helpers/built-in-modules/path.js rename to plugin-test/copy-plugin/helpers/built-in-modules/path.js diff --git a/packages/rspack/tests/copyPlugin/helpers/built-in-modules/process.js b/plugin-test/copy-plugin/helpers/built-in-modules/process.js similarity index 100% rename from packages/rspack/tests/copyPlugin/helpers/built-in-modules/process.js rename to plugin-test/copy-plugin/helpers/built-in-modules/process.js diff --git a/packages/rspack/tests/copyPlugin/helpers/built-in-modules/stream.js b/plugin-test/copy-plugin/helpers/built-in-modules/stream.js similarity index 100% rename from packages/rspack/tests/copyPlugin/helpers/built-in-modules/stream.js rename to plugin-test/copy-plugin/helpers/built-in-modules/stream.js diff --git a/packages/rspack/tests/copyPlugin/helpers/built-in-modules/url.js b/plugin-test/copy-plugin/helpers/built-in-modules/url.js similarity index 100% rename from packages/rspack/tests/copyPlugin/helpers/built-in-modules/url.js rename to plugin-test/copy-plugin/helpers/built-in-modules/url.js diff --git a/packages/rspack/tests/copyPlugin/helpers/built-in-modules/util.js b/plugin-test/copy-plugin/helpers/built-in-modules/util.js similarity index 100% rename from packages/rspack/tests/copyPlugin/helpers/built-in-modules/util.js rename to plugin-test/copy-plugin/helpers/built-in-modules/util.js diff --git a/packages/rspack/tests/copyPlugin/helpers/compile.js b/plugin-test/copy-plugin/helpers/compile.js similarity index 100% rename from packages/rspack/tests/copyPlugin/helpers/compile.js rename to plugin-test/copy-plugin/helpers/compile.js diff --git a/packages/rspack/tests/copyPlugin/helpers/enter-with-asset-modules.js b/plugin-test/copy-plugin/helpers/enter-with-asset-modules.js similarity index 100% rename from packages/rspack/tests/copyPlugin/helpers/enter-with-asset-modules.js rename to plugin-test/copy-plugin/helpers/enter-with-asset-modules.js diff --git a/packages/rspack/tests/copyPlugin/helpers/enter.js b/plugin-test/copy-plugin/helpers/enter.js similarity index 100% rename from packages/rspack/tests/copyPlugin/helpers/enter.js rename to plugin-test/copy-plugin/helpers/enter.js diff --git a/packages/rspack/tests/copyPlugin/helpers/getCompiler.js b/plugin-test/copy-plugin/helpers/getCompiler.js similarity index 92% rename from packages/rspack/tests/copyPlugin/helpers/getCompiler.js rename to plugin-test/copy-plugin/helpers/getCompiler.js index 0fa744f42f4..eb06b825539 100644 --- a/packages/rspack/tests/copyPlugin/helpers/getCompiler.js +++ b/plugin-test/copy-plugin/helpers/getCompiler.js @@ -1,6 +1,6 @@ const path = require("path"); -const rspack = require("../../../"); +const rspack = require("@rspack/core"); module.exports = (config = {}) => { const fullConfig = { diff --git a/packages/rspack/tests/copyPlugin/helpers/index.js b/plugin-test/copy-plugin/helpers/index.js similarity index 100% rename from packages/rspack/tests/copyPlugin/helpers/index.js rename to plugin-test/copy-plugin/helpers/index.js diff --git a/packages/rspack/tests/copyPlugin/helpers/readAsset.js b/plugin-test/copy-plugin/helpers/readAsset.js similarity index 100% rename from packages/rspack/tests/copyPlugin/helpers/readAsset.js rename to plugin-test/copy-plugin/helpers/readAsset.js diff --git a/packages/rspack/tests/copyPlugin/helpers/readAssets.js b/plugin-test/copy-plugin/helpers/readAssets.js similarity index 100% rename from packages/rspack/tests/copyPlugin/helpers/readAssets.js rename to plugin-test/copy-plugin/helpers/readAssets.js diff --git a/packages/rspack/tests/copyPlugin/helpers/removeIllegalCharacterForWindows.js b/plugin-test/copy-plugin/helpers/removeIllegalCharacterForWindows.js similarity index 100% rename from packages/rspack/tests/copyPlugin/helpers/removeIllegalCharacterForWindows.js rename to plugin-test/copy-plugin/helpers/removeIllegalCharacterForWindows.js diff --git a/packages/rspack/tests/copyPlugin/helpers/run.js b/plugin-test/copy-plugin/helpers/run.js similarity index 97% rename from packages/rspack/tests/copyPlugin/helpers/run.js rename to plugin-test/copy-plugin/helpers/run.js index e0625eb3f5c..a4ab2de8233 100644 --- a/packages/rspack/tests/copyPlugin/helpers/run.js +++ b/plugin-test/copy-plugin/helpers/run.js @@ -1,7 +1,7 @@ // Ideally we pass in patterns and confirm the resulting assets const fs = require("fs"); const { rspack } = require("@rspack/core"); -const AsyncEventIterator = require("../../helpers/AsyncEventIterator"); +const AsyncEventIterator = require("./AsyncEventIterator"); const removeIllegalCharacterForWindows = require("./removeIllegalCharacterForWindows"); @@ -152,7 +152,7 @@ function runForce(opts) { new PreCopyPlugin({ options: opts }).apply(opts.compiler); - return runEmit(opts).then(() => {}); + return runEmit(opts).then(() => { }); } const delay = ms => new Promise(resolve => setTimeout(resolve, ms));