refactor: Flatten crates (#2697)

This commit is contained in:
Donny/강동윤 2021-11-09 20:42:49 +09:00 committed by GitHub
parent bf0007bec0
commit 687305f280
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17193 changed files with 162 additions and 163 deletions

View File

@ -70,8 +70,8 @@ jobs:
- name: Check swc_bundler - name: Check swc_bundler
run: | run: |
(cd bundler && cargo hack check --feature-powerset --no-dev-deps) (cd crates/swc_bundler && cargo hack check --feature-powerset --no-dev-deps)
- name: Check swc - name: Check swc
run: | run: |
cargo hack check --feature-powerset --no-dev-deps (cd crates/swc && cargo hack check --feature-powerset --no-dev-deps)

View File

@ -112,7 +112,7 @@ jobs:
(cd tests/integration/redux/repo && npm i) (cd tests/integration/redux/repo && npm i)
(cd tests/integration/redux/repo && npx jest '.*.js' --modulePathIgnorePatterns 'typescript') (cd tests/integration/redux/repo && npx jest '.*.js' --modulePathIgnorePatterns 'typescript')
- name: (spack) example react app - name: (swcpack) example react app
run: | run: |
export PATH="$PATH:$HOME/npm/bin" export PATH="$PATH:$HOME/npm/bin"
(cd node/bundler/tests/integration/react && npm i && npx spack) (cd crates/swc_node_bundler/tests/integration/react && npm i && npx spack)

View File

@ -38,12 +38,12 @@ jobs:
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Build - name: Build
run: (cd wasm && wasm-pack build --release --scope=swc --target nodejs) run: (cd crates/wasm && wasm-pack build --release --scope=swc --target nodejs)
- name: Publish - name: Publish
run: | run: |
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
(cd wasm/pkg && npm publish --access public) (cd crates/wasm/pkg && npm publish --access public)
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
@ -76,7 +76,7 @@ jobs:
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Build - name: Build
run: (cd wasm && wasm-pack build --release --scope=swc --target web) run: (cd crates/wasm && wasm-pack build --release --scope=swc --target web)
- name: Rename - name: Rename
run: | run: |
@ -86,7 +86,7 @@ jobs:
- name: Publish - name: Publish
run: | run: |
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
(cd wasm/pkg && npm publish --access public) (cd crates/wasm/pkg && npm publish --access public)
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

View File

@ -34,9 +34,9 @@ jobs:
- name: Build - name: Build
run: | run: |
(cd wasm && yarn) (cd crates/wasm && yarn)
(cd wasm && ./scripts/build.sh) (cd crates/wasm && ./scripts/build.sh)
- name: Test - name: Test
run: | run: |
(cd wasm && ./scripts/test.sh) (cd crates/wasm && ./scripts/test.sh)

1
.gitignore vendored
View File

@ -10,7 +10,6 @@ artifacts.json
target/ target/
**/*.bk **/*.bk
core
*.log *.log
.vscode/* .vscode/*

View File

@ -3,98 +3,16 @@ members = [
"css", "css",
"css/stylis", "css/stylis",
"ecmascript", "ecmascript",
"ecmascript/plugin_ast", "crates/swc_ecma_plugin_ast",
"ecmascript/babel/compat", "crates/swc_babel_compat",
"ecmascript/jsdoc", "ecmascript/jsdoc",
"node/binding", "crates/node",
"plugin", "crates/swc_plugin",
"plugin/runner", "crates/swc_plugin_runner",
"plugin/testing", "crates/swc_plugin_testing",
"wasm", "crates/wasm",
] ]
[package]
authors = ["강동윤 <kdy1997.dev@gmail.com>"]
description = "Speedy web compiler"
documentation = "https://rustdoc.swc.rs/swc/"
edition = "2018"
include = ["Cargo.toml", "src/**/*.rs"]
license = "Apache-2.0/MIT"
name = "swc"
repository = "https://github.com/swc-project/swc.git"
version = "0.83.1"
[lib]
name = "swc"
[features]
default = ["es3"]
# You can disable this feautre to reduce binary size.
es3 = []
# See https://github.com/swc-project/swc/issues/1108
#
# If this option is enabled, es2015 transforms are enabled if target is es2015.
# If this option is disabled, es2015 transforms are disabled if target is es2015.
#
# This feature will be removed on v2 of node bindings.
wrong-target = []
concurrent = [
"swc_ecma_utils/concurrent",
"swc_ecma_transforms_base/concurrent",
"swc_ecma_transforms_compat/concurrent",
"swc_ecma_transforms_optimization/concurrent",
]
[dependencies]
ahash = "0.7.4"
anyhow = "1"
base64 = "0.13.0"
dashmap = "4.0.2"
either = "1"
indexmap = {version = "1", features = ["serde"]}
lru = "0.6.1"
once_cell = "1"
pathdiff = "0.2.0"
regex = "1"
serde = {version = "1", features = ["derive"]}
serde_json = "1"
sourcemap = "6"
swc_atoms = {version = "0.2", path = "./atoms"}
swc_common = {version = "0.14.0", path = "./common", features = ["sourcemap", "concurrent"]}
swc_ecma_ast = {version = "0.57.0", path = "./ecmascript/ast"}
swc_ecma_codegen = {version = "0.79.0", path = "./ecmascript/codegen"}
swc_ecma_ext_transforms = {version = "0.37.0", path = "./ecmascript/ext-transforms"}
swc_ecma_loader = {version = "0.24.0", path = "./ecmascript/loader", features = ["lru", "node", "tsc"]}
swc_ecma_minifier = {version = "0.49.0", path = "./ecmascript/minifier"}
swc_ecma_parser = {version = "0.77.0", path = "./ecmascript/parser"}
swc_ecma_preset_env = {version = "0.64.0", path = "./ecmascript/preset-env"}
swc_ecma_transforms = {version = "0.93.0", path = "./ecmascript/transforms", features = [
"compat",
"module",
"optimization",
"proposal",
"react",
"typescript",
]}
swc_ecma_transforms_base = {version = "0.43.0", path = "./ecmascript/transforms/base"}
swc_ecma_transforms_compat = {version = "0.50.0", path = "./ecmascript/transforms/compat"}
swc_ecma_transforms_optimization = {version = "0.63.0", path = "./ecmascript/transforms/optimization"}
swc_ecma_utils = {version = "0.51.0", path = "./ecmascript/utils"}
swc_ecma_visit = {version = "0.43.0", path = "./ecmascript/visit"}
swc_ecmascript = {version = "0.85.0", path = "./ecmascript"}
swc_visit = {version = "0.2.3", path = "./visit"}
tracing = "0.1.28"
[dev-dependencies]
rayon = "1"
swc_node_base = {version = "0.5.0", path = "./node/base"}
testing = {version = "0.15.0", path = "./testing"}
walkdir = "2"
[[example]]
name = "usage"
[profile.release] [profile.release]
codegen-units = 1 codegen-units = 1
lto = "fat" lto = "fat"

View File

@ -22,13 +22,13 @@ napi-derive = {version = "1"}
path-clean = "0.1" path-clean = "0.1"
serde = {version = "1", features = ["derive"]} serde = {version = "1", features = ["derive"]}
serde_json = {version = "1", features = ["unbounded_depth"]} serde_json = {version = "1", features = ["unbounded_depth"]}
swc = {path = "../../", features = ["concurrent", "wrong-target"]} swc = {path = "../swc", features = ["concurrent", "wrong-target"]}
swc_atoms = {version = "0.2.4", path = "../../atoms"} swc_atoms = {version = "0.2.4", path = "../../atoms"}
swc_bundler = {path = "../../bundler"} swc_bundler = {path = "../swc_bundler"}
swc_common = {path = "../../common", features = ["sourcemap"]} swc_common = {path = "../../common", features = ["sourcemap"]}
swc_ecma_ast = {path = "../../ecmascript/ast"} swc_ecma_ast = {path = "../../ecmascript/ast"}
swc_ecma_loader = {path = "../../ecmascript/loader"} swc_ecma_loader = {path = "../../ecmascript/loader"}
swc_ecma_parser = {path = "../../ecmascript/parser"} swc_ecma_parser = {path = "../../ecmascript/parser"}
swc_node_base = {path = "../base"} swc_node_base = {path = "../../node/base"}
swc_node_bundler = {path = "../bundler"} swc_node_bundler = {path = "../swc_node_bundler"}
tracing = {version = "0.1.28", features = ["release_max_level_off"]} tracing = {version = "0.1.28", features = ["release_max_level_off"]}

View File

@ -12,6 +12,6 @@ version = "0.1.0"
[dependencies] [dependencies]
abi_stable = "0.10.3" abi_stable = "0.10.3"
rplugin_macros = {version = "0.1", path = "./macros/"} rplugin_macros = {version = "0.1", path = "../rplugin_macros/"}
string_cache = "0.8.2" string_cache = "0.8.2"
swc_common = {version = "0.14.6", path = "../common/"} swc_common = {version = "0.14.6", path = "../../common/"}

83
crates/swc/Cargo.toml Normal file
View File

@ -0,0 +1,83 @@
[package]
authors = ["강동윤 <kdy1997.dev@gmail.com>"]
description = "Speedy web compiler"
documentation = "https://rustdoc.swc.rs/swc/"
edition = "2018"
include = ["Cargo.toml", "src/**/*.rs"]
license = "Apache-2.0/MIT"
name = "swc"
repository = "https://github.com/swc-project/swc.git"
version = "0.83.1"
[lib]
name = "swc"
[features]
default = ["es3"]
# You can disable this feautre to reduce binary size.
es3 = []
# See https://github.com/swc-project/swc/issues/1108
#
# If this option is enabled, es2015 transforms are enabled if target is es2015.
# If this option is disabled, es2015 transforms are disabled if target is es2015.
#
# This feature will be removed on v2 of node bindings.
wrong-target = []
concurrent = [
"swc_ecma_utils/concurrent",
"swc_ecma_transforms_base/concurrent",
"swc_ecma_transforms_compat/concurrent",
"swc_ecma_transforms_optimization/concurrent",
]
[dependencies]
ahash = "0.7.4"
anyhow = "1"
base64 = "0.13.0"
dashmap = "4.0.2"
either = "1"
indexmap = {version = "1", features = ["serde"]}
lru = "0.6.1"
once_cell = "1"
pathdiff = "0.2.0"
regex = "1"
serde = {version = "1", features = ["derive"]}
serde_json = "1"
sourcemap = "6"
swc_atoms = {version = "0.2", path = "../../atoms"}
swc_common = {version = "0.14.0", path = "../../common", features = ["sourcemap", "concurrent"]}
swc_ecma_ast = {version = "0.57.0", path = "../../ecmascript/ast"}
swc_ecma_codegen = {version = "0.79.0", path = "../../ecmascript/codegen"}
swc_ecma_ext_transforms = {version = "0.37.0", path = "../../ecmascript/ext-transforms"}
swc_ecma_loader = {version = "0.24.0", path = "../../ecmascript/loader", features = ["lru", "node", "tsc"]}
swc_ecma_minifier = {version = "0.49.0", path = "../../ecmascript/minifier"}
swc_ecma_parser = {version = "0.77.0", path = "../../ecmascript/parser"}
swc_ecma_preset_env = {version = "0.64.0", path = "../../ecmascript/preset-env"}
swc_ecma_transforms = {version = "0.93.0", path = "../../ecmascript/transforms", features = [
"compat",
"module",
"optimization",
"proposal",
"react",
"typescript",
]}
swc_ecma_transforms_base = {version = "0.43.0", path = "../../ecmascript/transforms/base"}
swc_ecma_transforms_compat = {version = "0.50.0", path = "../../ecmascript/transforms/compat"}
swc_ecma_transforms_optimization = {version = "0.63.0", path = "../../ecmascript/transforms/optimization"}
swc_ecma_utils = {version = "0.51.0", path = "../../ecmascript/utils"}
swc_ecma_visit = {version = "0.43.0", path = "../../ecmascript/visit"}
swc_ecmascript = {version = "0.85.0", path = "../../ecmascript"}
swc_visit = {version = "0.2.3", path = "../../visit"}
tracing = "0.1.28"
[dev-dependencies]
rayon = "1"
swc_node_base = {version = "0.5.0", path = "../../node/base"}
testing = {version = "0.15.0", path = "../../testing"}
walkdir = "2"
[[example]]
name = "usage"

Some files were not shown because too many files have changed in this diff Show More