File tree 6 files changed +75
-4
lines changed
6 files changed +75
-4
lines changed Original file line number Diff line number Diff line change 7
7
"id" : " org.nativescript.demo" ,
8
8
"tns-android" : {
9
9
"version" : " 3.4.1"
10
+ },
11
+ "tns-ios" : {
12
+ "version" : " 3.4.1"
10
13
}
11
14
},
12
15
"dependencies" : {
Original file line number Diff line number Diff line change 1
1
{
2
2
"scripts" : {
3
- "tsc" : " cd src && npm i && npm run tsc" ,
3
+ "tsc" : " cd src && npm i && tsc" ,
4
4
"start-server" : " cd demo-server && npm i && node server.js 8080" ,
5
5
"start-demo" : " npm run start-demo-android" ,
6
6
"start-demo-android" : " npm run tsc && cd demo && npm i && tns run android" ,
7
7
"start-demo-ios" : " npm run tsc && cd demo && npm i && tns run ios"
8
8
}
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 35
35
"typescript" : " ~2.7.1"
36
36
},
37
37
"scripts" : {
38
- "tsc " : " tsc" ,
38
+ "build " : " npm i && tsc" ,
39
39
"prepack" : " tsc"
40
40
}
41
- }
41
+ }
You can’t perform that action at this time.
0 commit comments