Skip to content

Commit

Permalink
Merge pull request #50 from prisma/DA-1571
Browse files Browse the repository at this point in the history
feat(custom): add conventional commits
  • Loading branch information
ankur-arch authored Nov 11, 2024
2 parents 6b9b48a + b9dd533 commit c643b05
Show file tree
Hide file tree
Showing 7 changed files with 2,913 additions and 157 deletions.
27 changes: 27 additions & 0 deletions .cz-config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
module.exports = {
types: [
{ value: "feat", name: "feat: ✨ A new feature" },
{ value: "fix", name: "fix: 🐛 A bug fix" },
{ value: "docs", name: "docs: 📚 Documentation" },
{ value: "style", name: "style: 💄 Code style changes" },
{ value: "refactor", name: "refactor: ♻️ Code restructuring" },
{ value: "perf", name: "perf: ⚡ Performance improvements" },
{ value: "test", name: "test: ✅ Adding or modifying tests" },
{ value: "chore", name: "chore: 🔧 Other changes" },
],
scopes: [],
allowCustomScopes: true,
allowBreakingChanges: ["feat", "fix"],
messages: {
type: "Select the type of change you're committing:",
scope: "Specify the scope (optional):",
customScope: "Specify the custom scope:",
subject: "Write a short description of the change:",
body: "Provide a longer description (optional):",
breaking: "List any BREAKING CHANGES (optional):",
footer: "Add issue number (e.g., #1234):",
confirmCommit: "Confirm your commit message:",
},
footerPrefix: "Issue:",
subjectLimit: 100,
};
4 changes: 4 additions & 0 deletions .czrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"path": "node_modules/cz-customizable",
"config": ".cz-config.cjs"
}
31 changes: 31 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Release
on:
push:
branches:
- main
permissions:
contents: read # for checkout
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: "lts/*"
- run: npm clean-install
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
run: npm audit signatures
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_NUXT_TOKEN }}
run: npm run release
11 changes: 11 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

# Run commitlint to check the commit message format
npx --no -- commitlint --edit "$1"

# If no commit message is provided, use Commitizen
if [ -z "$1" ]; then
exec < /dev/tty && npm run commit
exit 1 # Stop the default git commit message prompt
fi
6 changes: 6 additions & 0 deletions commitlint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
extends: ["@commitlint/config-conventional"],
rules: {
"scope-max-length": [2, "always", 80],
},
};
Loading

0 comments on commit c643b05

Please sign in to comment.