-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Expand file tree
/
Copy pathprepare-core.sh
More file actions
executable file
·80 lines (59 loc) · 1.78 KB
/
prepare-core.sh
File metadata and controls
executable file
·80 lines (59 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/bin/bash
##
# Prepares the tns-platform-declarations and @nativescript/core packages inside dist folder
##
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=nativescript-core;
echo "Clearing $DIST/$PACKAGE"
npx rimraf "$DIST/$PACKAGE"
npx rimraf "$DIST/$PACKAGE*.tgz"
# TODO: restore extractor (need typings to be auto generated)
# npm run api-extractor-ci
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
(
cd "$DIST/$PACKAGE"
npm install
)
# Aways execute npx tsc from repo root to use the local typescript
echo 'TypeScript transpile...'
npx tsc -v
npx tsc -p "$DIST/$PACKAGE"
echo "Clearing typescript definitions from private APIs..."
npx ts-node --project ./build/tsconfig.json build/clear-private-definitions "$DIST/$PACKAGE"
)