-
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replace husky and lint-staged with lefthook
- Loading branch information
Showing
13 changed files
with
971 additions
and
544 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 "post-merge" "$@" |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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,39 @@ | ||
import { | ||
Select as AriaSelect, | ||
Button, | ||
Label, | ||
ListBox, | ||
ListBoxItem, | ||
Popover, | ||
SelectValue, | ||
} from 'react-aria-components' | ||
|
||
export function Select({ | ||
className, | ||
label, | ||
options = [{ value: '1', label: 'Option 1' }], | ||
icon, | ||
}) { | ||
return ( | ||
<AriaSelect className={className}> | ||
{label && <Label>{label}</Label>} | ||
<Button> | ||
<SelectValue /> | ||
{icon ? icon : <span aria-hidden="true">▼</span>} | ||
</Button> | ||
<Popover> | ||
<ListBox> | ||
{options.map((props) => { | ||
const { value, label } = props | ||
|
||
return ( | ||
<ListBoxItem key={value} {...props}> | ||
{label} | ||
</ListBoxItem> | ||
) | ||
})} | ||
</ListBox> | ||
</Popover> | ||
</AriaSelect> | ||
) | ||
} |
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,34 @@ | ||
import { Select } from '.' | ||
|
||
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export | ||
export default { | ||
title: 'Components/Select', | ||
component: Select, | ||
parameters: { | ||
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout | ||
layout: 'centered', | ||
}, | ||
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs | ||
tags: ['autodocs'], | ||
// More on argTypes: https://storybook.js.org/docs/api/argtypes | ||
argTypes: {}, | ||
// Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args | ||
args: {}, | ||
} | ||
|
||
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args | ||
export const Default = { | ||
render: ({ children, ...props }) => <Select {...props}>{children}</Select>, | ||
args: { | ||
...Select.props, | ||
label: 'Favorite Animal', | ||
options: [ | ||
{ value: '1', label: 'Aardvark' }, | ||
{ value: '2', label: 'Cat' }, | ||
{ value: '3', label: 'Dog' }, | ||
{ value: '4', label: 'Kangaroo' }, | ||
{ value: '5', label: 'Panda' }, | ||
{ value: '6', label: 'Snake' }, | ||
], | ||
}, | ||
} |
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,50 @@ | ||
# EXAMPLE USAGE: | ||
# | ||
# Refer for explanation to following link: | ||
# https://github.com/evilmartians/lefthook/blob/master/docs/configuration.md | ||
# | ||
# pre-push: | ||
# commands: | ||
# packages-audit: | ||
# tags: frontend security | ||
# run: yarn audit | ||
# gems-audit: | ||
# tags: backend security | ||
# run: bundle audit | ||
# | ||
# pre-commit: | ||
# parallel: true | ||
# commands: | ||
# eslint: | ||
# glob: "*.{js,ts,jsx,tsx}" | ||
# run: yarn eslint {staged_files} | ||
# rubocop: | ||
# tags: backend style | ||
# glob: "*.rb" | ||
# exclude: '(^|/)(application|routes)\.rb$' | ||
# run: bundle exec rubocop --force-exclusion {all_files} | ||
# govet: | ||
# tags: backend style | ||
# files: git ls-files -m | ||
# glob: "*.go" | ||
# run: go vet {files} | ||
# scripts: | ||
# "hello.js": | ||
# runner: node | ||
# "any.go": | ||
# runner: go run | ||
|
||
pre-commit: | ||
parallel: true | ||
commands: | ||
lint: | ||
glob: '*.{js,ts,jsx,tsx}' | ||
run: npx eslint --cache --fix {staged_files} | ||
format: | ||
glob: '*.{js,ts,jsx,tsx,css,scss,md}' | ||
run: npx prettier --write {staged_files} | ||
|
||
post-merge: | ||
commands: | ||
update-env: | ||
run: npx vc env pull |
Oops, something went wrong.
f3a64c3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"⚡️ Lighthouse report for the changes in this commit:
🔴 Performance: 46
🟢 Accessibility: 91
🟢 Best practices: 96
🟢 SEO: 92
🔴 PWA: undefined
Lighthouse ran on https://vercel.com/login?next=%2Fsso-api%3Furl%3Dhttps%253A%252F%252Fsatus-storybook-i3bq9m3h9-darkroom-engineering.vercel.app%252F%26nonce%3Df0bf7ee054c9fef9b73d468100a7dc0193ba3b5bc272f04051afbd71359e901d"