From d5c53455598833f92fbf598a40562b819c3f18c8 Mon Sep 17 00:00:00 2001 From: Stanley Ugwu Date: Sat, 14 Sep 2024 11:14:10 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9B=A0=EF=B8=8F=20build:=20enable=20emoji?= =?UTF-8?q?s=20in=20commit=20message=20header=20and=20make=20workflow=20sc?= =?UTF-8?q?ript=20run=20on=20macos-latest?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 2 +- commitlint.config.ts | 45 ++++++++++++++++++++++++++++++++++++++++ package.json | 13 +++++------- 3 files changed, 51 insertions(+), 9 deletions(-) create mode 100644 commitlint.config.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ca60566..2aff58d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: run: yarn test --maxWorkers=2 --coverage build-library: - runs-on: windows-latest + runs-on: macos-latest steps: - name: Checkout uses: actions/checkout@v3 diff --git a/commitlint.config.ts b/commitlint.config.ts new file mode 100644 index 0000000..ec8edca --- /dev/null +++ b/commitlint.config.ts @@ -0,0 +1,45 @@ +import type { UserConfig } from '@commitlint/types'; + +const Configuration: UserConfig = { + extends: ['@commitlint/config-conventional'], + parserPreset: { + parserOpts: { + headerPattern: + /^(?.*\s\w*)(?:\((?.*)\))?!?:\s(?(?:(?!#).)*(?:(?!\s).))$/, + headerCorrespondence: ['type', 'scope', 'subject'], + }, + }, + rules: { + 'type-enum': [ + 2, + 'always', + [ + 'build', + 'chore', + 'ci', + 'docs', + 'feat', + 'fix', + 'perf', + 'refactor', + 'revert', + 'style', + 'test', + 'πŸ› οΈ build', + 'πŸ› οΈπŸš€ build', // new version release + '♻️ chore', + 'βš™οΈ ci', + 'πŸ“ƒ docs', + '✨ feat', + '🐞 fix', + 'πŸš€ perf', + 'πŸ¦„ refactor', + 'πŸ—‘οΈ revert', + '🌈 style', + 'πŸ§ͺ test', + ], + ], + }, +}; + +module.exports = Configuration; diff --git a/package.json b/package.json index 36fca3a..a88ca00 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@devvie/bottom-sheet", - "version": "0.3.0", + "version": "0.4.0", "description": "The 😎smart , πŸ“¦tiny , and πŸŽ—flexible bottom sheet your app craves πŸš€", "main": "lib/commonjs/index", "module": "lib/module/index", @@ -18,7 +18,9 @@ "lint": "eslint \"**/*.{js,ts,tsx}\"", "del-build-dir": "node scripts/delete-lib-dir.js", "build-dts": "tsc --project tsconfig.build.json", - "copy-dts": "xcopy /S /Y \"src\\*.d.ts\" \"lib\\typescript\"", + "copy-dts:unix": "mkdir -p lib/typescript && rsync --prune-empty-dirs -av --include '*/' --include '*.d.ts' --exclude '*' src/ lib/typescript/", + "copy-dts:windows": "xcopy /S /Y \"src\\*.d.ts\" \"lib\\typescript\"", + "copy-dts": "if [ \"$OS\" = \"Windows_NT\" ]; then yarn copy-dts:windows; else yarn copy-dts:unix; fi", "prepack": "yarn del-build-dir && yarn build-dts && yarn copy-dts && bob build", "release": "yarn prepack && dotenv release-it --", "example": "yarn --cwd example", @@ -87,14 +89,9 @@ "/lib/" ] }, - "commitlint": { - "extends": [ - "@commitlint/config-conventional" - ] - }, "release-it": { "git": { - "commitMessage": "🧹✨ chore: release ${version}", + "commitMessage": "πŸ› οΈπŸš€ build: release ${version}", "tagName": "v${version}", "requireBranch": "main" },