Skip to content

Commit f01ca2a

Browse files
committed
Added publish script
1 parent e205228 commit f01ca2a

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

frontend/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
{
22
"description": "A workspace for managing the Corelle project.",
33
"scripts": {
4-
"dev": "yarn workspace @corelle/demo-app run dev"
4+
"dev": "yarn workspace @corelle/demo-app run dev",
5+
"build": "yarn workspaces foreach -A -p run build",
6+
"publish": "./publish.sh"
57
},
68
"author": "Daven Quinn",
79
"workspaces": [

frontend/publish.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash -e
2+
3+
# Ensure work tree is clean
4+
if ! git diff --quiet; then
5+
echo "Working tree is not clean. Please commit all changes before publishing."
6+
exit 1
7+
fi
8+
9+
echo "Building packages:"
10+
11+
yarn workspaces foreach --no-private -A run build
12+
13+
echo "Listing files to be published:"
14+
15+
yarn workspaces foreach --no-private -A run pack --dry-run
16+
17+
# Prompt user to confirm publishing
18+
read -p "Are you sure you want to publish? (y/n) " -n 1 -r
19+
20+
yarn workspaces foreach --no-private -A npm publish --access public

0 commit comments

Comments
 (0)