From 883c1ac4e4875c65b866aecdd122ca9514c62139 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Fri, 13 Aug 2021 19:03:04 +0900 Subject: [PATCH] fix(bundler): Prepare renaming of bundler (#2066) - Rename `spack` crate to `swc_node_bundler`. (#1113) --- .github/workflows/cargo.yml | 7 +- .github/workflows/integration.yml | 2 +- .npmignore | 1 + .rustfmt.toml | 1 + Cargo.lock | 70 ++++----- babel/compat/benches/babelify.rs | 12 +- babel/compat/src/babelify/class.rs | 4 +- babel/compat/src/babelify/mod.rs | 15 +- babel/compat/src/babelify/typescript.rs | 3 +- babel/compat/src/swcify/class.rs | 14 +- babel/compat/src/swcify/ctx.rs | 12 +- babel/compat/src/swcify/expr.rs | 142 ++++-------------- babel/compat/src/swcify/jsx.rs | 3 +- babel/compat/src/swcify/lit.rs | 28 +--- babel/compat/src/swcify/pat.rs | 15 +- babel/compat/src/swcify/stmt.rs | 120 +++------------ babel/compat/src/swcify/typescript.rs | 30 ++-- babel/compat/tests/convert.rs | 8 +- bundler/src/bundler/chunk/cjs.rs | 5 +- bundler/src/bundler/chunk/computed_key.rs | 3 +- bundler/src/bundler/chunk/merge.rs | 16 +- bundler/src/bundler/chunk/mod.rs | 3 +- bundler/src/bundler/chunk/plan/mod.rs | 9 +- bundler/src/bundler/import/mod.rs | 7 +- bundler/src/bundler/keywords.rs | 7 +- bundler/src/dep_graph.rs | 3 +- bundler/src/inline.rs | 16 +- bundler/src/modules/mod.rs | 11 +- bundler/src/modules/sort/chunk.rs | 13 +- bundler/src/modules/sort/graph.rs | 10 +- bundler/src/modules/sort/mod.rs | 7 +- bundler/src/modules/sort/stmt.rs | 31 +--- bundler/src/modules/sort/tests.rs | 6 +- bundler/src/util/fast_graph.rs | 41 +++-- bundler/tests/common/mod.rs | 13 +- bundler/tests/deno.rs | 2 +- bundler/tests/fixture.rs | 3 +- common/src/eq.rs | 9 +- common/src/errors.rs | 3 +- common/src/lib.rs | 9 +- ecmascript/ast/src/class.rs | 3 +- ecmascript/ast/src/decl.rs | 3 +- ecmascript/ast/src/expr.rs | 3 +- ecmascript/ast/src/function.rs | 3 +- ecmascript/ast/src/ident.rs | 8 +- ecmascript/ast/src/jsx.rs | 3 +- ecmascript/ast/src/lib.rs | 6 +- ecmascript/ast/src/lit.rs | 3 +- ecmascript/ast/src/module.rs | 3 +- ecmascript/ast/src/module_decl.rs | 3 +- ecmascript/ast/src/pat.rs | 12 +- ecmascript/ast/src/prop.rs | 3 +- ecmascript/ast/src/stmt.rs | 3 +- ecmascript/ast/src/typescript.rs | 6 +- ecmascript/codegen/src/tests.rs | 3 +- ecmascript/loader/src/resolve.rs | 6 +- ecmascript/loader/tests/tsc_resolver.rs | 6 +- ecmascript/minifier/src/analyzer/ctx.rs | 3 +- ecmascript/minifier/src/analyzer/mod.rs | 26 ++-- .../minifier/src/compress/drop_console.rs | 8 +- .../minifier/src/compress/hoist_decls.rs | 22 +-- ecmascript/minifier/src/compress/mod.rs | 67 ++++----- .../src/compress/optimize/arguments.rs | 9 +- .../minifier/src/compress/optimize/bools.rs | 12 +- .../src/compress/optimize/collapse_vars.rs | 7 +- .../src/compress/optimize/conditionals.rs | 26 ++-- .../src/compress/optimize/evaluate.rs | 12 +- .../src/compress/optimize/if_return.rs | 16 +- .../minifier/src/compress/optimize/iife.rs | 23 ++- .../minifier/src/compress/optimize/inline.rs | 16 +- .../minifier/src/compress/optimize/loops.rs | 6 +- .../minifier/src/compress/optimize/mod.rs | 48 ++---- .../minifier/src/compress/optimize/ops.rs | 12 +- .../src/compress/optimize/sequences.rs | 23 ++- .../minifier/src/compress/optimize/strings.rs | 4 +- .../src/compress/optimize/switches.rs | 15 +- .../minifier/src/compress/optimize/unused.rs | 16 +- .../minifier/src/compress/optimize/util.rs | 14 +- .../minifier/src/compress/pure/bools.rs | 17 +-- .../minifier/src/compress/pure/properties.rs | 6 +- ecmascript/minifier/src/debug.rs | 25 +-- ecmascript/minifier/src/lib.rs | 33 ++-- ecmascript/minifier/src/metadata/mod.rs | 25 +-- ecmascript/minifier/src/option/mod.rs | 6 +- ecmascript/minifier/src/option/terser.rs | 13 +- ecmascript/minifier/src/pass/expand_names.rs | 3 +- ecmascript/minifier/src/pass/global_defs.rs | 14 +- ecmascript/minifier/src/pass/hygiene/mod.rs | 19 +-- .../minifier/src/pass/mangle_names/mod.rs | 24 ++- .../src/pass/mangle_names/preserver.rs | 9 +- ecmascript/minifier/src/pass/mangle_props.rs | 9 +- ecmascript/minifier/src/timing.rs | 6 +- ecmascript/minifier/src/util/mod.rs | 22 +-- ecmascript/minifier/tests/compress.rs | 63 ++++---- ecmascript/minifier/tests/hygiene.rs | 11 +- ecmascript/minifier/tests/mangle.rs | 25 +-- ecmascript/parser/benches/parser.rs | 3 +- ecmascript/parser/src/parser/class_and_fn.rs | 3 +- ecmascript/parser/src/parser/pat.rs | 6 +- ecmascript/parser/tests/comments.rs | 26 ++-- ecmascript/preset-env/src/corejs3/entry.rs | 3 +- ecmascript/preset-env/tests/test.rs | 7 +- ecmascript/transforms/base/src/hygiene/mod.rs | 16 +- .../transforms/base/src/hygiene/tests.rs | 3 +- ecmascript/transforms/base/src/quote.rs | 3 +- ecmascript/transforms/base/src/tests.rs | 4 +- ecmascript/transforms/base/tests/fixture.rs | 24 +-- .../transforms/base/tests/ts_resolver.rs | 15 +- .../transforms/classes/src/super_field.rs | 5 +- .../transforms/compat/src/bugfixes/mod.rs | 7 +- .../transforms/compat/src/es2015/arrow.rs | 7 +- .../compat/src/es2015/block_scoped_fn.rs | 6 +- .../compat/src/es2015/block_scoping.rs | 19 +-- .../compat/src/es2015/classes/constructor.rs | 9 +- .../compat/src/es2015/classes/mod.rs | 17 +-- .../compat/src/es2015/computed_props.rs | 7 +- .../compat/src/es2015/destructuring.rs | 20 +-- .../transforms/compat/src/es2015/for_of.rs | 13 +- .../compat/src/es2015/function_name.rs | 7 +- .../compat/src/es2015/instanceof.rs | 6 +- .../transforms/compat/src/es2015/mod.rs | 3 +- .../compat/src/es2015/parameters.rs | 16 +- .../compat/src/es2015/regenerator/case.rs | 15 +- .../compat/src/es2015/regenerator/hoist.rs | 3 +- .../compat/src/es2015/regenerator/mod.rs | 13 +- .../compat/src/es2015/shorthand_property.rs | 6 +- .../transforms/compat/src/es2015/spread.rs | 22 +-- .../compat/src/es2015/sticky_regex.rs | 8 +- .../compat/src/es2015/template_literal.rs | 9 +- .../compat/src/es2015/typeof_symbol.rs | 10 +- .../compat/src/es2016/exponentation.rs | 14 +- .../compat/src/es2017/async_to_generator.rs | 18 +-- .../compat/src/es2018/object_rest_spread.rs | 19 +-- .../compat/src/es2020/class_properties/mod.rs | 13 +- .../es2020/class_properties/private_field.rs | 13 +- .../src/es2020/class_properties/used_name.rs | 3 +- .../src/es2020/export_namespace_from.rs | 3 +- .../src/es2020/nullish_coalescing/mod.rs | 3 +- .../src/es2020/nullish_coalescing/tests.rs | 3 +- .../compat/src/es2020/opt_chaining.rs | 7 +- .../compat/src/es2021/logical_assignments.rs | 3 +- .../transforms/compat/src/reserved_words.rs | 3 +- .../compat/tests/es2015_block_scoping.rs | 7 +- .../transforms/compat/tests/es2015_classes.rs | 19 +-- .../compat/tests/es2015_computed_props.rs | 3 +- .../compat/tests/es2015_destructuring.rs | 3 +- .../transforms/compat/tests/es2015_for_of.rs | 6 +- .../compat/tests/es2015_parameters.rs | 14 +- .../compat/tests/es2015_regenerator.rs | 9 +- .../transforms/compat/tests/es2015_spread.rs | 8 +- .../compat/tests/es2015_template_literals.rs | 3 +- .../compat/tests/es2017_async_to_generator.rs | 19 +-- .../compat/tests/es2018_object_rest_spread.rs | 6 +- .../compat/tests/es2020_optional_chaining.rs | 3 +- ecmascript/transforms/module/src/amd.rs | 22 ++- ecmascript/transforms/module/src/common_js.rs | 20 ++- .../transforms/module/src/import_analysis.rs | 7 +- ecmascript/transforms/module/src/lib.rs | 4 +- ecmascript/transforms/module/src/umd.rs | 16 +- .../transforms/module/src/umd/config.rs | 3 +- ecmascript/transforms/module/src/util.rs | 10 +- ecmascript/transforms/module/tests/amd.rs | 12 +- .../transforms/module/tests/common_js.rs | 43 +++--- ecmascript/transforms/module/tests/umd.rs | 23 ++- .../optimization/src/const_modules.rs | 3 +- .../optimization/src/inline_globals.rs | 3 +- .../transforms/optimization/src/json_parse.rs | 3 +- ecmascript/transforms/optimization/src/lib.rs | 6 +- .../optimization/src/simplify/branch/mod.rs | 21 +-- .../optimization/src/simplify/dce/mod.rs | 3 +- .../src/simplify/dce/side_effect.rs | 3 +- .../optimization/src/simplify/expr/mod.rs | 35 ++--- .../optimization/src/simplify/inlining/mod.rs | 12 +- .../optimization/tests/const_modules.rs | 3 +- .../transforms/optimization/tests/fixture.rs | 6 +- .../transforms/optimization/tests/simplify.rs | 35 ++--- .../optimization/tests/simplify_dce.rs | 6 +- .../transforms/proposal/src/decorators.rs | 11 +- .../proposal/src/decorators/legacy.rs | 16 +- .../src/decorators/legacy/metadata.rs | 4 +- .../transforms/react/src/display_name/mod.rs | 3 +- ecmascript/transforms/react/src/jsx/mod.rs | 22 +-- ecmascript/transforms/react/src/jsx/tests.rs | 12 +- .../transforms/react/src/jsx_src/tests.rs | 3 +- ecmascript/transforms/react/src/lib.rs | 6 +- .../react/src/pure_annotations/tests.rs | 3 +- .../transforms/react/src/refresh/mod.rs | 11 +- ecmascript/transforms/src/lib.rs | 7 +- ecmascript/transforms/testing/src/lib.rs | 39 ++--- ecmascript/transforms/tests/decorators.rs | 16 +- .../transforms/tests/es2015_function_name.rs | 10 +- ecmascript/transforms/typescript/src/strip.rs | 16 +- .../transforms/typescript/tests/strip.rs | 14 +- .../typescript/tests/strip_correctness.rs | 3 +- ecmascript/utils/src/ident.rs | 3 +- macros/eq_ignore/src/lib.rs | 33 +--- .../{error_test.js => error_test.mjs} | 18 ++- node-swc/tests/legacy/octal.js | 1 + node/base/Cargo.toml | 4 +- node/binding/Cargo.toml | 2 +- node/binding/src/bundle.rs | 7 +- {spack => node/bundler}/.gitignore | 0 node/bundler/Cargo.toml | 44 ++++++ {spack => node/bundler}/benches/bench.rs | 0 {spack => node/bundler}/build.rs | 0 {spack => node/bundler}/scripts/fixture.sh | 0 {spack => node/bundler}/src/config/mod.rs | 0 .../bundler}/src/config/module/mod.rs | 0 .../bundler}/src/config/optimization.rs | 0 {spack => node/bundler}/src/config/output.rs | 0 {spack => node/bundler}/src/config/resolve.rs | 0 {spack => node/bundler}/src/lib.rs | 0 {spack => node/bundler}/src/loaders/json.rs | 14 +- {spack => node/bundler}/src/loaders/mod.rs | 0 {spack => node/bundler}/src/loaders/swc.rs | 12 +- {spack => node/bundler}/tests/fixture.rs | 2 +- .../tests/integration/react/.gitignore | 0 .../tests/integration/react/package.json | 0 .../tests/integration/react/spack.config.js | 0 .../tests/integration/react/src/.swcrc | 0 .../tests/integration/react/src/index.tsx | 0 {spack => node/bundler}/tests/package.json | 0 {spack => node/bundler}/tests/pass/.swcrc | 0 .../pass/alias/export-default/input/a.js | 0 .../pass/alias/export-default/input/entry.js | 0 .../pass/alias/export-default/output/entry.js | 0 .../pass/alias/export-named-1/input/a.js | 0 .../pass/alias/export-named-1/input/entry.js | 0 .../pass/alias/export-named-1/output/entry.js | 0 .../export-named-optimization/input/a.js | 0 .../export-named-optimization/input/entry.js | 0 .../export-named-optimization/output/entry.js | 0 .../alias/export-named-same-name/input/a.js | 0 .../export-named-same-name/input/entry.js | 0 .../export-named-same-name/output/entry.js | 0 .../tests/pass/alias/import/multi/input/a.js | 0 .../tests/pass/alias/import/multi/input/b.js | 0 .../pass/alias/import/multi/input/entry.js | 0 .../pass/alias/import/multi/output/entry.js | 0 .../tests/pass/alias/import/simple/input/a.js | 0 .../pass/alias/import/simple/input/entry.js | 0 .../pass/alias/import/simple/output/entry.js | 0 .../pass/basic/class-inheritance/input/a.js | 0 .../pass/basic/class-inheritance/input/b.js | 0 .../tests/pass/basic/extends/input/a.js | 0 .../tests/pass/basic/extends/input/b.js | 0 .../tests/pass/basic/extends/input/entry.js | 0 .../tests/pass/basic/extends/output/entry.js | 0 .../tests/pass/basic/no-import/input/entry.js | 0 .../pass/basic/no-import/output/entry.js | 0 .../basic/relative-import-const/input/a.js | 0 .../relative-import-const/input/entry.js | 0 .../relative-import-const/output/entry.js | 0 .../complex-class-function/input/a.js | 0 .../complex-class-function/input/b.js | 0 .../complex-class-function/input/c.js | 0 .../complex-class-function/input/entry.js | 0 .../complex-class-function/output/entry.js | 0 .../hygiene/class-inheritance/input/a.js | 0 .../hygiene/class-inheritance/input/b.js | 0 .../hygiene/class-inheritance/input/c.js | 0 .../hygiene/class-inheritance/input/entry.js | 0 .../hygiene/class-inheritance/output/entry.js | 0 .../pass/circular/imports-same/input/a.js | 0 .../pass/circular/imports-same/input/b.js | 0 .../circular/imports-same/input/common-foo.js | 0 .../circular/imports-same/input/common.js | 0 .../pass/circular/imports-same/input/entry.js | 0 .../circular/imports-same/output/entry.js | 0 .../tests/pass/circular/many/input/a.js | 0 .../tests/pass/circular/many/input/b.js | 0 .../tests/pass/circular/many/input/c.js | 0 .../tests/pass/circular/many/input/d.js | 0 .../tests/pass/circular/many/input/entry.js | 0 .../tests/pass/circular/mixed/input/a.js | 0 .../tests/pass/circular/mixed/input/b.js | 0 .../tests/pass/circular/mixed/input/c.js | 0 .../tests/pass/circular/mixed/input/entry.js | 0 .../tests/pass/circular/mixed/output/entry.js | 0 .../tests/pass/circular/simple/input/a.js | 0 .../tests/pass/circular/simple/input/b.js | 0 .../tests/pass/circular/simple/input/entry.js | 0 .../pass/circular/simple/output/entry.js | 0 .../pass/circular/top-level-idents/input/a.js | 0 .../pass/circular/top-level-idents/input/b.js | 0 .../pass/circular/top-level-idents/input/c.js | 0 .../circular/top-level-idents/input/entry.js | 0 .../circular/top-level-idents/output/entry.js | 0 .../tests/pass/cjs/common-library/input/a.js | 0 .../tests/pass/cjs/common-library/input/b.js | 0 .../pass/cjs/common-library/input/common.js | 0 .../pass/cjs/common-library/input/entry.js | 0 .../pass/cjs/common-library/output/entry.js | 0 .../pass/cjs/conditional/input/common.js | 0 .../tests/pass/cjs/conditional/input/entry.js | 0 .../pass/cjs/conditional/output/entry.js | 0 .../input/.swcrc | 0 .../issue-967-no-recursive-require/input/a.js | 0 .../issue-967-no-recursive-require/input/b.js | 0 .../issue-967-no-recursive-require/input/c.js | 0 .../input/entry.js | 0 .../output/entry.js | 0 .../issue-967-recursive-require/input/.swcrc | 0 .../input/a-a-a.js | 0 .../issue-967-recursive-require/input/a-a.js | 0 .../issue-967-recursive-require/input/a-b.js | 0 .../issue-967-recursive-require/input/a.js | 0 .../issue-967-recursive-require/input/b.js | 0 .../issue-967-recursive-require/input/c.js | 0 .../input/entry.js | 0 .../output/entry.js | 0 .../bundler}/tests/pass/cjs/mixed/input/a.js | 0 .../bundler}/tests/pass/cjs/mixed/input/b.js | 0 .../tests/pass/cjs/mixed/input/entry.js | 0 .../tests/pass/cjs/mixed/output/entry.js | 0 .../bundler}/tests/pass/cjs/nested/input/a.js | 0 .../bundler}/tests/pass/cjs/nested/input/b.js | 0 .../tests/pass/cjs/nested/input/entry.js | 0 .../tests/pass/cjs/nested/output/entry.js | 0 .../tests/pass/deno-001/full/input}/.swcrc | 0 .../pass/deno-001/full/input/_util/assert.ts | 0 .../deno-001/full/input/async/deferred.ts | 0 .../pass/deno-001/full/input/async/delay.ts | 0 .../pass/deno-001/full/input/async/mod.ts | 0 .../full/input/async/mux_async_iterator.ts | 0 .../pass/deno-001/full/input/async/pool.ts | 0 .../pass/deno-001/full/input/bytes/mod.ts | 0 .../pass/deno-001/full/input/encoding/utf8.ts | 0 .../tests/pass/deno-001/full/input/entry.js | 0 .../pass/deno-001/full/input/http/_io.ts | 0 .../deno-001/full/input/http/http_status.ts | 0 .../pass/deno-001/full/input/http/server.ts | 0 .../pass/deno-001/full/input/io/bufio.ts | 0 .../pass/deno-001/full/input/textproto/mod.ts | 0 .../tests/pass/deno-001/full/output/entry.js | 0 .../pass/deno-001/simple-1}/input/.swcrc | 0 .../deno-001/simple-1/input/async/deferred.ts | 0 .../deno-001/simple-1/input/async/delay.ts | 0 .../pass/deno-001/simple-1/input/async/mod.ts | 0 .../input/async/mux_async_iterator.ts | 0 .../deno-001/simple-1/input/async/pool.ts | 0 .../pass/deno-001/simple-1/input/entry.js | 0 .../pass/deno-001/simple-1/input/http/_io.ts | 0 .../deno-001/simple-1/input/http/server.ts | 0 .../deno-001/simple-1/input/textproto/mod.ts | 0 .../pass/deno-001/simple-1/output/entry.js | 0 .../pass/deno-001/simple-2}/input/.swcrc | 0 .../deno-001/simple-2/input/async/deferred.ts | 0 .../pass/deno-001/simple-2/input/async/mod.ts | 0 .../input/async/mux_async_iterator.ts | 0 .../pass/deno-001/simple-2/input/entry.js | 0 .../pass/deno-001/simple-2/input/http/_io.ts | 0 .../deno-001/simple-2/input/http/server.ts | 0 .../deno-001/simple-2/input/textproto/mod.ts | 0 .../pass/deno-001/simple-2/output/entry.js | 0 .../pass/deno-001/simple-3}/input/.swcrc | 0 .../deno-001/simple-3/input/async/deferred.ts | 0 .../pass/deno-001/simple-3/input/async/mod.ts | 0 .../input/async/mux_async_iterator.ts | 0 .../pass/deno-001/simple-3/input/entry.js | 0 .../pass/deno-001/simple-3/output/entry.js | 0 .../pass/deno-001/simple-4}/input/.swcrc | 0 .../deno-001/simple-4/input/async/deferred.ts | 0 .../pass/deno-001/simple-4/input/async/mod.ts | 0 .../input/async/mux_async_iterator.ts | 0 .../pass/deno-001/simple-4/input/entry.js | 0 .../pass/deno-001/simple-4/output/entry.js | 0 .../pass/deno-001/simple-5}/input/.swcrc | 0 .../deno-001/simple-5/input/async/deferred.ts | 0 .../pass/deno-001/simple-5/input/async/mod.ts | 0 .../input/async/mux_async_iterator.ts | 0 .../pass/deno-001/simple-5/input/entry.js | 0 .../pass/deno-001/simple-5/output/entry.js | 0 .../tests/pass/deno-002/.full}/input/.swcrc | 0 .../deno-002/.full/input/async/deferred.ts | 0 .../pass/deno-002/.full/input/async/delay.ts | 0 .../pass/deno-002/.full/input/async/mod.ts | 0 .../.full/input/async/mux_async_iterator.ts | 0 .../pass/deno-002/.full/input/async/pool.ts | 0 .../tests/pass/deno-002/.full/input/entry.js | 0 .../tests/pass/deno-002/.full/output/entry.js | 0 .../export/default-mixed/input/a.js | 0 .../export/default-mixed/input/entry.js | 0 .../export/default-mixed/output/entry.js | 0 .../drop-unused/export/named/input/entry.js | 0 .../drop-unused/export/named/output/entry.js | 0 .../side-effect/import-multi/input/a.js | 0 .../side-effect/import-multi/input/b.js | 0 .../side-effect/import-multi/input/entry.js | 0 .../side-effect/import-multi/output/entry.js | 0 .../side-effect/simple/input/entry.js | 0 .../side-effect/simple/output/entry.js | 0 .../namespace/dynamic-key/input/entry.js | 0 .../namespace/dynamic-key/input/lib/a.js | 0 .../namespace/dynamic-key/input/lib/b.js | 0 .../namespace/dynamic-key/input/lib/nop.js | 0 .../namespace/dynamic-key/output/entry.js | 0 .../issue-1112/simple/input/.swcrc | 0 .../issue-1112/simple/input/a.js | 0 .../issue-1112/simple/input/entry.js | 0 .../issue-1112/simple/output/entry.js | 0 .../bundler}/tests/pass/export-all/input/a.js | 0 .../bundler}/tests/pass/export-all/input/b.js | 0 .../tests/pass/export-all/input/entry.js | 0 .../tests/pass/export-all/output/entry.js | 0 .../export-star-namespace/issue-1109/.swcrc | 0 .../issue-1109/input/a.ts | 0 .../issue-1109/input/entry.js | 0 .../issue-1109/output/entry.js | 0 .../pass/export/all-1/multiple/input/a.js | 0 .../pass/export/all-1/multiple/input/b.js | 0 .../pass/export/all-1/multiple/input/entry.js | 0 .../export/all-1/multiple/output/entry.js | 0 .../tests/pass/export/all-2/input/a.js | 0 .../tests/pass/export/all-2/input/b.js | 0 .../tests/pass/export/all-2/input/c.js | 0 .../tests/pass/export/all-2/input/entry.js | 0 .../tests/pass/export/all-2/output/entry.js | 0 .../tests/pass/export/all-nested-1/input/a.js | 0 .../tests/pass/export/all-nested-1/input/b.js | 0 .../tests/pass/export/all-nested-1/input/c.js | 0 .../pass/export/all-nested-1/input/entry.js | 0 .../pass/export/all-nested-1/output/entry.js | 0 .../tests/pass/export/complex-1/input/a.js | 0 .../tests/pass/export/complex-1/input/b.js | 0 .../pass/export/complex-1/input/entry.js | 0 .../pass/export/complex-1/output/entry.js | 0 .../pass/export/issue-1111/simple/input/a.js | 0 .../pass/export/issue-1111/simple/input/d.js | 0 .../export/issue-1111/simple/input/entry.js | 0 .../export/issue-1111/simple/output/entry.js | 0 .../export/mixed-all-and-const/input/a.js | 0 .../export/mixed-all-and-const/input/b.js | 0 .../export/mixed-all-and-const/input/entry.js | 0 .../mixed-all-and-const/output/entry.js | 0 .../tests/pass/helpers/simple/input/.swcrc | 0 .../tests/pass/helpers/simple/input/entry.js | 0 .../tests/pass/helpers/simple/output/entry.js | 0 .../import-with-export/simple-1/input/a.js | 0 .../simple-1/input/entry.js | 0 .../simple-1/output/entry.js | 0 .../pass/import/commons-default/input/a.js | 0 .../pass/import/commons-default/input/b.js | 0 .../pass/import/commons-default/input/c.js | 0 .../import/commons-default/input/entry.js | 0 .../import/commons-default/output/entry.js | 0 .../pass/import/commons-named/input/a.js | 0 .../pass/import/commons-named/input/b.js | 0 .../pass/import/commons-named/input/c.js | 0 .../pass/import/commons-named/input/entry.js | 0 .../pass/import/commons-named/output/entry.js | 0 .../tests/pass/import/computed-key/input/a.js | 0 .../pass/import/computed-key/input/entry.js | 0 .../pass/import/computed-key/output/entry.js | 0 .../import/default/named-class/input/a.js | 0 .../import/default/named-class/input/entry.js | 0 .../default/named-class/output/entry.js | 0 .../import/default/unnamed-class/input/a.js | 0 .../default/unnamed-class/input/entry.js | 0 .../default/unnamed-class/output/entry.js | 0 .../import/name-conflict/simple/input/a.js | 0 .../name-conflict/simple/input/entry.js | 0 .../name-conflict/simple/output/entry.js | 0 .../name-conflict/in-entry/input/a.js | 0 .../name-conflict/in-entry/input/entry.js | 0 .../name-conflict/in-entry/output/entry.js | 0 .../pass/import/namespace/simple/input/a.js | 0 .../import/namespace/simple/input/entry.js | 0 .../import/namespace/simple/output/entry.js | 0 .../tests/pass/import/resursive/input/a.js | 0 .../tests/pass/import/resursive/input/b.js | 0 .../tests/pass/import/resursive/input/c.js | 0 .../pass/import/resursive/input/entry.js | 0 .../pass/import/resursive/output/entry.js | 0 .../tests/pass/import/simple-alias/input/a.js | 0 .../pass/import/simple-alias/input/entry.js | 0 .../pass/import/simple-alias/output/entry.js | 0 .../tests/pass/import/simple-decl/input/a.js | 0 .../pass/import/simple-decl/input/entry.js | 0 .../pass/import/simple-decl/output/entry.js | 0 .../tests/pass/import/star-export/input/a.js | 0 .../pass/import/star-export/input/entry.js | 0 .../pass/import/star-export/output/entry.js | 0 .../tests/pass/import/star-use/input/a.js | 0 .../tests/pass/import/star-use/input/entry.js | 0 .../pass/import/star-use/output/entry.js | 0 .../top-level-require/.order/input/a.js | 0 .../top-level-require/.order/input/entry.js | 0 .../top-level-require/.order/output/entry.js | 0 .../top-level-require/.seq-expr/input/a.js | 0 .../.seq-expr/input/entry.js | 0 .../.seq-expr/output/entry.js | 0 .../top-level-require/.simple/input/a.js | 0 .../top-level-require/.simple/input/b.js | 0 .../top-level-require/.simple/input/entry.js | 0 .../top-level-require/.simple/output/entry.js | 0 .../pass/issue-1138/example-1/input/.swcrc | 0 .../pass/issue-1138/example-1/input/a.ts | 0 .../pass/issue-1138/example-1/input/entry.js | 0 .../pass/issue-1138/example-1/input/l.ts | 0 .../pass/issue-1138/example-1/output/entry.js | 0 .../pass/issue-1138/example-2/input/.swcrc | 0 .../pass/issue-1138/example-2/input/a.ts | 0 .../pass/issue-1138/example-2/input/entry.js | 0 .../pass/issue-1138/example-2/input/l.ts | 0 .../pass/issue-1138/example-2/output/entry.js | 0 .../pass/issue-1138/example-3/input/.swcrc | 0 .../pass/issue-1138/example-3/input/a.ts | 0 .../pass/issue-1138/example-3/input/entry.js | 0 .../pass/issue-1138/example-3/input/l.ts | 0 .../pass/issue-1138/example-3/output/entry.js | 0 .../pass/issue-1139/example-1/input/a.js | 0 .../pass/issue-1139/example-1/input/entry.js | 0 .../pass/issue-1139/example-1/output/entry.js | 0 .../pass/issue-1139/example-2/input/a.js | 0 .../pass/issue-1139/example-2/input/b.js | 0 .../pass/issue-1139/example-2/input/entry.js | 0 .../pass/issue-1139/example-2/output/entry.js | 0 .../tests/pass/issue-1225/cjs/input/entry.js | 0 .../tests/pass/issue-1225/cjs/input/mod.json | 0 .../tests/pass/issue-1225/cjs/output/entry.js | 0 .../tests/pass/issue-1225/esm/input/entry.js | 0 .../tests/pass/issue-1225/esm/input/mod.json | 0 .../tests/pass/issue-1225/esm/output/entry.js | 0 .../tests/pass/issue-1328/case1/input/.swcrc | 0 .../pass/issue-1328/case1/input/entry.js | 0 .../pass/issue-1328/case1/output/entry.js | 0 .../export-all-alias/input/entry.js | 0 .../export-all-alias/output/entry.js | 0 .../pass/issue-1338/export-all/input/entry.js | 0 .../issue-1338/export-all/output/entry.js | 0 .../pass/issue-1338/import-all/input/entry.js | 0 .../issue-1338/import-all/output/entry.js | 0 .../issue-1338/import-specific/input/entry.js | 0 .../import-specific/output/entry.js | 0 .../pass/issue-1533/case1/input/entry.js | 0 .../pass/issue-1533/case1/output/entry.js | 0 .../issue-1756/input/app/scripts/lib/util.js | 0 .../tests/pass/issue-1756/input/entry.js | 0 .../issue-1756/input/shared/constants/app.js | 0 .../ui/ducks/alerts/unconnected-account.js | 0 .../input/ui/helpers/utils/confirm-tx.util.js | 0 .../input/ui/helpers/utils/token-util.js | 0 .../input/ui/pages/send/send.constants.js | 0 .../input/ui/pages/send/send.utils.js | 0 .../pass/issue-1756/input/ui/store/actions.js | 0 .../tests/pass/merge/basic/input/a.js | 0 .../tests/pass/merge/basic/input/b.js | 0 .../tests/pass/merge/basic/input/entry.js | 0 .../tests/pass/merge/basic/output/entry.js | 0 .../side-effects/simple/input/a.js | 0 .../side-effects/simple/input/entry.js | 0 .../side-effects/simple/output/entry.js | 0 .../merge/name-conflict/simple/input/a.js | 0 .../merge/name-conflict/simple/input/b.js | 0 .../merge/name-conflict/simple/input/entry.js | 0 .../name-conflict/simple/output/entry.js | 0 .../tests/pass/merge/nested-import/input/a.js | 0 .../tests/pass/merge/nested-import/input/b.js | 0 .../pass/merge/nested-import/input/entry.js | 0 .../pass/merge/nested-import/output/entry.js | 0 .../multi-entry/.dynamic-import/input/a.js | 0 .../.dynamic-import/input/entry.js | 0 .../tests/pass/multi-entry/.mixed/input/a.js | 0 .../tests/pass/multi-entry/.mixed/input/b.js | 0 .../tests/pass/multi-entry/.mixed/input/c.js | 0 .../pass/multi-entry/.mixed/input/entryA.js | 0 .../pass/multi-entry/.mixed/input/entryB.js | 0 .../tests/pass/multi-entry/simple/input/c.js | 0 .../tests/pass/multi-entry/simple/input/d.js | 0 .../pass/multi-entry/simple/input/entry-a.js | 0 .../pass/multi-entry/simple/input/entry-b.js | 0 .../simple/output/d-2w4j5tksz1e1k.js | 0 .../pass/multi-entry/simple/output/entry-a.js | 0 .../pass/multi-entry/simple/output/entry-b.js | 0 .../builtin/.simple/input/entry.js | 0 .../library/simple/input/entry.js | 0 .../library/simple/output/entry.js | 0 .../tests/pass/pr-1105/example-1/input/a.js | 0 .../pass/pr-1105/example-1/input/entry.js | 0 .../pass/pr-1105/example-1/output/entry.js | 0 .../pass/pr-1105/example-10/input/.swcrc | 0 .../pass/pr-1105/example-10/input/entry.js | 0 .../tests/pass/pr-1105/example-10/input/i.ts | 0 .../tests/pass/pr-1105/example-10/input/j.ts | 0 .../tests/pass/pr-1105/example-10/input/k.ts | 0 .../pass/pr-1105/example-10/output/entry.js | 0 .../tests/pass/pr-1105/example-2/input/.swcrc | 0 .../tests/pass/pr-1105/example-2/input/b.js | 0 .../tests/pass/pr-1105/example-2/input/c.js | 0 .../pass/pr-1105/example-2/input/entry.js | 0 .../pass/pr-1105/example-2/output/entry.js | 0 .../tests/pass/pr-1105/example-3/input/a.js | 0 .../tests/pass/pr-1105/example-3/input/d.js | 0 .../pass/pr-1105/example-3/input/entry.js | 0 .../pass/pr-1105/example-3/output/entry.js | 0 .../tests/pass/pr-1105/example-5/input/a.js | 0 .../tests/pass/pr-1105/example-5/input/e.js | 0 .../pass/pr-1105/example-5/input/entry.js | 0 .../pass/pr-1105/example-5/output/entry.js | 0 .../tests/pass/pr-1105/example-7/input/.swcrc | 0 .../pass/pr-1105/example-7/input/entry.js | 0 .../tests/pass/pr-1105/example-7/input/f.js | 0 .../pass/pr-1105/example-7/output/entry.js | 0 .../pass/pr-1105/example-9-js/input/.swcrc | 0 .../pass/pr-1105/example-9-js/input/a.js | 0 .../pass/pr-1105/example-9-js/input/entry.js | 0 .../pass/pr-1105/example-9-js/output/entry.js | 0 .../pass/pr-1105/example-9-ts/input/.swcrc | 0 .../pass/pr-1105/example-9-ts/input/a.ts | 0 .../pass/pr-1105/example-9-ts/input/entry.js | 0 .../pass/pr-1105/example-9-ts/output/entry.js | 0 .../pass/reexport/.namespace/input/.swcrc | 0 .../tests/pass/reexport/.namespace/input/a.js | 0 .../tests/pass/reexport/.namespace/input/b.js | 0 .../pass/reexport/.namespace/input/entry.js | 0 .../pass/reexport/default-1-simple/input/a.js | 0 .../pass/reexport/default-1-simple/input/b.js | 0 .../reexport/default-1-simple/input/entry.js | 0 .../reexport/default-1-simple/output/entry.js | 0 .../reexport/import-then-export-1/input/a.js | 0 .../reexport/import-then-export-1/input/b.js | 0 .../import-then-export-1/input/entry.js | 0 .../import-then-export-1/output/entry.js | 0 .../reexport/import-then-export-2/input/a.js | 0 .../reexport/import-then-export-2/input/b.js | 0 .../import-then-export-2/input/entry.js | 0 .../import-then-export-2/output/entry.js | 0 .../reexport/import-then-export-3/input/a.js | 0 .../reexport/import-then-export-3/input/b.js | 0 .../import-then-export-3/input/entry.js | 0 .../import-then-export-3/output/entry.js | 0 .../pass/reexport/named-1-alias/input/a.js | 0 .../pass/reexport/named-1-alias/input/b.js | 0 .../reexport/named-1-alias/input/entry.js | 0 .../reexport/named-1-alias/output/entry.js | 0 .../pass/reexport/named-1-orig/input/a.js | 0 .../pass/reexport/named-1-orig/input/b.js | 0 .../pass/reexport/named-1-orig/input/entry.js | 0 .../reexport/named-1-orig/output/entry.js | 0 .../pass/reexport/named-2-nested/input/a.js | 0 .../pass/reexport/named-2-nested/input/b.js | 0 .../pass/reexport/named-2-nested/input/c.js | 0 .../reexport/named-2-nested/input/entry.js | 0 .../reexport/named-2-nested/output/entry.js | 0 .../pass/reexport/named-3-var/input/a.js | 0 .../pass/reexport/named-3-var/input/b.js | 0 .../pass/reexport/named-3-var/input/c.js | 0 .../pass/reexport/named-3-var/input/entry.js | 0 .../pass/reexport/named-3-var/output/entry.js | 0 .../tests/pass/reexport/named-4-fn/input/a.js | 0 .../tests/pass/reexport/named-4-fn/input/b.js | 0 .../pass/reexport/named-4-fn/input/entry.js | 0 .../pass/reexport/named-4-fn/output/entry.js | 0 .../pass/reexport/named-5-class/input/a.js | 0 .../pass/reexport/named-5-class/input/b.js | 0 .../reexport/named-5-class/input/entry.js | 0 .../reexport/named-5-class/output/entry.js | 0 .../pass/reexport/recursive-mini/input/a.js | 0 .../pass/reexport/recursive-mini/input/b.js | 0 .../reexport/recursive-mini/input/entry.js | 0 .../reexport/recursive-mini/output/entry.js | 0 .../pass/reexport/recursive-step1/input/a.js | 0 .../pass/reexport/recursive-step1/input/b.js | 0 .../pass/reexport/recursive-step1/input/c.js | 0 .../reexport/recursive-step1/input/entry.js | 0 .../reexport/recursive-step1/output/entry.js | 0 .../pass/reexport/recursive-step2/input/a.js | 0 .../pass/reexport/recursive-step2/input/b.js | 0 .../pass/reexport/recursive-step2/input/c.js | 0 .../pass/reexport/recursive-step2/input/d.js | 0 .../reexport/recursive-step2/input/entry.js | 0 .../reexport/recursive-step2/output/entry.js | 0 .../tests/pass/reexport/recursive/input/a.js | 0 .../tests/pass/reexport/recursive/input/b.js | 0 .../tests/pass/reexport/recursive/input/c.js | 0 .../tests/pass/reexport/recursive/input/d.js | 0 .../tests/pass/reexport/recursive/input/e.js | 0 .../pass/reexport/recursive/input/entry.js | 0 .../pass/reexport/recursive/output/entry.js | 0 .../pass/resolve-name-fix/input/entry.js | 0 .../pass/resolve-name-fix/input/package.json | 0 .../pass/resolve-name-fix/output/entry.js | 0 .../pass/swcrc/jsx/issue-884/input/.swcrc | 0 .../pass/swcrc/jsx/issue-884/input/entry.jsx | 0 .../pass/swcrc/jsx/issue-884/output/entry.js | 0 .../pass/swcrc/jsx/issue-884/output/entry.jsx | 0 .../pass/transitive/export-all-1/input/a.js | 0 .../pass/transitive/export-all-1/input/b.js | 0 .../pass/transitive/export-all-1/input/c.js | 0 .../pass/transitive/export-all-1/input/d.js | 0 .../pass/transitive/export-all-1/input/e.js | 0 .../transitive/export-all-1/input/entry.js | 0 .../pass/transitive/export-all-1/input/f.js | 0 .../transitive/export-all-1/output/entry.js | 0 .../pass/transitive/export-all-2/input/a.js | 0 .../pass/transitive/export-all-2/input/b.js | 0 .../pass/transitive/export-all-2/input/c.js | 0 .../pass/transitive/export-all-2/input/d.js | 0 .../pass/transitive/export-all-2/input/e.js | 0 .../transitive/export-all-2/input/entry.js | 0 .../pass/transitive/export-all-2/input/f.js | 0 .../transitive/export-all-2/output/entry.js | 0 .../pass/transitive/export-named/input/a.js | 0 .../pass/transitive/export-named/input/b.js | 0 .../transitive/export-named/input/common.js | 0 .../transitive/export-named/input/entry.js | 0 .../transitive/export-named/output/entry.js | 0 .../transitive/import/simple-1/input/a.js | 0 .../transitive/import/simple-1/input/b.js | 0 .../import/simple-1/input/common.js | 0 .../transitive/import/simple-1/input/entry.js | 0 .../import/simple-1/output/entry.js | 0 .../transitive/import/simple-2/input/a.js | 0 .../transitive/import/simple-2/input/b.js | 0 .../transitive/import/simple-2/input/c.js | 0 .../import/simple-2/input/common1.js | 0 .../import/simple-2/input/common2.js | 0 .../import/simple-2/input/common3.js | 0 .../import/simple-2/input/common4.js | 0 .../transitive/import/simple-2/input/entry.js | 0 .../import/simple-2/output/entry.js | 0 .../in-module-export/input/entry.js | 0 .../in-module-export/output/entry.js | 0 .../tree-shaking/in-module/input/entry.js | 0 .../tree-shaking/in-module/output/entry.js | 0 .../tree-shaking/preserve-import/input/b.js | 0 .../preserve-import/input/entry-a.js | 0 .../preserve-import/output/entry-a.js | 0 spack/.npmignore | 21 --- spack/Cargo.toml | 44 ------ spack/tests/pass/deno-002/.full/input/.swcrc | 9 -- src/builder.rs | 23 ++- src/config/mod.rs | 22 ++- src/lib.rs | 2 +- testing/src/lib.rs | 14 +- tests/projects.rs | 6 +- tests/simple.rs | 3 +- tests/source_map.rs | 22 ++- 739 files changed, 1007 insertions(+), 1843 deletions(-) rename node-swc/__tests__/{error_test.js => error_test.mjs} (57%) create mode 100644 node-swc/tests/legacy/octal.js rename {spack => node/bundler}/.gitignore (100%) create mode 100644 node/bundler/Cargo.toml rename {spack => node/bundler}/benches/bench.rs (100%) rename {spack => node/bundler}/build.rs (100%) rename {spack => node/bundler}/scripts/fixture.sh (100%) rename {spack => node/bundler}/src/config/mod.rs (100%) rename {spack => node/bundler}/src/config/module/mod.rs (100%) rename {spack => node/bundler}/src/config/optimization.rs (100%) rename {spack => node/bundler}/src/config/output.rs (100%) rename {spack => node/bundler}/src/config/resolve.rs (100%) rename {spack => node/bundler}/src/lib.rs (100%) rename {spack => node/bundler}/src/loaders/json.rs (80%) rename {spack => node/bundler}/src/loaders/mod.rs (100%) rename {spack => node/bundler}/src/loaders/swc.rs (97%) rename {spack => node/bundler}/tests/fixture.rs (99%) rename {spack => node/bundler}/tests/integration/react/.gitignore (100%) rename {spack => node/bundler}/tests/integration/react/package.json (100%) rename {spack => node/bundler}/tests/integration/react/spack.config.js (100%) rename {spack => node/bundler}/tests/integration/react/src/.swcrc (100%) rename {spack => node/bundler}/tests/integration/react/src/index.tsx (100%) rename {spack => node/bundler}/tests/package.json (100%) rename {spack => node/bundler}/tests/pass/.swcrc (100%) rename {spack => node/bundler}/tests/pass/alias/export-default/input/a.js (100%) rename {spack => node/bundler}/tests/pass/alias/export-default/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/alias/export-default/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/alias/export-named-1/input/a.js (100%) rename {spack => node/bundler}/tests/pass/alias/export-named-1/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/alias/export-named-1/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/alias/export-named-optimization/input/a.js (100%) rename {spack => node/bundler}/tests/pass/alias/export-named-optimization/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/alias/export-named-optimization/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/alias/export-named-same-name/input/a.js (100%) rename {spack => node/bundler}/tests/pass/alias/export-named-same-name/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/alias/export-named-same-name/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/alias/import/multi/input/a.js (100%) rename {spack => node/bundler}/tests/pass/alias/import/multi/input/b.js (100%) rename {spack => node/bundler}/tests/pass/alias/import/multi/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/alias/import/multi/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/alias/import/simple/input/a.js (100%) rename {spack => node/bundler}/tests/pass/alias/import/simple/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/alias/import/simple/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/basic/class-inheritance/input/a.js (100%) rename {spack => node/bundler}/tests/pass/basic/class-inheritance/input/b.js (100%) rename {spack => node/bundler}/tests/pass/basic/extends/input/a.js (100%) rename {spack => node/bundler}/tests/pass/basic/extends/input/b.js (100%) rename {spack => node/bundler}/tests/pass/basic/extends/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/basic/extends/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/basic/no-import/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/basic/no-import/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/basic/relative-import-const/input/a.js (100%) rename {spack => node/bundler}/tests/pass/basic/relative-import-const/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/basic/relative-import-const/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/circular/complex-class-function/input/a.js (100%) rename {spack => node/bundler}/tests/pass/circular/complex-class-function/input/b.js (100%) rename {spack => node/bundler}/tests/pass/circular/complex-class-function/input/c.js (100%) rename {spack => node/bundler}/tests/pass/circular/complex-class-function/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/circular/complex-class-function/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/circular/hygiene/class-inheritance/input/a.js (100%) rename {spack => node/bundler}/tests/pass/circular/hygiene/class-inheritance/input/b.js (100%) rename {spack => node/bundler}/tests/pass/circular/hygiene/class-inheritance/input/c.js (100%) rename {spack => node/bundler}/tests/pass/circular/hygiene/class-inheritance/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/circular/hygiene/class-inheritance/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/circular/imports-same/input/a.js (100%) rename {spack => node/bundler}/tests/pass/circular/imports-same/input/b.js (100%) rename {spack => node/bundler}/tests/pass/circular/imports-same/input/common-foo.js (100%) rename {spack => node/bundler}/tests/pass/circular/imports-same/input/common.js (100%) rename {spack => node/bundler}/tests/pass/circular/imports-same/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/circular/imports-same/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/circular/many/input/a.js (100%) rename {spack => node/bundler}/tests/pass/circular/many/input/b.js (100%) rename {spack => node/bundler}/tests/pass/circular/many/input/c.js (100%) rename {spack => node/bundler}/tests/pass/circular/many/input/d.js (100%) rename {spack => node/bundler}/tests/pass/circular/many/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/circular/mixed/input/a.js (100%) rename {spack => node/bundler}/tests/pass/circular/mixed/input/b.js (100%) rename {spack => node/bundler}/tests/pass/circular/mixed/input/c.js (100%) rename {spack => node/bundler}/tests/pass/circular/mixed/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/circular/mixed/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/circular/simple/input/a.js (100%) rename {spack => node/bundler}/tests/pass/circular/simple/input/b.js (100%) rename {spack => node/bundler}/tests/pass/circular/simple/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/circular/simple/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/circular/top-level-idents/input/a.js (100%) rename {spack => node/bundler}/tests/pass/circular/top-level-idents/input/b.js (100%) rename {spack => node/bundler}/tests/pass/circular/top-level-idents/input/c.js (100%) rename {spack => node/bundler}/tests/pass/circular/top-level-idents/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/circular/top-level-idents/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/cjs/common-library/input/a.js (100%) rename {spack => node/bundler}/tests/pass/cjs/common-library/input/b.js (100%) rename {spack => node/bundler}/tests/pass/cjs/common-library/input/common.js (100%) rename {spack => node/bundler}/tests/pass/cjs/common-library/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/cjs/common-library/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/cjs/conditional/input/common.js (100%) rename {spack => node/bundler}/tests/pass/cjs/conditional/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/cjs/conditional/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/cjs/issue-967-no-recursive-require/input/.swcrc (100%) rename {spack => node/bundler}/tests/pass/cjs/issue-967-no-recursive-require/input/a.js (100%) rename {spack => node/bundler}/tests/pass/cjs/issue-967-no-recursive-require/input/b.js (100%) rename {spack => node/bundler}/tests/pass/cjs/issue-967-no-recursive-require/input/c.js (100%) rename {spack => node/bundler}/tests/pass/cjs/issue-967-no-recursive-require/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/cjs/issue-967-no-recursive-require/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/cjs/issue-967-recursive-require/input/.swcrc (100%) rename {spack => node/bundler}/tests/pass/cjs/issue-967-recursive-require/input/a-a-a.js (100%) rename {spack => node/bundler}/tests/pass/cjs/issue-967-recursive-require/input/a-a.js (100%) rename {spack => node/bundler}/tests/pass/cjs/issue-967-recursive-require/input/a-b.js (100%) rename {spack => node/bundler}/tests/pass/cjs/issue-967-recursive-require/input/a.js (100%) rename {spack => node/bundler}/tests/pass/cjs/issue-967-recursive-require/input/b.js (100%) rename {spack => node/bundler}/tests/pass/cjs/issue-967-recursive-require/input/c.js (100%) rename {spack => node/bundler}/tests/pass/cjs/issue-967-recursive-require/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/cjs/issue-967-recursive-require/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/cjs/mixed/input/a.js (100%) rename {spack => node/bundler}/tests/pass/cjs/mixed/input/b.js (100%) rename {spack => node/bundler}/tests/pass/cjs/mixed/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/cjs/mixed/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/cjs/nested/input/a.js (100%) rename {spack => node/bundler}/tests/pass/cjs/nested/input/b.js (100%) rename {spack => node/bundler}/tests/pass/cjs/nested/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/cjs/nested/output/entry.js (100%) rename {spack/tests/deno-std => node/bundler/tests/pass/deno-001/full/input}/.swcrc (100%) rename {spack => node/bundler}/tests/pass/deno-001/full/input/_util/assert.ts (100%) rename {spack => node/bundler}/tests/pass/deno-001/full/input/async/deferred.ts (100%) rename {spack => node/bundler}/tests/pass/deno-001/full/input/async/delay.ts (100%) rename {spack => node/bundler}/tests/pass/deno-001/full/input/async/mod.ts (100%) rename {spack => node/bundler}/tests/pass/deno-001/full/input/async/mux_async_iterator.ts (100%) rename {spack => node/bundler}/tests/pass/deno-001/full/input/async/pool.ts (100%) rename {spack => node/bundler}/tests/pass/deno-001/full/input/bytes/mod.ts (100%) rename {spack => node/bundler}/tests/pass/deno-001/full/input/encoding/utf8.ts (100%) rename {spack => node/bundler}/tests/pass/deno-001/full/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/deno-001/full/input/http/_io.ts (100%) rename {spack => node/bundler}/tests/pass/deno-001/full/input/http/http_status.ts (100%) rename {spack => node/bundler}/tests/pass/deno-001/full/input/http/server.ts (100%) rename {spack => node/bundler}/tests/pass/deno-001/full/input/io/bufio.ts (100%) rename {spack => node/bundler}/tests/pass/deno-001/full/input/textproto/mod.ts (100%) rename {spack => node/bundler}/tests/pass/deno-001/full/output/entry.js (100%) rename {spack/tests/pass/deno-001/full => node/bundler/tests/pass/deno-001/simple-1}/input/.swcrc (100%) rename {spack => node/bundler}/tests/pass/deno-001/simple-1/input/async/deferred.ts (100%) rename {spack => node/bundler}/tests/pass/deno-001/simple-1/input/async/delay.ts (100%) rename {spack => node/bundler}/tests/pass/deno-001/simple-1/input/async/mod.ts (100%) rename {spack => node/bundler}/tests/pass/deno-001/simple-1/input/async/mux_async_iterator.ts (100%) rename {spack => node/bundler}/tests/pass/deno-001/simple-1/input/async/pool.ts (100%) rename {spack => node/bundler}/tests/pass/deno-001/simple-1/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/deno-001/simple-1/input/http/_io.ts (100%) rename {spack => node/bundler}/tests/pass/deno-001/simple-1/input/http/server.ts (100%) rename {spack => node/bundler}/tests/pass/deno-001/simple-1/input/textproto/mod.ts (100%) rename {spack => node/bundler}/tests/pass/deno-001/simple-1/output/entry.js (100%) rename {spack/tests/pass/deno-001/simple-1 => node/bundler/tests/pass/deno-001/simple-2}/input/.swcrc (100%) rename {spack => node/bundler}/tests/pass/deno-001/simple-2/input/async/deferred.ts (100%) rename {spack => node/bundler}/tests/pass/deno-001/simple-2/input/async/mod.ts (100%) rename {spack => node/bundler}/tests/pass/deno-001/simple-2/input/async/mux_async_iterator.ts (100%) rename {spack => node/bundler}/tests/pass/deno-001/simple-2/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/deno-001/simple-2/input/http/_io.ts (100%) rename {spack => node/bundler}/tests/pass/deno-001/simple-2/input/http/server.ts (100%) rename {spack => node/bundler}/tests/pass/deno-001/simple-2/input/textproto/mod.ts (100%) rename {spack => node/bundler}/tests/pass/deno-001/simple-2/output/entry.js (100%) rename {spack/tests/pass/deno-001/simple-2 => node/bundler/tests/pass/deno-001/simple-3}/input/.swcrc (100%) rename {spack => node/bundler}/tests/pass/deno-001/simple-3/input/async/deferred.ts (100%) rename {spack => node/bundler}/tests/pass/deno-001/simple-3/input/async/mod.ts (100%) rename {spack => node/bundler}/tests/pass/deno-001/simple-3/input/async/mux_async_iterator.ts (100%) rename {spack => node/bundler}/tests/pass/deno-001/simple-3/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/deno-001/simple-3/output/entry.js (100%) rename {spack/tests/pass/deno-001/simple-3 => node/bundler/tests/pass/deno-001/simple-4}/input/.swcrc (100%) rename {spack => node/bundler}/tests/pass/deno-001/simple-4/input/async/deferred.ts (100%) rename {spack => node/bundler}/tests/pass/deno-001/simple-4/input/async/mod.ts (100%) rename {spack => node/bundler}/tests/pass/deno-001/simple-4/input/async/mux_async_iterator.ts (100%) rename {spack => node/bundler}/tests/pass/deno-001/simple-4/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/deno-001/simple-4/output/entry.js (100%) rename {spack/tests/pass/deno-001/simple-4 => node/bundler/tests/pass/deno-001/simple-5}/input/.swcrc (100%) rename {spack => node/bundler}/tests/pass/deno-001/simple-5/input/async/deferred.ts (100%) rename {spack => node/bundler}/tests/pass/deno-001/simple-5/input/async/mod.ts (100%) rename {spack => node/bundler}/tests/pass/deno-001/simple-5/input/async/mux_async_iterator.ts (100%) rename {spack => node/bundler}/tests/pass/deno-001/simple-5/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/deno-001/simple-5/output/entry.js (100%) rename {spack/tests/pass/deno-001/simple-5 => node/bundler/tests/pass/deno-002/.full}/input/.swcrc (100%) rename {spack => node/bundler}/tests/pass/deno-002/.full/input/async/deferred.ts (100%) rename {spack => node/bundler}/tests/pass/deno-002/.full/input/async/delay.ts (100%) rename {spack => node/bundler}/tests/pass/deno-002/.full/input/async/mod.ts (100%) rename {spack => node/bundler}/tests/pass/deno-002/.full/input/async/mux_async_iterator.ts (100%) rename {spack => node/bundler}/tests/pass/deno-002/.full/input/async/pool.ts (100%) rename {spack => node/bundler}/tests/pass/deno-002/.full/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/deno-002/.full/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/drop-unused/export/default-mixed/input/a.js (100%) rename {spack => node/bundler}/tests/pass/drop-unused/export/default-mixed/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/drop-unused/export/default-mixed/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/drop-unused/export/named/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/drop-unused/export/named/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/drop-unused/side-effect/import-multi/input/a.js (100%) rename {spack => node/bundler}/tests/pass/drop-unused/side-effect/import-multi/input/b.js (100%) rename {spack => node/bundler}/tests/pass/drop-unused/side-effect/import-multi/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/drop-unused/side-effect/import-multi/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/drop-unused/side-effect/simple/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/drop-unused/side-effect/simple/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/dynamic-import/namespace/dynamic-key/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/dynamic-import/namespace/dynamic-key/input/lib/a.js (100%) rename {spack => node/bundler}/tests/pass/dynamic-import/namespace/dynamic-key/input/lib/b.js (100%) rename {spack => node/bundler}/tests/pass/dynamic-import/namespace/dynamic-key/input/lib/nop.js (100%) rename {spack => node/bundler}/tests/pass/dynamic-import/namespace/dynamic-key/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/dynmaic-imports/issue-1112/simple/input/.swcrc (100%) rename {spack => node/bundler}/tests/pass/dynmaic-imports/issue-1112/simple/input/a.js (100%) rename {spack => node/bundler}/tests/pass/dynmaic-imports/issue-1112/simple/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/dynmaic-imports/issue-1112/simple/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/export-all/input/a.js (100%) rename {spack => node/bundler}/tests/pass/export-all/input/b.js (100%) rename {spack => node/bundler}/tests/pass/export-all/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/export-all/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/export-star-namespace/issue-1109/.swcrc (100%) rename {spack => node/bundler}/tests/pass/export-star-namespace/issue-1109/input/a.ts (100%) rename {spack => node/bundler}/tests/pass/export-star-namespace/issue-1109/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/export-star-namespace/issue-1109/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/export/all-1/multiple/input/a.js (100%) rename {spack => node/bundler}/tests/pass/export/all-1/multiple/input/b.js (100%) rename {spack => node/bundler}/tests/pass/export/all-1/multiple/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/export/all-1/multiple/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/export/all-2/input/a.js (100%) rename {spack => node/bundler}/tests/pass/export/all-2/input/b.js (100%) rename {spack => node/bundler}/tests/pass/export/all-2/input/c.js (100%) rename {spack => node/bundler}/tests/pass/export/all-2/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/export/all-2/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/export/all-nested-1/input/a.js (100%) rename {spack => node/bundler}/tests/pass/export/all-nested-1/input/b.js (100%) rename {spack => node/bundler}/tests/pass/export/all-nested-1/input/c.js (100%) rename {spack => node/bundler}/tests/pass/export/all-nested-1/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/export/all-nested-1/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/export/complex-1/input/a.js (100%) rename {spack => node/bundler}/tests/pass/export/complex-1/input/b.js (100%) rename {spack => node/bundler}/tests/pass/export/complex-1/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/export/complex-1/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/export/issue-1111/simple/input/a.js (100%) rename {spack => node/bundler}/tests/pass/export/issue-1111/simple/input/d.js (100%) rename {spack => node/bundler}/tests/pass/export/issue-1111/simple/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/export/issue-1111/simple/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/export/mixed-all-and-const/input/a.js (100%) rename {spack => node/bundler}/tests/pass/export/mixed-all-and-const/input/b.js (100%) rename {spack => node/bundler}/tests/pass/export/mixed-all-and-const/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/export/mixed-all-and-const/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/helpers/simple/input/.swcrc (100%) rename {spack => node/bundler}/tests/pass/helpers/simple/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/helpers/simple/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/import-with-export/simple-1/input/a.js (100%) rename {spack => node/bundler}/tests/pass/import-with-export/simple-1/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/import-with-export/simple-1/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/import/commons-default/input/a.js (100%) rename {spack => node/bundler}/tests/pass/import/commons-default/input/b.js (100%) rename {spack => node/bundler}/tests/pass/import/commons-default/input/c.js (100%) rename {spack => node/bundler}/tests/pass/import/commons-default/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/import/commons-default/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/import/commons-named/input/a.js (100%) rename {spack => node/bundler}/tests/pass/import/commons-named/input/b.js (100%) rename {spack => node/bundler}/tests/pass/import/commons-named/input/c.js (100%) rename {spack => node/bundler}/tests/pass/import/commons-named/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/import/commons-named/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/import/computed-key/input/a.js (100%) rename {spack => node/bundler}/tests/pass/import/computed-key/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/import/computed-key/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/import/default/named-class/input/a.js (100%) rename {spack => node/bundler}/tests/pass/import/default/named-class/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/import/default/named-class/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/import/default/unnamed-class/input/a.js (100%) rename {spack => node/bundler}/tests/pass/import/default/unnamed-class/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/import/default/unnamed-class/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/import/name-conflict/simple/input/a.js (100%) rename {spack => node/bundler}/tests/pass/import/name-conflict/simple/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/import/name-conflict/simple/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/import/namespace/name-conflict/in-entry/input/a.js (100%) rename {spack => node/bundler}/tests/pass/import/namespace/name-conflict/in-entry/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/import/namespace/name-conflict/in-entry/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/import/namespace/simple/input/a.js (100%) rename {spack => node/bundler}/tests/pass/import/namespace/simple/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/import/namespace/simple/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/import/resursive/input/a.js (100%) rename {spack => node/bundler}/tests/pass/import/resursive/input/b.js (100%) rename {spack => node/bundler}/tests/pass/import/resursive/input/c.js (100%) rename {spack => node/bundler}/tests/pass/import/resursive/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/import/resursive/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/import/simple-alias/input/a.js (100%) rename {spack => node/bundler}/tests/pass/import/simple-alias/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/import/simple-alias/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/import/simple-decl/input/a.js (100%) rename {spack => node/bundler}/tests/pass/import/simple-decl/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/import/simple-decl/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/import/star-export/input/a.js (100%) rename {spack => node/bundler}/tests/pass/import/star-export/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/import/star-export/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/import/star-use/input/a.js (100%) rename {spack => node/bundler}/tests/pass/import/star-use/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/import/star-use/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/import/top-level-require/.order/input/a.js (100%) rename {spack => node/bundler}/tests/pass/import/top-level-require/.order/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/import/top-level-require/.order/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/import/top-level-require/.seq-expr/input/a.js (100%) rename {spack => node/bundler}/tests/pass/import/top-level-require/.seq-expr/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/import/top-level-require/.seq-expr/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/import/top-level-require/.simple/input/a.js (100%) rename {spack => node/bundler}/tests/pass/import/top-level-require/.simple/input/b.js (100%) rename {spack => node/bundler}/tests/pass/import/top-level-require/.simple/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/import/top-level-require/.simple/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/issue-1138/example-1/input/.swcrc (100%) rename {spack => node/bundler}/tests/pass/issue-1138/example-1/input/a.ts (100%) rename {spack => node/bundler}/tests/pass/issue-1138/example-1/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/issue-1138/example-1/input/l.ts (100%) rename {spack => node/bundler}/tests/pass/issue-1138/example-1/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/issue-1138/example-2/input/.swcrc (100%) rename {spack => node/bundler}/tests/pass/issue-1138/example-2/input/a.ts (100%) rename {spack => node/bundler}/tests/pass/issue-1138/example-2/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/issue-1138/example-2/input/l.ts (100%) rename {spack => node/bundler}/tests/pass/issue-1138/example-2/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/issue-1138/example-3/input/.swcrc (100%) rename {spack => node/bundler}/tests/pass/issue-1138/example-3/input/a.ts (100%) rename {spack => node/bundler}/tests/pass/issue-1138/example-3/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/issue-1138/example-3/input/l.ts (100%) rename {spack => node/bundler}/tests/pass/issue-1138/example-3/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/issue-1139/example-1/input/a.js (100%) rename {spack => node/bundler}/tests/pass/issue-1139/example-1/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/issue-1139/example-1/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/issue-1139/example-2/input/a.js (100%) rename {spack => node/bundler}/tests/pass/issue-1139/example-2/input/b.js (100%) rename {spack => node/bundler}/tests/pass/issue-1139/example-2/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/issue-1139/example-2/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/issue-1225/cjs/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/issue-1225/cjs/input/mod.json (100%) rename {spack => node/bundler}/tests/pass/issue-1225/cjs/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/issue-1225/esm/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/issue-1225/esm/input/mod.json (100%) rename {spack => node/bundler}/tests/pass/issue-1225/esm/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/issue-1328/case1/input/.swcrc (100%) rename {spack => node/bundler}/tests/pass/issue-1328/case1/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/issue-1328/case1/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/issue-1338/export-all-alias/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/issue-1338/export-all-alias/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/issue-1338/export-all/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/issue-1338/export-all/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/issue-1338/import-all/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/issue-1338/import-all/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/issue-1338/import-specific/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/issue-1338/import-specific/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/issue-1533/case1/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/issue-1533/case1/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/issue-1756/input/app/scripts/lib/util.js (100%) rename {spack => node/bundler}/tests/pass/issue-1756/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/issue-1756/input/shared/constants/app.js (100%) rename {spack => node/bundler}/tests/pass/issue-1756/input/ui/ducks/alerts/unconnected-account.js (100%) rename {spack => node/bundler}/tests/pass/issue-1756/input/ui/helpers/utils/confirm-tx.util.js (100%) rename {spack => node/bundler}/tests/pass/issue-1756/input/ui/helpers/utils/token-util.js (100%) rename {spack => node/bundler}/tests/pass/issue-1756/input/ui/pages/send/send.constants.js (100%) rename {spack => node/bundler}/tests/pass/issue-1756/input/ui/pages/send/send.utils.js (100%) rename {spack => node/bundler}/tests/pass/issue-1756/input/ui/store/actions.js (100%) rename {spack => node/bundler}/tests/pass/merge/basic/input/a.js (100%) rename {spack => node/bundler}/tests/pass/merge/basic/input/b.js (100%) rename {spack => node/bundler}/tests/pass/merge/basic/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/merge/basic/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/merge/name-conflict/side-effects/simple/input/a.js (100%) rename {spack => node/bundler}/tests/pass/merge/name-conflict/side-effects/simple/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/merge/name-conflict/side-effects/simple/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/merge/name-conflict/simple/input/a.js (100%) rename {spack => node/bundler}/tests/pass/merge/name-conflict/simple/input/b.js (100%) rename {spack => node/bundler}/tests/pass/merge/name-conflict/simple/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/merge/name-conflict/simple/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/merge/nested-import/input/a.js (100%) rename {spack => node/bundler}/tests/pass/merge/nested-import/input/b.js (100%) rename {spack => node/bundler}/tests/pass/merge/nested-import/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/merge/nested-import/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/multi-entry/.dynamic-import/input/a.js (100%) rename {spack => node/bundler}/tests/pass/multi-entry/.dynamic-import/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/multi-entry/.mixed/input/a.js (100%) rename {spack => node/bundler}/tests/pass/multi-entry/.mixed/input/b.js (100%) rename {spack => node/bundler}/tests/pass/multi-entry/.mixed/input/c.js (100%) rename {spack => node/bundler}/tests/pass/multi-entry/.mixed/input/entryA.js (100%) rename {spack => node/bundler}/tests/pass/multi-entry/.mixed/input/entryB.js (100%) rename {spack => node/bundler}/tests/pass/multi-entry/simple/input/c.js (100%) rename {spack => node/bundler}/tests/pass/multi-entry/simple/input/d.js (100%) rename {spack => node/bundler}/tests/pass/multi-entry/simple/input/entry-a.js (100%) rename {spack => node/bundler}/tests/pass/multi-entry/simple/input/entry-b.js (100%) rename {spack => node/bundler}/tests/pass/multi-entry/simple/output/d-2w4j5tksz1e1k.js (100%) rename {spack => node/bundler}/tests/pass/multi-entry/simple/output/entry-a.js (100%) rename {spack => node/bundler}/tests/pass/multi-entry/simple/output/entry-b.js (100%) rename {spack => node/bundler}/tests/pass/node-modules/builtin/.simple/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/node-modules/library/simple/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/node-modules/library/simple/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/pr-1105/example-1/input/a.js (100%) rename {spack => node/bundler}/tests/pass/pr-1105/example-1/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/pr-1105/example-1/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/pr-1105/example-10/input/.swcrc (100%) rename {spack => node/bundler}/tests/pass/pr-1105/example-10/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/pr-1105/example-10/input/i.ts (100%) rename {spack => node/bundler}/tests/pass/pr-1105/example-10/input/j.ts (100%) rename {spack => node/bundler}/tests/pass/pr-1105/example-10/input/k.ts (100%) rename {spack => node/bundler}/tests/pass/pr-1105/example-10/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/pr-1105/example-2/input/.swcrc (100%) rename {spack => node/bundler}/tests/pass/pr-1105/example-2/input/b.js (100%) rename {spack => node/bundler}/tests/pass/pr-1105/example-2/input/c.js (100%) rename {spack => node/bundler}/tests/pass/pr-1105/example-2/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/pr-1105/example-2/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/pr-1105/example-3/input/a.js (100%) rename {spack => node/bundler}/tests/pass/pr-1105/example-3/input/d.js (100%) rename {spack => node/bundler}/tests/pass/pr-1105/example-3/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/pr-1105/example-3/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/pr-1105/example-5/input/a.js (100%) rename {spack => node/bundler}/tests/pass/pr-1105/example-5/input/e.js (100%) rename {spack => node/bundler}/tests/pass/pr-1105/example-5/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/pr-1105/example-5/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/pr-1105/example-7/input/.swcrc (100%) rename {spack => node/bundler}/tests/pass/pr-1105/example-7/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/pr-1105/example-7/input/f.js (100%) rename {spack => node/bundler}/tests/pass/pr-1105/example-7/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/pr-1105/example-9-js/input/.swcrc (100%) rename {spack => node/bundler}/tests/pass/pr-1105/example-9-js/input/a.js (100%) rename {spack => node/bundler}/tests/pass/pr-1105/example-9-js/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/pr-1105/example-9-js/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/pr-1105/example-9-ts/input/.swcrc (100%) rename {spack => node/bundler}/tests/pass/pr-1105/example-9-ts/input/a.ts (100%) rename {spack => node/bundler}/tests/pass/pr-1105/example-9-ts/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/pr-1105/example-9-ts/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/reexport/.namespace/input/.swcrc (100%) rename {spack => node/bundler}/tests/pass/reexport/.namespace/input/a.js (100%) rename {spack => node/bundler}/tests/pass/reexport/.namespace/input/b.js (100%) rename {spack => node/bundler}/tests/pass/reexport/.namespace/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/reexport/default-1-simple/input/a.js (100%) rename {spack => node/bundler}/tests/pass/reexport/default-1-simple/input/b.js (100%) rename {spack => node/bundler}/tests/pass/reexport/default-1-simple/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/reexport/default-1-simple/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/reexport/import-then-export-1/input/a.js (100%) rename {spack => node/bundler}/tests/pass/reexport/import-then-export-1/input/b.js (100%) rename {spack => node/bundler}/tests/pass/reexport/import-then-export-1/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/reexport/import-then-export-1/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/reexport/import-then-export-2/input/a.js (100%) rename {spack => node/bundler}/tests/pass/reexport/import-then-export-2/input/b.js (100%) rename {spack => node/bundler}/tests/pass/reexport/import-then-export-2/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/reexport/import-then-export-2/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/reexport/import-then-export-3/input/a.js (100%) rename {spack => node/bundler}/tests/pass/reexport/import-then-export-3/input/b.js (100%) rename {spack => node/bundler}/tests/pass/reexport/import-then-export-3/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/reexport/import-then-export-3/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/reexport/named-1-alias/input/a.js (100%) rename {spack => node/bundler}/tests/pass/reexport/named-1-alias/input/b.js (100%) rename {spack => node/bundler}/tests/pass/reexport/named-1-alias/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/reexport/named-1-alias/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/reexport/named-1-orig/input/a.js (100%) rename {spack => node/bundler}/tests/pass/reexport/named-1-orig/input/b.js (100%) rename {spack => node/bundler}/tests/pass/reexport/named-1-orig/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/reexport/named-1-orig/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/reexport/named-2-nested/input/a.js (100%) rename {spack => node/bundler}/tests/pass/reexport/named-2-nested/input/b.js (100%) rename {spack => node/bundler}/tests/pass/reexport/named-2-nested/input/c.js (100%) rename {spack => node/bundler}/tests/pass/reexport/named-2-nested/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/reexport/named-2-nested/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/reexport/named-3-var/input/a.js (100%) rename {spack => node/bundler}/tests/pass/reexport/named-3-var/input/b.js (100%) rename {spack => node/bundler}/tests/pass/reexport/named-3-var/input/c.js (100%) rename {spack => node/bundler}/tests/pass/reexport/named-3-var/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/reexport/named-3-var/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/reexport/named-4-fn/input/a.js (100%) rename {spack => node/bundler}/tests/pass/reexport/named-4-fn/input/b.js (100%) rename {spack => node/bundler}/tests/pass/reexport/named-4-fn/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/reexport/named-4-fn/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/reexport/named-5-class/input/a.js (100%) rename {spack => node/bundler}/tests/pass/reexport/named-5-class/input/b.js (100%) rename {spack => node/bundler}/tests/pass/reexport/named-5-class/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/reexport/named-5-class/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/reexport/recursive-mini/input/a.js (100%) rename {spack => node/bundler}/tests/pass/reexport/recursive-mini/input/b.js (100%) rename {spack => node/bundler}/tests/pass/reexport/recursive-mini/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/reexport/recursive-mini/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/reexport/recursive-step1/input/a.js (100%) rename {spack => node/bundler}/tests/pass/reexport/recursive-step1/input/b.js (100%) rename {spack => node/bundler}/tests/pass/reexport/recursive-step1/input/c.js (100%) rename {spack => node/bundler}/tests/pass/reexport/recursive-step1/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/reexport/recursive-step1/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/reexport/recursive-step2/input/a.js (100%) rename {spack => node/bundler}/tests/pass/reexport/recursive-step2/input/b.js (100%) rename {spack => node/bundler}/tests/pass/reexport/recursive-step2/input/c.js (100%) rename {spack => node/bundler}/tests/pass/reexport/recursive-step2/input/d.js (100%) rename {spack => node/bundler}/tests/pass/reexport/recursive-step2/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/reexport/recursive-step2/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/reexport/recursive/input/a.js (100%) rename {spack => node/bundler}/tests/pass/reexport/recursive/input/b.js (100%) rename {spack => node/bundler}/tests/pass/reexport/recursive/input/c.js (100%) rename {spack => node/bundler}/tests/pass/reexport/recursive/input/d.js (100%) rename {spack => node/bundler}/tests/pass/reexport/recursive/input/e.js (100%) rename {spack => node/bundler}/tests/pass/reexport/recursive/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/reexport/recursive/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/resolve-name-fix/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/resolve-name-fix/input/package.json (100%) rename {spack => node/bundler}/tests/pass/resolve-name-fix/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/swcrc/jsx/issue-884/input/.swcrc (100%) rename {spack => node/bundler}/tests/pass/swcrc/jsx/issue-884/input/entry.jsx (100%) rename {spack => node/bundler}/tests/pass/swcrc/jsx/issue-884/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/swcrc/jsx/issue-884/output/entry.jsx (100%) rename {spack => node/bundler}/tests/pass/transitive/export-all-1/input/a.js (100%) rename {spack => node/bundler}/tests/pass/transitive/export-all-1/input/b.js (100%) rename {spack => node/bundler}/tests/pass/transitive/export-all-1/input/c.js (100%) rename {spack => node/bundler}/tests/pass/transitive/export-all-1/input/d.js (100%) rename {spack => node/bundler}/tests/pass/transitive/export-all-1/input/e.js (100%) rename {spack => node/bundler}/tests/pass/transitive/export-all-1/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/transitive/export-all-1/input/f.js (100%) rename {spack => node/bundler}/tests/pass/transitive/export-all-1/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/transitive/export-all-2/input/a.js (100%) rename {spack => node/bundler}/tests/pass/transitive/export-all-2/input/b.js (100%) rename {spack => node/bundler}/tests/pass/transitive/export-all-2/input/c.js (100%) rename {spack => node/bundler}/tests/pass/transitive/export-all-2/input/d.js (100%) rename {spack => node/bundler}/tests/pass/transitive/export-all-2/input/e.js (100%) rename {spack => node/bundler}/tests/pass/transitive/export-all-2/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/transitive/export-all-2/input/f.js (100%) rename {spack => node/bundler}/tests/pass/transitive/export-all-2/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/transitive/export-named/input/a.js (100%) rename {spack => node/bundler}/tests/pass/transitive/export-named/input/b.js (100%) rename {spack => node/bundler}/tests/pass/transitive/export-named/input/common.js (100%) rename {spack => node/bundler}/tests/pass/transitive/export-named/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/transitive/export-named/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/transitive/import/simple-1/input/a.js (100%) rename {spack => node/bundler}/tests/pass/transitive/import/simple-1/input/b.js (100%) rename {spack => node/bundler}/tests/pass/transitive/import/simple-1/input/common.js (100%) rename {spack => node/bundler}/tests/pass/transitive/import/simple-1/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/transitive/import/simple-1/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/transitive/import/simple-2/input/a.js (100%) rename {spack => node/bundler}/tests/pass/transitive/import/simple-2/input/b.js (100%) rename {spack => node/bundler}/tests/pass/transitive/import/simple-2/input/c.js (100%) rename {spack => node/bundler}/tests/pass/transitive/import/simple-2/input/common1.js (100%) rename {spack => node/bundler}/tests/pass/transitive/import/simple-2/input/common2.js (100%) rename {spack => node/bundler}/tests/pass/transitive/import/simple-2/input/common3.js (100%) rename {spack => node/bundler}/tests/pass/transitive/import/simple-2/input/common4.js (100%) rename {spack => node/bundler}/tests/pass/transitive/import/simple-2/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/transitive/import/simple-2/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/tree-shaking/in-module-export/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/tree-shaking/in-module-export/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/tree-shaking/in-module/input/entry.js (100%) rename {spack => node/bundler}/tests/pass/tree-shaking/in-module/output/entry.js (100%) rename {spack => node/bundler}/tests/pass/tree-shaking/preserve-import/input/b.js (100%) rename {spack => node/bundler}/tests/pass/tree-shaking/preserve-import/input/entry-a.js (100%) rename {spack => node/bundler}/tests/pass/tree-shaking/preserve-import/output/entry-a.js (100%) delete mode 100644 spack/.npmignore delete mode 100644 spack/Cargo.toml delete mode 100644 spack/tests/pass/deno-002/.full/input/.swcrc diff --git a/.github/workflows/cargo.yml b/.github/workflows/cargo.yml index c79b1623c1eb..8505497ad1d3 100644 --- a/.github/workflows/cargo.yml +++ b/.github/workflows/cargo.yml @@ -103,7 +103,6 @@ jobs: - from_variant - jsdoc - node - - spack - string_enum - swc - swc_atoms @@ -138,6 +137,7 @@ jobs: - swc_eq_ignore_macros - swc_macros_common - swc_node_base + - swc_node_bundler - swc_visit - swc_visit_macros - testing @@ -145,7 +145,7 @@ jobs: - wasm exclude: - os: windows-latest - crate: spack + crate: swc_node_bundler steps: - name: Handle line endings @@ -232,10 +232,9 @@ jobs: uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: nightly-2021-03-30 - name: Create rustdoc - run: cargo +nightly-2021-03-30 doc + run: cargo doc - name: Create CNAME run: | diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 55b7f2757b7e..643dd6226899 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -115,4 +115,4 @@ jobs: - name: (spack) example react app run: | export PATH="$PATH:$HOME/npm/bin" - (cd spack/tests/integration/react && npm i && npx spack) + (cd node/bundler/tests/integration/react && npm i && npx spack) diff --git a/.npmignore b/.npmignore index 51d425f7a7fd..818da1fd2561 100644 --- a/.npmignore +++ b/.npmignore @@ -40,6 +40,7 @@ common CONTRIBUTING.md ecmascript macros +node node-swc scripts spack diff --git a/.rustfmt.toml b/.rustfmt.toml index 69a311ce686e..6e75b410a203 100644 --- a/.rustfmt.toml +++ b/.rustfmt.toml @@ -1,3 +1,4 @@ format_strings = true +merge_imports = true use_field_init_shorthand = true wrap_comments = true diff --git a/Cargo.lock b/Cargo.lock index c0ae21c4a711..11b33e6958df 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1077,7 +1077,6 @@ dependencies = [ "path-clean", "serde", "serde_json", - "spack", "swc", "swc_atoms", "swc_babel_compat", @@ -1086,6 +1085,7 @@ dependencies = [ "swc_ecma_ast", "swc_ecma_parser", "swc_node_base", + "swc_node_bundler", ] [[package]] @@ -2024,39 +2024,6 @@ dependencies = [ "url", ] -[[package]] -name = "spack" -version = "0.0.0" -dependencies = [ - "anyhow", - "dashmap", - "fxhash", - "is-macro", - "log", - "once_cell", - "pretty_assertions 0.6.1", - "pretty_env_logger", - "regex", - "serde", - "serde_json", - "string_enum", - "swc", - "swc_atoms", - "swc_bundler", - "swc_common", - "swc_ecma_ast", - "swc_ecma_codegen", - "swc_ecma_loader", - "swc_ecma_parser", - "swc_ecma_transforms", - "swc_ecma_utils", - "swc_ecma_visit", - "swc_node_base", - "tempfile", - "testing", - "walkdir", -] - [[package]] name = "st-map" version = "0.1.4" @@ -2755,13 +2722,46 @@ dependencies = [ [[package]] name = "swc_node_base" -version = "0.2.0" +version = "0.2.1" dependencies = [ "dashmap", "mimalloc-rust", "swc_common", ] +[[package]] +name = "swc_node_bundler" +version = "0.0.0" +dependencies = [ + "anyhow", + "dashmap", + "fxhash", + "is-macro", + "log", + "once_cell", + "pretty_assertions 0.6.1", + "pretty_env_logger", + "regex", + "serde", + "serde_json", + "string_enum", + "swc", + "swc_atoms", + "swc_bundler", + "swc_common", + "swc_ecma_ast", + "swc_ecma_codegen", + "swc_ecma_loader", + "swc_ecma_parser", + "swc_ecma_transforms", + "swc_ecma_utils", + "swc_ecma_visit", + "swc_node_base", + "tempfile", + "testing", + "walkdir", +] + [[package]] name = "swc_visit" version = "0.2.5" diff --git a/babel/compat/benches/babelify.rs b/babel/compat/benches/babelify.rs index 5756591acb1f..383f1517ecae 100644 --- a/babel/compat/benches/babelify.rs +++ b/babel/compat/benches/babelify.rs @@ -3,16 +3,12 @@ extern crate test; -use std::io::stderr; -use std::{hint::black_box, sync::Arc}; -use swc_babel_compat::babelify::Babelify; -use swc_babel_compat::babelify::Context; -use swc_common::SourceFile; -use swc_common::{errors::Handler, FileName, FilePathMapping, SourceMap}; +use std::{hint::black_box, io::stderr, sync::Arc}; +use swc_babel_compat::babelify::{Babelify, Context}; +use swc_common::{errors::Handler, FileName, FilePathMapping, SourceFile, SourceMap}; use swc_ecma_ast::Program; use swc_ecma_parser::{JscTarget, Syntax}; -use swc_ecma_transforms::compat::es2020; -use swc_ecma_transforms::typescript; +use swc_ecma_transforms::{compat::es2020, typescript}; use swc_ecma_visit::FoldWith; use test::Bencher; diff --git a/babel/compat/src/babelify/class.rs b/babel/compat/src/babelify/class.rs index 07d416b96278..208590e1a45e 100644 --- a/babel/compat/src/babelify/class.rs +++ b/babel/compat/src/babelify/class.rs @@ -1,6 +1,4 @@ -use crate::babelify::extract_class_body_span; -use crate::babelify::Babelify; -use crate::babelify::Context; +use crate::babelify::{extract_class_body_span, Babelify, Context}; use copyless::BoxHelper; use serde_json::value::Value; use swc_babel_ast::{ diff --git a/babel/compat/src/babelify/mod.rs b/babel/compat/src/babelify/mod.rs index d3bdd88950ac..fb2c48ca7369 100644 --- a/babel/compat/src/babelify/mod.rs +++ b/babel/compat/src/babelify/mod.rs @@ -1,16 +1,13 @@ use rayon::prelude::*; -use serde::de::DeserializeOwned; -use serde::Serialize; +use serde::{de::DeserializeOwned, Serialize}; use std::sync::Arc; use swc::SwcComments; use swc_babel_ast::{BaseComment, BaseNode, Comment, LineCol, Loc}; -use swc_common::comments::CommentKind; -use swc_common::comments::Comments; -use swc_common::sync::Lrc; -use swc_common::BytePos; -use swc_common::SourceFile; -use swc_common::SourceMap; -use swc_common::Span; +use swc_common::{ + comments::{CommentKind, Comments}, + sync::Lrc, + BytePos, SourceFile, SourceMap, Span, +}; use swc_ecma_ast::Class; mod class; diff --git a/babel/compat/src/babelify/typescript.rs b/babel/compat/src/babelify/typescript.rs index 72406d93a469..0de044a9f01a 100644 --- a/babel/compat/src/babelify/typescript.rs +++ b/babel/compat/src/babelify/typescript.rs @@ -1,7 +1,6 @@ use crate::babelify::{Babelify, Context}; use copyless::BoxHelper; -use swc_atoms::js_word; -use swc_atoms::JsWord; +use swc_atoms::{js_word, JsWord}; use swc_babel_ast::{ Access, ArrayPattern, IdOrRest, IdOrString, Identifier, ObjectPattern, RestElement, TSAnyKeyword, TSArrayType, TSAsExpression, TSBigIntKeyword, TSBooleanKeyword, diff --git a/babel/compat/src/swcify/class.rs b/babel/compat/src/swcify/class.rs index b3d7f9d31d92..61e77809f8b3 100644 --- a/babel/compat/src/swcify/class.rs +++ b/babel/compat/src/swcify/class.rs @@ -1,15 +1,9 @@ use super::Context; use crate::swcify::Swcify; -use swc_babel_ast::ClassBody; -use swc_babel_ast::ClassBodyEl; -use swc_babel_ast::ClassImpl; -use swc_babel_ast::ClassMethodKind; -use swc_babel_ast::TSExpressionWithTypeArguments; -use swc_ecma_ast::ClassMember; -use swc_ecma_ast::Function; -use swc_ecma_ast::MethodKind; -use swc_ecma_ast::ParamOrTsParamProp; -use swc_ecma_ast::TsExprWithTypeArgs; +use swc_babel_ast::{ + ClassBody, ClassBodyEl, ClassImpl, ClassMethodKind, TSExpressionWithTypeArguments, +}; +use swc_ecma_ast::{ClassMember, Function, MethodKind, ParamOrTsParamProp, TsExprWithTypeArgs}; use swc_ecma_utils::prop_name_to_expr; impl Swcify for ClassBody { diff --git a/babel/compat/src/swcify/ctx.rs b/babel/compat/src/swcify/ctx.rs index a20e58c688e3..39b3db970ef9 100644 --- a/babel/compat/src/swcify/ctx.rs +++ b/babel/compat/src/swcify/ctx.rs @@ -1,15 +1,7 @@ use std::sync::Arc; use swc::SwcComments; -use swc_babel_ast::BaseNode; -use swc_babel_ast::LineCol; -use swc_babel_ast::Loc; -use swc_common::BytePos; -use swc_common::FileName; -use swc_common::SourceFile; -use swc_common::SourceMap; -use swc_common::Span; -use swc_common::SyntaxContext; -use swc_common::DUMMY_SP; +use swc_babel_ast::{BaseNode, LineCol, Loc}; +use swc_common::{BytePos, FileName, SourceFile, SourceMap, Span, SyntaxContext, DUMMY_SP}; pub struct Context { #[allow(unused)] diff --git a/babel/compat/src/swcify/expr.rs b/babel/compat/src/swcify/expr.rs index 7ae04f9ac033..96d0cb112e4f 100644 --- a/babel/compat/src/swcify/expr.rs +++ b/babel/compat/src/swcify/expr.rs @@ -1,121 +1,31 @@ use crate::swcify::Swcify; use swc_atoms::js_word; -use swc_babel_ast::Arg; -use swc_babel_ast::ArrayExprEl; -use swc_babel_ast::ArrayExpression; -use swc_babel_ast::ArrowFuncExprBody; -use swc_babel_ast::ArrowFunctionExpression; -use swc_babel_ast::AssignmentExpression; -use swc_babel_ast::AwaitExpression; -use swc_babel_ast::BinaryExprLeft; -use swc_babel_ast::BinaryExprOp; -use swc_babel_ast::BinaryExpression; -use swc_babel_ast::BindExpression; -use swc_babel_ast::CallExpression; -use swc_babel_ast::Callee; -use swc_babel_ast::ClassExpression; -use swc_babel_ast::ConditionalExpression; -use swc_babel_ast::DoExpression; -use swc_babel_ast::Expression; -use swc_babel_ast::FunctionExpression; -use swc_babel_ast::Identifier; -use swc_babel_ast::Import; -use swc_babel_ast::JSXAttrVal; -use swc_babel_ast::JSXAttribute; -use swc_babel_ast::JSXEmptyExpression; -use swc_babel_ast::JSXExprContainerExpr; -use swc_babel_ast::JSXExpressionContainer; -use swc_babel_ast::JSXMemberExprObject; -use swc_babel_ast::JSXMemberExpression; -use swc_babel_ast::JSXSpreadAttribute; -use swc_babel_ast::LogicalExprOp; -use swc_babel_ast::LogicalExpression; -use swc_babel_ast::MemberExprProp; -use swc_babel_ast::MemberExpression; -use swc_babel_ast::MetaProperty; -use swc_babel_ast::ModuleExpression; -use swc_babel_ast::NewExpression; -use swc_babel_ast::ObjectExprProp; -use swc_babel_ast::ObjectExpression; -use swc_babel_ast::ObjectKey; -use swc_babel_ast::ObjectMethod; -use swc_babel_ast::ObjectPropVal; -use swc_babel_ast::ObjectProperty; -use swc_babel_ast::OptionalCallExpression; -use swc_babel_ast::OptionalMemberExprProp; -use swc_babel_ast::OptionalMemberExpression; -use swc_babel_ast::ParenthesizedExpression; -use swc_babel_ast::PatternLike; -use swc_babel_ast::PipelinePrimaryTopicReference; -use swc_babel_ast::RecordExpression; -use swc_babel_ast::SequenceExpression; -use swc_babel_ast::TSAsExpression; -use swc_babel_ast::TSNonNullExpression; -use swc_babel_ast::TSTypeAssertion; -use swc_babel_ast::TaggedTemplateExprTypeParams; -use swc_babel_ast::TaggedTemplateExpression; -use swc_babel_ast::ThisExpression; -use swc_babel_ast::TupleExpression; -use swc_babel_ast::TypeCastExpression; -use swc_babel_ast::UnaryExprOp; -use swc_babel_ast::UnaryExpression; -use swc_babel_ast::UpdateExprOp; -use swc_babel_ast::UpdateExpression; -use swc_babel_ast::YieldExpression; -use swc_common::Spanned; -use swc_common::DUMMY_SP; -use swc_ecma_ast::op; -use swc_ecma_ast::ArrayLit; -use swc_ecma_ast::ArrowExpr; -use swc_ecma_ast::AssignExpr; -use swc_ecma_ast::AwaitExpr; -use swc_ecma_ast::BinExpr; -use swc_ecma_ast::BinaryOp; -use swc_ecma_ast::BindingIdent; -use swc_ecma_ast::BlockStmtOrExpr; -use swc_ecma_ast::CallExpr; -use swc_ecma_ast::ClassExpr; -use swc_ecma_ast::ComputedPropName; -use swc_ecma_ast::CondExpr; -use swc_ecma_ast::Expr; -use swc_ecma_ast::ExprOrSpread; -use swc_ecma_ast::ExprOrSuper; -use swc_ecma_ast::FnExpr; -use swc_ecma_ast::Function; -use swc_ecma_ast::Ident; -use swc_ecma_ast::JSXAttr; -use swc_ecma_ast::JSXAttrOrSpread; -use swc_ecma_ast::JSXAttrValue; -use swc_ecma_ast::JSXEmptyExpr; -use swc_ecma_ast::JSXExpr; -use swc_ecma_ast::JSXExprContainer; -use swc_ecma_ast::JSXMemberExpr; -use swc_ecma_ast::JSXObject; -use swc_ecma_ast::KeyValueProp; -use swc_ecma_ast::Lit; -use swc_ecma_ast::MemberExpr; -use swc_ecma_ast::MetaPropExpr; -use swc_ecma_ast::MethodProp; -use swc_ecma_ast::NewExpr; -use swc_ecma_ast::ObjectLit; -use swc_ecma_ast::OptChainExpr; -use swc_ecma_ast::ParenExpr; -use swc_ecma_ast::PatOrExpr; -use swc_ecma_ast::Prop; -use swc_ecma_ast::PropName; -use swc_ecma_ast::PropOrSpread; -use swc_ecma_ast::SeqExpr; -use swc_ecma_ast::SpreadElement; -use swc_ecma_ast::TaggedTpl; -use swc_ecma_ast::ThisExpr; -use swc_ecma_ast::TsAsExpr; -use swc_ecma_ast::TsNonNullExpr; -use swc_ecma_ast::TsTypeAssertion; -use swc_ecma_ast::TsTypeParamInstantiation; -use swc_ecma_ast::UnaryExpr; -use swc_ecma_ast::UnaryOp; -use swc_ecma_ast::UpdateExpr; -use swc_ecma_ast::YieldExpr; +use swc_babel_ast::{ + Arg, ArrayExprEl, ArrayExpression, ArrowFuncExprBody, ArrowFunctionExpression, + AssignmentExpression, AwaitExpression, BinaryExprLeft, BinaryExprOp, BinaryExpression, + BindExpression, CallExpression, Callee, ClassExpression, ConditionalExpression, DoExpression, + Expression, FunctionExpression, Identifier, Import, JSXAttrVal, JSXAttribute, + JSXEmptyExpression, JSXExprContainerExpr, JSXExpressionContainer, JSXMemberExprObject, + JSXMemberExpression, JSXSpreadAttribute, LogicalExprOp, LogicalExpression, MemberExprProp, + MemberExpression, MetaProperty, ModuleExpression, NewExpression, ObjectExprProp, + ObjectExpression, ObjectKey, ObjectMethod, ObjectPropVal, ObjectProperty, + OptionalCallExpression, OptionalMemberExprProp, OptionalMemberExpression, + ParenthesizedExpression, PatternLike, PipelinePrimaryTopicReference, RecordExpression, + SequenceExpression, TSAsExpression, TSNonNullExpression, TSTypeAssertion, + TaggedTemplateExprTypeParams, TaggedTemplateExpression, ThisExpression, TupleExpression, + TypeCastExpression, UnaryExprOp, UnaryExpression, UpdateExprOp, UpdateExpression, + YieldExpression, +}; +use swc_common::{Spanned, DUMMY_SP}; +use swc_ecma_ast::{ + op, ArrayLit, ArrowExpr, AssignExpr, AwaitExpr, BinExpr, BinaryOp, BindingIdent, + BlockStmtOrExpr, CallExpr, ClassExpr, ComputedPropName, CondExpr, Expr, ExprOrSpread, + ExprOrSuper, FnExpr, Function, Ident, JSXAttr, JSXAttrOrSpread, JSXAttrValue, JSXEmptyExpr, + JSXExpr, JSXExprContainer, JSXMemberExpr, JSXObject, KeyValueProp, Lit, MemberExpr, + MetaPropExpr, MethodProp, NewExpr, ObjectLit, OptChainExpr, ParenExpr, PatOrExpr, Prop, + PropName, PropOrSpread, SeqExpr, SpreadElement, TaggedTpl, ThisExpr, TsAsExpr, TsNonNullExpr, + TsTypeAssertion, TsTypeParamInstantiation, UnaryExpr, UnaryOp, UpdateExpr, YieldExpr, +}; use super::Context; diff --git a/babel/compat/src/swcify/jsx.rs b/babel/compat/src/swcify/jsx.rs index 201152a84528..f89bdab87db5 100644 --- a/babel/compat/src/swcify/jsx.rs +++ b/babel/compat/src/swcify/jsx.rs @@ -1,5 +1,4 @@ -use crate::swcify::Context; -use crate::swcify::Swcify; +use crate::swcify::{Context, Swcify}; use swc_ecma_ast::Ident; impl Swcify for swc_babel_ast::JSXNamespacedName { diff --git a/babel/compat/src/swcify/lit.rs b/babel/compat/src/swcify/lit.rs index 1b9ecb67fcd0..1ed590af488f 100644 --- a/babel/compat/src/swcify/lit.rs +++ b/babel/compat/src/swcify/lit.rs @@ -1,28 +1,12 @@ use super::Context; use crate::swcify::Swcify; -use swc_babel_ast::BigIntLiteral; -use swc_babel_ast::BooleanLiteral; -use swc_babel_ast::DecimalLiteral; -use swc_babel_ast::Literal; -use swc_babel_ast::NullLiteral; -use swc_babel_ast::NumberLiteral; -use swc_babel_ast::NumericLiteral; -use swc_babel_ast::RegExpLiteral; -use swc_babel_ast::StringLiteral; -use swc_babel_ast::TemplateElement; -use swc_babel_ast::TemplateLiteral; -use swc_babel_ast::TemplateLiteralExpr; +use swc_babel_ast::{ + BigIntLiteral, BooleanLiteral, DecimalLiteral, Literal, NullLiteral, NumberLiteral, + NumericLiteral, RegExpLiteral, StringLiteral, TemplateElement, TemplateLiteral, + TemplateLiteralExpr, +}; use swc_common::DUMMY_SP; -use swc_ecma_ast::BigInt; -use swc_ecma_ast::Bool; -use swc_ecma_ast::Expr; -use swc_ecma_ast::Lit; -use swc_ecma_ast::Null; -use swc_ecma_ast::Number; -use swc_ecma_ast::Regex; -use swc_ecma_ast::Str; -use swc_ecma_ast::Tpl; -use swc_ecma_ast::TplElement; +use swc_ecma_ast::{BigInt, Bool, Expr, Lit, Null, Number, Regex, Str, Tpl, TplElement}; impl Swcify for Literal { type Output = Lit; diff --git a/babel/compat/src/swcify/pat.rs b/babel/compat/src/swcify/pat.rs index 1a3fe1b1f517..a8e541829d77 100644 --- a/babel/compat/src/swcify/pat.rs +++ b/babel/compat/src/swcify/pat.rs @@ -1,13 +1,8 @@ -use crate::swcify::Context; -use crate::swcify::Swcify; -use swc_babel_ast::ArrayPattern; -use swc_babel_ast::AssignmentPattern; -use swc_babel_ast::AssignmentPatternLeft; -use swc_babel_ast::LVal; -use swc_babel_ast::ObjectPattern; -use swc_babel_ast::ObjectPatternProp; -use swc_babel_ast::PatternLike; -use swc_babel_ast::RestElement; +use crate::swcify::{Context, Swcify}; +use swc_babel_ast::{ + ArrayPattern, AssignmentPattern, AssignmentPatternLeft, LVal, ObjectPattern, ObjectPatternProp, + PatternLike, RestElement, +}; use swc_common::Spanned; use swc_ecma_ast::*; diff --git a/babel/compat/src/swcify/stmt.rs b/babel/compat/src/swcify/stmt.rs index 7b50d14f7b98..dff70944b04d 100644 --- a/babel/compat/src/swcify/stmt.rs +++ b/babel/compat/src/swcify/stmt.rs @@ -1,104 +1,28 @@ use super::Context; use crate::swcify::Swcify; -use swc_babel_ast::BlockStatement; -use swc_babel_ast::BreakStatement; -use swc_babel_ast::ClassDeclaration; -use swc_babel_ast::ContinueStatement; -use swc_babel_ast::DebuggerStatement; -use swc_babel_ast::DeclareClass; -use swc_babel_ast::DeclareExportAllDeclaration; -use swc_babel_ast::DeclareExportDeclaration; -use swc_babel_ast::DeclareFunction; -use swc_babel_ast::DeclareInterface; -use swc_babel_ast::DeclareModule; -use swc_babel_ast::DeclareModuleExports; -use swc_babel_ast::DeclareTypeAlias; -use swc_babel_ast::DeclareVariable; -use swc_babel_ast::DoWhileStatement; -use swc_babel_ast::EmptyStatement; -use swc_babel_ast::ExportAllDeclaration; -use swc_babel_ast::ExportDefaultDeclType; -use swc_babel_ast::ExportDefaultDeclaration; -use swc_babel_ast::ExportNamedDeclaration; -use swc_babel_ast::ExpressionStatement; -use swc_babel_ast::ForInStatement; -use swc_babel_ast::ForOfStatement; -use swc_babel_ast::ForStatement; -use swc_babel_ast::ForStmtInit; -use swc_babel_ast::ForStmtLeft; -use swc_babel_ast::FunctionDeclaration; -use swc_babel_ast::IdOrString; -use swc_babel_ast::IfStatement; -use swc_babel_ast::ImportAttribute; -use swc_babel_ast::ImportDeclaration; -use swc_babel_ast::ImportNamespaceSpecifier; -use swc_babel_ast::ImportSpecifierType; -use swc_babel_ast::LabeledStatement; -use swc_babel_ast::ReturnStatement; -use swc_babel_ast::Statement; -use swc_babel_ast::SwitchStatement; -use swc_babel_ast::ThrowStatement; -use swc_babel_ast::TryStatement; -use swc_babel_ast::VariableDeclaration; -use swc_babel_ast::VariableDeclarationKind; -use swc_babel_ast::VariableDeclarator; -use swc_babel_ast::WhileStatement; -use swc_babel_ast::WithStatement; +use swc_babel_ast::{ + BlockStatement, BreakStatement, ClassDeclaration, ContinueStatement, DebuggerStatement, + DeclareClass, DeclareExportAllDeclaration, DeclareExportDeclaration, DeclareFunction, + DeclareInterface, DeclareModule, DeclareModuleExports, DeclareTypeAlias, DeclareVariable, + DoWhileStatement, EmptyStatement, ExportAllDeclaration, ExportDefaultDeclType, + ExportDefaultDeclaration, ExportNamedDeclaration, ExpressionStatement, ForInStatement, + ForOfStatement, ForStatement, ForStmtInit, ForStmtLeft, FunctionDeclaration, IdOrString, + IfStatement, ImportAttribute, ImportDeclaration, ImportNamespaceSpecifier, ImportSpecifierType, + LabeledStatement, ReturnStatement, Statement, SwitchStatement, ThrowStatement, TryStatement, + VariableDeclaration, VariableDeclarationKind, VariableDeclarator, WhileStatement, + WithStatement, +}; use swc_common::DUMMY_SP; -use swc_ecma_ast::BlockStmt; -use swc_ecma_ast::BreakStmt; -use swc_ecma_ast::ClassDecl; -use swc_ecma_ast::ClassExpr; -use swc_ecma_ast::ContinueStmt; -use swc_ecma_ast::DebuggerStmt; -use swc_ecma_ast::Decl; -use swc_ecma_ast::DefaultDecl; -use swc_ecma_ast::DoWhileStmt; -use swc_ecma_ast::EmptyStmt; -use swc_ecma_ast::ExportAll; -use swc_ecma_ast::ExportDecl; -use swc_ecma_ast::ExportDefaultDecl; -use swc_ecma_ast::ExportDefaultExpr; -use swc_ecma_ast::ExportNamedSpecifier; -use swc_ecma_ast::Expr; -use swc_ecma_ast::ExprStmt; -use swc_ecma_ast::FnDecl; -use swc_ecma_ast::FnExpr; -use swc_ecma_ast::ForInStmt; -use swc_ecma_ast::ForOfStmt; -use swc_ecma_ast::ForStmt; -use swc_ecma_ast::IfStmt; -use swc_ecma_ast::ImportDecl; -use swc_ecma_ast::ImportNamedSpecifier; -use swc_ecma_ast::ImportSpecifier; -use swc_ecma_ast::ImportStarAsSpecifier; -use swc_ecma_ast::KeyValueProp; -use swc_ecma_ast::LabeledStmt; -use swc_ecma_ast::Lit; -use swc_ecma_ast::ModuleDecl; -use swc_ecma_ast::ModuleItem; -use swc_ecma_ast::NamedExport; -use swc_ecma_ast::ObjectLit; -use swc_ecma_ast::Pat; -use swc_ecma_ast::Prop; -use swc_ecma_ast::PropName; -use swc_ecma_ast::PropOrSpread; -use swc_ecma_ast::ReturnStmt; -use swc_ecma_ast::Stmt; -use swc_ecma_ast::SwitchStmt; -use swc_ecma_ast::ThrowStmt; -use swc_ecma_ast::TryStmt; -use swc_ecma_ast::TsExportAssignment; -use swc_ecma_ast::TsInterfaceDecl; -use swc_ecma_ast::TsModuleDecl; -use swc_ecma_ast::TsTypeAliasDecl; -use swc_ecma_ast::VarDecl; -use swc_ecma_ast::VarDeclKind; -use swc_ecma_ast::VarDeclOrExpr; -use swc_ecma_ast::VarDeclOrPat; -use swc_ecma_ast::VarDeclarator; -use swc_ecma_ast::WhileStmt; -use swc_ecma_ast::WithStmt; +use swc_ecma_ast::{ + BlockStmt, BreakStmt, ClassDecl, ClassExpr, ContinueStmt, DebuggerStmt, Decl, DefaultDecl, + DoWhileStmt, EmptyStmt, ExportAll, ExportDecl, ExportDefaultDecl, ExportDefaultExpr, + ExportNamedSpecifier, Expr, ExprStmt, FnDecl, FnExpr, ForInStmt, ForOfStmt, ForStmt, IfStmt, + ImportDecl, ImportNamedSpecifier, ImportSpecifier, ImportStarAsSpecifier, KeyValueProp, + LabeledStmt, Lit, ModuleDecl, ModuleItem, NamedExport, ObjectLit, Pat, Prop, PropName, + PropOrSpread, ReturnStmt, Stmt, SwitchStmt, ThrowStmt, TryStmt, TsExportAssignment, + TsInterfaceDecl, TsModuleDecl, TsTypeAliasDecl, VarDecl, VarDeclKind, VarDeclOrExpr, + VarDeclOrPat, VarDeclarator, WhileStmt, WithStmt, +}; impl Swcify for BlockStatement { type Output = BlockStmt; diff --git a/babel/compat/src/swcify/typescript.rs b/babel/compat/src/swcify/typescript.rs index a3b3763bc463..4fd819b6f48d 100644 --- a/babel/compat/src/swcify/typescript.rs +++ b/babel/compat/src/swcify/typescript.rs @@ -1,26 +1,14 @@ use super::Context; use crate::swcify::Swcify; -use swc_babel_ast::Access; -use swc_babel_ast::FlowType; -use swc_babel_ast::SuperTypeParams; -use swc_babel_ast::TSEntityName; -use swc_babel_ast::TSQualifiedName; -use swc_babel_ast::TSType; -use swc_babel_ast::TSTypeAnnotation; -use swc_babel_ast::TSTypeParameter; -use swc_babel_ast::TSTypeParameterDeclaration; -use swc_babel_ast::TSTypeParameterInstantiation; -use swc_babel_ast::TypeAnnotOrNoop; -use swc_babel_ast::TypeParamDeclOrNoop; -use swc_ecma_ast::Accessibility; -use swc_ecma_ast::Ident; -use swc_ecma_ast::TsEntityName; -use swc_ecma_ast::TsQualifiedName; -use swc_ecma_ast::TsType; -use swc_ecma_ast::TsTypeAnn; -use swc_ecma_ast::TsTypeParam; -use swc_ecma_ast::TsTypeParamDecl; -use swc_ecma_ast::TsTypeParamInstantiation; +use swc_babel_ast::{ + Access, FlowType, SuperTypeParams, TSEntityName, TSQualifiedName, TSType, TSTypeAnnotation, + TSTypeParameter, TSTypeParameterDeclaration, TSTypeParameterInstantiation, TypeAnnotOrNoop, + TypeParamDeclOrNoop, +}; +use swc_ecma_ast::{ + Accessibility, Ident, TsEntityName, TsQualifiedName, TsType, TsTypeAnn, TsTypeParam, + TsTypeParamDecl, TsTypeParamInstantiation, +}; impl Swcify for TSTypeParameterInstantiation { type Output = TsTypeParamInstantiation; diff --git a/babel/compat/tests/convert.rs b/babel/compat/tests/convert.rs index b5c22763b839..c29353b147fd 100644 --- a/babel/compat/tests/convert.rs +++ b/babel/compat/tests/convert.rs @@ -11,14 +11,10 @@ use std::{ }; use swc::Compiler; use swc_babel_ast::File; -use swc_babel_compat::babelify::normalize::normalize; -use swc_babel_compat::babelify::{Babelify, Context}; +use swc_babel_compat::babelify::{normalize::normalize, Babelify, Context}; use swc_common::{ errors::{ColorConfig, Handler}, - FileName, - // FilePathMapping, SourceMap, FileName, SourceFile, - FilePathMapping, - SourceMap, + FileName, FilePathMapping, SourceMap, }; use swc_ecma_parser::{EsConfig, Syntax}; use test::{test_main, DynTestFn, ShouldPanic, TestDesc, TestDescAndFn, TestName, TestType}; diff --git a/bundler/src/bundler/chunk/cjs.rs b/bundler/src/bundler/chunk/cjs.rs index 4ef661189c0f..552d7f57fb3f 100644 --- a/bundler/src/bundler/chunk/cjs.rs +++ b/bundler/src/bundler/chunk/cjs.rs @@ -1,13 +1,12 @@ -use crate::modules::Modules; use crate::{ bundler::{chunk::merge::Ctx, load::TransformedModule}, + modules::Modules, Bundler, Load, Resolve, }; use anyhow::Error; use std::sync::atomic::Ordering; use swc_atoms::js_word; -use swc_common::Span; -use swc_common::{SyntaxContext, DUMMY_SP}; +use swc_common::{Span, SyntaxContext, DUMMY_SP}; use swc_ecma_ast::{ModuleItem, *}; use swc_ecma_utils::{quote_ident, undefined, ExprFactory}; use swc_ecma_visit::{noop_visit_mut_type, VisitMut, VisitMutWith}; diff --git a/bundler/src/bundler/chunk/computed_key.rs b/bundler/src/bundler/chunk/computed_key.rs index 57f7168e8d4c..2612167fbc17 100644 --- a/bundler/src/bundler/chunk/computed_key.rs +++ b/bundler/src/bundler/chunk/computed_key.rs @@ -1,5 +1,4 @@ -use crate::modules::Modules; -use crate::{bundler::chunk::merge::Ctx, Bundler, Load, ModuleId, Resolve}; +use crate::{bundler::chunk::merge::Ctx, modules::Modules, Bundler, Load, ModuleId, Resolve}; use anyhow::{bail, Error}; use std::mem::take; use swc_atoms::js_word; diff --git a/bundler/src/bundler/chunk/merge.rs b/bundler/src/bundler/chunk/merge.rs index 174f220ae27c..0d7707ca084e 100644 --- a/bundler/src/bundler/chunk/merge.rs +++ b/bundler/src/bundler/chunk/merge.rs @@ -1,19 +1,19 @@ -use crate::bundler::keywords::KeywordRenamer; -use crate::dep_graph::ModuleGraph; -use crate::inline::inline; -use crate::modules::Modules; use crate::{ - bundler::load::{Imports, TransformedModule}, + bundler::{ + keywords::KeywordRenamer, + load::{Imports, TransformedModule}, + }, + dep_graph::ModuleGraph, id::{Id, ModuleId}, + inline::inline, load::Load, + modules::Modules, resolve::Resolve, util::{CloneMap, ExprExt, VarDeclaratorExt}, Bundler, Hook, ModuleRecord, }; use anyhow::Error; -use fxhash::FxBuildHasher; -use fxhash::FxHashMap; -use fxhash::FxHashSet; +use fxhash::{FxBuildHasher, FxHashMap, FxHashSet}; use indexmap::IndexSet; use petgraph::EdgeDirection; #[cfg(feature = "concurrent")] diff --git a/bundler/src/bundler/chunk/mod.rs b/bundler/src/bundler/chunk/mod.rs index 8fcd089c7076..277a2bcba752 100644 --- a/bundler/src/bundler/chunk/mod.rs +++ b/bundler/src/bundler/chunk/mod.rs @@ -5,8 +5,7 @@ use crate::{ }; use ahash::AHashMap; use anyhow::{Context, Error}; -use fxhash::FxHashMap; -use fxhash::FxHashSet; +use fxhash::{FxHashMap, FxHashSet}; #[cfg(feature = "rayon")] use rayon::iter::ParallelIterator; use std::time::Instant; diff --git a/bundler/src/bundler/chunk/plan/mod.rs b/bundler/src/bundler/chunk/plan/mod.rs index 2d4f6913023e..f2e4a3170ffd 100644 --- a/bundler/src/bundler/chunk/plan/mod.rs +++ b/bundler/src/bundler/chunk/plan/mod.rs @@ -1,9 +1,10 @@ -use crate::dep_graph::ModuleGraph; -use crate::{bundler::load::TransformedModule, BundleKind, Bundler, Load, ModuleId, Resolve}; +use crate::{ + bundler::load::TransformedModule, dep_graph::ModuleGraph, BundleKind, Bundler, Load, ModuleId, + Resolve, +}; use ahash::AHashMap; use anyhow::{bail, Error}; -use fxhash::FxHashMap; -use fxhash::FxHashSet; +use fxhash::{FxHashMap, FxHashSet}; #[cfg(test)] mod tests; diff --git a/bundler/src/bundler/import/mod.rs b/bundler/src/bundler/import/mod.rs index e4cddfc488dd..e8ab30aa1ba0 100644 --- a/bundler/src/bundler/import/mod.rs +++ b/bundler/src/bundler/import/mod.rs @@ -1,16 +1,13 @@ use super::Bundler; use crate::{load::Load, resolve::Resolve}; use anyhow::{Context, Error}; -use fxhash::FxHashMap; -use fxhash::FxHashSet; +use fxhash::{FxHashMap, FxHashSet}; use retain_mut::RetainMut; use swc_atoms::{js_word, JsWord}; use swc_common::{sync::Lrc, FileName, Mark, Spanned, SyntaxContext, DUMMY_SP}; use swc_ecma_ast::*; use swc_ecma_utils::{find_ids, ident::IdentLike, Id}; -use swc_ecma_visit::noop_visit_mut_type; -use swc_ecma_visit::VisitMut; -use swc_ecma_visit::VisitMutWith; +use swc_ecma_visit::{noop_visit_mut_type, VisitMut, VisitMutWith}; #[cfg(test)] mod tests; diff --git a/bundler/src/bundler/keywords.rs b/bundler/src/bundler/keywords.rs index 9f203f932833..99952c3b2f83 100644 --- a/bundler/src/bundler/keywords.rs +++ b/bundler/src/bundler/keywords.rs @@ -1,12 +1,9 @@ -use crate::id::Id; -use crate::util::MapWithMut; +use crate::{id::Id, util::MapWithMut}; use fxhash::FxHashMap; use swc_atoms::js_word; use swc_ecma_ast::*; use swc_ecma_utils::private_ident; -use swc_ecma_visit::noop_visit_mut_type; -use swc_ecma_visit::VisitMut; -use swc_ecma_visit::VisitMutWith; +use swc_ecma_visit::{noop_visit_mut_type, VisitMut, VisitMutWith}; #[derive(Default)] pub struct KeywordRenamer { diff --git a/bundler/src/dep_graph.rs b/bundler/src/dep_graph.rs index 3385aaa9061e..5dcf425c87c7 100644 --- a/bundler/src/dep_graph.rs +++ b/bundler/src/dep_graph.rs @@ -1,4 +1,3 @@ -use crate::util::fast_graph::FastDiGraphMap; -use crate::ModuleId; +use crate::{util::fast_graph::FastDiGraphMap, ModuleId}; pub(crate) type ModuleGraph = FastDiGraphMap; diff --git a/bundler/src/inline.rs b/bundler/src/inline.rs index 99e2b5320cc0..d9bb47ab2767 100644 --- a/bundler/src/inline.rs +++ b/bundler/src/inline.rs @@ -1,17 +1,11 @@ -use crate::id::Id; -use crate::modules::Modules; +use crate::{id::Id, modules::Modules}; use ahash::RandomState; use std::collections::HashMap; -use swc_common::SyntaxContext; -use swc_common::DUMMY_SP; +use swc_common::{SyntaxContext, DUMMY_SP}; use swc_ecma_ast::*; -use swc_ecma_visit::noop_visit_mut_type; -use swc_ecma_visit::noop_visit_type; -use swc_ecma_visit::Node; -use swc_ecma_visit::Visit; -use swc_ecma_visit::VisitMut; -use swc_ecma_visit::VisitMutWith; -use swc_ecma_visit::VisitWith; +use swc_ecma_visit::{ + noop_visit_mut_type, noop_visit_type, Node, Visit, VisitMut, VisitMutWith, VisitWith, +}; #[derive(Debug, Default)] pub(crate) struct InlineData { diff --git a/bundler/src/modules/mod.rs b/bundler/src/modules/mod.rs index a18e46092f23..c6ff60635712 100644 --- a/bundler/src/modules/mod.rs +++ b/bundler/src/modules/mod.rs @@ -2,16 +2,9 @@ use crate::ModuleId; use fxhash::FxHashMap; use retain_mut::RetainMut; use std::mem::take; -use swc_common::SourceMap; -use swc_common::SyntaxContext; -use swc_common::DUMMY_SP; +use swc_common::{SourceMap, SyntaxContext, DUMMY_SP}; use swc_ecma_ast::*; -use swc_ecma_visit::Fold; -use swc_ecma_visit::FoldWith; -use swc_ecma_visit::Visit; -use swc_ecma_visit::VisitMut; -use swc_ecma_visit::VisitMutWith; -use swc_ecma_visit::VisitWith; +use swc_ecma_visit::{Fold, FoldWith, Visit, VisitMut, VisitMutWith, VisitWith}; mod sort; diff --git a/bundler/src/modules/sort/chunk.rs b/bundler/src/modules/sort/chunk.rs index 6104aee6266c..4359ac37d1f4 100644 --- a/bundler/src/modules/sort/chunk.rs +++ b/bundler/src/modules/sort/chunk.rs @@ -1,17 +1,10 @@ use super::stmt::sort_stmts; -use crate::dep_graph::ModuleGraph; -use crate::modules::Modules; -use crate::ModuleId; +use crate::{dep_graph::ModuleGraph, modules::Modules, ModuleId}; use fxhash::FxHashSet; use indexmap::IndexSet; use petgraph::EdgeDirection::Outgoing; -use std::collections::VecDeque; -use std::iter::from_fn; -use std::mem::take; -use std::time::Instant; -use swc_common::sync::Lrc; -use swc_common::SourceMap; -use swc_common::SyntaxContext; +use std::{collections::VecDeque, iter::from_fn, mem::take, time::Instant}; +use swc_common::{sync::Lrc, SourceMap, SyntaxContext}; use swc_ecma_ast::*; use swc_ecma_utils::prepend_stmts; diff --git a/bundler/src/modules/sort/graph.rs b/bundler/src/modules/sort/graph.rs index c1f66905abe8..3297003880bb 100644 --- a/bundler/src/modules/sort/graph.rs +++ b/bundler/src/modules/sort/graph.rs @@ -1,10 +1,10 @@ use crate::util::fast_graph::FastDiGraphMap; use fxhash::FxHashSet; -use petgraph::EdgeDirection; -use petgraph::EdgeDirection::Incoming; -use petgraph::EdgeDirection::Outgoing; -use std::collections::VecDeque; -use std::iter::repeat; +use petgraph::{ + EdgeDirection, + EdgeDirection::{Incoming, Outgoing}, +}; +use std::{collections::VecDeque, iter::repeat}; /// Is dependancy between nodes hard? #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] diff --git a/bundler/src/modules/sort/mod.rs b/bundler/src/modules/sort/mod.rs index 099f6cd8038f..e6289172809a 100644 --- a/bundler/src/modules/sort/mod.rs +++ b/bundler/src/modules/sort/mod.rs @@ -1,10 +1,7 @@ use super::Modules; -use crate::dep_graph::ModuleGraph; -use crate::ModuleId; +use crate::{dep_graph::ModuleGraph, ModuleId}; use std::time::Instant; -use swc_common::sync::Lrc; -use swc_common::SourceMap; -use swc_common::DUMMY_SP; +use swc_common::{sync::Lrc, SourceMap, DUMMY_SP}; use swc_ecma_ast::*; mod chunk; diff --git a/bundler/src/modules/sort/stmt.rs b/bundler/src/modules/sort/stmt.rs index 183862d62d97..83bdfaa96565 100644 --- a/bundler/src/modules/sort/stmt.rs +++ b/bundler/src/modules/sort/stmt.rs @@ -1,27 +1,14 @@ use super::graph::Required; -use crate::id::Id; -use crate::modules::sort::graph::StmtDepGraph; -use crate::util::MapWithMut; -use fxhash::FxHashMap; -use fxhash::FxHashSet; +use crate::{id::Id, modules::sort::graph::StmtDepGraph, util::MapWithMut}; +use fxhash::{FxHashMap, FxHashSet}; use indexmap::IndexSet; -use petgraph::EdgeDirection::Incoming as Dependants; -use petgraph::EdgeDirection::Outgoing as Dependancies; -use std::collections::VecDeque; -use std::iter::from_fn; -use std::ops::Range; +use petgraph::EdgeDirection::{Incoming as Dependants, Outgoing as Dependancies}; +use std::{collections::VecDeque, iter::from_fn, ops::Range}; use swc_atoms::js_word; -use swc_common::sync::Lrc; -use swc_common::SourceMap; -use swc_common::Spanned; -use swc_common::SyntaxContext; -use swc_common::DUMMY_SP; +use swc_common::{sync::Lrc, SourceMap, Spanned, SyntaxContext, DUMMY_SP}; use swc_ecma_ast::*; use swc_ecma_utils::find_ids; -use swc_ecma_visit::noop_visit_type; -use swc_ecma_visit::Node; -use swc_ecma_visit::Visit; -use swc_ecma_visit::VisitWith; +use swc_ecma_visit::{noop_visit_type, Node, Visit, VisitWith}; pub(super) fn sort_stmts( injected_ctxt: SyntaxContext, @@ -795,10 +782,8 @@ fn calc_deps(new: &[ModuleItem]) -> StmtDepGraph { #[cfg(test)] mod tests { - use super::calc_deps; - use super::Dependancies; - use crate::bundler::tests::suite; - use crate::debug::print_hygiene; + use super::{calc_deps, Dependancies}; + use crate::{bundler::tests::suite, debug::print_hygiene}; use swc_common::DUMMY_SP; use swc_ecma_ast::*; diff --git a/bundler/src/modules/sort/tests.rs b/bundler/src/modules/sort/tests.rs index e298dd8e6309..d2544b2cee10 100644 --- a/bundler/src/modules/sort/tests.rs +++ b/bundler/src/modules/sort/tests.rs @@ -1,8 +1,6 @@ use super::stmt::sort_stmts; -use crate::bundler::tests::suite; -use crate::debug::print_hygiene; -use swc_common::SyntaxContext; -use swc_common::DUMMY_SP; +use crate::{bundler::tests::suite, debug::print_hygiene}; +use swc_common::{SyntaxContext, DUMMY_SP}; use swc_ecma_ast::*; use swc_ecma_utils::drop_span; use testing::assert_eq; diff --git a/bundler/src/util/fast_graph.rs b/bundler/src/util/fast_graph.rs index bd1bfce4a2a6..eafe70841325 100644 --- a/bundler/src/util/fast_graph.rs +++ b/bundler/src/util/fast_graph.rs @@ -3,28 +3,25 @@ #![allow(dead_code)] // We don't want to modify copied source code. -use fxhash::FxBuildHasher; -use fxhash::FxHashSet; -use indexmap::map::Keys; -use indexmap::map::{Iter as IndexMapIter, IterMut as IndexMapIterMut}; -use indexmap::IndexMap; -use petgraph::graph::node_index; -use petgraph::graph::Graph; -use petgraph::visit::GraphBase; -use petgraph::visit::IntoNeighbors; -use petgraph::visit::IntoNeighborsDirected; -use petgraph::visit::NodeCount; -use petgraph::visit::Visitable; -use petgraph::IntoWeightedEdge; -use petgraph::{Directed, Direction, EdgeType, Incoming, Outgoing, Undirected}; -use std::cmp::Ordering; -use std::fmt; -use std::hash::{self, Hash}; -use std::iter::FromIterator; -use std::iter::{Cloned, DoubleEndedIterator}; -use std::marker::PhantomData; -use std::ops::Deref; -use std::slice::Iter; +use fxhash::{FxBuildHasher, FxHashSet}; +use indexmap::{ + map::{Iter as IndexMapIter, IterMut as IndexMapIterMut, Keys}, + IndexMap, +}; +use petgraph::{ + graph::{node_index, Graph}, + visit::{GraphBase, IntoNeighbors, IntoNeighborsDirected, NodeCount, Visitable}, + Directed, Direction, EdgeType, Incoming, IntoWeightedEdge, Outgoing, Undirected, +}; +use std::{ + cmp::Ordering, + fmt, + hash::{self, Hash}, + iter::{Cloned, DoubleEndedIterator, FromIterator}, + marker::PhantomData, + ops::Deref, + slice::Iter, +}; /// A `GraphMap` with directed edges. /// diff --git a/bundler/tests/common/mod.rs b/bundler/tests/common/mod.rs index 615eceeacc33..56999063a1f3 100644 --- a/bundler/tests/common/mod.rs +++ b/bundler/tests/common/mod.rs @@ -1,16 +1,19 @@ use anyhow::{bail, Context, Error}; use reqwest::Url; use sha1::{Digest, Sha1}; -use std::env::current_dir; -use std::io::Write; use std::{ + env::current_dir, fs::{create_dir_all, read_to_string, write}, + io::Write, path::{Path, PathBuf}, }; use swc_bundler::{Load, ModuleData, Resolve}; -use swc_common::errors::ColorConfig; -use swc_common::errors::Handler; -use swc_common::{comments::SingleThreadedComments, sync::Lrc, FileName, SourceMap}; +use swc_common::{ + comments::SingleThreadedComments, + errors::{ColorConfig, Handler}, + sync::Lrc, + FileName, SourceMap, +}; use swc_ecma_parser::{lexer::Lexer, JscTarget, Parser, StringInput, Syntax, TsConfig}; use swc_ecma_transforms::{react, typescript::strip}; use swc_ecma_visit::FoldWith; diff --git a/bundler/tests/deno.rs b/bundler/tests/deno.rs index a5e2c6dcce90..b5fbf3a30361 100644 --- a/bundler/tests/deno.rs +++ b/bundler/tests/deno.rs @@ -6,10 +6,10 @@ use self::common::*; use anyhow::Error; use ntest::timeout; -use std::path::PathBuf; use std::{ collections::{HashMap, HashSet}, fs::write, + path::PathBuf, process::{Command, Stdio}, }; use swc_atoms::js_word; diff --git a/bundler/tests/fixture.rs b/bundler/tests/fixture.rs index 8d39e0231f99..e4fd48add76a 100644 --- a/bundler/tests/fixture.rs +++ b/bundler/tests/fixture.rs @@ -25,8 +25,7 @@ use test::{ test_main, DynTestFn, Options, ShouldPanic::No, TestDesc, TestDescAndFn, TestName, TestType, }; use testing::NormalizedOutput; -use walkdir::DirEntry; -use walkdir::WalkDir; +use walkdir::{DirEntry, WalkDir}; #[path = "common/mod.rs"] mod common; diff --git a/common/src/eq.rs b/common/src/eq.rs index 229026f74c10..30aedb101703 100644 --- a/common/src/eq.rs +++ b/common/src/eq.rs @@ -1,11 +1,6 @@ -use crate::BytePos; -use crate::Span; -use crate::SyntaxContext; +use crate::{BytePos, Span, SyntaxContext}; use num_bigint::BigInt; -use std::cell::RefCell; -use std::cmp::PartialEq; -use std::rc::Rc; -use std::sync::Arc; +use std::{cell::RefCell, cmp::PartialEq, rc::Rc, sync::Arc}; use string_cache::Atom; /// Derive with `#[derive(EqIgnoreSpan)]`. diff --git a/common/src/errors.rs b/common/src/errors.rs index 33e39197fff5..9f256707b876 100644 --- a/common/src/errors.rs +++ b/common/src/errors.rs @@ -14,10 +14,9 @@ pub use self::{ diagnostic_builder::DiagnosticBuilder, emitter::{ColorConfig, Emitter, EmitterWriter}, }; -use crate::sync::Lrc; use crate::{ rustc_data_structures::stable_hasher::StableHasher, - sync::{Lock, LockCell}, + sync::{Lock, LockCell, Lrc}, syntax_pos::{BytePos, FileLinesResult, FileName, Loc, MultiSpan, Span, NO_EXPANSION}, }; use std::{ diff --git a/common/src/lib.rs b/common/src/lib.rs index 1c781150d75e..322b33ea920b 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -13,9 +13,8 @@ //! Adds methods to generate web sourcemap. #![deny(unused)] -pub use self::eq::EqIgnoreSpan; -pub use self::eq::TypeEq; pub use self::{ + eq::{EqIgnoreSpan, TypeEq}, errors::{SourceMapper, SourceMapperDyn}, pos::{ hygiene, BytePos, CharPos, FileName, Globals, Loc, LocWithOpt, Mark, MultiSpan, SourceFile, @@ -25,13 +24,11 @@ pub use self::{ source_map::{FileLines, FileLoader, FilePathMapping, SourceMap, SpanSnippetError}, syntax_pos::LineCol, }; -pub use ast_node::ast_serde; -pub use ast_node::{ast_node, DeserializeEnum, Spanned}; +pub use ast_node::{ast_node, ast_serde, DeserializeEnum, Spanned}; pub use from_variant::FromVariant; use serde::Serialize; use std::fmt::Debug; -pub use swc_eq_ignore_macros::EqIgnoreSpan; -pub use swc_eq_ignore_macros::TypeEq; +pub use swc_eq_ignore_macros::{EqIgnoreSpan, TypeEq}; pub use swc_visit::chain; #[doc(hidden)] pub mod private; diff --git a/ecmascript/ast/src/class.rs b/ecmascript/ast/src/class.rs index 18cde05c3f73..53b6a283b7ee 100644 --- a/ecmascript/ast/src/class.rs +++ b/ecmascript/ast/src/class.rs @@ -12,8 +12,7 @@ use crate::{ }; use is_macro::Is; use serde::{Deserialize, Serialize}; -use swc_common::EqIgnoreSpan; -use swc_common::{ast_node, Span}; +use swc_common::{ast_node, EqIgnoreSpan, Span}; #[ast_node] #[derive(Eq, Hash, EqIgnoreSpan)] diff --git a/ecmascript/ast/src/decl.rs b/ecmascript/ast/src/decl.rs index 2f26810af395..70366d86de83 100644 --- a/ecmascript/ast/src/decl.rs +++ b/ecmascript/ast/src/decl.rs @@ -8,8 +8,7 @@ use crate::{ }; use is_macro::Is; use string_enum::StringEnum; -use swc_common::EqIgnoreSpan; -use swc_common::{ast_node, Span}; +use swc_common::{ast_node, EqIgnoreSpan, Span}; #[ast_node] #[derive(Eq, Hash, Is, EqIgnoreSpan)] diff --git a/ecmascript/ast/src/expr.rs b/ecmascript/ast/src/expr.rs index 1ab74c0f9631..4b0ca2e37543 100644 --- a/ecmascript/ast/src/expr.rs +++ b/ecmascript/ast/src/expr.rs @@ -17,8 +17,7 @@ use crate::{ }; use is_macro::Is; use serde::{self, Deserialize, Serialize}; -use swc_common::EqIgnoreSpan; -use swc_common::{ast_node, Span, Spanned, DUMMY_SP}; +use swc_common::{ast_node, EqIgnoreSpan, Span, Spanned, DUMMY_SP}; #[ast_node] #[derive(Eq, Hash, Is, EqIgnoreSpan)] diff --git a/ecmascript/ast/src/function.rs b/ecmascript/ast/src/function.rs index 4d85146492c1..9468bb7d668d 100644 --- a/ecmascript/ast/src/function.rs +++ b/ecmascript/ast/src/function.rs @@ -5,8 +5,7 @@ use crate::{ typescript::{TsParamProp, TsTypeAnn, TsTypeParamDecl}, }; use is_macro::Is; -use swc_common::EqIgnoreSpan; -use swc_common::{ast_node, Span}; +use swc_common::{ast_node, EqIgnoreSpan, Span}; /// Common parts of function and method. #[ast_node] diff --git a/ecmascript/ast/src/ident.rs b/ecmascript/ast/src/ident.rs index f78020ffbfdc..76db70008a63 100644 --- a/ecmascript/ast/src/ident.rs +++ b/ecmascript/ast/src/ident.rs @@ -1,11 +1,7 @@ use crate::typescript::TsTypeAnn; -use serde::Deserialize; -use serde::Serialize; +use serde::{Deserialize, Serialize}; use swc_atoms::JsWord; -use swc_common::ast_node; -use swc_common::EqIgnoreSpan; -use swc_common::Span; -use swc_common::Spanned; +use swc_common::{ast_node, EqIgnoreSpan, Span, Spanned}; /// Identifer used as a pattern. #[derive(Spanned, Clone, Debug, PartialEq, Eq, Hash, EqIgnoreSpan, Serialize, Deserialize)] diff --git a/ecmascript/ast/src/jsx.rs b/ecmascript/ast/src/jsx.rs index 2cd71cce11ad..291bb43545e3 100644 --- a/ecmascript/ast/src/jsx.rs +++ b/ecmascript/ast/src/jsx.rs @@ -6,8 +6,7 @@ use crate::{ }; use is_macro::Is; use swc_atoms::JsWord; -use swc_common::EqIgnoreSpan; -use swc_common::{ast_node, Span}; +use swc_common::{ast_node, EqIgnoreSpan, Span}; /// Used for `obj` property of `JSXMemberExpr`. #[ast_node] diff --git a/ecmascript/ast/src/lib.rs b/ecmascript/ast/src/lib.rs index 48cd2454a715..64364457b107 100644 --- a/ecmascript/ast/src/lib.rs +++ b/ecmascript/ast/src/lib.rs @@ -64,10 +64,8 @@ pub use self::{ TsTypeQuery, TsTypeQueryExpr, TsTypeRef, TsUnionOrIntersectionType, TsUnionType, }, }; -use serde::Deserialize; -use serde::Serialize; -use swc_common::EqIgnoreSpan; -use swc_common::{ast_node, Span}; +use serde::{Deserialize, Serialize}; +use swc_common::{ast_node, EqIgnoreSpan, Span}; #[macro_use] mod macros; diff --git a/ecmascript/ast/src/lit.rs b/ecmascript/ast/src/lit.rs index 937d3e6b5fec..e3ffb7dfd4b5 100644 --- a/ecmascript/ast/src/lit.rs +++ b/ecmascript/ast/src/lit.rs @@ -7,8 +7,7 @@ use std::{ mem, }; use swc_atoms::JsWord; -use swc_common::EqIgnoreSpan; -use swc_common::{ast_node, Span}; +use swc_common::{ast_node, EqIgnoreSpan, Span}; #[ast_node] #[derive(Eq, Hash, EqIgnoreSpan)] diff --git a/ecmascript/ast/src/module.rs b/ecmascript/ast/src/module.rs index 7d14547e11f5..54bebd68d825 100644 --- a/ecmascript/ast/src/module.rs +++ b/ecmascript/ast/src/module.rs @@ -1,8 +1,7 @@ use crate::{module_decl::ModuleDecl, stmt::Stmt}; use is_macro::Is; use swc_atoms::JsWord; -use swc_common::EqIgnoreSpan; -use swc_common::{ast_node, Span}; +use swc_common::{ast_node, EqIgnoreSpan, Span}; #[ast_node] #[derive(Eq, Hash, Is, EqIgnoreSpan)] diff --git a/ecmascript/ast/src/module_decl.rs b/ecmascript/ast/src/module_decl.rs index 01fcf1b2860a..13eb737157eb 100644 --- a/ecmascript/ast/src/module_decl.rs +++ b/ecmascript/ast/src/module_decl.rs @@ -7,8 +7,7 @@ use crate::{ ObjectLit, }; use is_macro::Is; -use swc_common::EqIgnoreSpan; -use swc_common::{ast_node, Span}; +use swc_common::{ast_node, EqIgnoreSpan, Span}; #[ast_node] #[derive(Eq, Hash, Is, EqIgnoreSpan)] diff --git a/ecmascript/ast/src/pat.rs b/ecmascript/ast/src/pat.rs index e14022df90b9..fca3cd8a850b 100644 --- a/ecmascript/ast/src/pat.rs +++ b/ecmascript/ast/src/pat.rs @@ -1,8 +1,12 @@ -use crate::ident::BindingIdent; -use crate::{expr::Expr, ident::Ident, prop::PropName, typescript::TsTypeAnn, Invalid}; +use crate::{ + expr::Expr, + ident::{BindingIdent, Ident}, + prop::PropName, + typescript::TsTypeAnn, + Invalid, +}; use is_macro::Is; -use swc_common::EqIgnoreSpan; -use swc_common::{ast_node, Span}; +use swc_common::{ast_node, EqIgnoreSpan, Span}; impl From for Pat { fn from(i: Ident) -> Self { diff --git a/ecmascript/ast/src/prop.rs b/ecmascript/ast/src/prop.rs index 33ad517f47b4..309420db90fe 100644 --- a/ecmascript/ast/src/prop.rs +++ b/ecmascript/ast/src/prop.rs @@ -8,8 +8,7 @@ use crate::{ typescript::TsTypeAnn, }; use is_macro::Is; -use swc_common::EqIgnoreSpan; -use swc_common::{ast_node, Span}; +use swc_common::{ast_node, EqIgnoreSpan, Span}; #[ast_node] #[derive(Eq, Hash, Is, EqIgnoreSpan)] diff --git a/ecmascript/ast/src/stmt.rs b/ecmascript/ast/src/stmt.rs index b464c0606011..e36a74baf2aa 100644 --- a/ecmascript/ast/src/stmt.rs +++ b/ecmascript/ast/src/stmt.rs @@ -5,8 +5,7 @@ use crate::{ pat::Pat, }; use is_macro::Is; -use swc_common::EqIgnoreSpan; -use swc_common::{ast_node, Span}; +use swc_common::{ast_node, EqIgnoreSpan, Span}; /// Use when only block statements are allowed. #[ast_node("BlockStatement")] diff --git a/ecmascript/ast/src/typescript.rs b/ecmascript/ast/src/typescript.rs index b580e6fa83bd..84100cb37ea2 100644 --- a/ecmascript/ast/src/typescript.rs +++ b/ecmascript/ast/src/typescript.rs @@ -1,6 +1,5 @@ #![allow(clippy::vec_box)] #![allow(missing_copy_implementations)] -use crate::BindingIdent; use crate::{ class::Decorator, expr::Expr, @@ -8,7 +7,7 @@ use crate::{ lit::{Bool, Number, Str}, module::ModuleItem, pat::{ArrayPat, AssignPat, ObjectPat, Pat, RestPat}, - BigInt, TplElement, + BigInt, BindingIdent, TplElement, }; use is_macro::Is; use serde::{ @@ -17,8 +16,7 @@ use serde::{ }; use std::fmt; use string_enum::StringEnum; -use swc_common::EqIgnoreSpan; -use swc_common::{ast_node, Span}; +use swc_common::{ast_node, EqIgnoreSpan, Span}; #[ast_node("TsTypeAnnotation")] #[derive(Eq, Hash, EqIgnoreSpan)] diff --git a/ecmascript/codegen/src/tests.rs b/ecmascript/codegen/src/tests.rs index 97f1e377e2ca..b30a4491521c 100644 --- a/ecmascript/codegen/src/tests.rs +++ b/ecmascript/codegen/src/tests.rs @@ -1,7 +1,6 @@ use self::swc_ecma_parser::{EsConfig, Parser, StringInput, Syntax}; use super::*; -use crate::config::Config; -use crate::text_writer::omit_trailing_semi; +use crate::{config::Config, text_writer::omit_trailing_semi}; use std::{ fmt::Debug, io::Write, diff --git a/ecmascript/loader/src/resolve.rs b/ecmascript/loader/src/resolve.rs index 5355de080cf2..3c99f6eb320b 100644 --- a/ecmascript/loader/src/resolve.rs +++ b/ecmascript/loader/src/resolve.rs @@ -1,7 +1,9 @@ use anyhow::Error; use std::sync::Arc; -use swc_common::sync::{Send, Sync}; -use swc_common::FileName; +use swc_common::{ + sync::{Send, Sync}, + FileName, +}; pub trait Resolve: Send + Sync { fn resolve(&self, base: &FileName, module_specifier: &str) -> Result; diff --git a/ecmascript/loader/tests/tsc_resolver.rs b/ecmascript/loader/tests/tsc_resolver.rs index ef7b29b37222..3662aa5014c9 100644 --- a/ecmascript/loader/tests/tsc_resolver.rs +++ b/ecmascript/loader/tests/tsc_resolver.rs @@ -1,11 +1,9 @@ #![cfg(feature = "tsc")] -use anyhow::anyhow; -use anyhow::Error; +use anyhow::{anyhow, Error}; use std::collections::HashMap; use swc_common::FileName; -use swc_ecma_loader::resolve::Resolve; -use swc_ecma_loader::resolvers::tsc::TsConfigResolver; +use swc_ecma_loader::{resolve::Resolve, resolvers::tsc::TsConfigResolver}; #[test] fn base_dir_exact() {} diff --git a/ecmascript/minifier/src/analyzer/ctx.rs b/ecmascript/minifier/src/analyzer/ctx.rs index 233bc1059aaa..cf168ef4ab74 100644 --- a/ecmascript/minifier/src/analyzer/ctx.rs +++ b/ecmascript/minifier/src/analyzer/ctx.rs @@ -1,6 +1,5 @@ use super::UsageAnalyzer; -use std::ops::Deref; -use std::ops::DerefMut; +use std::ops::{Deref, DerefMut}; use swc_ecma_ast::VarDeclKind; impl UsageAnalyzer { diff --git a/ecmascript/minifier/src/analyzer/mod.rs b/ecmascript/minifier/src/analyzer/mod.rs index f05860efcefa..fe5675253e0f 100644 --- a/ecmascript/minifier/src/analyzer/mod.rs +++ b/ecmascript/minifier/src/analyzer/mod.rs @@ -1,23 +1,15 @@ use self::ctx::Ctx; -use crate::marks::Marks; -use crate::util::can_end_conditionally; -use crate::util::idents_used_by; -use crate::util::now; -use fxhash::FxHashMap; -use fxhash::FxHashSet; -use std::collections::hash_map::Entry; -use std::time::Instant; +use crate::{ + marks::Marks, + util::{can_end_conditionally, idents_used_by, now}, +}; +use fxhash::{FxHashMap, FxHashSet}; +use std::{collections::hash_map::Entry, time::Instant}; use swc_atoms::JsWord; -use swc_common::SyntaxContext; -use swc_common::DUMMY_SP; +use swc_common::{SyntaxContext, DUMMY_SP}; use swc_ecma_ast::*; -use swc_ecma_utils::find_ids; -use swc_ecma_utils::ident::IdentLike; -use swc_ecma_utils::Id; -use swc_ecma_visit::noop_visit_type; -use swc_ecma_visit::Node; -use swc_ecma_visit::Visit; -use swc_ecma_visit::VisitWith; +use swc_ecma_utils::{find_ids, ident::IdentLike, Id}; +use swc_ecma_visit::{noop_visit_type, Node, Visit, VisitWith}; mod ctx; diff --git a/ecmascript/minifier/src/compress/drop_console.rs b/ecmascript/minifier/src/compress/drop_console.rs index d9c359be415a..5b536fc50bd3 100644 --- a/ecmascript/minifier/src/compress/drop_console.rs +++ b/ecmascript/minifier/src/compress/drop_console.rs @@ -1,12 +1,8 @@ -use std::borrow::Cow; -use std::mem::take; +use std::{borrow::Cow, mem::take}; use swc_common::pass::CompilerPass; use swc_ecma_ast::*; use swc_ecma_transforms::pass::JsPass; -use swc_ecma_visit::as_folder; -use swc_ecma_visit::noop_visit_mut_type; -use swc_ecma_visit::VisitMut; -use swc_ecma_visit::VisitMutWith; +use swc_ecma_visit::{as_folder, noop_visit_mut_type, VisitMut, VisitMutWith}; pub fn drop_console() -> impl JsPass + VisitMut { as_folder(DropConsole { done: false }) diff --git a/ecmascript/minifier/src/compress/hoist_decls.rs b/ecmascript/minifier/src/compress/hoist_decls.rs index f1aebafce7e8..722f13fc6f80 100644 --- a/ecmascript/minifier/src/compress/hoist_decls.rs +++ b/ecmascript/minifier/src/compress/hoist_decls.rs @@ -1,21 +1,13 @@ -use crate::analyzer::ProgramData; -use crate::analyzer::UsageAnalyzer; -use crate::util::is_hoisted_var_decl_without_init; -use crate::util::sort::is_sorted_by_key; -use crate::util::IsModuleItem; +use crate::{ + analyzer::{ProgramData, UsageAnalyzer}, + util::{is_hoisted_var_decl_without_init, sort::is_sorted_by_key, IsModuleItem}, +}; use fxhash::FxHashSet; -use swc_common::pass::Repeated; -use swc_common::DUMMY_SP; +use swc_common::{pass::Repeated, DUMMY_SP}; use swc_ecma_ast::*; use swc_ecma_transforms_base::ext::MapWithMut; -use swc_ecma_utils::find_ids; -use swc_ecma_utils::ident::IdentLike; -use swc_ecma_utils::Id; -use swc_ecma_utils::StmtLike; -use swc_ecma_visit::noop_visit_mut_type; -use swc_ecma_visit::VisitMut; -use swc_ecma_visit::VisitMutWith; -use swc_ecma_visit::VisitWith; +use swc_ecma_utils::{find_ids, ident::IdentLike, Id, StmtLike}; +use swc_ecma_visit::{noop_visit_mut_type, VisitMut, VisitMutWith, VisitWith}; pub(super) struct DeclHoisterConfig { pub hoist_fns: bool, diff --git a/ecmascript/minifier/src/compress/mod.rs b/ecmascript/minifier/src/compress/mod.rs index f32805ae7989..a571997e9749 100644 --- a/ecmascript/minifier/src/compress/mod.rs +++ b/ecmascript/minifier/src/compress/mod.rs @@ -1,44 +1,39 @@ -use self::drop_console::drop_console; -use self::hoist_decls::DeclHoisterConfig; -use self::optimize::optimizer; -use self::optimize::OptimizerState; -use crate::analyzer::analyze; -use crate::analyzer::ProgramData; -use crate::analyzer::UsageAnalyzer; -use crate::compress::hoist_decls::decl_hoister; -use crate::compress::pure::pure_optimizer; -use crate::debug::dump; -use crate::debug::invoke; -use crate::marks::Marks; -use crate::option::CompressOptions; -use crate::util::now; -use crate::util::unit::CompileUnit; -use crate::util::Optional; -use crate::MAX_PAR_DEPTH; +use self::{ + drop_console::drop_console, + hoist_decls::DeclHoisterConfig, + optimize::{optimizer, OptimizerState}, +}; +use crate::{ + analyzer::{analyze, ProgramData, UsageAnalyzer}, + compress::{hoist_decls::decl_hoister, pure::pure_optimizer}, + debug::{dump, invoke}, + marks::Marks, + option::CompressOptions, + util::{now, unit::CompileUnit, Optional}, + MAX_PAR_DEPTH, +}; #[cfg(feature = "pretty_assertions")] use pretty_assertions::assert_eq; use rayon::prelude::*; -use std::borrow::Cow; -use std::fmt; -use std::fmt::Debug; -use std::fmt::Display; -use std::fmt::Formatter; -use std::thread; -use std::time::Instant; -use swc_common::chain; -use swc_common::pass::CompilerPass; -use swc_common::pass::Repeated; -use swc_common::Globals; +use std::{ + borrow::Cow, + fmt, + fmt::{Debug, Display, Formatter}, + thread, + time::Instant, +}; +use swc_common::{ + chain, + pass::{CompilerPass, Repeated}, + Globals, +}; use swc_ecma_ast::*; -use swc_ecma_transforms::optimization::simplify::dead_branch_remover; -use swc_ecma_transforms::optimization::simplify::expr_simplifier; -use swc_ecma_transforms::pass::JsPass; +use swc_ecma_transforms::{ + optimization::simplify::{dead_branch_remover, expr_simplifier}, + pass::JsPass, +}; use swc_ecma_utils::StmtLike; -use swc_ecma_visit::as_folder; -use swc_ecma_visit::noop_visit_mut_type; -use swc_ecma_visit::VisitMut; -use swc_ecma_visit::VisitMutWith; -use swc_ecma_visit::VisitWith; +use swc_ecma_visit::{as_folder, noop_visit_mut_type, VisitMut, VisitMutWith, VisitWith}; mod drop_console; mod hoist_decls; diff --git a/ecmascript/minifier/src/compress/optimize/arguments.rs b/ecmascript/minifier/src/compress/optimize/arguments.rs index 3b8d7448c06f..ea6125924325 100644 --- a/ecmascript/minifier/src/compress/optimize/arguments.rs +++ b/ecmascript/minifier/src/compress/optimize/arguments.rs @@ -4,13 +4,8 @@ use std::iter::repeat_with; use swc_atoms::js_word; use swc_common::DUMMY_SP; use swc_ecma_ast::*; -use swc_ecma_utils::find_ids; -use swc_ecma_utils::ident::IdentLike; -use swc_ecma_utils::private_ident; -use swc_ecma_utils::Id; -use swc_ecma_visit::noop_visit_mut_type; -use swc_ecma_visit::VisitMut; -use swc_ecma_visit::VisitMutWith; +use swc_ecma_utils::{find_ids, ident::IdentLike, private_ident, Id}; +use swc_ecma_visit::{noop_visit_mut_type, VisitMut, VisitMutWith}; /// Methods related to the option `arguments`. impl Optimizer<'_> { diff --git a/ecmascript/minifier/src/compress/optimize/bools.rs b/ecmascript/minifier/src/compress/optimize/bools.rs index 05a9cce0c560..807ad79ed3e7 100644 --- a/ecmascript/minifier/src/compress/optimize/bools.rs +++ b/ecmascript/minifier/src/compress/optimize/bools.rs @@ -1,15 +1,13 @@ use super::Optimizer; -use crate::compress::optimize::Ctx; -use crate::compress::util::negate_cost; -use crate::debug::dump; +use crate::{ + compress::{optimize::Ctx, util::negate_cost}, + debug::dump, +}; use swc_atoms::js_word; use swc_common::Spanned; use swc_ecma_ast::*; use swc_ecma_transforms_base::ext::MapWithMut; -use swc_ecma_utils::ident::IdentLike; -use swc_ecma_utils::Type; -use swc_ecma_utils::Value::Known; -use swc_ecma_utils::{undefined, ExprExt}; +use swc_ecma_utils::{ident::IdentLike, undefined, ExprExt, Type, Value::Known}; /// Methods related to the options `bools` and `bool_as_ints`. impl Optimizer<'_> { diff --git a/ecmascript/minifier/src/compress/optimize/collapse_vars.rs b/ecmascript/minifier/src/compress/optimize/collapse_vars.rs index 9cbc163f640a..6add9580b872 100644 --- a/ecmascript/minifier/src/compress/optimize/collapse_vars.rs +++ b/ecmascript/minifier/src/compress/optimize/collapse_vars.rs @@ -1,11 +1,8 @@ use super::Optimizer; use fxhash::FxHashMap; use swc_ecma_ast::*; -use swc_ecma_utils::ident::IdentLike; -use swc_ecma_utils::Id; -use swc_ecma_visit::noop_visit_mut_type; -use swc_ecma_visit::VisitMut; -use swc_ecma_visit::VisitMutWith; +use swc_ecma_utils::{ident::IdentLike, Id}; +use swc_ecma_visit::{noop_visit_mut_type, VisitMut, VisitMutWith}; /// Methods related to the option `collapse_vars`. impl Optimizer<'_> { diff --git a/ecmascript/minifier/src/compress/optimize/conditionals.rs b/ecmascript/minifier/src/compress/optimize/conditionals.rs index 8279d011cd3f..eb20ae47f343 100644 --- a/ecmascript/minifier/src/compress/optimize/conditionals.rs +++ b/ecmascript/minifier/src/compress/optimize/conditionals.rs @@ -1,21 +1,17 @@ use super::Optimizer; -use crate::compress::optimize::Ctx; -use crate::compress::util::always_terminates; -use crate::compress::util::negate_cost; -use crate::util::SpanExt; -use crate::DISABLE_BUGGY_PASSES; +use crate::{ + compress::{ + optimize::Ctx, + util::{always_terminates, negate_cost}, + }, + util::SpanExt, + DISABLE_BUGGY_PASSES, +}; use std::mem::swap; -use swc_common::EqIgnoreSpan; -use swc_common::Spanned; -use swc_common::DUMMY_SP; +use swc_common::{EqIgnoreSpan, Spanned, DUMMY_SP}; use swc_ecma_ast::*; -use swc_ecma_transforms_base::ext::AsOptExpr; -use swc_ecma_transforms_base::ext::ExprRefExt; -use swc_ecma_transforms_base::ext::MapWithMut; -use swc_ecma_utils::ident::IdentLike; -use swc_ecma_utils::ExprExt; -use swc_ecma_utils::ExprFactory; -use swc_ecma_utils::StmtLike; +use swc_ecma_transforms_base::ext::{AsOptExpr, ExprRefExt, MapWithMut}; +use swc_ecma_utils::{ident::IdentLike, ExprExt, ExprFactory, StmtLike}; /// Methods related to the option `conditionals`. All methods are noop if /// `conditionals` is false. diff --git a/ecmascript/minifier/src/compress/optimize/evaluate.rs b/ecmascript/minifier/src/compress/optimize/evaluate.rs index a4f815106a7b..f04974455c79 100644 --- a/ecmascript/minifier/src/compress/optimize/evaluate.rs +++ b/ecmascript/minifier/src/compress/optimize/evaluate.rs @@ -1,17 +1,11 @@ use super::Optimizer; -use crate::compress::util::eval_as_number; -use crate::DISABLE_BUGGY_PASSES; +use crate::{compress::util::eval_as_number, DISABLE_BUGGY_PASSES}; use std::num::FpCategory; use swc_atoms::js_word; -use swc_common::Spanned; -use swc_common::SyntaxContext; -use swc_common::DUMMY_SP; +use swc_common::{Spanned, SyntaxContext, DUMMY_SP}; use swc_ecma_ast::*; use swc_ecma_transforms_base::ext::MapWithMut; -use swc_ecma_utils::ident::IdentLike; -use swc_ecma_utils::undefined; -use swc_ecma_utils::ExprExt; -use swc_ecma_utils::Value::Known; +use swc_ecma_utils::{ident::IdentLike, undefined, ExprExt, Value::Known}; /// Methods related to the option `evaludate`. impl Optimizer<'_> { diff --git a/ecmascript/minifier/src/compress/optimize/if_return.rs b/ecmascript/minifier/src/compress/optimize/if_return.rs index 9fffd665220f..50a2b158058c 100644 --- a/ecmascript/minifier/src/compress/optimize/if_return.rs +++ b/ecmascript/minifier/src/compress/optimize/if_return.rs @@ -1,18 +1,10 @@ use super::Optimizer; -use crate::compress::util::is_pure_undefined; -use crate::debug::dump; -use crate::util::ExprOptExt; -use swc_common::Spanned; -use swc_common::DUMMY_SP; +use crate::{compress::util::is_pure_undefined, debug::dump, util::ExprOptExt}; +use swc_common::{Spanned, DUMMY_SP}; use swc_ecma_ast::*; use swc_ecma_transforms_base::ext::MapWithMut; -use swc_ecma_utils::prepend; -use swc_ecma_utils::undefined; -use swc_ecma_utils::StmtLike; -use swc_ecma_visit::noop_visit_type; -use swc_ecma_visit::Node; -use swc_ecma_visit::Visit; -use swc_ecma_visit::VisitWith; +use swc_ecma_utils::{prepend, undefined, StmtLike}; +use swc_ecma_visit::{noop_visit_type, Node, Visit, VisitWith}; /// Methods related to the option `if_return`. All methods are noop if /// `if_return` is false. diff --git a/ecmascript/minifier/src/compress/optimize/iife.rs b/ecmascript/minifier/src/compress/optimize/iife.rs index 6d6f7121c773..aba2a8bc6725 100644 --- a/ecmascript/minifier/src/compress/optimize/iife.rs +++ b/ecmascript/minifier/src/compress/optimize/iife.rs @@ -1,21 +1,18 @@ use super::Optimizer; -use crate::compress::optimize::Ctx; -use crate::util::idents_used_by; -use crate::util::make_number; +use crate::{ + compress::optimize::Ctx, + util::{idents_used_by, make_number}, +}; use fxhash::FxHashMap; -use std::collections::HashMap; -use std::mem::replace; -use std::mem::swap; +use std::{ + collections::HashMap, + mem::{replace, swap}, +}; use swc_atoms::js_word; -use swc_common::pass::Either; -use swc_common::Spanned; -use swc_common::DUMMY_SP; +use swc_common::{pass::Either, Spanned, DUMMY_SP}; use swc_ecma_ast::*; use swc_ecma_transforms_base::ext::MapWithMut; -use swc_ecma_utils::ident::IdentLike; -use swc_ecma_utils::undefined; -use swc_ecma_utils::ExprFactory; -use swc_ecma_utils::Id; +use swc_ecma_utils::{ident::IdentLike, undefined, ExprFactory, Id}; use swc_ecma_visit::VisitMutWith; /// Methods related to the option `negate_iife`. diff --git a/ecmascript/minifier/src/compress/optimize/inline.rs b/ecmascript/minifier/src/compress/optimize/inline.rs index 666f18163b31..9909197c2a5e 100644 --- a/ecmascript/minifier/src/compress/optimize/inline.rs +++ b/ecmascript/minifier/src/compress/optimize/inline.rs @@ -1,16 +1,14 @@ use super::Optimizer; -use crate::compress::optimize::util::class_has_side_effect; -use crate::compress::optimize::util::is_valid_for_lhs; -use crate::debug::dump; -use crate::util::idents_used_by; +use crate::{ + compress::optimize::util::{class_has_side_effect, is_valid_for_lhs}, + debug::dump, + util::idents_used_by, +}; use swc_atoms::js_word; -use swc_common::Spanned; -use swc_common::DUMMY_SP; +use swc_common::{Spanned, DUMMY_SP}; use swc_ecma_ast::*; use swc_ecma_transforms_base::ext::MapWithMut; -use swc_ecma_utils::ident::IdentLike; -use swc_ecma_utils::ExprExt; -use swc_ecma_utils::UsageFinder; +use swc_ecma_utils::{ident::IdentLike, ExprExt, UsageFinder}; /// Methods related to option `inline`. impl Optimizer<'_> { diff --git a/ecmascript/minifier/src/compress/optimize/loops.rs b/ecmascript/minifier/src/compress/optimize/loops.rs index ea920cb987a6..23c7a5c63035 100644 --- a/ecmascript/minifier/src/compress/optimize/loops.rs +++ b/ecmascript/minifier/src/compress/optimize/loops.rs @@ -1,10 +1,8 @@ -use crate::compress::optimize::unused::UnreachableHandler; -use crate::compress::optimize::Optimizer; +use crate::compress::optimize::{unused::UnreachableHandler, Optimizer}; use swc_common::DUMMY_SP; use swc_ecma_ast::*; use swc_ecma_transforms_base::ext::MapWithMut; -use swc_ecma_utils::ExprExt; -use swc_ecma_utils::Value::Known; +use swc_ecma_utils::{ExprExt, Value::Known}; /// Methods related to the option `loops`. impl Optimizer<'_> { diff --git a/ecmascript/minifier/src/compress/optimize/mod.rs b/ecmascript/minifier/src/compress/optimize/mod.rs index 7ee44876bf04..2edc59caf9ad 100644 --- a/ecmascript/minifier/src/compress/optimize/mod.rs +++ b/ecmascript/minifier/src/compress/optimize/mod.rs @@ -1,39 +1,23 @@ -use crate::analyzer::ProgramData; -use crate::analyzer::UsageAnalyzer; -use crate::compress::util::is_pure_undefined; -use crate::debug::dump; -use crate::marks::Marks; -use crate::option::CompressOptions; -use crate::util::contains_leaping_yield; -use crate::util::MoudleItemExt; +use crate::{ + analyzer::{ProgramData, UsageAnalyzer}, + compress::util::is_pure_undefined, + debug::dump, + marks::Marks, + option::CompressOptions, + util::{contains_leaping_yield, MoudleItemExt}, +}; use fxhash::FxHashMap; use retain_mut::RetainMut; -use std::fmt::Write; -use std::mem::take; -use swc_atoms::js_word; -use swc_atoms::JsWord; -use swc_common::iter::IdentifyLast; -use swc_common::pass::Repeated; -use swc_common::Mark; -use swc_common::Spanned; -use swc_common::SyntaxContext; -use swc_common::DUMMY_SP; +use std::{fmt::Write, mem::take}; +use swc_atoms::{js_word, JsWord}; +use swc_common::{iter::IdentifyLast, pass::Repeated, Mark, Spanned, SyntaxContext, DUMMY_SP}; use swc_ecma_ast::*; use swc_ecma_transforms_base::ext::MapWithMut; -use swc_ecma_utils::ident::IdentLike; -use swc_ecma_utils::undefined; -use swc_ecma_utils::ExprExt; -use swc_ecma_utils::ExprFactory; -use swc_ecma_utils::Id; -use swc_ecma_utils::IsEmpty; -use swc_ecma_utils::ModuleItemLike; -use swc_ecma_utils::StmtLike; -use swc_ecma_utils::Type; -use swc_ecma_utils::Value; -use swc_ecma_visit::noop_visit_mut_type; -use swc_ecma_visit::VisitMut; -use swc_ecma_visit::VisitMutWith; -use swc_ecma_visit::VisitWith; +use swc_ecma_utils::{ + ident::IdentLike, undefined, ExprExt, ExprFactory, Id, IsEmpty, ModuleItemLike, StmtLike, Type, + Value, +}; +use swc_ecma_visit::{noop_visit_mut_type, VisitMut, VisitMutWith, VisitWith}; use Value::Known; use self::util::replace_id_with_expr; diff --git a/ecmascript/minifier/src/compress/optimize/ops.rs b/ecmascript/minifier/src/compress/optimize/ops.rs index 97c596cc0b5d..57f8e4a1f729 100644 --- a/ecmascript/minifier/src/compress/optimize/ops.rs +++ b/ecmascript/minifier/src/compress/optimize/ops.rs @@ -1,15 +1,13 @@ use super::Optimizer; -use crate::compress::util::negate; -use crate::util::make_bool; -use crate::util::ValueExt; +use crate::{ + compress::util::negate, + util::{make_bool, ValueExt}, +}; use swc_atoms::js_word; use swc_common::EqIgnoreSpan; use swc_ecma_ast::*; use swc_ecma_transforms_base::ext::MapWithMut; -use swc_ecma_utils::ident::IdentLike; -use swc_ecma_utils::ExprExt; -use swc_ecma_utils::Type; -use swc_ecma_utils::Value; +use swc_ecma_utils::{ident::IdentLike, ExprExt, Type, Value}; use Value::Known; impl Optimizer<'_> { diff --git a/ecmascript/minifier/src/compress/optimize/sequences.rs b/ecmascript/minifier/src/compress/optimize/sequences.rs index 9f379b23fe2c..5cc0d84c7b60 100644 --- a/ecmascript/minifier/src/compress/optimize/sequences.rs +++ b/ecmascript/minifier/src/compress/optimize/sequences.rs @@ -1,21 +1,20 @@ use super::{is_pure_undefined, Optimizer}; -use crate::compress::optimize::util::replace_id_with_expr; -use crate::compress::util::{get_lhs_ident, get_lhs_ident_mut, is_directive}; -use crate::debug::dump; -use crate::util::{idents_used_by, idents_used_by_ignoring_nested, ExprOptExt}; +use crate::{ + compress::{ + optimize::util::replace_id_with_expr, + util::{get_lhs_ident, get_lhs_ident_mut, is_directive}, + }, + debug::dump, + util::{idents_used_by, idents_used_by_ignoring_nested, ExprOptExt}, +}; use retain_mut::RetainMut; use std::mem::take; use swc_atoms::js_word; -use swc_common::Spanned; -use swc_common::DUMMY_SP; +use swc_common::{Spanned, DUMMY_SP}; use swc_ecma_ast::*; use swc_ecma_transforms_base::ext::MapWithMut; -use swc_ecma_utils::ident::IdentLike; -use swc_ecma_utils::{contains_this_expr, undefined, ExprExt, Id, StmtLike}; -use swc_ecma_visit::noop_visit_type; -use swc_ecma_visit::Node; -use swc_ecma_visit::Visit; -use swc_ecma_visit::VisitWith; +use swc_ecma_utils::{contains_this_expr, ident::IdentLike, undefined, ExprExt, Id, StmtLike}; +use swc_ecma_visit::{noop_visit_type, Node, Visit, VisitWith}; /// Methods related to the option `sequences`. All methods are noop if /// `sequences` is false. diff --git a/ecmascript/minifier/src/compress/optimize/strings.rs b/ecmascript/minifier/src/compress/optimize/strings.rs index bf889de9b336..2b90a34f971e 100644 --- a/ecmascript/minifier/src/compress/optimize/strings.rs +++ b/ecmascript/minifier/src/compress/optimize/strings.rs @@ -3,9 +3,7 @@ use swc_atoms::js_word; use swc_common::Spanned; use swc_ecma_ast::*; use swc_ecma_transforms_base::ext::MapWithMut; -use swc_ecma_utils::ident::IdentLike; -use swc_ecma_utils::ExprExt; -use swc_ecma_utils::Value::Known; +use swc_ecma_utils::{ident::IdentLike, ExprExt, Value::Known}; impl Optimizer<'_> { pub(super) fn optimize_expr_in_str_ctx_unsafely(&mut self, e: &mut Expr) { diff --git a/ecmascript/minifier/src/compress/optimize/switches.rs b/ecmascript/minifier/src/compress/optimize/switches.rs index 0f7a966a94f4..756fc793b8f8 100644 --- a/ecmascript/minifier/src/compress/optimize/switches.rs +++ b/ecmascript/minifier/src/compress/optimize/switches.rs @@ -2,20 +2,11 @@ use std::mem::take; use super::Optimizer; use crate::util::ExprOptExt; -use swc_common::EqIgnoreSpan; -use swc_common::DUMMY_SP; +use swc_common::{EqIgnoreSpan, DUMMY_SP}; use swc_ecma_ast::*; use swc_ecma_transforms_base::ext::MapWithMut; -use swc_ecma_utils::ident::IdentLike; -use swc_ecma_utils::prepend; -use swc_ecma_utils::ExprExt; -use swc_ecma_utils::StmtExt; -use swc_ecma_utils::Type; -use swc_ecma_utils::Value::Known; -use swc_ecma_visit::noop_visit_type; -use swc_ecma_visit::Node; -use swc_ecma_visit::Visit; -use swc_ecma_visit::VisitWith; +use swc_ecma_utils::{ident::IdentLike, prepend, ExprExt, StmtExt, Type, Value::Known}; +use swc_ecma_visit::{noop_visit_type, Node, Visit, VisitWith}; /// Methods related to option `switches`. impl Optimizer<'_> { diff --git a/ecmascript/minifier/src/compress/optimize/unused.rs b/ecmascript/minifier/src/compress/optimize/unused.rs index fffc597a6fc4..73a737ea411e 100644 --- a/ecmascript/minifier/src/compress/optimize/unused.rs +++ b/ecmascript/minifier/src/compress/optimize/unused.rs @@ -1,17 +1,13 @@ use super::Optimizer; -use crate::compress::optimize::util::class_has_side_effect; -use crate::debug::dump; -use crate::option::PureGetterOption; +use crate::{ + compress::optimize::util::class_has_side_effect, debug::dump, option::PureGetterOption, +}; use swc_atoms::js_word; -use swc_common::Span; -use swc_common::DUMMY_SP; +use swc_common::{Span, DUMMY_SP}; use swc_ecma_ast::*; use swc_ecma_transforms_base::ext::MapWithMut; -use swc_ecma_utils::contains_ident_ref; -use swc_ecma_utils::ident::IdentLike; -use swc_ecma_visit::noop_visit_mut_type; -use swc_ecma_visit::VisitMut; -use swc_ecma_visit::VisitMutWith; +use swc_ecma_utils::{contains_ident_ref, ident::IdentLike}; +use swc_ecma_visit::{noop_visit_mut_type, VisitMut, VisitMutWith}; /// Methods related to the option `unused`. impl Optimizer<'_> { diff --git a/ecmascript/minifier/src/compress/optimize/util.rs b/ecmascript/minifier/src/compress/optimize/util.rs index 9189f35a42f3..fa46a5885d8c 100644 --- a/ecmascript/minifier/src/compress/optimize/util.rs +++ b/ecmascript/minifier/src/compress/optimize/util.rs @@ -1,16 +1,10 @@ -use super::Ctx; -use super::Optimizer; -use std::ops::Deref; -use std::ops::DerefMut; +use super::{Ctx, Optimizer}; +use std::ops::{Deref, DerefMut}; use swc_atoms::JsWord; use swc_common::Span; use swc_ecma_ast::*; -use swc_ecma_utils::prop_name_eq; -use swc_ecma_utils::ExprExt; -use swc_ecma_utils::Id; -use swc_ecma_visit::noop_visit_mut_type; -use swc_ecma_visit::VisitMut; -use swc_ecma_visit::VisitMutWith; +use swc_ecma_utils::{prop_name_eq, ExprExt, Id}; +use swc_ecma_visit::{noop_visit_mut_type, VisitMut, VisitMutWith}; impl<'b> Optimizer<'b> { pub(super) fn access_property<'e>( diff --git a/ecmascript/minifier/src/compress/pure/bools.rs b/ecmascript/minifier/src/compress/pure/bools.rs index f90dd79974cb..96cf903febac 100644 --- a/ecmascript/minifier/src/compress/pure/bools.rs +++ b/ecmascript/minifier/src/compress/pure/bools.rs @@ -1,19 +1,14 @@ use super::Pure; -use crate::compress::util::is_pure_undefined; -use crate::compress::util::negate; -use crate::compress::util::negate_cost; -use crate::util::make_bool; +use crate::{ + compress::util::{is_pure_undefined, negate, negate_cost}, + util::make_bool, +}; use std::mem::swap; use swc_atoms::js_word; -use swc_common::EqIgnoreSpan; -use swc_common::Span; -use swc_common::Spanned; -use swc_common::DUMMY_SP; +use swc_common::{EqIgnoreSpan, Span, Spanned, DUMMY_SP}; use swc_ecma_ast::*; use swc_ecma_transforms_base::ext::MapWithMut; -use swc_ecma_utils::ExprExt; -use swc_ecma_utils::Type; -use swc_ecma_utils::Value; +use swc_ecma_utils::{ExprExt, Type, Value}; impl Pure<'_> { pub(super) fn negate_twice(&mut self, e: &mut Expr) { diff --git a/ecmascript/minifier/src/compress/pure/properties.rs b/ecmascript/minifier/src/compress/pure/properties.rs index 5f4478ae8cc0..298e0db82301 100644 --- a/ecmascript/minifier/src/compress/pure/properties.rs +++ b/ecmascript/minifier/src/compress/pure/properties.rs @@ -1,11 +1,9 @@ use super::Pure; -use crate::compress::util::is_valid_identifier; -use crate::util::deeply_contains_this_expr; +use crate::{compress::util::is_valid_identifier, util::deeply_contains_this_expr}; use swc_atoms::js_word; use swc_common::SyntaxContext; use swc_ecma_ast::*; -use swc_ecma_utils::prop_name_eq; -use swc_ecma_utils::ExprExt; +use swc_ecma_utils::{prop_name_eq, ExprExt}; impl Pure<'_> { pub(super) fn optimize_property_of_member_expr(&mut self, e: &mut MemberExpr) { diff --git a/ecmascript/minifier/src/debug.rs b/ecmascript/minifier/src/debug.rs index 76d8d611bb12..c76338b6663e 100644 --- a/ecmascript/minifier/src/debug.rs +++ b/ecmascript/minifier/src/debug.rs @@ -1,22 +1,11 @@ use once_cell::sync::Lazy; -use std::env; -use std::process::Command; -use swc_common::sync::Lrc; -use swc_common::SourceMap; -use swc_common::SyntaxContext; -use swc_ecma_ast::Ident; -use swc_ecma_ast::Module; -use swc_ecma_ast::StrKind; -use swc_ecma_codegen::text_writer::JsWriter; -use swc_ecma_codegen::Emitter; -use swc_ecma_transforms::fixer; -use swc_ecma_transforms::hygiene; -use swc_ecma_utils::drop_span; -use swc_ecma_utils::DropSpan; -use swc_ecma_visit::noop_visit_mut_type; -use swc_ecma_visit::FoldWith; -use swc_ecma_visit::VisitMut; -use swc_ecma_visit::VisitMutWith; +use std::{env, process::Command}; +use swc_common::{sync::Lrc, SourceMap, SyntaxContext}; +use swc_ecma_ast::{Ident, Module, StrKind}; +use swc_ecma_codegen::{text_writer::JsWriter, Emitter}; +use swc_ecma_transforms::{fixer, hygiene}; +use swc_ecma_utils::{drop_span, DropSpan}; +use swc_ecma_visit::{noop_visit_mut_type, FoldWith, VisitMut, VisitMutWith}; pub(crate) struct Debugger; diff --git a/ecmascript/minifier/src/lib.rs b/ecmascript/minifier/src/lib.rs index 82588f3ae6bd..b24ed3a120e5 100644 --- a/ecmascript/minifier/src/lib.rs +++ b/ecmascript/minifier/src/lib.rs @@ -12,30 +12,25 @@ //! them something other. Don't call methods like `visit_mut_script` nor //! `visit_mut_module_items`. -use crate::compress::compressor; -use crate::marks::Marks; -use crate::metadata::info_marker; -use crate::option::ExtraOptions; -use crate::option::MinifyOptions; -use crate::pass::compute_char_freq::compute_char_freq; -use crate::pass::expand_names::name_expander; -use crate::pass::global_defs; -use crate::pass::hygiene::hygiene_optimizer; pub use crate::pass::hygiene::optimize_hygiene; -use crate::pass::mangle_names::name_mangler; -use crate::pass::mangle_props::mangle_properties; -use crate::pass::precompress::precompress_optimizer; -use crate::util::now; +use crate::{ + compress::compressor, + marks::Marks, + metadata::info_marker, + option::{ExtraOptions, MinifyOptions}, + pass::{ + compute_char_freq::compute_char_freq, expand_names::name_expander, global_defs, + hygiene::hygiene_optimizer, mangle_names::name_mangler, mangle_props::mangle_properties, + precompress::precompress_optimizer, + }, + util::now, +}; use analyzer::analyze; use pass::postcompress::postcompress_optimizer; use std::time::Instant; -use swc_common::comments::Comments; -use swc_common::sync::Lrc; -use swc_common::SourceMap; -use swc_common::GLOBALS; +use swc_common::{comments::Comments, sync::Lrc, SourceMap, GLOBALS}; use swc_ecma_ast::Module; -use swc_ecma_visit::FoldWith; -use swc_ecma_visit::VisitMutWith; +use swc_ecma_visit::{FoldWith, VisitMutWith}; use timing::Timings; mod analyzer; diff --git a/ecmascript/minifier/src/metadata/mod.rs b/ecmascript/minifier/src/metadata/mod.rs index 541b917e0283..5963da11d16f 100644 --- a/ecmascript/minifier/src/metadata/mod.rs +++ b/ecmascript/minifier/src/metadata/mod.rs @@ -1,22 +1,13 @@ use crate::marks::Marks; -use swc_common::comments::Comment; -use swc_common::comments::CommentKind; -use swc_common::comments::Comments; -use swc_common::Mark; -use swc_common::Span; -use swc_common::SyntaxContext; -use swc_common::DUMMY_SP; +use swc_common::{ + comments::{Comment, CommentKind, Comments}, + Mark, Span, SyntaxContext, DUMMY_SP, +}; use swc_ecma_ast::*; -use swc_ecma_utils::find_ids; -use swc_ecma_utils::ident::IdentLike; -use swc_ecma_utils::Id; -use swc_ecma_visit::noop_visit_mut_type; -use swc_ecma_visit::noop_visit_type; -use swc_ecma_visit::Node; -use swc_ecma_visit::Visit; -use swc_ecma_visit::VisitMut; -use swc_ecma_visit::VisitMutWith; -use swc_ecma_visit::VisitWith; +use swc_ecma_utils::{find_ids, ident::IdentLike, Id}; +use swc_ecma_visit::{ + noop_visit_mut_type, noop_visit_type, Node, Visit, VisitMut, VisitMutWith, VisitWith, +}; #[cfg(test)] mod tests; diff --git a/ecmascript/minifier/src/option/mod.rs b/ecmascript/minifier/src/option/mod.rs index 8bb211dc94ce..e577c5be73ad 100644 --- a/ecmascript/minifier/src/option/mod.rs +++ b/ecmascript/minifier/src/option/mod.rs @@ -1,11 +1,9 @@ use fxhash::FxHashMap; use regex::Regex; -use serde::Deserialize; -use serde::Serialize; +use serde::{Deserialize, Serialize}; use swc_atoms::JsWord; use swc_common::Mark; -use swc_ecma_ast::EsVersion; -use swc_ecma_ast::Expr; +use swc_ecma_ast::{EsVersion, Expr}; pub mod terser; diff --git a/ecmascript/minifier/src/option/terser.rs b/ecmascript/minifier/src/option/terser.rs index 6f2f131b927b..631d9109fa57 100644 --- a/ecmascript/minifier/src/option/terser.rs +++ b/ecmascript/minifier/src/option/terser.rs @@ -1,21 +1,14 @@ //! Compatibility for terser config. -use super::true_by_default; -use super::CompressOptions; -use super::TopLevelOptions; +use super::{true_by_default, CompressOptions, TopLevelOptions}; use crate::option::PureGetterOption; use fxhash::FxHashMap; use serde::{Deserialize, Serialize}; use serde_json::Value; use swc_atoms::JsWord; -use swc_common::input::SourceFileInput; -use swc_common::sync::Lrc; -use swc_common::FileName; -use swc_common::SourceMap; -use swc_common::DUMMY_SP; +use swc_common::{input::SourceFileInput, sync::Lrc, FileName, SourceMap, DUMMY_SP}; use swc_ecma_ast::*; -use swc_ecma_parser::lexer::Lexer; -use swc_ecma_parser::Parser; +use swc_ecma_parser::{lexer::Lexer, Parser}; use swc_ecma_utils::drop_span; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/ecmascript/minifier/src/pass/expand_names.rs b/ecmascript/minifier/src/pass/expand_names.rs index d035994963c9..f53646567d6c 100644 --- a/ecmascript/minifier/src/pass/expand_names.rs +++ b/ecmascript/minifier/src/pass/expand_names.rs @@ -1,5 +1,4 @@ -use swc_ecma_visit::noop_visit_mut_type; -use swc_ecma_visit::VisitMut; +use swc_ecma_visit::{noop_visit_mut_type, VisitMut}; /// Currently noop. /// diff --git a/ecmascript/minifier/src/pass/global_defs.rs b/ecmascript/minifier/src/pass/global_defs.rs index a3d0c3716353..6908de740ef2 100644 --- a/ecmascript/minifier/src/pass/global_defs.rs +++ b/ecmascript/minifier/src/pass/global_defs.rs @@ -1,17 +1,9 @@ use fxhash::FxHashSet; use std::borrow::Cow; -use swc_common::pass::CompilerPass; -use swc_common::EqIgnoreSpan; -use swc_common::Mark; -use swc_common::SyntaxContext; +use swc_common::{pass::CompilerPass, EqIgnoreSpan, Mark, SyntaxContext}; use swc_ecma_ast::*; -use swc_ecma_utils::ident::IdentLike; -use swc_ecma_utils::Id; -use swc_ecma_visit::noop_visit_mut_type; -use swc_ecma_visit::noop_visit_type; -use swc_ecma_visit::Visit; -use swc_ecma_visit::VisitMut; -use swc_ecma_visit::VisitMutWith; +use swc_ecma_utils::{ident::IdentLike, Id}; +use swc_ecma_visit::{noop_visit_mut_type, noop_visit_type, Visit, VisitMut, VisitMutWith}; pub fn globals_defs(defs: Vec<(Box, Box)>, top_level_mark: Mark) -> impl VisitMut { GlobalDefs { diff --git a/ecmascript/minifier/src/pass/hygiene/mod.rs b/ecmascript/minifier/src/pass/hygiene/mod.rs index 41c0bfc6ef21..196037cc3ceb 100644 --- a/ecmascript/minifier/src/pass/hygiene/mod.rs +++ b/ecmascript/minifier/src/pass/hygiene/mod.rs @@ -1,18 +1,13 @@ -use crate::analyzer::analyze; -use crate::analyzer::ProgramData; -use crate::pass::hygiene::analyzer::HygieneAnalyzer; -use crate::pass::hygiene::analyzer::HygieneData; -use crate::util::now; +use crate::{ + analyzer::{analyze, ProgramData}, + pass::hygiene::analyzer::{HygieneAnalyzer, HygieneData}, + util::now, +}; use std::time::Instant; -use swc_common::Mark; -use swc_common::SyntaxContext; -use swc_common::DUMMY_SP; +use swc_common::{Mark, SyntaxContext, DUMMY_SP}; use swc_ecma_ast::*; use swc_ecma_utils::ident::IdentLike; -use swc_ecma_visit::noop_visit_mut_type; -use swc_ecma_visit::VisitMut; -use swc_ecma_visit::VisitMutWith; -use swc_ecma_visit::VisitWith; +use swc_ecma_visit::{noop_visit_mut_type, VisitMut, VisitMutWith, VisitWith}; mod analyzer; diff --git a/ecmascript/minifier/src/pass/mangle_names/mod.rs b/ecmascript/minifier/src/pass/mangle_names/mod.rs index 1d033e16750d..8d9ffc3e3999 100644 --- a/ecmascript/minifier/src/pass/mangle_names/mod.rs +++ b/ecmascript/minifier/src/pass/mangle_names/mod.rs @@ -1,21 +1,17 @@ use self::preserver::idents_to_preserve; use super::compute_char_freq::CharFreqInfo; -use crate::analyzer::analyze; -use crate::analyzer::ProgramData; -use crate::marks::Marks; -use crate::option::MangleOptions; -use crate::util::base54::incr_base54; -use fxhash::FxHashMap; -use fxhash::FxHashSet; -use swc_atoms::js_word; -use swc_atoms::JsWord; +use crate::{ + analyzer::{analyze, ProgramData}, + marks::Marks, + option::MangleOptions, + util::base54::incr_base54, +}; +use fxhash::{FxHashMap, FxHashSet}; +use swc_atoms::{js_word, JsWord}; use swc_common::SyntaxContext; use swc_ecma_ast::*; -use swc_ecma_utils::ident::IdentLike; -use swc_ecma_utils::Id; -use swc_ecma_visit::noop_visit_mut_type; -use swc_ecma_visit::VisitMut; -use swc_ecma_visit::VisitMutWith; +use swc_ecma_utils::{ident::IdentLike, Id}; +use swc_ecma_visit::{noop_visit_mut_type, VisitMut, VisitMutWith}; mod preserver; diff --git a/ecmascript/minifier/src/pass/mangle_names/preserver.rs b/ecmascript/minifier/src/pass/mangle_names/preserver.rs index 01aeaa421217..8cc14e445705 100644 --- a/ecmascript/minifier/src/pass/mangle_names/preserver.rs +++ b/ecmascript/minifier/src/pass/mangle_names/preserver.rs @@ -2,13 +2,8 @@ use crate::option::MangleOptions; use fxhash::FxHashSet; use swc_common::DUMMY_SP; use swc_ecma_ast::*; -use swc_ecma_utils::find_ids; -use swc_ecma_utils::ident::IdentLike; -use swc_ecma_utils::Id; -use swc_ecma_visit::noop_visit_type; -use swc_ecma_visit::Node; -use swc_ecma_visit::Visit; -use swc_ecma_visit::VisitWith; +use swc_ecma_utils::{find_ids, ident::IdentLike, Id}; +use swc_ecma_visit::{noop_visit_type, Node, Visit, VisitWith}; pub(super) fn idents_to_preserve(options: MangleOptions, n: &N) -> FxHashSet where diff --git a/ecmascript/minifier/src/pass/mangle_props.rs b/ecmascript/minifier/src/pass/mangle_props.rs index 2437c5c439c4..6b7a28c0fbfc 100644 --- a/ecmascript/minifier/src/pass/mangle_props.rs +++ b/ecmascript/minifier/src/pass/mangle_props.rs @@ -1,7 +1,8 @@ -use crate::analyzer::analyze; -use crate::analyzer::ProgramData; -use crate::option::ManglePropertiesOptions; -use crate::util::base54::incr_base54; +use crate::{ + analyzer::{analyze, ProgramData}, + option::ManglePropertiesOptions, + util::base54::incr_base54, +}; use once_cell::sync::Lazy; use std::collections::{HashMap, HashSet}; use swc_atoms::JsWord; diff --git a/ecmascript/minifier/src/timing.rs b/ecmascript/minifier/src/timing.rs index ab586201e0fc..45381050ba58 100644 --- a/ecmascript/minifier/src/timing.rs +++ b/ecmascript/minifier/src/timing.rs @@ -1,5 +1,7 @@ -use std::io::{self, Write}; -use std::time::{Duration, Instant}; +use std::{ + io::{self, Write}, + time::{Duration, Instant}, +}; use crate::util::now; diff --git a/ecmascript/minifier/src/util/mod.rs b/ecmascript/minifier/src/util/mod.rs index 63f0df6ed71e..8426b84eb134 100644 --- a/ecmascript/minifier/src/util/mod.rs +++ b/ecmascript/minifier/src/util/mod.rs @@ -1,23 +1,13 @@ use fxhash::FxHashSet; use std::time::Instant; -use swc_common::pass::CompilerPass; -use swc_common::pass::Repeated; -use swc_common::Mark; -use swc_common::Span; -use swc_common::DUMMY_SP; +use swc_common::{ + pass::{CompilerPass, Repeated}, + Mark, Span, DUMMY_SP, +}; use swc_ecma_ast::*; use swc_ecma_transforms_base::ext::MapWithMut; -use swc_ecma_utils::ident::IdentLike; -use swc_ecma_utils::Id; -use swc_ecma_utils::ModuleItemLike; -use swc_ecma_utils::StmtLike; -use swc_ecma_utils::Value; -use swc_ecma_visit::noop_visit_type; -use swc_ecma_visit::Fold; -use swc_ecma_visit::FoldWith; -use swc_ecma_visit::Node; -use swc_ecma_visit::Visit; -use swc_ecma_visit::VisitWith; +use swc_ecma_utils::{ident::IdentLike, Id, ModuleItemLike, StmtLike, Value}; +use swc_ecma_visit::{noop_visit_type, Fold, FoldWith, Node, Visit, VisitWith}; pub(crate) mod base54; pub(crate) mod sort; diff --git a/ecmascript/minifier/tests/compress.rs b/ecmascript/minifier/tests/compress.rs index 15aa12bee3d3..c9b04c4903eb 100644 --- a/ecmascript/minifier/tests/compress.rs +++ b/ecmascript/minifier/tests/compress.rs @@ -1,46 +1,39 @@ extern crate swc_node_base; use ansi_term::Color; -use anyhow::bail; -use anyhow::Context; -use anyhow::Error; +use anyhow::{bail, Context, Error}; use once_cell::sync::Lazy; use serde::Deserialize; -use std::env; -use std::fmt::Debug; -use std::fs::read_to_string; -use std::panic::catch_unwind; -use std::path::Path; -use std::path::PathBuf; -use std::process::Command; -use std::time::Instant; -use swc_common::comments::SingleThreadedComments; -use swc_common::errors::Handler; -use swc_common::sync::Lrc; -use swc_common::EqIgnoreSpan; -use swc_common::FileName; -use swc_common::Mark; -use swc_common::SourceMap; +use std::{ + env, + fmt::Debug, + fs::read_to_string, + panic::catch_unwind, + path::{Path, PathBuf}, + process::Command, + time::Instant, +}; +use swc_common::{ + comments::SingleThreadedComments, errors::Handler, sync::Lrc, EqIgnoreSpan, FileName, Mark, + SourceMap, +}; use swc_ecma_ast::*; -use swc_ecma_codegen::text_writer::JsWriter; -use swc_ecma_codegen::Emitter; -use swc_ecma_minifier::optimize; -use swc_ecma_minifier::option::terser::TerserCompressorOptions; -use swc_ecma_minifier::option::CompressOptions; -use swc_ecma_minifier::option::ExtraOptions; -use swc_ecma_minifier::option::MangleOptions; -use swc_ecma_minifier::option::MinifyOptions; -use swc_ecma_parser::lexer::input::SourceFileInput; -use swc_ecma_parser::lexer::Lexer; -use swc_ecma_parser::Parser; -use swc_ecma_transforms::fixer; -use swc_ecma_transforms::hygiene; -use swc_ecma_transforms::resolver_with_mark; +use swc_ecma_codegen::{text_writer::JsWriter, Emitter}; +use swc_ecma_minifier::{ + optimize, + option::{ + terser::TerserCompressorOptions, CompressOptions, ExtraOptions, MangleOptions, + MinifyOptions, + }, +}; +use swc_ecma_parser::{ + lexer::{input::SourceFileInput, Lexer}, + Parser, +}; +use swc_ecma_transforms::{fixer, hygiene, resolver_with_mark}; use swc_ecma_utils::drop_span; use swc_ecma_visit::FoldWith; -use testing::assert_eq; -use testing::DebugUsingDisplay; -use testing::NormalizedOutput; +use testing::{assert_eq, DebugUsingDisplay, NormalizedOutput}; fn load_txt(filename: &str) -> Vec { let lines = read_to_string(filename).unwrap(); diff --git a/ecmascript/minifier/tests/hygiene.rs b/ecmascript/minifier/tests/hygiene.rs index 236ac7aa9930..14b21d77996c 100644 --- a/ecmascript/minifier/tests/hygiene.rs +++ b/ecmascript/minifier/tests/hygiene.rs @@ -1,17 +1,12 @@ use std::path::PathBuf; -use swc_common::sync::Lrc; -use swc_common::SourceMap; -use swc_common::{input::SourceFileInput, Mark}; -use swc_ecma_codegen::text_writer::JsWriter; -use swc_ecma_codegen::Emitter; +use swc_common::{input::SourceFileInput, sync::Lrc, Mark, SourceMap}; +use swc_ecma_codegen::{text_writer::JsWriter, Emitter}; use swc_ecma_minifier::optimize_hygiene; use swc_ecma_parser::{lexer::Lexer, Parser}; use swc_ecma_transforms::{fixer, hygiene, resolver_with_mark}; use swc_ecma_utils::drop_span; use swc_ecma_visit::FoldWith; -use testing::assert_eq; -use testing::run_test2; -use testing::DebugUsingDisplay; +use testing::{assert_eq, run_test2, DebugUsingDisplay}; #[testing::fixture("tests/hygiene/identical/**/*.js")] fn identical(input: PathBuf) { diff --git a/ecmascript/minifier/tests/mangle.rs b/ecmascript/minifier/tests/mangle.rs index ba917197f7d8..7a4fff3f7d3c 100644 --- a/ecmascript/minifier/tests/mangle.rs +++ b/ecmascript/minifier/tests/mangle.rs @@ -1,23 +1,24 @@ use ansi_term::Color; use anyhow::{bail, Context, Error}; -use std::fs::read_to_string; -use std::path::{Path, PathBuf}; -use std::process::Command; -use swc_common::comments::SingleThreadedComments; -use swc_common::errors::Handler; -use swc_common::{input::SourceFileInput, sync::Lrc}; -use swc_common::{FileName, Mark, SourceFile, SourceMap}; +use std::{ + fs::read_to_string, + path::{Path, PathBuf}, + process::Command, +}; +use swc_common::{ + comments::SingleThreadedComments, errors::Handler, input::SourceFileInput, sync::Lrc, FileName, + Mark, SourceFile, SourceMap, +}; use swc_ecma_ast::*; use swc_ecma_codegen::{ text_writer::{omit_trailing_semi, JsWriter, WriteJs}, Emitter, }; -use swc_ecma_minifier::optimize; -use swc_ecma_minifier::option::{ - ExtraOptions, MangleOptions, ManglePropertiesOptions, MinifyOptions, +use swc_ecma_minifier::{ + optimize, + option::{ExtraOptions, MangleOptions, ManglePropertiesOptions, MinifyOptions}, }; -use swc_ecma_parser::lexer::Lexer; -use swc_ecma_parser::Parser; +use swc_ecma_parser::{lexer::Lexer, Parser}; use swc_ecma_transforms::{fixer, hygiene, resolver_with_mark}; use swc_ecma_visit::FoldWith; use testing::DebugUsingDisplay; diff --git a/ecmascript/parser/benches/parser.rs b/ecmascript/parser/benches/parser.rs index 1c6b87ab8bfa..73236a5095ea 100644 --- a/ecmascript/parser/benches/parser.rs +++ b/ecmascript/parser/benches/parser.rs @@ -2,8 +2,7 @@ extern crate test; -use swc_common::comments::SingleThreadedComments; -use swc_common::FileName; +use swc_common::{comments::SingleThreadedComments, FileName}; use swc_ecma_parser::{lexer::Lexer, Parser, StringInput, Syntax}; use test::Bencher; diff --git a/ecmascript/parser/src/parser/class_and_fn.rs b/ecmascript/parser/src/parser/class_and_fn.rs index ffd0f32cdc8c..313336da541b 100644 --- a/ecmascript/parser/src/parser/class_and_fn.rs +++ b/ecmascript/parser/src/parser/class_and_fn.rs @@ -1,6 +1,5 @@ use super::{ident::MaybeOptionalIdentParser, *}; -use crate::lexer::TokenContext; -use crate::{error::SyntaxError, Tokens}; +use crate::{error::SyntaxError, lexer::TokenContext, Tokens}; use either::Either; use swc_atoms::js_word; use swc_common::{Spanned, SyntaxContext}; diff --git a/ecmascript/parser/src/parser/pat.rs b/ecmascript/parser/src/parser/pat.rs index 6427c44f3d3c..ed4819646667 100644 --- a/ecmascript/parser/src/parser/pat.rs +++ b/ecmascript/parser/src/parser/pat.rs @@ -1,7 +1,9 @@ //! 13.3.3 Destructuring Binding Patterns use super::{util::ExprExt, *}; -use crate::parser::class_and_fn::is_not_this; -use crate::{parser::expr::PatOrExprOrSpread, token::AssignOpToken}; +use crate::{ + parser::{class_and_fn::is_not_this, expr::PatOrExprOrSpread}, + token::AssignOpToken, +}; use std::iter; use swc_atoms::js_word; use swc_common::Spanned; diff --git a/ecmascript/parser/tests/comments.rs b/ecmascript/parser/tests/comments.rs index 831c3807b75b..881e0a35b7b1 100644 --- a/ecmascript/parser/tests/comments.rs +++ b/ecmascript/parser/tests/comments.rs @@ -1,22 +1,14 @@ use std::path::PathBuf; -use swc_common::comments::SingleThreadedComments; -use swc_common::errors::DiagnosticBuilder; -use swc_common::errors::Handler; -use swc_common::input::SourceFileInput; -use swc_common::BytePos; -use swc_common::Span; -use swc_common::DUMMY_SP; +use swc_common::{ + comments::SingleThreadedComments, + errors::{DiagnosticBuilder, Handler}, + input::SourceFileInput, + BytePos, Span, DUMMY_SP, +}; use swc_ecma_ast::*; -use swc_ecma_parser::lexer::Lexer; -use swc_ecma_parser::EsConfig; -use swc_ecma_parser::Parser; -use swc_ecma_parser::Syntax; -use swc_ecma_parser::TsConfig; -use swc_ecma_visit::Node; -use swc_ecma_visit::Visit; -use swc_ecma_visit::VisitWith; -use testing::fixture; -use testing::Tester; +use swc_ecma_parser::{lexer::Lexer, EsConfig, Parser, Syntax, TsConfig}; +use swc_ecma_visit::{Node, Visit, VisitWith}; +use testing::{fixture, Tester}; #[fixture("tests/comments/**/input.js")] #[fixture("tests/comments/**/input.ts")] diff --git a/ecmascript/preset-env/src/corejs3/entry.rs b/ecmascript/preset-env/src/corejs3/entry.rs index 1f86904c8982..521e4451cef7 100644 --- a/ecmascript/preset-env/src/corejs3/entry.rs +++ b/ecmascript/preset-env/src/corejs3/entry.rs @@ -1,7 +1,6 @@ use super::compat::DATA as CORE_JS_COMPAT_DATA; use crate::{version::should_enable, Version, Versions}; -use fxhash::FxBuildHasher; -use fxhash::FxHashMap; +use fxhash::{FxBuildHasher, FxHashMap}; use indexmap::IndexSet; use once_cell::sync::Lazy; use swc_atoms::js_word; diff --git a/ecmascript/preset-env/tests/test.rs b/ecmascript/preset-env/tests/test.rs index d1b18a48f742..e0d531074098 100644 --- a/ecmascript/preset-env/tests/test.rs +++ b/ecmascript/preset-env/tests/test.rs @@ -20,12 +20,9 @@ use swc_ecma_codegen::Emitter; use swc_ecma_parser::{EsConfig, Parser, Syntax}; use swc_ecma_preset_env::{preset_env, Config, FeatureOrModule, Mode, Targets, Version}; use swc_ecma_utils::drop_span; -use swc_ecma_visit::as_folder; -use swc_ecma_visit::FoldWith; -use swc_ecma_visit::VisitMut; +use swc_ecma_visit::{as_folder, FoldWith, VisitMut}; use test::{test_main, ShouldPanic, TestDesc, TestDescAndFn, TestFn, TestName, TestType}; -use testing::NormalizedOutput; -use testing::Tester; +use testing::{NormalizedOutput, Tester}; use walkdir::WalkDir; /// options.json file diff --git a/ecmascript/transforms/base/src/hygiene/mod.rs b/ecmascript/transforms/base/src/hygiene/mod.rs index 63485d1d973b..92f72e13d25f 100644 --- a/ecmascript/transforms/base/src/hygiene/mod.rs +++ b/ecmascript/transforms/base/src/hygiene/mod.rs @@ -1,15 +1,13 @@ use self::ops::{Operations, Operator}; -use crate::ext::MapWithMut; -use crate::native::is_native; -use crate::native::is_native_word; -use crate::scope::IdentType; -use crate::scope::ScopeKind; +use crate::{ + ext::MapWithMut, + native::{is_native, is_native_word}, + scope::{IdentType, ScopeKind}, +}; use fxhash::{FxHashMap, FxHashSet}; use smallvec::{smallvec, SmallVec}; -use std::cell::RefCell; -use std::collections::HashMap; -use swc_atoms::js_word; -use swc_atoms::JsWord; +use std::{cell::RefCell, collections::HashMap}; +use swc_atoms::{js_word, JsWord}; use swc_common::{chain, SyntaxContext}; use swc_ecma_ast::*; use swc_ecma_utils::ident::IdentLike; diff --git a/ecmascript/transforms/base/src/hygiene/tests.rs b/ecmascript/transforms/base/src/hygiene/tests.rs index d5447c45dea1..0f30a0810406 100644 --- a/ecmascript/transforms/base/src/hygiene/tests.rs +++ b/ecmascript/transforms/base/src/hygiene/tests.rs @@ -1,6 +1,5 @@ use super::*; -use crate::tests::HygieneVisualizer; -use crate::tests::Tester; +use crate::tests::{HygieneVisualizer, Tester}; use std::collections::HashMap; use swc_common::{hygiene::*, DUMMY_SP}; use swc_ecma_parser::Syntax; diff --git a/ecmascript/transforms/base/src/quote.rs b/ecmascript/transforms/base/src/quote.rs index a048e4a4523c..560bf5cc5ca2 100644 --- a/ecmascript/transforms/base/src/quote.rs +++ b/ecmascript/transforms/base/src/quote.rs @@ -25,8 +25,7 @@ macro_rules! helper_expr { }}; ($span:expr, $field_name:ident, $s:tt) => {{ - use swc_ecma_utils::quote_ident; - use swc_ecma_utils::ExprFactory; + use swc_ecma_utils::{quote_ident, ExprFactory}; debug_assert!( !$s.starts_with("_"), diff --git a/ecmascript/transforms/base/src/tests.rs b/ecmascript/transforms/base/src/tests.rs index 01a27ee1e2df..ebb32773c429 100644 --- a/ecmascript/transforms/base/src/tests.rs +++ b/ecmascript/transforms/base/src/tests.rs @@ -1,6 +1,4 @@ -use crate::fixer::fixer; -use crate::helpers::HELPERS; -use crate::hygiene::hygiene_with_config; +use crate::{fixer::fixer, helpers::HELPERS, hygiene::hygiene_with_config}; use swc_common::{ comments::SingleThreadedComments, errors::Handler, sync::Lrc, FileName, SourceMap, }; diff --git a/ecmascript/transforms/base/tests/fixture.rs b/ecmascript/transforms/base/tests/fixture.rs index 37e98dcadc06..cc4c6f1db486 100644 --- a/ecmascript/transforms/base/tests/fixture.rs +++ b/ecmascript/transforms/base/tests/fixture.rs @@ -1,23 +1,15 @@ use std::path::{Path, PathBuf}; -use swc_common::chain; -use swc_common::sync::Lrc; -use swc_common::Mark; -use swc_common::SourceMap; -use swc_common::SyntaxContext; +use swc_common::{chain, sync::Lrc, Mark, SourceMap, SyntaxContext}; use swc_ecma_ast::*; use swc_ecma_codegen::Emitter; use swc_ecma_parser::{lexer::Lexer, Parser, StringInput, Syntax}; -use swc_ecma_transforms_base::fixer::fixer; -use swc_ecma_transforms_base::hygiene::hygiene; -use swc_ecma_transforms_base::resolver::resolver; -use swc_ecma_transforms_base::resolver::ts_resolver; -use swc_ecma_visit::as_folder; -use swc_ecma_visit::Fold; -use swc_ecma_visit::FoldWith; -use swc_ecma_visit::VisitMut; -use swc_ecma_visit::VisitMutWith; -use testing::NormalizedOutput; -use testing::{fixture, run_test2}; +use swc_ecma_transforms_base::{ + fixer::fixer, + hygiene::hygiene, + resolver::{resolver, ts_resolver}, +}; +use swc_ecma_visit::{as_folder, Fold, FoldWith, VisitMut, VisitMutWith}; +use testing::{fixture, run_test2, NormalizedOutput}; pub fn print(cm: Lrc, module: &Module) -> String { let mut buf = vec![]; diff --git a/ecmascript/transforms/base/tests/ts_resolver.rs b/ecmascript/transforms/base/tests/ts_resolver.rs index f001f738c080..a22220683aa1 100644 --- a/ecmascript/transforms/base/tests/ts_resolver.rs +++ b/ecmascript/transforms/base/tests/ts_resolver.rs @@ -1,18 +1,9 @@ use std::path::PathBuf; -use swc_common::input::SourceFileInput; -use swc_common::Mark; -use swc_common::SyntaxContext; -use swc_common::DUMMY_SP; +use swc_common::{input::SourceFileInput, Mark, SyntaxContext, DUMMY_SP}; use swc_ecma_ast::*; -use swc_ecma_parser::lexer::Lexer; -use swc_ecma_parser::Parser; -use swc_ecma_parser::Syntax; -use swc_ecma_parser::TsConfig; +use swc_ecma_parser::{lexer::Lexer, Parser, Syntax, TsConfig}; use swc_ecma_transforms_base::resolver::ts_resolver; -use swc_ecma_visit::FoldWith; -use swc_ecma_visit::Node; -use swc_ecma_visit::Visit; -use swc_ecma_visit::VisitWith; +use swc_ecma_visit::{FoldWith, Node, Visit, VisitWith}; use testing::fixture; #[fixture("../../parser/tests/typescript/**/*.ts")] diff --git a/ecmascript/transforms/classes/src/super_field.rs b/ecmascript/transforms/classes/src/super_field.rs index 6b74e4e4a516..e23d77cef739 100644 --- a/ecmascript/transforms/classes/src/super_field.rs +++ b/ecmascript/transforms/classes/src/super_field.rs @@ -4,10 +4,7 @@ use swc_atoms::js_word; use swc_common::{Mark, Span, DUMMY_SP}; use swc_ecma_ast::*; use swc_ecma_transforms_base::helper; -use swc_ecma_utils::alias_ident_for; -use swc_ecma_utils::is_rest_arguments; -use swc_ecma_utils::quote_ident; -use swc_ecma_utils::ExprFactory; +use swc_ecma_utils::{alias_ident_for, is_rest_arguments, quote_ident, ExprFactory}; use swc_ecma_visit::{noop_fold_type, Fold, FoldWith}; /// Process function body. diff --git a/ecmascript/transforms/compat/src/bugfixes/mod.rs b/ecmascript/transforms/compat/src/bugfixes/mod.rs index 320594f05961..a57c01bb7417 100644 --- a/ecmascript/transforms/compat/src/bugfixes/mod.rs +++ b/ecmascript/transforms/compat/src/bugfixes/mod.rs @@ -1,6 +1,7 @@ -pub use self::async_arrows_in_class::async_arrows_in_class; -pub use self::edge_default_param::edge_default_param; -pub use self::template_literal_caching::template_literal_caching; +pub use self::{ + async_arrows_in_class::async_arrows_in_class, edge_default_param::edge_default_param, + template_literal_caching::template_literal_caching, +}; use swc_common::chain; use swc_ecma_visit::Fold; diff --git a/ecmascript/transforms/compat/src/es2015/arrow.rs b/ecmascript/transforms/compat/src/es2015/arrow.rs index 4d921576e834..6fbd8814b5eb 100644 --- a/ecmascript/transforms/compat/src/es2015/arrow.rs +++ b/ecmascript/transforms/compat/src/es2015/arrow.rs @@ -3,11 +3,8 @@ use swc_common::{Spanned, DUMMY_SP}; use swc_ecma_ast::*; use swc_ecma_transforms_base::perf::Check; use swc_ecma_transforms_macros::fast_path; -use swc_ecma_utils::quote_ident; -use swc_ecma_utils::ExprFactory; -use swc_ecma_utils::{contains_this_expr, private_ident}; -use swc_ecma_visit::noop_visit_type; -use swc_ecma_visit::{noop_fold_type, Fold, FoldWith, Node, Visit}; +use swc_ecma_utils::{contains_this_expr, private_ident, quote_ident, ExprFactory}; +use swc_ecma_visit::{noop_fold_type, noop_visit_type, Fold, FoldWith, Node, Visit}; /// Compile ES2015 arrow functions to ES5 /// diff --git a/ecmascript/transforms/compat/src/es2015/block_scoped_fn.rs b/ecmascript/transforms/compat/src/es2015/block_scoped_fn.rs index 16de45e4d648..3c19c33948fa 100644 --- a/ecmascript/transforms/compat/src/es2015/block_scoped_fn.rs +++ b/ecmascript/transforms/compat/src/es2015/block_scoped_fn.rs @@ -3,11 +3,7 @@ use swc_ecma_ast::*; use swc_ecma_transforms_base::perf::Check; use swc_ecma_transforms_macros::fast_path; use swc_ecma_utils::UsageFinder; -use swc_ecma_visit::noop_visit_type; -use swc_ecma_visit::Node; -use swc_ecma_visit::Visit; -use swc_ecma_visit::VisitWith; -use swc_ecma_visit::{noop_fold_type, Fold, FoldWith}; +use swc_ecma_visit::{noop_fold_type, noop_visit_type, Fold, FoldWith, Node, Visit, VisitWith}; pub fn block_scoped_functions() -> impl Fold { BlockScopedFns diff --git a/ecmascript/transforms/compat/src/es2015/block_scoping.rs b/ecmascript/transforms/compat/src/es2015/block_scoping.rs index 6d19ddf3bdaa..e9012eb93402 100644 --- a/ecmascript/transforms/compat/src/es2015/block_scoping.rs +++ b/ecmascript/transforms/compat/src/es2015/block_scoping.rs @@ -1,22 +1,19 @@ use smallvec::SmallVec; -use std::mem::take; -use std::{collections::HashMap, mem::replace}; +use std::{ + collections::HashMap, + mem::{replace, take}, +}; use swc_atoms::js_word; use swc_common::{util::map::Map, Mark, Spanned, SyntaxContext, DUMMY_SP}; use swc_ecma_ast::*; use swc_ecma_transforms_base::helper; -use swc_ecma_utils::private_ident; -use swc_ecma_utils::quote_ident; -use swc_ecma_utils::quote_str; -use swc_ecma_utils::undefined; use swc_ecma_utils::{ - contains_arguments, contains_this_expr, find_ids, ident::IdentLike, prepend, var::VarCollector, - ExprFactory, Id, StmtLike, + contains_arguments, contains_this_expr, find_ids, ident::IdentLike, prepend, private_ident, + quote_ident, quote_str, undefined, var::VarCollector, ExprFactory, Id, StmtLike, }; -use swc_ecma_visit::noop_visit_type; use swc_ecma_visit::{ - noop_fold_type, noop_visit_mut_type, Fold, FoldWith, Node, Visit, VisitMut, VisitMutWith, - VisitWith, + noop_fold_type, noop_visit_mut_type, noop_visit_type, Fold, FoldWith, Node, Visit, VisitMut, + VisitMutWith, VisitWith, }; /// diff --git a/ecmascript/transforms/compat/src/es2015/classes/constructor.rs b/ecmascript/transforms/compat/src/es2015/classes/constructor.rs index ddb4972412ad..e24691c0d4be 100644 --- a/ecmascript/transforms/compat/src/es2015/classes/constructor.rs +++ b/ecmascript/transforms/compat/src/es2015/classes/constructor.rs @@ -3,12 +3,9 @@ use swc_atoms::JsWord; use swc_common::{Mark, DUMMY_SP}; use swc_ecma_ast::*; use swc_ecma_transforms_base::helper; -use swc_ecma_transforms_classes::fold_only_key; -use swc_ecma_transforms_classes::get_prototype_of; -use swc_ecma_utils::quote_ident; -use swc_ecma_utils::ExprFactory; -use swc_ecma_visit::noop_visit_type; -use swc_ecma_visit::{noop_fold_type, Fold, FoldWith, Node, Visit, VisitWith}; +use swc_ecma_transforms_classes::{fold_only_key, get_prototype_of}; +use swc_ecma_utils::{quote_ident, ExprFactory}; +use swc_ecma_visit::{noop_fold_type, noop_visit_type, Fold, FoldWith, Node, Visit, VisitWith}; pub(super) struct SuperCallFinder { mode: Option, diff --git a/ecmascript/transforms/compat/src/es2015/classes/mod.rs b/ecmascript/transforms/compat/src/es2015/classes/mod.rs index 8d9992963a13..3e1814bea46e 100644 --- a/ecmascript/transforms/compat/src/es2015/classes/mod.rs +++ b/ecmascript/transforms/compat/src/es2015/classes/mod.rs @@ -7,23 +7,16 @@ use self::{ }; use fxhash::FxBuildHasher; use std::iter; -use swc_common::comments::Comments; -use swc_common::{Mark, Spanned, DUMMY_SP}; +use swc_common::{comments::Comments, Mark, Spanned, DUMMY_SP}; use swc_ecma_ast::*; -use swc_ecma_transforms_base::helper; -use swc_ecma_transforms_base::native::is_native; -use swc_ecma_transforms_base::perf::Check; +use swc_ecma_transforms_base::{helper, native::is_native, perf::Check}; use swc_ecma_transforms_classes::super_field::SuperFieldAccessFolder; use swc_ecma_transforms_macros::fast_path; -use swc_ecma_utils::quote_expr; -use swc_ecma_utils::quote_str; use swc_ecma_utils::{ - alias_if_required, default_constructor, prepend, prop_name_to_expr, ExprFactory, IsDirective, - ModuleItemLike, StmtLike, + alias_if_required, default_constructor, prepend, private_ident, prop_name_to_expr, quote_expr, + quote_ident, quote_str, ExprFactory, IsDirective, ModuleItemLike, StmtLike, }; -use swc_ecma_utils::{private_ident, quote_ident}; -use swc_ecma_visit::noop_visit_type; -use swc_ecma_visit::{noop_fold_type, Fold, FoldWith, Node, Visit, VisitWith}; +use swc_ecma_visit::{noop_fold_type, noop_visit_type, Fold, FoldWith, Node, Visit, VisitWith}; mod constructor; mod prop_name; diff --git a/ecmascript/transforms/compat/src/es2015/computed_props.rs b/ecmascript/transforms/compat/src/es2015/computed_props.rs index 6589fa159920..45241ccaa91f 100644 --- a/ecmascript/transforms/compat/src/es2015/computed_props.rs +++ b/ecmascript/transforms/compat/src/es2015/computed_props.rs @@ -1,11 +1,8 @@ use swc_common::{Mark, Spanned, DUMMY_SP}; use swc_ecma_ast::*; use swc_ecma_transforms_base::helper; -use swc_ecma_utils::quote_ident; -use swc_ecma_utils::ExprFactory; -use swc_ecma_utils::StmtLike; -use swc_ecma_visit::noop_visit_type; -use swc_ecma_visit::{noop_fold_type, Fold, FoldWith, Node, Visit, VisitWith}; +use swc_ecma_utils::{quote_ident, ExprFactory, StmtLike}; +use swc_ecma_visit::{noop_fold_type, noop_visit_type, Fold, FoldWith, Node, Visit, VisitWith}; /// `@babel/plugin-transform-computed-properties` /// diff --git a/ecmascript/transforms/compat/src/es2015/destructuring.rs b/ecmascript/transforms/compat/src/es2015/destructuring.rs index 76ea8b511f2c..d5eb1c584198 100644 --- a/ecmascript/transforms/compat/src/es2015/destructuring.rs +++ b/ecmascript/transforms/compat/src/es2015/destructuring.rs @@ -2,21 +2,13 @@ use serde::Deserialize; use std::iter; use swc_common::{Spanned, SyntaxContext, DUMMY_SP}; use swc_ecma_ast::*; -use swc_ecma_transforms_base::helper; -use swc_ecma_transforms_base::perf::Check; +use swc_ecma_transforms_base::{helper, perf::Check}; use swc_ecma_transforms_macros::fast_path; -use swc_ecma_utils::alias_ident_for; -use swc_ecma_utils::alias_if_required; -use swc_ecma_utils::has_rest_pat; -use swc_ecma_utils::is_literal; -use swc_ecma_utils::private_ident; -use swc_ecma_utils::prop_name_to_expr; -use swc_ecma_utils::quote_ident; -use swc_ecma_utils::undefined; -use swc_ecma_utils::ExprFactory; -use swc_ecma_utils::StmtLike; -use swc_ecma_visit::noop_visit_type; -use swc_ecma_visit::{noop_fold_type, Fold, FoldWith, Node, Visit, VisitWith}; +use swc_ecma_utils::{ + alias_ident_for, alias_if_required, has_rest_pat, is_literal, private_ident, prop_name_to_expr, + quote_ident, undefined, ExprFactory, StmtLike, +}; +use swc_ecma_visit::{noop_fold_type, noop_visit_type, Fold, FoldWith, Node, Visit, VisitWith}; /// `@babel/plugin-transform-destructuring` /// diff --git a/ecmascript/transforms/compat/src/es2015/for_of.rs b/ecmascript/transforms/compat/src/es2015/for_of.rs index d72c3730417a..f8264fe454dd 100644 --- a/ecmascript/transforms/compat/src/es2015/for_of.rs +++ b/ecmascript/transforms/compat/src/es2015/for_of.rs @@ -2,15 +2,10 @@ use serde::Deserialize; use swc_atoms::js_word; use swc_common::{Mark, Spanned, DUMMY_SP}; use swc_ecma_ast::*; -use swc_ecma_utils::alias_if_required; -use swc_ecma_utils::member_expr; -use swc_ecma_utils::prepend; -use swc_ecma_utils::private_ident; -use swc_ecma_utils::quote_ident; -use swc_ecma_utils::ExprFactory; -use swc_ecma_utils::StmtLike; -use swc_ecma_visit::noop_visit_type; -use swc_ecma_visit::{noop_fold_type, Fold, FoldWith, Node, Visit, VisitWith}; +use swc_ecma_utils::{ + alias_if_required, member_expr, prepend, private_ident, quote_ident, ExprFactory, StmtLike, +}; +use swc_ecma_visit::{noop_fold_type, noop_visit_type, Fold, FoldWith, Node, Visit, VisitWith}; /// `@babel/plugin-transform-for-of` /// diff --git a/ecmascript/transforms/compat/src/es2015/function_name.rs b/ecmascript/transforms/compat/src/es2015/function_name.rs index dfbf91d585ff..b2e4c30b64f7 100644 --- a/ecmascript/transforms/compat/src/es2015/function_name.rs +++ b/ecmascript/transforms/compat/src/es2015/function_name.rs @@ -1,10 +1,7 @@ use swc_ecma_ast::*; use swc_ecma_transforms_base::ext::PatOrExprExt; -use swc_ecma_utils::private_ident; -use swc_ecma_utils::UsageFinder; -use swc_ecma_visit::noop_fold_type; -use swc_ecma_visit::Fold; -use swc_ecma_visit::FoldWith; +use swc_ecma_utils::{private_ident, UsageFinder}; +use swc_ecma_visit::{noop_fold_type, Fold, FoldWith}; /// `@babel/plugin-transform-function-name` /// diff --git a/ecmascript/transforms/compat/src/es2015/instanceof.rs b/ecmascript/transforms/compat/src/es2015/instanceof.rs index 03d06fdb2680..0e9c9cd1b567 100644 --- a/ecmascript/transforms/compat/src/es2015/instanceof.rs +++ b/ecmascript/transforms/compat/src/es2015/instanceof.rs @@ -1,10 +1,8 @@ use swc_ecma_ast::*; -use swc_ecma_transforms_base::helper; -use swc_ecma_transforms_base::perf::Check; +use swc_ecma_transforms_base::{helper, perf::Check}; use swc_ecma_transforms_macros::fast_path; use swc_ecma_utils::ExprFactory; -use swc_ecma_visit::noop_visit_type; -use swc_ecma_visit::{noop_fold_type, Fold, FoldWith, Node, Visit, VisitWith}; +use swc_ecma_visit::{noop_fold_type, noop_visit_type, Fold, FoldWith, Node, Visit, VisitWith}; /// `@babel/plugin-transform-instanceof` /// diff --git a/ecmascript/transforms/compat/src/es2015/mod.rs b/ecmascript/transforms/compat/src/es2015/mod.rs index 2ed0a0a43f06..7e0418022aef 100644 --- a/ecmascript/transforms/compat/src/es2015/mod.rs +++ b/ecmascript/transforms/compat/src/es2015/mod.rs @@ -79,8 +79,7 @@ mod tests { use super::*; use swc_common::Mark; use swc_ecma_transforms_base::resolver::resolver; - use swc_ecma_transforms_testing::test; - use swc_ecma_transforms_testing::test_exec; + use swc_ecma_transforms_testing::{test, test_exec}; test!( ::swc_ecma_parser::Syntax::default(), diff --git a/ecmascript/transforms/compat/src/es2015/parameters.rs b/ecmascript/transforms/compat/src/es2015/parameters.rs index 7391c50c5984..adb1bcd4838c 100644 --- a/ecmascript/transforms/compat/src/es2015/parameters.rs +++ b/ecmascript/transforms/compat/src/es2015/parameters.rs @@ -2,17 +2,11 @@ use arrayvec::ArrayVec; use swc_common::{Mark, Spanned, DUMMY_SP}; use swc_ecma_ast::*; use swc_ecma_transforms_base::ext::MapWithMut; -use swc_ecma_utils::contains_this_expr; -use swc_ecma_utils::member_expr; -use swc_ecma_utils::prepend; -use swc_ecma_utils::prepend_stmts; -use swc_ecma_utils::private_ident; -use swc_ecma_utils::quote_ident; -use swc_ecma_utils::ExprFactory; -use swc_ecma_visit::noop_visit_mut_type; -use swc_ecma_visit::VisitMut; -use swc_ecma_visit::VisitMutWith; -use swc_ecma_visit::{noop_fold_type, Fold, FoldWith}; +use swc_ecma_utils::{ + contains_this_expr, member_expr, prepend, prepend_stmts, private_ident, quote_ident, + ExprFactory, +}; +use swc_ecma_visit::{noop_fold_type, noop_visit_mut_type, Fold, FoldWith, VisitMut, VisitMutWith}; pub fn parameters() -> impl 'static + Fold { Params::default() diff --git a/ecmascript/transforms/compat/src/es2015/regenerator/case.rs b/ecmascript/transforms/compat/src/es2015/regenerator/case.rs index ed852672922a..730c97a7e274 100644 --- a/ecmascript/transforms/compat/src/es2015/regenerator/case.rs +++ b/ecmascript/transforms/compat/src/es2015/regenerator/case.rs @@ -1,5 +1,4 @@ -use super::leap::{CatchEntry, FinallyEntry, TryEntry}; -use super::leap::{Entry, LeapManager}; +use super::leap::{CatchEntry, Entry, FinallyEntry, LeapManager, TryEntry}; use smallvec::SmallVec; use std::mem::replace; use swc_atoms::JsWord; @@ -8,14 +7,10 @@ use swc_common::{ BytePos, Span, Spanned, SyntaxContext, DUMMY_SP, }; use swc_ecma_ast::*; -use swc_ecma_utils::ident::IdentLike; -use swc_ecma_utils::member_expr; -use swc_ecma_utils::quote_ident; -use swc_ecma_utils::quote_str; -use swc_ecma_utils::undefined; -use swc_ecma_utils::ExprFactory; -use swc_ecma_visit::noop_visit_type; -use swc_ecma_visit::{noop_fold_type, Fold, FoldWith, Node, Visit, VisitWith}; +use swc_ecma_utils::{ + ident::IdentLike, member_expr, quote_ident, quote_str, undefined, ExprFactory, +}; +use swc_ecma_visit::{noop_fold_type, noop_visit_type, Fold, FoldWith, Node, Visit, VisitWith}; #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub(super) struct Loc { diff --git a/ecmascript/transforms/compat/src/es2015/regenerator/hoist.rs b/ecmascript/transforms/compat/src/es2015/regenerator/hoist.rs index 633a4f636967..4bceb4e90a54 100644 --- a/ecmascript/transforms/compat/src/es2015/regenerator/hoist.rs +++ b/ecmascript/transforms/compat/src/es2015/regenerator/hoist.rs @@ -2,8 +2,7 @@ use smallvec::SmallVec; use swc_atoms::js_word; use swc_common::DUMMY_SP; use swc_ecma_ast::*; -use swc_ecma_utils::find_ids; -use swc_ecma_utils::private_ident; +use swc_ecma_utils::{find_ids, private_ident}; use swc_ecma_visit::{noop_fold_type, Fold, FoldWith}; pub(super) type Vars = SmallVec<[Ident; 32]>; diff --git a/ecmascript/transforms/compat/src/es2015/regenerator/mod.rs b/ecmascript/transforms/compat/src/es2015/regenerator/mod.rs index 68e155d520d4..c016cd3dc513 100644 --- a/ecmascript/transforms/compat/src/es2015/regenerator/mod.rs +++ b/ecmascript/transforms/compat/src/es2015/regenerator/mod.rs @@ -3,15 +3,10 @@ use std::mem::take; use swc_atoms::js_word; use swc_common::{Mark, Spanned, DUMMY_SP}; use swc_ecma_ast::*; -use swc_ecma_utils::contains_this_expr; -use swc_ecma_utils::prepend; -use swc_ecma_utils::private_ident; -use swc_ecma_utils::quote_ident; -use swc_ecma_utils::quote_str; -use swc_ecma_utils::ExprFactory; -use swc_ecma_utils::StmtLike; -use swc_ecma_visit::noop_visit_type; -use swc_ecma_visit::{noop_fold_type, Fold, FoldWith, Node, Visit, VisitWith}; +use swc_ecma_utils::{ + contains_this_expr, prepend, private_ident, quote_ident, quote_str, ExprFactory, StmtLike, +}; +use swc_ecma_visit::{noop_fold_type, noop_visit_type, Fold, FoldWith, Node, Visit, VisitWith}; mod case; mod hoist; diff --git a/ecmascript/transforms/compat/src/es2015/shorthand_property.rs b/ecmascript/transforms/compat/src/es2015/shorthand_property.rs index b92be3f6d889..007fc3461a09 100644 --- a/ecmascript/transforms/compat/src/es2015/shorthand_property.rs +++ b/ecmascript/transforms/compat/src/es2015/shorthand_property.rs @@ -2,11 +2,7 @@ use swc_ecma_ast::*; use swc_ecma_transforms_base::perf::Check; use swc_ecma_transforms_macros::fast_path; use swc_ecma_utils::quote_ident; -use swc_ecma_visit::noop_visit_type; -use swc_ecma_visit::Node; -use swc_ecma_visit::Visit; -use swc_ecma_visit::VisitWith; -use swc_ecma_visit::{noop_fold_type, Fold, FoldWith}; +use swc_ecma_visit::{noop_fold_type, noop_visit_type, Fold, FoldWith, Node, Visit, VisitWith}; /// Compile ES2015 shorthand properties to ES5 /// diff --git a/ecmascript/transforms/compat/src/es2015/spread.rs b/ecmascript/transforms/compat/src/es2015/spread.rs index 25fbbaa5a7d9..2ecbcb6eb687 100644 --- a/ecmascript/transforms/compat/src/es2015/spread.rs +++ b/ecmascript/transforms/compat/src/es2015/spread.rs @@ -3,23 +3,13 @@ use std::mem; use swc_atoms::js_word; use swc_common::{util::move_map::MoveMap, Span, Spanned, DUMMY_SP}; use swc_ecma_ast::*; -use swc_ecma_transforms_base::ext::ExprRefExt; -use swc_ecma_transforms_base::helper; -use swc_ecma_transforms_base::perf::Check; +use swc_ecma_transforms_base::{ext::ExprRefExt, helper, perf::Check}; use swc_ecma_transforms_macros::fast_path; -use swc_ecma_utils::alias_ident_for; -use swc_ecma_utils::is_literal; -use swc_ecma_utils::member_expr; -use swc_ecma_utils::prepend; -use swc_ecma_utils::quote_ident; -use swc_ecma_utils::undefined; -use swc_ecma_utils::ExprFactory; -use swc_ecma_utils::StmtLike; -use swc_ecma_visit::noop_visit_type; -use swc_ecma_visit::Node; -use swc_ecma_visit::Visit; -use swc_ecma_visit::VisitWith; -use swc_ecma_visit::{noop_fold_type, Fold, FoldWith}; +use swc_ecma_utils::{ + alias_ident_for, is_literal, member_expr, prepend, quote_ident, undefined, ExprFactory, + StmtLike, +}; +use swc_ecma_visit::{noop_fold_type, noop_visit_type, Fold, FoldWith, Node, Visit, VisitWith}; pub fn spread(c: Config) -> impl Fold { Spread { c } diff --git a/ecmascript/transforms/compat/src/es2015/sticky_regex.rs b/ecmascript/transforms/compat/src/es2015/sticky_regex.rs index a48446719806..71dec9c1b6ab 100644 --- a/ecmascript/transforms/compat/src/es2015/sticky_regex.rs +++ b/ecmascript/transforms/compat/src/es2015/sticky_regex.rs @@ -3,12 +3,8 @@ use swc_common::DUMMY_SP; use swc_ecma_ast::*; use swc_ecma_transforms_base::perf::Check; use swc_ecma_transforms_macros::fast_path; -use swc_ecma_utils::quote_ident; -use swc_ecma_utils::ExprFactory; -use swc_ecma_visit::noop_visit_type; -use swc_ecma_visit::Node; -use swc_ecma_visit::Visit; -use swc_ecma_visit::{noop_fold_type, Fold, FoldWith}; +use swc_ecma_utils::{quote_ident, ExprFactory}; +use swc_ecma_visit::{noop_fold_type, noop_visit_type, Fold, FoldWith, Node, Visit}; /// Compile ES2015 sticky regex to an ES5 RegExp constructor /// diff --git a/ecmascript/transforms/compat/src/es2015/template_literal.rs b/ecmascript/transforms/compat/src/es2015/template_literal.rs index 566f724a56a8..1b0d144709db 100644 --- a/ecmascript/transforms/compat/src/es2015/template_literal.rs +++ b/ecmascript/transforms/compat/src/es2015/template_literal.rs @@ -3,12 +3,9 @@ use swc_atoms::js_word; use swc_common::{BytePos, Spanned, DUMMY_SP}; use swc_ecma_ast::*; use swc_ecma_transforms_base::helper; -use swc_ecma_utils::is_literal; -use swc_ecma_utils::prepend_stmts; -use swc_ecma_utils::private_ident; -use swc_ecma_utils::quote_ident; -use swc_ecma_utils::ExprFactory; -use swc_ecma_utils::StmtLike; +use swc_ecma_utils::{ + is_literal, prepend_stmts, private_ident, quote_ident, ExprFactory, StmtLike, +}; use swc_ecma_visit::{noop_fold_type, Fold, FoldWith}; pub fn template_literal() -> impl Fold { diff --git a/ecmascript/transforms/compat/src/es2015/typeof_symbol.rs b/ecmascript/transforms/compat/src/es2015/typeof_symbol.rs index 8feaa3035ed7..3c58db4cb2a9 100644 --- a/ecmascript/transforms/compat/src/es2015/typeof_symbol.rs +++ b/ecmascript/transforms/compat/src/es2015/typeof_symbol.rs @@ -1,13 +1,13 @@ use swc_atoms::js_word; use swc_common::DUMMY_SP; use swc_ecma_ast::*; -use swc_ecma_transforms_base::ext::MapWithMut; -use swc_ecma_transforms_base::helper; -use swc_ecma_transforms_base::perf::Check; +use swc_ecma_transforms_base::{ext::MapWithMut, helper, perf::Check}; use swc_ecma_transforms_macros::fast_path; use swc_ecma_utils::{quote_str, ExprFactory}; -use swc_ecma_visit::{as_folder, noop_visit_mut_type, noop_visit_type, VisitMut, VisitMutWith}; -use swc_ecma_visit::{Fold, Node, Visit, VisitWith}; +use swc_ecma_visit::{ + as_folder, noop_visit_mut_type, noop_visit_type, Fold, Node, Visit, VisitMut, VisitMutWith, + VisitWith, +}; pub fn typeof_symbol() -> impl VisitMut + Fold { as_folder(TypeOfSymbol) diff --git a/ecmascript/transforms/compat/src/es2016/exponentation.rs b/ecmascript/transforms/compat/src/es2016/exponentation.rs index 6a6174602673..1a03552abe98 100644 --- a/ecmascript/transforms/compat/src/es2016/exponentation.rs +++ b/ecmascript/transforms/compat/src/es2016/exponentation.rs @@ -1,14 +1,9 @@ use swc_common::{Span, Spanned, DUMMY_SP}; use swc_ecma_ast::*; -use swc_ecma_transforms_base::ext::PatOrExprExt; -use swc_ecma_transforms_base::perf::Check; +use swc_ecma_transforms_base::{ext::PatOrExprExt, perf::Check}; use swc_ecma_transforms_macros::fast_path; -use swc_ecma_utils::member_expr; -use swc_ecma_utils::private_ident; -use swc_ecma_utils::ExprFactory; -use swc_ecma_utils::StmtLike; -use swc_ecma_visit::noop_visit_type; -use swc_ecma_visit::{noop_fold_type, Fold, FoldWith, Node, Visit, VisitWith}; +use swc_ecma_utils::{member_expr, private_ident, ExprFactory, StmtLike}; +use swc_ecma_visit::{noop_fold_type, noop_visit_type, Fold, FoldWith, Node, Visit, VisitWith}; /// `@babel/plugin-transform-exponentiation-operator` /// @@ -193,8 +188,7 @@ impl Check for ShouldFold { #[cfg(test)] mod tests { use super::*; - use swc_ecma_transforms_testing::test; - use swc_ecma_transforms_testing::test_exec; + use swc_ecma_transforms_testing::{test, test_exec}; test!( ::swc_ecma_parser::Syntax::default(), diff --git a/ecmascript/transforms/compat/src/es2017/async_to_generator.rs b/ecmascript/transforms/compat/src/es2017/async_to_generator.rs index 6f99795daac8..4d50d5eec557 100644 --- a/ecmascript/transforms/compat/src/es2017/async_to_generator.rs +++ b/ecmascript/transforms/compat/src/es2017/async_to_generator.rs @@ -1,18 +1,12 @@ -use std::iter; -use std::mem::replace; +use std::{iter, mem::replace}; use swc_common::{Mark, Span, Spanned, DUMMY_SP}; use swc_ecma_ast::*; -use swc_ecma_transforms_base::helper; -use swc_ecma_transforms_base::perf::Check; +use swc_ecma_transforms_base::{helper, perf::Check}; use swc_ecma_transforms_macros::fast_path; -use swc_ecma_utils::contains_ident_ref; -use swc_ecma_utils::contains_this_expr; -use swc_ecma_utils::private_ident; -use swc_ecma_utils::quote_ident; -use swc_ecma_utils::ExprFactory; -use swc_ecma_utils::StmtLike; -use swc_ecma_visit::noop_visit_type; -use swc_ecma_visit::{noop_fold_type, Fold, FoldWith, Node, Visit, VisitWith}; +use swc_ecma_utils::{ + contains_ident_ref, contains_this_expr, private_ident, quote_ident, ExprFactory, StmtLike, +}; +use swc_ecma_visit::{noop_fold_type, noop_visit_type, Fold, FoldWith, Node, Visit, VisitWith}; /// `@babel/plugin-transform-async-to-generator` /// diff --git a/ecmascript/transforms/compat/src/es2018/object_rest_spread.rs b/ecmascript/transforms/compat/src/es2018/object_rest_spread.rs index b4e9d046235b..4b2867366966 100644 --- a/ecmascript/transforms/compat/src/es2018/object_rest_spread.rs +++ b/ecmascript/transforms/compat/src/es2018/object_rest_spread.rs @@ -1,20 +1,13 @@ use std::{iter, mem}; use swc_common::{chain, util::move_map::MoveMap, Mark, Spanned, DUMMY_SP}; use swc_ecma_ast::*; -use swc_ecma_transforms_base::helper; -use swc_ecma_transforms_base::helper_expr; -use swc_ecma_transforms_base::perf::Check; +use swc_ecma_transforms_base::{helper, helper_expr, perf::Check}; use swc_ecma_transforms_macros::fast_path; -use swc_ecma_utils::alias_ident_for; -use swc_ecma_utils::alias_if_required; -use swc_ecma_utils::is_literal; -use swc_ecma_utils::private_ident; -use swc_ecma_utils::quote_ident; -use swc_ecma_utils::var::VarCollector; -use swc_ecma_utils::ExprFactory; -use swc_ecma_utils::StmtLike; -use swc_ecma_visit::noop_visit_type; -use swc_ecma_visit::{noop_fold_type, Fold, FoldWith, Node, Visit, VisitWith}; +use swc_ecma_utils::{ + alias_ident_for, alias_if_required, is_literal, private_ident, quote_ident, var::VarCollector, + ExprFactory, StmtLike, +}; +use swc_ecma_visit::{noop_fold_type, noop_visit_type, Fold, FoldWith, Node, Visit, VisitWith}; /// `@babel/plugin-proposal-object-rest-spread` pub fn object_rest_spread() -> impl Fold { diff --git a/ecmascript/transforms/compat/src/es2020/class_properties/mod.rs b/ecmascript/transforms/compat/src/es2020/class_properties/mod.rs index 04d518ba131d..b27a1aede63b 100644 --- a/ecmascript/transforms/compat/src/es2020/class_properties/mod.rs +++ b/ecmascript/transforms/compat/src/es2020/class_properties/mod.rs @@ -3,21 +3,16 @@ use self::{ this_in_static::ThisInStaticFolder, used_name::UsedNameCollector, }; use std::{collections::HashSet, mem::take}; -use swc_common::SyntaxContext; -use swc_common::{util::move_map::MoveMap, Mark, Spanned, DUMMY_SP}; +use swc_common::{util::move_map::MoveMap, Mark, Spanned, SyntaxContext, DUMMY_SP}; use swc_ecma_ast::*; -use swc_ecma_transforms_base::helper; -use swc_ecma_transforms_base::perf::Check; +use swc_ecma_transforms_base::{helper, perf::Check}; use swc_ecma_transforms_classes::super_field::SuperFieldAccessFolder; use swc_ecma_transforms_macros::fast_path; -use swc_ecma_utils::private_ident; -use swc_ecma_utils::quote_ident; use swc_ecma_utils::{ alias_ident_for, alias_if_required, constructor::inject_after_super, default_constructor, - undefined, ExprFactory, ModuleItemLike, StmtLike, + private_ident, quote_ident, undefined, ExprFactory, ModuleItemLike, StmtLike, }; -use swc_ecma_visit::noop_visit_type; -use swc_ecma_visit::{noop_fold_type, Fold, FoldWith, Node, Visit, VisitWith}; +use swc_ecma_visit::{noop_fold_type, noop_visit_type, Fold, FoldWith, Node, Visit, VisitWith}; mod class_name_tdz; mod private_field; diff --git a/ecmascript/transforms/compat/src/es2020/class_properties/private_field.rs b/ecmascript/transforms/compat/src/es2020/class_properties/private_field.rs index 7018bf323205..43f0806df0cf 100644 --- a/ecmascript/transforms/compat/src/es2020/class_properties/private_field.rs +++ b/ecmascript/transforms/compat/src/es2020/class_properties/private_field.rs @@ -1,14 +1,13 @@ use fxhash::FxHashSet; use std::{iter, mem}; use swc_atoms::JsWord; -use swc_common::SyntaxContext; -use swc_common::{Mark, Spanned, DUMMY_SP}; +use swc_common::{Mark, Spanned, SyntaxContext, DUMMY_SP}; use swc_ecma_ast::*; -use swc_ecma_transforms_base::ext::AsOptExpr; -use swc_ecma_transforms_base::ext::PatOrExprExt; -use swc_ecma_transforms_base::helper; -use swc_ecma_utils::quote_ident; -use swc_ecma_utils::{alias_ident_for, alias_if_required, prepend, ExprFactory}; +use swc_ecma_transforms_base::{ + ext::{AsOptExpr, PatOrExprExt}, + helper, +}; +use swc_ecma_utils::{alias_ident_for, alias_if_required, prepend, quote_ident, ExprFactory}; use swc_ecma_visit::{noop_fold_type, Fold, FoldWith}; pub(super) struct FieldAccessFolder<'a> { diff --git a/ecmascript/transforms/compat/src/es2020/class_properties/used_name.rs b/ecmascript/transforms/compat/src/es2020/class_properties/used_name.rs index 66f7c88388b9..77dbca1a5001 100644 --- a/ecmascript/transforms/compat/src/es2020/class_properties/used_name.rs +++ b/ecmascript/transforms/compat/src/es2020/class_properties/used_name.rs @@ -1,7 +1,6 @@ use swc_atoms::JsWord; use swc_ecma_ast::*; -use swc_ecma_visit::noop_visit_type; -use swc_ecma_visit::{Node, Visit, VisitWith}; +use swc_ecma_visit::{noop_visit_type, Node, Visit, VisitWith}; pub(super) struct UsedNameCollector<'a> { pub used_names: &'a mut Vec, diff --git a/ecmascript/transforms/compat/src/es2020/export_namespace_from.rs b/ecmascript/transforms/compat/src/es2020/export_namespace_from.rs index 0ce2c8c067d7..f35c4ec7c9c2 100644 --- a/ecmascript/transforms/compat/src/es2020/export_namespace_from.rs +++ b/ecmascript/transforms/compat/src/es2020/export_namespace_from.rs @@ -1,7 +1,6 @@ use swc_common::DUMMY_SP; use swc_ecma_ast::*; -use swc_ecma_utils::IdentExt; -use swc_ecma_utils::IsDirective; +use swc_ecma_utils::{IdentExt, IsDirective}; use swc_ecma_visit::{noop_fold_type, Fold}; pub fn export_namespace_from() -> impl Fold { diff --git a/ecmascript/transforms/compat/src/es2020/nullish_coalescing/mod.rs b/ecmascript/transforms/compat/src/es2020/nullish_coalescing/mod.rs index 3fcfeca97a70..ac21d8edf986 100644 --- a/ecmascript/transforms/compat/src/es2020/nullish_coalescing/mod.rs +++ b/ecmascript/transforms/compat/src/es2020/nullish_coalescing/mod.rs @@ -1,8 +1,7 @@ use std::mem::replace; use swc_common::{Span, DUMMY_SP}; use swc_ecma_ast::*; -use swc_ecma_transforms_base::ext::MapWithMut; -use swc_ecma_transforms_base::perf::Check; +use swc_ecma_transforms_base::{ext::MapWithMut, perf::Check}; use swc_ecma_transforms_macros::fast_path; use swc_ecma_utils::{alias_if_required, undefined, StmtLike}; use swc_ecma_visit::{noop_fold_type, noop_visit_type, Fold, FoldWith, Node, Visit, VisitWith}; diff --git a/ecmascript/transforms/compat/src/es2020/nullish_coalescing/tests.rs b/ecmascript/transforms/compat/src/es2020/nullish_coalescing/tests.rs index 74f85c3be2a9..c544546e0ed9 100644 --- a/ecmascript/transforms/compat/src/es2020/nullish_coalescing/tests.rs +++ b/ecmascript/transforms/compat/src/es2020/nullish_coalescing/tests.rs @@ -1,7 +1,6 @@ use super::*; use swc_ecma_parser::{EsConfig, Syntax}; -use swc_ecma_transforms_testing::test; -use swc_ecma_transforms_testing::test_exec; +use swc_ecma_transforms_testing::{test, test_exec}; fn tr(_: ()) -> impl Fold { nullish_coalescing() diff --git a/ecmascript/transforms/compat/src/es2020/opt_chaining.rs b/ecmascript/transforms/compat/src/es2020/opt_chaining.rs index 7095b9a1af2c..ebcf948f63d8 100644 --- a/ecmascript/transforms/compat/src/es2020/opt_chaining.rs +++ b/ecmascript/transforms/compat/src/es2020/opt_chaining.rs @@ -3,11 +3,8 @@ use swc_common::{Spanned, DUMMY_SP}; use swc_ecma_ast::*; use swc_ecma_transforms_base::perf::Check; use swc_ecma_transforms_macros::fast_path; -use swc_ecma_utils::alias_if_required; -use swc_ecma_utils::private_ident; -use swc_ecma_utils::{prepend, undefined, ExprFactory, StmtLike}; -use swc_ecma_visit::noop_visit_type; -use swc_ecma_visit::{noop_fold_type, Fold, FoldWith, Node, Visit}; +use swc_ecma_utils::{alias_if_required, prepend, private_ident, undefined, ExprFactory, StmtLike}; +use swc_ecma_visit::{noop_fold_type, noop_visit_type, Fold, FoldWith, Node, Visit}; pub fn optional_chaining() -> impl Fold { OptChaining::default() diff --git a/ecmascript/transforms/compat/src/es2021/logical_assignments.rs b/ecmascript/transforms/compat/src/es2021/logical_assignments.rs index caf23da2a5e0..cdd69d3c39ce 100644 --- a/ecmascript/transforms/compat/src/es2021/logical_assignments.rs +++ b/ecmascript/transforms/compat/src/es2021/logical_assignments.rs @@ -2,8 +2,7 @@ use swc_common::DUMMY_SP; use swc_ecma_ast::*; use swc_ecma_transforms_base::{ext::MapWithMut, perf::Check}; use swc_ecma_transforms_macros::fast_path; -use swc_ecma_utils::prepend; -use swc_ecma_utils::{alias_ident_for, ExprFactory}; +use swc_ecma_utils::{alias_ident_for, prepend, ExprFactory}; use swc_ecma_visit::{ as_folder, noop_visit_mut_type, noop_visit_type, Fold, Node, Visit, VisitMut, VisitMutWith, }; diff --git a/ecmascript/transforms/compat/src/reserved_words.rs b/ecmascript/transforms/compat/src/reserved_words.rs index 7232dd3df1e2..d6287a0ae1f6 100644 --- a/ecmascript/transforms/compat/src/reserved_words.rs +++ b/ecmascript/transforms/compat/src/reserved_words.rs @@ -1,5 +1,4 @@ -use swc_atoms::js_word; -use swc_atoms::JsWord; +use swc_atoms::{js_word, JsWord}; use swc_ecma_ast::*; use swc_ecma_transforms_base::perf::Check; use swc_ecma_transforms_macros::fast_path; diff --git a/ecmascript/transforms/compat/tests/es2015_block_scoping.rs b/ecmascript/transforms/compat/tests/es2015_block_scoping.rs index 665a2060cbc7..30644d148c37 100644 --- a/ecmascript/transforms/compat/tests/es2015_block_scoping.rs +++ b/ecmascript/transforms/compat/tests/es2015_block_scoping.rs @@ -1,7 +1,10 @@ use swc_common::{chain, Mark}; use swc_ecma_parser::Syntax; -use swc_ecma_transforms_compat::es2015::block_scoping; -use swc_ecma_transforms_compat::{es2015, es2015::for_of::for_of, es2017::async_to_generator}; +use swc_ecma_transforms_compat::{ + es2015, + es2015::{block_scoping, for_of::for_of}, + es2017::async_to_generator, +}; use swc_ecma_transforms_testing::{test, test_exec, Tester}; test!( diff --git a/ecmascript/transforms/compat/tests/es2015_classes.rs b/ecmascript/transforms/compat/tests/es2015_classes.rs index 5005bae76d63..5a1818bfa1a3 100644 --- a/ecmascript/transforms/compat/tests/es2015_classes.rs +++ b/ecmascript/transforms/compat/tests/es2015_classes.rs @@ -1,17 +1,12 @@ -use swc_common::chain; -use swc_common::Mark; +use swc_common::{chain, Mark}; use swc_ecma_parser::Syntax; use swc_ecma_transforms_base::resolver::resolver; -use swc_ecma_transforms_compat::es2015; -use swc_ecma_transforms_compat::es2015::arrow; -use swc_ecma_transforms_compat::es2015::block_scoping; -use swc_ecma_transforms_compat::es2015::classes; -use swc_ecma_transforms_compat::es2015::spread; -use swc_ecma_transforms_compat::es2016; -use swc_ecma_transforms_compat::es2017; -use swc_ecma_transforms_compat::es2018; -use swc_ecma_transforms_compat::es2020; -use swc_ecma_transforms_compat::es2020::class_properties; +use swc_ecma_transforms_compat::{ + es2015, + es2015::{arrow, block_scoping, classes, spread}, + es2016, es2017, es2018, es2020, + es2020::class_properties, +}; use swc_ecma_transforms_testing::{test, test_exec, Tester}; use swc_ecma_visit::Fold; diff --git a/ecmascript/transforms/compat/tests/es2015_computed_props.rs b/ecmascript/transforms/compat/tests/es2015_computed_props.rs index 2746fbd380dc..20d9cd7129d3 100644 --- a/ecmascript/transforms/compat/tests/es2015_computed_props.rs +++ b/ecmascript/transforms/compat/tests/es2015_computed_props.rs @@ -1,7 +1,6 @@ use swc_ecma_parser::Syntax; use swc_ecma_transforms_compat::es2015::computed_properties; -use swc_ecma_transforms_testing::test; -use swc_ecma_transforms_testing::test_exec; +use swc_ecma_transforms_testing::{test, test_exec}; use swc_ecma_visit::Fold; fn syntax() -> Syntax { diff --git a/ecmascript/transforms/compat/tests/es2015_destructuring.rs b/ecmascript/transforms/compat/tests/es2015_destructuring.rs index 15f0c7b9948c..957fb9fba781 100644 --- a/ecmascript/transforms/compat/tests/es2015_destructuring.rs +++ b/ecmascript/transforms/compat/tests/es2015_destructuring.rs @@ -11,8 +11,7 @@ use swc_ecma_transforms_compat::{ }, es2018::object_rest_spread, }; -use swc_ecma_transforms_testing::test; -use swc_ecma_transforms_testing::test_exec; +use swc_ecma_transforms_testing::{test, test_exec}; use swc_ecma_visit::Fold; fn syntax() -> Syntax { diff --git a/ecmascript/transforms/compat/tests/es2015_for_of.rs b/ecmascript/transforms/compat/tests/es2015_for_of.rs index 08feb1099102..2cd84b6e886f 100644 --- a/ecmascript/transforms/compat/tests/es2015_for_of.rs +++ b/ecmascript/transforms/compat/tests/es2015_for_of.rs @@ -1,8 +1,6 @@ use swc_ecma_parser::Syntax; -use swc_ecma_transforms_compat::es2015::for_of::for_of; -use swc_ecma_transforms_compat::es2015::for_of::Config; -use swc_ecma_transforms_testing::test; -use swc_ecma_transforms_testing::test_exec; +use swc_ecma_transforms_compat::es2015::for_of::{for_of, Config}; +use swc_ecma_transforms_testing::{test, test_exec}; fn syntax() -> Syntax { Default::default() diff --git a/ecmascript/transforms/compat/tests/es2015_parameters.rs b/ecmascript/transforms/compat/tests/es2015_parameters.rs index 66ff3f64a017..569ff0442379 100644 --- a/ecmascript/transforms/compat/tests/es2015_parameters.rs +++ b/ecmascript/transforms/compat/tests/es2015_parameters.rs @@ -1,15 +1,11 @@ use swc_common::chain; use swc_ecma_parser::Syntax; use swc_ecma_transforms_base::resolver::resolver; -use swc_ecma_transforms_compat::es2015::arrow; -use swc_ecma_transforms_compat::es2015::block_scoping; -use swc_ecma_transforms_compat::es2015::classes; -use swc_ecma_transforms_compat::es2015::destructuring; -use swc_ecma_transforms_compat::es2015::parameters; -use swc_ecma_transforms_compat::es2015::spread; -use swc_ecma_transforms_compat::es2017::async_to_generator; -use swc_ecma_transforms_testing::test; -use swc_ecma_transforms_testing::test_exec; +use swc_ecma_transforms_compat::{ + es2015::{arrow, block_scoping, classes, destructuring, parameters, spread}, + es2017::async_to_generator, +}; +use swc_ecma_transforms_testing::{test, test_exec}; use swc_ecma_visit::Fold; fn syntax() -> Syntax { diff --git a/ecmascript/transforms/compat/tests/es2015_regenerator.rs b/ecmascript/transforms/compat/tests/es2015_regenerator.rs index 46eab9a2e985..8dbf83d77e25 100644 --- a/ecmascript/transforms/compat/tests/es2015_regenerator.rs +++ b/ecmascript/transforms/compat/tests/es2015_regenerator.rs @@ -1,13 +1,10 @@ -use swc_common::comments::SingleThreadedComments; -use swc_common::{chain, Mark}; +use swc_common::{chain, comments::SingleThreadedComments, Mark}; use swc_ecma_parser::Syntax; use swc_ecma_transforms_base::resolver::resolver; use swc_ecma_transforms_compat::{ - es2015, es2015::regenerator, es2016, es2017, es2017::async_to_generator, + es2015, es2015::regenerator, es2016, es2017, es2017::async_to_generator, es2018, es2020, es2021, }; -use swc_ecma_transforms_compat::{es2018, es2020, es2021}; -use swc_ecma_transforms_testing::test; -use swc_ecma_transforms_testing::test_exec; +use swc_ecma_transforms_testing::{test, test_exec}; use swc_ecma_visit::Fold; fn syntax() -> Syntax { diff --git a/ecmascript/transforms/compat/tests/es2015_spread.rs b/ecmascript/transforms/compat/tests/es2015_spread.rs index d7c3ff21c35f..76dd29532ad8 100644 --- a/ecmascript/transforms/compat/tests/es2015_spread.rs +++ b/ecmascript/transforms/compat/tests/es2015_spread.rs @@ -1,10 +1,6 @@ use swc_common::chain; -use swc_ecma_transforms_compat::es2015::block_scoping; -use swc_ecma_transforms_compat::es2015::parameters; -use swc_ecma_transforms_compat::es2015::spread; -use swc_ecma_transforms_compat::es2015::spread::Config; -use swc_ecma_transforms_testing::test; -use swc_ecma_transforms_testing::test_exec; +use swc_ecma_transforms_compat::es2015::{block_scoping, parameters, spread, spread::Config}; +use swc_ecma_transforms_testing::{test, test_exec}; use swc_ecma_visit::Fold; fn syntax() -> ::swc_ecma_parser::Syntax { diff --git a/ecmascript/transforms/compat/tests/es2015_template_literals.rs b/ecmascript/transforms/compat/tests/es2015_template_literals.rs index e6fb589841b8..fc3cecb39b49 100644 --- a/ecmascript/transforms/compat/tests/es2015_template_literals.rs +++ b/ecmascript/transforms/compat/tests/es2015_template_literals.rs @@ -1,7 +1,6 @@ use swc_ecma_parser::Syntax; use swc_ecma_transforms_compat::es2015::template_literal; -use swc_ecma_transforms_testing::test; -use swc_ecma_transforms_testing::test_exec; +use swc_ecma_transforms_testing::{test, test_exec}; use swc_ecma_visit::Fold; fn syntax() -> Syntax { diff --git a/ecmascript/transforms/compat/tests/es2017_async_to_generator.rs b/ecmascript/transforms/compat/tests/es2017_async_to_generator.rs index ead277d17aec..951aacf09534 100644 --- a/ecmascript/transforms/compat/tests/es2017_async_to_generator.rs +++ b/ecmascript/transforms/compat/tests/es2017_async_to_generator.rs @@ -3,17 +3,14 @@ use crate::es2015::regenerator; use swc_common::{chain, Mark, Spanned}; use swc_ecma_ast::*; use swc_ecma_parser::Syntax; -use swc_ecma_transforms_base::fixer::fixer; -use swc_ecma_transforms_base::resolver::resolver; -use swc_ecma_transforms_compat::es2015; -use swc_ecma_transforms_compat::es2015::arrow; -use swc_ecma_transforms_compat::es2015::destructuring; -use swc_ecma_transforms_compat::es2015::function_name; -use swc_ecma_transforms_compat::es2015::parameters; -use swc_ecma_transforms_compat::es2017::async_to_generator; -use swc_ecma_transforms_compat::es2020::class_properties; -use swc_ecma_transforms_testing::test; -use swc_ecma_transforms_testing::test_exec; +use swc_ecma_transforms_base::{fixer::fixer, resolver::resolver}; +use swc_ecma_transforms_compat::{ + es2015, + es2015::{arrow, destructuring, function_name, parameters}, + es2017::async_to_generator, + es2020::class_properties, +}; +use swc_ecma_transforms_testing::{test, test_exec}; use swc_ecma_visit::{Fold, FoldWith}; struct ParenRemover; diff --git a/ecmascript/transforms/compat/tests/es2018_object_rest_spread.rs b/ecmascript/transforms/compat/tests/es2018_object_rest_spread.rs index d58a1828d249..0033065901cf 100644 --- a/ecmascript/transforms/compat/tests/es2018_object_rest_spread.rs +++ b/ecmascript/transforms/compat/tests/es2018_object_rest_spread.rs @@ -1,9 +1,7 @@ use swc_common::chain; use swc_ecma_parser::Syntax; -use swc_ecma_transforms_compat::es2015::spread; -use swc_ecma_transforms_compat::es2018::object_rest_spread; -use swc_ecma_transforms_testing::test; -use swc_ecma_transforms_testing::test_exec; +use swc_ecma_transforms_compat::{es2015::spread, es2018::object_rest_spread}; +use swc_ecma_transforms_testing::{test, test_exec}; use swc_ecma_visit::Fold; fn syntax() -> Syntax { diff --git a/ecmascript/transforms/compat/tests/es2020_optional_chaining.rs b/ecmascript/transforms/compat/tests/es2020_optional_chaining.rs index 0686ce04a937..634635c00dba 100644 --- a/ecmascript/transforms/compat/tests/es2020_optional_chaining.rs +++ b/ecmascript/transforms/compat/tests/es2020_optional_chaining.rs @@ -1,7 +1,6 @@ use swc_ecma_parser::{Syntax, TsConfig}; use swc_ecma_transforms_compat::es2020::optional_chaining; -use swc_ecma_transforms_testing::test; -use swc_ecma_transforms_testing::test_exec; +use swc_ecma_transforms_testing::{test, test_exec}; use swc_ecma_visit::Fold; fn tr(_: ()) -> impl Fold { diff --git a/ecmascript/transforms/module/src/amd.rs b/ecmascript/transforms/module/src/amd.rs index b3a224f4e6e3..2a023faa72bf 100644 --- a/ecmascript/transforms/module/src/amd.rs +++ b/ecmascript/transforms/module/src/amd.rs @@ -6,22 +6,18 @@ use crate::path::{ImportResolver, NoopImportResolver}; use anyhow::Context; use fxhash::FxHashSet; use serde::{Deserialize, Serialize}; -use std::cell::Ref; -use std::cell::RefCell; -use std::cell::RefMut; -use std::iter; +use std::{ + cell::{Ref, RefCell, RefMut}, + iter, +}; use swc_atoms::js_word; -use swc_common::FileName; -use swc_common::{Mark, Span, DUMMY_SP}; +use swc_common::{FileName, Mark, Span, DUMMY_SP}; use swc_ecma_ast::*; use swc_ecma_transforms_base::helper; -use swc_ecma_utils::prepend_stmts; -use swc_ecma_utils::private_ident; -use swc_ecma_utils::quote_ident; -use swc_ecma_utils::quote_str; -use swc_ecma_utils::var::VarCollector; -use swc_ecma_utils::DestructuringFinder; -use swc_ecma_utils::ExprFactory; +use swc_ecma_utils::{ + prepend_stmts, private_ident, quote_ident, quote_str, var::VarCollector, DestructuringFinder, + ExprFactory, +}; use swc_ecma_visit::{noop_fold_type, Fold, FoldWith, VisitWith}; pub fn amd(config: Config) -> impl Fold { diff --git a/ecmascript/transforms/module/src/common_js.rs b/ecmascript/transforms/module/src/common_js.rs index ccc0859a4bd5..c7467ddec872 100644 --- a/ecmascript/transforms/module/src/common_js.rs +++ b/ecmascript/transforms/module/src/common_js.rs @@ -5,20 +5,18 @@ use super::util::{ }; use crate::path::{ImportResolver, NoopImportResolver}; use fxhash::FxHashSet; -use std::cell::{Ref, RefCell, RefMut}; -use std::rc::Rc; +use std::{ + cell::{Ref, RefCell, RefMut}, + rc::Rc, +}; use swc_atoms::js_word; -use swc_common::FileName; -use swc_common::{Mark, Span, DUMMY_SP}; +use swc_common::{FileName, Mark, Span, DUMMY_SP}; use swc_ecma_ast::*; use swc_ecma_transforms_base::helper; -use swc_ecma_utils::ident::IdentLike; -use swc_ecma_utils::member_expr; -use swc_ecma_utils::private_ident; -use swc_ecma_utils::quote_ident; -use swc_ecma_utils::quote_str; -use swc_ecma_utils::IsDirective; -use swc_ecma_utils::{var::VarCollector, DestructuringFinder, ExprFactory}; +use swc_ecma_utils::{ + ident::IdentLike, member_expr, private_ident, quote_ident, quote_str, var::VarCollector, + DestructuringFinder, ExprFactory, IsDirective, +}; use swc_ecma_visit::{noop_fold_type, Fold, FoldWith, VisitWith}; pub fn common_js(root_mark: Mark, config: Config, scope: Option>>) -> impl Fold { diff --git a/ecmascript/transforms/module/src/import_analysis.rs b/ecmascript/transforms/module/src/import_analysis.rs index 2bf69170f898..819300c80593 100644 --- a/ecmascript/transforms/module/src/import_analysis.rs +++ b/ecmascript/transforms/module/src/import_analysis.rs @@ -1,13 +1,10 @@ use super::util::Scope; -use std::cell::RefCell; -use std::rc::Rc; +use std::{cell::RefCell, rc::Rc}; use swc_atoms::js_word; use swc_common::DUMMY_SP; use swc_ecma_ast::*; use swc_ecma_transforms_base::enable_helper; -use swc_ecma_visit::noop_visit_type; -use swc_ecma_visit::VisitWith; -use swc_ecma_visit::{noop_fold_type, Fold, Node, Visit}; +use swc_ecma_visit::{noop_fold_type, noop_visit_type, Fold, Node, Visit, VisitWith}; pub fn import_analyzer(scope: Rc>) -> ImportAnalyzer { ImportAnalyzer { scope } diff --git a/ecmascript/transforms/module/src/lib.rs b/ecmascript/transforms/module/src/lib.rs index e1992a859c3c..853742da6cd8 100644 --- a/ecmascript/transforms/module/src/lib.rs +++ b/ecmascript/transforms/module/src/lib.rs @@ -1,8 +1,6 @@ #![deny(unused)] -pub use self::amd::amd; -pub use self::common_js::common_js; -pub use self::umd::umd; +pub use self::{amd::amd, common_js::common_js, umd::umd}; #[macro_use] pub mod util; diff --git a/ecmascript/transforms/module/src/umd.rs b/ecmascript/transforms/module/src/umd.rs index 68cae1131fc4..741ea766a862 100644 --- a/ecmascript/transforms/module/src/umd.rs +++ b/ecmascript/transforms/module/src/umd.rs @@ -1,6 +1,4 @@ -use std::cell::Ref; -use std::cell::RefCell; -use std::cell::RefMut; +use std::cell::{Ref, RefCell, RefMut}; use self::config::BuiltConfig; pub use self::config::Config; @@ -11,15 +9,13 @@ use super::util::{ use crate::path::{ImportResolver, NoopImportResolver}; use fxhash::FxHashSet; use swc_atoms::js_word; -use swc_common::FileName; -use swc_common::{sync::Lrc, Mark, SourceMap, DUMMY_SP}; +use swc_common::{sync::Lrc, FileName, Mark, SourceMap, DUMMY_SP}; use swc_ecma_ast::*; use swc_ecma_transforms_base::helper; -use swc_ecma_utils::member_expr; -use swc_ecma_utils::private_ident; -use swc_ecma_utils::quote_ident; -use swc_ecma_utils::quote_str; -use swc_ecma_utils::{prepend_stmts, var::VarCollector, DestructuringFinder, ExprFactory}; +use swc_ecma_utils::{ + member_expr, prepend_stmts, private_ident, quote_ident, quote_str, var::VarCollector, + DestructuringFinder, ExprFactory, +}; use swc_ecma_visit::{noop_fold_type, Fold, FoldWith, VisitWith}; mod config; diff --git a/ecmascript/transforms/module/src/umd/config.rs b/ecmascript/transforms/module/src/umd/config.rs index 5506eff6341b..15e5b36b653a 100644 --- a/ecmascript/transforms/module/src/umd/config.rs +++ b/ecmascript/transforms/module/src/umd/config.rs @@ -6,8 +6,7 @@ use swc_atoms::JsWord; use swc_common::{sync::Lrc, FileName, SourceMap}; use swc_ecma_ast::Expr; use swc_ecma_parser::{lexer::Lexer, Parser, StringInput, Syntax}; -use swc_ecma_utils::quote_ident; -use swc_ecma_utils::HANDLER; +use swc_ecma_utils::{quote_ident, HANDLER}; #[derive(Debug, Default, Clone, Serialize, Deserialize)] #[serde(deny_unknown_fields, rename_all = "camelCase")] diff --git a/ecmascript/transforms/module/src/util.rs b/ecmascript/transforms/module/src/util.rs index 2e07a60cdf23..506bb60b7b5e 100644 --- a/ecmascript/transforms/module/src/util.rs +++ b/ecmascript/transforms/module/src/util.rs @@ -13,12 +13,10 @@ use swc_atoms::{js_word, JsWord}; use swc_common::{FileName, Mark, Span, SyntaxContext, DUMMY_SP}; use swc_ecma_ast::*; use swc_ecma_transforms_base::ext::MapWithMut; -use swc_ecma_utils::ident::IdentLike; -use swc_ecma_utils::member_expr; -use swc_ecma_utils::private_ident; -use swc_ecma_utils::quote_ident; -use swc_ecma_utils::quote_str; -use swc_ecma_utils::{undefined, DestructuringFinder, ExprFactory}; +use swc_ecma_utils::{ + ident::IdentLike, member_expr, private_ident, quote_ident, quote_str, undefined, + DestructuringFinder, ExprFactory, +}; use swc_ecma_visit::{Fold, FoldWith, VisitWith}; pub(super) trait ModulePass: Fold { diff --git a/ecmascript/transforms/module/tests/amd.rs b/ecmascript/transforms/module/tests/amd.rs index af22124bbfa4..72a455d3ef5f 100644 --- a/ecmascript/transforms/module/tests/amd.rs +++ b/ecmascript/transforms/module/tests/amd.rs @@ -1,13 +1,11 @@ use swc_common::chain; use swc_ecma_parser::{EsConfig, Syntax}; use swc_ecma_transforms_base::resolver::resolver; -use swc_ecma_transforms_compat::es2015::arrow; -use swc_ecma_transforms_compat::es2015::for_of; -use swc_ecma_transforms_compat::es2015::function_name; -use swc_ecma_transforms_compat::es2015::shorthand; -use swc_ecma_transforms_module::amd::amd; -use swc_ecma_transforms_module::amd::Config; -use swc_ecma_transforms_module::util; +use swc_ecma_transforms_compat::es2015::{arrow, for_of, function_name, shorthand}; +use swc_ecma_transforms_module::{ + amd::{amd, Config}, + util, +}; use swc_ecma_transforms_testing::test; use swc_ecma_visit::Fold; diff --git a/ecmascript/transforms/module/tests/common_js.rs b/ecmascript/transforms/module/tests/common_js.rs index 22bbef38229e..5342ee19c575 100644 --- a/ecmascript/transforms/module/tests/common_js.rs +++ b/ecmascript/transforms/module/tests/common_js.rs @@ -1,28 +1,25 @@ -use std::cell::RefCell; -use std::rc::Rc; +use std::{cell::RefCell, rc::Rc}; use swc_common::{chain, Mark}; use swc_ecma_parser::{EsConfig, Syntax, TsConfig}; -use swc_ecma_transforms_base::fixer::fixer; -use swc_ecma_transforms_base::helpers::inject_helpers; -use swc_ecma_transforms_base::hygiene::hygiene; -use swc_ecma_transforms_base::resolver::resolver; -use swc_ecma_transforms_base::resolver::resolver_with_mark; -use swc_ecma_transforms_compat::es2015::block_scoped_functions; -use swc_ecma_transforms_compat::es2015::block_scoping; -use swc_ecma_transforms_compat::es2015::classes; -use swc_ecma_transforms_compat::es2015::destructuring; -use swc_ecma_transforms_compat::es2015::for_of; -use swc_ecma_transforms_compat::es2015::parameters; -use swc_ecma_transforms_compat::es2015::regenerator; -use swc_ecma_transforms_compat::es2015::spread; -use swc_ecma_transforms_compat::es2018::object_rest_spread; -use swc_ecma_transforms_module::common_js::common_js; -use swc_ecma_transforms_module::import_analysis::import_analyzer; -use swc_ecma_transforms_module::util::Config; -use swc_ecma_transforms_module::util::Lazy; -use swc_ecma_transforms_module::util::Scope; -use swc_ecma_transforms_testing::test; -use swc_ecma_transforms_testing::test_exec; +use swc_ecma_transforms_base::{ + fixer::fixer, + helpers::inject_helpers, + hygiene::hygiene, + resolver::{resolver, resolver_with_mark}, +}; +use swc_ecma_transforms_compat::{ + es2015::{ + block_scoped_functions, block_scoping, classes, destructuring, for_of, parameters, + regenerator, spread, + }, + es2018::object_rest_spread, +}; +use swc_ecma_transforms_module::{ + common_js::common_js, + import_analysis::import_analyzer, + util::{Config, Lazy, Scope}, +}; +use swc_ecma_transforms_testing::{test, test_exec}; use swc_ecma_visit::Fold; fn syntax() -> Syntax { diff --git a/ecmascript/transforms/module/tests/umd.rs b/ecmascript/transforms/module/tests/umd.rs index 2d23499adfab..9d5f4fcc7d3d 100644 --- a/ecmascript/transforms/module/tests/umd.rs +++ b/ecmascript/transforms/module/tests/umd.rs @@ -1,17 +1,12 @@ -use swc_common::chain; -use swc_common::Mark; -use swc_ecma_parser::EsConfig; -use swc_ecma_parser::Syntax; -use swc_ecma_transforms_base::resolver::resolver; -use swc_ecma_transforms_base::resolver::resolver_with_mark; -use swc_ecma_transforms_compat::es2015::arrow; -use swc_ecma_transforms_compat::es2015::function_name; -use swc_ecma_transforms_compat::es2015::shorthand; -use swc_ecma_transforms_module::umd::umd; -use swc_ecma_transforms_module::umd::Config; -use swc_ecma_transforms_module::util; -use swc_ecma_transforms_testing::test; -use swc_ecma_transforms_testing::Tester; +use swc_common::{chain, Mark}; +use swc_ecma_parser::{EsConfig, Syntax}; +use swc_ecma_transforms_base::resolver::{resolver, resolver_with_mark}; +use swc_ecma_transforms_compat::es2015::{arrow, function_name, shorthand}; +use swc_ecma_transforms_module::{ + umd::{umd, Config}, + util, +}; +use swc_ecma_transforms_testing::{test, Tester}; use swc_ecma_visit::Fold; fn syntax() -> Syntax { diff --git a/ecmascript/transforms/optimization/src/const_modules.rs b/ecmascript/transforms/optimization/src/const_modules.rs index bd2a33949713..bc06a03020f7 100644 --- a/ecmascript/transforms/optimization/src/const_modules.rs +++ b/ecmascript/transforms/optimization/src/const_modules.rs @@ -5,8 +5,7 @@ use swc_atoms::JsWord; use swc_common::{sync::Lrc, util::move_map::MoveMap, FileName, SourceMap}; use swc_ecma_ast::*; use swc_ecma_parser::{lexer::Lexer, Parser, StringInput}; -use swc_ecma_utils::drop_span; -use swc_ecma_utils::HANDLER; +use swc_ecma_utils::{drop_span, HANDLER}; use swc_ecma_visit::{noop_fold_type, Fold, FoldWith}; pub fn const_modules( diff --git a/ecmascript/transforms/optimization/src/inline_globals.rs b/ecmascript/transforms/optimization/src/inline_globals.rs index a63a1355cbdf..6372a03718ab 100644 --- a/ecmascript/transforms/optimization/src/inline_globals.rs +++ b/ecmascript/transforms/optimization/src/inline_globals.rs @@ -85,8 +85,7 @@ impl Fold for InlineGlobals { #[cfg(test)] mod tests { use super::*; - use swc_ecma_transforms_testing::test; - use swc_ecma_transforms_testing::Tester; + use swc_ecma_transforms_testing::{test, Tester}; use swc_ecma_utils::DropSpan; use swc_ecma_visit::as_folder; diff --git a/ecmascript/transforms/optimization/src/json_parse.rs b/ecmascript/transforms/optimization/src/json_parse.rs index e1561c965269..8f62035e3b96 100644 --- a/ecmascript/transforms/optimization/src/json_parse.rs +++ b/ecmascript/transforms/optimization/src/json_parse.rs @@ -2,8 +2,7 @@ use serde_json::Value; use std::usize; use swc_common::{Spanned, DUMMY_SP}; use swc_ecma_ast::*; -use swc_ecma_utils::member_expr; -use swc_ecma_utils::{calc_literal_cost, ExprFactory}; +use swc_ecma_utils::{calc_literal_cost, member_expr, ExprFactory}; use swc_ecma_visit::{noop_fold_type, Fold, FoldWith}; /// Transform to optimize performance of literals. diff --git a/ecmascript/transforms/optimization/src/lib.rs b/ecmascript/transforms/optimization/src/lib.rs index 57de4f691862..4dab568fb4e0 100644 --- a/ecmascript/transforms/optimization/src/lib.rs +++ b/ecmascript/transforms/optimization/src/lib.rs @@ -1,5 +1,7 @@ -pub use self::const_modules::const_modules; -pub use self::{inline_globals::inline_globals, json_parse::json_parse, simplify::simplifier}; +pub use self::{ + const_modules::const_modules, inline_globals::inline_globals, json_parse::json_parse, + simplify::simplifier, +}; mod const_modules; mod inline_globals; diff --git a/ecmascript/transforms/optimization/src/simplify/branch/mod.rs b/ecmascript/transforms/optimization/src/simplify/branch/mod.rs index 7607fdeefeb5..f31e7b57f7a4 100644 --- a/ecmascript/transforms/optimization/src/simplify/branch/mod.rs +++ b/ecmascript/transforms/optimization/src/simplify/branch/mod.rs @@ -7,20 +7,13 @@ use swc_common::{ }; use swc_ecma_ast::*; use swc_ecma_transforms_base::{ext::MapWithMut, pass::RepeatedJsPass}; -use swc_ecma_utils::extract_var_ids; -use swc_ecma_utils::is_literal; -use swc_ecma_utils::prepend; -use swc_ecma_utils::preserve_effects; -use swc_ecma_utils::undefined; -use swc_ecma_utils::ExprExt; -use swc_ecma_utils::ExprFactory; -use swc_ecma_utils::Hoister; -use swc_ecma_utils::IsEmpty; -use swc_ecma_utils::StmtExt; -use swc_ecma_utils::StmtLike; -use swc_ecma_utils::Value::Known; -use swc_ecma_visit::{as_folder, noop_visit_mut_type, noop_visit_type, VisitMut, VisitMutWith}; -use swc_ecma_visit::{Node, Visit, VisitWith}; +use swc_ecma_utils::{ + extract_var_ids, is_literal, prepend, preserve_effects, undefined, ExprExt, ExprFactory, + Hoister, IsEmpty, StmtExt, StmtLike, Value::Known, +}; +use swc_ecma_visit::{ + as_folder, noop_visit_mut_type, noop_visit_type, Node, Visit, VisitMut, VisitMutWith, VisitWith, +}; #[cfg(test)] mod tests; diff --git a/ecmascript/transforms/optimization/src/simplify/dce/mod.rs b/ecmascript/transforms/optimization/src/simplify/dce/mod.rs index ad34309801bd..30ea7dce40ba 100644 --- a/ecmascript/transforms/optimization/src/simplify/dce/mod.rs +++ b/ecmascript/transforms/optimization/src/simplify/dce/mod.rs @@ -2,8 +2,7 @@ use self::side_effect::{ImportDetector, SideEffectVisitor}; use fxhash::FxHashSet; use retain_mut::RetainMut; use std::{any::type_name, borrow::Cow, fmt::Debug, mem::take}; -use swc_atoms::js_word; -use swc_atoms::JsWord; +use swc_atoms::{js_word, JsWord}; use swc_common::{ chain, pass::{CompilerPass, Repeated}, diff --git a/ecmascript/transforms/optimization/src/simplify/dce/side_effect.rs b/ecmascript/transforms/optimization/src/simplify/dce/side_effect.rs index a1990f9146b9..57340e343e49 100644 --- a/ecmascript/transforms/optimization/src/simplify/dce/side_effect.rs +++ b/ecmascript/transforms/optimization/src/simplify/dce/side_effect.rs @@ -4,8 +4,7 @@ use swc_atoms::JsWord; use swc_common::DUMMY_SP; use swc_ecma_ast::*; use swc_ecma_utils::{ident::IdentLike, ExprExt, Id}; -use swc_ecma_visit::noop_visit_type; -use swc_ecma_visit::{Node, Visit, VisitWith}; +use swc_ecma_visit::{noop_visit_type, Node, Visit, VisitWith}; pub(super) struct ImportDetector { found: bool, diff --git a/ecmascript/transforms/optimization/src/simplify/expr/mod.rs b/ecmascript/transforms/optimization/src/simplify/expr/mod.rs index 0123e54edbf5..a30692dee646 100644 --- a/ecmascript/transforms/optimization/src/simplify/expr/mod.rs +++ b/ecmascript/transforms/optimization/src/simplify/expr/mod.rs @@ -1,34 +1,21 @@ use std::{borrow::Cow, iter, iter::once}; use swc_atoms::{js_word, JsWord}; -use swc_common::DUMMY_SP; use swc_common::{ pass::{CompilerPass, Repeated}, - Span, Spanned, + Span, Spanned, DUMMY_SP, }; use swc_ecma_ast::{Ident, Lit, *}; -use swc_ecma_transforms_base::ext::{ExprRefExt, MapWithMut}; -use swc_ecma_transforms_base::pass::RepeatedJsPass; -use swc_ecma_utils::alias_ident_for; -use swc_ecma_utils::extract_side_effects_to; -use swc_ecma_utils::ident::IdentLike; -use swc_ecma_utils::is_literal; -use swc_ecma_utils::prepend; -use swc_ecma_utils::preserve_effects; -use swc_ecma_utils::prop_name_eq; -use swc_ecma_utils::to_int32; -use swc_ecma_utils::undefined; -use swc_ecma_utils::BoolType; -use swc_ecma_utils::ExprExt; -use swc_ecma_utils::NullType; -use swc_ecma_utils::NumberType; -use swc_ecma_utils::ObjectType; -use swc_ecma_utils::StringType; -use swc_ecma_utils::SymbolType; -use swc_ecma_utils::UndefinedType; -use swc_ecma_utils::Value; +use swc_ecma_transforms_base::{ + ext::{ExprRefExt, MapWithMut}, + pass::RepeatedJsPass, +}; +use swc_ecma_utils::{ + alias_ident_for, extract_side_effects_to, ident::IdentLike, is_literal, prepend, + preserve_effects, prop_name_eq, to_int32, undefined, BoolType, ExprExt, NullType, NumberType, + ObjectType, StringType, SymbolType, UndefinedType, Value, +}; use swc_ecma_visit::{as_folder, noop_visit_mut_type, VisitMut, VisitMutWith}; -use Value::Known; -use Value::Unknown; +use Value::{Known, Unknown}; #[cfg(test)] mod tests; diff --git a/ecmascript/transforms/optimization/src/simplify/inlining/mod.rs b/ecmascript/transforms/optimization/src/simplify/inlining/mod.rs index 3edb24b3c32b..bd46ddf3e388 100644 --- a/ecmascript/transforms/optimization/src/simplify/inlining/mod.rs +++ b/ecmascript/transforms/optimization/src/simplify/inlining/mod.rs @@ -5,14 +5,14 @@ use swc_common::{ DUMMY_SP, }; use swc_ecma_ast::*; -use swc_ecma_transforms_base::ext::MapWithMut; -use swc_ecma_transforms_base::ext::PatOrExprExt; -use swc_ecma_transforms_base::pass::RepeatedJsPass; -use swc_ecma_transforms_base::scope::IdentType; +use swc_ecma_transforms_base::{ + ext::{MapWithMut, PatOrExprExt}, + pass::RepeatedJsPass, + scope::IdentType, +}; use swc_ecma_utils::{contains_this_expr, find_ids, ident::IdentLike, undefined, Id}; -use swc_ecma_visit::noop_visit_type; use swc_ecma_visit::{ - as_folder, noop_visit_mut_type, Node, Visit, VisitMut, VisitMutWith, VisitWith, + as_folder, noop_visit_mut_type, noop_visit_type, Node, Visit, VisitMut, VisitMutWith, VisitWith, }; mod scope; diff --git a/ecmascript/transforms/optimization/tests/const_modules.rs b/ecmascript/transforms/optimization/tests/const_modules.rs index b1247779aaa4..1d0aa32da7d8 100644 --- a/ecmascript/transforms/optimization/tests/const_modules.rs +++ b/ecmascript/transforms/optimization/tests/const_modules.rs @@ -1,7 +1,6 @@ use std::collections::HashMap; use swc_ecma_transforms_optimization::const_modules; -use swc_ecma_transforms_testing::test; -use swc_ecma_transforms_testing::Tester; +use swc_ecma_transforms_testing::{test, Tester}; use swc_ecma_visit::Fold; fn tr(t: &mut Tester<'_>, sources: &[(&str, &[(&str, &str)])]) -> impl Fold { diff --git a/ecmascript/transforms/optimization/tests/fixture.rs b/ecmascript/transforms/optimization/tests/fixture.rs index 46dcb6a0863c..588ff6eaae2e 100644 --- a/ecmascript/transforms/optimization/tests/fixture.rs +++ b/ecmascript/transforms/optimization/tests/fixture.rs @@ -1,9 +1,7 @@ use std::path::PathBuf; use swc_common::pass::Repeat; -use swc_ecma_parser::EsConfig; -use swc_ecma_parser::Syntax; -use swc_ecma_transforms_optimization::simplify::dce::dce; -use swc_ecma_transforms_optimization::simplify::expr_simplifier; +use swc_ecma_parser::{EsConfig, Syntax}; +use swc_ecma_transforms_optimization::simplify::{dce::dce, expr_simplifier}; use swc_ecma_transforms_testing::test_fixture; #[testing::fixture("tests/dce/**/input.js")] diff --git a/ecmascript/transforms/optimization/tests/simplify.rs b/ecmascript/transforms/optimization/tests/simplify.rs index 55d876763b9e..933268e54d4d 100644 --- a/ecmascript/transforms/optimization/tests/simplify.rs +++ b/ecmascript/transforms/optimization/tests/simplify.rs @@ -1,29 +1,18 @@ //! Copied from PeepholeIntegrationTest from the google closure compiler. -use std::cell::RefCell; -use std::rc::Rc; -use swc_common::chain; -use swc_common::Mark; -use swc_ecma_parser::EsConfig; -use swc_ecma_parser::{Syntax, TsConfig}; -use swc_ecma_transforms_base::helpers::inject_helpers; -use swc_ecma_transforms_base::resolver::resolver; -use swc_ecma_transforms_compat::es2015; -use swc_ecma_transforms_compat::es2016; -use swc_ecma_transforms_compat::es2017; -use swc_ecma_transforms_compat::es2018; -use swc_ecma_transforms_compat::es2020::class_properties; -use swc_ecma_transforms_compat::es3; -use swc_ecma_transforms_module::common_js::common_js; -use swc_ecma_transforms_module::import_analysis::import_analyzer; -use swc_ecma_transforms_module::util::Scope; -use swc_ecma_transforms_optimization::simplify::dce::dce; -use swc_ecma_transforms_optimization::simplify::expr_simplifier; -use swc_ecma_transforms_optimization::simplify::inlining::inlining; -use swc_ecma_transforms_optimization::simplify::simplifier; +use std::{cell::RefCell, rc::Rc}; +use swc_common::{chain, Mark}; +use swc_ecma_parser::{EsConfig, Syntax, TsConfig}; +use swc_ecma_transforms_base::{helpers::inject_helpers, resolver::resolver}; +use swc_ecma_transforms_compat::{es2015, es2016, es2017, es2018, es2020::class_properties, es3}; +use swc_ecma_transforms_module::{ + common_js::common_js, import_analysis::import_analyzer, util::Scope, +}; +use swc_ecma_transforms_optimization::simplify::{ + dce::dce, expr_simplifier, inlining::inlining, simplifier, +}; use swc_ecma_transforms_proposal::decorators; -use swc_ecma_transforms_testing::test; -use swc_ecma_transforms_testing::test_transform; +use swc_ecma_transforms_testing::{test, test_transform}; use swc_ecma_transforms_typescript::strip; fn test(src: &str, expected: &str) { diff --git a/ecmascript/transforms/optimization/tests/simplify_dce.rs b/ecmascript/transforms/optimization/tests/simplify_dce.rs index 21f76ee95cce..939d60082e9d 100644 --- a/ecmascript/transforms/optimization/tests/simplify_dce.rs +++ b/ecmascript/transforms/optimization/tests/simplify_dce.rs @@ -1,11 +1,9 @@ use swc_common::{chain, Mark, SyntaxContext}; use swc_ecma_parser::{EsConfig, Syntax, TsConfig}; use swc_ecma_transforms_base::resolver::resolver; -use swc_ecma_transforms_optimization::simplify::dce; -use swc_ecma_transforms_optimization::simplify::dce::dce; +use swc_ecma_transforms_optimization::simplify::{dce, dce::dce}; use swc_ecma_transforms_proposal::decorators; -use swc_ecma_transforms_testing::test; -use swc_ecma_transforms_testing::test_transform; +use swc_ecma_transforms_testing::{test, test_transform}; use swc_ecma_transforms_typescript::strip; macro_rules! to { diff --git a/ecmascript/transforms/proposal/src/decorators.rs b/ecmascript/transforms/proposal/src/decorators.rs index 77bb10659064..ee7cb8403e2e 100644 --- a/ecmascript/transforms/proposal/src/decorators.rs +++ b/ecmascript/transforms/proposal/src/decorators.rs @@ -1,18 +1,13 @@ use either::Either; use serde::Deserialize; -use std::iter; -use std::mem::take; +use std::{iter, mem::take}; use swc_common::{Spanned, DUMMY_SP}; use swc_ecma_ast::*; use swc_ecma_transforms_base::helper; use swc_ecma_transforms_classes::super_field::SuperFieldAccessFolder; -use swc_ecma_utils::prepend; -use swc_ecma_utils::private_ident; -use swc_ecma_utils::quote_ident; -use swc_ecma_utils::quote_str; use swc_ecma_utils::{ - alias_ident_for, constructor::inject_after_super, prop_name_to_expr_value, undefined, - ExprFactory, IdentExt, + alias_ident_for, constructor::inject_after_super, prepend, private_ident, + prop_name_to_expr_value, quote_ident, quote_str, undefined, ExprFactory, IdentExt, }; use swc_ecma_visit::{noop_fold_type, Fold, FoldWith, Node, Visit, VisitWith}; diff --git a/ecmascript/transforms/proposal/src/decorators/legacy.rs b/ecmascript/transforms/proposal/src/decorators/legacy.rs index 74dce7276adb..35eee368eb4c 100644 --- a/ecmascript/transforms/proposal/src/decorators/legacy.rs +++ b/ecmascript/transforms/proposal/src/decorators/legacy.rs @@ -1,22 +1,16 @@ use self::metadata::{Metadata, ParamMetadata}; -use super::contains_decorator; -use super::DecoratorFinder; +use super::{contains_decorator, DecoratorFinder}; use fxhash::FxHashMap; use smallvec::SmallVec; -use std::mem::replace; -use std::mem::take; +use std::mem::{replace, take}; use swc_common::{util::move_map::MoveMap, DUMMY_SP}; use swc_ecma_ast::*; use swc_ecma_transforms_base::helper; -use swc_ecma_utils::member_expr; -use swc_ecma_utils::private_ident; -use swc_ecma_utils::quote_ident; -use swc_ecma_utils::replace_ident; use swc_ecma_utils::{ - alias_if_required, default_constructor, prepend, prop_name_to_expr_value, undefined, - ExprFactory, ModuleItemLike, StmtLike, + alias_if_required, default_constructor, ident::IdentLike, member_expr, prepend, private_ident, + prop_name_to_expr_value, quote_ident, replace_ident, undefined, ExprFactory, Id, + ModuleItemLike, StmtLike, }; -use swc_ecma_utils::{ident::IdentLike, Id}; use swc_ecma_visit::{noop_fold_type, Fold, FoldWith, Node, Visit, VisitWith}; mod metadata; diff --git a/ecmascript/transforms/proposal/src/decorators/legacy/metadata.rs b/ecmascript/transforms/proposal/src/decorators/legacy/metadata.rs index 92fdf9b1e934..d82757b7a42a 100644 --- a/ecmascript/transforms/proposal/src/decorators/legacy/metadata.rs +++ b/ecmascript/transforms/proposal/src/decorators/legacy/metadata.rs @@ -3,9 +3,7 @@ use fxhash::FxHashMap; use swc_atoms::js_word; use swc_common::{util::move_map::MoveMap, Spanned, DUMMY_SP}; use swc_ecma_ast::*; -use swc_ecma_utils::member_expr; -use swc_ecma_utils::quote_ident; -use swc_ecma_utils::{ident::IdentLike, undefined, ExprFactory, Id}; +use swc_ecma_utils::{ident::IdentLike, member_expr, quote_ident, undefined, ExprFactory, Id}; use swc_ecma_visit::{noop_fold_type, Fold, FoldWith}; /// https://github.com/leonardfactory/babel-plugin-transform-typescript-metadata/blob/master/src/parameter/parameterVisitor.ts diff --git a/ecmascript/transforms/react/src/display_name/mod.rs b/ecmascript/transforms/react/src/display_name/mod.rs index fa4e61a6743d..3fee595e40eb 100644 --- a/ecmascript/transforms/react/src/display_name/mod.rs +++ b/ecmascript/transforms/react/src/display_name/mod.rs @@ -2,8 +2,7 @@ use std::ops::DerefMut; use swc_atoms::js_word; use swc_common::DUMMY_SP; use swc_ecma_ast::*; -use swc_ecma_transforms_base::ext::AsOptExpr; -use swc_ecma_transforms_base::ext::PatOrExprExt; +use swc_ecma_transforms_base::ext::{AsOptExpr, PatOrExprExt}; use swc_ecma_utils::quote_ident; use swc_ecma_visit::{noop_fold_type, Fold, FoldWith}; diff --git a/ecmascript/transforms/react/src/jsx/mod.rs b/ecmascript/transforms/react/src/jsx/mod.rs index bfe8d1d4f935..8eb0af163639 100644 --- a/ecmascript/transforms/react/src/jsx/mod.rs +++ b/ecmascript/transforms/react/src/jsx/mod.rs @@ -3,8 +3,7 @@ use dashmap::DashMap; use once_cell::sync::Lazy; use regex::Regex; use serde::{Deserialize, Serialize}; -use std::iter::once; -use std::{iter, mem}; +use std::{iter, iter::once, mem}; use string_enum::StringEnum; use swc_atoms::{js_word, JsWord}; use swc_common::{ @@ -15,20 +14,11 @@ use swc_common::{ }; use swc_ecma_ast::*; use swc_ecma_parser::{Parser, StringInput, Syntax}; -use swc_ecma_transforms_base::ext::MapWithMut; -use swc_ecma_transforms_base::helper; -use swc_ecma_utils::drop_span; -use swc_ecma_utils::member_expr; -use swc_ecma_utils::prepend; -use swc_ecma_utils::private_ident; -use swc_ecma_utils::quote_ident; -use swc_ecma_utils::ExprFactory; -use swc_ecma_utils::HANDLER; -use swc_ecma_visit::as_folder; -use swc_ecma_visit::noop_visit_mut_type; -use swc_ecma_visit::Fold; -use swc_ecma_visit::VisitMut; -use swc_ecma_visit::VisitMutWith; +use swc_ecma_transforms_base::{ext::MapWithMut, helper}; +use swc_ecma_utils::{ + drop_span, member_expr, prepend, private_ident, quote_ident, ExprFactory, HANDLER, +}; +use swc_ecma_visit::{as_folder, noop_visit_mut_type, Fold, VisitMut, VisitMutWith}; use crate::refresh::options::{deserialize_refresh, RefreshOptions}; diff --git a/ecmascript/transforms/react/src/jsx/tests.rs b/ecmascript/transforms/react/src/jsx/tests.rs index da5e964d11d9..46e13edeb57c 100644 --- a/ecmascript/transforms/react/src/jsx/tests.rs +++ b/ecmascript/transforms/react/src/jsx/tests.rs @@ -3,14 +3,12 @@ use crate::display_name; use std::path::PathBuf; use swc_common::{chain, Mark}; use swc_ecma_parser::EsConfig; -use swc_ecma_transforms_compat::es2015::arrow; -use swc_ecma_transforms_compat::es2015::classes; -use swc_ecma_transforms_compat::es3::property_literals; +use swc_ecma_transforms_compat::{ + es2015::{arrow, classes}, + es3::property_literals, +}; use swc_ecma_transforms_module::common_js::common_js; -use swc_ecma_transforms_testing::parse_options; -use swc_ecma_transforms_testing::test; -use swc_ecma_transforms_testing::test_fixture; -use swc_ecma_transforms_testing::Tester; +use swc_ecma_transforms_testing::{parse_options, test, test_fixture, Tester}; fn tr(t: &mut Tester, options: Options) -> impl Fold { chain!( diff --git a/ecmascript/transforms/react/src/jsx_src/tests.rs b/ecmascript/transforms/react/src/jsx_src/tests.rs index a1805b98bab9..7f3c5660476e 100644 --- a/ecmascript/transforms/react/src/jsx_src/tests.rs +++ b/ecmascript/transforms/react/src/jsx_src/tests.rs @@ -1,7 +1,6 @@ use super::*; use swc_common::{sync::Lrc, FilePathMapping}; -use swc_ecma_transforms_testing::test; -use swc_ecma_transforms_testing::test_exec; +use swc_ecma_transforms_testing::{test, test_exec}; fn tr() -> impl Fold { let cm = Lrc::new(SourceMap::new(FilePathMapping::empty())); diff --git a/ecmascript/transforms/react/src/lib.rs b/ecmascript/transforms/react/src/lib.rs index 455b2d44c3bc..af84c716deae 100644 --- a/ecmascript/transforms/react/src/lib.rs +++ b/ecmascript/transforms/react/src/lib.rs @@ -1,12 +1,10 @@ -pub use self::jsx::Runtime; -pub use self::refresh::options::RefreshOptions; pub use self::{ display_name::display_name, - jsx::{jsx, Options}, + jsx::{jsx, Options, Runtime}, jsx_self::jsx_self, jsx_src::jsx_src, pure_annotations::pure_annotations, - refresh::refresh, + refresh::{options::RefreshOptions, refresh}, }; use std::mem; use swc_common::{chain, comments::Comments, sync::Lrc, SourceMap}; diff --git a/ecmascript/transforms/react/src/pure_annotations/tests.rs b/ecmascript/transforms/react/src/pure_annotations/tests.rs index 19e56a2064ad..bb522e71a7b9 100644 --- a/ecmascript/transforms/react/src/pure_annotations/tests.rs +++ b/ecmascript/transforms/react/src/pure_annotations/tests.rs @@ -1,6 +1,5 @@ use super::*; -use swc_common::comments::SingleThreadedComments; -use swc_common::{sync::Lrc, FileName, SourceMap}; +use swc_common::{comments::SingleThreadedComments, sync::Lrc, FileName, SourceMap}; use swc_ecma_codegen::{text_writer::JsWriter, Emitter}; use swc_ecma_parser::{Parser, StringInput}; use swc_ecma_transforms_base::resolver; diff --git a/ecmascript/transforms/react/src/refresh/mod.rs b/ecmascript/transforms/react/src/refresh/mod.rs index 972d078b0b20..1b953ea0567e 100644 --- a/ecmascript/transforms/react/src/refresh/mod.rs +++ b/ecmascript/transforms/react/src/refresh/mod.rs @@ -1,5 +1,7 @@ -use std::collections::{HashMap, HashSet}; -use std::mem; +use std::{ + collections::{HashMap, HashSet}, + mem, +}; use base64; use indexmap::IndexSet; @@ -8,9 +10,10 @@ use regex::Regex; use sha1::{Digest, Sha1}; use swc_atoms::JsWord; -use swc_common::BytePos; use swc_common::{ - comments::Comments, comments::CommentsExt, sync::Lrc, SourceMap, Span, Spanned, DUMMY_SP, + comments::{Comments, CommentsExt}, + sync::Lrc, + BytePos, SourceMap, Span, Spanned, DUMMY_SP, }; use swc_ecma_ast::*; use swc_ecma_transforms_base::ext::MapWithMut; diff --git a/ecmascript/transforms/src/lib.rs b/ecmascript/transforms/src/lib.rs index a0d1fb0d5d83..d170fd3f3d2d 100644 --- a/ecmascript/transforms/src/lib.rs +++ b/ecmascript/transforms/src/lib.rs @@ -5,12 +5,7 @@ pub use self::{ hygiene::hygiene, resolver::{resolver, resolver_with_mark}, }; -pub use swc_ecma_transforms_base::fixer; -pub use swc_ecma_transforms_base::helpers; -pub use swc_ecma_transforms_base::hygiene; -pub use swc_ecma_transforms_base::pass; -pub use swc_ecma_transforms_base::perf; -pub use swc_ecma_transforms_base::resolver; +pub use swc_ecma_transforms_base::{fixer, helpers, hygiene, pass, perf, resolver}; #[cfg(feature = "swc_ecma_transforms_compat")] pub use swc_ecma_transforms_compat as compat; #[cfg(feature = "swc_ecma_transforms_module")] diff --git a/ecmascript/transforms/testing/src/lib.rs b/ecmascript/transforms/testing/src/lib.rs index a7d22d6ffea0..df2c8a0b7e39 100644 --- a/ecmascript/transforms/testing/src/lib.rs +++ b/ecmascript/transforms/testing/src/lib.rs @@ -1,42 +1,31 @@ use ansi_term::Color; use serde::de::DeserializeOwned; -use std::env; -use std::fs::read_to_string; -use std::mem::replace; -use std::mem::take; -use std::rc::Rc; use std::{ - fs::{create_dir_all, remove_dir_all, OpenOptions}, + env, + fs::{create_dir_all, read_to_string, remove_dir_all, OpenOptions}, io::{self, Write}, + mem::{replace, take}, path::Path, process::Command, + rc::Rc, sync::{Arc, RwLock}, }; -use swc_common::chain; -use swc_common::DUMMY_SP; use swc_common::{ - comments::SingleThreadedComments, errors::Handler, sync::Lrc, FileName, SourceMap, + chain, comments::SingleThreadedComments, errors::Handler, sync::Lrc, FileName, SourceMap, + DUMMY_SP, }; use swc_ecma_ast::{Pat, *}; use swc_ecma_codegen::Emitter; use swc_ecma_parser::{error::Error, lexer::Lexer, Parser, StringInput, Syntax}; -use swc_ecma_transforms_base::fixer; -use swc_ecma_transforms_base::helpers::{inject_helpers, HELPERS}; -use swc_ecma_transforms_base::hygiene; -use swc_ecma_utils::quote_ident; -use swc_ecma_utils::quote_str; -use swc_ecma_utils::DropSpan; -use swc_ecma_utils::ExprFactory; -use swc_ecma_utils::HANDLER; -use swc_ecma_visit::noop_visit_mut_type; -use swc_ecma_visit::VisitMut; -use swc_ecma_visit::VisitMutWith; -use swc_ecma_visit::{as_folder, Fold, FoldWith}; +use swc_ecma_transforms_base::{ + fixer, + helpers::{inject_helpers, HELPERS}, + hygiene, +}; +use swc_ecma_utils::{quote_ident, quote_str, DropSpan, ExprFactory, HANDLER}; +use swc_ecma_visit::{as_folder, noop_visit_mut_type, Fold, FoldWith, VisitMut, VisitMutWith}; use tempfile::tempdir_in; -use testing::assert_eq; -use testing::find_executable; -use testing::DebugUsingDisplay; -use testing::NormalizedOutput; +use testing::{assert_eq, find_executable, DebugUsingDisplay, NormalizedOutput}; pub struct Tester<'a> { pub cm: Lrc, diff --git a/ecmascript/transforms/tests/decorators.rs b/ecmascript/transforms/tests/decorators.rs index b3b0bc0faf41..85c4d96648a3 100644 --- a/ecmascript/transforms/tests/decorators.rs +++ b/ecmascript/transforms/tests/decorators.rs @@ -5,19 +5,17 @@ feature = "swc_ecma_transforms_proposal", ))] -use swc_common::chain; -use swc_common::Mark; +use swc_common::{chain, Mark}; use swc_ecma_parser::{EsConfig, Syntax, TsConfig}; use swc_ecma_transforms_base::resolver::resolver; -use swc_ecma_transforms_compat::es2015::classes; -use swc_ecma_transforms_compat::es2015::function_name; -use swc_ecma_transforms_compat::es2020::class_properties; +use swc_ecma_transforms_compat::{ + es2015::{classes, function_name}, + es2020::class_properties, +}; use swc_ecma_transforms_module::common_js; use swc_ecma_transforms_optimization::simplify::inlining; -use swc_ecma_transforms_proposal::decorators; -use swc_ecma_transforms_proposal::decorators::Config; -use swc_ecma_transforms_testing::test; -use swc_ecma_transforms_testing::test_exec; +use swc_ecma_transforms_proposal::{decorators, decorators::Config}; +use swc_ecma_transforms_testing::{test, test_exec}; use swc_ecma_transforms_typescript::strip; use swc_ecma_visit::Fold; diff --git a/ecmascript/transforms/tests/es2015_function_name.rs b/ecmascript/transforms/tests/es2015_function_name.rs index 58b69493fc9f..d3deae741d2d 100644 --- a/ecmascript/transforms/tests/es2015_function_name.rs +++ b/ecmascript/transforms/tests/es2015_function_name.rs @@ -8,12 +8,10 @@ use swc_common::{chain, Mark}; use swc_ecma_parser::Syntax; use swc_ecma_transforms_base::resolver::resolver; -use swc_ecma_transforms_compat::es2015::arrow; -use swc_ecma_transforms_compat::es2015::block_scoping; -use swc_ecma_transforms_compat::es2015::classes; -use swc_ecma_transforms_compat::es2015::function_name; -use swc_ecma_transforms_compat::es2015::shorthand; -use swc_ecma_transforms_compat::es2020::class_properties; +use swc_ecma_transforms_compat::{ + es2015::{arrow, block_scoping, classes, function_name, shorthand}, + es2020::class_properties, +}; use swc_ecma_transforms_module::common_js::common_js; use swc_ecma_transforms_proposal::decorators; use swc_ecma_transforms_testing::test; diff --git a/ecmascript/transforms/typescript/src/strip.rs b/ecmascript/transforms/typescript/src/strip.rs index 6baff5ce5473..15b6785c405d 100644 --- a/ecmascript/transforms/typescript/src/strip.rs +++ b/ecmascript/transforms/typescript/src/strip.rs @@ -1,19 +1,15 @@ -use fxhash::FxHashMap; -use fxhash::FxHashSet; +use fxhash::{FxHashMap, FxHashSet}; use serde::{Deserialize, Serialize}; use std::{borrow::Borrow, mem::take}; use swc_atoms::{js_word, JsWord}; use swc_common::{util::move_map::MoveMap, Span, Spanned, SyntaxContext, DUMMY_SP}; use swc_ecma_ast::*; use swc_ecma_transforms_base::ext::MapWithMut; -use swc_ecma_utils::member_expr; -use swc_ecma_utils::private_ident; -use swc_ecma_utils::quote_ident; -use swc_ecma_utils::replace_ident; -use swc_ecma_utils::var::VarCollector; -use swc_ecma_utils::ExprFactory; -use swc_ecma_utils::{constructor::inject_after_super, default_constructor}; -use swc_ecma_utils::{ident::IdentLike, prepend, Id, ModuleItemLike, StmtLike}; +use swc_ecma_utils::{ + constructor::inject_after_super, default_constructor, ident::IdentLike, member_expr, prepend, + private_ident, quote_ident, replace_ident, var::VarCollector, ExprFactory, Id, ModuleItemLike, + StmtLike, +}; use swc_ecma_visit::{as_folder, Fold, Node, Visit, VisitMut, VisitMutWith, VisitWith}; /// Value does not contain TsLit::Bool diff --git a/ecmascript/transforms/typescript/tests/strip.rs b/ecmascript/transforms/typescript/tests/strip.rs index 889f00c81ae3..827c35ac552c 100644 --- a/ecmascript/transforms/typescript/tests/strip.rs +++ b/ecmascript/transforms/typescript/tests/strip.rs @@ -1,15 +1,13 @@ use swc_common::chain; use swc_ecma_parser::{Syntax, TsConfig}; use swc_ecma_transforms_base::resolver::resolver; -use swc_ecma_transforms_compat::es2017::async_to_generator; -use swc_ecma_transforms_compat::es2020::class_properties; -use swc_ecma_transforms_compat::es2020::nullish_coalescing; -use swc_ecma_transforms_compat::es2020::optional_chaining; +use swc_ecma_transforms_compat::{ + es2017::async_to_generator, + es2020::{class_properties, nullish_coalescing, optional_chaining}, +}; use swc_ecma_transforms_proposal::decorators; -use swc_ecma_transforms_testing::test; -use swc_ecma_transforms_testing::test_exec; -use swc_ecma_transforms_typescript::strip; -use swc_ecma_transforms_typescript::strip::strip_with_config; +use swc_ecma_transforms_testing::{test, test_exec}; +use swc_ecma_transforms_typescript::{strip, strip::strip_with_config}; use swc_ecma_visit::Fold; fn tr() -> impl Fold { diff --git a/ecmascript/transforms/typescript/tests/strip_correctness.rs b/ecmascript/transforms/typescript/tests/strip_correctness.rs index 77a941c8e3c5..5b3c1650dfbc 100644 --- a/ecmascript/transforms/typescript/tests/strip_correctness.rs +++ b/ecmascript/transforms/typescript/tests/strip_correctness.rs @@ -12,8 +12,7 @@ use swc_ecma_ast::*; use swc_ecma_codegen::{self, Emitter}; use swc_ecma_parser::{lexer::Lexer, EsConfig, Parser, StringInput, Syntax, TsConfig}; use swc_ecma_transforms_base::fixer::fixer; -use swc_ecma_transforms_typescript::strip; -use swc_ecma_transforms_typescript::strip::strip_with_config; +use swc_ecma_transforms_typescript::{strip, strip::strip_with_config}; use swc_ecma_visit::{Fold, FoldWith}; use test::{ test_main, DynTestFn, Options, ShouldPanic::No, TestDesc, TestDescAndFn, TestName, TestType, diff --git a/ecmascript/utils/src/ident.rs b/ecmascript/utils/src/ident.rs index ba3f482410ff..10f89253f922 100644 --- a/ecmascript/utils/src/ident.rs +++ b/ecmascript/utils/src/ident.rs @@ -1,7 +1,6 @@ use swc_atoms::JsWord; use swc_common::{Span, SyntaxContext}; -use swc_ecma_ast::BindingIdent; -use swc_ecma_ast::Ident; +use swc_ecma_ast::{BindingIdent, Ident}; pub trait IdentLike: Sized { fn from_ident(i: &Ident) -> Self; diff --git a/macros/eq_ignore/src/lib.rs b/macros/eq_ignore/src/lib.rs index b328d311d93d..f7e704e81b75 100644 --- a/macros/eq_ignore/src/lib.rs +++ b/macros/eq_ignore/src/lib.rs @@ -1,31 +1,10 @@ -use pmutil::q; -use pmutil::IdentExt; -use pmutil::SpanExt; +use pmutil::{q, IdentExt, SpanExt}; use proc_macro2::Span; -use syn::parse; -use syn::punctuated::Punctuated; -use syn::spanned::Spanned; -use syn::Arm; -use syn::BinOp; -use syn::Block; -use syn::Data; -use syn::DeriveInput; -use syn::Expr; -use syn::ExprBinary; -use syn::ExprBlock; -use syn::Field; -use syn::FieldPat; -use syn::Fields; -use syn::Ident; -use syn::Index; -use syn::Member; -use syn::Pat; -use syn::PatIdent; -use syn::PatStruct; -use syn::PatTuple; -use syn::Path; -use syn::Stmt; -use syn::Token; +use syn::{ + parse, punctuated::Punctuated, spanned::Spanned, Arm, BinOp, Block, Data, DeriveInput, Expr, + ExprBinary, ExprBlock, Field, FieldPat, Fields, Ident, Index, Member, Pat, PatIdent, PatStruct, + PatTuple, Path, Stmt, Token, +}; /// Derives `swc_common::TypeEq`. /// diff --git a/node-swc/__tests__/error_test.js b/node-swc/__tests__/error_test.mjs similarity index 57% rename from node-swc/__tests__/error_test.js rename to node-swc/__tests__/error_test.mjs index c430cbc18c06..5486e390472d 100644 --- a/node-swc/__tests__/error_test.js +++ b/node-swc/__tests__/error_test.mjs @@ -1,4 +1,8 @@ -const swc = require("../../"); +import { dirname } from 'path'; +import { fileURLToPath } from 'url'; +import * as swc from '../..'; + +const __dirname = dirname(fileURLToPath(import.meta.url)); it("should work", () => { expect(() => { @@ -33,3 +37,15 @@ export async function getDependency(): Promise { swc.transformSync(code, options) }).toThrow("unknown variant `esnext`"); }); + +it("should report good error", () => { + expect(() => { + swc.transformFileSync(__dirname + "/../tests/error/simple.js"); + }).toThrow("failed to load config for"); +}); + +it("should report good error (handler)", () => { + expect(() => { + swc.transformFileSync(__dirname + "/../tests/legacy/octal.js"); + }).toThrow("console.log(00017)"); +}); \ No newline at end of file diff --git a/node-swc/tests/legacy/octal.js b/node-swc/tests/legacy/octal.js new file mode 100644 index 000000000000..f8b5ffcedc1b --- /dev/null +++ b/node-swc/tests/legacy/octal.js @@ -0,0 +1 @@ +console.log(00017) \ No newline at end of file diff --git a/node/base/Cargo.toml b/node/base/Cargo.toml index 96bb8d6b233e..782d12126f9e 100644 --- a/node/base/Cargo.toml +++ b/node/base/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" license = "Apache-2.0/MIT" name = "swc_node_base" repository = "https://github.com/swc-project/swc.git" -version = "0.2.0" +version = "0.2.1" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -15,4 +15,4 @@ dashmap = "4.0.2" swc_common = {version = "0.11.0", path = "../../common"} [target.'cfg(all(target_arch = "x86_64", not(target_env = "musl")))'.dependencies] -mimalloc-rust = "0.1" +mimalloc-rust = "=0.1.1" diff --git a/node/binding/Cargo.toml b/node/binding/Cargo.toml index a73e93c110d2..9e187f58ef71 100644 --- a/node/binding/Cargo.toml +++ b/node/binding/Cargo.toml @@ -24,7 +24,6 @@ napi-derive = {version = "1"} path-clean = "0.1" serde = {version = "1", features = ["derive"]} serde_json = "1" -spack = {path = "../../spack"} swc = {path = "../../"} swc_atoms = {version = "0.2.4", path = "../../atoms"} swc_babel_compat = {path = "../../babel/compat"} @@ -33,3 +32,4 @@ swc_common = {path = "../../common", features = ["sourcemap"]} swc_ecma_ast = {path = "../../ecmascript/ast"} swc_ecma_parser = {path = "../../ecmascript/parser"} swc_node_base = {path = "../base"} +swc_node_bundler = {path = "../bundler"} diff --git a/node/binding/src/bundle.rs b/node/binding/src/bundle.rs index 7a7c6079c21a..2d94a095f5d8 100644 --- a/node/binding/src/bundle.rs +++ b/node/binding/src/bundle.rs @@ -15,8 +15,7 @@ use swc::{ resolver::{environment_resolver, paths_resolver}, Compiler, TransformOutput, }; -use swc_atoms::js_word; -use swc_atoms::JsWord; +use swc_atoms::{js_word, JsWord}; use swc_bundler::{BundleKind, Bundler, Load, ModuleRecord, Resolve}; use swc_common::Span; use swc_ecma_ast::{ @@ -35,7 +34,7 @@ struct StaticConfigItem { #[serde(default)] working_dir: String, #[serde(flatten)] - config: spack::config::Config, + config: swc_node_bundler::config::Config, } struct BundleTask { @@ -187,7 +186,7 @@ pub(crate) fn bundle(cx: CallContext) -> napi::Result { let static_items: StaticConfigItem = cx.get_deserialized(0)?; - let loader = Box::new(spack::loaders::swc::SwcLoader::new( + let loader = Box::new(swc_node_bundler::loaders::swc::SwcLoader::new( c.clone(), static_items .config diff --git a/spack/.gitignore b/node/bundler/.gitignore similarity index 100% rename from spack/.gitignore rename to node/bundler/.gitignore diff --git a/node/bundler/Cargo.toml b/node/bundler/Cargo.toml new file mode 100644 index 000000000000..c380923be453 --- /dev/null +++ b/node/bundler/Cargo.toml @@ -0,0 +1,44 @@ +[package] +authors = ["강동윤 "] +build = "build.rs" +description = "Speedy web compiler" +documentation = "https://rustdoc.swc.rs/swc/" +edition = "2018" +license = "Apache-2.0/MIT" +name = "swc_node_bundler" +publish = false +repository = "https://github.com/swc-project/swc.git" +version = "0.0.0" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +anyhow = "1" +dashmap = "4.0.2" +fxhash = "0.2.1" +is-macro = "0.1.8" +log = "0.4.8" +once_cell = "1" +regex = "1" +serde = {version = "1", features = ["derive"]} +serde_json = "1" +string_enum = {version = "0.3", path = "../../macros/string_enum"} +swc = {path = "../../"} +swc_atoms = {path = "../../atoms"} +swc_bundler = {path = "../../bundler"} +swc_common = {path = "../../common", features = ["concurrent"]} +swc_ecma_ast = {path = "../../ecmascript/ast"} +swc_ecma_codegen = {path = "../../ecmascript/codegen"} +swc_ecma_loader = {path = "../../ecmascript/loader"} +swc_ecma_parser = {path = "../../ecmascript/parser"} +swc_ecma_transforms = {path = "../../ecmascript/transforms"} +swc_ecma_utils = {path = "../../ecmascript/utils"} +swc_ecma_visit = {path = "../../ecmascript/visit"} +swc_node_base = {path = "../../node/base"} + +[dev-dependencies] +pretty_assertions = "0.6.1" +pretty_env_logger = "0.3" +tempfile = "3" +testing = {path = "../../testing"} +walkdir = "2.3.1" diff --git a/spack/benches/bench.rs b/node/bundler/benches/bench.rs similarity index 100% rename from spack/benches/bench.rs rename to node/bundler/benches/bench.rs diff --git a/spack/build.rs b/node/bundler/build.rs similarity index 100% rename from spack/build.rs rename to node/bundler/build.rs diff --git a/spack/scripts/fixture.sh b/node/bundler/scripts/fixture.sh similarity index 100% rename from spack/scripts/fixture.sh rename to node/bundler/scripts/fixture.sh diff --git a/spack/src/config/mod.rs b/node/bundler/src/config/mod.rs similarity index 100% rename from spack/src/config/mod.rs rename to node/bundler/src/config/mod.rs diff --git a/spack/src/config/module/mod.rs b/node/bundler/src/config/module/mod.rs similarity index 100% rename from spack/src/config/module/mod.rs rename to node/bundler/src/config/module/mod.rs diff --git a/spack/src/config/optimization.rs b/node/bundler/src/config/optimization.rs similarity index 100% rename from spack/src/config/optimization.rs rename to node/bundler/src/config/optimization.rs diff --git a/spack/src/config/output.rs b/node/bundler/src/config/output.rs similarity index 100% rename from spack/src/config/output.rs rename to node/bundler/src/config/output.rs diff --git a/spack/src/config/resolve.rs b/node/bundler/src/config/resolve.rs similarity index 100% rename from spack/src/config/resolve.rs rename to node/bundler/src/config/resolve.rs diff --git a/spack/src/lib.rs b/node/bundler/src/lib.rs similarity index 100% rename from spack/src/lib.rs rename to node/bundler/src/lib.rs diff --git a/spack/src/loaders/json.rs b/node/bundler/src/loaders/json.rs similarity index 80% rename from spack/src/loaders/json.rs rename to node/bundler/src/loaders/json.rs index 8bbd48837e19..fedcdf628666 100644 --- a/spack/src/loaders/json.rs +++ b/node/bundler/src/loaders/json.rs @@ -1,14 +1,8 @@ -use anyhow::anyhow; -use anyhow::Error; +use anyhow::{anyhow, Error}; use std::sync::Arc; -use swc_common::input::SourceFileInput; -use swc_common::SourceFile; -use swc_common::DUMMY_SP; -use swc_ecma_ast::EsVersion; -use swc_ecma_ast::*; -use swc_ecma_parser::lexer::Lexer; -use swc_ecma_parser::Parser; -use swc_ecma_parser::Syntax; +use swc_common::{input::SourceFileInput, SourceFile, DUMMY_SP}; +use swc_ecma_ast::{EsVersion, *}; +use swc_ecma_parser::{lexer::Lexer, Parser, Syntax}; pub(super) fn load_json_as_module(fm: &Arc) -> Result { let lexer = Lexer::new( diff --git a/spack/src/loaders/mod.rs b/node/bundler/src/loaders/mod.rs similarity index 100% rename from spack/src/loaders/mod.rs rename to node/bundler/src/loaders/mod.rs diff --git a/spack/src/loaders/swc.rs b/node/bundler/src/loaders/swc.rs similarity index 97% rename from spack/src/loaders/swc.rs rename to node/bundler/src/loaders/swc.rs index 2f3e5576e6b9..2e781aff60a2 100644 --- a/spack/src/loaders/swc.rs +++ b/node/bundler/src/loaders/swc.rs @@ -2,14 +2,14 @@ use crate::loaders::json::load_json_as_module; use anyhow::{bail, Context, Error}; use helpers::Helpers; use std::{collections::HashMap, env, sync::Arc}; -use swc::config::{InputSourceMap, JscConfig, TransformConfig}; -use swc::try_with_handler; +use swc::{ + config::{InputSourceMap, JscConfig, TransformConfig}, + try_with_handler, +}; use swc_atoms::JsWord; use swc_bundler::{Load, ModuleData}; -use swc_common::errors::Handler; -use swc_common::{FileName, DUMMY_SP}; -use swc_ecma_ast::Module; -use swc_ecma_ast::{Expr, Lit, Program, Str}; +use swc_common::{errors::Handler, FileName, DUMMY_SP}; +use swc_ecma_ast::{Expr, Lit, Module, Program, Str}; use swc_ecma_parser::JscTarget; use swc_ecma_transforms::{ helpers, diff --git a/spack/tests/fixture.rs b/node/bundler/tests/fixture.rs similarity index 99% rename from spack/tests/fixture.rs rename to node/bundler/tests/fixture.rs index 216e85109200..097cdc384a9f 100644 --- a/spack/tests/fixture.rs +++ b/node/bundler/tests/fixture.rs @@ -3,7 +3,6 @@ extern crate test; use anyhow::Error; -use spack::loaders::swc::SwcLoader; use std::{ collections::HashMap, env, @@ -23,6 +22,7 @@ use swc_ecma_ast::{ use swc_ecma_parser::JscTarget; use swc_ecma_transforms::fixer; use swc_ecma_visit::FoldWith; +use swc_node_bundler::loaders::swc::SwcLoader; use test::{ test_main, DynTestFn, Options, ShouldPanic::No, TestDesc, TestDescAndFn, TestName, TestType, }; diff --git a/spack/tests/integration/react/.gitignore b/node/bundler/tests/integration/react/.gitignore similarity index 100% rename from spack/tests/integration/react/.gitignore rename to node/bundler/tests/integration/react/.gitignore diff --git a/spack/tests/integration/react/package.json b/node/bundler/tests/integration/react/package.json similarity index 100% rename from spack/tests/integration/react/package.json rename to node/bundler/tests/integration/react/package.json diff --git a/spack/tests/integration/react/spack.config.js b/node/bundler/tests/integration/react/spack.config.js similarity index 100% rename from spack/tests/integration/react/spack.config.js rename to node/bundler/tests/integration/react/spack.config.js diff --git a/spack/tests/integration/react/src/.swcrc b/node/bundler/tests/integration/react/src/.swcrc similarity index 100% rename from spack/tests/integration/react/src/.swcrc rename to node/bundler/tests/integration/react/src/.swcrc diff --git a/spack/tests/integration/react/src/index.tsx b/node/bundler/tests/integration/react/src/index.tsx similarity index 100% rename from spack/tests/integration/react/src/index.tsx rename to node/bundler/tests/integration/react/src/index.tsx diff --git a/spack/tests/package.json b/node/bundler/tests/package.json similarity index 100% rename from spack/tests/package.json rename to node/bundler/tests/package.json diff --git a/spack/tests/pass/.swcrc b/node/bundler/tests/pass/.swcrc similarity index 100% rename from spack/tests/pass/.swcrc rename to node/bundler/tests/pass/.swcrc diff --git a/spack/tests/pass/alias/export-default/input/a.js b/node/bundler/tests/pass/alias/export-default/input/a.js similarity index 100% rename from spack/tests/pass/alias/export-default/input/a.js rename to node/bundler/tests/pass/alias/export-default/input/a.js diff --git a/spack/tests/pass/alias/export-default/input/entry.js b/node/bundler/tests/pass/alias/export-default/input/entry.js similarity index 100% rename from spack/tests/pass/alias/export-default/input/entry.js rename to node/bundler/tests/pass/alias/export-default/input/entry.js diff --git a/spack/tests/pass/alias/export-default/output/entry.js b/node/bundler/tests/pass/alias/export-default/output/entry.js similarity index 100% rename from spack/tests/pass/alias/export-default/output/entry.js rename to node/bundler/tests/pass/alias/export-default/output/entry.js diff --git a/spack/tests/pass/alias/export-named-1/input/a.js b/node/bundler/tests/pass/alias/export-named-1/input/a.js similarity index 100% rename from spack/tests/pass/alias/export-named-1/input/a.js rename to node/bundler/tests/pass/alias/export-named-1/input/a.js diff --git a/spack/tests/pass/alias/export-named-1/input/entry.js b/node/bundler/tests/pass/alias/export-named-1/input/entry.js similarity index 100% rename from spack/tests/pass/alias/export-named-1/input/entry.js rename to node/bundler/tests/pass/alias/export-named-1/input/entry.js diff --git a/spack/tests/pass/alias/export-named-1/output/entry.js b/node/bundler/tests/pass/alias/export-named-1/output/entry.js similarity index 100% rename from spack/tests/pass/alias/export-named-1/output/entry.js rename to node/bundler/tests/pass/alias/export-named-1/output/entry.js diff --git a/spack/tests/pass/alias/export-named-optimization/input/a.js b/node/bundler/tests/pass/alias/export-named-optimization/input/a.js similarity index 100% rename from spack/tests/pass/alias/export-named-optimization/input/a.js rename to node/bundler/tests/pass/alias/export-named-optimization/input/a.js diff --git a/spack/tests/pass/alias/export-named-optimization/input/entry.js b/node/bundler/tests/pass/alias/export-named-optimization/input/entry.js similarity index 100% rename from spack/tests/pass/alias/export-named-optimization/input/entry.js rename to node/bundler/tests/pass/alias/export-named-optimization/input/entry.js diff --git a/spack/tests/pass/alias/export-named-optimization/output/entry.js b/node/bundler/tests/pass/alias/export-named-optimization/output/entry.js similarity index 100% rename from spack/tests/pass/alias/export-named-optimization/output/entry.js rename to node/bundler/tests/pass/alias/export-named-optimization/output/entry.js diff --git a/spack/tests/pass/alias/export-named-same-name/input/a.js b/node/bundler/tests/pass/alias/export-named-same-name/input/a.js similarity index 100% rename from spack/tests/pass/alias/export-named-same-name/input/a.js rename to node/bundler/tests/pass/alias/export-named-same-name/input/a.js diff --git a/spack/tests/pass/alias/export-named-same-name/input/entry.js b/node/bundler/tests/pass/alias/export-named-same-name/input/entry.js similarity index 100% rename from spack/tests/pass/alias/export-named-same-name/input/entry.js rename to node/bundler/tests/pass/alias/export-named-same-name/input/entry.js diff --git a/spack/tests/pass/alias/export-named-same-name/output/entry.js b/node/bundler/tests/pass/alias/export-named-same-name/output/entry.js similarity index 100% rename from spack/tests/pass/alias/export-named-same-name/output/entry.js rename to node/bundler/tests/pass/alias/export-named-same-name/output/entry.js diff --git a/spack/tests/pass/alias/import/multi/input/a.js b/node/bundler/tests/pass/alias/import/multi/input/a.js similarity index 100% rename from spack/tests/pass/alias/import/multi/input/a.js rename to node/bundler/tests/pass/alias/import/multi/input/a.js diff --git a/spack/tests/pass/alias/import/multi/input/b.js b/node/bundler/tests/pass/alias/import/multi/input/b.js similarity index 100% rename from spack/tests/pass/alias/import/multi/input/b.js rename to node/bundler/tests/pass/alias/import/multi/input/b.js diff --git a/spack/tests/pass/alias/import/multi/input/entry.js b/node/bundler/tests/pass/alias/import/multi/input/entry.js similarity index 100% rename from spack/tests/pass/alias/import/multi/input/entry.js rename to node/bundler/tests/pass/alias/import/multi/input/entry.js diff --git a/spack/tests/pass/alias/import/multi/output/entry.js b/node/bundler/tests/pass/alias/import/multi/output/entry.js similarity index 100% rename from spack/tests/pass/alias/import/multi/output/entry.js rename to node/bundler/tests/pass/alias/import/multi/output/entry.js diff --git a/spack/tests/pass/alias/import/simple/input/a.js b/node/bundler/tests/pass/alias/import/simple/input/a.js similarity index 100% rename from spack/tests/pass/alias/import/simple/input/a.js rename to node/bundler/tests/pass/alias/import/simple/input/a.js diff --git a/spack/tests/pass/alias/import/simple/input/entry.js b/node/bundler/tests/pass/alias/import/simple/input/entry.js similarity index 100% rename from spack/tests/pass/alias/import/simple/input/entry.js rename to node/bundler/tests/pass/alias/import/simple/input/entry.js diff --git a/spack/tests/pass/alias/import/simple/output/entry.js b/node/bundler/tests/pass/alias/import/simple/output/entry.js similarity index 100% rename from spack/tests/pass/alias/import/simple/output/entry.js rename to node/bundler/tests/pass/alias/import/simple/output/entry.js diff --git a/spack/tests/pass/basic/class-inheritance/input/a.js b/node/bundler/tests/pass/basic/class-inheritance/input/a.js similarity index 100% rename from spack/tests/pass/basic/class-inheritance/input/a.js rename to node/bundler/tests/pass/basic/class-inheritance/input/a.js diff --git a/spack/tests/pass/basic/class-inheritance/input/b.js b/node/bundler/tests/pass/basic/class-inheritance/input/b.js similarity index 100% rename from spack/tests/pass/basic/class-inheritance/input/b.js rename to node/bundler/tests/pass/basic/class-inheritance/input/b.js diff --git a/spack/tests/pass/basic/extends/input/a.js b/node/bundler/tests/pass/basic/extends/input/a.js similarity index 100% rename from spack/tests/pass/basic/extends/input/a.js rename to node/bundler/tests/pass/basic/extends/input/a.js diff --git a/spack/tests/pass/basic/extends/input/b.js b/node/bundler/tests/pass/basic/extends/input/b.js similarity index 100% rename from spack/tests/pass/basic/extends/input/b.js rename to node/bundler/tests/pass/basic/extends/input/b.js diff --git a/spack/tests/pass/basic/extends/input/entry.js b/node/bundler/tests/pass/basic/extends/input/entry.js similarity index 100% rename from spack/tests/pass/basic/extends/input/entry.js rename to node/bundler/tests/pass/basic/extends/input/entry.js diff --git a/spack/tests/pass/basic/extends/output/entry.js b/node/bundler/tests/pass/basic/extends/output/entry.js similarity index 100% rename from spack/tests/pass/basic/extends/output/entry.js rename to node/bundler/tests/pass/basic/extends/output/entry.js diff --git a/spack/tests/pass/basic/no-import/input/entry.js b/node/bundler/tests/pass/basic/no-import/input/entry.js similarity index 100% rename from spack/tests/pass/basic/no-import/input/entry.js rename to node/bundler/tests/pass/basic/no-import/input/entry.js diff --git a/spack/tests/pass/basic/no-import/output/entry.js b/node/bundler/tests/pass/basic/no-import/output/entry.js similarity index 100% rename from spack/tests/pass/basic/no-import/output/entry.js rename to node/bundler/tests/pass/basic/no-import/output/entry.js diff --git a/spack/tests/pass/basic/relative-import-const/input/a.js b/node/bundler/tests/pass/basic/relative-import-const/input/a.js similarity index 100% rename from spack/tests/pass/basic/relative-import-const/input/a.js rename to node/bundler/tests/pass/basic/relative-import-const/input/a.js diff --git a/spack/tests/pass/basic/relative-import-const/input/entry.js b/node/bundler/tests/pass/basic/relative-import-const/input/entry.js similarity index 100% rename from spack/tests/pass/basic/relative-import-const/input/entry.js rename to node/bundler/tests/pass/basic/relative-import-const/input/entry.js diff --git a/spack/tests/pass/basic/relative-import-const/output/entry.js b/node/bundler/tests/pass/basic/relative-import-const/output/entry.js similarity index 100% rename from spack/tests/pass/basic/relative-import-const/output/entry.js rename to node/bundler/tests/pass/basic/relative-import-const/output/entry.js diff --git a/spack/tests/pass/circular/complex-class-function/input/a.js b/node/bundler/tests/pass/circular/complex-class-function/input/a.js similarity index 100% rename from spack/tests/pass/circular/complex-class-function/input/a.js rename to node/bundler/tests/pass/circular/complex-class-function/input/a.js diff --git a/spack/tests/pass/circular/complex-class-function/input/b.js b/node/bundler/tests/pass/circular/complex-class-function/input/b.js similarity index 100% rename from spack/tests/pass/circular/complex-class-function/input/b.js rename to node/bundler/tests/pass/circular/complex-class-function/input/b.js diff --git a/spack/tests/pass/circular/complex-class-function/input/c.js b/node/bundler/tests/pass/circular/complex-class-function/input/c.js similarity index 100% rename from spack/tests/pass/circular/complex-class-function/input/c.js rename to node/bundler/tests/pass/circular/complex-class-function/input/c.js diff --git a/spack/tests/pass/circular/complex-class-function/input/entry.js b/node/bundler/tests/pass/circular/complex-class-function/input/entry.js similarity index 100% rename from spack/tests/pass/circular/complex-class-function/input/entry.js rename to node/bundler/tests/pass/circular/complex-class-function/input/entry.js diff --git a/spack/tests/pass/circular/complex-class-function/output/entry.js b/node/bundler/tests/pass/circular/complex-class-function/output/entry.js similarity index 100% rename from spack/tests/pass/circular/complex-class-function/output/entry.js rename to node/bundler/tests/pass/circular/complex-class-function/output/entry.js diff --git a/spack/tests/pass/circular/hygiene/class-inheritance/input/a.js b/node/bundler/tests/pass/circular/hygiene/class-inheritance/input/a.js similarity index 100% rename from spack/tests/pass/circular/hygiene/class-inheritance/input/a.js rename to node/bundler/tests/pass/circular/hygiene/class-inheritance/input/a.js diff --git a/spack/tests/pass/circular/hygiene/class-inheritance/input/b.js b/node/bundler/tests/pass/circular/hygiene/class-inheritance/input/b.js similarity index 100% rename from spack/tests/pass/circular/hygiene/class-inheritance/input/b.js rename to node/bundler/tests/pass/circular/hygiene/class-inheritance/input/b.js diff --git a/spack/tests/pass/circular/hygiene/class-inheritance/input/c.js b/node/bundler/tests/pass/circular/hygiene/class-inheritance/input/c.js similarity index 100% rename from spack/tests/pass/circular/hygiene/class-inheritance/input/c.js rename to node/bundler/tests/pass/circular/hygiene/class-inheritance/input/c.js diff --git a/spack/tests/pass/circular/hygiene/class-inheritance/input/entry.js b/node/bundler/tests/pass/circular/hygiene/class-inheritance/input/entry.js similarity index 100% rename from spack/tests/pass/circular/hygiene/class-inheritance/input/entry.js rename to node/bundler/tests/pass/circular/hygiene/class-inheritance/input/entry.js diff --git a/spack/tests/pass/circular/hygiene/class-inheritance/output/entry.js b/node/bundler/tests/pass/circular/hygiene/class-inheritance/output/entry.js similarity index 100% rename from spack/tests/pass/circular/hygiene/class-inheritance/output/entry.js rename to node/bundler/tests/pass/circular/hygiene/class-inheritance/output/entry.js diff --git a/spack/tests/pass/circular/imports-same/input/a.js b/node/bundler/tests/pass/circular/imports-same/input/a.js similarity index 100% rename from spack/tests/pass/circular/imports-same/input/a.js rename to node/bundler/tests/pass/circular/imports-same/input/a.js diff --git a/spack/tests/pass/circular/imports-same/input/b.js b/node/bundler/tests/pass/circular/imports-same/input/b.js similarity index 100% rename from spack/tests/pass/circular/imports-same/input/b.js rename to node/bundler/tests/pass/circular/imports-same/input/b.js diff --git a/spack/tests/pass/circular/imports-same/input/common-foo.js b/node/bundler/tests/pass/circular/imports-same/input/common-foo.js similarity index 100% rename from spack/tests/pass/circular/imports-same/input/common-foo.js rename to node/bundler/tests/pass/circular/imports-same/input/common-foo.js diff --git a/spack/tests/pass/circular/imports-same/input/common.js b/node/bundler/tests/pass/circular/imports-same/input/common.js similarity index 100% rename from spack/tests/pass/circular/imports-same/input/common.js rename to node/bundler/tests/pass/circular/imports-same/input/common.js diff --git a/spack/tests/pass/circular/imports-same/input/entry.js b/node/bundler/tests/pass/circular/imports-same/input/entry.js similarity index 100% rename from spack/tests/pass/circular/imports-same/input/entry.js rename to node/bundler/tests/pass/circular/imports-same/input/entry.js diff --git a/spack/tests/pass/circular/imports-same/output/entry.js b/node/bundler/tests/pass/circular/imports-same/output/entry.js similarity index 100% rename from spack/tests/pass/circular/imports-same/output/entry.js rename to node/bundler/tests/pass/circular/imports-same/output/entry.js diff --git a/spack/tests/pass/circular/many/input/a.js b/node/bundler/tests/pass/circular/many/input/a.js similarity index 100% rename from spack/tests/pass/circular/many/input/a.js rename to node/bundler/tests/pass/circular/many/input/a.js diff --git a/spack/tests/pass/circular/many/input/b.js b/node/bundler/tests/pass/circular/many/input/b.js similarity index 100% rename from spack/tests/pass/circular/many/input/b.js rename to node/bundler/tests/pass/circular/many/input/b.js diff --git a/spack/tests/pass/circular/many/input/c.js b/node/bundler/tests/pass/circular/many/input/c.js similarity index 100% rename from spack/tests/pass/circular/many/input/c.js rename to node/bundler/tests/pass/circular/many/input/c.js diff --git a/spack/tests/pass/circular/many/input/d.js b/node/bundler/tests/pass/circular/many/input/d.js similarity index 100% rename from spack/tests/pass/circular/many/input/d.js rename to node/bundler/tests/pass/circular/many/input/d.js diff --git a/spack/tests/pass/circular/many/input/entry.js b/node/bundler/tests/pass/circular/many/input/entry.js similarity index 100% rename from spack/tests/pass/circular/many/input/entry.js rename to node/bundler/tests/pass/circular/many/input/entry.js diff --git a/spack/tests/pass/circular/mixed/input/a.js b/node/bundler/tests/pass/circular/mixed/input/a.js similarity index 100% rename from spack/tests/pass/circular/mixed/input/a.js rename to node/bundler/tests/pass/circular/mixed/input/a.js diff --git a/spack/tests/pass/circular/mixed/input/b.js b/node/bundler/tests/pass/circular/mixed/input/b.js similarity index 100% rename from spack/tests/pass/circular/mixed/input/b.js rename to node/bundler/tests/pass/circular/mixed/input/b.js diff --git a/spack/tests/pass/circular/mixed/input/c.js b/node/bundler/tests/pass/circular/mixed/input/c.js similarity index 100% rename from spack/tests/pass/circular/mixed/input/c.js rename to node/bundler/tests/pass/circular/mixed/input/c.js diff --git a/spack/tests/pass/circular/mixed/input/entry.js b/node/bundler/tests/pass/circular/mixed/input/entry.js similarity index 100% rename from spack/tests/pass/circular/mixed/input/entry.js rename to node/bundler/tests/pass/circular/mixed/input/entry.js diff --git a/spack/tests/pass/circular/mixed/output/entry.js b/node/bundler/tests/pass/circular/mixed/output/entry.js similarity index 100% rename from spack/tests/pass/circular/mixed/output/entry.js rename to node/bundler/tests/pass/circular/mixed/output/entry.js diff --git a/spack/tests/pass/circular/simple/input/a.js b/node/bundler/tests/pass/circular/simple/input/a.js similarity index 100% rename from spack/tests/pass/circular/simple/input/a.js rename to node/bundler/tests/pass/circular/simple/input/a.js diff --git a/spack/tests/pass/circular/simple/input/b.js b/node/bundler/tests/pass/circular/simple/input/b.js similarity index 100% rename from spack/tests/pass/circular/simple/input/b.js rename to node/bundler/tests/pass/circular/simple/input/b.js diff --git a/spack/tests/pass/circular/simple/input/entry.js b/node/bundler/tests/pass/circular/simple/input/entry.js similarity index 100% rename from spack/tests/pass/circular/simple/input/entry.js rename to node/bundler/tests/pass/circular/simple/input/entry.js diff --git a/spack/tests/pass/circular/simple/output/entry.js b/node/bundler/tests/pass/circular/simple/output/entry.js similarity index 100% rename from spack/tests/pass/circular/simple/output/entry.js rename to node/bundler/tests/pass/circular/simple/output/entry.js diff --git a/spack/tests/pass/circular/top-level-idents/input/a.js b/node/bundler/tests/pass/circular/top-level-idents/input/a.js similarity index 100% rename from spack/tests/pass/circular/top-level-idents/input/a.js rename to node/bundler/tests/pass/circular/top-level-idents/input/a.js diff --git a/spack/tests/pass/circular/top-level-idents/input/b.js b/node/bundler/tests/pass/circular/top-level-idents/input/b.js similarity index 100% rename from spack/tests/pass/circular/top-level-idents/input/b.js rename to node/bundler/tests/pass/circular/top-level-idents/input/b.js diff --git a/spack/tests/pass/circular/top-level-idents/input/c.js b/node/bundler/tests/pass/circular/top-level-idents/input/c.js similarity index 100% rename from spack/tests/pass/circular/top-level-idents/input/c.js rename to node/bundler/tests/pass/circular/top-level-idents/input/c.js diff --git a/spack/tests/pass/circular/top-level-idents/input/entry.js b/node/bundler/tests/pass/circular/top-level-idents/input/entry.js similarity index 100% rename from spack/tests/pass/circular/top-level-idents/input/entry.js rename to node/bundler/tests/pass/circular/top-level-idents/input/entry.js diff --git a/spack/tests/pass/circular/top-level-idents/output/entry.js b/node/bundler/tests/pass/circular/top-level-idents/output/entry.js similarity index 100% rename from spack/tests/pass/circular/top-level-idents/output/entry.js rename to node/bundler/tests/pass/circular/top-level-idents/output/entry.js diff --git a/spack/tests/pass/cjs/common-library/input/a.js b/node/bundler/tests/pass/cjs/common-library/input/a.js similarity index 100% rename from spack/tests/pass/cjs/common-library/input/a.js rename to node/bundler/tests/pass/cjs/common-library/input/a.js diff --git a/spack/tests/pass/cjs/common-library/input/b.js b/node/bundler/tests/pass/cjs/common-library/input/b.js similarity index 100% rename from spack/tests/pass/cjs/common-library/input/b.js rename to node/bundler/tests/pass/cjs/common-library/input/b.js diff --git a/spack/tests/pass/cjs/common-library/input/common.js b/node/bundler/tests/pass/cjs/common-library/input/common.js similarity index 100% rename from spack/tests/pass/cjs/common-library/input/common.js rename to node/bundler/tests/pass/cjs/common-library/input/common.js diff --git a/spack/tests/pass/cjs/common-library/input/entry.js b/node/bundler/tests/pass/cjs/common-library/input/entry.js similarity index 100% rename from spack/tests/pass/cjs/common-library/input/entry.js rename to node/bundler/tests/pass/cjs/common-library/input/entry.js diff --git a/spack/tests/pass/cjs/common-library/output/entry.js b/node/bundler/tests/pass/cjs/common-library/output/entry.js similarity index 100% rename from spack/tests/pass/cjs/common-library/output/entry.js rename to node/bundler/tests/pass/cjs/common-library/output/entry.js diff --git a/spack/tests/pass/cjs/conditional/input/common.js b/node/bundler/tests/pass/cjs/conditional/input/common.js similarity index 100% rename from spack/tests/pass/cjs/conditional/input/common.js rename to node/bundler/tests/pass/cjs/conditional/input/common.js diff --git a/spack/tests/pass/cjs/conditional/input/entry.js b/node/bundler/tests/pass/cjs/conditional/input/entry.js similarity index 100% rename from spack/tests/pass/cjs/conditional/input/entry.js rename to node/bundler/tests/pass/cjs/conditional/input/entry.js diff --git a/spack/tests/pass/cjs/conditional/output/entry.js b/node/bundler/tests/pass/cjs/conditional/output/entry.js similarity index 100% rename from spack/tests/pass/cjs/conditional/output/entry.js rename to node/bundler/tests/pass/cjs/conditional/output/entry.js diff --git a/spack/tests/pass/cjs/issue-967-no-recursive-require/input/.swcrc b/node/bundler/tests/pass/cjs/issue-967-no-recursive-require/input/.swcrc similarity index 100% rename from spack/tests/pass/cjs/issue-967-no-recursive-require/input/.swcrc rename to node/bundler/tests/pass/cjs/issue-967-no-recursive-require/input/.swcrc diff --git a/spack/tests/pass/cjs/issue-967-no-recursive-require/input/a.js b/node/bundler/tests/pass/cjs/issue-967-no-recursive-require/input/a.js similarity index 100% rename from spack/tests/pass/cjs/issue-967-no-recursive-require/input/a.js rename to node/bundler/tests/pass/cjs/issue-967-no-recursive-require/input/a.js diff --git a/spack/tests/pass/cjs/issue-967-no-recursive-require/input/b.js b/node/bundler/tests/pass/cjs/issue-967-no-recursive-require/input/b.js similarity index 100% rename from spack/tests/pass/cjs/issue-967-no-recursive-require/input/b.js rename to node/bundler/tests/pass/cjs/issue-967-no-recursive-require/input/b.js diff --git a/spack/tests/pass/cjs/issue-967-no-recursive-require/input/c.js b/node/bundler/tests/pass/cjs/issue-967-no-recursive-require/input/c.js similarity index 100% rename from spack/tests/pass/cjs/issue-967-no-recursive-require/input/c.js rename to node/bundler/tests/pass/cjs/issue-967-no-recursive-require/input/c.js diff --git a/spack/tests/pass/cjs/issue-967-no-recursive-require/input/entry.js b/node/bundler/tests/pass/cjs/issue-967-no-recursive-require/input/entry.js similarity index 100% rename from spack/tests/pass/cjs/issue-967-no-recursive-require/input/entry.js rename to node/bundler/tests/pass/cjs/issue-967-no-recursive-require/input/entry.js diff --git a/spack/tests/pass/cjs/issue-967-no-recursive-require/output/entry.js b/node/bundler/tests/pass/cjs/issue-967-no-recursive-require/output/entry.js similarity index 100% rename from spack/tests/pass/cjs/issue-967-no-recursive-require/output/entry.js rename to node/bundler/tests/pass/cjs/issue-967-no-recursive-require/output/entry.js diff --git a/spack/tests/pass/cjs/issue-967-recursive-require/input/.swcrc b/node/bundler/tests/pass/cjs/issue-967-recursive-require/input/.swcrc similarity index 100% rename from spack/tests/pass/cjs/issue-967-recursive-require/input/.swcrc rename to node/bundler/tests/pass/cjs/issue-967-recursive-require/input/.swcrc diff --git a/spack/tests/pass/cjs/issue-967-recursive-require/input/a-a-a.js b/node/bundler/tests/pass/cjs/issue-967-recursive-require/input/a-a-a.js similarity index 100% rename from spack/tests/pass/cjs/issue-967-recursive-require/input/a-a-a.js rename to node/bundler/tests/pass/cjs/issue-967-recursive-require/input/a-a-a.js diff --git a/spack/tests/pass/cjs/issue-967-recursive-require/input/a-a.js b/node/bundler/tests/pass/cjs/issue-967-recursive-require/input/a-a.js similarity index 100% rename from spack/tests/pass/cjs/issue-967-recursive-require/input/a-a.js rename to node/bundler/tests/pass/cjs/issue-967-recursive-require/input/a-a.js diff --git a/spack/tests/pass/cjs/issue-967-recursive-require/input/a-b.js b/node/bundler/tests/pass/cjs/issue-967-recursive-require/input/a-b.js similarity index 100% rename from spack/tests/pass/cjs/issue-967-recursive-require/input/a-b.js rename to node/bundler/tests/pass/cjs/issue-967-recursive-require/input/a-b.js diff --git a/spack/tests/pass/cjs/issue-967-recursive-require/input/a.js b/node/bundler/tests/pass/cjs/issue-967-recursive-require/input/a.js similarity index 100% rename from spack/tests/pass/cjs/issue-967-recursive-require/input/a.js rename to node/bundler/tests/pass/cjs/issue-967-recursive-require/input/a.js diff --git a/spack/tests/pass/cjs/issue-967-recursive-require/input/b.js b/node/bundler/tests/pass/cjs/issue-967-recursive-require/input/b.js similarity index 100% rename from spack/tests/pass/cjs/issue-967-recursive-require/input/b.js rename to node/bundler/tests/pass/cjs/issue-967-recursive-require/input/b.js diff --git a/spack/tests/pass/cjs/issue-967-recursive-require/input/c.js b/node/bundler/tests/pass/cjs/issue-967-recursive-require/input/c.js similarity index 100% rename from spack/tests/pass/cjs/issue-967-recursive-require/input/c.js rename to node/bundler/tests/pass/cjs/issue-967-recursive-require/input/c.js diff --git a/spack/tests/pass/cjs/issue-967-recursive-require/input/entry.js b/node/bundler/tests/pass/cjs/issue-967-recursive-require/input/entry.js similarity index 100% rename from spack/tests/pass/cjs/issue-967-recursive-require/input/entry.js rename to node/bundler/tests/pass/cjs/issue-967-recursive-require/input/entry.js diff --git a/spack/tests/pass/cjs/issue-967-recursive-require/output/entry.js b/node/bundler/tests/pass/cjs/issue-967-recursive-require/output/entry.js similarity index 100% rename from spack/tests/pass/cjs/issue-967-recursive-require/output/entry.js rename to node/bundler/tests/pass/cjs/issue-967-recursive-require/output/entry.js diff --git a/spack/tests/pass/cjs/mixed/input/a.js b/node/bundler/tests/pass/cjs/mixed/input/a.js similarity index 100% rename from spack/tests/pass/cjs/mixed/input/a.js rename to node/bundler/tests/pass/cjs/mixed/input/a.js diff --git a/spack/tests/pass/cjs/mixed/input/b.js b/node/bundler/tests/pass/cjs/mixed/input/b.js similarity index 100% rename from spack/tests/pass/cjs/mixed/input/b.js rename to node/bundler/tests/pass/cjs/mixed/input/b.js diff --git a/spack/tests/pass/cjs/mixed/input/entry.js b/node/bundler/tests/pass/cjs/mixed/input/entry.js similarity index 100% rename from spack/tests/pass/cjs/mixed/input/entry.js rename to node/bundler/tests/pass/cjs/mixed/input/entry.js diff --git a/spack/tests/pass/cjs/mixed/output/entry.js b/node/bundler/tests/pass/cjs/mixed/output/entry.js similarity index 100% rename from spack/tests/pass/cjs/mixed/output/entry.js rename to node/bundler/tests/pass/cjs/mixed/output/entry.js diff --git a/spack/tests/pass/cjs/nested/input/a.js b/node/bundler/tests/pass/cjs/nested/input/a.js similarity index 100% rename from spack/tests/pass/cjs/nested/input/a.js rename to node/bundler/tests/pass/cjs/nested/input/a.js diff --git a/spack/tests/pass/cjs/nested/input/b.js b/node/bundler/tests/pass/cjs/nested/input/b.js similarity index 100% rename from spack/tests/pass/cjs/nested/input/b.js rename to node/bundler/tests/pass/cjs/nested/input/b.js diff --git a/spack/tests/pass/cjs/nested/input/entry.js b/node/bundler/tests/pass/cjs/nested/input/entry.js similarity index 100% rename from spack/tests/pass/cjs/nested/input/entry.js rename to node/bundler/tests/pass/cjs/nested/input/entry.js diff --git a/spack/tests/pass/cjs/nested/output/entry.js b/node/bundler/tests/pass/cjs/nested/output/entry.js similarity index 100% rename from spack/tests/pass/cjs/nested/output/entry.js rename to node/bundler/tests/pass/cjs/nested/output/entry.js diff --git a/spack/tests/deno-std/.swcrc b/node/bundler/tests/pass/deno-001/full/input/.swcrc similarity index 100% rename from spack/tests/deno-std/.swcrc rename to node/bundler/tests/pass/deno-001/full/input/.swcrc diff --git a/spack/tests/pass/deno-001/full/input/_util/assert.ts b/node/bundler/tests/pass/deno-001/full/input/_util/assert.ts similarity index 100% rename from spack/tests/pass/deno-001/full/input/_util/assert.ts rename to node/bundler/tests/pass/deno-001/full/input/_util/assert.ts diff --git a/spack/tests/pass/deno-001/full/input/async/deferred.ts b/node/bundler/tests/pass/deno-001/full/input/async/deferred.ts similarity index 100% rename from spack/tests/pass/deno-001/full/input/async/deferred.ts rename to node/bundler/tests/pass/deno-001/full/input/async/deferred.ts diff --git a/spack/tests/pass/deno-001/full/input/async/delay.ts b/node/bundler/tests/pass/deno-001/full/input/async/delay.ts similarity index 100% rename from spack/tests/pass/deno-001/full/input/async/delay.ts rename to node/bundler/tests/pass/deno-001/full/input/async/delay.ts diff --git a/spack/tests/pass/deno-001/full/input/async/mod.ts b/node/bundler/tests/pass/deno-001/full/input/async/mod.ts similarity index 100% rename from spack/tests/pass/deno-001/full/input/async/mod.ts rename to node/bundler/tests/pass/deno-001/full/input/async/mod.ts diff --git a/spack/tests/pass/deno-001/full/input/async/mux_async_iterator.ts b/node/bundler/tests/pass/deno-001/full/input/async/mux_async_iterator.ts similarity index 100% rename from spack/tests/pass/deno-001/full/input/async/mux_async_iterator.ts rename to node/bundler/tests/pass/deno-001/full/input/async/mux_async_iterator.ts diff --git a/spack/tests/pass/deno-001/full/input/async/pool.ts b/node/bundler/tests/pass/deno-001/full/input/async/pool.ts similarity index 100% rename from spack/tests/pass/deno-001/full/input/async/pool.ts rename to node/bundler/tests/pass/deno-001/full/input/async/pool.ts diff --git a/spack/tests/pass/deno-001/full/input/bytes/mod.ts b/node/bundler/tests/pass/deno-001/full/input/bytes/mod.ts similarity index 100% rename from spack/tests/pass/deno-001/full/input/bytes/mod.ts rename to node/bundler/tests/pass/deno-001/full/input/bytes/mod.ts diff --git a/spack/tests/pass/deno-001/full/input/encoding/utf8.ts b/node/bundler/tests/pass/deno-001/full/input/encoding/utf8.ts similarity index 100% rename from spack/tests/pass/deno-001/full/input/encoding/utf8.ts rename to node/bundler/tests/pass/deno-001/full/input/encoding/utf8.ts diff --git a/spack/tests/pass/deno-001/full/input/entry.js b/node/bundler/tests/pass/deno-001/full/input/entry.js similarity index 100% rename from spack/tests/pass/deno-001/full/input/entry.js rename to node/bundler/tests/pass/deno-001/full/input/entry.js diff --git a/spack/tests/pass/deno-001/full/input/http/_io.ts b/node/bundler/tests/pass/deno-001/full/input/http/_io.ts similarity index 100% rename from spack/tests/pass/deno-001/full/input/http/_io.ts rename to node/bundler/tests/pass/deno-001/full/input/http/_io.ts diff --git a/spack/tests/pass/deno-001/full/input/http/http_status.ts b/node/bundler/tests/pass/deno-001/full/input/http/http_status.ts similarity index 100% rename from spack/tests/pass/deno-001/full/input/http/http_status.ts rename to node/bundler/tests/pass/deno-001/full/input/http/http_status.ts diff --git a/spack/tests/pass/deno-001/full/input/http/server.ts b/node/bundler/tests/pass/deno-001/full/input/http/server.ts similarity index 100% rename from spack/tests/pass/deno-001/full/input/http/server.ts rename to node/bundler/tests/pass/deno-001/full/input/http/server.ts diff --git a/spack/tests/pass/deno-001/full/input/io/bufio.ts b/node/bundler/tests/pass/deno-001/full/input/io/bufio.ts similarity index 100% rename from spack/tests/pass/deno-001/full/input/io/bufio.ts rename to node/bundler/tests/pass/deno-001/full/input/io/bufio.ts diff --git a/spack/tests/pass/deno-001/full/input/textproto/mod.ts b/node/bundler/tests/pass/deno-001/full/input/textproto/mod.ts similarity index 100% rename from spack/tests/pass/deno-001/full/input/textproto/mod.ts rename to node/bundler/tests/pass/deno-001/full/input/textproto/mod.ts diff --git a/spack/tests/pass/deno-001/full/output/entry.js b/node/bundler/tests/pass/deno-001/full/output/entry.js similarity index 100% rename from spack/tests/pass/deno-001/full/output/entry.js rename to node/bundler/tests/pass/deno-001/full/output/entry.js diff --git a/spack/tests/pass/deno-001/full/input/.swcrc b/node/bundler/tests/pass/deno-001/simple-1/input/.swcrc similarity index 100% rename from spack/tests/pass/deno-001/full/input/.swcrc rename to node/bundler/tests/pass/deno-001/simple-1/input/.swcrc diff --git a/spack/tests/pass/deno-001/simple-1/input/async/deferred.ts b/node/bundler/tests/pass/deno-001/simple-1/input/async/deferred.ts similarity index 100% rename from spack/tests/pass/deno-001/simple-1/input/async/deferred.ts rename to node/bundler/tests/pass/deno-001/simple-1/input/async/deferred.ts diff --git a/spack/tests/pass/deno-001/simple-1/input/async/delay.ts b/node/bundler/tests/pass/deno-001/simple-1/input/async/delay.ts similarity index 100% rename from spack/tests/pass/deno-001/simple-1/input/async/delay.ts rename to node/bundler/tests/pass/deno-001/simple-1/input/async/delay.ts diff --git a/spack/tests/pass/deno-001/simple-1/input/async/mod.ts b/node/bundler/tests/pass/deno-001/simple-1/input/async/mod.ts similarity index 100% rename from spack/tests/pass/deno-001/simple-1/input/async/mod.ts rename to node/bundler/tests/pass/deno-001/simple-1/input/async/mod.ts diff --git a/spack/tests/pass/deno-001/simple-1/input/async/mux_async_iterator.ts b/node/bundler/tests/pass/deno-001/simple-1/input/async/mux_async_iterator.ts similarity index 100% rename from spack/tests/pass/deno-001/simple-1/input/async/mux_async_iterator.ts rename to node/bundler/tests/pass/deno-001/simple-1/input/async/mux_async_iterator.ts diff --git a/spack/tests/pass/deno-001/simple-1/input/async/pool.ts b/node/bundler/tests/pass/deno-001/simple-1/input/async/pool.ts similarity index 100% rename from spack/tests/pass/deno-001/simple-1/input/async/pool.ts rename to node/bundler/tests/pass/deno-001/simple-1/input/async/pool.ts diff --git a/spack/tests/pass/deno-001/simple-1/input/entry.js b/node/bundler/tests/pass/deno-001/simple-1/input/entry.js similarity index 100% rename from spack/tests/pass/deno-001/simple-1/input/entry.js rename to node/bundler/tests/pass/deno-001/simple-1/input/entry.js diff --git a/spack/tests/pass/deno-001/simple-1/input/http/_io.ts b/node/bundler/tests/pass/deno-001/simple-1/input/http/_io.ts similarity index 100% rename from spack/tests/pass/deno-001/simple-1/input/http/_io.ts rename to node/bundler/tests/pass/deno-001/simple-1/input/http/_io.ts diff --git a/spack/tests/pass/deno-001/simple-1/input/http/server.ts b/node/bundler/tests/pass/deno-001/simple-1/input/http/server.ts similarity index 100% rename from spack/tests/pass/deno-001/simple-1/input/http/server.ts rename to node/bundler/tests/pass/deno-001/simple-1/input/http/server.ts diff --git a/spack/tests/pass/deno-001/simple-1/input/textproto/mod.ts b/node/bundler/tests/pass/deno-001/simple-1/input/textproto/mod.ts similarity index 100% rename from spack/tests/pass/deno-001/simple-1/input/textproto/mod.ts rename to node/bundler/tests/pass/deno-001/simple-1/input/textproto/mod.ts diff --git a/spack/tests/pass/deno-001/simple-1/output/entry.js b/node/bundler/tests/pass/deno-001/simple-1/output/entry.js similarity index 100% rename from spack/tests/pass/deno-001/simple-1/output/entry.js rename to node/bundler/tests/pass/deno-001/simple-1/output/entry.js diff --git a/spack/tests/pass/deno-001/simple-1/input/.swcrc b/node/bundler/tests/pass/deno-001/simple-2/input/.swcrc similarity index 100% rename from spack/tests/pass/deno-001/simple-1/input/.swcrc rename to node/bundler/tests/pass/deno-001/simple-2/input/.swcrc diff --git a/spack/tests/pass/deno-001/simple-2/input/async/deferred.ts b/node/bundler/tests/pass/deno-001/simple-2/input/async/deferred.ts similarity index 100% rename from spack/tests/pass/deno-001/simple-2/input/async/deferred.ts rename to node/bundler/tests/pass/deno-001/simple-2/input/async/deferred.ts diff --git a/spack/tests/pass/deno-001/simple-2/input/async/mod.ts b/node/bundler/tests/pass/deno-001/simple-2/input/async/mod.ts similarity index 100% rename from spack/tests/pass/deno-001/simple-2/input/async/mod.ts rename to node/bundler/tests/pass/deno-001/simple-2/input/async/mod.ts diff --git a/spack/tests/pass/deno-001/simple-2/input/async/mux_async_iterator.ts b/node/bundler/tests/pass/deno-001/simple-2/input/async/mux_async_iterator.ts similarity index 100% rename from spack/tests/pass/deno-001/simple-2/input/async/mux_async_iterator.ts rename to node/bundler/tests/pass/deno-001/simple-2/input/async/mux_async_iterator.ts diff --git a/spack/tests/pass/deno-001/simple-2/input/entry.js b/node/bundler/tests/pass/deno-001/simple-2/input/entry.js similarity index 100% rename from spack/tests/pass/deno-001/simple-2/input/entry.js rename to node/bundler/tests/pass/deno-001/simple-2/input/entry.js diff --git a/spack/tests/pass/deno-001/simple-2/input/http/_io.ts b/node/bundler/tests/pass/deno-001/simple-2/input/http/_io.ts similarity index 100% rename from spack/tests/pass/deno-001/simple-2/input/http/_io.ts rename to node/bundler/tests/pass/deno-001/simple-2/input/http/_io.ts diff --git a/spack/tests/pass/deno-001/simple-2/input/http/server.ts b/node/bundler/tests/pass/deno-001/simple-2/input/http/server.ts similarity index 100% rename from spack/tests/pass/deno-001/simple-2/input/http/server.ts rename to node/bundler/tests/pass/deno-001/simple-2/input/http/server.ts diff --git a/spack/tests/pass/deno-001/simple-2/input/textproto/mod.ts b/node/bundler/tests/pass/deno-001/simple-2/input/textproto/mod.ts similarity index 100% rename from spack/tests/pass/deno-001/simple-2/input/textproto/mod.ts rename to node/bundler/tests/pass/deno-001/simple-2/input/textproto/mod.ts diff --git a/spack/tests/pass/deno-001/simple-2/output/entry.js b/node/bundler/tests/pass/deno-001/simple-2/output/entry.js similarity index 100% rename from spack/tests/pass/deno-001/simple-2/output/entry.js rename to node/bundler/tests/pass/deno-001/simple-2/output/entry.js diff --git a/spack/tests/pass/deno-001/simple-2/input/.swcrc b/node/bundler/tests/pass/deno-001/simple-3/input/.swcrc similarity index 100% rename from spack/tests/pass/deno-001/simple-2/input/.swcrc rename to node/bundler/tests/pass/deno-001/simple-3/input/.swcrc diff --git a/spack/tests/pass/deno-001/simple-3/input/async/deferred.ts b/node/bundler/tests/pass/deno-001/simple-3/input/async/deferred.ts similarity index 100% rename from spack/tests/pass/deno-001/simple-3/input/async/deferred.ts rename to node/bundler/tests/pass/deno-001/simple-3/input/async/deferred.ts diff --git a/spack/tests/pass/deno-001/simple-3/input/async/mod.ts b/node/bundler/tests/pass/deno-001/simple-3/input/async/mod.ts similarity index 100% rename from spack/tests/pass/deno-001/simple-3/input/async/mod.ts rename to node/bundler/tests/pass/deno-001/simple-3/input/async/mod.ts diff --git a/spack/tests/pass/deno-001/simple-3/input/async/mux_async_iterator.ts b/node/bundler/tests/pass/deno-001/simple-3/input/async/mux_async_iterator.ts similarity index 100% rename from spack/tests/pass/deno-001/simple-3/input/async/mux_async_iterator.ts rename to node/bundler/tests/pass/deno-001/simple-3/input/async/mux_async_iterator.ts diff --git a/spack/tests/pass/deno-001/simple-3/input/entry.js b/node/bundler/tests/pass/deno-001/simple-3/input/entry.js similarity index 100% rename from spack/tests/pass/deno-001/simple-3/input/entry.js rename to node/bundler/tests/pass/deno-001/simple-3/input/entry.js diff --git a/spack/tests/pass/deno-001/simple-3/output/entry.js b/node/bundler/tests/pass/deno-001/simple-3/output/entry.js similarity index 100% rename from spack/tests/pass/deno-001/simple-3/output/entry.js rename to node/bundler/tests/pass/deno-001/simple-3/output/entry.js diff --git a/spack/tests/pass/deno-001/simple-3/input/.swcrc b/node/bundler/tests/pass/deno-001/simple-4/input/.swcrc similarity index 100% rename from spack/tests/pass/deno-001/simple-3/input/.swcrc rename to node/bundler/tests/pass/deno-001/simple-4/input/.swcrc diff --git a/spack/tests/pass/deno-001/simple-4/input/async/deferred.ts b/node/bundler/tests/pass/deno-001/simple-4/input/async/deferred.ts similarity index 100% rename from spack/tests/pass/deno-001/simple-4/input/async/deferred.ts rename to node/bundler/tests/pass/deno-001/simple-4/input/async/deferred.ts diff --git a/spack/tests/pass/deno-001/simple-4/input/async/mod.ts b/node/bundler/tests/pass/deno-001/simple-4/input/async/mod.ts similarity index 100% rename from spack/tests/pass/deno-001/simple-4/input/async/mod.ts rename to node/bundler/tests/pass/deno-001/simple-4/input/async/mod.ts diff --git a/spack/tests/pass/deno-001/simple-4/input/async/mux_async_iterator.ts b/node/bundler/tests/pass/deno-001/simple-4/input/async/mux_async_iterator.ts similarity index 100% rename from spack/tests/pass/deno-001/simple-4/input/async/mux_async_iterator.ts rename to node/bundler/tests/pass/deno-001/simple-4/input/async/mux_async_iterator.ts diff --git a/spack/tests/pass/deno-001/simple-4/input/entry.js b/node/bundler/tests/pass/deno-001/simple-4/input/entry.js similarity index 100% rename from spack/tests/pass/deno-001/simple-4/input/entry.js rename to node/bundler/tests/pass/deno-001/simple-4/input/entry.js diff --git a/spack/tests/pass/deno-001/simple-4/output/entry.js b/node/bundler/tests/pass/deno-001/simple-4/output/entry.js similarity index 100% rename from spack/tests/pass/deno-001/simple-4/output/entry.js rename to node/bundler/tests/pass/deno-001/simple-4/output/entry.js diff --git a/spack/tests/pass/deno-001/simple-4/input/.swcrc b/node/bundler/tests/pass/deno-001/simple-5/input/.swcrc similarity index 100% rename from spack/tests/pass/deno-001/simple-4/input/.swcrc rename to node/bundler/tests/pass/deno-001/simple-5/input/.swcrc diff --git a/spack/tests/pass/deno-001/simple-5/input/async/deferred.ts b/node/bundler/tests/pass/deno-001/simple-5/input/async/deferred.ts similarity index 100% rename from spack/tests/pass/deno-001/simple-5/input/async/deferred.ts rename to node/bundler/tests/pass/deno-001/simple-5/input/async/deferred.ts diff --git a/spack/tests/pass/deno-001/simple-5/input/async/mod.ts b/node/bundler/tests/pass/deno-001/simple-5/input/async/mod.ts similarity index 100% rename from spack/tests/pass/deno-001/simple-5/input/async/mod.ts rename to node/bundler/tests/pass/deno-001/simple-5/input/async/mod.ts diff --git a/spack/tests/pass/deno-001/simple-5/input/async/mux_async_iterator.ts b/node/bundler/tests/pass/deno-001/simple-5/input/async/mux_async_iterator.ts similarity index 100% rename from spack/tests/pass/deno-001/simple-5/input/async/mux_async_iterator.ts rename to node/bundler/tests/pass/deno-001/simple-5/input/async/mux_async_iterator.ts diff --git a/spack/tests/pass/deno-001/simple-5/input/entry.js b/node/bundler/tests/pass/deno-001/simple-5/input/entry.js similarity index 100% rename from spack/tests/pass/deno-001/simple-5/input/entry.js rename to node/bundler/tests/pass/deno-001/simple-5/input/entry.js diff --git a/spack/tests/pass/deno-001/simple-5/output/entry.js b/node/bundler/tests/pass/deno-001/simple-5/output/entry.js similarity index 100% rename from spack/tests/pass/deno-001/simple-5/output/entry.js rename to node/bundler/tests/pass/deno-001/simple-5/output/entry.js diff --git a/spack/tests/pass/deno-001/simple-5/input/.swcrc b/node/bundler/tests/pass/deno-002/.full/input/.swcrc similarity index 100% rename from spack/tests/pass/deno-001/simple-5/input/.swcrc rename to node/bundler/tests/pass/deno-002/.full/input/.swcrc diff --git a/spack/tests/pass/deno-002/.full/input/async/deferred.ts b/node/bundler/tests/pass/deno-002/.full/input/async/deferred.ts similarity index 100% rename from spack/tests/pass/deno-002/.full/input/async/deferred.ts rename to node/bundler/tests/pass/deno-002/.full/input/async/deferred.ts diff --git a/spack/tests/pass/deno-002/.full/input/async/delay.ts b/node/bundler/tests/pass/deno-002/.full/input/async/delay.ts similarity index 100% rename from spack/tests/pass/deno-002/.full/input/async/delay.ts rename to node/bundler/tests/pass/deno-002/.full/input/async/delay.ts diff --git a/spack/tests/pass/deno-002/.full/input/async/mod.ts b/node/bundler/tests/pass/deno-002/.full/input/async/mod.ts similarity index 100% rename from spack/tests/pass/deno-002/.full/input/async/mod.ts rename to node/bundler/tests/pass/deno-002/.full/input/async/mod.ts diff --git a/spack/tests/pass/deno-002/.full/input/async/mux_async_iterator.ts b/node/bundler/tests/pass/deno-002/.full/input/async/mux_async_iterator.ts similarity index 100% rename from spack/tests/pass/deno-002/.full/input/async/mux_async_iterator.ts rename to node/bundler/tests/pass/deno-002/.full/input/async/mux_async_iterator.ts diff --git a/spack/tests/pass/deno-002/.full/input/async/pool.ts b/node/bundler/tests/pass/deno-002/.full/input/async/pool.ts similarity index 100% rename from spack/tests/pass/deno-002/.full/input/async/pool.ts rename to node/bundler/tests/pass/deno-002/.full/input/async/pool.ts diff --git a/spack/tests/pass/deno-002/.full/input/entry.js b/node/bundler/tests/pass/deno-002/.full/input/entry.js similarity index 100% rename from spack/tests/pass/deno-002/.full/input/entry.js rename to node/bundler/tests/pass/deno-002/.full/input/entry.js diff --git a/spack/tests/pass/deno-002/.full/output/entry.js b/node/bundler/tests/pass/deno-002/.full/output/entry.js similarity index 100% rename from spack/tests/pass/deno-002/.full/output/entry.js rename to node/bundler/tests/pass/deno-002/.full/output/entry.js diff --git a/spack/tests/pass/drop-unused/export/default-mixed/input/a.js b/node/bundler/tests/pass/drop-unused/export/default-mixed/input/a.js similarity index 100% rename from spack/tests/pass/drop-unused/export/default-mixed/input/a.js rename to node/bundler/tests/pass/drop-unused/export/default-mixed/input/a.js diff --git a/spack/tests/pass/drop-unused/export/default-mixed/input/entry.js b/node/bundler/tests/pass/drop-unused/export/default-mixed/input/entry.js similarity index 100% rename from spack/tests/pass/drop-unused/export/default-mixed/input/entry.js rename to node/bundler/tests/pass/drop-unused/export/default-mixed/input/entry.js diff --git a/spack/tests/pass/drop-unused/export/default-mixed/output/entry.js b/node/bundler/tests/pass/drop-unused/export/default-mixed/output/entry.js similarity index 100% rename from spack/tests/pass/drop-unused/export/default-mixed/output/entry.js rename to node/bundler/tests/pass/drop-unused/export/default-mixed/output/entry.js diff --git a/spack/tests/pass/drop-unused/export/named/input/entry.js b/node/bundler/tests/pass/drop-unused/export/named/input/entry.js similarity index 100% rename from spack/tests/pass/drop-unused/export/named/input/entry.js rename to node/bundler/tests/pass/drop-unused/export/named/input/entry.js diff --git a/spack/tests/pass/drop-unused/export/named/output/entry.js b/node/bundler/tests/pass/drop-unused/export/named/output/entry.js similarity index 100% rename from spack/tests/pass/drop-unused/export/named/output/entry.js rename to node/bundler/tests/pass/drop-unused/export/named/output/entry.js diff --git a/spack/tests/pass/drop-unused/side-effect/import-multi/input/a.js b/node/bundler/tests/pass/drop-unused/side-effect/import-multi/input/a.js similarity index 100% rename from spack/tests/pass/drop-unused/side-effect/import-multi/input/a.js rename to node/bundler/tests/pass/drop-unused/side-effect/import-multi/input/a.js diff --git a/spack/tests/pass/drop-unused/side-effect/import-multi/input/b.js b/node/bundler/tests/pass/drop-unused/side-effect/import-multi/input/b.js similarity index 100% rename from spack/tests/pass/drop-unused/side-effect/import-multi/input/b.js rename to node/bundler/tests/pass/drop-unused/side-effect/import-multi/input/b.js diff --git a/spack/tests/pass/drop-unused/side-effect/import-multi/input/entry.js b/node/bundler/tests/pass/drop-unused/side-effect/import-multi/input/entry.js similarity index 100% rename from spack/tests/pass/drop-unused/side-effect/import-multi/input/entry.js rename to node/bundler/tests/pass/drop-unused/side-effect/import-multi/input/entry.js diff --git a/spack/tests/pass/drop-unused/side-effect/import-multi/output/entry.js b/node/bundler/tests/pass/drop-unused/side-effect/import-multi/output/entry.js similarity index 100% rename from spack/tests/pass/drop-unused/side-effect/import-multi/output/entry.js rename to node/bundler/tests/pass/drop-unused/side-effect/import-multi/output/entry.js diff --git a/spack/tests/pass/drop-unused/side-effect/simple/input/entry.js b/node/bundler/tests/pass/drop-unused/side-effect/simple/input/entry.js similarity index 100% rename from spack/tests/pass/drop-unused/side-effect/simple/input/entry.js rename to node/bundler/tests/pass/drop-unused/side-effect/simple/input/entry.js diff --git a/spack/tests/pass/drop-unused/side-effect/simple/output/entry.js b/node/bundler/tests/pass/drop-unused/side-effect/simple/output/entry.js similarity index 100% rename from spack/tests/pass/drop-unused/side-effect/simple/output/entry.js rename to node/bundler/tests/pass/drop-unused/side-effect/simple/output/entry.js diff --git a/spack/tests/pass/dynamic-import/namespace/dynamic-key/input/entry.js b/node/bundler/tests/pass/dynamic-import/namespace/dynamic-key/input/entry.js similarity index 100% rename from spack/tests/pass/dynamic-import/namespace/dynamic-key/input/entry.js rename to node/bundler/tests/pass/dynamic-import/namespace/dynamic-key/input/entry.js diff --git a/spack/tests/pass/dynamic-import/namespace/dynamic-key/input/lib/a.js b/node/bundler/tests/pass/dynamic-import/namespace/dynamic-key/input/lib/a.js similarity index 100% rename from spack/tests/pass/dynamic-import/namespace/dynamic-key/input/lib/a.js rename to node/bundler/tests/pass/dynamic-import/namespace/dynamic-key/input/lib/a.js diff --git a/spack/tests/pass/dynamic-import/namespace/dynamic-key/input/lib/b.js b/node/bundler/tests/pass/dynamic-import/namespace/dynamic-key/input/lib/b.js similarity index 100% rename from spack/tests/pass/dynamic-import/namespace/dynamic-key/input/lib/b.js rename to node/bundler/tests/pass/dynamic-import/namespace/dynamic-key/input/lib/b.js diff --git a/spack/tests/pass/dynamic-import/namespace/dynamic-key/input/lib/nop.js b/node/bundler/tests/pass/dynamic-import/namespace/dynamic-key/input/lib/nop.js similarity index 100% rename from spack/tests/pass/dynamic-import/namespace/dynamic-key/input/lib/nop.js rename to node/bundler/tests/pass/dynamic-import/namespace/dynamic-key/input/lib/nop.js diff --git a/spack/tests/pass/dynamic-import/namespace/dynamic-key/output/entry.js b/node/bundler/tests/pass/dynamic-import/namespace/dynamic-key/output/entry.js similarity index 100% rename from spack/tests/pass/dynamic-import/namespace/dynamic-key/output/entry.js rename to node/bundler/tests/pass/dynamic-import/namespace/dynamic-key/output/entry.js diff --git a/spack/tests/pass/dynmaic-imports/issue-1112/simple/input/.swcrc b/node/bundler/tests/pass/dynmaic-imports/issue-1112/simple/input/.swcrc similarity index 100% rename from spack/tests/pass/dynmaic-imports/issue-1112/simple/input/.swcrc rename to node/bundler/tests/pass/dynmaic-imports/issue-1112/simple/input/.swcrc diff --git a/spack/tests/pass/dynmaic-imports/issue-1112/simple/input/a.js b/node/bundler/tests/pass/dynmaic-imports/issue-1112/simple/input/a.js similarity index 100% rename from spack/tests/pass/dynmaic-imports/issue-1112/simple/input/a.js rename to node/bundler/tests/pass/dynmaic-imports/issue-1112/simple/input/a.js diff --git a/spack/tests/pass/dynmaic-imports/issue-1112/simple/input/entry.js b/node/bundler/tests/pass/dynmaic-imports/issue-1112/simple/input/entry.js similarity index 100% rename from spack/tests/pass/dynmaic-imports/issue-1112/simple/input/entry.js rename to node/bundler/tests/pass/dynmaic-imports/issue-1112/simple/input/entry.js diff --git a/spack/tests/pass/dynmaic-imports/issue-1112/simple/output/entry.js b/node/bundler/tests/pass/dynmaic-imports/issue-1112/simple/output/entry.js similarity index 100% rename from spack/tests/pass/dynmaic-imports/issue-1112/simple/output/entry.js rename to node/bundler/tests/pass/dynmaic-imports/issue-1112/simple/output/entry.js diff --git a/spack/tests/pass/export-all/input/a.js b/node/bundler/tests/pass/export-all/input/a.js similarity index 100% rename from spack/tests/pass/export-all/input/a.js rename to node/bundler/tests/pass/export-all/input/a.js diff --git a/spack/tests/pass/export-all/input/b.js b/node/bundler/tests/pass/export-all/input/b.js similarity index 100% rename from spack/tests/pass/export-all/input/b.js rename to node/bundler/tests/pass/export-all/input/b.js diff --git a/spack/tests/pass/export-all/input/entry.js b/node/bundler/tests/pass/export-all/input/entry.js similarity index 100% rename from spack/tests/pass/export-all/input/entry.js rename to node/bundler/tests/pass/export-all/input/entry.js diff --git a/spack/tests/pass/export-all/output/entry.js b/node/bundler/tests/pass/export-all/output/entry.js similarity index 100% rename from spack/tests/pass/export-all/output/entry.js rename to node/bundler/tests/pass/export-all/output/entry.js diff --git a/spack/tests/pass/export-star-namespace/issue-1109/.swcrc b/node/bundler/tests/pass/export-star-namespace/issue-1109/.swcrc similarity index 100% rename from spack/tests/pass/export-star-namespace/issue-1109/.swcrc rename to node/bundler/tests/pass/export-star-namespace/issue-1109/.swcrc diff --git a/spack/tests/pass/export-star-namespace/issue-1109/input/a.ts b/node/bundler/tests/pass/export-star-namespace/issue-1109/input/a.ts similarity index 100% rename from spack/tests/pass/export-star-namespace/issue-1109/input/a.ts rename to node/bundler/tests/pass/export-star-namespace/issue-1109/input/a.ts diff --git a/spack/tests/pass/export-star-namespace/issue-1109/input/entry.js b/node/bundler/tests/pass/export-star-namespace/issue-1109/input/entry.js similarity index 100% rename from spack/tests/pass/export-star-namespace/issue-1109/input/entry.js rename to node/bundler/tests/pass/export-star-namespace/issue-1109/input/entry.js diff --git a/spack/tests/pass/export-star-namespace/issue-1109/output/entry.js b/node/bundler/tests/pass/export-star-namespace/issue-1109/output/entry.js similarity index 100% rename from spack/tests/pass/export-star-namespace/issue-1109/output/entry.js rename to node/bundler/tests/pass/export-star-namespace/issue-1109/output/entry.js diff --git a/spack/tests/pass/export/all-1/multiple/input/a.js b/node/bundler/tests/pass/export/all-1/multiple/input/a.js similarity index 100% rename from spack/tests/pass/export/all-1/multiple/input/a.js rename to node/bundler/tests/pass/export/all-1/multiple/input/a.js diff --git a/spack/tests/pass/export/all-1/multiple/input/b.js b/node/bundler/tests/pass/export/all-1/multiple/input/b.js similarity index 100% rename from spack/tests/pass/export/all-1/multiple/input/b.js rename to node/bundler/tests/pass/export/all-1/multiple/input/b.js diff --git a/spack/tests/pass/export/all-1/multiple/input/entry.js b/node/bundler/tests/pass/export/all-1/multiple/input/entry.js similarity index 100% rename from spack/tests/pass/export/all-1/multiple/input/entry.js rename to node/bundler/tests/pass/export/all-1/multiple/input/entry.js diff --git a/spack/tests/pass/export/all-1/multiple/output/entry.js b/node/bundler/tests/pass/export/all-1/multiple/output/entry.js similarity index 100% rename from spack/tests/pass/export/all-1/multiple/output/entry.js rename to node/bundler/tests/pass/export/all-1/multiple/output/entry.js diff --git a/spack/tests/pass/export/all-2/input/a.js b/node/bundler/tests/pass/export/all-2/input/a.js similarity index 100% rename from spack/tests/pass/export/all-2/input/a.js rename to node/bundler/tests/pass/export/all-2/input/a.js diff --git a/spack/tests/pass/export/all-2/input/b.js b/node/bundler/tests/pass/export/all-2/input/b.js similarity index 100% rename from spack/tests/pass/export/all-2/input/b.js rename to node/bundler/tests/pass/export/all-2/input/b.js diff --git a/spack/tests/pass/export/all-2/input/c.js b/node/bundler/tests/pass/export/all-2/input/c.js similarity index 100% rename from spack/tests/pass/export/all-2/input/c.js rename to node/bundler/tests/pass/export/all-2/input/c.js diff --git a/spack/tests/pass/export/all-2/input/entry.js b/node/bundler/tests/pass/export/all-2/input/entry.js similarity index 100% rename from spack/tests/pass/export/all-2/input/entry.js rename to node/bundler/tests/pass/export/all-2/input/entry.js diff --git a/spack/tests/pass/export/all-2/output/entry.js b/node/bundler/tests/pass/export/all-2/output/entry.js similarity index 100% rename from spack/tests/pass/export/all-2/output/entry.js rename to node/bundler/tests/pass/export/all-2/output/entry.js diff --git a/spack/tests/pass/export/all-nested-1/input/a.js b/node/bundler/tests/pass/export/all-nested-1/input/a.js similarity index 100% rename from spack/tests/pass/export/all-nested-1/input/a.js rename to node/bundler/tests/pass/export/all-nested-1/input/a.js diff --git a/spack/tests/pass/export/all-nested-1/input/b.js b/node/bundler/tests/pass/export/all-nested-1/input/b.js similarity index 100% rename from spack/tests/pass/export/all-nested-1/input/b.js rename to node/bundler/tests/pass/export/all-nested-1/input/b.js diff --git a/spack/tests/pass/export/all-nested-1/input/c.js b/node/bundler/tests/pass/export/all-nested-1/input/c.js similarity index 100% rename from spack/tests/pass/export/all-nested-1/input/c.js rename to node/bundler/tests/pass/export/all-nested-1/input/c.js diff --git a/spack/tests/pass/export/all-nested-1/input/entry.js b/node/bundler/tests/pass/export/all-nested-1/input/entry.js similarity index 100% rename from spack/tests/pass/export/all-nested-1/input/entry.js rename to node/bundler/tests/pass/export/all-nested-1/input/entry.js diff --git a/spack/tests/pass/export/all-nested-1/output/entry.js b/node/bundler/tests/pass/export/all-nested-1/output/entry.js similarity index 100% rename from spack/tests/pass/export/all-nested-1/output/entry.js rename to node/bundler/tests/pass/export/all-nested-1/output/entry.js diff --git a/spack/tests/pass/export/complex-1/input/a.js b/node/bundler/tests/pass/export/complex-1/input/a.js similarity index 100% rename from spack/tests/pass/export/complex-1/input/a.js rename to node/bundler/tests/pass/export/complex-1/input/a.js diff --git a/spack/tests/pass/export/complex-1/input/b.js b/node/bundler/tests/pass/export/complex-1/input/b.js similarity index 100% rename from spack/tests/pass/export/complex-1/input/b.js rename to node/bundler/tests/pass/export/complex-1/input/b.js diff --git a/spack/tests/pass/export/complex-1/input/entry.js b/node/bundler/tests/pass/export/complex-1/input/entry.js similarity index 100% rename from spack/tests/pass/export/complex-1/input/entry.js rename to node/bundler/tests/pass/export/complex-1/input/entry.js diff --git a/spack/tests/pass/export/complex-1/output/entry.js b/node/bundler/tests/pass/export/complex-1/output/entry.js similarity index 100% rename from spack/tests/pass/export/complex-1/output/entry.js rename to node/bundler/tests/pass/export/complex-1/output/entry.js diff --git a/spack/tests/pass/export/issue-1111/simple/input/a.js b/node/bundler/tests/pass/export/issue-1111/simple/input/a.js similarity index 100% rename from spack/tests/pass/export/issue-1111/simple/input/a.js rename to node/bundler/tests/pass/export/issue-1111/simple/input/a.js diff --git a/spack/tests/pass/export/issue-1111/simple/input/d.js b/node/bundler/tests/pass/export/issue-1111/simple/input/d.js similarity index 100% rename from spack/tests/pass/export/issue-1111/simple/input/d.js rename to node/bundler/tests/pass/export/issue-1111/simple/input/d.js diff --git a/spack/tests/pass/export/issue-1111/simple/input/entry.js b/node/bundler/tests/pass/export/issue-1111/simple/input/entry.js similarity index 100% rename from spack/tests/pass/export/issue-1111/simple/input/entry.js rename to node/bundler/tests/pass/export/issue-1111/simple/input/entry.js diff --git a/spack/tests/pass/export/issue-1111/simple/output/entry.js b/node/bundler/tests/pass/export/issue-1111/simple/output/entry.js similarity index 100% rename from spack/tests/pass/export/issue-1111/simple/output/entry.js rename to node/bundler/tests/pass/export/issue-1111/simple/output/entry.js diff --git a/spack/tests/pass/export/mixed-all-and-const/input/a.js b/node/bundler/tests/pass/export/mixed-all-and-const/input/a.js similarity index 100% rename from spack/tests/pass/export/mixed-all-and-const/input/a.js rename to node/bundler/tests/pass/export/mixed-all-and-const/input/a.js diff --git a/spack/tests/pass/export/mixed-all-and-const/input/b.js b/node/bundler/tests/pass/export/mixed-all-and-const/input/b.js similarity index 100% rename from spack/tests/pass/export/mixed-all-and-const/input/b.js rename to node/bundler/tests/pass/export/mixed-all-and-const/input/b.js diff --git a/spack/tests/pass/export/mixed-all-and-const/input/entry.js b/node/bundler/tests/pass/export/mixed-all-and-const/input/entry.js similarity index 100% rename from spack/tests/pass/export/mixed-all-and-const/input/entry.js rename to node/bundler/tests/pass/export/mixed-all-and-const/input/entry.js diff --git a/spack/tests/pass/export/mixed-all-and-const/output/entry.js b/node/bundler/tests/pass/export/mixed-all-and-const/output/entry.js similarity index 100% rename from spack/tests/pass/export/mixed-all-and-const/output/entry.js rename to node/bundler/tests/pass/export/mixed-all-and-const/output/entry.js diff --git a/spack/tests/pass/helpers/simple/input/.swcrc b/node/bundler/tests/pass/helpers/simple/input/.swcrc similarity index 100% rename from spack/tests/pass/helpers/simple/input/.swcrc rename to node/bundler/tests/pass/helpers/simple/input/.swcrc diff --git a/spack/tests/pass/helpers/simple/input/entry.js b/node/bundler/tests/pass/helpers/simple/input/entry.js similarity index 100% rename from spack/tests/pass/helpers/simple/input/entry.js rename to node/bundler/tests/pass/helpers/simple/input/entry.js diff --git a/spack/tests/pass/helpers/simple/output/entry.js b/node/bundler/tests/pass/helpers/simple/output/entry.js similarity index 100% rename from spack/tests/pass/helpers/simple/output/entry.js rename to node/bundler/tests/pass/helpers/simple/output/entry.js diff --git a/spack/tests/pass/import-with-export/simple-1/input/a.js b/node/bundler/tests/pass/import-with-export/simple-1/input/a.js similarity index 100% rename from spack/tests/pass/import-with-export/simple-1/input/a.js rename to node/bundler/tests/pass/import-with-export/simple-1/input/a.js diff --git a/spack/tests/pass/import-with-export/simple-1/input/entry.js b/node/bundler/tests/pass/import-with-export/simple-1/input/entry.js similarity index 100% rename from spack/tests/pass/import-with-export/simple-1/input/entry.js rename to node/bundler/tests/pass/import-with-export/simple-1/input/entry.js diff --git a/spack/tests/pass/import-with-export/simple-1/output/entry.js b/node/bundler/tests/pass/import-with-export/simple-1/output/entry.js similarity index 100% rename from spack/tests/pass/import-with-export/simple-1/output/entry.js rename to node/bundler/tests/pass/import-with-export/simple-1/output/entry.js diff --git a/spack/tests/pass/import/commons-default/input/a.js b/node/bundler/tests/pass/import/commons-default/input/a.js similarity index 100% rename from spack/tests/pass/import/commons-default/input/a.js rename to node/bundler/tests/pass/import/commons-default/input/a.js diff --git a/spack/tests/pass/import/commons-default/input/b.js b/node/bundler/tests/pass/import/commons-default/input/b.js similarity index 100% rename from spack/tests/pass/import/commons-default/input/b.js rename to node/bundler/tests/pass/import/commons-default/input/b.js diff --git a/spack/tests/pass/import/commons-default/input/c.js b/node/bundler/tests/pass/import/commons-default/input/c.js similarity index 100% rename from spack/tests/pass/import/commons-default/input/c.js rename to node/bundler/tests/pass/import/commons-default/input/c.js diff --git a/spack/tests/pass/import/commons-default/input/entry.js b/node/bundler/tests/pass/import/commons-default/input/entry.js similarity index 100% rename from spack/tests/pass/import/commons-default/input/entry.js rename to node/bundler/tests/pass/import/commons-default/input/entry.js diff --git a/spack/tests/pass/import/commons-default/output/entry.js b/node/bundler/tests/pass/import/commons-default/output/entry.js similarity index 100% rename from spack/tests/pass/import/commons-default/output/entry.js rename to node/bundler/tests/pass/import/commons-default/output/entry.js diff --git a/spack/tests/pass/import/commons-named/input/a.js b/node/bundler/tests/pass/import/commons-named/input/a.js similarity index 100% rename from spack/tests/pass/import/commons-named/input/a.js rename to node/bundler/tests/pass/import/commons-named/input/a.js diff --git a/spack/tests/pass/import/commons-named/input/b.js b/node/bundler/tests/pass/import/commons-named/input/b.js similarity index 100% rename from spack/tests/pass/import/commons-named/input/b.js rename to node/bundler/tests/pass/import/commons-named/input/b.js diff --git a/spack/tests/pass/import/commons-named/input/c.js b/node/bundler/tests/pass/import/commons-named/input/c.js similarity index 100% rename from spack/tests/pass/import/commons-named/input/c.js rename to node/bundler/tests/pass/import/commons-named/input/c.js diff --git a/spack/tests/pass/import/commons-named/input/entry.js b/node/bundler/tests/pass/import/commons-named/input/entry.js similarity index 100% rename from spack/tests/pass/import/commons-named/input/entry.js rename to node/bundler/tests/pass/import/commons-named/input/entry.js diff --git a/spack/tests/pass/import/commons-named/output/entry.js b/node/bundler/tests/pass/import/commons-named/output/entry.js similarity index 100% rename from spack/tests/pass/import/commons-named/output/entry.js rename to node/bundler/tests/pass/import/commons-named/output/entry.js diff --git a/spack/tests/pass/import/computed-key/input/a.js b/node/bundler/tests/pass/import/computed-key/input/a.js similarity index 100% rename from spack/tests/pass/import/computed-key/input/a.js rename to node/bundler/tests/pass/import/computed-key/input/a.js diff --git a/spack/tests/pass/import/computed-key/input/entry.js b/node/bundler/tests/pass/import/computed-key/input/entry.js similarity index 100% rename from spack/tests/pass/import/computed-key/input/entry.js rename to node/bundler/tests/pass/import/computed-key/input/entry.js diff --git a/spack/tests/pass/import/computed-key/output/entry.js b/node/bundler/tests/pass/import/computed-key/output/entry.js similarity index 100% rename from spack/tests/pass/import/computed-key/output/entry.js rename to node/bundler/tests/pass/import/computed-key/output/entry.js diff --git a/spack/tests/pass/import/default/named-class/input/a.js b/node/bundler/tests/pass/import/default/named-class/input/a.js similarity index 100% rename from spack/tests/pass/import/default/named-class/input/a.js rename to node/bundler/tests/pass/import/default/named-class/input/a.js diff --git a/spack/tests/pass/import/default/named-class/input/entry.js b/node/bundler/tests/pass/import/default/named-class/input/entry.js similarity index 100% rename from spack/tests/pass/import/default/named-class/input/entry.js rename to node/bundler/tests/pass/import/default/named-class/input/entry.js diff --git a/spack/tests/pass/import/default/named-class/output/entry.js b/node/bundler/tests/pass/import/default/named-class/output/entry.js similarity index 100% rename from spack/tests/pass/import/default/named-class/output/entry.js rename to node/bundler/tests/pass/import/default/named-class/output/entry.js diff --git a/spack/tests/pass/import/default/unnamed-class/input/a.js b/node/bundler/tests/pass/import/default/unnamed-class/input/a.js similarity index 100% rename from spack/tests/pass/import/default/unnamed-class/input/a.js rename to node/bundler/tests/pass/import/default/unnamed-class/input/a.js diff --git a/spack/tests/pass/import/default/unnamed-class/input/entry.js b/node/bundler/tests/pass/import/default/unnamed-class/input/entry.js similarity index 100% rename from spack/tests/pass/import/default/unnamed-class/input/entry.js rename to node/bundler/tests/pass/import/default/unnamed-class/input/entry.js diff --git a/spack/tests/pass/import/default/unnamed-class/output/entry.js b/node/bundler/tests/pass/import/default/unnamed-class/output/entry.js similarity index 100% rename from spack/tests/pass/import/default/unnamed-class/output/entry.js rename to node/bundler/tests/pass/import/default/unnamed-class/output/entry.js diff --git a/spack/tests/pass/import/name-conflict/simple/input/a.js b/node/bundler/tests/pass/import/name-conflict/simple/input/a.js similarity index 100% rename from spack/tests/pass/import/name-conflict/simple/input/a.js rename to node/bundler/tests/pass/import/name-conflict/simple/input/a.js diff --git a/spack/tests/pass/import/name-conflict/simple/input/entry.js b/node/bundler/tests/pass/import/name-conflict/simple/input/entry.js similarity index 100% rename from spack/tests/pass/import/name-conflict/simple/input/entry.js rename to node/bundler/tests/pass/import/name-conflict/simple/input/entry.js diff --git a/spack/tests/pass/import/name-conflict/simple/output/entry.js b/node/bundler/tests/pass/import/name-conflict/simple/output/entry.js similarity index 100% rename from spack/tests/pass/import/name-conflict/simple/output/entry.js rename to node/bundler/tests/pass/import/name-conflict/simple/output/entry.js diff --git a/spack/tests/pass/import/namespace/name-conflict/in-entry/input/a.js b/node/bundler/tests/pass/import/namespace/name-conflict/in-entry/input/a.js similarity index 100% rename from spack/tests/pass/import/namespace/name-conflict/in-entry/input/a.js rename to node/bundler/tests/pass/import/namespace/name-conflict/in-entry/input/a.js diff --git a/spack/tests/pass/import/namespace/name-conflict/in-entry/input/entry.js b/node/bundler/tests/pass/import/namespace/name-conflict/in-entry/input/entry.js similarity index 100% rename from spack/tests/pass/import/namespace/name-conflict/in-entry/input/entry.js rename to node/bundler/tests/pass/import/namespace/name-conflict/in-entry/input/entry.js diff --git a/spack/tests/pass/import/namespace/name-conflict/in-entry/output/entry.js b/node/bundler/tests/pass/import/namespace/name-conflict/in-entry/output/entry.js similarity index 100% rename from spack/tests/pass/import/namespace/name-conflict/in-entry/output/entry.js rename to node/bundler/tests/pass/import/namespace/name-conflict/in-entry/output/entry.js diff --git a/spack/tests/pass/import/namespace/simple/input/a.js b/node/bundler/tests/pass/import/namespace/simple/input/a.js similarity index 100% rename from spack/tests/pass/import/namespace/simple/input/a.js rename to node/bundler/tests/pass/import/namespace/simple/input/a.js diff --git a/spack/tests/pass/import/namespace/simple/input/entry.js b/node/bundler/tests/pass/import/namespace/simple/input/entry.js similarity index 100% rename from spack/tests/pass/import/namespace/simple/input/entry.js rename to node/bundler/tests/pass/import/namespace/simple/input/entry.js diff --git a/spack/tests/pass/import/namespace/simple/output/entry.js b/node/bundler/tests/pass/import/namespace/simple/output/entry.js similarity index 100% rename from spack/tests/pass/import/namespace/simple/output/entry.js rename to node/bundler/tests/pass/import/namespace/simple/output/entry.js diff --git a/spack/tests/pass/import/resursive/input/a.js b/node/bundler/tests/pass/import/resursive/input/a.js similarity index 100% rename from spack/tests/pass/import/resursive/input/a.js rename to node/bundler/tests/pass/import/resursive/input/a.js diff --git a/spack/tests/pass/import/resursive/input/b.js b/node/bundler/tests/pass/import/resursive/input/b.js similarity index 100% rename from spack/tests/pass/import/resursive/input/b.js rename to node/bundler/tests/pass/import/resursive/input/b.js diff --git a/spack/tests/pass/import/resursive/input/c.js b/node/bundler/tests/pass/import/resursive/input/c.js similarity index 100% rename from spack/tests/pass/import/resursive/input/c.js rename to node/bundler/tests/pass/import/resursive/input/c.js diff --git a/spack/tests/pass/import/resursive/input/entry.js b/node/bundler/tests/pass/import/resursive/input/entry.js similarity index 100% rename from spack/tests/pass/import/resursive/input/entry.js rename to node/bundler/tests/pass/import/resursive/input/entry.js diff --git a/spack/tests/pass/import/resursive/output/entry.js b/node/bundler/tests/pass/import/resursive/output/entry.js similarity index 100% rename from spack/tests/pass/import/resursive/output/entry.js rename to node/bundler/tests/pass/import/resursive/output/entry.js diff --git a/spack/tests/pass/import/simple-alias/input/a.js b/node/bundler/tests/pass/import/simple-alias/input/a.js similarity index 100% rename from spack/tests/pass/import/simple-alias/input/a.js rename to node/bundler/tests/pass/import/simple-alias/input/a.js diff --git a/spack/tests/pass/import/simple-alias/input/entry.js b/node/bundler/tests/pass/import/simple-alias/input/entry.js similarity index 100% rename from spack/tests/pass/import/simple-alias/input/entry.js rename to node/bundler/tests/pass/import/simple-alias/input/entry.js diff --git a/spack/tests/pass/import/simple-alias/output/entry.js b/node/bundler/tests/pass/import/simple-alias/output/entry.js similarity index 100% rename from spack/tests/pass/import/simple-alias/output/entry.js rename to node/bundler/tests/pass/import/simple-alias/output/entry.js diff --git a/spack/tests/pass/import/simple-decl/input/a.js b/node/bundler/tests/pass/import/simple-decl/input/a.js similarity index 100% rename from spack/tests/pass/import/simple-decl/input/a.js rename to node/bundler/tests/pass/import/simple-decl/input/a.js diff --git a/spack/tests/pass/import/simple-decl/input/entry.js b/node/bundler/tests/pass/import/simple-decl/input/entry.js similarity index 100% rename from spack/tests/pass/import/simple-decl/input/entry.js rename to node/bundler/tests/pass/import/simple-decl/input/entry.js diff --git a/spack/tests/pass/import/simple-decl/output/entry.js b/node/bundler/tests/pass/import/simple-decl/output/entry.js similarity index 100% rename from spack/tests/pass/import/simple-decl/output/entry.js rename to node/bundler/tests/pass/import/simple-decl/output/entry.js diff --git a/spack/tests/pass/import/star-export/input/a.js b/node/bundler/tests/pass/import/star-export/input/a.js similarity index 100% rename from spack/tests/pass/import/star-export/input/a.js rename to node/bundler/tests/pass/import/star-export/input/a.js diff --git a/spack/tests/pass/import/star-export/input/entry.js b/node/bundler/tests/pass/import/star-export/input/entry.js similarity index 100% rename from spack/tests/pass/import/star-export/input/entry.js rename to node/bundler/tests/pass/import/star-export/input/entry.js diff --git a/spack/tests/pass/import/star-export/output/entry.js b/node/bundler/tests/pass/import/star-export/output/entry.js similarity index 100% rename from spack/tests/pass/import/star-export/output/entry.js rename to node/bundler/tests/pass/import/star-export/output/entry.js diff --git a/spack/tests/pass/import/star-use/input/a.js b/node/bundler/tests/pass/import/star-use/input/a.js similarity index 100% rename from spack/tests/pass/import/star-use/input/a.js rename to node/bundler/tests/pass/import/star-use/input/a.js diff --git a/spack/tests/pass/import/star-use/input/entry.js b/node/bundler/tests/pass/import/star-use/input/entry.js similarity index 100% rename from spack/tests/pass/import/star-use/input/entry.js rename to node/bundler/tests/pass/import/star-use/input/entry.js diff --git a/spack/tests/pass/import/star-use/output/entry.js b/node/bundler/tests/pass/import/star-use/output/entry.js similarity index 100% rename from spack/tests/pass/import/star-use/output/entry.js rename to node/bundler/tests/pass/import/star-use/output/entry.js diff --git a/spack/tests/pass/import/top-level-require/.order/input/a.js b/node/bundler/tests/pass/import/top-level-require/.order/input/a.js similarity index 100% rename from spack/tests/pass/import/top-level-require/.order/input/a.js rename to node/bundler/tests/pass/import/top-level-require/.order/input/a.js diff --git a/spack/tests/pass/import/top-level-require/.order/input/entry.js b/node/bundler/tests/pass/import/top-level-require/.order/input/entry.js similarity index 100% rename from spack/tests/pass/import/top-level-require/.order/input/entry.js rename to node/bundler/tests/pass/import/top-level-require/.order/input/entry.js diff --git a/spack/tests/pass/import/top-level-require/.order/output/entry.js b/node/bundler/tests/pass/import/top-level-require/.order/output/entry.js similarity index 100% rename from spack/tests/pass/import/top-level-require/.order/output/entry.js rename to node/bundler/tests/pass/import/top-level-require/.order/output/entry.js diff --git a/spack/tests/pass/import/top-level-require/.seq-expr/input/a.js b/node/bundler/tests/pass/import/top-level-require/.seq-expr/input/a.js similarity index 100% rename from spack/tests/pass/import/top-level-require/.seq-expr/input/a.js rename to node/bundler/tests/pass/import/top-level-require/.seq-expr/input/a.js diff --git a/spack/tests/pass/import/top-level-require/.seq-expr/input/entry.js b/node/bundler/tests/pass/import/top-level-require/.seq-expr/input/entry.js similarity index 100% rename from spack/tests/pass/import/top-level-require/.seq-expr/input/entry.js rename to node/bundler/tests/pass/import/top-level-require/.seq-expr/input/entry.js diff --git a/spack/tests/pass/import/top-level-require/.seq-expr/output/entry.js b/node/bundler/tests/pass/import/top-level-require/.seq-expr/output/entry.js similarity index 100% rename from spack/tests/pass/import/top-level-require/.seq-expr/output/entry.js rename to node/bundler/tests/pass/import/top-level-require/.seq-expr/output/entry.js diff --git a/spack/tests/pass/import/top-level-require/.simple/input/a.js b/node/bundler/tests/pass/import/top-level-require/.simple/input/a.js similarity index 100% rename from spack/tests/pass/import/top-level-require/.simple/input/a.js rename to node/bundler/tests/pass/import/top-level-require/.simple/input/a.js diff --git a/spack/tests/pass/import/top-level-require/.simple/input/b.js b/node/bundler/tests/pass/import/top-level-require/.simple/input/b.js similarity index 100% rename from spack/tests/pass/import/top-level-require/.simple/input/b.js rename to node/bundler/tests/pass/import/top-level-require/.simple/input/b.js diff --git a/spack/tests/pass/import/top-level-require/.simple/input/entry.js b/node/bundler/tests/pass/import/top-level-require/.simple/input/entry.js similarity index 100% rename from spack/tests/pass/import/top-level-require/.simple/input/entry.js rename to node/bundler/tests/pass/import/top-level-require/.simple/input/entry.js diff --git a/spack/tests/pass/import/top-level-require/.simple/output/entry.js b/node/bundler/tests/pass/import/top-level-require/.simple/output/entry.js similarity index 100% rename from spack/tests/pass/import/top-level-require/.simple/output/entry.js rename to node/bundler/tests/pass/import/top-level-require/.simple/output/entry.js diff --git a/spack/tests/pass/issue-1138/example-1/input/.swcrc b/node/bundler/tests/pass/issue-1138/example-1/input/.swcrc similarity index 100% rename from spack/tests/pass/issue-1138/example-1/input/.swcrc rename to node/bundler/tests/pass/issue-1138/example-1/input/.swcrc diff --git a/spack/tests/pass/issue-1138/example-1/input/a.ts b/node/bundler/tests/pass/issue-1138/example-1/input/a.ts similarity index 100% rename from spack/tests/pass/issue-1138/example-1/input/a.ts rename to node/bundler/tests/pass/issue-1138/example-1/input/a.ts diff --git a/spack/tests/pass/issue-1138/example-1/input/entry.js b/node/bundler/tests/pass/issue-1138/example-1/input/entry.js similarity index 100% rename from spack/tests/pass/issue-1138/example-1/input/entry.js rename to node/bundler/tests/pass/issue-1138/example-1/input/entry.js diff --git a/spack/tests/pass/issue-1138/example-1/input/l.ts b/node/bundler/tests/pass/issue-1138/example-1/input/l.ts similarity index 100% rename from spack/tests/pass/issue-1138/example-1/input/l.ts rename to node/bundler/tests/pass/issue-1138/example-1/input/l.ts diff --git a/spack/tests/pass/issue-1138/example-1/output/entry.js b/node/bundler/tests/pass/issue-1138/example-1/output/entry.js similarity index 100% rename from spack/tests/pass/issue-1138/example-1/output/entry.js rename to node/bundler/tests/pass/issue-1138/example-1/output/entry.js diff --git a/spack/tests/pass/issue-1138/example-2/input/.swcrc b/node/bundler/tests/pass/issue-1138/example-2/input/.swcrc similarity index 100% rename from spack/tests/pass/issue-1138/example-2/input/.swcrc rename to node/bundler/tests/pass/issue-1138/example-2/input/.swcrc diff --git a/spack/tests/pass/issue-1138/example-2/input/a.ts b/node/bundler/tests/pass/issue-1138/example-2/input/a.ts similarity index 100% rename from spack/tests/pass/issue-1138/example-2/input/a.ts rename to node/bundler/tests/pass/issue-1138/example-2/input/a.ts diff --git a/spack/tests/pass/issue-1138/example-2/input/entry.js b/node/bundler/tests/pass/issue-1138/example-2/input/entry.js similarity index 100% rename from spack/tests/pass/issue-1138/example-2/input/entry.js rename to node/bundler/tests/pass/issue-1138/example-2/input/entry.js diff --git a/spack/tests/pass/issue-1138/example-2/input/l.ts b/node/bundler/tests/pass/issue-1138/example-2/input/l.ts similarity index 100% rename from spack/tests/pass/issue-1138/example-2/input/l.ts rename to node/bundler/tests/pass/issue-1138/example-2/input/l.ts diff --git a/spack/tests/pass/issue-1138/example-2/output/entry.js b/node/bundler/tests/pass/issue-1138/example-2/output/entry.js similarity index 100% rename from spack/tests/pass/issue-1138/example-2/output/entry.js rename to node/bundler/tests/pass/issue-1138/example-2/output/entry.js diff --git a/spack/tests/pass/issue-1138/example-3/input/.swcrc b/node/bundler/tests/pass/issue-1138/example-3/input/.swcrc similarity index 100% rename from spack/tests/pass/issue-1138/example-3/input/.swcrc rename to node/bundler/tests/pass/issue-1138/example-3/input/.swcrc diff --git a/spack/tests/pass/issue-1138/example-3/input/a.ts b/node/bundler/tests/pass/issue-1138/example-3/input/a.ts similarity index 100% rename from spack/tests/pass/issue-1138/example-3/input/a.ts rename to node/bundler/tests/pass/issue-1138/example-3/input/a.ts diff --git a/spack/tests/pass/issue-1138/example-3/input/entry.js b/node/bundler/tests/pass/issue-1138/example-3/input/entry.js similarity index 100% rename from spack/tests/pass/issue-1138/example-3/input/entry.js rename to node/bundler/tests/pass/issue-1138/example-3/input/entry.js diff --git a/spack/tests/pass/issue-1138/example-3/input/l.ts b/node/bundler/tests/pass/issue-1138/example-3/input/l.ts similarity index 100% rename from spack/tests/pass/issue-1138/example-3/input/l.ts rename to node/bundler/tests/pass/issue-1138/example-3/input/l.ts diff --git a/spack/tests/pass/issue-1138/example-3/output/entry.js b/node/bundler/tests/pass/issue-1138/example-3/output/entry.js similarity index 100% rename from spack/tests/pass/issue-1138/example-3/output/entry.js rename to node/bundler/tests/pass/issue-1138/example-3/output/entry.js diff --git a/spack/tests/pass/issue-1139/example-1/input/a.js b/node/bundler/tests/pass/issue-1139/example-1/input/a.js similarity index 100% rename from spack/tests/pass/issue-1139/example-1/input/a.js rename to node/bundler/tests/pass/issue-1139/example-1/input/a.js diff --git a/spack/tests/pass/issue-1139/example-1/input/entry.js b/node/bundler/tests/pass/issue-1139/example-1/input/entry.js similarity index 100% rename from spack/tests/pass/issue-1139/example-1/input/entry.js rename to node/bundler/tests/pass/issue-1139/example-1/input/entry.js diff --git a/spack/tests/pass/issue-1139/example-1/output/entry.js b/node/bundler/tests/pass/issue-1139/example-1/output/entry.js similarity index 100% rename from spack/tests/pass/issue-1139/example-1/output/entry.js rename to node/bundler/tests/pass/issue-1139/example-1/output/entry.js diff --git a/spack/tests/pass/issue-1139/example-2/input/a.js b/node/bundler/tests/pass/issue-1139/example-2/input/a.js similarity index 100% rename from spack/tests/pass/issue-1139/example-2/input/a.js rename to node/bundler/tests/pass/issue-1139/example-2/input/a.js diff --git a/spack/tests/pass/issue-1139/example-2/input/b.js b/node/bundler/tests/pass/issue-1139/example-2/input/b.js similarity index 100% rename from spack/tests/pass/issue-1139/example-2/input/b.js rename to node/bundler/tests/pass/issue-1139/example-2/input/b.js diff --git a/spack/tests/pass/issue-1139/example-2/input/entry.js b/node/bundler/tests/pass/issue-1139/example-2/input/entry.js similarity index 100% rename from spack/tests/pass/issue-1139/example-2/input/entry.js rename to node/bundler/tests/pass/issue-1139/example-2/input/entry.js diff --git a/spack/tests/pass/issue-1139/example-2/output/entry.js b/node/bundler/tests/pass/issue-1139/example-2/output/entry.js similarity index 100% rename from spack/tests/pass/issue-1139/example-2/output/entry.js rename to node/bundler/tests/pass/issue-1139/example-2/output/entry.js diff --git a/spack/tests/pass/issue-1225/cjs/input/entry.js b/node/bundler/tests/pass/issue-1225/cjs/input/entry.js similarity index 100% rename from spack/tests/pass/issue-1225/cjs/input/entry.js rename to node/bundler/tests/pass/issue-1225/cjs/input/entry.js diff --git a/spack/tests/pass/issue-1225/cjs/input/mod.json b/node/bundler/tests/pass/issue-1225/cjs/input/mod.json similarity index 100% rename from spack/tests/pass/issue-1225/cjs/input/mod.json rename to node/bundler/tests/pass/issue-1225/cjs/input/mod.json diff --git a/spack/tests/pass/issue-1225/cjs/output/entry.js b/node/bundler/tests/pass/issue-1225/cjs/output/entry.js similarity index 100% rename from spack/tests/pass/issue-1225/cjs/output/entry.js rename to node/bundler/tests/pass/issue-1225/cjs/output/entry.js diff --git a/spack/tests/pass/issue-1225/esm/input/entry.js b/node/bundler/tests/pass/issue-1225/esm/input/entry.js similarity index 100% rename from spack/tests/pass/issue-1225/esm/input/entry.js rename to node/bundler/tests/pass/issue-1225/esm/input/entry.js diff --git a/spack/tests/pass/issue-1225/esm/input/mod.json b/node/bundler/tests/pass/issue-1225/esm/input/mod.json similarity index 100% rename from spack/tests/pass/issue-1225/esm/input/mod.json rename to node/bundler/tests/pass/issue-1225/esm/input/mod.json diff --git a/spack/tests/pass/issue-1225/esm/output/entry.js b/node/bundler/tests/pass/issue-1225/esm/output/entry.js similarity index 100% rename from spack/tests/pass/issue-1225/esm/output/entry.js rename to node/bundler/tests/pass/issue-1225/esm/output/entry.js diff --git a/spack/tests/pass/issue-1328/case1/input/.swcrc b/node/bundler/tests/pass/issue-1328/case1/input/.swcrc similarity index 100% rename from spack/tests/pass/issue-1328/case1/input/.swcrc rename to node/bundler/tests/pass/issue-1328/case1/input/.swcrc diff --git a/spack/tests/pass/issue-1328/case1/input/entry.js b/node/bundler/tests/pass/issue-1328/case1/input/entry.js similarity index 100% rename from spack/tests/pass/issue-1328/case1/input/entry.js rename to node/bundler/tests/pass/issue-1328/case1/input/entry.js diff --git a/spack/tests/pass/issue-1328/case1/output/entry.js b/node/bundler/tests/pass/issue-1328/case1/output/entry.js similarity index 100% rename from spack/tests/pass/issue-1328/case1/output/entry.js rename to node/bundler/tests/pass/issue-1328/case1/output/entry.js diff --git a/spack/tests/pass/issue-1338/export-all-alias/input/entry.js b/node/bundler/tests/pass/issue-1338/export-all-alias/input/entry.js similarity index 100% rename from spack/tests/pass/issue-1338/export-all-alias/input/entry.js rename to node/bundler/tests/pass/issue-1338/export-all-alias/input/entry.js diff --git a/spack/tests/pass/issue-1338/export-all-alias/output/entry.js b/node/bundler/tests/pass/issue-1338/export-all-alias/output/entry.js similarity index 100% rename from spack/tests/pass/issue-1338/export-all-alias/output/entry.js rename to node/bundler/tests/pass/issue-1338/export-all-alias/output/entry.js diff --git a/spack/tests/pass/issue-1338/export-all/input/entry.js b/node/bundler/tests/pass/issue-1338/export-all/input/entry.js similarity index 100% rename from spack/tests/pass/issue-1338/export-all/input/entry.js rename to node/bundler/tests/pass/issue-1338/export-all/input/entry.js diff --git a/spack/tests/pass/issue-1338/export-all/output/entry.js b/node/bundler/tests/pass/issue-1338/export-all/output/entry.js similarity index 100% rename from spack/tests/pass/issue-1338/export-all/output/entry.js rename to node/bundler/tests/pass/issue-1338/export-all/output/entry.js diff --git a/spack/tests/pass/issue-1338/import-all/input/entry.js b/node/bundler/tests/pass/issue-1338/import-all/input/entry.js similarity index 100% rename from spack/tests/pass/issue-1338/import-all/input/entry.js rename to node/bundler/tests/pass/issue-1338/import-all/input/entry.js diff --git a/spack/tests/pass/issue-1338/import-all/output/entry.js b/node/bundler/tests/pass/issue-1338/import-all/output/entry.js similarity index 100% rename from spack/tests/pass/issue-1338/import-all/output/entry.js rename to node/bundler/tests/pass/issue-1338/import-all/output/entry.js diff --git a/spack/tests/pass/issue-1338/import-specific/input/entry.js b/node/bundler/tests/pass/issue-1338/import-specific/input/entry.js similarity index 100% rename from spack/tests/pass/issue-1338/import-specific/input/entry.js rename to node/bundler/tests/pass/issue-1338/import-specific/input/entry.js diff --git a/spack/tests/pass/issue-1338/import-specific/output/entry.js b/node/bundler/tests/pass/issue-1338/import-specific/output/entry.js similarity index 100% rename from spack/tests/pass/issue-1338/import-specific/output/entry.js rename to node/bundler/tests/pass/issue-1338/import-specific/output/entry.js diff --git a/spack/tests/pass/issue-1533/case1/input/entry.js b/node/bundler/tests/pass/issue-1533/case1/input/entry.js similarity index 100% rename from spack/tests/pass/issue-1533/case1/input/entry.js rename to node/bundler/tests/pass/issue-1533/case1/input/entry.js diff --git a/spack/tests/pass/issue-1533/case1/output/entry.js b/node/bundler/tests/pass/issue-1533/case1/output/entry.js similarity index 100% rename from spack/tests/pass/issue-1533/case1/output/entry.js rename to node/bundler/tests/pass/issue-1533/case1/output/entry.js diff --git a/spack/tests/pass/issue-1756/input/app/scripts/lib/util.js b/node/bundler/tests/pass/issue-1756/input/app/scripts/lib/util.js similarity index 100% rename from spack/tests/pass/issue-1756/input/app/scripts/lib/util.js rename to node/bundler/tests/pass/issue-1756/input/app/scripts/lib/util.js diff --git a/spack/tests/pass/issue-1756/input/entry.js b/node/bundler/tests/pass/issue-1756/input/entry.js similarity index 100% rename from spack/tests/pass/issue-1756/input/entry.js rename to node/bundler/tests/pass/issue-1756/input/entry.js diff --git a/spack/tests/pass/issue-1756/input/shared/constants/app.js b/node/bundler/tests/pass/issue-1756/input/shared/constants/app.js similarity index 100% rename from spack/tests/pass/issue-1756/input/shared/constants/app.js rename to node/bundler/tests/pass/issue-1756/input/shared/constants/app.js diff --git a/spack/tests/pass/issue-1756/input/ui/ducks/alerts/unconnected-account.js b/node/bundler/tests/pass/issue-1756/input/ui/ducks/alerts/unconnected-account.js similarity index 100% rename from spack/tests/pass/issue-1756/input/ui/ducks/alerts/unconnected-account.js rename to node/bundler/tests/pass/issue-1756/input/ui/ducks/alerts/unconnected-account.js diff --git a/spack/tests/pass/issue-1756/input/ui/helpers/utils/confirm-tx.util.js b/node/bundler/tests/pass/issue-1756/input/ui/helpers/utils/confirm-tx.util.js similarity index 100% rename from spack/tests/pass/issue-1756/input/ui/helpers/utils/confirm-tx.util.js rename to node/bundler/tests/pass/issue-1756/input/ui/helpers/utils/confirm-tx.util.js diff --git a/spack/tests/pass/issue-1756/input/ui/helpers/utils/token-util.js b/node/bundler/tests/pass/issue-1756/input/ui/helpers/utils/token-util.js similarity index 100% rename from spack/tests/pass/issue-1756/input/ui/helpers/utils/token-util.js rename to node/bundler/tests/pass/issue-1756/input/ui/helpers/utils/token-util.js diff --git a/spack/tests/pass/issue-1756/input/ui/pages/send/send.constants.js b/node/bundler/tests/pass/issue-1756/input/ui/pages/send/send.constants.js similarity index 100% rename from spack/tests/pass/issue-1756/input/ui/pages/send/send.constants.js rename to node/bundler/tests/pass/issue-1756/input/ui/pages/send/send.constants.js diff --git a/spack/tests/pass/issue-1756/input/ui/pages/send/send.utils.js b/node/bundler/tests/pass/issue-1756/input/ui/pages/send/send.utils.js similarity index 100% rename from spack/tests/pass/issue-1756/input/ui/pages/send/send.utils.js rename to node/bundler/tests/pass/issue-1756/input/ui/pages/send/send.utils.js diff --git a/spack/tests/pass/issue-1756/input/ui/store/actions.js b/node/bundler/tests/pass/issue-1756/input/ui/store/actions.js similarity index 100% rename from spack/tests/pass/issue-1756/input/ui/store/actions.js rename to node/bundler/tests/pass/issue-1756/input/ui/store/actions.js diff --git a/spack/tests/pass/merge/basic/input/a.js b/node/bundler/tests/pass/merge/basic/input/a.js similarity index 100% rename from spack/tests/pass/merge/basic/input/a.js rename to node/bundler/tests/pass/merge/basic/input/a.js diff --git a/spack/tests/pass/merge/basic/input/b.js b/node/bundler/tests/pass/merge/basic/input/b.js similarity index 100% rename from spack/tests/pass/merge/basic/input/b.js rename to node/bundler/tests/pass/merge/basic/input/b.js diff --git a/spack/tests/pass/merge/basic/input/entry.js b/node/bundler/tests/pass/merge/basic/input/entry.js similarity index 100% rename from spack/tests/pass/merge/basic/input/entry.js rename to node/bundler/tests/pass/merge/basic/input/entry.js diff --git a/spack/tests/pass/merge/basic/output/entry.js b/node/bundler/tests/pass/merge/basic/output/entry.js similarity index 100% rename from spack/tests/pass/merge/basic/output/entry.js rename to node/bundler/tests/pass/merge/basic/output/entry.js diff --git a/spack/tests/pass/merge/name-conflict/side-effects/simple/input/a.js b/node/bundler/tests/pass/merge/name-conflict/side-effects/simple/input/a.js similarity index 100% rename from spack/tests/pass/merge/name-conflict/side-effects/simple/input/a.js rename to node/bundler/tests/pass/merge/name-conflict/side-effects/simple/input/a.js diff --git a/spack/tests/pass/merge/name-conflict/side-effects/simple/input/entry.js b/node/bundler/tests/pass/merge/name-conflict/side-effects/simple/input/entry.js similarity index 100% rename from spack/tests/pass/merge/name-conflict/side-effects/simple/input/entry.js rename to node/bundler/tests/pass/merge/name-conflict/side-effects/simple/input/entry.js diff --git a/spack/tests/pass/merge/name-conflict/side-effects/simple/output/entry.js b/node/bundler/tests/pass/merge/name-conflict/side-effects/simple/output/entry.js similarity index 100% rename from spack/tests/pass/merge/name-conflict/side-effects/simple/output/entry.js rename to node/bundler/tests/pass/merge/name-conflict/side-effects/simple/output/entry.js diff --git a/spack/tests/pass/merge/name-conflict/simple/input/a.js b/node/bundler/tests/pass/merge/name-conflict/simple/input/a.js similarity index 100% rename from spack/tests/pass/merge/name-conflict/simple/input/a.js rename to node/bundler/tests/pass/merge/name-conflict/simple/input/a.js diff --git a/spack/tests/pass/merge/name-conflict/simple/input/b.js b/node/bundler/tests/pass/merge/name-conflict/simple/input/b.js similarity index 100% rename from spack/tests/pass/merge/name-conflict/simple/input/b.js rename to node/bundler/tests/pass/merge/name-conflict/simple/input/b.js diff --git a/spack/tests/pass/merge/name-conflict/simple/input/entry.js b/node/bundler/tests/pass/merge/name-conflict/simple/input/entry.js similarity index 100% rename from spack/tests/pass/merge/name-conflict/simple/input/entry.js rename to node/bundler/tests/pass/merge/name-conflict/simple/input/entry.js diff --git a/spack/tests/pass/merge/name-conflict/simple/output/entry.js b/node/bundler/tests/pass/merge/name-conflict/simple/output/entry.js similarity index 100% rename from spack/tests/pass/merge/name-conflict/simple/output/entry.js rename to node/bundler/tests/pass/merge/name-conflict/simple/output/entry.js diff --git a/spack/tests/pass/merge/nested-import/input/a.js b/node/bundler/tests/pass/merge/nested-import/input/a.js similarity index 100% rename from spack/tests/pass/merge/nested-import/input/a.js rename to node/bundler/tests/pass/merge/nested-import/input/a.js diff --git a/spack/tests/pass/merge/nested-import/input/b.js b/node/bundler/tests/pass/merge/nested-import/input/b.js similarity index 100% rename from spack/tests/pass/merge/nested-import/input/b.js rename to node/bundler/tests/pass/merge/nested-import/input/b.js diff --git a/spack/tests/pass/merge/nested-import/input/entry.js b/node/bundler/tests/pass/merge/nested-import/input/entry.js similarity index 100% rename from spack/tests/pass/merge/nested-import/input/entry.js rename to node/bundler/tests/pass/merge/nested-import/input/entry.js diff --git a/spack/tests/pass/merge/nested-import/output/entry.js b/node/bundler/tests/pass/merge/nested-import/output/entry.js similarity index 100% rename from spack/tests/pass/merge/nested-import/output/entry.js rename to node/bundler/tests/pass/merge/nested-import/output/entry.js diff --git a/spack/tests/pass/multi-entry/.dynamic-import/input/a.js b/node/bundler/tests/pass/multi-entry/.dynamic-import/input/a.js similarity index 100% rename from spack/tests/pass/multi-entry/.dynamic-import/input/a.js rename to node/bundler/tests/pass/multi-entry/.dynamic-import/input/a.js diff --git a/spack/tests/pass/multi-entry/.dynamic-import/input/entry.js b/node/bundler/tests/pass/multi-entry/.dynamic-import/input/entry.js similarity index 100% rename from spack/tests/pass/multi-entry/.dynamic-import/input/entry.js rename to node/bundler/tests/pass/multi-entry/.dynamic-import/input/entry.js diff --git a/spack/tests/pass/multi-entry/.mixed/input/a.js b/node/bundler/tests/pass/multi-entry/.mixed/input/a.js similarity index 100% rename from spack/tests/pass/multi-entry/.mixed/input/a.js rename to node/bundler/tests/pass/multi-entry/.mixed/input/a.js diff --git a/spack/tests/pass/multi-entry/.mixed/input/b.js b/node/bundler/tests/pass/multi-entry/.mixed/input/b.js similarity index 100% rename from spack/tests/pass/multi-entry/.mixed/input/b.js rename to node/bundler/tests/pass/multi-entry/.mixed/input/b.js diff --git a/spack/tests/pass/multi-entry/.mixed/input/c.js b/node/bundler/tests/pass/multi-entry/.mixed/input/c.js similarity index 100% rename from spack/tests/pass/multi-entry/.mixed/input/c.js rename to node/bundler/tests/pass/multi-entry/.mixed/input/c.js diff --git a/spack/tests/pass/multi-entry/.mixed/input/entryA.js b/node/bundler/tests/pass/multi-entry/.mixed/input/entryA.js similarity index 100% rename from spack/tests/pass/multi-entry/.mixed/input/entryA.js rename to node/bundler/tests/pass/multi-entry/.mixed/input/entryA.js diff --git a/spack/tests/pass/multi-entry/.mixed/input/entryB.js b/node/bundler/tests/pass/multi-entry/.mixed/input/entryB.js similarity index 100% rename from spack/tests/pass/multi-entry/.mixed/input/entryB.js rename to node/bundler/tests/pass/multi-entry/.mixed/input/entryB.js diff --git a/spack/tests/pass/multi-entry/simple/input/c.js b/node/bundler/tests/pass/multi-entry/simple/input/c.js similarity index 100% rename from spack/tests/pass/multi-entry/simple/input/c.js rename to node/bundler/tests/pass/multi-entry/simple/input/c.js diff --git a/spack/tests/pass/multi-entry/simple/input/d.js b/node/bundler/tests/pass/multi-entry/simple/input/d.js similarity index 100% rename from spack/tests/pass/multi-entry/simple/input/d.js rename to node/bundler/tests/pass/multi-entry/simple/input/d.js diff --git a/spack/tests/pass/multi-entry/simple/input/entry-a.js b/node/bundler/tests/pass/multi-entry/simple/input/entry-a.js similarity index 100% rename from spack/tests/pass/multi-entry/simple/input/entry-a.js rename to node/bundler/tests/pass/multi-entry/simple/input/entry-a.js diff --git a/spack/tests/pass/multi-entry/simple/input/entry-b.js b/node/bundler/tests/pass/multi-entry/simple/input/entry-b.js similarity index 100% rename from spack/tests/pass/multi-entry/simple/input/entry-b.js rename to node/bundler/tests/pass/multi-entry/simple/input/entry-b.js diff --git a/spack/tests/pass/multi-entry/simple/output/d-2w4j5tksz1e1k.js b/node/bundler/tests/pass/multi-entry/simple/output/d-2w4j5tksz1e1k.js similarity index 100% rename from spack/tests/pass/multi-entry/simple/output/d-2w4j5tksz1e1k.js rename to node/bundler/tests/pass/multi-entry/simple/output/d-2w4j5tksz1e1k.js diff --git a/spack/tests/pass/multi-entry/simple/output/entry-a.js b/node/bundler/tests/pass/multi-entry/simple/output/entry-a.js similarity index 100% rename from spack/tests/pass/multi-entry/simple/output/entry-a.js rename to node/bundler/tests/pass/multi-entry/simple/output/entry-a.js diff --git a/spack/tests/pass/multi-entry/simple/output/entry-b.js b/node/bundler/tests/pass/multi-entry/simple/output/entry-b.js similarity index 100% rename from spack/tests/pass/multi-entry/simple/output/entry-b.js rename to node/bundler/tests/pass/multi-entry/simple/output/entry-b.js diff --git a/spack/tests/pass/node-modules/builtin/.simple/input/entry.js b/node/bundler/tests/pass/node-modules/builtin/.simple/input/entry.js similarity index 100% rename from spack/tests/pass/node-modules/builtin/.simple/input/entry.js rename to node/bundler/tests/pass/node-modules/builtin/.simple/input/entry.js diff --git a/spack/tests/pass/node-modules/library/simple/input/entry.js b/node/bundler/tests/pass/node-modules/library/simple/input/entry.js similarity index 100% rename from spack/tests/pass/node-modules/library/simple/input/entry.js rename to node/bundler/tests/pass/node-modules/library/simple/input/entry.js diff --git a/spack/tests/pass/node-modules/library/simple/output/entry.js b/node/bundler/tests/pass/node-modules/library/simple/output/entry.js similarity index 100% rename from spack/tests/pass/node-modules/library/simple/output/entry.js rename to node/bundler/tests/pass/node-modules/library/simple/output/entry.js diff --git a/spack/tests/pass/pr-1105/example-1/input/a.js b/node/bundler/tests/pass/pr-1105/example-1/input/a.js similarity index 100% rename from spack/tests/pass/pr-1105/example-1/input/a.js rename to node/bundler/tests/pass/pr-1105/example-1/input/a.js diff --git a/spack/tests/pass/pr-1105/example-1/input/entry.js b/node/bundler/tests/pass/pr-1105/example-1/input/entry.js similarity index 100% rename from spack/tests/pass/pr-1105/example-1/input/entry.js rename to node/bundler/tests/pass/pr-1105/example-1/input/entry.js diff --git a/spack/tests/pass/pr-1105/example-1/output/entry.js b/node/bundler/tests/pass/pr-1105/example-1/output/entry.js similarity index 100% rename from spack/tests/pass/pr-1105/example-1/output/entry.js rename to node/bundler/tests/pass/pr-1105/example-1/output/entry.js diff --git a/spack/tests/pass/pr-1105/example-10/input/.swcrc b/node/bundler/tests/pass/pr-1105/example-10/input/.swcrc similarity index 100% rename from spack/tests/pass/pr-1105/example-10/input/.swcrc rename to node/bundler/tests/pass/pr-1105/example-10/input/.swcrc diff --git a/spack/tests/pass/pr-1105/example-10/input/entry.js b/node/bundler/tests/pass/pr-1105/example-10/input/entry.js similarity index 100% rename from spack/tests/pass/pr-1105/example-10/input/entry.js rename to node/bundler/tests/pass/pr-1105/example-10/input/entry.js diff --git a/spack/tests/pass/pr-1105/example-10/input/i.ts b/node/bundler/tests/pass/pr-1105/example-10/input/i.ts similarity index 100% rename from spack/tests/pass/pr-1105/example-10/input/i.ts rename to node/bundler/tests/pass/pr-1105/example-10/input/i.ts diff --git a/spack/tests/pass/pr-1105/example-10/input/j.ts b/node/bundler/tests/pass/pr-1105/example-10/input/j.ts similarity index 100% rename from spack/tests/pass/pr-1105/example-10/input/j.ts rename to node/bundler/tests/pass/pr-1105/example-10/input/j.ts diff --git a/spack/tests/pass/pr-1105/example-10/input/k.ts b/node/bundler/tests/pass/pr-1105/example-10/input/k.ts similarity index 100% rename from spack/tests/pass/pr-1105/example-10/input/k.ts rename to node/bundler/tests/pass/pr-1105/example-10/input/k.ts diff --git a/spack/tests/pass/pr-1105/example-10/output/entry.js b/node/bundler/tests/pass/pr-1105/example-10/output/entry.js similarity index 100% rename from spack/tests/pass/pr-1105/example-10/output/entry.js rename to node/bundler/tests/pass/pr-1105/example-10/output/entry.js diff --git a/spack/tests/pass/pr-1105/example-2/input/.swcrc b/node/bundler/tests/pass/pr-1105/example-2/input/.swcrc similarity index 100% rename from spack/tests/pass/pr-1105/example-2/input/.swcrc rename to node/bundler/tests/pass/pr-1105/example-2/input/.swcrc diff --git a/spack/tests/pass/pr-1105/example-2/input/b.js b/node/bundler/tests/pass/pr-1105/example-2/input/b.js similarity index 100% rename from spack/tests/pass/pr-1105/example-2/input/b.js rename to node/bundler/tests/pass/pr-1105/example-2/input/b.js diff --git a/spack/tests/pass/pr-1105/example-2/input/c.js b/node/bundler/tests/pass/pr-1105/example-2/input/c.js similarity index 100% rename from spack/tests/pass/pr-1105/example-2/input/c.js rename to node/bundler/tests/pass/pr-1105/example-2/input/c.js diff --git a/spack/tests/pass/pr-1105/example-2/input/entry.js b/node/bundler/tests/pass/pr-1105/example-2/input/entry.js similarity index 100% rename from spack/tests/pass/pr-1105/example-2/input/entry.js rename to node/bundler/tests/pass/pr-1105/example-2/input/entry.js diff --git a/spack/tests/pass/pr-1105/example-2/output/entry.js b/node/bundler/tests/pass/pr-1105/example-2/output/entry.js similarity index 100% rename from spack/tests/pass/pr-1105/example-2/output/entry.js rename to node/bundler/tests/pass/pr-1105/example-2/output/entry.js diff --git a/spack/tests/pass/pr-1105/example-3/input/a.js b/node/bundler/tests/pass/pr-1105/example-3/input/a.js similarity index 100% rename from spack/tests/pass/pr-1105/example-3/input/a.js rename to node/bundler/tests/pass/pr-1105/example-3/input/a.js diff --git a/spack/tests/pass/pr-1105/example-3/input/d.js b/node/bundler/tests/pass/pr-1105/example-3/input/d.js similarity index 100% rename from spack/tests/pass/pr-1105/example-3/input/d.js rename to node/bundler/tests/pass/pr-1105/example-3/input/d.js diff --git a/spack/tests/pass/pr-1105/example-3/input/entry.js b/node/bundler/tests/pass/pr-1105/example-3/input/entry.js similarity index 100% rename from spack/tests/pass/pr-1105/example-3/input/entry.js rename to node/bundler/tests/pass/pr-1105/example-3/input/entry.js diff --git a/spack/tests/pass/pr-1105/example-3/output/entry.js b/node/bundler/tests/pass/pr-1105/example-3/output/entry.js similarity index 100% rename from spack/tests/pass/pr-1105/example-3/output/entry.js rename to node/bundler/tests/pass/pr-1105/example-3/output/entry.js diff --git a/spack/tests/pass/pr-1105/example-5/input/a.js b/node/bundler/tests/pass/pr-1105/example-5/input/a.js similarity index 100% rename from spack/tests/pass/pr-1105/example-5/input/a.js rename to node/bundler/tests/pass/pr-1105/example-5/input/a.js diff --git a/spack/tests/pass/pr-1105/example-5/input/e.js b/node/bundler/tests/pass/pr-1105/example-5/input/e.js similarity index 100% rename from spack/tests/pass/pr-1105/example-5/input/e.js rename to node/bundler/tests/pass/pr-1105/example-5/input/e.js diff --git a/spack/tests/pass/pr-1105/example-5/input/entry.js b/node/bundler/tests/pass/pr-1105/example-5/input/entry.js similarity index 100% rename from spack/tests/pass/pr-1105/example-5/input/entry.js rename to node/bundler/tests/pass/pr-1105/example-5/input/entry.js diff --git a/spack/tests/pass/pr-1105/example-5/output/entry.js b/node/bundler/tests/pass/pr-1105/example-5/output/entry.js similarity index 100% rename from spack/tests/pass/pr-1105/example-5/output/entry.js rename to node/bundler/tests/pass/pr-1105/example-5/output/entry.js diff --git a/spack/tests/pass/pr-1105/example-7/input/.swcrc b/node/bundler/tests/pass/pr-1105/example-7/input/.swcrc similarity index 100% rename from spack/tests/pass/pr-1105/example-7/input/.swcrc rename to node/bundler/tests/pass/pr-1105/example-7/input/.swcrc diff --git a/spack/tests/pass/pr-1105/example-7/input/entry.js b/node/bundler/tests/pass/pr-1105/example-7/input/entry.js similarity index 100% rename from spack/tests/pass/pr-1105/example-7/input/entry.js rename to node/bundler/tests/pass/pr-1105/example-7/input/entry.js diff --git a/spack/tests/pass/pr-1105/example-7/input/f.js b/node/bundler/tests/pass/pr-1105/example-7/input/f.js similarity index 100% rename from spack/tests/pass/pr-1105/example-7/input/f.js rename to node/bundler/tests/pass/pr-1105/example-7/input/f.js diff --git a/spack/tests/pass/pr-1105/example-7/output/entry.js b/node/bundler/tests/pass/pr-1105/example-7/output/entry.js similarity index 100% rename from spack/tests/pass/pr-1105/example-7/output/entry.js rename to node/bundler/tests/pass/pr-1105/example-7/output/entry.js diff --git a/spack/tests/pass/pr-1105/example-9-js/input/.swcrc b/node/bundler/tests/pass/pr-1105/example-9-js/input/.swcrc similarity index 100% rename from spack/tests/pass/pr-1105/example-9-js/input/.swcrc rename to node/bundler/tests/pass/pr-1105/example-9-js/input/.swcrc diff --git a/spack/tests/pass/pr-1105/example-9-js/input/a.js b/node/bundler/tests/pass/pr-1105/example-9-js/input/a.js similarity index 100% rename from spack/tests/pass/pr-1105/example-9-js/input/a.js rename to node/bundler/tests/pass/pr-1105/example-9-js/input/a.js diff --git a/spack/tests/pass/pr-1105/example-9-js/input/entry.js b/node/bundler/tests/pass/pr-1105/example-9-js/input/entry.js similarity index 100% rename from spack/tests/pass/pr-1105/example-9-js/input/entry.js rename to node/bundler/tests/pass/pr-1105/example-9-js/input/entry.js diff --git a/spack/tests/pass/pr-1105/example-9-js/output/entry.js b/node/bundler/tests/pass/pr-1105/example-9-js/output/entry.js similarity index 100% rename from spack/tests/pass/pr-1105/example-9-js/output/entry.js rename to node/bundler/tests/pass/pr-1105/example-9-js/output/entry.js diff --git a/spack/tests/pass/pr-1105/example-9-ts/input/.swcrc b/node/bundler/tests/pass/pr-1105/example-9-ts/input/.swcrc similarity index 100% rename from spack/tests/pass/pr-1105/example-9-ts/input/.swcrc rename to node/bundler/tests/pass/pr-1105/example-9-ts/input/.swcrc diff --git a/spack/tests/pass/pr-1105/example-9-ts/input/a.ts b/node/bundler/tests/pass/pr-1105/example-9-ts/input/a.ts similarity index 100% rename from spack/tests/pass/pr-1105/example-9-ts/input/a.ts rename to node/bundler/tests/pass/pr-1105/example-9-ts/input/a.ts diff --git a/spack/tests/pass/pr-1105/example-9-ts/input/entry.js b/node/bundler/tests/pass/pr-1105/example-9-ts/input/entry.js similarity index 100% rename from spack/tests/pass/pr-1105/example-9-ts/input/entry.js rename to node/bundler/tests/pass/pr-1105/example-9-ts/input/entry.js diff --git a/spack/tests/pass/pr-1105/example-9-ts/output/entry.js b/node/bundler/tests/pass/pr-1105/example-9-ts/output/entry.js similarity index 100% rename from spack/tests/pass/pr-1105/example-9-ts/output/entry.js rename to node/bundler/tests/pass/pr-1105/example-9-ts/output/entry.js diff --git a/spack/tests/pass/reexport/.namespace/input/.swcrc b/node/bundler/tests/pass/reexport/.namespace/input/.swcrc similarity index 100% rename from spack/tests/pass/reexport/.namespace/input/.swcrc rename to node/bundler/tests/pass/reexport/.namespace/input/.swcrc diff --git a/spack/tests/pass/reexport/.namespace/input/a.js b/node/bundler/tests/pass/reexport/.namespace/input/a.js similarity index 100% rename from spack/tests/pass/reexport/.namespace/input/a.js rename to node/bundler/tests/pass/reexport/.namespace/input/a.js diff --git a/spack/tests/pass/reexport/.namespace/input/b.js b/node/bundler/tests/pass/reexport/.namespace/input/b.js similarity index 100% rename from spack/tests/pass/reexport/.namespace/input/b.js rename to node/bundler/tests/pass/reexport/.namespace/input/b.js diff --git a/spack/tests/pass/reexport/.namespace/input/entry.js b/node/bundler/tests/pass/reexport/.namespace/input/entry.js similarity index 100% rename from spack/tests/pass/reexport/.namespace/input/entry.js rename to node/bundler/tests/pass/reexport/.namespace/input/entry.js diff --git a/spack/tests/pass/reexport/default-1-simple/input/a.js b/node/bundler/tests/pass/reexport/default-1-simple/input/a.js similarity index 100% rename from spack/tests/pass/reexport/default-1-simple/input/a.js rename to node/bundler/tests/pass/reexport/default-1-simple/input/a.js diff --git a/spack/tests/pass/reexport/default-1-simple/input/b.js b/node/bundler/tests/pass/reexport/default-1-simple/input/b.js similarity index 100% rename from spack/tests/pass/reexport/default-1-simple/input/b.js rename to node/bundler/tests/pass/reexport/default-1-simple/input/b.js diff --git a/spack/tests/pass/reexport/default-1-simple/input/entry.js b/node/bundler/tests/pass/reexport/default-1-simple/input/entry.js similarity index 100% rename from spack/tests/pass/reexport/default-1-simple/input/entry.js rename to node/bundler/tests/pass/reexport/default-1-simple/input/entry.js diff --git a/spack/tests/pass/reexport/default-1-simple/output/entry.js b/node/bundler/tests/pass/reexport/default-1-simple/output/entry.js similarity index 100% rename from spack/tests/pass/reexport/default-1-simple/output/entry.js rename to node/bundler/tests/pass/reexport/default-1-simple/output/entry.js diff --git a/spack/tests/pass/reexport/import-then-export-1/input/a.js b/node/bundler/tests/pass/reexport/import-then-export-1/input/a.js similarity index 100% rename from spack/tests/pass/reexport/import-then-export-1/input/a.js rename to node/bundler/tests/pass/reexport/import-then-export-1/input/a.js diff --git a/spack/tests/pass/reexport/import-then-export-1/input/b.js b/node/bundler/tests/pass/reexport/import-then-export-1/input/b.js similarity index 100% rename from spack/tests/pass/reexport/import-then-export-1/input/b.js rename to node/bundler/tests/pass/reexport/import-then-export-1/input/b.js diff --git a/spack/tests/pass/reexport/import-then-export-1/input/entry.js b/node/bundler/tests/pass/reexport/import-then-export-1/input/entry.js similarity index 100% rename from spack/tests/pass/reexport/import-then-export-1/input/entry.js rename to node/bundler/tests/pass/reexport/import-then-export-1/input/entry.js diff --git a/spack/tests/pass/reexport/import-then-export-1/output/entry.js b/node/bundler/tests/pass/reexport/import-then-export-1/output/entry.js similarity index 100% rename from spack/tests/pass/reexport/import-then-export-1/output/entry.js rename to node/bundler/tests/pass/reexport/import-then-export-1/output/entry.js diff --git a/spack/tests/pass/reexport/import-then-export-2/input/a.js b/node/bundler/tests/pass/reexport/import-then-export-2/input/a.js similarity index 100% rename from spack/tests/pass/reexport/import-then-export-2/input/a.js rename to node/bundler/tests/pass/reexport/import-then-export-2/input/a.js diff --git a/spack/tests/pass/reexport/import-then-export-2/input/b.js b/node/bundler/tests/pass/reexport/import-then-export-2/input/b.js similarity index 100% rename from spack/tests/pass/reexport/import-then-export-2/input/b.js rename to node/bundler/tests/pass/reexport/import-then-export-2/input/b.js diff --git a/spack/tests/pass/reexport/import-then-export-2/input/entry.js b/node/bundler/tests/pass/reexport/import-then-export-2/input/entry.js similarity index 100% rename from spack/tests/pass/reexport/import-then-export-2/input/entry.js rename to node/bundler/tests/pass/reexport/import-then-export-2/input/entry.js diff --git a/spack/tests/pass/reexport/import-then-export-2/output/entry.js b/node/bundler/tests/pass/reexport/import-then-export-2/output/entry.js similarity index 100% rename from spack/tests/pass/reexport/import-then-export-2/output/entry.js rename to node/bundler/tests/pass/reexport/import-then-export-2/output/entry.js diff --git a/spack/tests/pass/reexport/import-then-export-3/input/a.js b/node/bundler/tests/pass/reexport/import-then-export-3/input/a.js similarity index 100% rename from spack/tests/pass/reexport/import-then-export-3/input/a.js rename to node/bundler/tests/pass/reexport/import-then-export-3/input/a.js diff --git a/spack/tests/pass/reexport/import-then-export-3/input/b.js b/node/bundler/tests/pass/reexport/import-then-export-3/input/b.js similarity index 100% rename from spack/tests/pass/reexport/import-then-export-3/input/b.js rename to node/bundler/tests/pass/reexport/import-then-export-3/input/b.js diff --git a/spack/tests/pass/reexport/import-then-export-3/input/entry.js b/node/bundler/tests/pass/reexport/import-then-export-3/input/entry.js similarity index 100% rename from spack/tests/pass/reexport/import-then-export-3/input/entry.js rename to node/bundler/tests/pass/reexport/import-then-export-3/input/entry.js diff --git a/spack/tests/pass/reexport/import-then-export-3/output/entry.js b/node/bundler/tests/pass/reexport/import-then-export-3/output/entry.js similarity index 100% rename from spack/tests/pass/reexport/import-then-export-3/output/entry.js rename to node/bundler/tests/pass/reexport/import-then-export-3/output/entry.js diff --git a/spack/tests/pass/reexport/named-1-alias/input/a.js b/node/bundler/tests/pass/reexport/named-1-alias/input/a.js similarity index 100% rename from spack/tests/pass/reexport/named-1-alias/input/a.js rename to node/bundler/tests/pass/reexport/named-1-alias/input/a.js diff --git a/spack/tests/pass/reexport/named-1-alias/input/b.js b/node/bundler/tests/pass/reexport/named-1-alias/input/b.js similarity index 100% rename from spack/tests/pass/reexport/named-1-alias/input/b.js rename to node/bundler/tests/pass/reexport/named-1-alias/input/b.js diff --git a/spack/tests/pass/reexport/named-1-alias/input/entry.js b/node/bundler/tests/pass/reexport/named-1-alias/input/entry.js similarity index 100% rename from spack/tests/pass/reexport/named-1-alias/input/entry.js rename to node/bundler/tests/pass/reexport/named-1-alias/input/entry.js diff --git a/spack/tests/pass/reexport/named-1-alias/output/entry.js b/node/bundler/tests/pass/reexport/named-1-alias/output/entry.js similarity index 100% rename from spack/tests/pass/reexport/named-1-alias/output/entry.js rename to node/bundler/tests/pass/reexport/named-1-alias/output/entry.js diff --git a/spack/tests/pass/reexport/named-1-orig/input/a.js b/node/bundler/tests/pass/reexport/named-1-orig/input/a.js similarity index 100% rename from spack/tests/pass/reexport/named-1-orig/input/a.js rename to node/bundler/tests/pass/reexport/named-1-orig/input/a.js diff --git a/spack/tests/pass/reexport/named-1-orig/input/b.js b/node/bundler/tests/pass/reexport/named-1-orig/input/b.js similarity index 100% rename from spack/tests/pass/reexport/named-1-orig/input/b.js rename to node/bundler/tests/pass/reexport/named-1-orig/input/b.js diff --git a/spack/tests/pass/reexport/named-1-orig/input/entry.js b/node/bundler/tests/pass/reexport/named-1-orig/input/entry.js similarity index 100% rename from spack/tests/pass/reexport/named-1-orig/input/entry.js rename to node/bundler/tests/pass/reexport/named-1-orig/input/entry.js diff --git a/spack/tests/pass/reexport/named-1-orig/output/entry.js b/node/bundler/tests/pass/reexport/named-1-orig/output/entry.js similarity index 100% rename from spack/tests/pass/reexport/named-1-orig/output/entry.js rename to node/bundler/tests/pass/reexport/named-1-orig/output/entry.js diff --git a/spack/tests/pass/reexport/named-2-nested/input/a.js b/node/bundler/tests/pass/reexport/named-2-nested/input/a.js similarity index 100% rename from spack/tests/pass/reexport/named-2-nested/input/a.js rename to node/bundler/tests/pass/reexport/named-2-nested/input/a.js diff --git a/spack/tests/pass/reexport/named-2-nested/input/b.js b/node/bundler/tests/pass/reexport/named-2-nested/input/b.js similarity index 100% rename from spack/tests/pass/reexport/named-2-nested/input/b.js rename to node/bundler/tests/pass/reexport/named-2-nested/input/b.js diff --git a/spack/tests/pass/reexport/named-2-nested/input/c.js b/node/bundler/tests/pass/reexport/named-2-nested/input/c.js similarity index 100% rename from spack/tests/pass/reexport/named-2-nested/input/c.js rename to node/bundler/tests/pass/reexport/named-2-nested/input/c.js diff --git a/spack/tests/pass/reexport/named-2-nested/input/entry.js b/node/bundler/tests/pass/reexport/named-2-nested/input/entry.js similarity index 100% rename from spack/tests/pass/reexport/named-2-nested/input/entry.js rename to node/bundler/tests/pass/reexport/named-2-nested/input/entry.js diff --git a/spack/tests/pass/reexport/named-2-nested/output/entry.js b/node/bundler/tests/pass/reexport/named-2-nested/output/entry.js similarity index 100% rename from spack/tests/pass/reexport/named-2-nested/output/entry.js rename to node/bundler/tests/pass/reexport/named-2-nested/output/entry.js diff --git a/spack/tests/pass/reexport/named-3-var/input/a.js b/node/bundler/tests/pass/reexport/named-3-var/input/a.js similarity index 100% rename from spack/tests/pass/reexport/named-3-var/input/a.js rename to node/bundler/tests/pass/reexport/named-3-var/input/a.js diff --git a/spack/tests/pass/reexport/named-3-var/input/b.js b/node/bundler/tests/pass/reexport/named-3-var/input/b.js similarity index 100% rename from spack/tests/pass/reexport/named-3-var/input/b.js rename to node/bundler/tests/pass/reexport/named-3-var/input/b.js diff --git a/spack/tests/pass/reexport/named-3-var/input/c.js b/node/bundler/tests/pass/reexport/named-3-var/input/c.js similarity index 100% rename from spack/tests/pass/reexport/named-3-var/input/c.js rename to node/bundler/tests/pass/reexport/named-3-var/input/c.js diff --git a/spack/tests/pass/reexport/named-3-var/input/entry.js b/node/bundler/tests/pass/reexport/named-3-var/input/entry.js similarity index 100% rename from spack/tests/pass/reexport/named-3-var/input/entry.js rename to node/bundler/tests/pass/reexport/named-3-var/input/entry.js diff --git a/spack/tests/pass/reexport/named-3-var/output/entry.js b/node/bundler/tests/pass/reexport/named-3-var/output/entry.js similarity index 100% rename from spack/tests/pass/reexport/named-3-var/output/entry.js rename to node/bundler/tests/pass/reexport/named-3-var/output/entry.js diff --git a/spack/tests/pass/reexport/named-4-fn/input/a.js b/node/bundler/tests/pass/reexport/named-4-fn/input/a.js similarity index 100% rename from spack/tests/pass/reexport/named-4-fn/input/a.js rename to node/bundler/tests/pass/reexport/named-4-fn/input/a.js diff --git a/spack/tests/pass/reexport/named-4-fn/input/b.js b/node/bundler/tests/pass/reexport/named-4-fn/input/b.js similarity index 100% rename from spack/tests/pass/reexport/named-4-fn/input/b.js rename to node/bundler/tests/pass/reexport/named-4-fn/input/b.js diff --git a/spack/tests/pass/reexport/named-4-fn/input/entry.js b/node/bundler/tests/pass/reexport/named-4-fn/input/entry.js similarity index 100% rename from spack/tests/pass/reexport/named-4-fn/input/entry.js rename to node/bundler/tests/pass/reexport/named-4-fn/input/entry.js diff --git a/spack/tests/pass/reexport/named-4-fn/output/entry.js b/node/bundler/tests/pass/reexport/named-4-fn/output/entry.js similarity index 100% rename from spack/tests/pass/reexport/named-4-fn/output/entry.js rename to node/bundler/tests/pass/reexport/named-4-fn/output/entry.js diff --git a/spack/tests/pass/reexport/named-5-class/input/a.js b/node/bundler/tests/pass/reexport/named-5-class/input/a.js similarity index 100% rename from spack/tests/pass/reexport/named-5-class/input/a.js rename to node/bundler/tests/pass/reexport/named-5-class/input/a.js diff --git a/spack/tests/pass/reexport/named-5-class/input/b.js b/node/bundler/tests/pass/reexport/named-5-class/input/b.js similarity index 100% rename from spack/tests/pass/reexport/named-5-class/input/b.js rename to node/bundler/tests/pass/reexport/named-5-class/input/b.js diff --git a/spack/tests/pass/reexport/named-5-class/input/entry.js b/node/bundler/tests/pass/reexport/named-5-class/input/entry.js similarity index 100% rename from spack/tests/pass/reexport/named-5-class/input/entry.js rename to node/bundler/tests/pass/reexport/named-5-class/input/entry.js diff --git a/spack/tests/pass/reexport/named-5-class/output/entry.js b/node/bundler/tests/pass/reexport/named-5-class/output/entry.js similarity index 100% rename from spack/tests/pass/reexport/named-5-class/output/entry.js rename to node/bundler/tests/pass/reexport/named-5-class/output/entry.js diff --git a/spack/tests/pass/reexport/recursive-mini/input/a.js b/node/bundler/tests/pass/reexport/recursive-mini/input/a.js similarity index 100% rename from spack/tests/pass/reexport/recursive-mini/input/a.js rename to node/bundler/tests/pass/reexport/recursive-mini/input/a.js diff --git a/spack/tests/pass/reexport/recursive-mini/input/b.js b/node/bundler/tests/pass/reexport/recursive-mini/input/b.js similarity index 100% rename from spack/tests/pass/reexport/recursive-mini/input/b.js rename to node/bundler/tests/pass/reexport/recursive-mini/input/b.js diff --git a/spack/tests/pass/reexport/recursive-mini/input/entry.js b/node/bundler/tests/pass/reexport/recursive-mini/input/entry.js similarity index 100% rename from spack/tests/pass/reexport/recursive-mini/input/entry.js rename to node/bundler/tests/pass/reexport/recursive-mini/input/entry.js diff --git a/spack/tests/pass/reexport/recursive-mini/output/entry.js b/node/bundler/tests/pass/reexport/recursive-mini/output/entry.js similarity index 100% rename from spack/tests/pass/reexport/recursive-mini/output/entry.js rename to node/bundler/tests/pass/reexport/recursive-mini/output/entry.js diff --git a/spack/tests/pass/reexport/recursive-step1/input/a.js b/node/bundler/tests/pass/reexport/recursive-step1/input/a.js similarity index 100% rename from spack/tests/pass/reexport/recursive-step1/input/a.js rename to node/bundler/tests/pass/reexport/recursive-step1/input/a.js diff --git a/spack/tests/pass/reexport/recursive-step1/input/b.js b/node/bundler/tests/pass/reexport/recursive-step1/input/b.js similarity index 100% rename from spack/tests/pass/reexport/recursive-step1/input/b.js rename to node/bundler/tests/pass/reexport/recursive-step1/input/b.js diff --git a/spack/tests/pass/reexport/recursive-step1/input/c.js b/node/bundler/tests/pass/reexport/recursive-step1/input/c.js similarity index 100% rename from spack/tests/pass/reexport/recursive-step1/input/c.js rename to node/bundler/tests/pass/reexport/recursive-step1/input/c.js diff --git a/spack/tests/pass/reexport/recursive-step1/input/entry.js b/node/bundler/tests/pass/reexport/recursive-step1/input/entry.js similarity index 100% rename from spack/tests/pass/reexport/recursive-step1/input/entry.js rename to node/bundler/tests/pass/reexport/recursive-step1/input/entry.js diff --git a/spack/tests/pass/reexport/recursive-step1/output/entry.js b/node/bundler/tests/pass/reexport/recursive-step1/output/entry.js similarity index 100% rename from spack/tests/pass/reexport/recursive-step1/output/entry.js rename to node/bundler/tests/pass/reexport/recursive-step1/output/entry.js diff --git a/spack/tests/pass/reexport/recursive-step2/input/a.js b/node/bundler/tests/pass/reexport/recursive-step2/input/a.js similarity index 100% rename from spack/tests/pass/reexport/recursive-step2/input/a.js rename to node/bundler/tests/pass/reexport/recursive-step2/input/a.js diff --git a/spack/tests/pass/reexport/recursive-step2/input/b.js b/node/bundler/tests/pass/reexport/recursive-step2/input/b.js similarity index 100% rename from spack/tests/pass/reexport/recursive-step2/input/b.js rename to node/bundler/tests/pass/reexport/recursive-step2/input/b.js diff --git a/spack/tests/pass/reexport/recursive-step2/input/c.js b/node/bundler/tests/pass/reexport/recursive-step2/input/c.js similarity index 100% rename from spack/tests/pass/reexport/recursive-step2/input/c.js rename to node/bundler/tests/pass/reexport/recursive-step2/input/c.js diff --git a/spack/tests/pass/reexport/recursive-step2/input/d.js b/node/bundler/tests/pass/reexport/recursive-step2/input/d.js similarity index 100% rename from spack/tests/pass/reexport/recursive-step2/input/d.js rename to node/bundler/tests/pass/reexport/recursive-step2/input/d.js diff --git a/spack/tests/pass/reexport/recursive-step2/input/entry.js b/node/bundler/tests/pass/reexport/recursive-step2/input/entry.js similarity index 100% rename from spack/tests/pass/reexport/recursive-step2/input/entry.js rename to node/bundler/tests/pass/reexport/recursive-step2/input/entry.js diff --git a/spack/tests/pass/reexport/recursive-step2/output/entry.js b/node/bundler/tests/pass/reexport/recursive-step2/output/entry.js similarity index 100% rename from spack/tests/pass/reexport/recursive-step2/output/entry.js rename to node/bundler/tests/pass/reexport/recursive-step2/output/entry.js diff --git a/spack/tests/pass/reexport/recursive/input/a.js b/node/bundler/tests/pass/reexport/recursive/input/a.js similarity index 100% rename from spack/tests/pass/reexport/recursive/input/a.js rename to node/bundler/tests/pass/reexport/recursive/input/a.js diff --git a/spack/tests/pass/reexport/recursive/input/b.js b/node/bundler/tests/pass/reexport/recursive/input/b.js similarity index 100% rename from spack/tests/pass/reexport/recursive/input/b.js rename to node/bundler/tests/pass/reexport/recursive/input/b.js diff --git a/spack/tests/pass/reexport/recursive/input/c.js b/node/bundler/tests/pass/reexport/recursive/input/c.js similarity index 100% rename from spack/tests/pass/reexport/recursive/input/c.js rename to node/bundler/tests/pass/reexport/recursive/input/c.js diff --git a/spack/tests/pass/reexport/recursive/input/d.js b/node/bundler/tests/pass/reexport/recursive/input/d.js similarity index 100% rename from spack/tests/pass/reexport/recursive/input/d.js rename to node/bundler/tests/pass/reexport/recursive/input/d.js diff --git a/spack/tests/pass/reexport/recursive/input/e.js b/node/bundler/tests/pass/reexport/recursive/input/e.js similarity index 100% rename from spack/tests/pass/reexport/recursive/input/e.js rename to node/bundler/tests/pass/reexport/recursive/input/e.js diff --git a/spack/tests/pass/reexport/recursive/input/entry.js b/node/bundler/tests/pass/reexport/recursive/input/entry.js similarity index 100% rename from spack/tests/pass/reexport/recursive/input/entry.js rename to node/bundler/tests/pass/reexport/recursive/input/entry.js diff --git a/spack/tests/pass/reexport/recursive/output/entry.js b/node/bundler/tests/pass/reexport/recursive/output/entry.js similarity index 100% rename from spack/tests/pass/reexport/recursive/output/entry.js rename to node/bundler/tests/pass/reexport/recursive/output/entry.js diff --git a/spack/tests/pass/resolve-name-fix/input/entry.js b/node/bundler/tests/pass/resolve-name-fix/input/entry.js similarity index 100% rename from spack/tests/pass/resolve-name-fix/input/entry.js rename to node/bundler/tests/pass/resolve-name-fix/input/entry.js diff --git a/spack/tests/pass/resolve-name-fix/input/package.json b/node/bundler/tests/pass/resolve-name-fix/input/package.json similarity index 100% rename from spack/tests/pass/resolve-name-fix/input/package.json rename to node/bundler/tests/pass/resolve-name-fix/input/package.json diff --git a/spack/tests/pass/resolve-name-fix/output/entry.js b/node/bundler/tests/pass/resolve-name-fix/output/entry.js similarity index 100% rename from spack/tests/pass/resolve-name-fix/output/entry.js rename to node/bundler/tests/pass/resolve-name-fix/output/entry.js diff --git a/spack/tests/pass/swcrc/jsx/issue-884/input/.swcrc b/node/bundler/tests/pass/swcrc/jsx/issue-884/input/.swcrc similarity index 100% rename from spack/tests/pass/swcrc/jsx/issue-884/input/.swcrc rename to node/bundler/tests/pass/swcrc/jsx/issue-884/input/.swcrc diff --git a/spack/tests/pass/swcrc/jsx/issue-884/input/entry.jsx b/node/bundler/tests/pass/swcrc/jsx/issue-884/input/entry.jsx similarity index 100% rename from spack/tests/pass/swcrc/jsx/issue-884/input/entry.jsx rename to node/bundler/tests/pass/swcrc/jsx/issue-884/input/entry.jsx diff --git a/spack/tests/pass/swcrc/jsx/issue-884/output/entry.js b/node/bundler/tests/pass/swcrc/jsx/issue-884/output/entry.js similarity index 100% rename from spack/tests/pass/swcrc/jsx/issue-884/output/entry.js rename to node/bundler/tests/pass/swcrc/jsx/issue-884/output/entry.js diff --git a/spack/tests/pass/swcrc/jsx/issue-884/output/entry.jsx b/node/bundler/tests/pass/swcrc/jsx/issue-884/output/entry.jsx similarity index 100% rename from spack/tests/pass/swcrc/jsx/issue-884/output/entry.jsx rename to node/bundler/tests/pass/swcrc/jsx/issue-884/output/entry.jsx diff --git a/spack/tests/pass/transitive/export-all-1/input/a.js b/node/bundler/tests/pass/transitive/export-all-1/input/a.js similarity index 100% rename from spack/tests/pass/transitive/export-all-1/input/a.js rename to node/bundler/tests/pass/transitive/export-all-1/input/a.js diff --git a/spack/tests/pass/transitive/export-all-1/input/b.js b/node/bundler/tests/pass/transitive/export-all-1/input/b.js similarity index 100% rename from spack/tests/pass/transitive/export-all-1/input/b.js rename to node/bundler/tests/pass/transitive/export-all-1/input/b.js diff --git a/spack/tests/pass/transitive/export-all-1/input/c.js b/node/bundler/tests/pass/transitive/export-all-1/input/c.js similarity index 100% rename from spack/tests/pass/transitive/export-all-1/input/c.js rename to node/bundler/tests/pass/transitive/export-all-1/input/c.js diff --git a/spack/tests/pass/transitive/export-all-1/input/d.js b/node/bundler/tests/pass/transitive/export-all-1/input/d.js similarity index 100% rename from spack/tests/pass/transitive/export-all-1/input/d.js rename to node/bundler/tests/pass/transitive/export-all-1/input/d.js diff --git a/spack/tests/pass/transitive/export-all-1/input/e.js b/node/bundler/tests/pass/transitive/export-all-1/input/e.js similarity index 100% rename from spack/tests/pass/transitive/export-all-1/input/e.js rename to node/bundler/tests/pass/transitive/export-all-1/input/e.js diff --git a/spack/tests/pass/transitive/export-all-1/input/entry.js b/node/bundler/tests/pass/transitive/export-all-1/input/entry.js similarity index 100% rename from spack/tests/pass/transitive/export-all-1/input/entry.js rename to node/bundler/tests/pass/transitive/export-all-1/input/entry.js diff --git a/spack/tests/pass/transitive/export-all-1/input/f.js b/node/bundler/tests/pass/transitive/export-all-1/input/f.js similarity index 100% rename from spack/tests/pass/transitive/export-all-1/input/f.js rename to node/bundler/tests/pass/transitive/export-all-1/input/f.js diff --git a/spack/tests/pass/transitive/export-all-1/output/entry.js b/node/bundler/tests/pass/transitive/export-all-1/output/entry.js similarity index 100% rename from spack/tests/pass/transitive/export-all-1/output/entry.js rename to node/bundler/tests/pass/transitive/export-all-1/output/entry.js diff --git a/spack/tests/pass/transitive/export-all-2/input/a.js b/node/bundler/tests/pass/transitive/export-all-2/input/a.js similarity index 100% rename from spack/tests/pass/transitive/export-all-2/input/a.js rename to node/bundler/tests/pass/transitive/export-all-2/input/a.js diff --git a/spack/tests/pass/transitive/export-all-2/input/b.js b/node/bundler/tests/pass/transitive/export-all-2/input/b.js similarity index 100% rename from spack/tests/pass/transitive/export-all-2/input/b.js rename to node/bundler/tests/pass/transitive/export-all-2/input/b.js diff --git a/spack/tests/pass/transitive/export-all-2/input/c.js b/node/bundler/tests/pass/transitive/export-all-2/input/c.js similarity index 100% rename from spack/tests/pass/transitive/export-all-2/input/c.js rename to node/bundler/tests/pass/transitive/export-all-2/input/c.js diff --git a/spack/tests/pass/transitive/export-all-2/input/d.js b/node/bundler/tests/pass/transitive/export-all-2/input/d.js similarity index 100% rename from spack/tests/pass/transitive/export-all-2/input/d.js rename to node/bundler/tests/pass/transitive/export-all-2/input/d.js diff --git a/spack/tests/pass/transitive/export-all-2/input/e.js b/node/bundler/tests/pass/transitive/export-all-2/input/e.js similarity index 100% rename from spack/tests/pass/transitive/export-all-2/input/e.js rename to node/bundler/tests/pass/transitive/export-all-2/input/e.js diff --git a/spack/tests/pass/transitive/export-all-2/input/entry.js b/node/bundler/tests/pass/transitive/export-all-2/input/entry.js similarity index 100% rename from spack/tests/pass/transitive/export-all-2/input/entry.js rename to node/bundler/tests/pass/transitive/export-all-2/input/entry.js diff --git a/spack/tests/pass/transitive/export-all-2/input/f.js b/node/bundler/tests/pass/transitive/export-all-2/input/f.js similarity index 100% rename from spack/tests/pass/transitive/export-all-2/input/f.js rename to node/bundler/tests/pass/transitive/export-all-2/input/f.js diff --git a/spack/tests/pass/transitive/export-all-2/output/entry.js b/node/bundler/tests/pass/transitive/export-all-2/output/entry.js similarity index 100% rename from spack/tests/pass/transitive/export-all-2/output/entry.js rename to node/bundler/tests/pass/transitive/export-all-2/output/entry.js diff --git a/spack/tests/pass/transitive/export-named/input/a.js b/node/bundler/tests/pass/transitive/export-named/input/a.js similarity index 100% rename from spack/tests/pass/transitive/export-named/input/a.js rename to node/bundler/tests/pass/transitive/export-named/input/a.js diff --git a/spack/tests/pass/transitive/export-named/input/b.js b/node/bundler/tests/pass/transitive/export-named/input/b.js similarity index 100% rename from spack/tests/pass/transitive/export-named/input/b.js rename to node/bundler/tests/pass/transitive/export-named/input/b.js diff --git a/spack/tests/pass/transitive/export-named/input/common.js b/node/bundler/tests/pass/transitive/export-named/input/common.js similarity index 100% rename from spack/tests/pass/transitive/export-named/input/common.js rename to node/bundler/tests/pass/transitive/export-named/input/common.js diff --git a/spack/tests/pass/transitive/export-named/input/entry.js b/node/bundler/tests/pass/transitive/export-named/input/entry.js similarity index 100% rename from spack/tests/pass/transitive/export-named/input/entry.js rename to node/bundler/tests/pass/transitive/export-named/input/entry.js diff --git a/spack/tests/pass/transitive/export-named/output/entry.js b/node/bundler/tests/pass/transitive/export-named/output/entry.js similarity index 100% rename from spack/tests/pass/transitive/export-named/output/entry.js rename to node/bundler/tests/pass/transitive/export-named/output/entry.js diff --git a/spack/tests/pass/transitive/import/simple-1/input/a.js b/node/bundler/tests/pass/transitive/import/simple-1/input/a.js similarity index 100% rename from spack/tests/pass/transitive/import/simple-1/input/a.js rename to node/bundler/tests/pass/transitive/import/simple-1/input/a.js diff --git a/spack/tests/pass/transitive/import/simple-1/input/b.js b/node/bundler/tests/pass/transitive/import/simple-1/input/b.js similarity index 100% rename from spack/tests/pass/transitive/import/simple-1/input/b.js rename to node/bundler/tests/pass/transitive/import/simple-1/input/b.js diff --git a/spack/tests/pass/transitive/import/simple-1/input/common.js b/node/bundler/tests/pass/transitive/import/simple-1/input/common.js similarity index 100% rename from spack/tests/pass/transitive/import/simple-1/input/common.js rename to node/bundler/tests/pass/transitive/import/simple-1/input/common.js diff --git a/spack/tests/pass/transitive/import/simple-1/input/entry.js b/node/bundler/tests/pass/transitive/import/simple-1/input/entry.js similarity index 100% rename from spack/tests/pass/transitive/import/simple-1/input/entry.js rename to node/bundler/tests/pass/transitive/import/simple-1/input/entry.js diff --git a/spack/tests/pass/transitive/import/simple-1/output/entry.js b/node/bundler/tests/pass/transitive/import/simple-1/output/entry.js similarity index 100% rename from spack/tests/pass/transitive/import/simple-1/output/entry.js rename to node/bundler/tests/pass/transitive/import/simple-1/output/entry.js diff --git a/spack/tests/pass/transitive/import/simple-2/input/a.js b/node/bundler/tests/pass/transitive/import/simple-2/input/a.js similarity index 100% rename from spack/tests/pass/transitive/import/simple-2/input/a.js rename to node/bundler/tests/pass/transitive/import/simple-2/input/a.js diff --git a/spack/tests/pass/transitive/import/simple-2/input/b.js b/node/bundler/tests/pass/transitive/import/simple-2/input/b.js similarity index 100% rename from spack/tests/pass/transitive/import/simple-2/input/b.js rename to node/bundler/tests/pass/transitive/import/simple-2/input/b.js diff --git a/spack/tests/pass/transitive/import/simple-2/input/c.js b/node/bundler/tests/pass/transitive/import/simple-2/input/c.js similarity index 100% rename from spack/tests/pass/transitive/import/simple-2/input/c.js rename to node/bundler/tests/pass/transitive/import/simple-2/input/c.js diff --git a/spack/tests/pass/transitive/import/simple-2/input/common1.js b/node/bundler/tests/pass/transitive/import/simple-2/input/common1.js similarity index 100% rename from spack/tests/pass/transitive/import/simple-2/input/common1.js rename to node/bundler/tests/pass/transitive/import/simple-2/input/common1.js diff --git a/spack/tests/pass/transitive/import/simple-2/input/common2.js b/node/bundler/tests/pass/transitive/import/simple-2/input/common2.js similarity index 100% rename from spack/tests/pass/transitive/import/simple-2/input/common2.js rename to node/bundler/tests/pass/transitive/import/simple-2/input/common2.js diff --git a/spack/tests/pass/transitive/import/simple-2/input/common3.js b/node/bundler/tests/pass/transitive/import/simple-2/input/common3.js similarity index 100% rename from spack/tests/pass/transitive/import/simple-2/input/common3.js rename to node/bundler/tests/pass/transitive/import/simple-2/input/common3.js diff --git a/spack/tests/pass/transitive/import/simple-2/input/common4.js b/node/bundler/tests/pass/transitive/import/simple-2/input/common4.js similarity index 100% rename from spack/tests/pass/transitive/import/simple-2/input/common4.js rename to node/bundler/tests/pass/transitive/import/simple-2/input/common4.js diff --git a/spack/tests/pass/transitive/import/simple-2/input/entry.js b/node/bundler/tests/pass/transitive/import/simple-2/input/entry.js similarity index 100% rename from spack/tests/pass/transitive/import/simple-2/input/entry.js rename to node/bundler/tests/pass/transitive/import/simple-2/input/entry.js diff --git a/spack/tests/pass/transitive/import/simple-2/output/entry.js b/node/bundler/tests/pass/transitive/import/simple-2/output/entry.js similarity index 100% rename from spack/tests/pass/transitive/import/simple-2/output/entry.js rename to node/bundler/tests/pass/transitive/import/simple-2/output/entry.js diff --git a/spack/tests/pass/tree-shaking/in-module-export/input/entry.js b/node/bundler/tests/pass/tree-shaking/in-module-export/input/entry.js similarity index 100% rename from spack/tests/pass/tree-shaking/in-module-export/input/entry.js rename to node/bundler/tests/pass/tree-shaking/in-module-export/input/entry.js diff --git a/spack/tests/pass/tree-shaking/in-module-export/output/entry.js b/node/bundler/tests/pass/tree-shaking/in-module-export/output/entry.js similarity index 100% rename from spack/tests/pass/tree-shaking/in-module-export/output/entry.js rename to node/bundler/tests/pass/tree-shaking/in-module-export/output/entry.js diff --git a/spack/tests/pass/tree-shaking/in-module/input/entry.js b/node/bundler/tests/pass/tree-shaking/in-module/input/entry.js similarity index 100% rename from spack/tests/pass/tree-shaking/in-module/input/entry.js rename to node/bundler/tests/pass/tree-shaking/in-module/input/entry.js diff --git a/spack/tests/pass/tree-shaking/in-module/output/entry.js b/node/bundler/tests/pass/tree-shaking/in-module/output/entry.js similarity index 100% rename from spack/tests/pass/tree-shaking/in-module/output/entry.js rename to node/bundler/tests/pass/tree-shaking/in-module/output/entry.js diff --git a/spack/tests/pass/tree-shaking/preserve-import/input/b.js b/node/bundler/tests/pass/tree-shaking/preserve-import/input/b.js similarity index 100% rename from spack/tests/pass/tree-shaking/preserve-import/input/b.js rename to node/bundler/tests/pass/tree-shaking/preserve-import/input/b.js diff --git a/spack/tests/pass/tree-shaking/preserve-import/input/entry-a.js b/node/bundler/tests/pass/tree-shaking/preserve-import/input/entry-a.js similarity index 100% rename from spack/tests/pass/tree-shaking/preserve-import/input/entry-a.js rename to node/bundler/tests/pass/tree-shaking/preserve-import/input/entry-a.js diff --git a/spack/tests/pass/tree-shaking/preserve-import/output/entry-a.js b/node/bundler/tests/pass/tree-shaking/preserve-import/output/entry-a.js similarity index 100% rename from spack/tests/pass/tree-shaking/preserve-import/output/entry-a.js rename to node/bundler/tests/pass/tree-shaking/preserve-import/output/entry-a.js diff --git a/spack/.npmignore b/spack/.npmignore deleted file mode 100644 index 570eecb0d478..000000000000 --- a/spack/.npmignore +++ /dev/null @@ -1,21 +0,0 @@ -target/ -native/index.node -native/artifacts.json -**/*~ -**/node_modules -**/.DS_Store - -pkg/ - -yarn.lock -package-lock.json -*.log -.idea/ - -wasm/ - -# Reduce package size -**/tests/ -**/benches/ -**/target/ -*.svg \ No newline at end of file diff --git a/spack/Cargo.toml b/spack/Cargo.toml deleted file mode 100644 index e959d9154dd9..000000000000 --- a/spack/Cargo.toml +++ /dev/null @@ -1,44 +0,0 @@ -[package] -authors = ["강동윤 "] -build = "build.rs" -description = "Speedy web compiler" -documentation = "https://rustdoc.swc.rs/swc/" -edition = "2018" -license = "Apache-2.0/MIT" -name = "spack" -publish = false -repository = "https://github.com/swc-project/swc.git" -version = "0.0.0" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -anyhow = "1" -dashmap = "4.0.2" -fxhash = "0.2.1" -is-macro = "0.1.8" -log = "0.4.8" -once_cell = "1" -regex = "1" -serde = {version = "1", features = ["derive"]} -serde_json = "1" -string_enum = {version = "0.3", path = "../macros/string_enum"} -swc = {path = "../"} -swc_atoms = {path = "../atoms"} -swc_bundler = {path = "../bundler"} -swc_common = {path = "../common", features = ["concurrent"]} -swc_ecma_ast = {path = "../ecmascript/ast"} -swc_ecma_codegen = {path = "../ecmascript/codegen"} -swc_ecma_loader = {path = "../ecmascript/loader"} -swc_ecma_parser = {path = "../ecmascript/parser"} -swc_ecma_transforms = {path = "../ecmascript/transforms"} -swc_ecma_utils = {path = "../ecmascript/utils"} -swc_ecma_visit = {path = "../ecmascript/visit"} -swc_node_base = {path = "../node/base"} - -[dev-dependencies] -pretty_assertions = "0.6.1" -pretty_env_logger = "0.3" -tempfile = "3" -testing = {path = "../testing"} -walkdir = "2.3.1" diff --git a/spack/tests/pass/deno-002/.full/input/.swcrc b/spack/tests/pass/deno-002/.full/input/.swcrc deleted file mode 100644 index fc5920ef248b..000000000000 --- a/spack/tests/pass/deno-002/.full/input/.swcrc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "jsc": { - "target": "es2020", - "parser": { - "syntax": "typescript", - "decorators": true - } - } -} diff --git a/src/builder.rs b/src/builder.rs index 8a88eece2c7a..e801e8489957 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -1,23 +1,20 @@ -use crate::config::{CompiledPaths, GlobalPassOption, JsMinifyOptions, JscTarget, ModuleConfig}; -use crate::SwcComments; +use crate::{ + config::{CompiledPaths, GlobalPassOption, JsMinifyOptions, JscTarget, ModuleConfig}, + SwcComments, +}; use compat::es2020::export_namespace_from; use either::Either; -use std::cell::RefCell; -use std::rc::Rc; -use std::{collections::HashMap, sync::Arc}; +use std::{cell::RefCell, collections::HashMap, rc::Rc, sync::Arc}; use swc_atoms::JsWord; -use swc_common::comments::Comments; -use swc_common::sync::Lrc; -use swc_common::FileName; -use swc_common::{chain, errors::Handler, Mark, SourceMap}; +use swc_common::{ + chain, comments::Comments, errors::Handler, sync::Lrc, FileName, Mark, SourceMap, +}; use swc_ecma_ast::Module; use swc_ecma_minifier::option::MinifyOptions; use swc_ecma_parser::Syntax; -use swc_ecma_transforms::hygiene::hygiene_with_config; -use swc_ecma_transforms::modules::util::Scope; use swc_ecma_transforms::{ - compat, fixer, helpers, hygiene, modules, optimization::const_modules, pass::Optional, - proposals::import_assertions, typescript, + compat, fixer, helpers, hygiene, hygiene::hygiene_with_config, modules, modules::util::Scope, + optimization::const_modules, pass::Optional, proposals::import_assertions, typescript, }; use swc_ecma_transforms_base::ext::MapWithMut; use swc_ecma_visit::{as_folder, noop_visit_mut_type, VisitMut}; diff --git a/src/config/mod.rs b/src/config/mod.rs index af1e6b7f7d46..d8bd1f588dc6 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -1,18 +1,17 @@ -use crate::SwcComments; -use crate::{builder::PassBuilder, SwcImportResolver}; +use crate::{builder::PassBuilder, SwcComments, SwcImportResolver}; use anyhow::{bail, Context, Error}; use dashmap::DashMap; use either::Either; use once_cell::sync::Lazy; use regex::Regex; use serde::{Deserialize, Serialize}; -use std::hash::BuildHasher; -use std::rc::Rc as RustRc; use std::{ cell::RefCell, collections::{HashMap, HashSet}, env, + hash::BuildHasher, path::{Path, PathBuf}, + rc::Rc as RustRc, sync::Arc, usize, }; @@ -24,17 +23,16 @@ use swc_ecma_ext_transforms::jest; use swc_ecma_loader::resolvers::{ lru::CachingResolver, node::NodeModulesResolver, tsc::TsConfigResolver, }; -use swc_ecma_minifier::option::terser::{TerserCompressorOptions, TerserEcmaVersion}; -use swc_ecma_minifier::option::{MangleOptions, ManglePropertiesOptions}; +use swc_ecma_minifier::option::{ + terser::{TerserCompressorOptions, TerserEcmaVersion}, + MangleOptions, ManglePropertiesOptions, +}; pub use swc_ecma_parser::JscTarget; use swc_ecma_parser::{lexer::Lexer, Parser, StringInput, Syntax, TsConfig}; -use swc_ecma_transforms::modules::hoist::import_hoister; -use swc_ecma_transforms::modules::path::NodeImportResolver; -use swc_ecma_transforms::{hygiene, modules::util::Scope}; use swc_ecma_transforms::{ - modules, - optimization::const_modules, - optimization::{inline_globals, json_parse, simplifier}, + hygiene, modules, + modules::{hoist::import_hoister, path::NodeImportResolver, util::Scope}, + optimization::{const_modules, inline_globals, json_parse, simplifier}, pass::{noop, Optional}, proposals::{decorators, export_default_from}, react, resolver_with_mark, typescript, diff --git a/src/lib.rs b/src/lib.rs index 46d2db16c975..ed0565767a7b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -22,13 +22,13 @@ use std::{ path::{Path, PathBuf}, sync::{Arc, Mutex}, }; -use swc_common::sync::Lrc; use swc_common::{ chain, comments::{Comment, CommentKind, Comments}, errors::Handler, input::StringInput, source_map::SourceMapGenConfig, + sync::Lrc, BytePos, FileName, Globals, Mark, SourceFile, SourceMap, Spanned, DUMMY_SP, GLOBALS, }; use swc_ecma_ast::Program; diff --git a/testing/src/lib.rs b/testing/src/lib.rs index a06851b7b927..047145c6c145 100644 --- a/testing/src/lib.rs +++ b/testing/src/lib.rs @@ -5,18 +5,14 @@ use difference::Changeset; use once_cell::sync::Lazy; pub use pretty_assertions::{assert_eq, assert_ne}; use regex::Regex; -use std::collections::HashMap; -use std::env; -use std::fmt::Display; -use std::fmt::Formatter; -use std::path::PathBuf; -use std::sync::RwLock; use std::{ - fmt, - fmt::Debug, + collections::HashMap, + env, fmt, + fmt::{Debug, Display, Formatter}, fs::{create_dir_all, File}, io::Write, - path::Path, + path::{Path, PathBuf}, + sync::RwLock, thread, }; use swc_common::{ diff --git a/tests/projects.rs b/tests/projects.rs index 22aa4116d8a0..adf16915edab 100644 --- a/tests/projects.rs +++ b/tests/projects.rs @@ -10,10 +10,8 @@ use swc::{ Compiler, TransformOutput, }; use swc_common::{chain, comments::Comment, BytePos, FileName}; -use swc_ecma_ast::EsVersion; -use swc_ecma_ast::*; -use swc_ecma_parser::TsConfig; -use swc_ecma_parser::{EsConfig, Syntax}; +use swc_ecma_ast::{EsVersion, *}; +use swc_ecma_parser::{EsConfig, Syntax, TsConfig}; use swc_ecma_transforms::helpers::{self, Helpers}; use swc_ecma_utils::HANDLER; use swc_ecma_visit::{Fold, FoldWith}; diff --git a/tests/simple.rs b/tests/simple.rs index a41b0a596139..34658b71ee96 100644 --- a/tests/simple.rs +++ b/tests/simple.rs @@ -4,8 +4,7 @@ use swc::{ }; use swc_common::FileName; use swc_ecma_ast::EsVersion; -use swc_ecma_parser::TsConfig; -use swc_ecma_parser::{EsConfig, Syntax}; +use swc_ecma_parser::{EsConfig, Syntax, TsConfig}; use testing::Tester; fn compile(src: &str, options: Options) -> String { diff --git a/tests/source_map.rs b/tests/source_map.rs index c6b594e98845..e68c7e9de51a 100644 --- a/tests/source_map.rs +++ b/tests/source_map.rs @@ -1,21 +1,19 @@ #![allow(unused)] -use anyhow::Context; -use anyhow::Error; -use std::env::temp_dir; -use std::fs; -use std::fs::create_dir_all; -use std::path::PathBuf; -use std::process::Command; -use std::process::Output; -use std::{fs::canonicalize, sync::Arc}; +use anyhow::{Context, Error}; +use std::{ + env::temp_dir, + fs, + fs::{canonicalize, create_dir_all}, + path::PathBuf, + process::{Command, Output}, + sync::Arc, +}; use swc::{ config::{Options, SourceMapsConfig}, Compiler, }; -use testing::assert_eq; -use testing::NormalizedOutput; -use testing::{StdErr, Tester}; +use testing::{assert_eq, NormalizedOutput, StdErr, Tester}; use walkdir::WalkDir; fn file(f: &str) -> Result<(), StdErr> {