-
Notifications
You must be signed in to change notification settings - Fork 4
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
1 parent
da96467
commit 5b63594
Showing
141 changed files
with
37,581 additions
and
2 deletions.
There are no files selected for viewing
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,52 @@ | ||
module.exports = { | ||
root: true, | ||
env: { browser: true, es2020: true }, | ||
extends: [ | ||
'plugin:unicorn/recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:react-hooks/recommended', | ||
'plugin:tailwindcss/recommended', | ||
], | ||
ignorePatterns: [ | ||
'dist', | ||
'.eslintrc.cjs', | ||
'node_modules', | ||
'coverage', | ||
'vite-env.d.ts', | ||
], | ||
parser: '@typescript-eslint/parser', | ||
plugins: ['unicorn', 'react-refresh'], | ||
rules: { | ||
'sort-imports': [ | ||
'error', | ||
{ | ||
ignoreCase: true, | ||
ignoreDeclarationSort: true, | ||
ignoreMemberSort: false, | ||
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'], | ||
allowSeparatedGroups: false, | ||
}, | ||
], | ||
'react-refresh/only-export-components': [ | ||
'warn', | ||
{ allowConstantExport: true }, | ||
], | ||
'unicorn/prevent-abbreviations': 'off', | ||
'unicorn/filename-case': [ | ||
'error', | ||
{ | ||
cases: { | ||
camelCase: true, | ||
pascalCase: true, | ||
}, | ||
}, | ||
], | ||
'tailwindcss/no-custom-classname': [ | ||
'error', | ||
{ | ||
callees: ['clsx', 'cn'], | ||
classRegex: '^(class(Name)?|wrapperClass)$', | ||
}, | ||
], | ||
}, | ||
}; |
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 @@ | ||
# This is a comment. | ||
# Each line is a file pattern followed by one or more owners. | ||
|
||
# These owners will be the default owners for everything in | ||
# the repo. Unless a later match takes precedence. | ||
* @dash-yuga @JordanDJackson | ||
|
||
# Order is important; the last matching pattern takes the most | ||
# precedence. When someone opens a pull request that only | ||
# modifies JS files, only @js-owner and not the global | ||
# owner(s) will be requested for a review. | ||
# *.js @js-owner #This is an inline comment. | ||
|
||
.github/ @yuga-labs/devops |
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,91 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: | ||
- '**' | ||
permissions: | ||
contents: write | ||
packages: write | ||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
permissions: write-all | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: '.nvmrc' | ||
cache: 'npm' | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Lint code | ||
run: npm run format && npm run lint | ||
- uses: stefanzweifel/git-auto-commit-action@v5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
commit_message: 'chore: format' | ||
commit_user_name: 'github-actions[bot]' | ||
commit_user_email: 'github-actions[bot]@users.noreply.github.com' | ||
build: | ||
name: Build | ||
needs: lint | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: '.nvmrc' | ||
cache: 'npm' | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Build | ||
run: npm run build | ||
test: | ||
name: Test | ||
needs: build | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: '.nvmrc' | ||
cache: 'npm' | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Test and get coverage for badge | ||
run: | | ||
# var SUMMARY = [ | ||
# '', | ||
# '=============================== Coverage summary ===============================', | ||
# 'Statements : 32.5% ( 39/120 )', | ||
# 'Branches : 38.89% ( 21/54 )', | ||
# 'Functions : 21.74% ( 5/23 )', | ||
# 'Lines : 31.93% ( 38/119 )', | ||
# '================================================================================', | ||
# '' | ||
# ]; | ||
# Run the tests and capture the output | ||
OUTPUT=$(npm run test:coverage) | ||
# Print the entire test output to the terminal | ||
echo "$OUTPUT" | ||
# Extract coverage summary (specifically the line you want) | ||
SUMMARY=$(echo "$OUTPUT" | tail -2 | head -1) | ||
TOKENS=($SUMMARY) | ||
# process.env.COVERAGE = '31.93%'; | ||
echo "COVERAGE=$(echo ${TOKENS[2]})" >> $GITHUB_ENV | ||
# var REF = 'refs/pull/27/merge.json'; | ||
REF=${{ github.ref }} | ||
# console.log('github.ref: ' + REF); | ||
echo "github.ref: $REF" | ||
# var PATHS = REF.split('/'); | ||
IFS='/' read -ra PATHS <<< "$REF" | ||
# var BRANCH_NAME = PATHS[1] + PATHS[2]; | ||
BRANCH_NAME="${PATHS[1]}_${PATHS[2]}" | ||
# console.log(BRANCH_NAME); // 'pull_27' | ||
echo $BRANCH_NAME | ||
# process.env.BRANCH = 'pull_27'; | ||
echo "BRANCH=$(echo ${BRANCH_NAME})" >> $GITHUB_ENV |
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,56 @@ | ||
name: Publish Package | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
|
||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_CONFIG_SKIP_PREFLIGHT_CHECK: true | ||
HUSKY: 0 | ||
|
||
permissions: | ||
contents: write | ||
packages: write | ||
|
||
jobs: | ||
publish: | ||
name: 'Publish Package' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
registry-url: 'https://npm.pkg.github.com' | ||
cache: 'npm' | ||
scope: '@yuga-labs' | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Update version | ||
run: | | ||
TAG_NAME="${{ github.ref }}" | ||
VERSION="${TAG_NAME#refs/tags/}" | ||
npm version $VERSION --no-git-tag-version | ||
- name: Publish to GitHub Packages | ||
run: npm publish --@yuga-labs:registry=https://npm.pkg.github.com/ | ||
|
||
- name: fix formatting of package.json | ||
run: npx prettier --write package.json | ||
|
||
- name: Commit package.json update | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git fetch origin main | ||
git checkout main | ||
git add package*.json | ||
git commit -m "chore: update version to ${{ github.ref }}" || echo "No changes to commit" | ||
git merge --ff-only HEAD | ||
git push origin main |
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,46 @@ | ||
# dependencies | ||
node_modules/ | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# production | ||
/build | ||
dist/ | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
.pnpm-debug.log* | ||
|
||
# local env files | ||
.env* | ||
!.env.example | ||
!manifests/**/*.env* | ||
|
||
# typescript | ||
*.tsbuildinfo | ||
|
||
# yarn | ||
yarn.lock | ||
yarn* | ||
|
||
# eslint | ||
.eslintcache | ||
|
||
# next.js | ||
.next/ | ||
/out/ | ||
/.swc/ | ||
|
||
# Sentry | ||
.sentryclirc | ||
.idea | ||
src |
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,8 @@ | ||
# To install private @yuga-labs scoped packages from GitHub's package registry, | ||
# you will need to create a GitHub Personal Access Token with "read:packages" | ||
# scope and export GITHUB_TOKEN env var in your shell. Keep your token secret. | ||
@yuga-labs:registry=https://npm.pkg.github.com | ||
//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN} | ||
|
||
# Pin dependencies to exact version | ||
save-exact=true |
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 @@ | ||
v18.20.3 |
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,6 @@ | ||
module.exports = { | ||
plugins: { | ||
'postcss-import': {}, | ||
tailwindcss: {}, | ||
}, | ||
}; |
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,5 @@ | ||
/** @type {import("prettier").Config} */ | ||
module.exports = { | ||
trailingComma: 'all', | ||
singleQuote: true, | ||
}; |
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,12 @@ | ||
{ | ||
"editor.formatOnSave": true, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": "explicit" | ||
}, | ||
"eslint.validate": [ | ||
"javascript", | ||
"javascriptreact", | ||
"typescript", | ||
"typescriptreact" | ||
] | ||
} |
Oops, something went wrong.