Skip to content

Commit

Permalink
Meta+CI: Modernize repo.
Browse files Browse the repository at this point in the history
  • Loading branch information
filiphsps committed Mar 19, 2024
1 parent 692e551 commit e7faa52
Show file tree
Hide file tree
Showing 28 changed files with 176 additions and 132 deletions.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://unpkg.com/@changesets/config@latest/schema.json",
"changelog": ["@changesets/changelog-github", { "repo": "NordcomInc/nordstar" }],
"commit": false,
"fixed": [["{,@nordcom/}nordstar{,-!(storybook|docs)*}"]],
"fixed": [["{,@nordcom/}nordstar{,-*}"]],
"linked": [],
"access": "public",
"baseBranch": "master",
Expand Down
9 changes: 8 additions & 1 deletion .github/common/install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ description: Install dependencies
runs:
using: 'composite'
steps:
- name: 💾 Cache node modules
- name: 🥸 Configure Git User
shell: bash
run: |
git config --global user.email "[email protected]"
git config --global user.name "nordcombot"
- name: 💾 Cache
uses: actions/cache@v4
with:
path: |
Expand All @@ -22,6 +28,7 @@ runs:
uses: oven-sh/setup-bun@v1
with:
bun-version: canary
no-cache: true

- name: 📦 Install dependencies
shell: bash
Expand Down
19 changes: 7 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ name: CI

on: [push, pull_request]

env:
CI: true
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}

jobs:
build:
name: 🔨 Build
Expand All @@ -21,7 +16,7 @@ jobs:
uses: ./.github/common/install

- name: 🔨 Build Everything
run: bun run build:packages
run: bun run --bun build:packages

test:
name: 🧪 Test
Expand All @@ -36,10 +31,10 @@ jobs:
uses: ./.github/common/install

- name: 🔨 Build Packages
run: bun run build:packages
run: bun run --bun build:packages

- name: 🧪 Test
run: bun run test
run: bun run --bun test

- name: 🦺 Report Coverage to GitHub
uses: davelosert/[email protected]
Expand All @@ -61,10 +56,10 @@ jobs:
uses: ./.github/common/install

- name: 🔨 Build Packages
run: bun run build:packages
run: bun run --bun build:packages

- name: 📋 Lint
run: bun run lint
run: bun run --bun lint

typecheck:
name: ✅ Typecheck
Expand All @@ -78,7 +73,7 @@ jobs:
uses: ./.github/common/install

- name: 🔨 Build Packages
run: bun run build:packages
run: bun run --bun build:packages

- name: ✅ Typecheck
run: bun run typecheck
run: bun run --bun typecheck
9 changes: 1 addition & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}

env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.MACHINE_USER }}
Expand All @@ -30,12 +28,7 @@ jobs:
uses: ./.github/common/install

- name: 🔨 Build
run: bun run build:packages

- name: 🥸 Configure Identity
run: |
git config --global user.email "[email protected]"
git config --global user.name "nordcombot"
run: bun run --bun build:packages

- name: 🤝 Create Release Pull Request or Publish to NPM
id: changesets
Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname "$0")/_/husky.sh"

bunx lint-staged --allow-empty
bunx --bun lint-staged --allow-empty
10 changes: 6 additions & 4 deletions .lintstagedrc.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ import process from 'node:process';

const ignoredFiles = [
'**/node_modules/**',
'**/dist/**',
'**/.next/**',
'**/storybook-static/**',
'**/.vitest/**',
'**/*.d.ts',
'vitest.config.ts',
'**/vite.config.ts'
'**/dist/**',
'**/storybook-static/**',
'**/vite.config.ts',
'**/vitest.config.ts',
'**/vitest.setup.ts',
'**/vitest.workspace.ts'
];

const filterIgnoredFiles = async (requestedFiles) => {
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"Filiph",
"lockb",
"Nordcom",
"nordcombot",
"nordstar",
"postbuild",
"postpack",
Expand Down
Binary file modified bun.lockb
Binary file not shown.
6 changes: 2 additions & 4 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{
"$schema": "https://json.schemastore.org/package.json",
"name": "@nordcom/nordstar-docs",
"sideEffects": [
"**/*.css*"
],
"sideEffects": false,
"private": true,
"type": "module",
"version": "0.0.41",
Expand All @@ -17,7 +15,7 @@
"scripts": {
"build": "next build",
"dev": "next dev",
"clean": "rimraf -g dist coverage storybook-static .turbo .next *.tsbuildinfo *.log",
"clean": "rm -rf dist coverage storybook-static .turbo .next *.tsbuildinfo *.log",
"start": "next start -p $PORT",
"lint": "concurrently -i bun:lint:*",
"lint:next": "next lint",
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"fix:prettier": "prettier **/src/**/*.* --write",
"test": "vitest run --coverage",
"clean": "concurrently -i bun:clean:*",
"clean:repo": "rimraf -g dist coverage storybook-static .turbo .next .tsbuildinfo *.log",
"clean:repo": "rm -rf dist coverage storybook-static .turbo .next .tsbuildinfo *.log",
"clean:packages": "turbo clean --filter=!@nordcom/nordstar-docs --filter=!@nordcom/nordstar-storybook",
"clean:docs": "turbo clean --filter=@nordcom/nordstar-docs",
"clean:storybook": "turbo clean --filter=@nordcom/nordstar-storybook",
Expand Down Expand Up @@ -106,7 +106,6 @@
"prettier": "3.2.5",
"react-dom": "18.2.0",
"react": "18.2.0",
"rimraf": "5.0.5",
"sass": "1.72.0",
"turbo": "1.12.5",
"typescript": "5.4.2",
Expand Down
14 changes: 9 additions & 5 deletions packages/components/accented/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,11 @@
"./package.json": "./package.json"
}
},
"sideEffects": [
"**/*.css*"
],
"sideEffects": false,
"scripts": {
"build": "tsc && vite build",
"dev": "vite build --watch",
"clean": "rimraf -g dist coverage storybook-static .turbo .next *.tsbuildinfo *.log",
"clean": "rm -rf dist coverage storybook-static .turbo .next *.tsbuildinfo *.log",
"typecheck": "tsc --noEmit"
},
"keywords": [
Expand Down Expand Up @@ -87,7 +85,13 @@
},
"devDependencies": {
"@nordcom/prettier": "0.1.1",
"@types/node": "20.11.27",
"@types/react-dom": "18.2.22",
"@types/react": "18.2.67",
"prettier": "3.2.5",
"react": "18.2.0"
"react-dom": "18.2.0",
"react": "18.2.0",
"typescript": "5.4.2",
"vite": "5.1.6"
}
}
14 changes: 9 additions & 5 deletions packages/components/button/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,11 @@
"publishConfig": {
"access": "public"
},
"sideEffects": [
"**/*.css*"
],
"sideEffects": false,
"scripts": {
"build": "tsc && vite build",
"dev": "vite build --watch",
"clean": "rimraf -g dist coverage storybook-static .turbo .next *.tsbuildinfo *.log",
"clean": "rm -rf dist coverage storybook-static .turbo .next *.tsbuildinfo *.log",
"typecheck": "tsc --noEmit"
},
"keywords": [
Expand Down Expand Up @@ -95,7 +93,13 @@
},
"devDependencies": {
"@nordcom/prettier": "0.1.1",
"@types/node": "20.11.27",
"@types/react-dom": "18.2.22",
"@types/react": "18.2.67",
"prettier": "3.2.5",
"react": "18.2.0"
"react-dom": "18.2.0",
"react": "18.2.0",
"typescript": "5.4.2",
"vite": "5.1.6"
}
}
14 changes: 9 additions & 5 deletions packages/components/card/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,11 @@
"./package.json": "./package.json"
}
},
"sideEffects": [
"**/*.css*"
],
"sideEffects": false,
"scripts": {
"build": "tsc && vite build",
"dev": "vite build --watch",
"clean": "rimraf -g dist coverage storybook-static .turbo .next *.tsbuildinfo *.log",
"clean": "rm -rf dist coverage storybook-static .turbo .next *.tsbuildinfo *.log",
"typecheck": "tsc --noEmit"
},
"keywords": [
Expand Down Expand Up @@ -84,7 +82,13 @@
},
"devDependencies": {
"@nordcom/prettier": "0.1.1",
"@types/node": "20.11.27",
"@types/react-dom": "18.2.22",
"@types/react": "18.2.67",
"prettier": "3.2.5",
"react": "18.2.0"
"react-dom": "18.2.0",
"react": "18.2.0",
"typescript": "5.4.2",
"vite": "5.1.6"
}
}
14 changes: 9 additions & 5 deletions packages/components/header/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,11 @@
"publishConfig": {
"access": "public"
},
"sideEffects": [
"**/*.css*"
],
"sideEffects": false,
"scripts": {
"build": "tsc && vite build",
"dev": "vite build --watch",
"clean": "rimraf -g dist coverage storybook-static .turbo .next *.tsbuildinfo *.log",
"clean": "rm -rf dist coverage storybook-static .turbo .next *.tsbuildinfo *.log",
"typecheck": "tsc --noEmit"
},
"keywords": [
Expand Down Expand Up @@ -96,7 +94,13 @@
},
"devDependencies": {
"@nordcom/prettier": "0.1.1",
"@types/node": "20.11.27",
"@types/react-dom": "18.2.22",
"@types/react": "18.2.67",
"prettier": "3.2.5",
"react": "18.2.0"
"react-dom": "18.2.0",
"react": "18.2.0",
"typescript": "5.4.2",
"vite": "5.1.6"
}
}
14 changes: 9 additions & 5 deletions packages/components/heading/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,11 @@
"publishConfig": {
"access": "public"
},
"sideEffects": [
"**/*.css*"
],
"sideEffects": false,
"scripts": {
"build": "tsc && vite build",
"dev": "vite build --watch",
"clean": "rimraf -g dist coverage storybook-static .turbo .next *.tsbuildinfo *.log",
"clean": "rm -rf dist coverage storybook-static .turbo .next *.tsbuildinfo *.log",
"typecheck": "tsc --noEmit"
},
"keywords": [
Expand Down Expand Up @@ -95,7 +93,13 @@
},
"devDependencies": {
"@nordcom/prettier": "0.1.1",
"@types/node": "20.11.27",
"@types/react-dom": "18.2.22",
"@types/react": "18.2.67",
"prettier": "3.2.5",
"react": "18.2.0"
"react-dom": "18.2.0",
"react": "18.2.0",
"typescript": "5.4.2",
"vite": "5.1.6"
}
}
14 changes: 9 additions & 5 deletions packages/components/input/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,11 @@
"publishConfig": {
"access": "public"
},
"sideEffects": [
"**/*.css*"
],
"sideEffects": false,
"scripts": {
"build": "tsc && vite build",
"dev": "vite build --watch",
"clean": "rimraf -g dist coverage storybook-static .turbo .next *.tsbuildinfo *.log",
"clean": "rm -rf dist coverage storybook-static .turbo .next *.tsbuildinfo *.log",
"typecheck": "tsc --noEmit"
},
"keywords": [
Expand Down Expand Up @@ -94,7 +92,13 @@
},
"devDependencies": {
"@nordcom/prettier": "0.1.1",
"@types/node": "20.11.27",
"@types/react-dom": "18.2.22",
"@types/react": "18.2.67",
"prettier": "3.2.5",
"react": "18.2.0"
"react-dom": "18.2.0",
"react": "18.2.0",
"typescript": "5.4.2",
"vite": "5.1.6"
}
}
14 changes: 9 additions & 5 deletions packages/components/label/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,11 @@
"publishConfig": {
"access": "public"
},
"sideEffects": [
"**/*.css*"
],
"sideEffects": false,
"scripts": {
"build": "tsc && vite build",
"dev": "vite build --watch",
"clean": "rimraf -g dist coverage storybook-static .turbo .next *.tsbuildinfo *.log",
"clean": "rm -rf dist coverage storybook-static .turbo .next *.tsbuildinfo *.log",
"typecheck": "tsc --noEmit"
},
"keywords": [
Expand Down Expand Up @@ -95,7 +93,13 @@
},
"devDependencies": {
"@nordcom/prettier": "0.1.1",
"@types/node": "20.11.27",
"@types/react-dom": "18.2.22",
"@types/react": "18.2.67",
"prettier": "3.2.5",
"react": "18.2.0"
"react-dom": "18.2.0",
"react": "18.2.0",
"typescript": "5.4.2",
"vite": "5.1.6"
}
}
Loading

0 comments on commit e7faa52

Please sign in to comment.