Skip to content

Commit

Permalink
feat(dx): improve commit flow
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbbreuer committed Jun 22, 2022
1 parent db4b737 commit 71381d1
Show file tree
Hide file tree
Showing 6 changed files with 533 additions and 1,003 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -5,13 +5,13 @@
<!-- [![npm downloads][npm-downloads-src]][npm-downloads-href] -->
<!-- [![Codecov][codecov-src]][codecov-href] -->

# The Quick Way to Get Started
# The Simple Way

This is an opinionated TypeScript Starter kit to help kick-start development of your next npm package.

## 💡 Get Started

Luckily, it's incredibly easy to get your package development started with this slightly opinionated starter kit.
Luckily, it's incredibly easy to get your package development started:

```bash
# you may use this GitHub template or the following command:
Expand Down
67 changes: 67 additions & 0 deletions commitlint.config.js
@@ -0,0 +1,67 @@
const scopes = ['', 'ci', 'deps', 'dx', 'example', 'release', 'readme', 'build']

/** @type {import('cz-git').UserConfig} */
module.exports = {
rules: {
// @see: https://commitlint.js.org/#/reference-rules
'scope-enum': [
2, 'always',
scopes,
],
},
prompt: {
messages: {
type: 'Select the type of change that you\'re committing:',
scope: 'Select the SCOPE of this change (optional):',
customScope: 'Select 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:\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 adjusting existing tests', emoji: ':white_check_mark:' },
{ value: 'build', name: 'build: 📦️ Changes that affect the build system or external dependencies', emoji: ':package:' },
{ value: 'ci', name: 'ci: 🎡 Changes to our CI configuration files and scripts', emoji: ':ferris_wheel:' },
{ 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,
themeColorCode: '',
scopes,
allowCustomScopes: true,
allowEmptyScopes: true,
customScopesAlign: 'bottom',
customScopesAlias: 'custom',
emptyScopesAlias: 'empty',
upperCaseSubject: false,
allowBreakingChanges: ['feat', 'fix'],
breaklineNumber: 100,
breaklineChar: '|',
skipQuestions: [],
issuePrefixs: [{ value: 'closed', name: 'closed: ISSUES has been processed' }],
customIssuePrefixsAlign: 'top',
emptyIssuePrefixsAlias: 'skip',
customIssuePrefixsAlias: 'custom',
allowCustomIssuePrefixs: true,
allowEmptyIssuePrefixs: true,
confirmColorize: true,
maxHeaderLength: Infinity,
maxSubjectLength: Infinity,
minSubjectLength: 0,
scopeOverrides: undefined,
defaultBody: '',
defaultIssues: '',
defaultScope: '',
defaultSubject: '',
},
}
57 changes: 0 additions & 57 deletions commitlint.config.ts

This file was deleted.

32 changes: 13 additions & 19 deletions package.json
Expand Up @@ -9,15 +9,15 @@
"kit",
"package"
],
"homepage": "https://github.com/openweblabs/ts-starter#readme",
"homepage": "https://github.com/openwebstacks/ts-starter#readme",
"bugs": {
"url": "https://github.com/openweblabs/ts-starter/issues"
"url": "https://github.com/openwebstacks/ts-starter/issues"
},
"license": "MIT",
"author": "Chris Breuer <chris@ow3.org>",
"repository": {
"type": "git",
"url": "git+https://github.com/openweblabs/ts-starter.git"
"url": "git+https://github.com/openwebstacks/ts-starter.git"
},
"main": "./dist/index.mjs",
"module": "./dist/index.mjs",
Expand Down Expand Up @@ -45,49 +45,43 @@
"build": "unbuild",
"dev": "unbuild --stub",
"lint": "eslint .",
"commit": "git-cz",
"lint:fix": "eslint . --fix",
"fresh": "rimraf node_modules/ pnpm-lock.yaml && pnpm i",
"commit": "git cz",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
"prepublishOnly": "pnpm run build",
"release": "npx bumpp package.json --execute 'pnpm run changelog' --commit 'chore(release): %s' --tag --push --all",
"release": "npx bumpp package.json --execute 'pnpm run changelog' --commit 'chore(release): %s' --all",
"start": "esno src/index.ts",
"test": "vitest",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"vue": "^3.2.37"
},
"devDependencies": {
"@antfu/eslint-config": "^0.25.1",
"@commitlint/config-conventional": "^17.0.2",
"@commitlint/cz-commitlint": "^17.0.0",
"@commitlint/types": "^17.0.0",
"@types/node": "^17.0.32",
"bumpp": "^8.2.1",
"commitizen": "^4.2.4",
"conventional-changelog-cli": "^2.2.2",
"cz-git": "^1.3.5",
"eslint": "^8.18.0",
"esno": "^0.16.3",
"inquirer": "^9.0.0",
"lint-staged": "^13.0.2",
"pnpm": "^7.3.0",
"rimraf": "^3.0.2",
"simple-git-hooks": "^2.8.0",
"sort-package-json": "^1.57.0",
"typescript": "^4.7.4",
"unbuild": "^0.7.4",
"vite": "^2.9.12",
"vitest": "^0.15.2"
},
"lint-staged": {
"*.{js,jsx,ts,tsx,vue}": "eslint --fix",
"package.json": "sort-package-json"
"*.{js,jsx,ts,tsx,vue}": "eslint --fix"
},
"simple-git-hooks": {
"pre-commit": "npx lint-staged",
"commit-msg": "npx commitlint --config ./commitlint.config.ts --edit $1"
"pre-commit": "npx --no-install lint-staged",
"commit-msg": "npx --no -- commitlint --edit $1"
},
"config": {
"commitizen": {
"path": "@commitlint/cz-commitlint"
"path": "node_modules/cz-git"
}
},
"engines": {
Expand Down

0 comments on commit 71381d1

Please sign in to comment.