Skip to content

Commit 923b3d8

Browse files
committed
migrated to 1.x code
1 parent 26f5e3c commit 923b3d8

31 files changed

+2259
-624
lines changed

.github/workflows/npm-deploy.yml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: Publish Package
2+
3+
on:
4+
push:
5+
branches:
6+
- 1.x
7+
workflow_dispatch:
8+
9+
jobs:
10+
verify_version:
11+
runs-on: ubuntu-latest
12+
outputs:
13+
should_publish: ${{ steps.check.outputs.should_publish }}
14+
version: ${{ steps.check.outputs.version }}
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Check if package.json version changed
22+
id: check
23+
run: |
24+
echo "Current branch: ${{ github.ref }}"
25+
26+
# Get current version
27+
CURRENT_VERSION=$(jq -r .version package.json)
28+
echo "Current version: $CURRENT_VERSION"
29+
30+
# Get previous commit hash
31+
git rev-parse HEAD~1 || git rev-parse HEAD
32+
PREV_COMMIT=$(git rev-parse HEAD~1 2>/dev/null || git rev-parse HEAD)
33+
34+
# Check if package.json changed
35+
if git diff --name-only HEAD~1 HEAD | grep "package.json"; then
36+
echo "Package.json was changed in this commit"
37+
38+
# Get previous version if possible
39+
if git show "$PREV_COMMIT:package.json" 2>/dev/null; then
40+
PREV_VERSION=$(git show "$PREV_COMMIT:package.json" | jq -r .version)
41+
echo "Previous version: $PREV_VERSION"
42+
43+
if [ "$CURRENT_VERSION" != "$PREV_VERSION" ]; then
44+
echo "Version changed from $PREV_VERSION to $CURRENT_VERSION"
45+
echo "should_publish=true" >> $GITHUB_OUTPUT
46+
else
47+
echo "Version unchanged"
48+
echo "should_publish=false" >> $GITHUB_OUTPUT
49+
fi
50+
else
51+
echo "First commit with package.json, will publish"
52+
echo "should_publish=true" >> $GITHUB_OUTPUT
53+
fi
54+
else
55+
echo "Package.json not changed in this commit"
56+
echo "should_publish=false" >> $GITHUB_OUTPUT
57+
fi
58+
59+
echo "version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
60+
61+
publish:
62+
needs: verify_version
63+
if: needs.verify_version.outputs.should_publish == 'true'
64+
runs-on: ubuntu-latest
65+
permissions:
66+
contents: write
67+
steps:
68+
- name: Checkout repository
69+
uses: actions/checkout@v4
70+
with:
71+
fetch-depth: 0
72+
73+
- name: Create Git tag
74+
run: |
75+
git config user.name "github-actions[bot]"
76+
git config user.email "github-actions[bot]@users.noreply.github.com"
77+
git tag -a "v${{ needs.verify_version.outputs.version }}" -m "Release v${{ needs.verify_version.outputs.version }}"
78+
git push origin "v${{ needs.verify_version.outputs.version }}"
79+
env:
80+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
81+
82+
- name: Setup Bun
83+
uses: oven-sh/setup-bun@v2
84+
85+
- name: Install dependencies
86+
run: bun install
87+
88+
- name: Build package
89+
run: bun run build
90+
91+
- name: Publish to npm
92+
run: bun publish
93+
env:
94+
NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }}
95+
96+
create_release:
97+
needs: [verify_version, publish]
98+
if: needs.verify_version.outputs.should_publish == 'true'
99+
runs-on: ubuntu-latest
100+
permissions:
101+
contents: write
102+
steps:
103+
- name: Create GitHub Release
104+
uses: actions/create-release@v1
105+
env:
106+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
107+
with:
108+
tag_name: 'v${{ needs.verify_version.outputs.version }}'
109+
release_name: 'v${{ needs.verify_version.outputs.version }}'
110+
body: 'Release v${{ needs.verify_version.outputs.version }}'
111+
draft: false
112+
prerelease: false

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1+
dist
12
node_modules
3+
.env
4+
.elizadb
25
.turbo

.npmignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*
2+
3+
!dist/**
4+
!package.json
5+
!readme.md
6+
!tsup.config.ts

.prettierrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"semi": true,
3+
"trailingComma": "es5",
4+
"singleQuote": false,
5+
"printWidth": 80,
6+
"tabWidth": 2,
7+
"useTabs": false,
8+
"arrowParens": "always",
9+
"endOfLine": "lf"
10+
}

.turbo/turbo-build.log

Lines changed: 0 additions & 18 deletions
This file was deleted.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Shaw Walters and elizaOS Contributors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ This plugin provides functionality to:
1515
## Installation
1616

1717
```bash
18-
npm install @elizaos/plugin-whatsapp
18+
bun add @elizaos/plugin-whatsapp
1919
```
2020

2121
## Configuration
@@ -174,19 +174,19 @@ interface WhatsAppTemplate {
174174
### Building
175175

176176
```bash
177-
npm run build
177+
bun run build
178178
```
179179

180180
### Testing
181181

182182
```bash
183-
npm run test
183+
bun test
184184
```
185185

186186
### Linting
187187

188188
```bash
189-
npm run lint
189+
bun run lint
190190
```
191191

192192
## Security Best Practices

__tests__/client.test.ts

Lines changed: 0 additions & 120 deletions
This file was deleted.

0 commit comments

Comments
 (0)