Skip to content

Commit

Permalink
chore(cli): build by tsc
Browse files Browse the repository at this point in the history
  • Loading branch information
JeromeLin committed Mar 13, 2023
1 parent 79b3c4f commit de1d3f2
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 40 deletions.
25 changes: 12 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
_book
*.log*
.DS_Store
.idea
.vscode
.history
.prettierrc.yaml
*.log
*.iml

# npm
package-lock.json
/node_modules/
/packages/*/node_modules/
node_modules

# bundle files
/packages/*/dist/
/packages/*/es/
/packages/*/lib/
/packages/*/native/
/packages/*/types/
es
lib
dist
types

# test
coverage

# test coverage
/packages/*/coverage/
*.tsbuildinfo
11 changes: 0 additions & 11 deletions packages/zarm-cli/babel.config.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/zarm-cli/bin/zarm.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
const importLocal = require('import-local');

if (!importLocal(__filename)) {
require('../lib/cli');
require('../dist/cli');
}
15 changes: 7 additions & 8 deletions packages/zarm-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
],
"license": "MIT",
"author": "[email protected]",
"typings": "types/index.d.ts",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"bin": {
"zarm": "./bin/zarm.js"
},
Expand All @@ -20,16 +21,13 @@
"types"
],
"scripts": {
"build": "yarn build:types && yarn build:lib",
"build:lib": "rimraf lib && babel src --extensions .ts --out-dir lib --copy-files",
"build:types": "rimraf types && tsc",
"clean": "rimraf types lib coverage",
"dev": "yarn build:lib -w",
"build": "rimraf dist/ && tsc --build --force",
"clean": "rimraf dist/ && tsc --build --clean",
"dev": "tsc -w",
"prepare": "yarn build",
"test": "jest"
},
"dependencies": {
"@babel/cli": "^7.13.10",
"@babel/core": "^7.13.10",
"@babel/plugin-proposal-class-properties": "^7.13.0",
"@babel/plugin-proposal-decorators": "^7.13.5",
Expand Down Expand Up @@ -81,7 +79,8 @@
},
"devDependencies": {
"@types/node": "^15.3.0",
"@types/webpack": "^5.28.0"
"@types/webpack": "^5.28.0",
"ts-node": "^10.9.1"
},
"tags": [
"zarm",
Expand Down
4 changes: 3 additions & 1 deletion packages/zarm-cli/src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import commander from 'commander';
import path from 'path';

import build from './build';
import development from './development';
import deploy from './deploy';
import template from './template';
import test from './test';
import { version } from '../package.json';

const { version } = require(path.resolve('./package.json'));

commander.version(version);

Expand Down
20 changes: 16 additions & 4 deletions packages/zarm-cli/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
{
"extends": "../../tsconfig",
"include": ["src"],
"compilerOptions": {
"outFile": "types/index.d.ts",
"module": "CommonJS",
"target": "ES2018",
"moduleResolution": "node",
"esModuleInterop": true,
"declaration": true,
"emitDeclarationOnly": true
"sourceMap": true,
"declarationMap": true,
"composite": true,
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true,
"outDir": "dist",
"rootDir": "src"
},
"include": ["src"]
"ts-node": {
"transpileOnly": true,
"swc": true
}
}
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
lodash "^4.17.21"
resize-observer-polyfill "^1.5.1"

"@babel/cli@^7.13.10", "@babel/cli@^7.13.16":
"@babel/cli@^7.13.16":
version "7.13.16"
resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.13.16.tgz#9d372e943ced0cc291f068204a9b010fd9cfadbc"
integrity sha512-cL9tllhqvsQ6r1+d9Invf7nNXg/3BlfL1vvvL/AdH9fZ2l5j0CeBcoq6UjsqHpvyN1v5nXSZgqJZoGeK+ZOAbw==
Expand Down Expand Up @@ -18776,7 +18776,7 @@ ts-jest@^26.5.0:
semver "7.x"
yargs-parser "20.x"

ts-node@^10.8.1:
ts-node@^10.8.1, ts-node@^10.9.1:
version "10.9.1"
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.1.tgz#e73de9102958af9e1f0b168a6ff320e25adcff4b"
integrity sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==
Expand Down

0 comments on commit de1d3f2

Please sign in to comment.