Skip to content

Commit

Permalink
chore: Upgrade to pnpm 9, add conventional commit PR title linting (#…
Browse files Browse the repository at this point in the history
…5598)

* chore: Upgrde pnpm engine & corepack version

* chore: Use workspace protocol

* chore: Upgrade lockfile

* chore: Use consistent version for @novu/novui

* build: Add convention commit PR title linter workflow

* test: PR title lint workflow

* fix: copy

* test: action

* test: wf

* fix: add missing id

* fix: workflow

* fix: wf

* fix: scopes

* test: logging

* fix: checkout code

* fix: command

* fix: pnpm

* fix: action

* fix: scopes

* fix: redudnancy

* fix: review action

* fix: add release version

* fix: spelling

* revert: test

* chore: release

* feat: add from package script

* Revert "chore: release"

This reverts commit 9696a96.

* refactor: Remove redundant pnpm version from gh actions

* chore: Upgrade all Dockerfile pnpm versions

* chore: auto commit

* chore: auto commit

* chore: auto commit

* chore: update publish and release scripts

* chore: remove dry-run flag from publish command

* ci: remove duplicate pull_request trigger

* ci: update workflow to trigger on pull request actions

---------

Co-authored-by: Dima Grossman <[email protected]>
  • Loading branch information
rifont and scopsy authored May 20, 2024
1 parent 8134535 commit 898ca79
Show file tree
Hide file tree
Showing 52 changed files with 41,339 additions and 36,484 deletions.
2 changes: 2 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,8 @@
"automerge",
"novui",
"tsup",
"marocchino",
"amannn",
"pandabox"
],
"flagWords": [],
Expand Down
4 changes: 3 additions & 1 deletion .github/actions/setup-project/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ runs:
- name: ⚙️ Setup kernel for react native, increase watchers
shell: bash
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
- uses: pnpm/action-setup@v2

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

- uses: actions/setup-node@v3
name: ⚙️ Setup Node Version
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/community-releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 8.9.0

- name: Use Node.js
uses: actions/setup-node@v4
with:
Expand Down
70 changes: 70 additions & 0 deletions .github/workflows/conventional-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: "Lint PR title"

on:
pull_request_target:
types:
- opened
- edited
- synchronize
pull_request:
types:
- opened
- edited
- synchronize

permissions:
pull-requests: write

jobs:
main:
name: Validate PR titles
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

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

- name: Generate scopes
id: generate_scopes
run: |
scopes=$(pnpm m ls --json --depth=-1 | grep "name" | cut -d":" -f2 | grep "@novu" | cut -d"/" -f2 | grep "\"" | cut -d"\"" -f1)
echo 'SCOPES<<EOF' >> $GITHUB_ENV
echo "$scopes" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- uses: amannn/action-semantic-pull-request@v5
id: lint_pr_title
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
scopes: |
${{ env.SCOPES }}
- uses: marocchino/sticky-pull-request-comment@v2
# When the previous steps fails, the workflow would stop. By adding this
# condition you can continue the execution with the populated error message.
if: always() && (steps.lint_pr_title.outputs.error_message != null)
with:
header: pr-title-lint-error
message: |
Hey there and thank you for opening this pull request! 👋
We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted.
Your PR title is: `${{ github.event.pull_request.title }}`
It should be something like: `feat(scope): Add fancy new feature`
Details:
```
${{ steps.lint_pr_title.outputs.error_message }}
```
# Delete a previous comment when the issue has been resolved
- if: ${{ steps.lint_pr_title.outputs.error_message == null }}
uses: marocchino/sticky-pull-request-comment@v2
with:
header: pr-title-lint-error
delete: true
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: 'Checkout Repository'
uses: actions/checkout@v3
- name: 'Dependency Review'
uses: actions/dependency-review-action@v3
uses: actions/dependency-review-action@v4

spellcheck:
name: Spell check
Expand Down
2 changes: 1 addition & 1 deletion .gitpod.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM gitpod/workspace-mongodb

RUN sudo apt-get update && sudo apt-get install -y redis-server && sudo rm -rf /var/lib/apt/lists/*
RUN npm install -g pnpm@8.9.0
RUN npm install -g pnpm@9.1.1
2 changes: 1 addition & 1 deletion .source
2 changes: 1 addition & 1 deletion apps/api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ RUN apk add g++ make py3-pip
ENV NX_DAEMON=false

RUN npm i pm2 -g
RUN npm --no-update-notifier --no-fund --global install pnpm@8.9.0
RUN npm --no-update-notifier --no-fund --global install pnpm@9.1.1
RUN pnpm --version

USER 1000
Expand Down
24 changes: 12 additions & 12 deletions apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@
"@nestjs/swagger": "^7.1.8",
"@nestjs/terminus": "^10.0.1",
"@nestjs/throttler": "^5.0.1",
"@novu/application-generic": "^0.24.2",
"@novu/dal": "^0.24.2",
"@novu/echo": "^0.0.1-alpha.25",
"@novu/node": "^0.24.2",
"@novu/shared": "^0.24.2",
"@novu/stateless": "^0.24.2",
"@novu/testing": "^0.24.2",
"@novu/application-generic": "workspace:",
"@novu/dal": "workspace:",
"@novu/echo": "workspace:",
"@novu/node": "workspace:",
"@novu/shared": "workspace:",
"@novu/stateless": "workspace:",
"@novu/testing": "workspace:",
"@sendgrid/mail": "^8.1.0",
"@sentry/hub": "^7.40.0",
"@sentry/node": "^7.40.0",
Expand Down Expand Up @@ -119,11 +119,11 @@
"typescript": "4.9.5"
},
"optionalDependencies": {
"@novu/ee-auth": "^0.24.2",
"@novu/ee-billing": "^0.24.2",
"@novu/ee-echo-api": "^0.24.2",
"@novu/ee-shared-services": "^0.24.2",
"@novu/ee-translation": "^0.24.2"
"@novu/ee-auth": "workspace:",
"@novu/ee-billing": "workspace:",
"@novu/ee-echo-api": "workspace:",
"@novu/ee-shared-services": "workspace:",
"@novu/ee-translation": "workspace:"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
Expand Down
2 changes: 1 addition & 1 deletion apps/inbound-mail/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ RUN apk add g++ make py3-pip
ENV NX_DAEMON=false

RUN npm i pm2 -g
RUN npm --no-update-notifier --no-fund --global install pnpm@8.9.0
RUN npm --no-update-notifier --no-fund --global install pnpm@9.1.1
RUN pnpm --version

USER 1000
Expand Down
6 changes: 3 additions & 3 deletions apps/inbound-mail/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"test": "cross-env TS_NODE_COMPILER_OPTIONS='{\"strictNullChecks\": false}' TZ=UTC NODE_ENV=test E2E_RUNNER=true mocha --trace-warnings --timeout 10000 --require ts-node/register --exit --file e2e/setup.ts src/**/**/*.spec.ts"
},
"dependencies": {
"@novu/application-generic": "^0.24.2",
"@novu/shared": "^0.24.2",
"@novu/application-generic": "workspace:",
"@novu/shared": "workspace:",
"@sentry/node": "^7.12.1",
"bluebird": "^2.9.30",
"dotenv": "^8.6.0",
Expand All @@ -39,7 +39,7 @@
"winston": "^3.9.0"
},
"devDependencies": {
"@novu/testing": "^0.24.2",
"@novu/testing": "workspace:",
"@types/chai": "^4.2.11",
"@types/express": "^4.17.8",
"@types/html-to-text": "^9.0.1",
Expand Down
4 changes: 2 additions & 2 deletions apps/web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ WORKDIR /usr/src/app


RUN apk add --no-cache bash
RUN npm install -g pnpm@8.9.0 --loglevel notice
RUN npm install -g pnpm@9.1.1 --loglevel notice

COPY .npmrc .
COPY package.json .
Expand Down Expand Up @@ -37,7 +37,7 @@ RUN NX_DAEMON=false pnpm build:web
FROM node:20-alpine

RUN apk add --no-cache bash
RUN npm install -g pnpm@8.9.0 http-server --loglevel notice
RUN npm install -g pnpm@9.1.1 http-server --loglevel notice

USER 1000
WORKDIR /app
Expand Down
20 changes: 10 additions & 10 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@
"@mantine/prism": "^5.7.1",
"@mantine/spotlight": "^5.7.1",
"@monaco-editor/react": "^4.6.0",
"@novu/design-system": "^0.24.2",
"@novu/notification-center": "^0.24.2",
"@novu/novui": "^0.0.1",
"@novu/shared": "^0.24.1",
"@novu/shared-web": "^0.24.1",
"@novu/design-system": "workspace:",
"@novu/notification-center": "workspace:",
"@novu/novui": "workspace:",
"@novu/shared": "workspace:",
"@novu/shared-web": "workspace:",
"@rive-app/react-canvas": "^4.8.1",
"@segment/analytics-next": "^1.48.0",
"@sentry/react": "^7.40.0",
Expand Down Expand Up @@ -132,18 +132,18 @@
"zod": "^3.22.4"
},
"optionalDependencies": {
"@novu/ee-billing-web": "^0.24.2",
"@novu/ee-echo-web": "^0.24.2",
"@novu/ee-translation-web": "^0.24.2"
"@novu/ee-billing-web": "workspace:",
"@novu/ee-echo-web": "workspace:",
"@novu/ee-translation-web": "workspace:"
},
"devDependencies": {
"@babel/polyfill": "^7.12.1",
"@babel/preset-env": "^7.23.2",
"@babel/preset-react": "^7.13.13",
"@babel/preset-typescript": "^7.13.0",
"@babel/runtime": "^7.20.13",
"@novu/dal": "^0.24.2",
"@novu/testing": "^0.24.2",
"@novu/dal": "workspace:",
"@novu/testing": "workspace:",
"@pandacss/dev": "^0.38.0",
"@pandacss/studio": "^0.38.0",
"@playwright/test": "^1.42.1",
Expand Down
2 changes: 1 addition & 1 deletion apps/webhook/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ RUN apk add g++ make py3-pip
ENV NX_DAEMON=false

RUN npm i pm2 -g
RUN npm --no-update-notifier --no-fund --global install pnpm@8.9.0
RUN npm --no-update-notifier --no-fund --global install pnpm@9.1.1
RUN pnpm --version

USER 1000
Expand Down
10 changes: 5 additions & 5 deletions apps/webhook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
"@nestjs/core": "^10.2.2",
"@nestjs/platform-express": "^10.2.2",
"@nestjs/terminus": "^10.0.1",
"@novu/application-generic": "^0.24.2",
"@novu/dal": "^0.24.2",
"@novu/shared": "^0.24.2",
"@novu/stateless": "^0.24.2",
"@novu/testing": "^0.24.2",
"@novu/application-generic": "workspace:",
"@novu/dal": "workspace:",
"@novu/shared": "workspace:",
"@novu/stateless": "workspace:",
"@novu/testing": "workspace:",
"@sentry/node": "^7.66.0",
"axios": "^1.6.2",
"class-transformer": "^0.5.1",
Expand Down
2 changes: 1 addition & 1 deletion apps/widget/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM node:20-alpine3.19
ENV NX_DAEMON=false

RUN apk add --no-cache bash g++ make py3-pip
RUN npm install -g pnpm@8.9.0 --loglevel notice
RUN npm install -g pnpm@9.1.1 --loglevel notice

USER 1000
WORKDIR /usr/src/app
Expand Down
8 changes: 4 additions & 4 deletions apps/widget/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
"@emotion/styled": "^11.6.0",
"@mantine/core": "4.2.12",
"@mantine/hooks": "4.2.12",
"@novu/notification-center": "^0.24.2",
"@novu/shared": "^0.24.2",
"@novu/notification-center": "workspace:",
"@novu/shared": "workspace:",
"antd": "^4.10.0",
"babel-plugin-import": "^1.13.3",
"chroma-js": "^2.4.2",
Expand Down Expand Up @@ -63,8 +63,8 @@
"@emotion/react": "^11.7.1",
"@emotion/styled": "^11.6.0",
"@faker-js/faker": "^6.0.0",
"@novu/dal": "^0.24.2",
"@novu/testing": "^0.24.2",
"@novu/dal": "workspace:",
"@novu/testing": "workspace:",
"@types/jest": "^29.5.0",
"@types/node": "^12.0.0",
"@types/react": "^17.0.0",
Expand Down
2 changes: 1 addition & 1 deletion apps/worker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ RUN apk --update --no-cache add curl g++ make py3-pip
ENV NX_DAEMON=false

RUN npm i pm2 -g
RUN npm --no-update-notifier --no-fund --global install pnpm@8.9.0
RUN npm --no-update-notifier --no-fund --global install pnpm@9.1.1
RUN pnpm --version

USER 1000
Expand Down
20 changes: 10 additions & 10 deletions apps/worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
"@nestjs/platform-express": "^10.2.2",
"@nestjs/swagger": "^7.1.9",
"@nestjs/terminus": "^10.0.1",
"@novu/application-generic": "^0.24.2",
"@novu/dal": "^0.24.2",
"@novu/shared": "^0.24.2",
"@novu/stateless": "^0.24.2",
"@novu/testing": "^0.24.2",
"@novu/application-generic": "workspace:",
"@novu/dal": "workspace:",
"@novu/shared": "workspace:",
"@novu/stateless": "workspace:",
"@novu/testing": "workspace:",
"@sentry/node": "^7.40.0",
"@sentry/tracing": "^7.40.0",
"@types/newrelic": "^9.13.0",
Expand Down Expand Up @@ -84,11 +84,11 @@
"typescript": "4.9.5"
},
"optionalDependencies": {
"@novu/ee-auth": "^0.24.2",
"@novu/ee-billing": "^0.24.2",
"@novu/ee-echo-worker": "^0.24.2",
"@novu/ee-shared-services": "^0.24.2",
"@novu/ee-translation": "^0.24.2"
"@novu/ee-auth": "workspace:",
"@novu/ee-billing": "workspace:",
"@novu/ee-echo-worker": "workspace:",
"@novu/ee-shared-services": "workspace:",
"@novu/ee-translation": "workspace:"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
Expand Down
2 changes: 1 addition & 1 deletion apps/ws/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM node:20-alpine3.19

ENV NX_DAEMON=false

RUN npm install -g pnpm@8.9.0 --loglevel notice
RUN npm install -g pnpm@9.1.1 --loglevel notice
RUN npm i pm2 -g
RUN apk --no-cache add g++ make py3-pip

Expand Down
8 changes: 4 additions & 4 deletions apps/ws/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
"@nestjs/swagger": "^7.1.9",
"@nestjs/terminus": "^10.0.1",
"@nestjs/websockets": "^10.2.2",
"@novu/application-generic": "^0.24.2",
"@novu/dal": "^0.24.2",
"@novu/shared": "^0.24.2",
"@novu/testing": "^0.24.2",
"@novu/application-generic": "workspace:",
"@novu/dal": "workspace:",
"@novu/shared": "workspace:",
"@novu/testing": "workspace:",
"@sentry/node": "^7.30.0",
"@socket.io/admin-ui": "^0.5.1",
"@socket.io/redis-adapter": "^7.2.0",
Expand Down
6 changes: 3 additions & 3 deletions enterprise/packages/auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
"test-ee": "cross-env TS_NODE_COMPILER_OPTIONS='{\"strictNullChecks\": false}' TZ=UTC NODE_ENV=test E2E_RUNNER=true mocha --timeout 10000 --require ts-node/register --exit --file tests/setup.ts src/**/**/*.spec.ts"
},
"dependencies": {
"@novu/application-generic": "^0.24.2",
"@novu/dal": "^0.24.2",
"@novu/shared": "^0.24.2",
"@novu/application-generic": "workspace:",
"@novu/dal": "workspace:",
"@novu/shared": "workspace:",
"passport-google-oauth": "^2.0.0"
},
"devDependencies": {
Expand Down
Loading

0 comments on commit 898ca79

Please sign in to comment.