@dlnk/cli 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,87 @@
1
+ #!/usr/bin/env bash
2
+ # dlnk-release.sh — Local CI/CD replacement for GitHub Actions
3
+ # Usage: bash dlnk-release.sh [patch|minor|major]
4
+ set -e
5
+
6
+ PROJECT="/home/donla/projects/dlnk-cli"
7
+ REPO="MutiAgentic/Dlnk"
8
+ NPM_TOKEN="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"
9
+
10
+ cd "$PROJECT"
11
+
12
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
13
+ echo " dLNk Release Pipeline"
14
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
15
+
16
+ # ── 1. Bump version ──────────────────────────────────────────
17
+ BUMP=${1:-patch}
18
+ CURRENT=$(node -p "require('./package.json').version")
19
+
20
+ IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT"
21
+ case "$BUMP" in
22
+ major) MAJOR=$((MAJOR+1)); MINOR=0; PATCH=0 ;;
23
+ minor) MINOR=$((MINOR+1)); PATCH=0 ;;
24
+ patch) PATCH=$((PATCH+1)) ;;
25
+ esac
26
+ NEW_VERSION="$MAJOR.$MINOR.$PATCH"
27
+
28
+ python3 -c "
29
+ import json
30
+ with open('package.json') as f: d = json.load(f)
31
+ d['version'] = '$NEW_VERSION'
32
+ with open('package.json', 'w') as f: json.dump(d, f, indent=2)
33
+ "
34
+ echo "✓ Version: $CURRENT → $NEW_VERSION"
35
+
36
+ # ── 2. Build TypeScript ──────────────────────────────────────
37
+ echo "⚡ Building TypeScript..."
38
+ npm run build
39
+ echo "✓ Build complete"
40
+
41
+ # ── 3. Package binaries ──────────────────────────────────────
42
+ echo "📦 Packaging binaries..."
43
+ npx pkg dist/index.js \
44
+ --targets node18-linux-x64,node18-win-x64 \
45
+ --output bin/dlnk \
46
+ 2>&1 | grep -v "^>" | grep -v "Warning" || true
47
+ echo "✓ Binaries: $(ls -lh bin/ | grep dlnk | awk '{print $5, $9}' | tr '\n' ' ')"
48
+
49
+ # ── 4. Git commit + tag ──────────────────────────────────────
50
+ echo "📝 Committing..."
51
+ # Remove npmrc before commit
52
+ echo "" > .npmrc
53
+ git add -A
54
+ git commit -m "release: v$NEW_VERSION" --allow-empty
55
+
56
+ # Rewrite to strip any accidental secrets
57
+ git filter-branch --force --index-filter \
58
+ 'git rm --cached --ignore-unmatch .npmrc' \
59
+ --prune-empty --tag-name-filter cat -- HEAD 2>&1 | grep -v "^Ref" || true
60
+
61
+ git tag "v$NEW_VERSION"
62
+ git push origin main --force --tags 2>&1 | grep -E "->|error" | head -5
63
+ echo "✓ Pushed to GitHub"
64
+
65
+ # ── 5. GitHub Release ────────────────────────────────────────
66
+ echo "🚀 Creating GitHub Release..."
67
+ gh release create "v$NEW_VERSION" \
68
+ bin/dlnk-linux \
69
+ bin/dlnk-win.exe \
70
+ --repo "$REPO" \
71
+ --title "dLNk CLI v$NEW_VERSION" \
72
+ --generate-notes 2>&1 | tail -2
73
+ echo "✓ GitHub Release created"
74
+
75
+ # ── 6. npm publish ───────────────────────────────────────────
76
+ echo "📤 Publishing to npm..."
77
+ echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
78
+ npm publish --access public 2>&1 | grep -E "^\+|error" | head -3
79
+ echo "" > .npmrc
80
+ echo "✓ npm published"
81
+
82
+ echo ""
83
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
84
+ echo " ✅ Released v$NEW_VERSION"
85
+ echo " npm: https://www.npmjs.com/package/@dlnk/cli"
86
+ echo " gh: https://github.com/$REPO/releases/tag/v$NEW_VERSION"
87
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dlnk/cli",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "AI Agent CLI \u2014 Powered by dLNk",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -26,7 +26,8 @@
26
26
  "commander": "^14.0.3",
27
27
  "figlet": "^1.11.0",
28
28
  "node-fetch": "^3.3.2",
29
- "ora": "^9.3.0"
29
+ "ora": "^9.3.0",
30
+ "zod": "^4.3.6"
30
31
  },
31
32
  "devDependencies": {
32
33
  "@types/node": "^25.5.2",