-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Merge
@swc/cli
into the monorepo (#11)
We also migrate to `lerna` from `turbo` because `@swc/cli` depend on an old version of `@swc/cli`, which is cyclic and not supported by `turbo`.
- Loading branch information
Showing
51 changed files
with
7,410 additions
and
1,068 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -130,3 +130,5 @@ dist | |
.pnp.* | ||
|
||
.DS_Store | ||
|
||
.nx/cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pnpm-lock.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"$schema": "node_modules/lerna/schemas/lerna-schema.json", | ||
"version": "0.0.0", | ||
"npmClient": "pnpm" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"targetDefaults": { | ||
"prepublishOnly": { | ||
"dependsOn": [] | ||
}, | ||
"types": { | ||
"dependsOn": [] | ||
}, | ||
"types:watch": { | ||
"dependsOn": [] | ||
}, | ||
"build": { | ||
"cache": true, | ||
"dependsOn": ["^build"], | ||
"outputs": ["{projectRoot}/**/*.js"] | ||
}, | ||
"build:watch": { | ||
"dependsOn": [] | ||
}, | ||
"format:src": { | ||
"dependsOn": [] | ||
}, | ||
"format:examples": { | ||
"dependsOn": [] | ||
}, | ||
"format": { | ||
"dependsOn": [] | ||
}, | ||
"test": { | ||
"cache": true, | ||
"dependsOn": ["build"] | ||
}, | ||
"test:watch": { | ||
"dependsOn": [] | ||
}, | ||
"test:coverage": { | ||
"dependsOn": [] | ||
}, | ||
"postpublish": { | ||
"dependsOn": [] | ||
}, | ||
"lint": { | ||
"cache": true, | ||
"dependsOn": [] | ||
}, | ||
"start": { | ||
"dependsOn": [] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Lock files | ||
package-lock.json | ||
|
||
# Dependencies | ||
node_modules/ | ||
|
||
# Testing | ||
coverage | ||
integration-tests | ||
|
||
# Build output | ||
lib | ||
|
||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# OS Specific | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"arrowParens": "avoid" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"jsc": { | ||
"target": "es2019", | ||
"parser": { | ||
"syntax": "typescript", | ||
"dynamicImport": true | ||
} | ||
}, | ||
"module": { | ||
"type": "commonjs" | ||
}, | ||
"sourceMaps": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# swc-cli | ||
|
||
See our website [swc-cli][] for more information or the issues associated with this package. | ||
|
||
[swc-cli]: https://swc.rs/docs/usage-swc-cli | ||
|
||
## @swc/cli@1 beta version is available | ||
|
||
Beta version of @swc/cli is now available via `swcx command. | ||
This'll be a default command for @swc/cli@1. | ||
Please give it a try and report any issues at https://github.com/swc-project/swc/issues/4017 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env node | ||
|
||
process.title = "spack"; | ||
require("../lib/spack"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env node | ||
|
||
process.title = "swc"; | ||
require("../lib/swc"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env node | ||
|
||
process.title = "swcx"; | ||
require("../lib/swcx"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"name": "spack-example-basic", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"scripts": {}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"@swc/cli": "file:../.." | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const { config } = require("@swc/core/spack"); | ||
|
||
module.exports = config({ | ||
entry: { | ||
web: __dirname + "/src/index.ts", | ||
}, | ||
output: { | ||
path: __dirname + "/lib", | ||
}, | ||
module: {}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export const A = "foo"; | ||
export const B = "bar"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { B } from "./common"; | ||
|
||
console.log(B); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"name": "spack-example-multiple-entry", | ||
"private": true, | ||
"version": "1.0.0", | ||
"main": "lib/index.js", | ||
"scripts": {}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"description": "", | ||
"dependencies": { | ||
"@swc/cli": "file:../.." | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
packages/cli/examples/spack-multiple-entry/spack.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const { config } = require("@swc/core/spack"); | ||
|
||
module.exports = config({ | ||
entry: { | ||
web: __dirname + "/src/web.ts", | ||
android: __dirname + "/src/android.ts", | ||
}, | ||
output: { | ||
path: __dirname + "/lib", | ||
}, | ||
module: {}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import "./common"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
console.log("initializing"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import "./common"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"name": "spack-example-node-modules", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"scripts": {}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"@swc/cli": "file:../..", | ||
"path": "^0.12.7" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const { config } = require("@swc/core/spack"); | ||
|
||
module.exports = config({ | ||
entry: { | ||
web: __dirname + "/src/index.ts", | ||
}, | ||
output: { | ||
path: __dirname + "/lib", | ||
}, | ||
module: {}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { join } from "path"; | ||
|
||
export const A = join(__dirname, "src"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { A } from "./common"; | ||
|
||
console.log(A); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const enableCoverage = process.env.JEST_COVERAGE === "true"; | ||
|
||
module.exports = enableCoverage | ||
? { | ||
// provides the most accurate coverage results | ||
preset: "ts-jest", | ||
roots: ["src"], | ||
} | ||
: { | ||
roots: ["src"], | ||
// provides fastest test transforms | ||
transform: { | ||
"^.+\\.(t|j)sx?$": ["@swc/jest"], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
{ | ||
"name": "@swc/cli", | ||
"version": "0.3.5", | ||
"description": "CLI for the swc project", | ||
"main": "lib/swc/index.js", | ||
"scripts": { | ||
"prepublishOnly": "pnpm build && pnpm test && pnpm types", | ||
"types": "tsc", | ||
"types:watch": "tsc --watch", | ||
"build": "swc src -d lib --ignore '**/*.test.ts' --ignore '**/__mocks__/**'", | ||
"build:watch": "swc src -d lib --watch --ignore '**/*.test.ts' --ignore '**/__mocks__/**'", | ||
"format:src": "prettier --write src", | ||
"format:examples": "prettier --write examples", | ||
"format": "pnpm format:src && pnpm format:examples", | ||
"test": "jest", | ||
"test:watch": "jest --watch", | ||
"test:coverage": "JEST_COVERAGE=true jest --coverage" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/node ./bin/swc-project/pkgs.git" | ||
}, | ||
"keywords": [ | ||
"swc", | ||
"cli", | ||
"babel", | ||
"es6", | ||
"transpile", | ||
"transpiler", | ||
"compiler", | ||
"javascript" | ||
], | ||
"author": "강동윤 <kdy1997.dev@gmail.com>", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/swc-project/pkgs/issues" | ||
}, | ||
"homepage": "https://github.com/swc-project/pkgs", | ||
"engines": { | ||
"node": ">= 16.14.0" | ||
}, | ||
"bin": { | ||
"swc": "./bin/swc.js", | ||
"swcx": "./bin/swcx.js", | ||
"spack": "./bin/spack.js" | ||
}, | ||
"dependencies": { | ||
"@mole-inc/bin-wrapper": "^8.0.1", | ||
"commander": "^7.1.0", | ||
"fast-glob": "^3.2.5", | ||
"minimatch": "^9.0.3", | ||
"piscina": "^4.3.0", | ||
"semver": "^7.3.8", | ||
"slash": "3.0.0", | ||
"source-map": "^0.7.3" | ||
}, | ||
"devDependencies": { | ||
"@swc/cli": "^0.1.43", | ||
"@swc/core": "^1.2.66", | ||
"@swc/jest": "^0.1.2", | ||
"@types/jest": "^29.5.0", | ||
"@types/node": "^20.11.5", | ||
"@types/semver": "^7.3.13", | ||
"chokidar": "^3.5.1", | ||
"deepmerge": "^4.2.2", | ||
"jest": "^29.5.0", | ||
"ts-jest": "^29.0.5", | ||
"typescript": "~4.3.2" | ||
}, | ||
"peerDependencies": { | ||
"@swc/core": "^1.2.66", | ||
"chokidar": "^3.5.1" | ||
}, | ||
"peerDependenciesMeta": { | ||
"chokidar": { | ||
"optional": true | ||
} | ||
}, | ||
"files": [ | ||
"bin", | ||
"lib" | ||
] | ||
} |
Oops, something went wrong.