Skip to content
Open
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
16 changes: 0 additions & 16 deletions .babelrc.json

This file was deleted.

3 changes: 0 additions & 3 deletions .commitlintrc.json

This file was deleted.

9 changes: 0 additions & 9 deletions .editorconfig

This file was deleted.

73 changes: 0 additions & 73 deletions .eslintrc.js

This file was deleted.

2 changes: 0 additions & 2 deletions .github/FUNDING.yml

This file was deleted.

14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: 'npm'
target-branch: 'master'
directory: '/'
schedule:
interval: 'monthly'
groups:
minor-and-patch-updates:
patterns:
- '*'
update-types:
- 'minor'
- 'patch'
56 changes: 39 additions & 17 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,65 @@ name: Main
on: [push]

jobs:
run-ci:
main:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

name: Run Type Check & Linters
name: Test & Build
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Node
uses: actions/setup-node@v3
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
node-version: lts/*
cache: 'yarn'
version: latest
run_install: false

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install dependencies
run: yarn install --frozen-lockfile
run: pnpm install --frozen-lockfile

- name: Check types
run: yarn type-check
run: pnpm tsc

- name: Check linting
run: yarn lint
run: pnpm lint:ci

- name: Run tests
run: yarn test:ci

- name: Build storybook
run: yarn build-storybook
run: pnpm test:ci

- name: Build package
run: yarn build
run: pnpm build

- name: Install example dependencies
run: cd example && pnpm install --frozen-lockfile

- name: Typecheck example
run: cd example && pnpm tsc

- name: Check commits messages
uses: wagoid/commitlint-github-action@v5
- name: Build example
run: cd example && pnpm build
49 changes: 39 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,65 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages

name: Publish

on:
workflow_dispatch:
release:
types: [published]

permissions:
contents: read
pages: write
id-token: write

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Node
uses: actions/setup-node@v3
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: latest
run_install: false

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: 'yarn'
node-version: 20
cache: 'pnpm'

- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- name: Build and Deploy Storybook
run: yarn deploy-storybook --ci
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Deploy Storybook
uses: bitovi/github-actions-storybook-to-github-pages@v1.0.2
with:
install_command: pnpm install --frozen-lockfile
build_command: pnpm storybook:build
path: storybook-static
env:
GH_TOKEN: ${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}

# - name: Build and publish to npm
# if: github.ref == 'refs/tags/v*' # Only run on version tags
# run: |
# yarn build
# pnpm build
# npm login --registry=https://registry.npmjs.org/ --scope=your-scope
# npm publish
# env:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/coverage

# production
dist
/dist

# misc
.DS_Store
Expand Down
60 changes: 60 additions & 0 deletions .husky/_/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/bin/sh

if [ "$LEFTHOOK_VERBOSE" = "1" -o "$LEFTHOOK_VERBOSE" = "true" ]; then
set -x
fi

if [ "$LEFTHOOK" = "0" ]; then
exit 0
fi

call_lefthook()
{
if test -n "$LEFTHOOK_BIN"
then
"$LEFTHOOK_BIN" "$@"
elif lefthook -h >/dev/null 2>&1
then
lefthook "$@"
else
dir="$(git rev-parse --show-toplevel)"
osArch=$(uname | tr '[:upper:]' '[:lower:]')
cpuArch=$(uname -m | sed 's/aarch64/arm64/;s/x86_64/x64/')
if test -f "$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook"
then
"$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook" "$@"
elif test -f "$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook"
then
"$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook" "$@"
elif test -f "$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook"
then
"$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook" "$@"
elif test -f "$dir/node_modules/lefthook/bin/index.js"
then
"$dir/node_modules/lefthook/bin/index.js" "$@"

elif bundle exec lefthook -h >/dev/null 2>&1
then
bundle exec lefthook "$@"
elif yarn lefthook -h >/dev/null 2>&1
then
yarn lefthook "$@"
elif pnpm lefthook -h >/dev/null 2>&1
then
pnpm lefthook "$@"
elif swift package plugin lefthook >/dev/null 2>&1
then
swift package --disable-sandbox plugin lefthook "$@"
elif command -v mint >/dev/null 2>&1
then
mint run csjones/lefthook-plugin "$@"
elif command -v npx >/dev/null 2>&1
then
npx lefthook "$@"
else
echo "Can't find lefthook in PATH"
fi
fi
}

call_lefthook run "pre-commit" "$@"
Loading
Loading