Skip to content

Commit 9419ed7

Browse files
Dimitar TachevDimitar Tachev
authored andcommitted
chore: moved the plugin source to src folder.
1 parent e5eb041 commit 9419ed7

File tree

13 files changed

+68
-1
lines changed

13 files changed

+68
-1
lines changed

demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
"babel-types": "6.26.0",
2222
"babylon": "6.18.0",
2323
"lazy": "1.0.11",
24-
"nativescript-dev-sass": "file:.."
24+
"nativescript-dev-sass": "file:../src"
2525
}
2626
}

publish/pack.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/bin/bash
2+
3+
SOURCE_DIR=../src;
4+
TO_SOURCE_DIR=src;
5+
PACK_DIR=package;
6+
ROOT_DIR=..;
7+
PUBLISH=--publish
8+
9+
install(){
10+
npm i
11+
}
12+
13+
pack() {
14+
15+
echo 'Clearing /src and /package...'
16+
node_modules/.bin/rimraf "$TO_SOURCE_DIR"
17+
node_modules/.bin/rimraf "$PACK_DIR"
18+
19+
# copy src
20+
echo 'Copying src...'
21+
node_modules/.bin/ncp "$SOURCE_DIR" "$TO_SOURCE_DIR"
22+
23+
# copy README & LICENSE to src
24+
echo 'Copying README and LICENSE to /src...'
25+
node_modules/.bin/ncp "$ROOT_DIR"/LICENSE "$TO_SOURCE_DIR"/LICENSE
26+
node_modules/.bin/ncp "$ROOT_DIR"/README.md "$TO_SOURCE_DIR"/README.md
27+
28+
# compile package and copy files required by npm
29+
echo 'Building /src...'
30+
cd "$TO_SOURCE_DIR"
31+
node_modules/.bin/tsc
32+
cd ..
33+
34+
echo 'Creating package...'
35+
# create package dir
36+
mkdir "$PACK_DIR"
37+
38+
# create the package
39+
cd "$PACK_DIR"
40+
npm pack ../"$TO_SOURCE_DIR"
41+
42+
# delete source directory used to create the package
43+
cd ..
44+
node_modules/.bin/rimraf "$TO_SOURCE_DIR"
45+
}
46+
47+
install && pack

publish/package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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+
}

publish/publish.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)