chore: remove grunt and update build scripts (#7838)

* chore: prepare and pack scripts

* chore: update @types/node dep

* chore: remove prepare-dist command from pack-dist
This commit is contained in:
Svetoslav
2019-09-18 01:05:39 +03:00
committed by GitHub
parent a8680f0761
commit 25046c7f94
13 changed files with 206 additions and 788 deletions

69
build/prepare-dist.sh Executable file
View File

@@ -0,0 +1,69 @@
#!/bin/bash
set -x
set -e
DIST=dist;
ROOT_DIR=$(cd `dirname $0` && pwd)/..;
cd "$ROOT_DIR"
mkdir -p "$DIST"
## NPM INSTALL
(
echo "NPM install in root of the repo"
cd "$ROOT_DIR"
npm install
)
## Prepare Platfrom Declarations
(
PACKAGE=tns-platform-declarations;
echo "Clearing $DIST/$PACKAGE"
npx rimraf "$DIST/$PACKAGE"
npx rimraf "$DIST/$PACKAGE*.tgz"
echo "Copying $PACKAGE $DIST/$PACKAGE..."
npx ncp "$PACKAGE" "$DIST/$PACKAGE"
echo "Copying README and LICENSE to $DIST/$PACKAGE"
npx ncp LICENSE "$DIST/$PACKAGE"/LICENSE
cd "$DIST/$PACKAGE"
echo 'Running npm install...'
npm install
echo 'Running npm test...'
npm test
)
## Prepare Core Modules
(
PACKAGE=tns-core-modules;
echo "Clearing $DIST/$PACKAGE"
npx rimraf "$DIST/$PACKAGE"
npx rimraf "$DIST/$PACKAGE*.tgz"
echo "Copying $PACKAGE $DIST/$PACKAGE..."
npx ncp "$PACKAGE" "$DIST/$PACKAGE"
echo "Cleaning inner readme.md-s ..."
npx rimraf "$DIST/$PACKAGE/**/README.md"
npx rimraf "$DIST/$PACKAGE/**/Readme.md"
echo "Copying README and LICENSE to $DIST/$PACKAGE"
npx ncp LICENSE "$DIST"/"$PACKAGE"/LICENSE
npx ncp README.md "$DIST"/"$PACKAGE"/README.md
(
echo 'TypeScript transpile...'
cd "$DIST/$PACKAGE"
npm install
npx tsc
)
echo "Clearing typescript definitions from private APIs..."
node build/clear-private-definitions "$DIST/$PACKAGE"
)