Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from idanwe/master
Add bower bundled version
- Loading branch information
Showing
6 changed files
with
1,973 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
.npm | ||
.npm | ||
node_modules |
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,28 @@ | ||
{ | ||
"name": "accounts-phone", | ||
"version": "0.0.21", | ||
"main": "./dist/accounts-phone.bundle.min.js", | ||
"dependencies": { | ||
"meteor-client-side": "~0.2.3", | ||
"accounts-base-client-side": "~0.1.1" | ||
}, | ||
"homepage": "https://github.com/okland/accounts-phone", | ||
"description": "A login service based on mobile phone number, For Meteor.", | ||
"keywords": [ | ||
"meteor", | ||
"ddp", | ||
"client", | ||
"side", | ||
"sms", | ||
"accounts", | ||
"phone" | ||
], | ||
"license": "MIT", | ||
"ignore": [ | ||
"**/.*", | ||
"node_modules", | ||
"bower_components", | ||
"test", | ||
"tests" | ||
] | ||
} |
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,55 @@ | ||
# Run this script from home folder | ||
|
||
# configs variables | ||
NAME=accounts-phone # Set the bundle file name | ||
PACKAGE=okland:accounts-phone | ||
DIST_FOLDER=dist # The folder that the bundled files will be copy in to | ||
|
||
# run time variables | ||
PROJECT_ROOT=$(pwd) | ||
PROJECT_PARENT=$PROJECT_ROOT/.. | ||
DIST_PATH=$PROJECT_ROOT/$DIST_FOLDER | ||
BUNDLER_TEMP="tmp-$NAME-bundler" | ||
BUNDLER_PATH=$DIST_PATH/$BUNDLER_TEMP | ||
|
||
|
||
# Ansure that the dist folder exists | ||
mkdir -p $DIST_PATH | ||
|
||
# Create temp meteor project | ||
rm -rf $BUNDLER_PATH | ||
meteor create $BUNDLER_PATH | ||
cd $BUNDLER_PATH | ||
|
||
|
||
# Add packages | ||
echo > .meteor/packages # Delete all default packages | ||
PACKAGE_DIRS=$PARENT meteor add $PACKAGE | ||
|
||
|
||
# Build the packages | ||
PACKAGE_DIRS=$PROJECT_PARENT meteor build --debug . | ||
tar -zxf $BUNDLER_TEMP.tar.gz | ||
|
||
OUTPUT_PATH="$DIST_PATH/$NAME-bundler-output" | ||
PACKAGES_PATH="$DIST_PATH/$BUNDLER_TEMP/bundle/programs/web.browser/packages" | ||
|
||
# Create output folder and copy the dependencies files | ||
rm -rf $OUTPUT_PATH | ||
mkdir $OUTPUT_PATH | ||
|
||
# Concat files | ||
cat "$PACKAGES_PATH/sha.js" >> $OUTPUT_PATH/$NAME.bundle.js | ||
cat "$PACKAGES_PATH/srp.js" >> $OUTPUT_PATH/$NAME.bundle.js | ||
cat "$PACKAGES_PATH/okland_accounts-phone.js" >> $OUTPUT_PATH/$NAME.bundle.js | ||
cat "$PACKAGES_PATH/global-imports.js" >> $OUTPUT_PATH/$NAME.bundle.js | ||
|
||
# Minify | ||
npm install uglify-js | ||
./node_modules/.bin/uglifyjs $OUTPUT_PATH/$NAME.bundle.js -o $OUTPUT_PATH/$NAME.bundle.min.js | ||
|
||
# Copy the bundled files to the dist folder | ||
cp $OUTPUT_PATH/$NAME.bundle.* $DIST_PATH | ||
|
||
# Cleanup | ||
rm -rf $BUNDLER_PATH $OUTPUT_PATH |
Oops, something went wrong.