@antigenic-oss/paint 0.2.0 → 0.2.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 +32 -17
- package/bin/bridge-server.js +38 -0
- package/bin/paint.js +559 -104
- package/bin/terminal-server.js +105 -0
- package/package.json +7 -8
- package/public/dev-editor-inspector.js +92 -104
- package/src/app/api/claude/apply/route.ts +2 -2
- package/src/app/api/project/scan/route.ts +1 -1
- package/src/app/api/proxy/[[...path]]/route.ts +4 -4
- package/src/app/docs/DocsClient.tsx +1 -1
- package/src/app/docs/page.tsx +0 -1
- package/src/app/page.tsx +1 -1
- package/src/bridge/api-handlers.ts +1 -1
- package/src/bridge/proxy-handler.ts +4 -4
- package/src/bridge/server.ts +135 -39
- package/src/components/ConnectModal.tsx +1 -2
- package/src/components/PreviewFrame.tsx +2 -2
- package/src/components/ResponsiveToolbar.tsx +1 -2
- package/src/components/common/ColorPicker.tsx +7 -9
- package/src/components/common/UnitInput.tsx +1 -1
- package/src/components/common/VariableColorPicker.tsx +0 -1
- package/src/components/left-panel/ComponentsPanel.tsx +3 -3
- package/src/components/left-panel/LayerNode.tsx +1 -1
- package/src/components/left-panel/icons.tsx +1 -1
- package/src/components/left-panel/terminal/TerminalPanel.tsx +2 -2
- package/src/components/right-panel/ElementLogBox.tsx +1 -3
- package/src/components/right-panel/changes/ChangesPanel.tsx +12 -12
- package/src/components/right-panel/claude/ClaudeIntegrationPanel.tsx +2 -2
- package/src/components/right-panel/claude/DiffViewer.tsx +1 -1
- package/src/components/right-panel/claude/ProjectRootSelector.tsx +7 -7
- package/src/components/right-panel/claude/SetupFlow.tsx +1 -1
- package/src/components/right-panel/console/ConsolePanel.tsx +4 -4
- package/src/components/right-panel/design/BackgroundSection.tsx +2 -2
- package/src/components/right-panel/design/GradientEditor.tsx +6 -6
- package/src/components/right-panel/design/LayoutSection.tsx +4 -4
- package/src/components/right-panel/design/PositionSection.tsx +2 -2
- package/src/components/right-panel/design/SVGSection.tsx +2 -3
- package/src/components/right-panel/design/ShadowBlurSection.tsx +5 -5
- package/src/components/right-panel/design/TextSection.tsx +5 -5
- package/src/components/right-panel/design/icons.tsx +1 -1
- package/src/components/right-panel/design/inputs/BoxModelPreview.tsx +2 -2
- package/src/components/right-panel/design/inputs/CompactInput.tsx +2 -2
- package/src/components/right-panel/design/inputs/DraggableLabel.tsx +2 -1
- package/src/components/right-panel/design/inputs/IconToggleGroup.tsx +1 -1
- package/src/components/right-panel/design/inputs/LinkedInputPair.tsx +3 -3
- package/src/components/right-panel/design/inputs/SectionHeader.tsx +2 -1
- package/src/hooks/useDOMTree.ts +0 -1
- package/src/hooks/usePostMessage.ts +4 -3
- package/src/hooks/useTargetUrl.ts +1 -1
- package/src/inspector/DOMTraverser.ts +2 -2
- package/src/inspector/HoverHighlighter.ts +6 -6
- package/src/inspector/SelectionHighlighter.ts +4 -4
- package/src/lib/classifyElement.ts +1 -2
- package/src/lib/claude-bin.ts +1 -1
- package/src/lib/clientProjectScanner.ts +13 -13
- package/src/lib/cssVariableUtils.ts +1 -1
- package/src/lib/folderPicker.ts +4 -1
- package/src/lib/projectScanner.ts +15 -15
- package/src/lib/tailwindClassParser.ts +1 -1
- package/src/lib/textShadowUtils.ts +1 -1
- package/src/lib/utils.ts +4 -4
- package/src/proxy.ts +1 -1
- package/src/store/treeSlice.ts +2 -2
- package/src/server/terminal-server.ts +0 -104
- package/tsconfig.server.json +0 -12
package/README.md
CHANGED
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
[](https://github.com/Antigenic-OSS/pAInt/blob/main/LICENSE)
|
|
4
4
|
[](https://github.com/Antigenic-OSS/pAInt/stargazers)
|
|
5
5
|
[](https://github.com/Antigenic-OSS/pAInt/issues)
|
|
6
|
-
[](https://www.npmjs.com/package/@antigenic-oss/paint)
|
|
7
|
+
[](https://www.npmjs.com/package/@antigenic-oss/paint)
|
|
8
|
+
[](https://bun.sh)
|
|
9
|
+
[](https://nodejs.org)
|
|
7
10
|
[](https://nextjs.org)
|
|
8
11
|
[](https://www.typescriptlang.org)
|
|
9
12
|
|
|
@@ -43,17 +46,28 @@ pnpm add -g @antigenic-oss/paint
|
|
|
43
46
|
bun add -g @antigenic-oss/paint
|
|
44
47
|
```
|
|
45
48
|
|
|
49
|
+
Requires Node.js `>=20.9.0`.
|
|
50
|
+
|
|
46
51
|
Then use:
|
|
47
52
|
|
|
48
53
|
```bash
|
|
49
|
-
paint start # Builds on first run, then starts server
|
|
50
|
-
paint status # Show
|
|
51
|
-
paint stop # Stop
|
|
54
|
+
paint start # Builds on first run, then starts web server
|
|
55
|
+
paint status # Show web status
|
|
56
|
+
paint stop # Stop web server
|
|
52
57
|
paint restart --rebuild # Force a rebuild before start
|
|
53
|
-
paint logs # Print
|
|
58
|
+
paint logs # Print web logs
|
|
59
|
+
paint terminal start # Start terminal websocket server
|
|
60
|
+
paint terminal restart
|
|
61
|
+
paint terminal status
|
|
62
|
+
paint terminal stop
|
|
63
|
+
paint bridge start # Start bridge server
|
|
64
|
+
paint bridge restart
|
|
65
|
+
paint bridge status
|
|
66
|
+
paint bridge stop
|
|
54
67
|
```
|
|
55
68
|
|
|
56
69
|
Default URL: `http://127.0.0.1:4000`
|
|
70
|
+
Terminal WS (when started): `ws://localhost:4001/ws`
|
|
57
71
|
|
|
58
72
|
## What You Can Do
|
|
59
73
|
|
|
@@ -68,7 +82,8 @@ Default URL: `http://127.0.0.1:4000`
|
|
|
68
82
|
|
|
69
83
|
## Prerequisites
|
|
70
84
|
|
|
71
|
-
-
|
|
85
|
+
- Local repository development: Bun `>=1.3`
|
|
86
|
+
- Global CLI runtime: Node.js `>=20.9.0`
|
|
72
87
|
- A localhost app running in development mode (Next.js, Vite, Astro, CRA, etc.)
|
|
73
88
|
|
|
74
89
|
## Quick Start
|
|
@@ -104,7 +119,7 @@ If auto-injection is not detected, add this script tag to your app layout and re
|
|
|
104
119
|
If the UI is hosted on Vercel, run the local bridge server:
|
|
105
120
|
|
|
106
121
|
```bash
|
|
107
|
-
|
|
122
|
+
paint bridge start
|
|
108
123
|
```
|
|
109
124
|
|
|
110
125
|
Bridge default: `http://localhost:4002`
|
|
@@ -126,19 +141,19 @@ Bridge default: `http://localhost:4002`
|
|
|
126
141
|
## Commands
|
|
127
142
|
|
|
128
143
|
```bash
|
|
129
|
-
bun install
|
|
130
|
-
bun dev
|
|
131
|
-
bun run bridge
|
|
132
|
-
bun run dev:terminal
|
|
133
|
-
bun run dev:all
|
|
134
|
-
bun run build
|
|
135
|
-
bun run start
|
|
136
|
-
bun run lint
|
|
144
|
+
bun install # Install dependencies for local repo development
|
|
145
|
+
bun dev # Start UI (localhost:4000)
|
|
146
|
+
bun run bridge # Start bridge server (localhost:4002)
|
|
147
|
+
bun run dev:terminal # Start terminal server
|
|
148
|
+
bun run dev:all # Start terminal + bridge + Next.js dev server
|
|
149
|
+
bun run build # Production build
|
|
150
|
+
bun run start # Production server (port 4000)
|
|
151
|
+
bun run lint # Biome check
|
|
137
152
|
```
|
|
138
153
|
|
|
139
154
|
## Architecture Summary
|
|
140
155
|
|
|
141
|
-
- Next.js App Router frontend
|
|
156
|
+
- Next.js App Router frontend (develop locally with Bun, run globally via Node.js CLI)
|
|
142
157
|
- Proxy API route at `/api/proxy/*` for target-page loading and injection
|
|
143
158
|
- Inspector script communicates with editor via `window.postMessage`
|
|
144
159
|
- State managed with Zustand slices
|
|
@@ -168,7 +183,7 @@ See `CONTRIBUTING.md` for setup, workflow, and pull request expectations.
|
|
|
168
183
|
- Versioning and release PRs are managed with Changesets.
|
|
169
184
|
- CI workflow: `.github/workflows/ci.yml`
|
|
170
185
|
- Release workflow: `.github/workflows/release.yml`
|
|
171
|
-
- Publishing
|
|
186
|
+
- Publishing uses npm Trusted Publishing (OIDC) from the `release` GitHub Environment.
|
|
172
187
|
- To queue a release, add a changeset:
|
|
173
188
|
|
|
174
189
|
```bash
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const path = require('node:path')
|
|
4
|
+
const fs = require('node:fs')
|
|
5
|
+
const { spawn, spawnSync } = require('node:child_process')
|
|
6
|
+
|
|
7
|
+
const ENTRY_REAL_PATH = fs.realpathSync(__filename)
|
|
8
|
+
const APP_ROOT = path.resolve(path.dirname(ENTRY_REAL_PATH), '..')
|
|
9
|
+
const TSX_CLI = path.join(APP_ROOT, 'node_modules', 'tsx', 'dist', 'cli.mjs')
|
|
10
|
+
|
|
11
|
+
const nodeCheck = spawnSync(process.execPath, ['--version'], {
|
|
12
|
+
stdio: 'ignore',
|
|
13
|
+
})
|
|
14
|
+
if (nodeCheck.status !== 0) {
|
|
15
|
+
console.error('Node.js runtime check failed.')
|
|
16
|
+
process.exit(1)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (!fs.existsSync(TSX_CLI)) {
|
|
20
|
+
console.error(
|
|
21
|
+
'Missing runtime dependency: tsx. Reinstall @antigenic-oss/paint.',
|
|
22
|
+
)
|
|
23
|
+
process.exit(1)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const child = spawn(process.execPath, [TSX_CLI, 'src/bridge/server.ts'], {
|
|
27
|
+
cwd: APP_ROOT,
|
|
28
|
+
env: process.env,
|
|
29
|
+
stdio: 'inherit',
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
child.on('exit', (code, signal) => {
|
|
33
|
+
if (signal) {
|
|
34
|
+
process.kill(process.pid, signal)
|
|
35
|
+
} else {
|
|
36
|
+
process.exit(code || 0)
|
|
37
|
+
}
|
|
38
|
+
})
|