-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
1,165 additions
and
511 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
*~ | ||
.vimrc | ||
.sublime-project | ||
.swp | ||
coverage | ||
reports | ||
desktop.ini | ||
npm-debug.log | ||
yarn-debug.log | ||
.npmrc | ||
Thumbs.db | ||
.idea | ||
src | ||
.babelrc | ||
.DS_Store | ||
.editorconfig | ||
.eslintrc.json | ||
.eslintrc | ||
.git | ||
.gitignore | ||
.npmignore | ||
.stylelintignore | ||
.stylelintrc | ||
.vscode | ||
.yarnrc | ||
build | ||
postcss.config.js | ||
reports | ||
test | ||
yarn.lock | ||
.travis.yml | ||
flow | ||
.flowconfig | ||
browserslist | ||
.conventional-changelog-lintrc | ||
*~~bak |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module.exports = `Box UI Element | ||
Copyright 2016-present, Box, Inc. | ||
All rights reserved. | ||
This source code is licensed under the Box Software License Agreement found | ||
in the LICENSE file in the root directory of this source tree. Additional | ||
third party license disclosures can be found in the THIRD_PARTY_LICENSES | ||
file in the same directory.`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,220 @@ | ||
#!/bin/bash | ||
|
||
# Temp version | ||
VERSION="XXX" | ||
|
||
install_dependencies() { | ||
echo "--------------------------------------------------------" | ||
echo "Installing all package dependencies" | ||
echo "--------------------------------------------------------" | ||
if yarn install; then | ||
echo "----------------------------------------------------" | ||
echo "Installed dependencies successfully." | ||
echo "----------------------------------------------------" | ||
else | ||
echo "----------------------------------------------------" | ||
echo "Error: Failed to run 'yarn install'!" | ||
echo "----------------------------------------------------" | ||
exit 1; | ||
fi | ||
} | ||
|
||
lint_and_test() { | ||
echo "----------------------------------------------------" | ||
echo "Running linter for version" $VERSION | ||
echo "----------------------------------------------------" | ||
if yarn run lint; then | ||
echo "----------------------------------------------------" | ||
echo "Done linting for version" $VERSION | ||
echo "----------------------------------------------------" | ||
else | ||
echo "----------------------------------------------------" | ||
echo "Failed linting!" | ||
echo "----------------------------------------------------" | ||
exit 1; | ||
fi | ||
|
||
|
||
echo "----------------------------------------------------" | ||
echo "Running flow for version" $VERSION | ||
echo "----------------------------------------------------" | ||
if yarn run flow; then | ||
echo "----------------------------------------------------" | ||
echo "Done flowing for version" $VERSION | ||
echo "----------------------------------------------------" | ||
else | ||
echo "----------------------------------------------------" | ||
echo "Failed flowing!" | ||
echo "----------------------------------------------------" | ||
exit 1; | ||
fi | ||
|
||
|
||
echo "----------------------------------------------------" | ||
echo "Running tests for version" $VERSION | ||
echo "----------------------------------------------------" | ||
if yarn run test; then | ||
echo "----------------------------------------------------" | ||
echo "Done testing for version" $VERSION | ||
echo "----------------------------------------------------" | ||
else | ||
echo "----------------------------------------------------" | ||
echo "Failed testing!" | ||
echo "----------------------------------------------------" | ||
exit 1; | ||
fi | ||
} | ||
|
||
clean_assets() { | ||
echo "----------------------------------------------------" | ||
echo "Running clean for version" $VERSION | ||
echo "----------------------------------------------------" | ||
if yarn run clean; then | ||
echo "----------------------------------------------------" | ||
echo "Done cleaning for version" $VERSION | ||
echo "----------------------------------------------------" | ||
else | ||
echo "----------------------------------------------------" | ||
echo "Failed cleaning!" | ||
echo "----------------------------------------------------" | ||
exit 1; | ||
fi | ||
} | ||
|
||
build_assets() { | ||
echo "----------------------------------------------------" | ||
echo "Starting babel build for version" $VERSION | ||
echo "----------------------------------------------------" | ||
if yarn run build-lib; then | ||
echo "----------------------------------------------------" | ||
echo "Built babel assets for version" $VERSION | ||
echo "----------------------------------------------------" | ||
else | ||
echo "----------------------------------------------------" | ||
echo "Failed to build production assets!" | ||
echo "----------------------------------------------------" | ||
exit 1; | ||
fi | ||
} | ||
|
||
push_to_npm() { | ||
echo "---------------------------------------------------------" | ||
echo "Running npm publish for version" $VERSION | ||
echo "---------------------------------------------------------" | ||
if npm publish; then | ||
echo "--------------------------------------------------------" | ||
echo "Published version" $VERSION | ||
echo "--------------------------------------------------------" | ||
else | ||
echo "----------------------------------------------------" | ||
echo "Error publishing to npm registry!" | ||
echo "----------------------------------------------------" | ||
exit 1; | ||
fi | ||
} | ||
|
||
add_remote() { | ||
# Add the release remote if it is not present | ||
if git remote get-url release; then | ||
git remote remove release || return 1 | ||
fi | ||
git remote add release [email protected]:box/box-annotations.git || return 1 | ||
} | ||
|
||
publish_to_npm() { | ||
if [[ $(git diff --shortstat 2> /dev/null | tail -n1) != "" ]] ; then | ||
echo "----------------------------------------------------" | ||
echo "Your branch is dirty!" | ||
echo "----------------------------------------------------" | ||
exit 1 | ||
fi | ||
|
||
if ! add_remote; then | ||
echo "----------------------------------------------------" | ||
echo "Error in add_remote!" | ||
echo "----------------------------------------------------" | ||
exit 1 | ||
fi | ||
|
||
git checkout master || exit 1 | ||
git fetch release || exit 1 | ||
git reset --hard release/master || exit 1 | ||
# Remove old local tags in case a build failed | ||
git fetch --prune release '+refs/tags/*:refs/tags/*' || exit 1 | ||
git clean -fdX || exit 1 | ||
|
||
VERSION=$(./build/current_version.sh) | ||
|
||
if [[ $(git status --porcelain 2>/dev/null| grep "^??") != "" ]] ; then | ||
echo "----------------------------------------------------" | ||
echo "Your branch has untracked files!" | ||
echo "----------------------------------------------------" | ||
exit 1 | ||
fi | ||
|
||
if [[ $(git status --porcelain 2>/dev/null| egrep "^(M| M)") != "" ]] ; then | ||
echo "----------------------------------------------------" | ||
echo "Your branch has uncommited files!" | ||
echo "----------------------------------------------------" | ||
exit 1 | ||
fi | ||
|
||
echo "----------------------------------------------------" | ||
echo "Checking out version" $VERSION | ||
echo "----------------------------------------------------" | ||
# Check out the version we want to build (version tags are prefixed with a v) | ||
git checkout v$VERSION || exit 1 | ||
|
||
# Install node modules | ||
if ! install_dependencies; then | ||
echo "----------------------------------------------------" | ||
echo "Error in install_dependencies!" | ||
echo "----------------------------------------------------" | ||
exit 1 | ||
fi | ||
|
||
# Do testing and linting | ||
if ! clean_assets; then | ||
echo "----------------------------------------------------" | ||
echo "Error in clean_assets!" | ||
echo "----------------------------------------------------" | ||
exit 1 | ||
fi | ||
|
||
# Do testing and linting | ||
if ! lint_and_test; then | ||
echo "----------------------------------------------------" | ||
echo "Error in lint_and_test!" | ||
echo "----------------------------------------------------" | ||
exit 1 | ||
fi | ||
|
||
# Babel build | ||
if ! build_assets; then | ||
echo "----------------------------------------------------" | ||
echo "Error in build_assets!" | ||
echo "----------------------------------------------------" | ||
exit 1 | ||
fi | ||
|
||
# Publish | ||
if ! push_to_npm; then | ||
echo "----------------------------------------------------" | ||
echo "Error in push_to_npm!" | ||
echo "----------------------------------------------------" | ||
exit 1 | ||
fi | ||
} | ||
|
||
# Execute this entire script | ||
if ! publish_to_npm; then | ||
echo "----------------------------------------------------" | ||
echo "Error: failure in publish_to_npm!" | ||
echo "----------------------------------------------------" | ||
exit 1 | ||
fi | ||
|
||
echo "----------------------------------------------------" | ||
echo "Checking out back to master" | ||
echo "----------------------------------------------------" | ||
git checkout master || exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.