Skip to content

Commit

Permalink
Bundle to both ESM and CJS (#118)
Browse files Browse the repository at this point in the history
This adds `tsup` as a dev dependency
to bundle for both ESM and CJS targets.
This also adds full CI/CD automation
for easier publish process and changelog
managment using `@changesets/cli`.
  • Loading branch information
blomqma authored Jan 9, 2024
1 parent e97bb88 commit 9a5e657
Show file tree
Hide file tree
Showing 37 changed files with 4,043 additions and 2,888 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@ name: "CI"

on:
push:
branches: [main]
pull_request:
branches:
- "**"

jobs:
build:
name: "Run CI pipeline"
runs-on: ubuntu-latest
strategy:
matrix:
node: [18]
node: [18, 20]
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2.2.4
- uses: pnpm/action-setup@v2
with:
version: 7.5.1
version: 7
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: "pnpm"
- run: pnpm i
- run: pnpm i --frozen-lockfile
- run: pnpm run ci

- name: Coverage
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: "Publish"

on:
workflow_run:
workflows: [CI]
branches: [main]
types: [completed]

concurrency: ${{ github.workflow }}-${{ github.ref }}

permissions:
contents: write
pull-requests: write

jobs:
publish:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 7
- uses: actions/setup-node@v3
with:
node-version: 20.x
cache: "pnpm"

- run: pnpm install --frozen-lockfile
- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
with:
publish: pnpm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
auto-install-peers=true
Loading

2 comments on commit 9a5e657

@vercel
Copy link

@vercel vercel bot commented on 9a5e657 Jan 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

next-rest-framework-demo – ./apps/example

next-rest-framework-demo-blomqma.vercel.app
next-rest-framework-demo-git-main-blomqma.vercel.app
next-rest-framework-demo.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 9a5e657 Jan 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

next-rest-framework – ./docs

next-rest-framework.vercel.app
next-rest-framework-git-main-blomqma.vercel.app
next-rest-framework-blomqma.vercel.app

Please sign in to comment.