Build and push

This commit is contained in:
Max Lynch
2017-02-07 14:51:40 -06:00
parent f13a007a1c
commit 03254ad4b7
8 changed files with 49 additions and 62 deletions
+6 -9
View File
@@ -1,6 +1,6 @@
{
"name": "ionic-native",
"version": "2.4.1",
"version": "3.0.0-alpha.0",
"description": "Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support",
"main": "dist/es5/index.js",
"module": "dist/esm/index.js",
@@ -50,14 +50,11 @@
"test:watch": "npm test -- --watch",
"start": "npm run test:watch",
"lint": "gulp lint",
"build": "npm run lint && npm run build:js && npm run build:esm && npm run build:bundle && npm run build:minify",
"build:jscore2": "tsc -p scripts/build/tsconfig-core.json",
"build:js2": "sh scripts/build/build.sh",
"build:js": "tsc -p tsconfig-es5.json",
"build:esm": "tsc -p tsconfig-esm.json",
"build:bundle": "browserify dist/es5/index.js > dist/ionic.native.js",
"build:minify": "gulp minify:dist",
"shipit": "npm run build && npm publish && bash ./scripts/bower.sh",
"build": "npm run lint && npm run build:core && npm run build:modules",
"build:core": "tsc -p scripts/build/tsconfig-core.json",
"build:modules": "sh scripts/build/build.sh",
"shipit": "npm run build && npm run npmpub",
"npmpub": "sh scripts/build/publish.sh",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
"plugin:create": "gulp plugin:create"
},
+13 -3
View File
@@ -1,26 +1,36 @@
#tsc -p tsconfig-core.json
VERSION=$(node -p -e "require('./package.json').version")
PLUGINS="./src/@ionic-native/plugins/*"
CORE_PACKAGE_JSON=`cat ./scripts/build/core-package.json.template`
PLUGIN_TSCONFIG=`cat ./scripts/build/tsconfig-plugin.json.template`
PLUGIN_PACKAGE_JSON=`cat ./scripts/build/plugin-package.json.template`
BUILD_TMP='.tmp'
BUILD_PLUGINS_DIST='dist/packages-dist/@ionic-native/plugins/'
BUILD_PLUGINS_DIST='dist/packages-dist/@ionic-native/plugins'
BUILD_CORE_DIST='dist/packages-dist/@ionic-native/core/'
# Clean the old build dir
rm -rf $BUILD_TMP
# Make it again
mkdir $BUILD_TMP
NEW_CORE_PACKAGE_JSON="$(echo "$CORE_PACKAGE_JSON" | sed "s/{{VERSION}}/$VERSION/g")"
echo "$NEW_CORE_PACKAGE_JSON" > "$BUILD_CORE_DIST/$BASE/package.json"
# For each plugin, replace the values in tsconfig w/ the appropriate ones for this plugin
for d in $PLUGINS ; do
BASE=`basename $d`
echo "Building plugin $BASE"
PLUGIN_BUILD_DIR="$BUILD_TMP/plugins/$BASE"
# Make the tmp build dir
mkdir -p "$PLUGIN_BUILD_DIR"
NEW_TSCONFIG="$(echo "$PLUGIN_TSCONFIG" | sed "s/{{PLUGIN}}/$BASE/g")"
NEW_PACKAGE_JSON="$(echo "$PLUGIN_PACKAGE_JSON" | sed "s/{{PLUGIN}}/$BASE/g;s/{{VERSION}}/$VERSION/g")"
echo "$NEW_TSCONFIG" > "$PLUGIN_BUILD_DIR/tsconfig.json"
echo "$NEW_PACKAGE_JSON" > "$BUILD_PLUGINS_DIST/$BASE/package.json"
./node_modules/.bin/tsc -p "$PLUGIN_BUILD_DIR/tsconfig.json"
echo "$NEW_PACKAGE_JSON" > "$BUILD_PLUGINS_DIST/$BASE/package.json"
done
+17
View File
@@ -0,0 +1,17 @@
{
"name": "@ionic-native/core",
"version": "{{VERSION}}",
"description": "Ionic Native - Native plugins for ionic apps",
"module": "index.js",
"typings": "index.d.ts",
"author": "ionic",
"license": "MIT",
"peerDependencies": {
"rxjs": "^5.0.1",
"zone.js": "^0.7.2"
},
"repository": {
"type": "git",
"url": "https://github.com/driftyco/ionic-native.git"
}
}
+13
View File
@@ -0,0 +1,13 @@
CORE="./dist/packages-dist/@ionic-native/core/"
PLUGINS="./src/@ionic-native/plugins/*"
BUILD_PLUGINS_DIST='dist/packages-dist/@ionic-native/plugins'
echo "Publishing @ionic-native/core"
npm publish "$CORE" --access public
# For each plugin, replace the values in tsconfig w/ the appropriate ones for this plugin
for d in $PLUGINS ; do
BASE=`basename $d`
echo "Publishing @ionic-native/$BASE"
npm publish "$BUILD_PLUGINS_DIST/$BASE/" --access public
done
-15
View File
@@ -1,15 +0,0 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "ES5",
"sourceMap": true,
"declaration": true,
"experimentalDecorators": true,
"outDir": "dist/es5",
"moduleResolution": "node"
},
"files": [
"typings/es6-shim/es6-shim.d.ts",
"src/index.ts"
]
}
-15
View File
@@ -1,15 +0,0 @@
{
"compilerOptions": {
"module": "es2015",
"target": "ES5",
"sourceMap": true,
"declaration": true,
"experimentalDecorators": true,
"outDir": "dist/esm",
"moduleResolution": "node"
},
"files": [
"typings/es6-shim/es6-shim.d.ts",
"src/index.ts"
]
}
-15
View File
@@ -1,15 +0,0 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "ES5",
"sourceMap": true,
"declaration": true,
"experimentalDecorators": true,
"outDir": "dist",
"moduleResolution": "node"
},
"files": [
"typings/es6-shim/es6-shim.d.ts",
"src/index.ts"
]
}
-5
View File
@@ -1,5 +0,0 @@
{
"globalDevDependencies": {
"jasmine": "registry:dt/jasmine#2.2.0+20160621224255"
}
}