termweb 0.9.6 → 0.9.8

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 CHANGED
@@ -176,31 +176,39 @@ Press `Ctrl+H` to enter hint mode. Yellow labels appear on all clickable element
176
176
 
177
177
  Pre-built terminal applications powered by termweb:
178
178
 
179
- ### @termweb/code
179
+ ### termweb-dashboard
180
+
181
+ System monitoring dashboard with CPU, memory, disk, network, and process views.
182
+
183
+ ```bash
184
+ npx termweb-dashboard
185
+ ```
186
+
187
+ ### termweb-code
180
188
 
181
189
  Full-featured code editor with syntax highlighting for 20+ languages.
182
190
 
183
191
  ```bash
184
- npx @termweb/code ./src/index.js
185
- npx @termweb/code ~/projects/app/main.py
192
+ npx termweb-code ./src/index.js
193
+ npx termweb-code ~/projects/app/main.py
186
194
  ```
187
195
 
188
- ### @termweb/markdown
196
+ ### termweb-markdown
189
197
 
190
198
  Markdown editor with live preview pane.
191
199
 
192
200
  ```bash
193
- npx @termweb/markdown ./README.md
194
- npx @termweb/markdown ~/docs/notes.md
201
+ npx termweb-markdown ./README.md
202
+ npx termweb-markdown ~/docs/notes.md
195
203
  ```
196
204
 
197
- ### @termweb/json
205
+ ### termweb-json
198
206
 
199
207
  JSON editor with validation, formatting, and key sorting.
200
208
 
201
209
  ```bash
202
- npx @termweb/json ./package.json
203
- npx @termweb/json ~/config/settings.json
210
+ npx termweb-json ./package.json
211
+ npx termweb-json ~/config/settings.json
204
212
  ```
205
213
 
206
214
  ## Documentation
package/bin/termweb.js CHANGED
@@ -27,11 +27,11 @@ if (!platformName || !archName) {
27
27
  }
28
28
 
29
29
  const binaryName = `termweb-${platformName}-${archName}`;
30
- const binaryPath = path.join(__dirname, '..', 'binaries', binaryName);
30
+ const binaryPath = path.join(__dirname, '..', 'native', binaryName);
31
31
 
32
32
  if (!fs.existsSync(binaryPath)) {
33
33
  console.error(`Binary not found: ${binaryPath}`);
34
- console.error('Run `npm run postinstall` to download the binary.');
34
+ console.error('Please reinstall: npm install termweb');
35
35
  process.exit(1);
36
36
  }
37
37
 
package/lib/index.js CHANGED
@@ -15,12 +15,10 @@ const arch = process.arch === 'arm64' ? 'aarch64' : 'x86_64';
15
15
 
16
16
  // Try multiple locations for native module
17
17
  const searchPaths = [
18
+ // Bundled: native/termweb-{platform}-{arch}.node
19
+ path.join(__dirname, '..', 'native', `termweb-${platform}-${arch}.node`),
18
20
  // Development: zig-out/lib/termweb.node
19
21
  path.join(__dirname, '..', 'zig-out', 'lib', 'termweb.node'),
20
- // Installed: native/termweb-{platform}-{arch}.node
21
- path.join(__dirname, '..', 'native', `termweb-${platform}-${arch}.node`),
22
- // Fallback: native/termweb.node
23
- path.join(__dirname, '..', 'native', 'termweb.node'),
24
22
  ];
25
23
 
26
24
  let native = null;
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,19 +1,18 @@
1
1
  {
2
2
  "name": "termweb",
3
- "version": "0.9.6",
3
+ "version": "0.9.8",
4
4
  "description": "Web browser in your terminal using Kitty graphics protocol. SDK for building terminal apps with web technologies.",
5
5
  "main": "./lib/index.js",
6
6
  "bin": {
7
7
  "termweb": "bin/termweb.js"
8
8
  },
9
9
  "scripts": {
10
- "postinstall": "node scripts/install.js",
11
10
  "build:all": "bash scripts/build-all.sh"
12
11
  },
13
12
  "files": [
14
13
  "bin/",
15
14
  "lib/",
16
- "scripts/install.js",
15
+ "native/",
17
16
  "README.md"
18
17
  ],
19
18
  "keywords": [
@@ -24,7 +23,7 @@
24
23
  "cli",
25
24
  "web"
26
25
  ],
27
- "author": "teamch",
26
+ "author": "teamchong",
28
27
  "license": "MIT",
29
28
  "repository": {
30
29
  "type": "git",
@@ -1,113 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const https = require('https');
4
- const fs = require('fs');
5
- const path = require('path');
6
- const { execSync } = require('child_process');
7
-
8
- const VERSION = require('../package.json').version;
9
- const REPO = 'teamchong/termweb';
10
-
11
- const platform = process.platform;
12
- const arch = process.arch;
13
-
14
- const platformMap = {
15
- darwin: 'macos',
16
- linux: 'linux',
17
- };
18
-
19
- const archMap = {
20
- x64: 'x86_64',
21
- arm64: 'aarch64',
22
- };
23
-
24
- const platformName = platformMap[platform];
25
- const archName = archMap[arch];
26
-
27
- if (!platformName || !archName) {
28
- console.error(`Unsupported platform: ${platform}-${arch}`);
29
- console.error('termweb only supports macOS and Linux on x64 and arm64.');
30
- process.exit(1);
31
- }
32
-
33
- const binaryName = `termweb-${platformName}-${archName}`;
34
- const binariesDir = path.join(__dirname, '..', 'binaries');
35
- const binaryPath = path.join(binariesDir, binaryName);
36
-
37
- // Create binaries directory
38
- if (!fs.existsSync(binariesDir)) {
39
- fs.mkdirSync(binariesDir, { recursive: true });
40
- }
41
-
42
- // Check if binary already exists
43
- if (fs.existsSync(binaryPath)) {
44
- console.log(`termweb binary already installed at ${binaryPath}`);
45
- process.exit(0);
46
- }
47
-
48
- // Download URL from GitHub releases
49
- const downloadUrl = `https://github.com/${REPO}/releases/download/v${VERSION}/${binaryName}`;
50
-
51
- console.log(`Downloading termweb for ${platformName}-${archName}...`);
52
- console.log(`URL: ${downloadUrl}`);
53
-
54
- function download(url, dest) {
55
- return new Promise((resolve, reject) => {
56
- const file = fs.createWriteStream(dest);
57
-
58
- const request = https.get(url, (response) => {
59
- // Handle redirects
60
- if (response.statusCode === 301 || response.statusCode === 302) {
61
- file.close();
62
- fs.unlinkSync(dest);
63
- return download(response.headers.location, dest).then(resolve).catch(reject);
64
- }
65
-
66
- if (response.statusCode !== 200) {
67
- file.close();
68
- fs.unlinkSync(dest);
69
- reject(new Error(`Failed to download: HTTP ${response.statusCode}`));
70
- return;
71
- }
72
-
73
- response.pipe(file);
74
-
75
- file.on('finish', () => {
76
- file.close();
77
- resolve();
78
- });
79
- });
80
-
81
- request.on('error', (err) => {
82
- file.close();
83
- fs.unlink(dest, () => {}); // Delete partial file
84
- reject(err);
85
- });
86
-
87
- file.on('error', (err) => {
88
- file.close();
89
- fs.unlink(dest, () => {});
90
- reject(err);
91
- });
92
- });
93
- }
94
-
95
- async function main() {
96
- try {
97
- await download(downloadUrl, binaryPath);
98
-
99
- // Make executable
100
- fs.chmodSync(binaryPath, 0o755);
101
-
102
- console.log(`Successfully installed termweb to ${binaryPath}`);
103
- } catch (err) {
104
- console.error(`Failed to download termweb: ${err.message}`);
105
- console.error('');
106
- console.error('You can manually build from source:');
107
- console.error(' git clone https://github.com/' + REPO);
108
- console.error(' cd termweb && zig build');
109
- process.exit(1);
110
- }
111
- }
112
-
113
- main();