-
Notifications
You must be signed in to change notification settings - Fork 49
Feat/dynamic context validation in sdk #1703
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
Changes from all commits
dbb89d2
85f3668
cdbbcf2
c59e102
220ea2f
6974fdb
88963e7
3ad42d5
d2c8f9c
25063c7
3abfbc5
9140518
e8cd12d
d3e4b59
1a11c84
98c2907
b851f2a
57711ba
cbdd6d1
77b57e4
71f851b
ecc9edf
e698548
93e59a1
18ae12f
0a8422f
04c80db
9b4e9d2
7d5ed21
542a8d9
3d42edc
a387e77
56853b9
52b31a3
cab784b
0562712
078b233
128e1e5
d2cb260
7b2ccd3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
node_modules | ||
|
||
# vite | ||
development | ||
build | ||
dist | ||
lib | ||
|
||
# misc | ||
.eslintcache | ||
.DS_Store | ||
.env | ||
.env.test | ||
.env.testnet | ||
.env.devnet | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
# logs | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# @kleros/kleros-v2-sdk | ||
# @kleros/kleros-sdk | ||
|
||
_Archon's successor_ | ||
|
||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,42 @@ | ||||||||||||||||||||||||||||||||||||||||
#!/bin/bash | ||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | ||||||||||||||||||||||||||||||||||||||||
Comment on lines
+1
to
+3
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Consider enhancing script directory handling. The script directory resolution is good but could be more robust. -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
+readonly SCRIPT_DIR="$( cd "$( dirname "$(readlink -f "${BASH_SOURCE[0]}")" )" >/dev/null 2>&1 && pwd )" 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||
#-------------------------------------- | ||||||||||||||||||||||||||||||||||||||||
# Error handling | ||||||||||||||||||||||||||||||||||||||||
#-------------------------------------- | ||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||
set -Ee | ||||||||||||||||||||||||||||||||||||||||
function _catch { | ||||||||||||||||||||||||||||||||||||||||
# Don't propagate to outer shell | ||||||||||||||||||||||||||||||||||||||||
exit 0 | ||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||
function _finally { | ||||||||||||||||||||||||||||||||||||||||
# TODO: rollback version bump | ||||||||||||||||||||||||||||||||||||||||
rm -rf $SCRIPT_DIR/../dist | ||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||
trap _catch ERR | ||||||||||||||||||||||||||||||||||||||||
trap _finally EXIT | ||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||
#-------------------------------------- | ||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||
# Check if any tracked files are currently changed, ignoring untracked files | ||||||||||||||||||||||||||||||||||||||||
if [ -n "$(git status --porcelain -uno)" ]; then | ||||||||||||||||||||||||||||||||||||||||
echo "Error: There are uncommitted changes in tracked files. Please commit or stash them before publishing." | ||||||||||||||||||||||||||||||||||||||||
exit 1 | ||||||||||||||||||||||||||||||||||||||||
fi | ||||||||||||||||||||||||||||||||||||||||
jaybuidl marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||
yarn version $1 | ||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||
version=$(cat package.json | jq -r .version) | ||||||||||||||||||||||||||||||||||||||||
echo "Publishing version $version" | ||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||
git add package.json | ||||||||||||||||||||||||||||||||||||||||
git commit -m "chore(sdk): release @kleros/kleros-sdk@$version" | ||||||||||||||||||||||||||||||||||||||||
git tag "@kleros/kleros-sdk@$version" -m "@kleros/kleros-sdk@$version" | ||||||||||||||||||||||||||||||||||||||||
git push | ||||||||||||||||||||||||||||||||||||||||
git push --tags | ||||||||||||||||||||||||||||||||||||||||
jaybuidl marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||
yarn clean | ||||||||||||||||||||||||||||||||||||||||
yarn build | ||||||||||||||||||||||||||||||||||||||||
yarn npm publish | ||||||||||||||||||||||||||||||||||||||||
Comment on lines
+40
to
+42
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add verification steps for build and publish process. The build and publish steps need additional checks to ensure reliability. +# Verify npm authentication
+if ! yarn npm whoami >/dev/null 2>&1; then
+ echo "Error: Not authenticated to npm. Please run 'yarn npm login' first."
+ exit 1
+fi
+
yarn clean
-yarn build
+yarn build || { echo "Build failed"; exit 1; }
+
+# Verify dist directory exists and contains files
+if [ ! -d "dist" ] || [ -z "$(ls -A dist)" ]; then
+ echo "Error: dist directory is missing or empty"
+ exit 1
+fi
+
yarn npm publish 📝 Committable suggestion
Suggested change
|
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.