Skip to content

Commit

Permalink
Release v0.2.21
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanDJackson committed Oct 22, 2024
1 parent da96467 commit 5b63594
Show file tree
Hide file tree
Showing 141 changed files with 37,581 additions and 2 deletions.
52 changes: 52 additions & 0 deletions .eslintrc.cjs
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)$',
},
],
},
};
14 changes: 14 additions & 0 deletions .github/CODEOWNERS
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
91 changes: 91 additions & 0 deletions .github/workflows/ci.yml
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
56 changes: 56 additions & 0 deletions .github/workflows/publish.yaml
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
46 changes: 46 additions & 0 deletions .gitignore
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
8 changes: 8 additions & 0 deletions .npmrc
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
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18.20.3
6 changes: 6 additions & 0 deletions .postcssrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
plugins: {
'postcss-import': {},
tailwindcss: {},
},
};
5 changes: 5 additions & 0 deletions .prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/** @type {import("prettier").Config} */
module.exports = {
trailingComma: 'all',
singleQuote: true,
};
12 changes: 12 additions & 0 deletions .vscode/settings.json
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"
]
}
Loading

0 comments on commit 5b63594

Please sign in to comment.