-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
6,176 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module.exports = { | ||
env: { | ||
node: true, | ||
}, | ||
extends: [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"prettier", | ||
"prettier/@typescript-eslint", | ||
], | ||
parser: "@typescript-eslint/parser", | ||
parserOptions: { | ||
ecmaVersion: 6, | ||
sourceType: "module", | ||
}, | ||
plugins: ["@typescript-eslint"], | ||
rules: { | ||
"@typescript-eslint/no-explicit-any": 0, | ||
"@typescript-eslint/no-non-null-assertion": 0, | ||
}, | ||
}; |
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,8 @@ | ||
module.exports = { | ||
printWidth: 80, | ||
useTabs: false, | ||
tabWidth: 2, | ||
semi: false, | ||
singleQuote: true, | ||
trailingComma: 'none' | ||
} |
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 @@ | ||
{ | ||
"packages": [ | ||
"packages/*" | ||
], | ||
"version": "independent", | ||
"npmClient": "yarn", | ||
"useWorkspaces": true, | ||
"command": { | ||
"publish": { | ||
"allowBranch": ["master"] | ||
} | ||
} | ||
} |
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,37 @@ | ||
{ | ||
"private": true, | ||
"workspaces": [ | ||
"packages/*" | ||
], | ||
"description": "a bundle tools for js ts react vue based on rollup", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/xus-code/bundle-tools.git" | ||
}, | ||
"keywords": [ | ||
"bundle", | ||
"esm", | ||
"cjs", | ||
"global", | ||
"typescript", | ||
"js", | ||
"react", | ||
"vue" | ||
], | ||
"author": "guo.xu xuguo@outlook.it", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/xus-code/bundle-tools/issues" | ||
}, | ||
"homepage": "https://github.com/xus-code/bundle-tools#readme", | ||
"devDependencies": { | ||
"@types/node": "^14.14.22", | ||
"@typescript-eslint/eslint-plugin": "^4.14.1", | ||
"@typescript-eslint/parser": "^4.14.1", | ||
"eslint": "^7.18.0", | ||
"eslint-config-prettier": "^7.2.0", | ||
"lerna": "^3.22.1", | ||
"prettier": "^2.2.1", | ||
"typescript": "^4.1.3" | ||
} | ||
} |
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 @@ | ||
# `cli` | ||
|
||
> TODO: description | ||
## Usage | ||
|
||
``` | ||
const cli = require('cli'); | ||
// TODO: DEMONSTRATE API | ||
``` |
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,26 @@ | ||
{ | ||
"name": "@xus/cli-plugin-rollup", | ||
"version": "0.0.1", | ||
"description": "xus cli plugin rollup", | ||
"keywords": [ | ||
"cli", | ||
"rollup" | ||
], | ||
"author": "guo.xu <xuguo@outlook.it>", | ||
"homepage": "https://github.com/xus-code/bundle-tools/tree/master/packages/cli#readme", | ||
"license": "MIT", | ||
"files": [ | ||
"lib" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/xus-code/bundle-tools.git" | ||
}, | ||
"scripts": { | ||
"dev:rollup": "tsc --watch", | ||
"build:rollup": "tsc" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/xus-code/bundle-tools/issues" | ||
} | ||
} |
Empty file.
Empty file.
Empty 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,7 @@ | ||
{ | ||
"compilerOptions": { | ||
"outDir": "./lib", | ||
}, | ||
"extends": "../../tsconfig.json", | ||
"include": ["./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,11 @@ | ||
# `cli` | ||
|
||
> TODO: description | ||
## Usage | ||
|
||
``` | ||
const cli = require('cli'); | ||
// TODO: DEMONSTRATE API | ||
``` |
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,25 @@ | ||
{ | ||
"name": "@xus/cli-shared-utils", | ||
"version": "0.0.1", | ||
"description": "xus cli-shared-utils", | ||
"keywords": [ | ||
"cli-shared-utils" | ||
], | ||
"author": "guo.xu <xuguo@outlook.it>", | ||
"homepage": "https://github.com/xus-code/bundle-tools/tree/master/packages/cli#readme", | ||
"license": "MIT", | ||
"files": [ | ||
"lib" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/xus-code/bundle-tools.git" | ||
}, | ||
"scripts": { | ||
"dev:utils": "tsc --watch", | ||
"build:utils": "tsc" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/xus-code/bundle-tools/issues" | ||
} | ||
} |
Empty 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,7 @@ | ||
{ | ||
"compilerOptions": { | ||
"outDir": "./lib", | ||
}, | ||
"extends": "../../tsconfig.json", | ||
"include": ["./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,11 @@ | ||
# `cli` | ||
|
||
> TODO: description | ||
## Usage | ||
|
||
``` | ||
const cli = require('cli'); | ||
// TODO: DEMONSTRATE API | ||
``` |
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,8 @@ | ||
declare class Cli { | ||
ctxPath: string; | ||
constructor(ctxPath: string); | ||
run(commandName: string, args: { | ||
[key: string]: any; | ||
}, rawArgs: any[]): Promise<any>; | ||
} | ||
export default Cli; |
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,17 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
class Cli { | ||
constructor(ctxPath) { | ||
this.ctxPath = process.cwd(); | ||
this.ctxPath = ctxPath; | ||
} | ||
async run(commandName, args, rawArgs) { | ||
console.log(`command `, commandName); | ||
console.log(`args `, args); | ||
console.log(`rawArgs `, rawArgs); | ||
// 1. valid commandName (help) | ||
// 2. init cli (load plugin / config...) | ||
// 3. get compiler task run | ||
} | ||
} | ||
exports.default = Cli; |
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,6 @@ | ||
declare class PluginAPI { | ||
id: string; | ||
service: any; | ||
constructor(id: string, service: any); | ||
} | ||
export default PluginAPI; |
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,9 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
class PluginAPI { | ||
constructor(id, service) { | ||
this.id = id; | ||
this.service = service; | ||
} | ||
} | ||
exports.default = PluginAPI; |
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 @@ | ||
#!/usr/bin/env node | ||
export {}; |
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,20 @@ | ||
#!/usr/bin/env node | ||
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const minimist_1 = __importDefault(require("minimist")); | ||
const Cli_1 = __importDefault(require("./Cli")); | ||
// collect builtIn plugins | ||
// const plugins = [] | ||
// 1. init cli | ||
const cli = new Cli_1.default(process.env.XUS_BUNDLE_CONTEXT || process.cwd()); | ||
// 2. get args | ||
const rawArgs = process.argv.slice(2); | ||
const args = minimist_1.default(rawArgs); | ||
const commandName = args._[0]; | ||
// 3. run commander | ||
cli.run(commandName, args, rawArgs).catch(() => { | ||
process.exit(1); | ||
}); |
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,33 @@ | ||
{ | ||
"name": "@xus/cli", | ||
"version": "0.0.1", | ||
"description": "xus cli", | ||
"keywords": [ | ||
"cli", | ||
"bundle" | ||
], | ||
"author": "guo.xu <xuguo@outlook.it>", | ||
"homepage": "https://github.com/xus-code/bundle-tools/tree/master/packages/cli#readme", | ||
"license": "MIT", | ||
"bin": { | ||
"xus-cli": "./lib/index.js" | ||
}, | ||
"files": [ | ||
"lib" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/xus-code/bundle-tools.git" | ||
}, | ||
"scripts": { | ||
"dev:cli": "tsc --watch", | ||
"build:cli": "tsc" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/xus-code/bundle-tools/issues" | ||
}, | ||
"dependencies": { | ||
"@types/minimist": "^1.2.1", | ||
"minimist": "^1.2.5" | ||
} | ||
} |
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,20 @@ | ||
class Cli { | ||
ctxPath: string = process.cwd() | ||
constructor(ctxPath: string) { | ||
this.ctxPath = ctxPath | ||
} | ||
async run( | ||
commandName: string, | ||
args: { [key: string]: any }, | ||
rawArgs: any[] | ||
): Promise<any> { | ||
console.log(`command `, commandName) | ||
console.log(`args `, args) | ||
console.log(`rawArgs `, rawArgs) | ||
// 1. valid commandName (help) | ||
// 2. init cli (load plugin / config...) | ||
// 3. get compiler task run | ||
} | ||
} | ||
|
||
export default Cli |
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,7 @@ | ||
class PluginAPI { | ||
constructor(public id: string, public service: any) {} | ||
|
||
// registerCommander(name: string, opt, fn) {} | ||
} | ||
|
||
export default PluginAPI |
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 @@ | ||
#!/usr/bin/env node | ||
import minimist from 'minimist' | ||
import Cli from './Cli' | ||
// collect builtIn plugins | ||
// const plugins = [] | ||
// 1. init cli | ||
const cli = new Cli(process.env.XUS_BUNDLE_CONTEXT || process.cwd()) | ||
// 2. get args | ||
const rawArgs = process.argv.slice(2) | ||
const args = minimist(rawArgs) | ||
const commandName = args._[0] | ||
// 3. run commander | ||
cli.run(commandName, args, rawArgs).catch(() => { | ||
process.exit(1) | ||
}) |
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,7 @@ | ||
{ | ||
"compilerOptions": { | ||
"outDir": "./lib", | ||
}, | ||
"extends": "../../tsconfig.json", | ||
"include": ["./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,12 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "ES2017", | ||
"module": "commonjs", | ||
"strict": true, | ||
"declaration": true, | ||
"skipLibCheck": true, | ||
"esModuleInterop": true, | ||
"lib": ["esnext", "dom"] | ||
}, | ||
"exclude": ["**/__test__/**/*"] | ||
} |
Oops, something went wrong.