refactor(dbg-swc): Rename esdiff to dbg-swc (#3189)

This commit is contained in:
Donny/강동윤 2022-01-04 18:39:43 +09:00 committed by GitHub
parent 8b633a93ff
commit c758997180
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 87 additions and 88 deletions

View File

@ -27,7 +27,7 @@ jobs:
- name: Deploy - name: Deploy
if: github.ref == 'refs/heads/main' if: github.ref == 'refs/heads/main'
uses: JamesIves/github-pages-deploy-action@4.1.0 uses: JamesIves/github-pages-deploy-action@4.1.8
with: with:
token: ${{ secrets.GH_TOKEN }} token: ${{ secrets.GH_TOKEN }}
branch: gh-pages branch: gh-pages

58
Cargo.lock generated
View File

@ -690,6 +690,35 @@ dependencies = [
"num_cpus", "num_cpus",
] ]
[[package]]
name = "dbg-swc"
version = "0.1.0"
dependencies = [
"anyhow",
"pretty_assertions 1.0.0",
"rayon",
"structopt",
"swc_atoms",
"swc_common",
"swc_ecma_ast",
"swc_ecma_codegen",
"swc_ecma_dep_graph",
"swc_ecma_diff",
"swc_ecma_loader",
"swc_ecma_minifier",
"swc_ecma_parser",
"swc_ecma_transforms_base",
"swc_ecma_transforms_react",
"swc_ecma_transforms_typescript",
"swc_ecma_utils",
"swc_ecma_visit",
"swc_node_comments",
"swc_timer",
"tempfile",
"tracing",
"tracing-subscriber",
]
[[package]] [[package]]
name = "debug_unreachable" name = "debug_unreachable"
version = "0.1.1" version = "0.1.1"
@ -777,35 +806,6 @@ dependencies = [
"syn", "syn",
] ]
[[package]]
name = "esdiff"
version = "0.1.0"
dependencies = [
"anyhow",
"pretty_assertions 1.0.0",
"rayon",
"structopt",
"swc_atoms",
"swc_common",
"swc_ecma_ast",
"swc_ecma_codegen",
"swc_ecma_dep_graph",
"swc_ecma_diff",
"swc_ecma_loader",
"swc_ecma_minifier",
"swc_ecma_parser",
"swc_ecma_transforms_base",
"swc_ecma_transforms_react",
"swc_ecma_transforms_typescript",
"swc_ecma_utils",
"swc_ecma_visit",
"swc_node_comments",
"swc_timer",
"tempfile",
"tracing",
"tracing-subscriber",
]
[[package]] [[package]]
name = "fallible-iterator" name = "fallible-iterator"
version = "0.2.0" version = "0.2.0"

View File

@ -1,6 +1,6 @@
[workspace] [workspace]
members = [ members = [
"crates/esdiff", "crates/dbg-swc",
"crates/jsdoc", "crates/jsdoc",
"crates/node", "crates/node",
"crates/swc_cli", "crates/swc_cli",

37
crates/dbg-swc/Cargo.toml Normal file
View File

@ -0,0 +1,37 @@
[package]
authors = ["강동윤 <kdy1997.dev@gmail.com>"]
description = "Debug tools for swc"
documentation = "https://rustdoc.swc.rs/dbg-swc/"
edition = "2021"
include = ["Cargo.toml", "src/**/*.rs"]
license = "Apache-2.0"
name = "dbg-swc"
repository = "https://github.com/swc-project/swc.git"
version = "0.1.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
anyhow = "1"
pretty_assertions = "1.0.0"
rayon = "1"
structopt = "0.3.25"
swc_atoms = {version = "0.2.9", path = "../swc_atoms/"}
swc_common = {version = "0.15.3", path = "../swc_common/", features = ["concurrent"]}
swc_ecma_ast = {version = "0.61.0", path = "../swc_ecma_ast/"}
swc_ecma_codegen = {version = "0.85.0", path = "../swc_ecma_codegen"}
swc_ecma_dep_graph = {version = "0.54.0", path = "../swc_ecma_dep_graph/"}
swc_ecma_diff = {version = "0.2.1", path = "../swc_ecma_diff/"}
swc_ecma_loader = {version = "0.25.4", path = "../swc_ecma_loader/", features = ["lru", "node", "tsc"]}
swc_ecma_minifier = {version = "0.62.1", path = "../swc_ecma_minifier/"}
swc_ecma_parser = {version = "0.83.0", path = "../swc_ecma_parser/"}
swc_ecma_transforms_base = {version = "0.51.0", path = "../swc_ecma_transforms_base/"}
swc_ecma_transforms_react = {version = "0.69.0", path = "../swc_ecma_transforms_react/"}
swc_ecma_transforms_typescript = {version = "0.71.0", path = "../swc_ecma_transforms_typescript/"}
swc_ecma_utils = {version = "0.58.0", path = "../swc_ecma_utils/"}
swc_ecma_visit = {version = "0.47.0", path = "../swc_ecma_visit/"}
swc_node_comments = {version = "0.2.0", path = "../swc_node_comments/"}
swc_timer = {version = "0.2.1", path = "../swc_timer/"}
tempfile = "3.2.0"
tracing = "0.1.29"
tracing-subscriber = {version = "0.3.5", features = ["env-filter"]}

13
crates/dbg-swc/README.md Normal file
View File

@ -0,0 +1,13 @@
# dbg-swc
## `dbg-swc reduce-min`
```
dbg-swc reduce-min --build '' --test 'npm test.spec' --working-dir ~/src/ionic-framework/packages/react/ ~/src/ionic-framework/packages/react/src/index.ts
```
(TODO) e.g. next.js app
```sh
dbg-swc reduce-min --build 'rm -rf .next && npx next build' --test 'dbg-swc grab-console http://localhost:3000 --script test.js --start "npm start"' ~/your/next/app/pages/index.js ~/your/next/app/pages/index.js
```

View File

@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -eu
./scripts/install.sh
dbg-swc reduce-min --build 'rm -rf .next && npx next build' --test 'dbg-swc grab-console http://localhost:3000 --script test.js --start "npm start"' $@

View File

@ -1,38 +0,0 @@
[package]
authors = ["강동윤 <kdy1997.dev@gmail.com>"]
description = "Diffing tools for ECMAScript"
documentation = "https://rustdoc.swc.rs/esdiff/"
edition = "2021"
include = ["Cargo.toml", "src/**/*.rs"]
license = "Apache-2.0"
name = "esdiff"
publish = false
repository = "https://github.com/swc-project/swc.git"
version = "0.1.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
anyhow = "1"
pretty_assertions = "1.0.0"
rayon = "1"
structopt = "0.3.25"
swc_atoms = {path = "../swc_atoms/"}
swc_common = {path = "../swc_common/", features = ["concurrent"]}
swc_ecma_ast = {path = "../swc_ecma_ast/"}
swc_ecma_codegen = {path = "../swc_ecma_codegen"}
swc_ecma_dep_graph = {path = "../swc_ecma_dep_graph/"}
swc_ecma_diff = {path = "../swc_ecma_diff/"}
swc_ecma_loader = {path = "../swc_ecma_loader/", features = ["lru", "node", "tsc"]}
swc_ecma_minifier = {path = "../swc_ecma_minifier/"}
swc_ecma_parser = {path = "../swc_ecma_parser/"}
swc_ecma_transforms_base = {path = "../swc_ecma_transforms_base/"}
swc_ecma_transforms_react = {path = "../swc_ecma_transforms_react/"}
swc_ecma_transforms_typescript = {path = "../swc_ecma_transforms_typescript/"}
swc_ecma_utils = {path = "../swc_ecma_utils/"}
swc_ecma_visit = {path = "../swc_ecma_visit/"}
swc_node_comments = {path = "../swc_node_comments/"}
swc_timer = {path = "../swc_timer/"}
tempfile = "3.2.0"
tracing = "0.1.29"
tracing-subscriber = {version = "0.3.5", features = ["env-filter"]}

View File

@ -1,13 +0,0 @@
# esdiff
## `esdiff reduce-min`
```
esdiff reduce-min --build '' --test 'npm test.spec' --working-dir ~/src/ionic-framework/packages/react/ ~/src/ionic-framework/packages/react/src/index.ts
```
(TODO) e.g. next.js app
```sh
esdiff reduce-min --build 'rm -rf .next && npx next build' --test 'esdiff grab-console http://localhost:3000 --script test.js --start "npm start"' ~/your/next/app/pages/index.js ~/your/next/app/pages/index.js
```

View File

@ -1,6 +0,0 @@
#!/usr/bin/env bash
set -eu
./scripts/install.sh
esdiff reduce-min --build 'rm -rf .next && npx next build' --test 'esdiff grab-console http://localhost:3000 --script test.js --start "npm start"' $@