-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 5091f84
Showing
28 changed files
with
10,646 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: Main | ||
|
||
on: [push] | ||
|
||
jobs: | ||
main: | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
name: Test & Build | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- 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: 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: pnpm install --frozen-lockfile | ||
|
||
- name: Check types | ||
run: pnpm tsc | ||
|
||
- name: Check linting | ||
run: pnpm lint:ci | ||
|
||
- name: Run tests | ||
run: pnpm test:ci | ||
|
||
- name: Build storybook | ||
run: pnpm storybook:build | ||
|
||
- name: Build package | ||
run: pnpm build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# 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@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- 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: 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: Deploy Storybook | ||
uses: bitovi/[email protected] | ||
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: | | ||
# pnpm build | ||
# npm login --registry=https://registry.npmjs.org/ --scope=your-scope | ||
# npm publish | ||
# env: | ||
# NODE_AUTH_TOKEN: ${{ secrets.YOUR_NPM_AUTH_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# JetBrains IDE files | ||
.idea/ | ||
|
||
# testing | ||
/coverage | ||
|
||
# production | ||
/dist | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
tsconfig.tsbuildinfo | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# local env files | ||
.env | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
storybook-static |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "prepare-commit-msg" "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import type { StorybookConfig } from "@storybook/react-webpack5"; | ||
const config: StorybookConfig = { | ||
stories: ["../src/**/*.stories.@(js|jsx|ts|tsx|mdx)"], | ||
addons: [ | ||
"@storybook/addon-links", | ||
"@storybook/addon-essentials", | ||
"@storybook/addon-interactions", | ||
"@storybook/addon-webpack5-compiler-swc", | ||
], | ||
framework: { | ||
name: "@storybook/react-webpack5", | ||
options: { | ||
builder: { | ||
useSWC: true, | ||
}, | ||
}, | ||
}, | ||
swc: () => ({ | ||
jsc: { | ||
transform: { | ||
react: { | ||
runtime: "automatic", | ||
}, | ||
}, | ||
}, | ||
}), | ||
docs: { | ||
autodocs: "tag", | ||
}, | ||
}; | ||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import type { Preview } from "@storybook/react"; | ||
|
||
const preview: Preview = { | ||
parameters: { | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export default preview; |
Oops, something went wrong.