Skip to content

Commit

Permalink
🩱 [Monorepo] Overhaul project to support monorepo design (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
beefchimi authored Jan 20, 2024
1 parent 7223805 commit ef66a1b
Show file tree
Hide file tree
Showing 202 changed files with 11,901 additions and 8,305 deletions.
4 changes: 2 additions & 2 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json",
"changelog": "@changesets/cli/changelog",
"$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
"changelog": ["@changesets/changelog-github", {"repo": "beefchimi/earwurm"}],
"commit": false,
"fixed": [],
"linked": [],
Expand Down
5 changes: 5 additions & 0 deletions .changeset/twelve-deers-allow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"earwurm": minor
---

Refactor codebase into a monorepo.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.nx/cache
node_modules/
coverage/
dist/
Expand Down
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"project": "./tsconfig.json"
},
"rules": {
"no-console": "warn",
"no-console": "error",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/strict-boolean-expressions": "off"
}
Expand Down
7 changes: 6 additions & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
🧰 Dependency:
- changed-files:
- any-glob-to-any-file: 'package-lock.json'
- any-glob-to-any-file: 'pnpm-lock.yaml'

📚 Documentation:
- changed-files:
Expand All @@ -27,12 +27,17 @@
'.editorconfig',
'.eslintignore',
'.eslintrc',
'.eslintrc.cjs',
'.gitignore',
'.npmignore',
'.nvmrc',
'.prettierignore',
'.prettierrc',
'config/**',
'package.json',
'tsconfig.json',
'tsconfig.*.json',
'vite.config.ts',
'**/*/env.d.ts',
'**/*/lightningcss-plugins.ts',
]
56 changes: 56 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: 🧑‍🚀 Deploy website

# Adding `workflow_dispatch` allows us to run this
# workflow manually from the Actions tab.
on:
push:
branches:
- main
workflow_dispatch:

# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages.
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment.
concurrency:
group: 'pages'
cancel-in-progress: true

# This workflow is adapted from:
# https://vitejs.dev/guide/static-deploy.html#github-pages
jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: 🗳️ Checkout Repo
uses: actions/checkout@v4

- name: 🔧 Setup Node 20.x
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'pnpm'

- name: 📦 Install dependencies
run: pnpm i

- name: 🏗️ Build projects
run: pnpm build

- name: 📄 Configure Pages
uses: actions/configure-pages@v4

- name: 📈 Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './app/website/dist'

- name: 📱 Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
6 changes: 3 additions & 3 deletions .github/workflows/labels.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: PR Labels
name: 🗃️ PR Labels
on: [pull_request_target]

jobs:
Expand All @@ -10,10 +10,10 @@ jobs:
pull-requests: write

steps:
- name: Checkout repo
- name: 🗳️ Checkout repo
uses: actions/checkout@v4

- name: Apply PR labels
- name: 🍭 Apply PR labels
uses: actions/labeler@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
26 changes: 16 additions & 10 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Lint
name: 🤖 Lint
on: [push]

jobs:
Expand All @@ -7,20 +7,26 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
- name: 🗳️ Checkout repo
uses: actions/checkout@v4

- name: Setup Node 20.x to install with private scope
- name: 🧰 Configure PNPM
uses: pnpm/action-setup@v2

- name: 🔧 Setup Node 20.x
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
cache: 'pnpm'

- name: 📦 Install dependencies
run: pnpm i

- name: Install dependencies
run: npm ci
- name: 🎨 Lint
run: pnpm lint

- name: Lint
run: npm run lint
- name: 💄 Prettier
run: pnpm format

- name: Prettier
run: npm run format
- name: 🕵️ Type check
run: pnpm type-check
27 changes: 18 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release
name: 🚀 Release

on:
push:
Expand All @@ -7,28 +7,37 @@ on:

jobs:
release:
name: Release
name: Version and release monorepo packages
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
- name: 🗳️ Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node 20.x to install with private scope
- name: 🧰 Configure PNPM
uses: pnpm/action-setup@v2

- name: 🔧 Setup Node 20.x
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
cache: 'pnpm'

- name: 📦 Install dependencies
run: pnpm i

- name: Install dependencies
run: npm ci
- name: 🏗️ Build projects
run: pnpm build

- name: Create PR or publish to NPM
- name: 📣 Create PR or publish to NPM
id: changesets
uses: changesets/action@v1
with:
publish: npm run release
title: '🦋 [Release] Version packages'
commit: '🦋 [Changesets] Prepare for next release'
version: pnpm release:version
publish: pnpm release:publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
19 changes: 11 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test
name: 🧪 Test
on: [push]

jobs:
Expand All @@ -7,17 +7,20 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
- name: 🗳️ Checkout repo
uses: actions/checkout@v4

- name: Setup Node 20.x to install with private scope
- name: 🧰 Configure PNPM
uses: pnpm/action-setup@v2

- name: 🔧 Setup Node 20.x
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
cache: 'pnpm'

- name: Install dependencies
run: npm ci
- name: 📦 Install dependencies
run: pnpm i

- name: Test
run: npm run test
- name: 🧑‍🔬 Test
run: pnpm test
18 changes: 15 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,19 @@ Temporary Items
.eslintcache
.sass-cache
*.tsbuildinfo
.nx/cache

# Code editor
.vscode/*
!.vscode/extensions.json
!.vscode/settings.json
!.vscode/tasks.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

# Build
build
Expand All @@ -34,8 +47,7 @@ storybook-static

# Environment
.env
.env.test
.env.production
.env.*

# Vite
*.local
Expand Down Expand Up @@ -77,7 +89,7 @@ pids
.npm
.yarn-integrity
node_modules
web_modules/
web_modules

# Output of 'npm pack'
*.tgz
Expand Down
Loading

0 comments on commit ef66a1b

Please sign in to comment.