File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77 "id" : " org.nativescript.demo" ,
88 "tns-android" : {
99 "version" : " 3.4.1"
10+ },
11+ "tns-ios" : {
12+ "version" : " 3.4.1"
1013 }
1114 },
1215 "dependencies" : {
Original file line number Diff line number Diff line change 11{
22 "scripts" : {
3- "tsc" : " cd src && npm i && npm run tsc" ,
3+ "tsc" : " cd src && npm i && tsc" ,
44 "start-server" : " cd demo-server && npm i && node server.js 8080" ,
55 "start-demo" : " npm run start-demo-android" ,
66 "start-demo-android" : " npm run tsc && cd demo && npm i && tns run android" ,
77 "start-demo-ios" : " npm run tsc && cd demo && npm i && tns run ios"
88 }
9- }
9+ }
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -e
3+ CURRENT_DIR=$( pwd)
4+ SOURCE_DIR=../src;
5+ TO_SOURCE_DIR=src;
6+ PACK_DIR=package;
7+ ROOT_DIR=..;
8+ PUBLISH=--publish
9+
10+ install (){
11+ npm i
12+ }
13+
14+ pack () {
15+
16+ echo ' Clearing /src and /package...'
17+ node_modules/.bin/rimraf " $TO_SOURCE_DIR "
18+ node_modules/.bin/rimraf " $PACK_DIR "
19+
20+ # build plugin
21+ echo ' Building plugin...'
22+ cd " $SOURCE_DIR "
23+ npm run build
24+ cd " $CURRENT_DIR "
25+
26+ # copy plugin
27+ echo ' Copying plugin source...'
28+ node_modules/.bin/ncp " $SOURCE_DIR " " $TO_SOURCE_DIR "
29+
30+ # copy README & LICENSE to src
31+ echo ' Copying README and LICENSE to /src...'
32+ node_modules/.bin/ncp " $ROOT_DIR " /LICENSE " $TO_SOURCE_DIR " /LICENSE
33+ node_modules/.bin/ncp " $ROOT_DIR " /README.md " $TO_SOURCE_DIR " /README.md
34+
35+ echo ' Creating package...'
36+ # create package dir
37+ mkdir " $PACK_DIR "
38+
39+ # create the package
40+ cd " $PACK_DIR "
41+ npm pack ../" $TO_SOURCE_DIR "
42+
43+ # delete source directory used to create the package
44+ cd ..
45+ node_modules/.bin/rimraf " $TO_SOURCE_DIR "
46+ }
47+
48+ install && pack
Original file line number Diff line number Diff line change 1+ {
2+ "name" : " nativescript-publish" ,
3+ "version" : " 1.0.0" ,
4+ "description" : " Publish helper" ,
5+ "devDependencies" : {
6+ "ncp" : " ^2.0.0" ,
7+ "rimraf" : " ^2.5.0"
8+ }
9+ }
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ PACK_DIR=package;
4+
5+ publish () {
6+ cd $PACK_DIR
7+ echo ' Publishing to npm...'
8+ npm publish * .tgz
9+ }
10+
11+ ./pack.sh && publish
Original file line number Diff line number Diff line change 3535 "typescript" : " ~2.7.1"
3636 },
3737 "scripts" : {
38- "tsc " : " tsc" ,
38+ "build " : " npm i && tsc" ,
3939 "prepack" : " tsc"
4040 }
41- }
41+ }
You can’t perform that action at this time.
0 commit comments