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
25 changes: 0 additions & 25 deletions .github/workflows/changelogCheck.yml

This file was deleted.

43 changes: 43 additions & 0 deletions .github/workflows/conventional-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Check for Conventional Commits

on: pull_request

jobs:
check_commits:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Required to get all commits in the PR

- name: Check for conventional commits
id: get_commits
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PR_NUMBER="${{ github.event.number }}"
BASE_SHA="${{ github.event.pull_request.base.sha }}"
HEAD_SHA="${{ github.event.pull_request.head.sha }}"

BRANCH_COMMITS=$(git log --pretty="%s" $BASE_SHA...$HEAD_SHA)

echo $BRANCH_COMMITS

found_conventional_commit=false
while IFS= read -r line; do
# Checks for a <type>(<optional scope>)[optional !]: <description>
pattern="^(feat|fix|build|chore|ci|docs|perf|refactor|revert|style|test)(\(.*\))*!*: .+"
if [[ $line =~ $pattern ]]; then
found_conventional_commit=true
echo "Found conventional commit: $line"
break
fi
done <<< "$BRANCH_COMMITS"

if [[ "$found_conventional_commit" == "false" ]]; then
echo "::warning::The pull request does not contain at least one conventional commit. A new package version will not be created automatically for this pull request."
exit 1
else
echo "::notice::The pull request contains at least one conventional commit."
fi
37 changes: 0 additions & 37 deletions .github/workflows/npmVersionCheck.yml

This file was deleted.

45 changes: 45 additions & 0 deletions .github/workflows/semantic-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Semantic Release
on:
push:
branches:
- master # or 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:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "lts/*"

- name: Install dependencies
run: npm ci

# consider npm provenance, see https://github.com/semantic-release/semantic-release/blob/master/docs/recipes/ci-configurations/github-actions.md#npm-provenance
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
run: npm audit signatures

- name: Build
run: npm run build

# Use npx semantic-release to determine the next version
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
46 changes: 0 additions & 46 deletions .github/workflows/tagAndPublish.yml

This file was deleted.

21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,33 @@ const App = () => {

You need to pass an object containing API endpoint callbacks as the `apiValue` prop of the ApiProvider as described in the [usage](#usage) section for the widget to work. [Here](./docs/APIDOCUMENTATION.md) is a more detailed list of the API endpoint callbacks.

## Developing
## Development Set Up

1. Clone project
2. Install `Node(with npm)`. See [package.json](/package.json) for current required versions
3. Run `npm i`
4. Make your code changes
4. Make your code changes - [Follow Conventional Commits](#commit-message-requirements)
5. Run `npm run build` to build the project
6. [Link Project](#linking-for-development)
7. Test your changes
8. Update change log, translations, and documentation as needed
8. Update translations and documentation as needed
9. Open Pull Request

## Commit Message Requirements

_To make commits that trigger a package release, use `npx cz`, it will launch easy to follow commitizen prompts._

A new _MAJOR.MINOR.PATCH_ release will be generated if at least one of the following types are used, see [Conventional Commits Documentation](https://www.conventionalcommits.org/) for more specifics.
* `fix:` -> PATCH bump
* `feat:` -> MINOR bump

Major bump (any type with a footer of `BREAKING CHANGE:`)
```
<any_type>: <message>

BREAKING CHANGE: <description>
```

## Linking for Development

For developing this package locally, we suggest you use npm link to connect your local version of the package to your client app using the package.
Expand Down
Loading
Loading