Skip to content

Commit

Permalink
feat(cz-git): init monorepo project
Browse files Browse the repository at this point in the history
link #2
  • Loading branch information
Zhengqbbb committed Mar 1, 2022
1 parent 056c4af commit ef6f30d
Show file tree
Hide file tree
Showing 34 changed files with 3,963 additions and 194 deletions.
50 changes: 9 additions & 41 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
@@ -1,52 +1,20 @@
/** @type {import('./lib').UserConfig} */
const fs = require('fs')
const path = require('path')
const packages = fs.readdirSync(path.resolve(__dirname, 'packages/@cz-git'))

/** @type {import('cz-git').UserConfig} */
module.exports = {
extends: ["@commitlint/config-conventional"],
rules: {
"scope-enum": [2, "always", [ "cz-git", "guide", "config" ]],
"header-max-length": [2, 'always', 100],
"scope-enum": [2, "always", [ "cz-git", "guide", ...packages ]],
"subject-min-length": [2, 'always', 2],
"subject-empty": [2, "never"],
},
prompt: {
messages: {
type: "Select the type of change that you're committing:",
scope: "Denote the SCOPE of this change (optional):",
customScope: "Denote the SCOPE of this change:",
subject: "Write a SHORT, IMPERATIVE tense description of the change:\n",
body: 'Provide a LONGER description of the change (optional). Use "|" to break new line:\n',
breaking: 'List any BREAKING CHANGES (optional). Use "|" to break new line:\n',
footerPrefixsSelect: "Select the ISSUES type of changeList by this change (optional):",
customFooterPrefixs: "Input ISSUES Prefix:",
footer: "List any ISSUES by this change. E.g.: #31, #34, #I972S:\n",
confirmCommit: "Are you sure you want to proceed with the commit above ?"
},
types: [
{ value: "feat", name: "feat: A new feature", emoji: ":sparkles:" },
{ value: "fix", name: "fix: A bug fix", emoji: ":bug:" },
{ value: "docs", name: "docs: Documentation only changes", emoji: ":memo:" },
{ value: "style", name: "style: Changes that do not affect the meaning of the code", emoji: ":lipstick:" },
{ value: "refactor", name: "refactor: A code change that neither fixes a bug nor adds a feature", emoji: ":recycle:" },
{ value: "perf", name: "perf: A code change that improves performance", emoji: ":zap:" },
{ value: "test", name: "test: Adding missing tests or correcting existing tests", emoji: ":white_check_mark:" },
{ value: "build", name: "build: Changes that affect the build system or external dependencies", emoji: ":building_construction:" },
{ value: "ci", name: "ci: Changes to our CI configuration files and scripts", emoji: ":green_heart:" },
{ value: "chore", name: "chore: Other changes that don't modify src or test files", emoji: ":hammer:" },
{ value: "revert", name: "revert: Reverts a previous commit", emoji: ":rewind:" }
],
useEmoji: false,
scopes: [{ value: "cz-git", name: "cz-git: core control" }, { name: "guide" } , 'config'],
customScopesAlign: "bottom",
emptyScopesAlias: "empty",
customScopesAlias: "custom",
allowBreakingChanges: ['feat', 'fix'],
breaklineChar: "|",
/** @see: https://github.com/Zhengqbbb/cz-git#options */
issuePrefixs: [
{ value: "link", name: "link: processing to ISSUES" },
{ value: "link", name: "link: Work in processing to ISSUES" },
{ value: "closed", name: "closed: ISSUES has been processed" }
],
customIssuePrefixsAlign: "top",
emptyIssuePrefixsAlias: "skip",
customIssuePrefixsAlias: "custom",
confirmColorize: true
]
}
};
40 changes: 40 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: Bug report
about: Create a report to help us improve
title: "(Bug report)"
labels: ''
assignees: ''

---

<!-- Please fill in relevant information as much as possible. That would be helpful to locate the problem and save us each other's time -->

<!-- If some fields are irrelevant or you are not sure, remove it or mark it as "not related" / not sure" -->

<!-- If you don't follow the template and not providing valid information, we'll close your issue without further reply -->

## Bug report

### Environment info

- `cz-git` verison:
- `Node.js` verison:


### Description

<!-- A clear and concise description of what the bug is. -->

### Steps to reproduce

<!-- Steps to reproduce the behavior -->

- Reproduction link / repo:

### Expected behavior

<!-- A clear and concise description of what you expected to happen. -->

### Screenshots

<!-- If applicable, add screenshots to help explain your problem. -->
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: Feature request
about: Suggest an idea for this project
title: "(Feature request)"
labels: ''
assignees: ''

---

## Feature request

### Description

<!-- This should be a clear and concise description -->

### Proposed Solution

<!-- Describe a clear and concise description of what you want to happen -->
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ jest.config.d.ts
jest.config.js
*.test.js
*.test.d.ts
*.test.js.map
coverage
3 changes: 2 additions & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ printf "\n\033[1;32m%s\033[0m \033[1m%s \033[1;32m%s\033[0m\n" \
"eslint checking commit file..." \
"«««"

yarn lint-staged
yarn lint-staged
npx lerna run lint-staged
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [](https://github.com/Zhengqbbb/cz-git/compare/v1.1.1...v) (2022-03-01)

### [1.1.1](https://github.com/Zhengqbbb/cz-git/compare/v1.1.0...v1.1.1) (2022-02-28)


Expand Down
2 changes: 1 addition & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const config: Config.InitialOptions = {
tsconfig: "tsconfig.base.json"
}
},
testMatch: ["<rootDir>/test/*.test.ts"]
testMatch: ["<rootDir>/**/__tests__/*.test.ts"]
};

export default config;
25 changes: 25 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"version": "1.1.1",
"npmClient": "yarn",
"useWorkspaces": true,
"packages": [
"packages/*",
"packages/@cz-git/*"
],
"command": {
"version": {
"allowBranch": [
"main",
"next_*",
"dev_*",
"fix_*"
],
"conventionalCommits": true,
"exact": true,
"ignoreChanges": [
"**/*.md"
],
"message": "chore(release): publish %s"
}
}
}
27 changes: 10 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cz-git",
"version": "1.1.1",
"private": true,
"description": "A better customizable and git support commitizen adapter",
"keywords": [
"commitizen-adapter",
Expand All @@ -27,14 +27,16 @@
"files": [
"lib"
],
"workspaces": [
"packages/*"
],
"scripts": {
"build": "rimraf *.tsbuildinfo lib && tsc -b",
"dev": "tsc -b --watch",
"build": "lerna run build",
"dev": "tsc -b tsconfig.build.json --watch",
"lint": "eslint --ext .ts",
"prepare": "husky install",
"prerelease": "yarn lint",
"release": "standard-version --release-as patch",
"release-as": "standard-version --release-as",
"release": "lerna version",
"release-as": "standard-version --lerna-package --release-as",
"test": "jest",
"test-coverage": "jest --coverage"
},
Expand All @@ -44,19 +46,9 @@
},
"config": {
"commitizen": {
"path": "./lib/index.js"
"path": "./packages/cz-git/lib/index.js"
}
},
"dependencies": {
"@commitlint/load": "^16.2.1",
"@commitlint/types": "^16.2.1",
"commitizen": "^4.2.4",
"editor": "^1.0.0",
"inquirer": "^8.0.0",
"inquirer-autocomplete-prompt": "^1.4.0",
"temp": "^0.9.4",
"word-wrap": "^1.2.3"
},
"devDependencies": {
"@commitlint/cli": "^16.2.1",
"@commitlint/config-conventional": "^16.2.1",
Expand All @@ -70,6 +62,7 @@
"eslint-plugin-prettier": "^4.0.0",
"husky": "^7.0.4",
"jest": "^27.5.1",
"lerna": "^4.0.0",
"lint-staged": "^12.3.4",
"prettier": "^2.2.1",
"rimraf": "^3.0.2",
Expand Down
140 changes: 140 additions & 0 deletions packages/@cz-git/load/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
# Changelog

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [1.1.1](https://github.com/Zhengqbbb/cz-git/compare/v1.1.0...v1.1.1) (2022-02-28)


### Bug Fixes

* **cz-git:** fix footerPrefix custom ([fc8dc78](https://github.com/Zhengqbbb/cz-git/commit/fc8dc7869a8db022771cd1ff9bcbdb99917aeb58))

## [1.1.0](https://github.com/Zhengqbbb/cz-git/compare/v1.0.9...v1.1.0) (2022-02-28)


### Features

* **cz-git:** done document README.Marks the official version release ([31e8b4d](https://github.com/Zhengqbbb/cz-git/commit/31e8b4d3ec4fa51d376b70202e7d9d7ce510e0d6)), closes [#1](https://github.com/Zhengqbbb/cz-git/issues/1)

### [1.0.9](https://github.com/Zhengqbbb/cz-git/compare/v1.0.7...v1.0.9) (2022-02-27)


### ⚠ BREAKING CHANGES

* **cz-git:** - `customScopesAlign` and `customIssuePrefixsAlign`:
can change align in selet
- `emptyScopesAlias`, `customScopesAlias`, `emptyIssuePrefixsAlias`, `customIssuePrefixsAlias`:
can change name of the prompt show

### Features

* **cz-git:** add align and alias option for selector ([5be93a5](https://github.com/Zhengqbbb/cz-git/commit/5be93a5ee07f969c32d74536d4c9dc8fed7737e7)), closes [#1](https://github.com/Zhengqbbb/cz-git/issues/1)
* **cz-git:** add allowEmptyScopes, allowCustomScopes to control disable ([e0becb6](https://github.com/Zhengqbbb/cz-git/commit/e0becb6fce5d6adae266f51aae58aac1a625c718)), closes [#1](https://github.com/Zhengqbbb/cz-git/issues/1)


### Bug Fixes

* **cz-git:** fixed use both maxHeaderLength and maxSubjectLengt ([659b8eb](https://github.com/Zhengqbbb/cz-git/commit/659b8eb9f9787698b766185fb62043fb98d8a511)), closes [#1](https://github.com/Zhengqbbb/cz-git/issues/1)

### [1.0.8](https://github.com/Zhengqbbb/cz-git/compare/v1.0.7...v1.0.8) (2022-02-24)


### ⚠ BREAKING CHANGES
- feat: allowCustomScopes and allowCustomScopes control disable
- feat: scopes can auto load value
from `commitlint`
* **cz-git:** - `customScopesAlign` and `customIssuePrefixsAlign`:
can change align in selet
- `emptyScopesAlias`, `customScopesAlias`, `emptyIssuePrefixsAlias`, `customIssuePrefixsAlias`:
can change name of the prompt show

### Features

* **cz-git:** add align and alias option for selector ([5be93a5](https://github.com/Zhengqbbb/cz-git/commit/5be93a5ee07f969c32d74536d4c9dc8fed7737e7)), closes [#1](https://github.com/Zhengqbbb/cz-git/issues/1)
* **cz-git:** add allowEmptyScopes, allowCustomScopes to control disable ([e0becb6](https://github.com/Zhengqbbb/cz-git/commit/e0becb6fce5d6adae266f51aae58aac1a625c718)), closes [#1](https://github.com/Zhengqbbb/cz-git/issues/1)

### [1.0.7](https://github.com/Zhengqbbb/cz-git/compare/v1.0.6...v1.0.7) (2022-02-22)


### ⚠ BREAKING CHANGES

* **cz-git:** `confirmColorize` option: Prompt final determination whether to display the color

### Features

* **cz-git:** add confirmColorize option to handle confirm colorize ([68b2629](https://github.com/Zhengqbbb/cz-git/commit/68b26296cb00ca0d33fcebbec6ba8ed36ca53e96)), closes [#1](https://github.com/Zhengqbbb/cz-git/issues/1)

### [1.0.6](https://github.com/Zhengqbbb/cz-git/compare/v1.0.5...v1.0.6) (2022-02-21)


### ⚠ BREAKING CHANGES

* **cz-git:** add option `breaklineChar`

### Features

* **cz-git:** add breaklineChar option to make new line for body and BreakingChanges ([6691c26](https://github.com/Zhengqbbb/cz-git/commit/6691c2624925551b4ad4175e0e9d953ebfe47baf)), closes [#1](https://github.com/Zhengqbbb/cz-git/issues/1)

### [1.0.5](https://github.com/Zhengqbbb/cz-git/compare/v1.0.4...v1.0.5) (2022-02-21)


### Features

* **cz-git:** support both head and subject max rules ([2444724](https://github.com/Zhengqbbb/cz-git/commit/24447247fec13d3f9c4ba323d74da5904f63133f)), closes [#1](https://github.com/Zhengqbbb/cz-git/issues/1)

### [1.0.4](https://github.com/Zhengqbbb/cz-git/compare/v1.0.3...v1.0.4) (2022-02-19)


### ⚠ BREAKING CHANGES

* **cz-git:** Need open option `useEmoji`

### Features

* **cz-git:** :sparkles: support commit add emoji ([dd7d9e0](https://github.com/Zhengqbbb/cz-git/commit/dd7d9e05e6aed48fd3962663fa5f00940d177070)), closes [#1](https://github.com/Zhengqbbb/cz-git/issues/1)

### [1.0.3](https://github.com/Zhengqbbb/cz-git/compare/v1.0.2...v1.0.3) (2022-02-19)


### ⚠ BREAKING CHANGES

* **cz-git:** e.g: { value: "cz-git", name: "cz-git: core control" }

### Features

* **cz-git:** scopes config support value to add descrition for selector ([980f163](https://github.com/Zhengqbbb/cz-git/commit/980f1631d00a68a9a328319c0f8d3523c5e3e0e2)), closes [#1](https://github.com/Zhengqbbb/cz-git/issues/1)

### [1.0.2](https://github.com/Zhengqbbb/cz-git/compare/v1.0.1...v1.0.2) (2022-02-18)


### ⚠ BREAKING CHANGES

* **cz-git:** if you want to use just set option:
1. defaultScope
2. defaultSubject
3. defaultBody
4. defaultIssues
more introduction see types:
https://github.com/Zhengqbbb/cz-git/blob/main/src/share.ts#L176
### Features

* **cz-git:** add default option to provide default value ([9910b75](https://github.com/Zhengqbbb/cz-git/commit/9910b7542d303a5b7830dbdf05785928d32b8292)), link [#1](https://github.com/Zhengqbbb/cz-git/issues/1)

### [1.0.1](https://github.com/Zhengqbbb/cz-git/compare/v1.0.0...v1.0.1) (2022-02-18)


### Features

* **config:** add standard-version to generate CHANGELOG ([08f5b77](https://github.com/Zhengqbbb/cz-git/commit/08f5b77428cf2042f154b5f39524b8c28adcb6a1))


### Bug Fixes

* **cz-git:** fix package main enter file path ([a1ec4e0](https://github.com/Zhengqbbb/cz-git/commit/a1ec4e0aac8a2fe439c0fc3e384b754322c96347))

## 1.0.0 (2022-02-18)


### Features

* **cz-git:** done commit prompt overall process ([bfb969c](https://github.com/Zhengqbbb/cz-git/commit/bfb969cd03711a2733fcfe59ff93170d353da6e4)), link [#1](https://github.com/Zhengqbbb/cz-git/issues/1)
11 changes: 11 additions & 0 deletions packages/@cz-git/load/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# `@cz-git/load`

> TODO: description
## Usage

```
const load = require('@cz-git/load');
// TODO: DEMONSTRATE API
```
Loading

0 comments on commit ef6f30d

Please sign in to comment.