Skip to content

Commit

Permalink
Meta: Migrate to pnpm.
Browse files Browse the repository at this point in the history
As it turns out bun is still slightly too incompatible to be used.
  • Loading branch information
filiphsps committed Mar 22, 2024
1 parent 99e1249 commit 156a41b
Show file tree
Hide file tree
Showing 16 changed files with 10,737 additions and 56 deletions.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
"snapshot": {
"useCalculatedVersion": true
},
"ignore": []
"ignore": ["@nordcom/nordstar-docs", "@nordcom/nordstar-storybook"]
}
14 changes: 14 additions & 0 deletions .changeset/evermore.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
"@nordcom/nordstar-accented": patch
"@nordcom/nordstar-heading": patch
"@nordcom/nordstar-button": patch
"@nordcom/nordstar-header": patch
"@nordcom/nordstar-input": patch
"@nordcom/nordstar-label": patch
"@nordcom/nordstar-card": patch
"@nordcom/nordstar-view": patch
"@nordcom/nordstar": patch
"@nordcom/nordstar-system": patch
---

Fix export.
28 changes: 8 additions & 20 deletions .github/common/install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,14 @@ runs:
git config --global user.email "[email protected]"
git config --global user.name "nordcombot"
- name: 💾 Cache
uses: actions/cache@v4
- name: 🏎️ Setup Node
uses: actions/setup-node@v4
with:
path: |
~/.bun/install/cache
${{ github.workspace }}/**/.next
${{ github.workspace }}/**/dist
${{ github.workspace }}/**/node_modules
key: ${{ runner.os }}-bun-build-${{ hashFiles('**/bun.lockb') }}-
restore-keys: |
${{ runner.os }}-bun-build-${{ hashFiles('**/bun.lockb') }}-
${{ runner.os }}-bun-build-
${{ runner.os }}-
registry-url: 'https://registry.npmjs.org/'
node-version-file: '.nvmrc'

- name: 🏎️ Setup Bun
uses: oven-sh/setup-bun@v1
- name: 🏎️ Setup pnpm
uses: pnpm/action-setup@v3
with:
bun-version: canary
no-cache: true

- name: 📦 Install dependencies
shell: bash
run: bun install
version: 8
run_install: true
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
uses: ./.github/common/install

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

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

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

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

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

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

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

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

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

- name: ✅ Typecheck
run: bun run --bun typecheck
run: pnpm run typecheck
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ jobs:
with:
token: ${{ secrets.MACHINE_USER }}
use-conventional-commits: false
commit-message: 'Deps: Update lockfile and add changeset.'
commit-message: 'Deps: Add changeset.'
author-name: nordcombot
author-email: [email protected]
16 changes: 5 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,16 @@ jobs:
- name: 📦 Install
uses: ./.github/common/install

- name: 🏎️ Setup Node
uses: actions/setup-node@v4
with:
registry-url: 'https://registry.npmjs.org/'
node-version: '21.x'

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

- name: 🤝 Create Release Pull Request or Publish to NPM
id: changesets
uses: changesets/action@v1
with:
createGithubReleases: true
version: bun run version
publish: bun run release
version: pnpm run version
publish: pnpm run release
setupGitUser: false
commit: |
Changeset: Increment package & dependecy versions.
Expand All @@ -55,5 +49,5 @@ jobs:
if: steps.changesets.outputs.published != 'true'
run: |
git checkout master
bun run version:unstable
bun run release:unstable
pnpm run version:unstable
pnpm run release:unstable
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 --bun lint-staged --allow-empty
pnpx lint-staged --allow-empty
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
21.x
Binary file removed bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"dev": "next dev",
"clean": "rm -rf dist coverage storybook-static .turbo .next *.tsbuildinfo *.log",
"start": "next start -p $PORT",
"lint": "concurrently -i bun:lint:*",
"lint": "concurrently -i pnpm:lint:*",
"lint:next": "next lint",
"lint:prettier": "prettier src/**/*.* --check"
},
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"description": "An opinionated component library for building human-centric user interfaces.",
"private": true,
"main": "index.js",
"packageManager": "[email protected]",
"engines": {
"node": "<=21"
},
Expand All @@ -18,7 +19,7 @@
],
"scripts": {
"prepare": "husky install",
"dev": "concurrently -i bun:dev:*",
"dev": "concurrently -i pnpm:dev:*",
"dev:docs": "turbo dev --filter=@nordcom/nordstar-docs",
"dev:storybook": "turbo dev --filter=@nordcom/nordstar-storybook",
"build": "turbo build",
Expand All @@ -27,20 +28,20 @@
"build:storybook": "turbo build --filter=@nordcom/nordstar-storybook",
"typecheck": "turbo typecheck",
"lint": "eslint **/*.{ts,tsx}",
"fix": "concurrently -i bun:fix:*",
"fix": "concurrently -i pnpm:fix:*",
"fix:lint": "eslint **/*.{ts,tsx} --fix",
"prettier": "prettier **/src/**/*.* --write",
"fix:prettier": "prettier **/src/**/*.* --write",
"test": "vitest run --coverage",
"clean": "concurrently -i bun:clean:*",
"clean": "concurrently -i pnpm:clean:*",
"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",
"create": "plop --plopfile ./plop/plopfile.js",
"create:component": "plop --plopfile ./plop/plopfile.js component",
"version": "changeset version",
"postversion": "bun install",
"postversion": "pnpm install",
"version:unstable": "changeset version --snapshot unstable",
"release": "changeset publish",
"release:unstable": "changeset publish --snapshot --no-git-tag --tag unstable",
Expand Down Expand Up @@ -84,7 +85,6 @@
"@typescript-eslint/parser": "7.3.1",
"@vitejs/plugin-react": "4.2.1",
"@vitest/coverage-v8": "1.4.0",
"bun-types": "1.0.33",
"concurrently": "8.2.2",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-import": "2.29.1",
Expand Down
36 changes: 30 additions & 6 deletions packages/components/accented/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,43 @@
"engines": {
"node": "<=21"
},
"files": [
"dist"
],
"prettier": "@nordcom/prettier",
"main": "./dist/index.js",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"exports": {
".": {
"import": "./dist/index.js",
"module": "./dist/index.js",
"import": [
"./src/index.ts",
"./dist/index.js"
],
"module": [
"./src/index.ts",
"./dist/index.js"
],
"require": null,
"types": [
"./src/index.ts",
"./dist/index.d.ts"
]
},
"./*": {
"import": [
"./src/*.ts",
"./dist/*.js"
],
"module": [
"./src/*.ts",
"./dist/*.js"
],
"require": null,
"types": "./dist/index.d.ts"
"types": [
"./src/*.ts",
"./dist/*.d.ts"
]
},
"./package.json": "./package.json"
},
Expand Down
Loading

0 comments on commit 156a41b

Please sign in to comment.