Skip to content

Add build:local script #2245

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

Merged
merged 4 commits into from
Sep 13, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"xcode": "xed ios",
"build:dev": "tsc --p tsconfig.dev.json",
"build": "node scripts/build.js",
"build:local": "./scripts/createLocalPackage.sh",
"pre-push": "npm run build:dev && npm run test",
"docs:deploy": "./scripts/deployDocs.sh",
"docs:build": "node scripts/buildDocs.js",
Expand Down
39 changes: 39 additions & 0 deletions scripts/createLocalPackage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env bash

# Test if there are currently untracked files and notify the user they exist (do not move things around for the user)
FILES_TO_CLEAN=$(git clean -n)
if [ ! -z "$FILES_TO_CLEAN" ]
then
echo "Please note that a byproduct is deleting ALL untracked files from your folder, these files will be deleted:"
echo "${FILES_TO_CLEAN}"
select yn in "Yes" "No"; do
case $yn in
Yes ) break;;
No ) exit;;
esac
done
fi

PACKAGE_JSON=$(git diff package.json)
if [ ! -z "$PACKAGE_JSON" ]
then
echo "Your changes to pacakge.json will be erased, continue?"
select yn in "Yes" "No"; do
case $yn in
Yes ) break;;
No ) exit;;
esac
done
fi

# Delete previous tar
rm -f ~/Downloads/react-native-ui-lib.tgz
# Build javascript files
npm run build
# Package into a tar
npm pack
# Rename tar and move to Downloads
mv react-native-ui-lib-5.0.0.tgz ~/Downloads/react-native-ui-lib.tgz
# Clean ALL untracked files
git clean -f
git checkout package.json