-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
1 parent
6b5bf31
commit a855783
Showing
7 changed files
with
204 additions
and
8 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 |
---|---|---|
@@ -0,0 +1,64 @@ | ||
## create-tsbb | ||
|
||
[![tsbb](https://user-images.githubusercontent.com/1680273/57547188-94c60100-7390-11e9-93b2-5ebf085bb925.png)](https://github.com/jaywcjlove/tsbb) | ||
|
||
<p align="center"> | ||
<a href="https://www.travis-ci.org/jaywcjlove/tsbb"> | ||
<img src="https://www.travis-ci.org/jaywcjlove/tsbb.svg?branch=master"> | ||
</a> | ||
<a href="https://github.com/jaywcjlove/tsbb/issues"> | ||
<img src="https://img.shields.io/github/issues/jaywcjlove/tsbb.svg"> | ||
</a> | ||
<a href="https://github.com/jaywcjlove/tsbb/network"> | ||
<img src="https://img.shields.io/github/forks/jaywcjlove/tsbb.svg"> | ||
</a> | ||
<a href="https://github.com/jaywcjlove/tsbb/stargazers"> | ||
<img src="https://img.shields.io/github/stars/jaywcjlove/tsbb.svg"> | ||
</a> | ||
<a href="https://github.com/jaywcjlove/tsbb/releases"> | ||
<img src="https://img.shields.io/github/release/jaywcjlove/tsbb.svg"> | ||
</a> | ||
<a href="https://www.npmjs.com/package/create-tsbb"> | ||
<img src="https://img.shields.io/npm/v/create-tsbb.svg"> | ||
</a> | ||
</p> | ||
|
||
Creates a [`tsbb`](https://www.travis-ci.org/jaywcjlove/tsbb) application using the command line. | ||
|
||
### Usage | ||
|
||
```shell | ||
$ yarn create tsbb [appName] | ||
# or npm | ||
$ npm create tsbb my-app | ||
# or npx | ||
$ npx create-tsbb my-app | ||
``` | ||
|
||
### Command Help | ||
|
||
Below is a help of commands you might find useful. The example download is from https://jaywcjlove.github.io/tsbb | ||
|
||
```bash | ||
Usage: create-tsbb <app-name> [options] [--help|h] | ||
|
||
Options: | ||
--version, -v Show version number | ||
--help, -h Displays help information. | ||
--example, -e Example from: https://jaywcjlove.github.io/tsbb , default: "basic" | ||
--force, -f Overwrite target directory if it exists. default: false | ||
--path, -p Specify the download target git address. default: "https://jaywcjlove.github.io/tsbb" | ||
|
||
Example: | ||
npx create-tsbb my-app | ||
yarn create tsbb appName | ||
npm create tsbb my-app | ||
npm create tsbb my-app -f | ||
npm create tsbb my-app -p https://jaywcjlove.github.io/tsbb | ||
|
||
Copyright 2021 | ||
``` | ||
## License | ||
[MIT © Kenny Wong](https://github.com/jaywcjlove/tsbb/blob/master/LICENSE) |
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,48 @@ | ||
{ | ||
"name": "create-tsbb", | ||
"version": "1.0.1", | ||
"description": "Creates a TSBB application using the command line.", | ||
"homepage": "https://jaywcjlove.github.io/tsbb", | ||
"author": "Kenny Wong <wowohoo@qq.com> (https://github.com/jaywcjlove)", | ||
"main": "lib/index.js", | ||
"typings": "lib/create.d.ts", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/jaywcjlove/tree/master/create-tsbb" | ||
}, | ||
"bin": { | ||
"create-tsbb": "lib/cli.js" | ||
}, | ||
"scripts": { | ||
"watch": "npm run watch:ts", | ||
"watch:ts": "tsbb watch & npm run build:types -- --watch", | ||
"build": "npm run build:ts && npm run build:types", | ||
"build:ts": "tsbb build", | ||
"build:types": "tsbb types" | ||
}, | ||
"files": [ | ||
"lib", | ||
"src" | ||
], | ||
"jest": {}, | ||
"keywords": [ | ||
"kkt", | ||
"tsbb", | ||
"create-tsbb", | ||
"react", | ||
"redux", | ||
"rematch", | ||
"uiw", | ||
"redux-saga", | ||
"elm", | ||
"framework", | ||
"frontend" | ||
], | ||
"devDependencies": { | ||
"tsbb": "2.0.0" | ||
}, | ||
"dependencies": { | ||
"create-kkt": "2.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,62 @@ | ||
#!/usr/bin/env node | ||
|
||
import minimist from 'minimist'; | ||
import { create } from 'create-kkt'; | ||
|
||
async function run(): Promise<void> { | ||
try { | ||
const argvs = minimist(process.argv.slice(2)); | ||
if (argvs.h || argvs.help) { | ||
console.log('\n Usage: create-tsbb <app-name> [options] [--help|h]'); | ||
console.log('\n Options:'); | ||
console.log(' --version, -v', 'Show version number'); | ||
console.log(' --help, -h', 'Displays help information.'); | ||
console.log( | ||
' --example, -e', | ||
'Example from: \x1b[34mhttp://jaywcjlove.github.io/tsbb/ \x1b[0m , default: "basic"', | ||
); | ||
console.log(' --force, -f', 'Overwrite target directory if it exists. default: false'); | ||
console.log( | ||
' --path, -p', | ||
'Specify the download target git address. default: "\x1b[34mhttp://jaywcjlove.github.io/tsbb/ \x1b[0m"', | ||
); | ||
exampleHelp(); | ||
console.log('\n Copyright 2021'); | ||
console.log('\n'); | ||
return; | ||
} | ||
const { version } = require('../package.json'); | ||
if (argvs.v || argvs.version) { | ||
console.log(`\n create-tsbb v${version}\n`); | ||
return; | ||
} | ||
argvs.appName = argvs._[0]; | ||
argvs.path = argvs.p = argvs.path || argvs.p || 'http://jaywcjlove.github.io/tsbb/'; | ||
argvs.force = argvs.f = argvs.force || argvs.f || false; | ||
argvs.example = argvs.e = (argvs.example || argvs.e || 'basic').toLocaleLowerCase(); | ||
create(argvs, exampleHelp); | ||
} catch (error) { | ||
console.log(`\x1b[31m${error.message}\x1b[0m`); | ||
console.log(error); | ||
process.exit(1); | ||
} | ||
} | ||
|
||
export function exampleHelp() { | ||
console.log('\n Example:'); | ||
console.log(' \x1b[35myarn\x1b[0m create tsbb \x1b[33mappName\x1b[0m'); | ||
console.log(' \x1b[35mnpx\x1b[0m create-tsbb \x1b[33mmy-app\x1b[0m'); | ||
console.log(' \x1b[35mnpm\x1b[0m create tsbb \x1b[33mmy-app\x1b[0m'); | ||
console.log(' \x1b[35mnpm\x1b[0m create tsbb \x1b[33mmy-app\x1b[0m -f'); | ||
console.log( | ||
' \x1b[35mnpm\x1b[0m create tsbb \x1b[33mmy-app\x1b[0m -p \x1b[34mhttp://jaywcjlove.github.io/tsbb/\x1b[0m', | ||
); | ||
} | ||
|
||
try { | ||
run(); | ||
} catch (error) { | ||
console.log(`\x1b[31m${error.message}\x1b[0m`); | ||
console.log(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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/// <reference types="node" /> |
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,16 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"esModuleInterop": true, | ||
"declaration": true, | ||
"target": "es2017", | ||
"noImplicitAny": true, | ||
"resolveJsonModule": true, | ||
"moduleResolution": "node", | ||
"sourceMap": true, | ||
"outDir": "lib", | ||
"baseUrl": ".", | ||
"typeRoots": ["node_modules/@types/*", "src/type/*"] | ||
}, | ||
"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