Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fei6062.releaseprotections] Update prepublish checks to add SNAPSHOT_RELEASE support #2412

Merged
merged 7 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changeset/perfect-pens-pay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
2 changes: 1 addition & 1 deletion .github/workflows/node-ci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ jobs:
run: yarn build:types

- name: Check package.json files
run: node utils/publish/pre-publish-check-ci.js
run: ./utils/publish/pre-publish-check-ci.ts
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"lint:watch": "esw --watch --config ./eslint/eslintrc packages",
"lint": "yarn lint:ci .",
"lint:ci": "eslint --ext .ts --ext .js --ext .tsx --ext .jsx",
"publish:ci": "yarn run lint:pkg-json && node utils/publish/pre-publish-check-ci.js && git diff --stat --exit-code HEAD && yarn build && yarn build:types && changeset publish",
"publish:ci": "yarn run lint:pkg-json && ./utils/publish/pre-publish-check-ci.ts && git diff --stat --exit-code HEAD && yarn build && yarn build:types && changeset publish",
"start": "yarn start:storybook",
"start:storybook": "storybook dev -p 6061",
"test:common": "yarn run build && yarn run lint && yarn run typecheck && yarn run alex",
Expand Down Expand Up @@ -81,6 +81,7 @@
"@typescript-eslint/eslint-plugin": "^5.59.5",
"@typescript-eslint/parser": "^5.59.5",
"alex": "^11.0.0",
"ancesdir": "^6.0.0",
"babel-jest": "^29.7.0",
"babel-loader": "^8.2.3",
"babel-plugin-dynamic-import-node": "^2.3.3",
Expand Down Expand Up @@ -149,4 +150,4 @@
"strip-ansi": "6.0.1",
"strip-ansi-explanation": "There's an issue with strip-ansi v7 which causes conflicts with the Khan/changeset-per-package action"
}
}
}
3 changes: 2 additions & 1 deletion packages/wonder-blocks-accordion/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"module": "dist/es/index.js",
"source": "src/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"prepublishOnly": "../../utils/publish/package-pre-publish-check.sh"
},
"types": "dist/index.d.ts",
"author": "",
Expand Down
3 changes: 2 additions & 1 deletion packages/wonder-blocks-banner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"module": "dist/es/index.js",
"types": "dist/index.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"prepublishOnly": "../../utils/publish/package-pre-publish-check.sh"
},
"author": "",
"license": "MIT",
Expand Down
3 changes: 2 additions & 1 deletion packages/wonder-blocks-birthday-picker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"module": "dist/es/index.js",
"types": "dist/index.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"prepublishOnly": "../../utils/publish/package-pre-publish-check.sh"
},
"dependencies": {
"@babel/runtime": "^7.18.6",
Expand Down
3 changes: 2 additions & 1 deletion packages/wonder-blocks-breadcrumbs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"module": "dist/es/index.js",
"types": "dist/index.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"prepublishOnly": "../../utils/publish/package-pre-publish-check.sh"
},
"author": "",
"license": "MIT",
Expand Down
3 changes: 2 additions & 1 deletion packages/wonder-blocks-button/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"module": "dist/es/index.js",
"types": "dist/index.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"prepublishOnly": "../../utils/publish/package-pre-publish-check.sh"
},
"author": "",
"license": "MIT",
Expand Down
3 changes: 2 additions & 1 deletion packages/wonder-blocks-cell/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"module": "dist/es/index.js",
"types": "dist/index.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"prepublishOnly": "../../utils/publish/package-pre-publish-check.sh"
},
"dependencies": {
"@babel/runtime": "^7.18.6",
Expand Down
3 changes: 2 additions & 1 deletion packages/wonder-blocks-clickable/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"module": "dist/es/index.js",
"types": "dist/index.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"prepublishOnly": "../../utils/publish/package-pre-publish-check.sh"
},
"author": "",
"license": "MIT",
Expand Down
3 changes: 2 additions & 1 deletion packages/wonder-blocks-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"module": "dist/es/index.js",
"types": "dist/index.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"prepublishOnly": "../../utils/publish/package-pre-publish-check.sh"
},
"dependencies": {
"@babel/runtime": "^7.18.6"
Expand Down
3 changes: 2 additions & 1 deletion packages/wonder-blocks-data/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"module": "dist/es/index.js",
"types": "dist/index.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"prepublishOnly": "../../utils/publish/package-pre-publish-check.sh"
},
"dependencies": {
"@babel/runtime": "^7.18.6",
Expand Down
3 changes: 2 additions & 1 deletion packages/wonder-blocks-dropdown/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"module": "dist/es/index.js",
"types": "dist/index.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"prepublishOnly": "../../utils/publish/package-pre-publish-check.sh"
},
"author": "",
"license": "MIT",
Expand Down
3 changes: 2 additions & 1 deletion packages/wonder-blocks-form/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"module": "dist/es/index.js",
"types": "dist/index.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"prepublishOnly": "../../utils/publish/package-pre-publish-check.sh"
},
"author": "",
"license": "MIT",
Expand Down
3 changes: 2 additions & 1 deletion packages/wonder-blocks-grid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"module": "dist/es/index.js",
"types": "dist/index.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"prepublishOnly": "../../utils/publish/package-pre-publish-check.sh"
},
"author": "",
"license": "MIT",
Expand Down
3 changes: 2 additions & 1 deletion packages/wonder-blocks-icon-button/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"module": "dist/es/index.js",
"types": "dist/index.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"prepublishOnly": "../../utils/publish/package-pre-publish-check.sh"
},
"author": "",
"license": "MIT",
Expand Down
3 changes: 2 additions & 1 deletion packages/wonder-blocks-icon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"module": "dist/es/index.js",
"types": "dist/index.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"prepublishOnly": "../../utils/publish/package-pre-publish-check.sh"
},
"author": "",
"license": "MIT",
Expand Down
3 changes: 2 additions & 1 deletion packages/wonder-blocks-labeled-field/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"module": "dist/es/index.js",
"types": "dist/index.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"prepublishOnly": "../../utils/publish/package-pre-publish-check.sh"
},
"author": "",
"license": "MIT",
Expand Down
3 changes: 2 additions & 1 deletion packages/wonder-blocks-layout/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"module": "dist/es/index.js",
"types": "dist/index.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"prepublishOnly": "../../utils/publish/package-pre-publish-check.sh"
},
"dependencies": {
"@babel/runtime": "^7.18.6",
Expand Down
3 changes: 2 additions & 1 deletion packages/wonder-blocks-link/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"module": "dist/es/index.js",
"types": "dist/index.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"prepublishOnly": "../../utils/publish/package-pre-publish-check.sh"
},
"author": "",
"license": "MIT",
Expand Down
3 changes: 2 additions & 1 deletion packages/wonder-blocks-modal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"types": "dist/index.d.ts",
"module": "dist/es/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"prepublishOnly": "../../utils/publish/package-pre-publish-check.sh"
},
"author": "",
"license": "MIT",
Expand Down
3 changes: 2 additions & 1 deletion packages/wonder-blocks-pill/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"types": "dist/index.d.ts",
"source": "src/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"prepublishOnly": "../../utils/publish/package-pre-publish-check.sh"
},
"author": "",
"license": "MIT",
Expand Down
3 changes: 2 additions & 1 deletion packages/wonder-blocks-popover/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"module": "dist/es/index.js",
"types": "dist/index.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"prepublishOnly": "../../utils/publish/package-pre-publish-check.sh"
},
"author": "",
"license": "MIT",
Expand Down
3 changes: 2 additions & 1 deletion packages/wonder-blocks-progress-spinner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"module": "dist/es/index.js",
"types": "dist/index.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"prepublishOnly": "../../utils/publish/package-pre-publish-check.sh"
},
"author": "",
"license": "MIT",
Expand Down
3 changes: 2 additions & 1 deletion packages/wonder-blocks-search-field/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"module": "dist/es/index.js",
"types": "dist/index.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"prepublishOnly": "../../utils/publish/package-pre-publish-check.sh"
},
"author": "",
"license": "MIT",
Expand Down
3 changes: 2 additions & 1 deletion packages/wonder-blocks-switch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"module": "dist/es/index.js",
"types": "dist/index.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"prepublishOnly": "../../utils/publish/package-pre-publish-check.sh"
},
"author": "",
"license": "MIT",
Expand Down
3 changes: 2 additions & 1 deletion packages/wonder-blocks-testing-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"module": "dist/es/index.js",
"types": "dist/index.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"prepublishOnly": "../../utils/publish/package-pre-publish-check.sh"
},
"dependencies": {
"@babel/runtime": "^7.18.6"
Expand Down
3 changes: 2 additions & 1 deletion packages/wonder-blocks-testing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"module": "dist/es/index.js",
"types": "dist/index.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"prepublishOnly": "../../utils/publish/package-pre-publish-check.sh"
},
"dependencies": {
"@babel/runtime": "^7.18.6",
Expand Down
3 changes: 2 additions & 1 deletion packages/wonder-blocks-theming/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"module": "dist/es/index.js",
"types": "dist/index.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"prepublishOnly": "../../utils/publish/package-pre-publish-check.sh"
},
"dependencies": {},
"peerDependencies": {
Expand Down
3 changes: 2 additions & 1 deletion packages/wonder-blocks-timing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"module": "dist/es/index.js",
"types": "dist/index.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"prepublishOnly": "../../utils/publish/package-pre-publish-check.sh"
},
"peerDependencies": {
"react": "18.2.0"
Expand Down
3 changes: 2 additions & 1 deletion packages/wonder-blocks-tokens/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"module": "dist/es/index.js",
"types": "dist/index.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"prepublishOnly": "../../utils/publish/package-pre-publish-check.sh"
},
"author": "",
"license": "MIT",
Expand Down
3 changes: 2 additions & 1 deletion packages/wonder-blocks-toolbar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"module": "dist/es/index.js",
"types": "dist/index.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"prepublishOnly": "../../utils/publish/package-pre-publish-check.sh"
},
"author": "",
"license": "MIT",
Expand Down
3 changes: 2 additions & 1 deletion packages/wonder-blocks-tooltip/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"module": "dist/es/index.js",
"types": "dist/index.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"prepublishOnly": "../../utils/publish/package-pre-publish-check.sh"
},
"author": "",
"license": "MIT",
Expand Down
3 changes: 2 additions & 1 deletion packages/wonder-blocks-typography/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"module": "dist/es/index.js",
"types": "dist/index.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"prepublishOnly": "../../utils/publish/package-pre-publish-check.sh"
},
"author": "",
"license": "MIT",
Expand Down
7 changes: 7 additions & 0 deletions utils/publish/package-pre-publish-check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

# Check if SNAPSHOT_RELEASE is set and the version does not start with 0.0.0-PR
if [ "$SNAPSHOT_RELEASE" = "1" ] && ! [[ "$npm_package_version" =~ ^0\.0\.0-PR ]]; then
echo "Error: Snapshot publish attempted, but $npm_package_name@$npm_package_version does not match version scheme for snapshots. Publish disallowed."
exit 1
fi
37 changes: 0 additions & 37 deletions utils/publish/pre-publish-check-ci.js

This file was deleted.

Loading
Loading