Skip to content

Commit 9f8be2b

Browse files
authored
Merge pull request #2 from appwrite/prepare-publish
chore: add workflow to publush package
2 parents dcc2b5f + 3ba8d46 commit 9f8be2b

File tree

3 files changed

+44
-8
lines changed

3 files changed

+44
-8
lines changed

.github/workflows/publish.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Publish to NPM
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Use Node.js
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: "20.x"
19+
registry-url: "https://registry.npmjs.org"
20+
21+
- name: Determine release tag
22+
id: release_tag
23+
run: |
24+
if [[ "${{ github.ref }}" == *"-rc"* ]] || [[ "${{ github.ref }}" == *"-RC"* ]]; then
25+
echo "tag=next" >> "$GITHUB_OUTPUT"
26+
else
27+
echo "tag=latest" >> "$GITHUB_OUTPUT"
28+
fi
29+
30+
- name: Install dependencies and build
31+
run: |
32+
npm install
33+
npm run build
34+
35+
- name: Publish
36+
run: npm publish --tag ${{ steps.release_tag.outputs.tag }}
37+
env:
38+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ Operating system gateway for remote serverless environments. Synapse provides a
3232
## Installation
3333

3434
```bash
35-
npm install synapse
35+
npm install @appwrite.io/synapse
3636
```
3737

3838
## Usage
3939

4040
### Basic Setup
4141

4242
```typescript
43-
import { Synapse, Terminal } from "synapse";
43+
import { Synapse, Terminal } from "@appwrite.io/synapse";
4444

4545
// Initialize Synapse for WebSocket communication
4646
const synapse = new Synapse();
@@ -56,15 +56,15 @@ const terminal = new Terminal(synapse);
5656

5757
```typescript
5858
// Send commands to the terminal
59-
terminal.write("ls -la");
59+
terminal.createCommand("ls -la");
6060

6161
// Handle terminal output
6262
terminal.onData((data) => {
6363
console.log("Terminal output:", data);
6464
});
6565

6666
// Resize terminal
67-
terminal.resize(80, 24);
67+
terminal.updateSize(80, 24);
6868

6969
// Kill terminal
7070
terminal.kill();

package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "synapse",
2+
"name": "@appwrite.io/synapse",
33
"version": "0.1.0",
44
"description": "Operating system gateway for remote serverless environments",
55
"main": "dist/index.js",
@@ -14,14 +14,12 @@
1414
"test:coverage": "jest --coverage",
1515
"lint": "eslint src/**/*.ts",
1616
"format": "prettier --write .",
17-
"prepare": "npm run build",
18-
"prepublishOnly": "npm test && npm run lint"
17+
"prepare": "npm run build"
1918
},
2019
"repository": {
2120
"type": "git",
2221
"url": "git+https://github.com/appwrite/synapse.git"
2322
},
24-
"author": "",
2523
"license": "MIT",
2624
"dependencies": {
2725
"node-pty": "^1.0.0",

0 commit comments

Comments
 (0)