File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -70,6 +70,25 @@ mv crates "$DEPS_FOLDER/crates"
7070# Keep workspace tools (needed by Cargo workspace members like tools/generate-code)
7171mv tools " $DEPS_FOLDER /tools"
7272
73+ # Remove all unused folders (using -depth to process bottom-up)
74+ find " $DEPS_FOLDER " -depth -type d -name " examples" -exec rm -rf {} + 2> /dev/null || true
75+ find " $DEPS_FOLDER " -depth -type d -name " __tests__" -exec rm -rf {} + 2> /dev/null || true
76+ find " $DEPS_FOLDER " -depth -type d -name " tests" -exec rm -rf {} + 2> /dev/null || true
77+ find " $DEPS_FOLDER " -depth -type d -name " benches" -exec rm -rf {} + 2> /dev/null || true
78+ find " $DEPS_FOLDER " -depth -type d -name " fixture" -exec rm -rf {} + 2> /dev/null || true
79+ find " $DEPS_FOLDER " -depth -type d -name " fixtures" -exec rm -rf {} + 2> /dev/null || true
80+
81+ # Remove test files
82+ find " $DEPS_FOLDER " -type f -name " *test*.rs" -exec rm -f {} + 2> /dev/null || true
83+ find " $DEPS_FOLDER " -type f -name " *spec*.rs" -exec rm -f {} + 2> /dev/null || true
84+
85+ # Remove testing crates (not needed for builds)
86+ rm -rf " $DEPS_FOLDER /crates/testing" 2> /dev/null || true
87+ rm -rf " $DEPS_FOLDER /crates/testing_macros" 2> /dev/null || true
88+ rm -rf " $DEPS_FOLDER /crates/swc_ecma_testing" 2> /dev/null || true
89+ rm -rf " $DEPS_FOLDER /crates/swc_ecma_transforms_testing" 2> /dev/null || true
90+ rm -rf " $DEPS_FOLDER /crates/swc_plugin_backend_tests" 2> /dev/null || true
91+
7392echo " All done!"
7493echo " "
7594echo " Please git add swc and commit the new version:"
You can’t perform that action at this time.
0 commit comments