Skip to content

Commit ab03c9b

Browse files
committed
Add build script and npm package template
* feat: added build script to compile GIV CLI * feat: created npm package.json template * chore: updated .gitignore to include build artifacts * chore: added .gitkeep files to build and dist directories
1 parent c65a027 commit ab03c9b

File tree

5 files changed

+29
-0
lines changed

5 files changed

+29
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ tests/.logs
88
tests/.tmp
99
bashdb-5.0-1.1.2
1010
changes.0.2.0.sh
11+
dist/npm/

build/.gitkeep

Whitespace-only changes.

build/build.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#! /bin/bash
2+
3+
BUILD_TEMP=$(mktemp -d)
4+
DIST_DIR="./dist"
5+
VERSION=$(sed -n 's/^__VERSION="\([^"]*\)"/\1/p' ../giv/src/giv.sh)
6+
printf "Building GIV CLI version %s...\n" "${VERSION}"
7+
# npm build section
8+
mkdir -p "${BUILD_TEMP}/npm"
9+
cp -r src templates "${BUILD_TEMP}/npm/"
10+
sed "s/{{VERSION}}/${VERSION}/g" build/npm/package.json.template > "${BUILD_TEMP}/npm/package.json"
11+
cp README.md "${BUILD_TEMP}/npm/" # Optional, but recommended
12+
# Copy BUILD_TEMP to DIST_DIR
13+
mkdir -p "${DIST_DIR}/npm"
14+
cp -r "${BUILD_TEMP}/npm"/* "${DIST_DIR}/npm/"
15+
16+
17+
printf "Build completed. Files are in %s\n" "${DIST_DIR}"

build/npm/package.json.template

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "giv",
3+
"version": "{{VERSION}}",
4+
"description": "Git history AI assistant CLI tool",
5+
"bin": { "giv": "src/giv.sh" },
6+
"files": [
7+
"src/",
8+
"templates/"
9+
],
10+
"preferGlobal": true
11+
}

dist/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)