Skip to content
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
5 changes: 5 additions & 0 deletions .changeset/ninety-eggs-hide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"open-source-stack": minor
---

We have migrated the open-source-stack to use pnpm workspaces with changesets instead of the old npm approach with npm workspaces.
15 changes: 10 additions & 5 deletions .github/workflows/publish-commit.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: 🚀 pkg-pr-new
on: [push, pull_request]

concurrency:
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -9,16 +12,18 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Install pnpm
uses: pnpm/action-setup@v4

- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
node-version-file: "package.json"

- name: Install dependencies
run: npm install
run: pnpm install

- name: Build
run: npm run build
run: pnpm run build

- run: npx pkg-pr-new publish
- run: npx pkg-pr-new publish ./packages/*
46 changes: 34 additions & 12 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,40 @@
name: Publish Package to npmjs
name: Release

on:
release:
types: [published]
push:
branches:
- main

jobs:
npm-publish:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v4
- name: Checkout Repo
uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
- run: npm ci
- run: npm publish
node-version-file: "package.json"

- name: Install Dependencies
run: pnpm install

# - name: 🔐 Setup npm auth
# run: |
# echo "registry=https://registry.npmjs.org" >> ~/.npmrc
# echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
with:
version: pnpm run version
publish: pnpm run release
23 changes: 9 additions & 14 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,18 @@ jobs:

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

- name: Install pnpm
uses: pnpm/action-setup@v4
- name: ⎔ Setup node
uses: actions/setup-node@v4
with:
node-version-file: "package.json"

- name: 📥 Download deps
uses: bahmutov/npm-install@v1
with:
useLockFile: false
run: pnpm install

- name: 🔎 Type check
run: npm run typecheck
run: pnpm run typecheck

vitest:
name: ⚡ Unit Tests
Expand All @@ -54,20 +53,16 @@ jobs:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: ⎔ Setup node
uses: actions/setup-node@v4
with:
node-version-file: "package.json"

- name: 📥 Download deps
uses: bahmutov/npm-install@v1
with:
useLockFile: false
run: pnpm install

- name: ⚡ Run vitest
run: npm run test:cov

- name: "Report Coverage"
# Only works if you set `reportOnFailure: true` in your vite config as specified above
if: always()
uses: davelosert/vitest-coverage-report-action@v2
run: pnpm run test:cov
6 changes: 3 additions & 3 deletions lefthook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ pre-commit:
parallel: true
commands:
check:
run: npm run check -- --staged --fix --no-errors-on-unmatched
run: pnpm run check -- --staged --fix --no-errors-on-unmatched
stage_fixed: true
typecheck:
run: npm run typecheck
run: pnpm run typecheck
test:
run: npm run test
run: pnpm run test
Loading