Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: version 2 #429

Merged
merged 23 commits into from
Sep 4, 2023
Merged
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
8 changes: 8 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const { extendEslint } = require("@kodingdotninja/style-guide");

module.exports = extendEslint(["node"], {
rules: {
"import/no-default-export": ["off"],
},
root: true,
});
14 changes: 1 addition & 13 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1 @@
# These are supported funding model platforms

github: [r17x, grikomsn]# Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
github: [grikomsn, r17x]
17 changes: 17 additions & 0 deletions .github/actions/quickstart/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Quickstart Setup
description: Setup git user, Node.js, and pnpm cache

runs:
using: composite
steps:
- shell: bash
run: git config user.email "[email protected]" && git config user.name "kdnjbot"
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
with:
cache: pnpm
node-version-file: ".nvmrc"
- shell: bash
run: pnpm install
31 changes: 0 additions & 31 deletions .github/actions/setup-node/action.yml

This file was deleted.

5 changes: 2 additions & 3 deletions .github/scripts/sync-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
changes=$(git diff-index --name-only HEAD --)
echo "Checking... modified snapshot.json in @chakra-icons/*"

for maybe_snapshot in $changes
do
for maybe_snapshot in $changes; do
file_name=$(basename $maybe_snapshot)
if [ $file_name = "snapshot.json" ]; then
scope=$(basename $(dirname $maybe_snapshot))
Expand All @@ -19,7 +18,7 @@ echo "Total Snapshot changes:" $(git rev-list --count HEAD ^origin/main)

echo "Clean git stage"

git checkout .
git checkout .
git clean -fd .

exit 0
23 changes: 8 additions & 15 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: CI

on:
on:
pull_request:
branches: [main, beta]
types: [opened, synchronize]
Expand All @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-node
- uses: ./.github/actions/quickstart
- uses: wagoid/commitlint-github-action@v5
env:
NODE_PATH: ${{ github.workspace }}/node_modules
Expand All @@ -20,21 +20,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-node

- name: validate (lint)
run: |
yarn lint --no-deps --scope="@chakra-icons/*" --scope="create-*" --parallel
- uses: ./.github/actions/quickstart
- run: pnpm --filter="@chakra-icons/*" --filter="create-*" run lint

test:
needs: init
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-node

- name: run test
run: yarn test
- uses: ./.github/actions/quickstart
- run: pnpm run test

build:
env:
Expand All @@ -43,7 +38,5 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-node

- name: build project
run: yarn build
- uses: ./.github/actions/quickstart
- run: pnpm run build
61 changes: 16 additions & 45 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,81 +6,52 @@ on:

jobs:
init:
# To use Turborepo Remote Caching, set the following environment variables for the job.
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-node
- uses: ./.github/actions/quickstart
- uses: wagoid/commitlint-github-action@v5
env:
NODE_PATH: ${{ github.workspace }}/node_modules

validate:
# To use Turborepo Remote Caching, set the following environment variables for the job.
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
needs: init
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-node

- name: validate (lint)
# website exclude here cause depends on build, so lint in buil stage
run: |
yarn lint --no-deps --scope="@chakra-icons/*" --scope="create-*" --parallel
- uses: ./.github/actions/quickstart
- run: pnpm --filter="@chakra-icons/*" --filter="create-*" run lint

test:
# To use Turborepo Remote Caching, set the following environment variables for the job.
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
needs: init
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-node

- name: run test
run: yarn test
- uses: ./.github/actions/quickstart
- run: pnpm run test

build:
# To use Turborepo Remote Caching, set the following environment variables for the job.
env:
NODE_OPTIONS: --max_old_space_size=8192 # handle OOM
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
NODE_OPTIONS: --max_old_space_size=8192
needs: init
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-node

- name: build project
run: yarn build
- uses: ./.github/actions/quickstart
- run: pnpm run build

release:
# To use Turborepo Remote Caching, set the following environment variables for the job.
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
needs: [validate, test, build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-node

- name: release project
env:
- uses: ./.github/actions/quickstart
- env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GH_USER: 'kdnjbot'
GH_USER: "kdnjbot"
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GIT_AUTHOR_EMAIL: '[email protected]'
GIT_COMMITTER_EMAIL: '[email protected]'
GIT_AUTHOR_NAME: '@kdnjbot'
GIT_COMMITTER_NAME: '@kdnjbot'
run: yarn release
GIT_AUTHOR_EMAIL: "[email protected]"
GIT_COMMITTER_EMAIL: "[email protected]"
GIT_AUTHOR_NAME: "@kdnjbot"
GIT_COMMITTER_NAME: "@kdnjbot"
run: pnpm run release
31 changes: 6 additions & 25 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Sync

on:
on:
schedule:
# run job every week on sunday at 23:59 PM
- cron: 59 23 * * 0
Expand All @@ -12,31 +12,12 @@ jobs:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GH_TOKEN }}

- uses: actions/setup-node@v3
with:
cache: yarn
node-version: '16'

- name: Setup git user to "kdnjbot"
shell: bash
run: git config user.email "[email protected]" && git config user.name "kdnjbot"

- name: install dependencies
shell: bash
run: yarn --frozen-lockfile --no-progress --non-interactive --prefer-offline

- name: build all packages
- uses: ./.github/actions/quickstart
- run: pnpm run build
env:
NODE_OPTIONS: --max_old_space_size=8192 # handle OOM
shell: bash
run: yarn build --force

- name: create commit when changed snapshot.json in @chakra-icons/*
run: ./.github/scripts/sync-snapshot

- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
NODE_OPTIONS: --max_old_space_size=8192
- run: ./.github/scripts/sync-snapshot
- uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GH_TOKEN }}
branch: "sync-icons"
Expand Down
55 changes: 6 additions & 49 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,59 +1,16 @@
*.lcov
*.log
*.pid
*.pid.lock
*.seed
*.tgz
*.tsbuildinfo
.cache
.cache/
.chakraIcons
.direnv
.DS_Store
.env*
.envrc
.eslintcache
.next
.npm
.pnp.*
.tern-port
.vscode-test
.yarn-integrity
.yarn/build-state.yml
.yarn/cache
.yarn/install-state.gz
.yarn/unplugged
build/Release
coverage/
dist/
logs
node_modules/
out/
pids
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
### gitignore
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

tooling/cli/dist/index.bin.js

!**/.gitkeep
grikomsn marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn commitlint --edit $1
pnpm commitlint --edit $1
4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

23 changes: 0 additions & 23 deletions .kodiak.toml

This file was deleted.

2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
public-hoist-pattern[]=*
enable-pre-post-scripts=true
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.*
18
Loading