@rws-framework/ai-tools 2.0.2 → 2.0.3

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.
Files changed (2) hide show
  1. package/.bin/add-v.sh +85 -6
  2. package/package.json +4 -4
package/.bin/add-v.sh CHANGED
@@ -1,10 +1,89 @@
1
1
  #!/bin/bash
2
2
 
3
+ # Check if version argument is provided
4
+ if [ -z "$1" ]; then
5
+ echo "Error: Version argument is required"
6
+ echo "Usage: $0 <version>"
7
+ echo "Example: $0 1.2.4"
8
+ exit 1
9
+ fi
10
+
3
11
  export VERSION=$1
4
12
 
5
- git add .
6
- git commit -m "v$VERSION"
7
- git tag $VERSION
8
- git push
9
- git push origin $VERSION
10
- npm publish
13
+ # Validate version format (basic semver check)
14
+ if ! echo "$VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$'; then
15
+ echo "Error: Version must be in semver format (e.g., 1.2.3)"
16
+ exit 1
17
+ fi
18
+
19
+ # Check if we're in a git repository
20
+ if ! git rev-parse --git-dir >/dev/null 2>&1; then
21
+ echo "Error: Not in a git repository"
22
+ exit 1
23
+ fi
24
+
25
+ # Get list of changed files for commit message
26
+ CHANGED_FILES=$(git diff --name-only HEAD 2>/dev/null || echo "")
27
+ STAGED_FILES=$(git diff --cached --name-only 2>/dev/null || echo "")
28
+
29
+ # Combine changed and staged files
30
+ ALL_CHANGED_FILES="$CHANGED_FILES $STAGED_FILES"
31
+ ALL_CHANGED_FILES=$(echo "$ALL_CHANGED_FILES" | tr ' ' '\n' | sort -u | tr '\n' ' ' | sed 's/[[:space:]]*$//')
32
+
33
+ # Update package.json version
34
+ echo "Updating package.json version to $VERSION..."
35
+ npm version "$VERSION" --no-git-tag-version || {
36
+ echo "Error: Failed to update package.json version"
37
+ exit 1
38
+ }
39
+
40
+ # Add all changes
41
+ echo "Adding changes to git..."
42
+ git add . || {
43
+ echo "Error: Failed to add changes to git"
44
+ exit 1
45
+ }
46
+
47
+ # Create detailed commit message
48
+ if [ -n "$ALL_CHANGED_FILES" ]; then
49
+ COMMIT_MSG="v$VERSION
50
+
51
+ Changed files:
52
+ $(echo "$ALL_CHANGED_FILES" | tr ' ' '\n' | sed 's/^/- /' | grep -v '^- $')"
53
+ else
54
+ COMMIT_MSG="v$VERSION"
55
+ fi
56
+
57
+ # Commit with version and file list
58
+ echo "Committing version $VERSION..."
59
+ git commit -m "$COMMIT_MSG" || {
60
+ echo "Error: Failed to commit changes"
61
+ exit 1
62
+ }
63
+
64
+ # Create git tag
65
+ echo "Creating git tag $VERSION..."
66
+ git tag "$VERSION" || {
67
+ echo "Error: Failed to create git tag"
68
+ exit 1
69
+ }
70
+
71
+ # Push commits
72
+ echo "Pushing commits..."
73
+ git push || {
74
+ echo "Error: Failed to push commits"
75
+ exit 1
76
+ }
77
+
78
+ # Push tags
79
+ echo "Pushing tags..."
80
+ git push origin "$VERSION" || {
81
+ echo "Error: Failed to push tags"
82
+ exit 1
83
+ }
84
+
85
+ echo "Publishing to NPM..."
86
+
87
+ npm publish
88
+
89
+ echo "Successfully published version $VERSION!"
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@rws-framework/ai-tools",
3
3
  "private": false,
4
- "version": "2.0.2",
4
+ "version": "2.0.3",
5
5
  "description": "",
6
6
  "main": "src/index.ts",
7
7
  "scripts": {},
8
8
  "author": "papablack",
9
9
  "license": "ISC",
10
10
  "dependencies": {
11
- "@langchain/community": "^0.3.28",
12
- "@langchain/core": "^0.3.37",
11
+ "@langchain/community": "0.3.28",
12
+ "@langchain/core": "0.3.37",
13
13
  "@nestjs/common": "^10.3.2",
14
14
  "@nestjs/core": "^10.3.2",
15
+ "@rws-framework/server": "3.16.*",
15
16
  "@rws-framework/db": "*",
16
17
  "@rws-framework/console": "*",
17
- "@rws-framework/server": "^3.*",
18
18
  "uuid": "^9.0.0",
19
19
  "xml2js": "^0.6.2"
20
20
  },