-
Notifications
You must be signed in to change notification settings - Fork 1
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
23 changed files
with
414 additions
and
45 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,9 @@ | ||
{ | ||
"name": "demo-biu", | ||
"scripts": { | ||
"start": "biu" | ||
}, | ||
"devDependencies": { | ||
"@fe6/biu": "workspace:*" | ||
} | ||
} |
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
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 @@ | ||
#!/usr/bin/env node | ||
/** @format */ | ||
|
||
try { | ||
require('../dist/cli/index.js').run(); | ||
} catch (error) { | ||
console.error(error); | ||
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
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,38 @@ | ||
/** @format */ | ||
|
||
import fs from 'fs'; | ||
import path from 'path'; | ||
import { logger } from '@fe6/biu-utils'; | ||
import { Command } from '../../compiled/commander'; | ||
|
||
export const run = () => { | ||
const pkg = fs.readFileSync( | ||
path.resolve(__filename, '../../../package.json'), | ||
'utf-8', | ||
); | ||
|
||
const program = new Command(); | ||
|
||
// 版本 biu --version | biu -v | ||
const vContent = `${logger.prefixes.info('version')} ${ | ||
JSON.parse(pkg).version | ||
}\n`; | ||
program.version(vContent, '-v, --version').usage('<command> [options]'); | ||
|
||
// TODO 初始化项目 biu init | ||
|
||
// TODO 开发 biu dev | ||
|
||
// TODO 打包 biu build | ||
|
||
// TODO 环境测试 biu serve | ||
|
||
// TODO 拉取远程类型文件 ( d.ts ) biu dts | ||
|
||
// 执行命令 | ||
program.parse(process.argv); | ||
|
||
if (!program.args.length) { | ||
program.help(); | ||
} | ||
}; |
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 |
---|---|---|
@@ -1,8 +1,10 @@ | ||
{ | ||
"extends": "../tsconfig.base.json", | ||
"compilerOptions": { | ||
"baseUrl": ".", | ||
"resolveJsonModule": true, | ||
"rootDir": "./src", | ||
"outDir": "dist" | ||
}, | ||
"include": ["src"] | ||
"include": ["src"], | ||
"exclude": ["node_modules"] | ||
} |
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 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2018 Made With MOXY Lda <hello@moxy.studio> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
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,36 @@ | ||
// Type definitions for cross-spawn 6.0 | ||
// Project: https://github.com/moxystudio/node-cross-spawn | ||
// Definitions by: Alorel <https://github.com/Alorel> | ||
// ExE Boss <https://github.com/ExE-Boss> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
|
||
/// <reference types="node" /> | ||
|
||
import * as child_process from 'child_process'; | ||
|
||
declare namespace spawn { | ||
/** | ||
* The `spawn()` method spawns a new process using the given `command`, with | ||
* command line arguments in `args`. If omitted, `args` defaults to an empty array. | ||
*/ | ||
const spawn: typeof child_process.spawn; | ||
|
||
/** | ||
* The `spawn.sync()` method spawns a new process using the given `command`, with | ||
* command line arguments in `args`. If omitted, `args` defaults to an empty array. | ||
*/ | ||
const sync: typeof child_process.spawnSync; | ||
} | ||
|
||
/** | ||
* The `spawn()` method spawns a new process using the given `command`, with | ||
* command line arguments in `args`. If omitted, `args` defaults to an empty array. | ||
*/ | ||
declare function spawn(command: string, options: child_process.SpawnOptions): child_process.ChildProcess; | ||
declare function spawn( | ||
command: string, | ||
args?: ReadonlyArray<string>, | ||
options?: child_process.SpawnOptions, | ||
): child_process.ChildProcess; | ||
|
||
export = spawn; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 @@ | ||
{"name":"cross-spawn","version":"7.0.3","author":"André Cruz <andre@moxy.studio>","license":"MIT"} |
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
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
Oops, something went wrong.