-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(cli): initialization cli project
link #37
- Loading branch information
Showing
10 changed files
with
326 additions
and
144 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
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,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2022-present Qiubin Zheng (@Zhengqbbb zhengqbbb@gmail.com) | ||
|
||
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,40 @@ | ||
{ | ||
"name": "czg", | ||
"version": "0.0.1", | ||
"description": "Interactive Commitizen CLI that generate standardized commit messages", | ||
"keywords": [ | ||
"commit", | ||
"commit message", | ||
"commitizen-cli", | ||
"commitizen", | ||
"cli", | ||
"cz-git", | ||
"cz-customizable" | ||
], | ||
"homepage": "https://cz-git.qbenben.com/cli", | ||
"bugs": { | ||
"url": "https://github.com/Zhengqbbb/cz-git/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/Zhengqbbb/cz-git", | ||
"directory": "packages/cli" | ||
}, | ||
"license": "MIT", | ||
"author": "Zhengqbbb <zhengqbbb@gmail.com> (https://github.com/Zhengqbbb)", | ||
"bin": { | ||
"czg": "lib/index.js" | ||
}, | ||
"scripts": { | ||
"build": "pnpm clean && tsup", | ||
"clean": "rimraf *.tsbuildinfo lib dist", | ||
"release:changelog": "conventional-changelog -p angular -i CHANGELOG.md -s" | ||
}, | ||
"devDependencies": { | ||
"@cz-git/inquirer": "workspace:*", | ||
"@cz-git/loader": "workspace:*", | ||
"cz-git": "workspace:*", | ||
"inquirer": "8.2.0", | ||
"rimraf": "3.0.2" | ||
} | ||
} |
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,75 @@ | ||
#!/usr/bin/env node | ||
import { SearchCheckbox, style, fuzzyFilter } from "@cz-git/inquirer"; | ||
import inquirer from "inquirer"; | ||
console.log(style.gray("Hello, world!")); | ||
|
||
const testArr1 = [ | ||
{ name: "test1", value: "test1" }, | ||
{ name: "test2", value: "test2" }, | ||
{ name: "test3", value: "test3" }, | ||
{ name: "test4", value: "test4" }, | ||
{ name: "test5", value: "test5" }, | ||
{ name: "test6", value: "test6" }, | ||
{ name: "test7", value: "test7" }, | ||
{ name: "test8", value: "test8" }, | ||
{ name: "test9", value: "test9" } | ||
]; | ||
|
||
const testArr2 = [ | ||
{ name: "test1", value: "test1" }, | ||
new inquirer.Separator(), | ||
{ name: "test2", value: "test2" }, | ||
{ name: "test3", value: "test3" }, | ||
{ name: "test4", value: "test4" }, | ||
{ name: "test5", value: "test5" }, | ||
{ name: "test6", value: "test6" }, | ||
{ name: "test7", value: "test7" }, | ||
{ name: "test8", value: "test8" }, | ||
{ name: "test9", value: "test9" } | ||
]; | ||
|
||
const testArr3 = [ | ||
{ value: false, name: "empty" }, | ||
{ value: "___CUSTOM___", name: "custom" }, | ||
new inquirer.Separator(), | ||
{ value: "cz-git", name: "cz-git" }, | ||
{ value: "docs", name: "docs: cz-git document" }, | ||
{ value: "plugin-inquirer", name: "plugin-inquirer: provide cz-git inquirer" }, | ||
{ value: "plugin-loader", name: "plugin-loader: options loader" } | ||
]; | ||
|
||
inquirer.registerPrompt("search-checkbox", SearchCheckbox); | ||
inquirer | ||
.prompt([ | ||
{ | ||
type: "search-checkbox", | ||
name: "testOne", | ||
themeColorCode: "", | ||
message: "Select checkbox test:", | ||
source: function (_: unknown, input: string) { | ||
return fuzzyFilter(input, testArr1); | ||
} | ||
}, | ||
{ | ||
type: "search-checkbox", | ||
name: "testTwo", | ||
themeColorCode: "38;5;043", | ||
message: "Select checkbox test:", | ||
source: function (_: unknown, input: string) { | ||
return fuzzyFilter(input, testArr2); | ||
} | ||
}, | ||
{ | ||
type: "search-checkbox", | ||
name: "cz", | ||
themeColorCode: "38;5;042", | ||
message: "Select scope:", | ||
source: function (_: unknown, input: string) { | ||
return fuzzyFilter(input, testArr3); | ||
} | ||
} | ||
]) | ||
.then(function (answers) { | ||
console.log(JSON.stringify(answers, null, " ")); | ||
}) | ||
.catch((e) => console.log(e)); |
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 @@ | ||
{ | ||
"extends": "../../tsconfig.base.json", | ||
"compilerOptions": { | ||
"rootDir": "./src", | ||
"outDir": "./lib", | ||
"noUnusedLocals": false, | ||
"noUnusedParameters": false, | ||
}, | ||
"exclude": ["node_modules", "./dist", "./lib"], | ||
"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,13 @@ | ||
import { defineConfig } from "tsup"; | ||
import baseConfig from "../../tsup.config"; | ||
|
||
export default defineConfig(() => { | ||
return { | ||
...baseConfig, | ||
|
||
minify: true, | ||
entry: ["./src/index.ts"], | ||
tsconfig: "./tsconfig.json", | ||
dts: false | ||
}; | ||
}); |
Oops, something went wrong.