@elizaos/cli 1.3.0 → 1.3.2
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.
- package/README.md +1 -1
- package/dist/{chunk-2CUIHNPL.js → chunk-5GUS4CFO.js} +7 -2
- package/dist/{chunk-2ALAPQLV.js → chunk-E6XYTE3A.js} +296 -311
- package/dist/chunk-GXWWPFBO.js +39 -0
- package/dist/{chunk-I77ZRNYO.js → chunk-T2QDIXGU.js} +2 -2
- package/dist/commands/agent/actions/index.d.ts +5 -0
- package/dist/commands/agent/actions/index.js +2 -2
- package/dist/commands/agent/index.d.ts +2 -2
- package/dist/commands/agent/index.js +2 -2
- package/dist/commands/create/actions/index.js +3 -3
- package/dist/commands/create/index.js +4 -4
- package/dist/commands/shared/index.d.ts +11 -28
- package/dist/commands/shared/index.js +7 -3
- package/dist/index.js +541 -450
- package/dist/{registry-N626N4VG.js → registry-433S5F3Y.js} +2 -2
- package/dist/templates/plugin-quick-starter/.gitignore +66 -0
- package/dist/templates/plugin-quick-starter/.npmignore +5 -0
- package/dist/templates/plugin-quick-starter/package.json +11 -3
- package/dist/templates/plugin-quick-starter/src/__tests__/plugin.test.ts +499 -146
- package/dist/templates/plugin-quick-starter/src/__tests__/test-utils.ts +316 -115
- package/dist/templates/plugin-quick-starter/src/plugin.ts +7 -13
- package/dist/templates/plugin-starter/.gitignore +66 -0
- package/dist/templates/plugin-starter/.npmignore +5 -0
- package/dist/templates/plugin-starter/README.md +1 -1
- package/dist/templates/plugin-starter/package.json +11 -3
- package/dist/templates/plugin-starter/src/__tests__/integration.test.ts +13 -13
- package/dist/templates/plugin-starter/src/__tests__/plugin.test.ts +556 -129
- package/dist/templates/plugin-starter/src/__tests__/test-utils.ts +347 -115
- package/dist/templates/plugin-starter/src/plugin.ts +18 -22
- package/dist/templates/project-starter/.gitignore +57 -0
- package/dist/templates/project-starter/.npmignore +11 -0
- package/dist/templates/project-starter/README.md +1 -1
- package/dist/templates/project-starter/package.json +4 -4
- package/dist/templates/project-starter/src/__tests__/env.test.ts +3 -1
- package/dist/templates/project-starter/src/__tests__/file-structure.test.ts +3 -2
- package/dist/templates/project-starter/src/__tests__/integration.test.ts +1 -1
- package/dist/templates/project-starter/tsup.config.ts +2 -1
- package/dist/templates/project-tee-starter/.dockerignore +64 -14
- package/dist/templates/project-tee-starter/.gitignore +57 -0
- package/dist/templates/project-tee-starter/.npmignore +6 -0
- package/dist/templates/project-tee-starter/Dockerfile +9 -5
- package/dist/templates/project-tee-starter/GUIDE.md +103 -42
- package/dist/templates/project-tee-starter/README.md +39 -19
- package/dist/templates/project-tee-starter/__tests__/build-order.test.ts +62 -0
- package/dist/templates/project-tee-starter/__tests__/character.test.ts +19 -17
- package/dist/templates/project-tee-starter/__tests__/config.test.ts +10 -3
- package/dist/templates/project-tee-starter/__tests__/env.test.ts +2 -1
- package/dist/templates/project-tee-starter/__tests__/file-structure.test.ts +14 -3
- package/dist/templates/project-tee-starter/__tests__/frontend.test.ts +459 -0
- package/dist/templates/project-tee-starter/__tests__/plugin.test.ts +4 -2
- package/dist/templates/project-tee-starter/__tests__/routes.test.ts +15 -6
- package/dist/templates/project-tee-starter/__tests__/tee-validation.test.ts +295 -0
- package/dist/templates/project-tee-starter/__tests__/vite-config-utils.ts +39 -0
- package/dist/templates/project-tee-starter/docker-compose.yaml +5 -2
- package/dist/templates/{plugin-starter/dist → project-tee-starter}/index.html +3 -3
- package/dist/templates/project-tee-starter/package.json +34 -14
- package/dist/templates/project-tee-starter/postcss.config.js +3 -0
- package/dist/templates/project-tee-starter/scripts/install-test-deps.js +52 -0
- package/dist/templates/project-tee-starter/scripts/test-all.sh +82 -0
- package/dist/templates/project-tee-starter/src/frontend/index.css +106 -0
- package/dist/templates/project-tee-starter/src/frontend/index.html +20 -0
- package/dist/templates/project-tee-starter/src/frontend/index.tsx +370 -0
- package/dist/templates/project-tee-starter/src/frontend/panels.tsx +17 -0
- package/dist/templates/project-tee-starter/src/frontend/utils.ts +6 -0
- package/dist/templates/project-tee-starter/src/index.ts +6 -6
- package/dist/templates/project-tee-starter/src/plugin.ts +209 -59
- package/dist/templates/project-tee-starter/tailwind.config.js +62 -0
- package/dist/templates/project-tee-starter/tsconfig.build.json +2 -2
- package/dist/templates/project-tee-starter/tsconfig.json +8 -5
- package/dist/templates/project-tee-starter/tsup.config.ts +3 -2
- package/dist/templates/project-tee-starter/vite.config.ts +39 -0
- package/dist/url-utils-CKc_Ebt_.d.ts +35 -0
- package/dist/{utils-H66532NB.js → utils-DBLSDYBF.js} +2 -2
- package/package.json +12 -7
- package/templates/plugin-quick-starter/.gitignore +66 -0
- package/templates/plugin-quick-starter/.npmignore +5 -0
- package/templates/plugin-quick-starter/package.json +11 -3
- package/templates/plugin-quick-starter/src/__tests__/plugin.test.ts +499 -146
- package/templates/plugin-quick-starter/src/__tests__/test-utils.ts +316 -115
- package/templates/plugin-quick-starter/src/plugin.ts +7 -13
- package/templates/plugin-starter/.gitignore +66 -0
- package/templates/plugin-starter/.npmignore +5 -0
- package/templates/plugin-starter/README.md +1 -1
- package/templates/plugin-starter/package.json +11 -3
- package/templates/plugin-starter/src/__tests__/integration.test.ts +13 -13
- package/templates/plugin-starter/src/__tests__/plugin.test.ts +556 -129
- package/templates/plugin-starter/src/__tests__/test-utils.ts +347 -115
- package/templates/plugin-starter/src/plugin.ts +18 -22
- package/templates/project-starter/.gitignore +57 -0
- package/templates/project-starter/.npmignore +11 -0
- package/templates/project-starter/README.md +1 -1
- package/templates/project-starter/package.json +4 -4
- package/templates/project-starter/src/__tests__/env.test.ts +3 -1
- package/templates/project-starter/src/__tests__/file-structure.test.ts +3 -2
- package/templates/project-starter/src/__tests__/integration.test.ts +1 -1
- package/templates/project-starter/tsup.config.ts +2 -1
- package/templates/project-tee-starter/.dockerignore +64 -14
- package/templates/project-tee-starter/.gitignore +57 -0
- package/templates/project-tee-starter/.npmignore +6 -0
- package/templates/project-tee-starter/Dockerfile +9 -5
- package/templates/project-tee-starter/GUIDE.md +103 -42
- package/templates/project-tee-starter/README.md +39 -19
- package/templates/project-tee-starter/__tests__/build-order.test.ts +62 -0
- package/templates/project-tee-starter/__tests__/character.test.ts +19 -17
- package/templates/project-tee-starter/__tests__/config.test.ts +10 -3
- package/templates/project-tee-starter/__tests__/env.test.ts +2 -1
- package/templates/project-tee-starter/__tests__/file-structure.test.ts +14 -3
- package/templates/project-tee-starter/__tests__/frontend.test.ts +459 -0
- package/templates/project-tee-starter/__tests__/plugin.test.ts +4 -2
- package/templates/project-tee-starter/__tests__/routes.test.ts +15 -6
- package/templates/project-tee-starter/__tests__/tee-validation.test.ts +295 -0
- package/templates/project-tee-starter/__tests__/vite-config-utils.ts +39 -0
- package/templates/project-tee-starter/docker-compose.yaml +5 -2
- package/templates/{plugin-starter/dist → project-tee-starter}/index.html +3 -3
- package/templates/project-tee-starter/package.json +34 -14
- package/templates/project-tee-starter/postcss.config.js +3 -0
- package/templates/project-tee-starter/scripts/install-test-deps.js +52 -0
- package/templates/project-tee-starter/scripts/test-all.sh +82 -0
- package/templates/project-tee-starter/src/frontend/index.css +106 -0
- package/templates/project-tee-starter/src/frontend/index.html +20 -0
- package/templates/project-tee-starter/src/frontend/index.tsx +370 -0
- package/templates/project-tee-starter/src/frontend/panels.tsx +17 -0
- package/templates/project-tee-starter/src/frontend/utils.ts +6 -0
- package/templates/project-tee-starter/src/index.ts +6 -6
- package/templates/project-tee-starter/src/plugin.ts +209 -59
- package/templates/project-tee-starter/tailwind.config.js +62 -0
- package/templates/project-tee-starter/tsconfig.build.json +2 -2
- package/templates/project-tee-starter/tsconfig.json +8 -5
- package/templates/project-tee-starter/tsup.config.ts +3 -2
- package/templates/project-tee-starter/vite.config.ts +39 -0
- package/dist/chunk-4O6EZU37.js +0 -14
- package/dist/migration-guides/advanced-migration-guide.md +0 -459
- package/dist/migration-guides/completion-requirements.md +0 -379
- package/dist/migration-guides/integrated-migration-loop.md +0 -392
- package/dist/migration-guides/migration-guide.md +0 -712
- package/dist/migration-guides/prompt-and-generation-guide.md +0 -702
- package/dist/migration-guides/state-and-providers-guide.md +0 -544
- package/dist/migration-guides/testing-guide.md +0 -1021
- package/dist/templates/plugin-starter/dist/assets/index-CgkejLs_.css +0 -1
- package/dist/templates/plugin-starter/dist/assets/index-D1cHX53P.js +0 -49
- package/dist/templates/plugin-starter/dist/index.js +0 -387
- package/dist/templates/plugin-starter/dist/index.js.map +0 -1
- package/templates/plugin-starter/dist/.vite/manifest.json +0 -11
- package/templates/plugin-starter/dist/assets/index-CgkejLs_.css +0 -1
- package/templates/plugin-starter/dist/assets/index-D1cHX53P.js +0 -49
- package/templates/plugin-starter/dist/index.d.ts +0 -14
- package/templates/plugin-starter/dist/index.js +0 -387
- package/templates/plugin-starter/dist/index.js.map +0 -1
|
@@ -1,379 +0,0 @@
|
|
|
1
|
-
# Final Setup Instructions Before Commit
|
|
2
|
-
|
|
3
|
-
This document outlines the essential steps to complete before committing and publishing the plugin. Please follow each step carefully to ensure proper configuration.
|
|
4
|
-
|
|
5
|
-
## 1. Configure .gitignore
|
|
6
|
-
|
|
7
|
-
Create or update the `.gitignore` file with the following minimum configuration:
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
dist
|
|
11
|
-
node_modules
|
|
12
|
-
.env
|
|
13
|
-
.elizadb
|
|
14
|
-
.turbo
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## 2. Configure .npmignore
|
|
18
|
-
|
|
19
|
-
Create or update the `.npmignore` file to ensure only necessary files are included in the npm package:
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
*
|
|
23
|
-
|
|
24
|
-
!dist/**
|
|
25
|
-
!package.json
|
|
26
|
-
!readme.md
|
|
27
|
-
!tsup.config.ts
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## 3. Add MIT License
|
|
31
|
-
|
|
32
|
-
Create a `LICENSE` file in the root directory with the following content:
|
|
33
|
-
|
|
34
|
-
```
|
|
35
|
-
MIT License
|
|
36
|
-
|
|
37
|
-
Copyright (c) 2025 Shaw Walters and elizaOS Contributors
|
|
38
|
-
|
|
39
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
40
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
41
|
-
in the Software without restriction, including without limitation the rights
|
|
42
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
43
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
44
|
-
furnished to do so, subject to the following conditions:
|
|
45
|
-
|
|
46
|
-
The above copyright notice and this permission notice shall be included in all
|
|
47
|
-
copies or substantial portions of the Software.
|
|
48
|
-
|
|
49
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
50
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
51
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
52
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
53
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
54
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
55
|
-
SOFTWARE.
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
## 4. Verify package.json
|
|
59
|
-
|
|
60
|
-
Ensure the `package.json` file contains all required fields:
|
|
61
|
-
|
|
62
|
-
### Basic Fields
|
|
63
|
-
|
|
64
|
-
- [ ] `name`: Package name (should match npm registry requirements)
|
|
65
|
-
- [ ] `version`: Semantic version (e.g., "1.0.0")
|
|
66
|
-
- [ ] `description`: Clear description of the plugin
|
|
67
|
-
- [ ] `main`: Entry point (typically "dist/index.js")
|
|
68
|
-
- [ ] `types`: TypeScript definitions (typically "dist/index.d.ts")
|
|
69
|
-
- [ ] `author`: Author information
|
|
70
|
-
- [ ] `license`: "MIT"
|
|
71
|
-
- [ ] `repository`: Git repository information
|
|
72
|
-
- [ ] `keywords`: Relevant keywords for npm search
|
|
73
|
-
- [ ] `scripts`: Build, test, and other necessary scripts
|
|
74
|
-
- [ ] `dependencies`: All runtime dependencies
|
|
75
|
-
- [ ] `devDependencies`: All development dependencies
|
|
76
|
-
- [ ] `peerDependencies`: If applicable (e.g., "@elizaos/core")
|
|
77
|
-
|
|
78
|
-
### Additional Important Fields
|
|
79
|
-
|
|
80
|
-
- [ ] `type`: Should be "module" for ESM modules
|
|
81
|
-
- [ ] `module`: Same as main for ESM (typically "dist/index.js")
|
|
82
|
-
- [ ] `exports`: Export configuration for modern bundlers
|
|
83
|
-
- [ ] `files`: Array of files/folders to include in npm package (typically ["dist"])
|
|
84
|
-
- [ ] `publishConfig`: Publishing configuration (e.g., `{"access": "public"}`)
|
|
85
|
-
|
|
86
|
-
Example exports configuration:
|
|
87
|
-
|
|
88
|
-
```json
|
|
89
|
-
"exports": {
|
|
90
|
-
"./package.json": "./package.json",
|
|
91
|
-
".": {
|
|
92
|
-
"import": {
|
|
93
|
-
"types": "./dist/index.d.ts",
|
|
94
|
-
"default": "./dist/index.js"
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
### Eliza Plugin Configuration (agentConfig)
|
|
101
|
-
|
|
102
|
-
For Eliza plugins, you MUST include the `agentConfig` section:
|
|
103
|
-
|
|
104
|
-
```json
|
|
105
|
-
"agentConfig": {
|
|
106
|
-
"pluginType": "elizaos:plugin:1.0.0",
|
|
107
|
-
"pluginParameters": {
|
|
108
|
-
"YOUR_PARAMETER_NAME": {
|
|
109
|
-
"type": "string",
|
|
110
|
-
"description": "Clear description of what this parameter does",
|
|
111
|
-
"required": true|false,
|
|
112
|
-
"sensitive": true|false,
|
|
113
|
-
"default": "optional-default-value"
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
#### Parameter Properties:
|
|
120
|
-
|
|
121
|
-
- `type`: Data type ("string", "number", "boolean", etc.)
|
|
122
|
-
- `description`: Clear explanation of the parameter's purpose
|
|
123
|
-
- `required`: Whether the parameter must be provided
|
|
124
|
-
- `sensitive`: Whether the parameter contains sensitive data (e.g., API keys)
|
|
125
|
-
- `default`: Optional default value if not required
|
|
126
|
-
|
|
127
|
-
#### Example for Avalanche Plugin:
|
|
128
|
-
|
|
129
|
-
```json
|
|
130
|
-
"agentConfig": {
|
|
131
|
-
"pluginType": "elizaos:plugin:1.0.0",
|
|
132
|
-
"pluginParameters": {
|
|
133
|
-
"AVALANCHE_PRIVATE_KEY": {
|
|
134
|
-
"type": "string",
|
|
135
|
-
"description": "Private key for interacting with Avalanche blockchain",
|
|
136
|
-
"required": true,
|
|
137
|
-
"sensitive": true
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
## 5. Review README.md
|
|
144
|
-
|
|
145
|
-
Verify that the README.md file includes:
|
|
146
|
-
|
|
147
|
-
- [ ] Clear project title and description
|
|
148
|
-
- [ ] Installation instructions
|
|
149
|
-
- [ ] Usage examples
|
|
150
|
-
- [ ] Configuration requirements
|
|
151
|
-
- [ ] API documentation (if applicable)
|
|
152
|
-
- [ ] Contributing guidelines
|
|
153
|
-
- [ ] License information
|
|
154
|
-
- [ ] Contact/support information
|
|
155
|
-
|
|
156
|
-
## Final Checklist
|
|
157
|
-
|
|
158
|
-
Before committing and publishing:
|
|
159
|
-
|
|
160
|
-
1. [ ] Run `bun run build` to ensure the project builds successfully
|
|
161
|
-
2. [ ] Run tests to verify functionality
|
|
162
|
-
3. [ ] Ensure all environment variables are documented
|
|
163
|
-
4. [ ] Remove any sensitive information or API keys
|
|
164
|
-
5. [ ] Verify all file paths and imports are correct
|
|
165
|
-
6. [ ] Check that the dist/ folder is properly generated
|
|
166
|
-
7. [ ] Confirm version number is appropriate for the release
|
|
167
|
-
|
|
168
|
-
## Notes
|
|
169
|
-
|
|
170
|
-
- The `.gitignore` prevents unnecessary files from being committed to the repository
|
|
171
|
-
- The `.npmignore` ensures only essential files are published to npm
|
|
172
|
-
- The LICENSE file is required for open-source distribution
|
|
173
|
-
- Proper package.json configuration is crucial for npm publishing and dependency management
|
|
174
|
-
|
|
175
|
-
## 6. GitHub Workflow for Automated NPM Release
|
|
176
|
-
|
|
177
|
-
### Prerequisites
|
|
178
|
-
|
|
179
|
-
### Adding the Release Workflow
|
|
180
|
-
|
|
181
|
-
Create the following file in your repository to enable automated npm publishing when the version changes:
|
|
182
|
-
|
|
183
|
-
**File Path:** `.github/workflows/npm-deploy.yml`
|
|
184
|
-
|
|
185
|
-
```yml
|
|
186
|
-
name: Publish Package
|
|
187
|
-
|
|
188
|
-
on:
|
|
189
|
-
push:
|
|
190
|
-
branches:
|
|
191
|
-
- 1.x
|
|
192
|
-
workflow_dispatch:
|
|
193
|
-
|
|
194
|
-
jobs:
|
|
195
|
-
verify_version:
|
|
196
|
-
runs-on: ubuntu-latest
|
|
197
|
-
outputs:
|
|
198
|
-
should_publish: ${{ steps.check.outputs.should_publish }}
|
|
199
|
-
version: ${{ steps.check.outputs.version }}
|
|
200
|
-
steps:
|
|
201
|
-
- name: Checkout repository
|
|
202
|
-
uses: actions/checkout@v4
|
|
203
|
-
with:
|
|
204
|
-
fetch-depth: 0
|
|
205
|
-
|
|
206
|
-
- name: Check if package.json version changed
|
|
207
|
-
id: check
|
|
208
|
-
run: |
|
|
209
|
-
echo "Current branch: ${{ github.ref }}"
|
|
210
|
-
|
|
211
|
-
# Get current version
|
|
212
|
-
CURRENT_VERSION=$(jq -r .version package.json)
|
|
213
|
-
echo "Current version: $CURRENT_VERSION"
|
|
214
|
-
|
|
215
|
-
# Get previous commit hash
|
|
216
|
-
git rev-parse HEAD~1 || git rev-parse HEAD
|
|
217
|
-
PREV_COMMIT=$(git rev-parse HEAD~1 2>/dev/null || git rev-parse HEAD)
|
|
218
|
-
|
|
219
|
-
# Check if package.json changed
|
|
220
|
-
if git diff --name-only HEAD~1 HEAD | grep "package.json"; then
|
|
221
|
-
echo "Package.json was changed in this commit"
|
|
222
|
-
|
|
223
|
-
# Get previous version if possible
|
|
224
|
-
if git show "$PREV_COMMIT:package.json" 2>/dev/null; then
|
|
225
|
-
PREV_VERSION=$(git show "$PREV_COMMIT:package.json" | jq -r .version)
|
|
226
|
-
echo "Previous version: $PREV_VERSION"
|
|
227
|
-
|
|
228
|
-
if [ "$CURRENT_VERSION" != "$PREV_VERSION" ]; then
|
|
229
|
-
echo "Version changed from $PREV_VERSION to $CURRENT_VERSION"
|
|
230
|
-
echo "should_publish=true" >> $GITHUB_OUTPUT
|
|
231
|
-
else
|
|
232
|
-
echo "Version unchanged"
|
|
233
|
-
echo "should_publish=false" >> $GITHUB_OUTPUT
|
|
234
|
-
fi
|
|
235
|
-
else
|
|
236
|
-
echo "First commit with package.json, will publish"
|
|
237
|
-
echo "should_publish=true" >> $GITHUB_OUTPUT
|
|
238
|
-
fi
|
|
239
|
-
else
|
|
240
|
-
echo "Package.json not changed in this commit"
|
|
241
|
-
echo "should_publish=false" >> $GITHUB_OUTPUT
|
|
242
|
-
fi
|
|
243
|
-
|
|
244
|
-
echo "version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
|
|
245
|
-
|
|
246
|
-
publish:
|
|
247
|
-
needs: verify_version
|
|
248
|
-
if: needs.verify_version.outputs.should_publish == 'true'
|
|
249
|
-
runs-on: ubuntu-latest
|
|
250
|
-
permissions:
|
|
251
|
-
contents: write
|
|
252
|
-
steps:
|
|
253
|
-
- name: Checkout repository
|
|
254
|
-
uses: actions/checkout@v4
|
|
255
|
-
with:
|
|
256
|
-
fetch-depth: 0
|
|
257
|
-
|
|
258
|
-
- name: Create Git tag
|
|
259
|
-
run: |
|
|
260
|
-
git config user.name "github-actions[bot]"
|
|
261
|
-
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
262
|
-
git tag -a "v${{ needs.verify_version.outputs.version }}" -m "Release v${{ needs.verify_version.outputs.version }}"
|
|
263
|
-
git push origin "v${{ needs.verify_version.outputs.version }}"
|
|
264
|
-
env:
|
|
265
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
266
|
-
|
|
267
|
-
- name: Setup Bun
|
|
268
|
-
uses: oven-sh/setup-bun@v2
|
|
269
|
-
|
|
270
|
-
- name: Install dependencies
|
|
271
|
-
run: bun install
|
|
272
|
-
|
|
273
|
-
- name: Build package
|
|
274
|
-
run: bun run build
|
|
275
|
-
|
|
276
|
-
- name: Publish to npm
|
|
277
|
-
run: bun publish
|
|
278
|
-
env:
|
|
279
|
-
NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
280
|
-
|
|
281
|
-
create_release:
|
|
282
|
-
needs: [verify_version, publish]
|
|
283
|
-
if: needs.verify_version.outputs.should_publish == 'true'
|
|
284
|
-
runs-on: ubuntu-latest
|
|
285
|
-
permissions:
|
|
286
|
-
contents: write
|
|
287
|
-
steps:
|
|
288
|
-
- name: Create GitHub Release
|
|
289
|
-
uses: actions/create-release@v1
|
|
290
|
-
env:
|
|
291
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
292
|
-
with:
|
|
293
|
-
tag_name: 'v${{ needs.verify_version.outputs.version }}'
|
|
294
|
-
release_name: 'v${{ needs.verify_version.outputs.version }}'
|
|
295
|
-
body: 'Release v${{ needs.verify_version.outputs.version }}'
|
|
296
|
-
draft: false
|
|
297
|
-
prerelease: false
|
|
298
|
-
```
|
|
299
|
-
|
|
300
|
-
### How This Workflow Works
|
|
301
|
-
|
|
302
|
-
1. **Triggers on:**
|
|
303
|
-
|
|
304
|
-
- Push to the 1.x branch
|
|
305
|
-
- Manual workflow dispatch
|
|
306
|
-
|
|
307
|
-
2. **Version Check:**
|
|
308
|
-
|
|
309
|
-
- Compares the current package.json version with the previous commit
|
|
310
|
-
- Only proceeds if the version has changed
|
|
311
|
-
|
|
312
|
-
3. **Publishing Steps:**
|
|
313
|
-
- Creates a git tag with the version
|
|
314
|
-
- Builds the package using Bun
|
|
315
|
-
- Publishes to npm using the NPM_TOKEN secret
|
|
316
|
-
- Creates a GitHub release
|
|
317
|
-
|
|
318
|
-
### Setting Up NPM Token
|
|
319
|
-
|
|
320
|
-
1. Go to your GitHub repository settings
|
|
321
|
-
2. Navigate to Settings → Secrets and variables → Actions
|
|
322
|
-
3. Add a new repository secret named `NPM_TOKEN`
|
|
323
|
-
4. Use your npm access token as the value
|
|
324
|
-
|
|
325
|
-
## 7. Code Formatting with Prettier
|
|
326
|
-
|
|
327
|
-
Before finalizing the plugin, ensure consistent code formatting:
|
|
328
|
-
|
|
329
|
-
### Install Prettier (if not already installed)
|
|
330
|
-
|
|
331
|
-
```bash
|
|
332
|
-
bun add -d prettier
|
|
333
|
-
```
|
|
334
|
-
|
|
335
|
-
### Add Prettier Configuration
|
|
336
|
-
|
|
337
|
-
Required config don't hallucinate and add anything else!
|
|
338
|
-
|
|
339
|
-
Create a `.prettierrc` file in the root directory:
|
|
340
|
-
|
|
341
|
-
```json
|
|
342
|
-
{
|
|
343
|
-
"semi": true,
|
|
344
|
-
"trailingComma": "es5",
|
|
345
|
-
"singleQuote": false,
|
|
346
|
-
"printWidth": 80,
|
|
347
|
-
"tabWidth": 2,
|
|
348
|
-
"useTabs": false,
|
|
349
|
-
"arrowParens": "always",
|
|
350
|
-
"endOfLine": "lf"
|
|
351
|
-
}
|
|
352
|
-
```
|
|
353
|
-
|
|
354
|
-
### Add Format Script to package.json
|
|
355
|
-
|
|
356
|
-
```json
|
|
357
|
-
"scripts": {
|
|
358
|
-
"format": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,md}\"",
|
|
359
|
-
"format:check": "prettier --check \"src/**/*.{ts,tsx,js,jsx,json,md}\""
|
|
360
|
-
}
|
|
361
|
-
```
|
|
362
|
-
|
|
363
|
-
### Run Prettier
|
|
364
|
-
|
|
365
|
-
```bash
|
|
366
|
-
bun run format
|
|
367
|
-
```
|
|
368
|
-
|
|
369
|
-
## Final Steps Before Committing to 1.x Branch
|
|
370
|
-
|
|
371
|
-
1. [ ] Ensure all files listed in this document are created
|
|
372
|
-
2. [ ] Run the build to verify everything compiles
|
|
373
|
-
3. [ ] Run prettier to format all code consistently
|
|
374
|
-
4. [ ] Test the package locally if possible
|
|
375
|
-
5. [ ] Commit all changes with a clear message
|
|
376
|
-
6. [ ] Push to the 1.x branch
|
|
377
|
-
7. [ ] Verify the GitHub Action runs successfully on first push
|
|
378
|
-
|
|
379
|
-
This completes the plugin migration to the standardized structure for the 1.x branch.
|