Skip to content

Commit

Permalink
Setup pnpm (#1092)
Browse files Browse the repository at this point in the history
* chore: setup pnpm

* refactor: specify root to resolve path alias

* chore: setup pnpm on ci workflows

* refactor: remove test-bin in favor of verify-build

It adds to verify-build workflow the build-eventcatalog step where
it builds the example-default the same way test-bin with docker did.

* fix: add build cli step

* chore: update README.md to use `pnpm`

* Create odd-sloths-collect.md

---------

Co-authored-by: David Boyne <[email protected]>
  • Loading branch information
carlosallexandre and boyney123 authored Jan 14, 2025
1 parent 7a6cd10 commit 7ffbf6f
Show file tree
Hide file tree
Showing 15 changed files with 13,473 additions and 22,276 deletions.
5 changes: 5 additions & 0 deletions .changeset/odd-sloths-collect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@eventcatalog/core": patch
---

chore(core): setup pnpm on the project
8 changes: 6 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
version: 9
node-version: 20.x
cache: 'pnpm'
- name: Installation
run: pnpm i
- name: Prettier Code
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,22 @@ jobs:
with:
fetch-depth: 0

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

- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'pnpm'

- name: Install deps and build (with cache)
uses: bahmutov/npm-install@v1
- name: Install deps
run: pnpm i

- name: Create Release Pull Request or Publish to npm
uses: changesets/action@master
with:
publish: npm run release
publish: pnpm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
29 changes: 0 additions & 29 deletions .github/workflows/test-bin.yml

This file was deleted.

56 changes: 45 additions & 11 deletions .github/workflows/verify-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,55 @@ on:
- main

jobs:
build:
name: Verify Build
timeout-minutes: 30
build-cli:
name: Build cli
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'pnpm'
- name: Installation
run: pnpm i
- name: Test
run: pnpm run test:ci
- name: Build cli
run: pnpm run build:bin
- name: Package
run: pnpm pack
- name: Rename package artifact
run: mv *.tgz package.tgz # Rename to a consistent name
- name: Upload package artifact
uses: actions/upload-artifact@v4
with:
name: eventcatalog-core-package-artifact
path: package.tgz

build-eventcatalog:
name: Build EventCatalog
timeout-minutes: 10
needs: build-cli
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Installation
run: npm i
- name: Test
run: npm run test:ci
- name: Build
run: npm run verify-build:catalog
node-version: 20.x
- name: Download package artifact
uses: actions/download-artifact@v4
with:
name: eventcatalog-core-package-artifact
- name: Install @eventcatalog-core
working-directory: examples/default/
run: npm install ../../package.tgz
- name: Build EventCatalog
working-directory: examples/default/
run: npx eventcatalog build
17 changes: 0 additions & 17 deletions Dockerfile

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ You can find the [contributing guidelines here](https://eventcatalog.dev/docs/co
## Running the project locally

1. Clone the repo
1. Install required dependencies `npm run i`
1. Run the command `npm run start:catalog`
1. Install required dependencies `pnpm install`
1. Run the command `pnpm run start:catalog`
- This will start the catalog found in `/examples` repo, locally on your machine

[license-badge]: https://img.shields.io/github/license/event-catalog/eventcatalog.svg?color=yellow
Expand Down
Loading

0 comments on commit 7ffbf6f

Please sign in to comment.