-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
38 lines (27 loc) · 1.08 KB
/
build.sh
File metadata and controls
38 lines (27 loc) · 1.08 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
#!/usr/bin/env bash
set -e
# Clean out old build folders
echo "[1] Cleaning previous build artifacts..."
rm -rf dist/ docs/ coverage/ *.tgz
#Generate new HTML documentation with Typedoc
echo "[2] Generating documentation with Typedoc into docs/..."
# Make sure typedoc is installed: npm install --save-dev typedoc
# typedoc will read tsconfig.json by default; override if needed.
npx typedoc --out docs src/index.ts
# Run tests
echo "[3] Running tests with Jest..."
# Run the teset Make sure jest is installed
npm run test
# Compile TypeScript to JavaScript (into dist/) buil process
echo "[4] Compiling TypeScript to JavaScript (npm run build)..."
# build script should be defined in package.json, e.g. "tsc --project tsconfig.json"
npm run build
# Bundle the browser-friendly bundle with Webpack
echo "[5] Bundling for browser (npm run bundle)..."
npm run bundle
# (Optional) Pack for verification (npm pack)
echo "[6] Creating a tarball via npm pack to verify packaging..."
# This generates cloudofficeprint-javascript-.tgz in the root dic
npm pack
echo
echo "build.sh completed all steps."