Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2
updates:
- package-ecosystem: npm
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 5
open-pull-requests-limit: 5
41 changes: 41 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
changelog:
exclude:
authors:
- dependabot[bot]
categories:
- title: "🛠 Breaking Changes"
labels:
- breaking-change
- title: "✨ New Features"
labels:
- feat
- title: "🐛 Bug Fixes"
labels:
- fix
- title: "📚 Documentation"
labels:
- docs
- title: "💅 Style"
labels:
- style
- title: "🧹 Refactoring"
labels:
- refactor
- title: "⚡️ Performance"
labels:
- perf
- title: "✅ Tests"
labels:
- test
- title: 🧰 CI / Build / Chore
labels:
- ci
- build
- chore
- title: 📦 Dependencies (Dependabot)
labels:
- dependencies
- dependabot
- title: Other Changes
labels:
- "*"
53 changes: 53 additions & 0 deletions .github/workflows/label-prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Label PRs

on:
pull_request_target:
types: [opened, reopened, synchronize]

jobs:
label:
runs-on: ubuntu-latest
steps:
- name: Ensure labels exist without overwriting
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const labels = [
{ name: 'breaking-change', color: 'FA0000' },
{ name: 'feat', color: '6DB84F' },
{ name: 'fix', color: '750808' },
{ name: 'docs', color: '42C5E3' },
{ name: 'style', color: 'E663B8' },
{ name: 'refactor', color: '390875' },
{ name: 'perf', color: 'F0E407' },
{ name: 'test', color: '07F0AE' },
{ name: 'ci', color: '818282' },
{ name: 'build', color: 'ED640E' },
{ name: 'chore', color: '0711D9' },
{ name: 'dependencies', color: '5B62E3' },
{ name: 'other', color: 'B0C4DE' }
];
const existingLabelsResp = await github.rest.issues.listLabelsForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
per_page: 100
});
const existingLabels = existingLabelsResp.data.map(l => l.name);
for (const label of labels) {
if (!existingLabels.includes(label.name)) {
await github.rest.issues.createLabel({
owner: context.repo.owner,
repo: context.repo.repo,
name: label.name,
color: label.color
});
}
}

- name: Assign labels
uses: bcoe/conventional-release-labels@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
type_labels: '{"breaking":"breaking-change","feat":"feat","fix":"fix","docs":"docs","style":"style","refactor":"refactor","perf":"perf","test":"test","ci":"ci","build":"build","chore":"chore","dependencies":"dependencies"}'
ignored_types: '["dependabot"]'
55 changes: 55 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Create release

on:
pull_request:
types: [closed]
branches:
- master

jobs:
release:
if: ${{ github.event.pull_request.merged == true }}
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Checkout PR branch
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.merge_commit_sha }}
fetch-depth: 0

- name: Extract version from package.json
id: version
run: |
VERSION=$(jq -r '.version' package.json)
TAG="v$VERSION"
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "tag=$TAG" >> $GITHUB_OUTPUT

- name: Get latest tag
id: latest
run: |
git fetch --tags
LATEST_TAG=$(git tag --sort=-v:refname --merged | head -n1)
echo "latest_tag=$LATEST_TAG" >> $GITHUB_OUTPUT

- name: Check version is new
id: check_version
run: |
node -e "
const spawnSync = require('child_process').spawnSync;
const latest = '${{ steps.latest.outputs.latest_tag }}';
const pr = '${{ steps.version.outputs.tag }}';
const res = spawnSync('npx', ['semver', pr, '-r', \`>\${latest}\`]);
const isNew = !latest || res.status === 0;
console.log(isNew ? '🎉 Version is newer, continuing release.' : '🚫 Version is not newer than latest tag. Skipping release.');
require('fs').writeFileSync(process.env.GITHUB_OUTPUT, 'new_version=' + isNew + '\n');
"

- name: Create tag
if: ${{ steps.check_version.outputs.new_version == 'true' }}
run: |
git tag "v${{ steps.version.outputs.version }}"
git push origin "v${{ steps.version.outputs.version }}"
50 changes: 50 additions & 0 deletions .versionrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"header": "# Changelog\n\nAll notable changes to this project will be documented in this file.\n\n",
"tagPrefix": "v",
"types": [
{
"type": "feat",
"section": "✨ New Features"
},
{
"type": "fix",
"section": "🐛 Bug Fixes"
},
{
"type": "docs",
"section": "📚 Documentation"
},
{
"type": "style",
"section": "💅 Style"
},
{
"type": "refactor",
"section": "🧹 Refactoring"
},
{
"type": "perf",
"section": "⚡️ Performance"
},
{
"type": "test",
"section": "✅ Tests"
},
{
"type": "ci",
"section": "🧰 CI / Build / Chore"
},
{
"type": "build",
"section": "🧰 CI / Build / Chore"
},
{
"type": "chore",
"section": "🧰 CI / Build / Chore"
}
],
"skip": {
"commit": true,
"tag": true
}
}
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Changelog

All notable changes to this project will be documented in this file.


### 2.9.2 (2025-10-27)


### 🧰 CI / Build / Chore

* [CR-7120] Setup conventional commits in frontend repos ([fb3ae75](https://github.com/Easypay/checkout-sdk/commit/fb3ae750217e0208d511921a106098bad12e6c10))
16 changes: 14 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@easypaypt/checkout-sdk",
"version": "2.9.1",
"version": "2.9.2",
"description": "SDK for easypay's Checkout",
"main": "dist/index.js",
"types": "dist/src/index.d.ts",
Expand All @@ -10,7 +10,9 @@
"scripts": {
"build": "rollup -c",
"lint": "eslint --ignore-path .gitignore .",
"test": "jest"
"test": "jest",
"commit": "cz",
"release": "standard-version"
},
"keywords": [
"easypay",
Expand All @@ -35,18 +37,28 @@
"@types/node": "18.14.6",
"@typescript-eslint/eslint-plugin": "5.54.1",
"@typescript-eslint/parser": "5.54.1",
"commitizen": "4.3.1",
"cz-conventional-changelog": "3.3.0",
"eslint": "8.20.0",
"jest": "28.1.0",
"jest-environment-jsdom": "28.1.3",
"postcss": "8.4.31",
"rollup": "2.77.2",
"rollup-plugin-postcss": "4.0.2",
"rollup-plugin-terser": "7.0.2",
"standard-version": "9.5.0",
"ts-jest": "28.0.2",
"tslib": "2.4.0",
"typescript": "4.6.4"
},
"dependencies": {
"dialog-polyfill": "0.5.6"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog",
"disableScopeLowerCase": true,
"disableSubjectLowerCase": true
}
}
}
Loading