Skip to content

Commit

Permalink
chore(root): Leverage pkg.pr.new for NPM package previews (#6523)
Browse files Browse the repository at this point in the history
  • Loading branch information
SokratisVidros authored Sep 18, 2024
1 parent 2d20b71 commit ee7033c
Show file tree
Hide file tree
Showing 14 changed files with 921 additions and 585 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/release-packages-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish Next Packages Previews

on:
workflow_dispatch:
push:
branches:
- next
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"

- name: Install dependencies
run: pnpm install

- name: Build
run: pnpm run build

- name: Release package previews to pkg.pr.new
run: pnpx run release:previews
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"release:preminor": "nx release version preminor --no-push",
"release:prerelease": "nx release version prerelease --no-push",
"release:submodules": "ts-node scripts/release-with-submodules.ts",
"release:previews": "nx affected -t release:preview --base=origin/main~1 --head=origin/main",
"start:integration:api": "cd apps/api && pnpm run test",
"start:e2e:api": "cd apps/api && pnpm run test:e2e",
"g:module": "hygen module new --name=$npm_config_name",
Expand Down Expand Up @@ -167,6 +168,7 @@
"meow": "^10.1.3",
"mississippi": "^4.0.0",
"ora": "~5.4.1",
"pkg-pr-new": "^0.0.24",
"pnpm": "9.1.4",
"prettier": "~3.3.3",
"process": "^0.11.10",
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"start:sync:mode": "cross-env NODE_ENV=dev CLI_SEGMENT_WRITE_KEY=GdQ594CEBj4pU6RFldDOjKJwZjxZOsIj nodemon sync",
"start:test": "cross-env NODE_ENV=test PORT=1336 nodemon init",
"start:debug": "cross-env nodemon --config nodemon-debug.json",
"start:prod": "cross-env node dist/src/index.js"
"start:prod": "cross-env node dist/src/index.js",
"release:preview": "pnpx pkg-pr-new publish"
},
"keywords": [
"novu",
Expand Down
3 changes: 2 additions & 1 deletion packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"doc:json": "typedoc src/ --exclude **/*.spec.ts --target ES6 --mode file --json build/docs/typedoc.json",
"doc:publish": "gh-pages -m \"[ci skip] Updates\" -d build/docs",
"reset-hard": "git clean -dfx && git reset --hard && pnpm install",
"prepare-release": "run-s reset-hard test"
"prepare-release": "run-s reset-hard test",
"release:preview": "pnpx pkg-pr-new publish"
},
"publishConfig": {
"access": "public"
Expand Down
3 changes: 2 additions & 1 deletion packages/framework/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"$comment:bump:prerelease": "This is a workaround to support `npm version prerelease` with lerna",
"bump:prerelease": "npm version prerelease --preid=alpha & PID=$!; (sleep 1 && kill -9 $PID) & wait $PID",
"release:alpha": "pnpm bump:prerelease || pnpm build && npm publish",
"devtool": "tsx ./scripts/devtool.ts"
"devtool": "tsx ./scripts/devtool.ts",
"release:preview": "pnpx pkg-pr-new publish"
},
"keywords": [
"novu",
Expand Down
3 changes: 2 additions & 1 deletion packages/headless/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"fix:prettier": "prettier \"src/**/*.ts\" --write",
"lint:fix": "eslint src --fix",
"test": "jest",
"test:watch": "jest --watch"
"test:watch": "jest --watch",
"release:preview": "pnpx pkg-pr-new publish"
},
"publishConfig": {
"access": "public"
Expand Down
3 changes: 2 additions & 1 deletion packages/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@
"check-exports": "attw --pack .",
"lint": "eslint src",
"lint:fix": "pnpm lint -- --fix",
"test": "jest"
"test": "jest",
"release:preview": "pnpx pkg-pr-new publish"
},
"browserslist": {
"production": [
Expand Down
3 changes: 2 additions & 1 deletion packages/nest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"watch:build": "tsc -p tsconfig.json -w",
"watch:test": "jest src --watch",
"reset-hard": "git clean -dfx && git reset --hard && pnpm install",
"prepare-release": "run-s reset-hard test"
"prepare-release": "run-s reset-hard test",
"release:preview": "pnpx pkg-pr-new publish"
},
"publishConfig": {
"access": "public"
Expand Down
3 changes: 2 additions & 1 deletion packages/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"doc:json": "typedoc src/ --exclude **/*.spec.ts --target ES6 --mode file --json build/docs/typedoc.json",
"doc:publish": "gh-pages -m \"[ci skip] Updates\" -d build/docs",
"reset-hard": "git clean -dfx && git reset --hard && pnpm install",
"prepare-release": "run-s reset-hard test"
"prepare-release": "run-s reset-hard test",
"release:preview": "pnpx pkg-pr-new publish"
},
"publishConfig": {
"access": "public"
Expand Down
3 changes: 2 additions & 1 deletion packages/providers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"watch:build": "tsc -p tsconfig.json -w",
"watch:test": "vitest",
"reset-hard": "git clean -dfx && git reset --hard && yarn",
"prepare-release": "run-s reset-hard test"
"prepare-release": "run-s reset-hard test",
"release:preview": "pnpx pkg-pr-new publish"
},
"publishConfig": {
"access": "public"
Expand Down
3 changes: 2 additions & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
"build:watch": "tsup --watch",
"build": "tsup && pnpm run check-exports",
"lint": "eslint src",
"check-exports": "attw --pack ."
"check-exports": "attw --pack .",
"release:preview": "pnpx pkg-pr-new publish"
},
"browserslist": {
"production": [
Expand Down
3 changes: 2 additions & 1 deletion packages/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"lint": "eslint src",
"lint:fix": "pnpm lint -- --fix",
"test": "jest src",
"watch:test": "jest src --watch"
"watch:test": "jest src --watch",
"release:preview": "pnpx pkg-pr-new publish"
},
"author": "",
"license": "ISC",
Expand Down
3 changes: 2 additions & 1 deletion packages/stateless/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"doc:json": "typedoc src/ --exclude **/*.spec.ts --target ES6 --mode file --json build/docs/typedoc.json",
"doc:publish": "gh-pages -m \"[ci skip] Updates\" -d build/docs",
"reset-hard": "git clean -dfx && git reset --hard && pnpm install",
"prepare-release": "run-s reset-hard test"
"prepare-release": "run-s reset-hard test",
"release:preview": "pnpx pkg-pr-new publish"
},
"publishConfig": {
"access": "public"
Expand Down
Loading

0 comments on commit ee7033c

Please sign in to comment.