Skip to content

Commit

Permalink
feat(publish): Add version bump script (#53)
Browse files Browse the repository at this point in the history
- Add Lerna to our repo to use it as a mechanism of bumping all our package versions. We need this for the craft publishing process. 
- Add a pre-release script we need for craft later on
  • Loading branch information
Lms24 authored Oct 20, 2022
1 parent acfd34d commit 77a217e
Show file tree
Hide file tree
Showing 13 changed files with 2,963 additions and 74 deletions.
6 changes: 6 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"version": "0.0.0-alpha.0",
"packages": "packages/*",
"npmClient": "yarn",
"useWorkspaces": true
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
"devDependencies": {
"@nrwl/cli": "14.5.10",
"@nrwl/workspace": "14.5.10",
"nx": "14.5.10",
"husky": "^8.0.0",
"lerna": "^6.0.1",
"nx": "14.5.10",
"prettier": "^2.7.1",
"pretty-quick": "^3.1.3"
}
Expand Down
8 changes: 4 additions & 4 deletions packages/esbuild-plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry/esbuild-plugin",
"version": "0.0.1",
"version": "0.0.0-alpha.0",
"description": "Official Sentry esbuild plugin",
"repository": "git://github.com/getsentry/sentry-unplugin.git",
"homepage": "https://github.com/getsentry/sentry-unplugin/tree/main/packages/esbuild-plugin",
Expand Down Expand Up @@ -35,7 +35,7 @@
"lint": "eslint ./src ./test"
},
"dependencies": {
"@sentry/sentry-unplugin": "0.0.1"
"@sentry/sentry-unplugin": "0.0.0-alpha.0"
},
"devDependencies": {
"@babel/core": "7.18.5",
Expand All @@ -45,12 +45,12 @@
"@rollup/plugin-commonjs": "22.0.1",
"@rollup/plugin-json": "4.1.0",
"@rollup/plugin-node-resolve": "13.3.0",
"@sentry-internal/eslint-config": "0.0.0-alpha.0",
"@sentry-internal/sentry-unplugin-tsconfig": "0.0.0-alpha.0",
"@swc/core": "^1.2.205",
"@swc/jest": "^0.2.21",
"@types/jest": "^28.1.3",
"@types/node": "^18.6.3",
"@sentry-internal/eslint-config": "*",
"@sentry-internal/sentry-unplugin-tsconfig": "*",
"eslint": "^8.18.0",
"jest": "^28.1.1",
"npm-run-all": "^4.1.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-configs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry-internal/eslint-config",
"version": "0.0.0",
"version": "0.0.0-alpha.0",
"license": "MIT",
"private": true,
"peerDependencies": {
Expand Down
10 changes: 5 additions & 5 deletions packages/integration-tests/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry-internal/integration-tests",
"version": "0.0.0",
"version": "0.0.0-alpha.0",
"license": "MIT",
"private": true,
"scripts": {
Expand All @@ -11,17 +11,17 @@
"check:types": "tsc --project ./tsconfig.json --noEmit"
},
"dependencies": {
"@sentry-internal/eslint-config": "0.0.0-alpha.0",
"@sentry-internal/sentry-unplugin-tsconfig": "0.0.0-alpha.0",
"@sentry/sentry-unplugin": "0.0.0-alpha.0",
"@swc/jest": "^0.2.21",
"@types/jest": "^28.1.3",
"@sentry/sentry-unplugin": "*",
"@types/webpack4": "npm:@types/[email protected]",
"@sentry-internal/eslint-config": "*",
"@sentry-internal/sentry-unplugin-tsconfig": "*",
"esbuild": "0.14.49",
"eslint": "^8.18.0",
"jest": "^28.1.3",
"npm-run-all": "4.1.5",
"rollup": "2.77.0",
"eslint": "^8.18.0",
"ts-node": "^10.9.1",
"vite": "3.0.0",
"webpack": "5.74.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/playground/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry-internal/unplugin-playground",
"version": "0.0.0",
"version": "0.0.0-alpha.0",
"license": "MIT",
"private": true,
"scripts": {
Expand All @@ -16,7 +16,7 @@
"dependencies": {
"@sentry/integrations": "^7.11.1",
"@sentry/node": "^7.11.1",
"@sentry/sentry-unplugin": "*",
"@sentry/sentry-unplugin": "0.0.0-alpha.0",
"@types/express": "^4.17.13",
"@types/http-proxy": "^1.17.9",
"esbuild": "0.14.49",
Expand Down
8 changes: 4 additions & 4 deletions packages/rollup-plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry/rollup-plugin",
"version": "0.0.1",
"version": "0.0.0-alpha.0",
"description": "Official Sentry Rollup plugin",
"repository": "git://github.com/getsentry/sentry-unplugin.git",
"homepage": "https://github.com/getsentry/sentry-unplugin/tree/main/packages/rollup-plugin",
Expand Down Expand Up @@ -36,7 +36,7 @@
"lint": "eslint ./src ./test"
},
"dependencies": {
"@sentry/sentry-unplugin": "0.0.1"
"@sentry/sentry-unplugin": "0.0.0-alpha.0"
},
"devDependencies": {
"@babel/core": "7.18.5",
Expand All @@ -46,12 +46,12 @@
"@rollup/plugin-commonjs": "22.0.1",
"@rollup/plugin-json": "4.1.0",
"@rollup/plugin-node-resolve": "13.3.0",
"@sentry-internal/eslint-config": "0.0.0-alpha.0",
"@sentry-internal/sentry-unplugin-tsconfig": "0.0.0-alpha.0",
"@swc/core": "^1.2.205",
"@swc/jest": "^0.2.21",
"@types/jest": "^28.1.3",
"@types/node": "^18.6.3",
"@sentry-internal/eslint-config": "*",
"@sentry-internal/sentry-unplugin-tsconfig": "*",
"eslint": "^8.18.0",
"jest": "^28.1.1",
"npm-run-all": "^4.1.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/tsconfigs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry-internal/sentry-unplugin-tsconfig",
"version": "0.0.0",
"version": "0.0.0-alpha.0",
"license": "MIT",
"private": true
}
6 changes: 3 additions & 3 deletions packages/unplugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry/sentry-unplugin",
"version": "0.0.1",
"version": "0.0.0-alpha.0",
"description": "Official Sentry unplugin",
"repository": "git://github.com/getsentry/sentry-unplugin.git",
"homepage": "https://github.com/getsentry/sentry-unplugin",
Expand Down Expand Up @@ -45,8 +45,8 @@
"@rollup/plugin-json": "4.1.0",
"@rollup/plugin-node-resolve": "13.3.0",
"@rollup/plugin-replace": "^4.0.0",
"@sentry-internal/eslint-config": "*",
"@sentry-internal/sentry-unplugin-tsconfig": "*",
"@sentry-internal/eslint-config": "0.0.0-alpha.0",
"@sentry-internal/sentry-unplugin-tsconfig": "0.0.0-alpha.0",
"@swc/core": "^1.2.205",
"@swc/jest": "^0.2.21",
"@types/jest": "^28.1.3",
Expand Down
8 changes: 4 additions & 4 deletions packages/vite-plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry/vite-plugin",
"version": "0.0.1",
"version": "0.0.0-alpha.0",
"description": "Official Sentry Vite plugin",
"repository": "git://github.com/getsentry/sentry-unplugin.git",
"homepage": "https://github.com/getsentry/sentry-unplugin/tree/main/packages/vite-plugin",
Expand Down Expand Up @@ -35,7 +35,7 @@
"lint": "eslint ./src ./test"
},
"dependencies": {
"@sentry/sentry-unplugin": "0.0.1"
"@sentry/sentry-unplugin": "0.0.0-alpha.0"
},
"devDependencies": {
"@babel/core": "7.18.5",
Expand All @@ -45,12 +45,12 @@
"@rollup/plugin-commonjs": "22.0.1",
"@rollup/plugin-json": "4.1.0",
"@rollup/plugin-node-resolve": "13.3.0",
"@sentry-internal/eslint-config": "0.0.0-alpha.0",
"@sentry-internal/sentry-unplugin-tsconfig": "0.0.0-alpha.0",
"@swc/core": "^1.2.205",
"@swc/jest": "^0.2.21",
"@types/jest": "^28.1.3",
"@types/node": "^18.6.3",
"@sentry-internal/eslint-config": "*",
"@sentry-internal/sentry-unplugin-tsconfig": "*",
"eslint": "^8.18.0",
"jest": "^28.1.1",
"npm-run-all": "^4.1.5",
Expand Down
8 changes: 4 additions & 4 deletions packages/webpack-plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry/webpack-plugin",
"version": "0.0.1",
"version": "0.0.0-alpha.0",
"description": "Official Sentry Webpack plugin",
"repository": "git://github.com/getsentry/sentry-unplugin.git",
"homepage": "https://github.com/getsentry/sentry-unplugin/tree/main/packages/webpack-plugin",
Expand Down Expand Up @@ -36,7 +36,7 @@
"lint": "eslint ./src ./test"
},
"dependencies": {
"@sentry/sentry-unplugin": "0.0.1"
"@sentry/sentry-unplugin": "0.0.0-alpha.0"
},
"devDependencies": {
"@babel/core": "7.18.5",
Expand All @@ -46,12 +46,12 @@
"@rollup/plugin-commonjs": "22.0.1",
"@rollup/plugin-json": "4.1.0",
"@rollup/plugin-node-resolve": "13.3.0",
"@sentry-internal/eslint-config": "0.0.0-alpha.0",
"@sentry-internal/sentry-unplugin-tsconfig": "0.0.0-alpha.0",
"@swc/core": "^1.2.205",
"@swc/jest": "^0.2.21",
"@types/jest": "^28.1.3",
"@types/node": "^18.6.3",
"@sentry-internal/eslint-config": "*",
"@sentry-internal/sentry-unplugin-tsconfig": "*",
"eslint": "^8.18.0",
"jest": "^28.1.1",
"npm-run-all": "^4.1.5",
Expand Down
20 changes: 20 additions & 0 deletions scripts/craft-pre-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
set -eux

# Move to the project root
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd $SCRIPT_DIR/..
OLD_VERSION="${1}"
NEW_VERSION="${2}"

# Do not tag and commit changes made by "npm version"
export npm_config_git_tag_version=false

yarn install --frozen-lockfile
# --force-publish - force publish all packages, this will skip the lerna changed check for changed packages and forces a package that didn't have a git diff change to be updated.
# --exact - specify updated dependencies in updated packages exactly (with no punctuation), instead of as semver compatible (with a ^).
# --no-git-tag-version - don't commit changes to package.json files and don't tag the release.
# --no-push - don't push committed and tagged changes.
# --include-merged-tags - include tags from merged branches when detecting changed packages.
# --yes - skip all confirmation prompts
yarn lerna version --force-publish --exact --no-git-tag-version --no-push --include-merged-tags --yes "${NEW_VERSION}"
Loading

0 comments on commit 77a217e

Please sign in to comment.