@alivault/pico 0.1.2 → 0.1.4

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
@@ -23,7 +23,7 @@ It gives you a persistent session browser, a live conversation shell, git tools,
23
23
 
24
24
  ## Built on Pi
25
25
 
26
- Pico runs Pi locally through the bundled `@mariozechner/pi-coding-agent` SDK dependency, pinned to `0.73.1` for reproducible installs. You do not need a separate global Pi install for normal use.
26
+ Pico runs Pi locally through the bundled `@earendil-works/pi-coding-agent` SDK dependency, pinned to `0.74.0` for reproducible installs. You do not need a separate global Pi install for normal use.
27
27
 
28
28
  If you intentionally want to test Pico against a different Pi SDK checkout or install, set:
29
29
 
@@ -92,8 +92,21 @@ pnpm build # build for production
92
92
  pnpm preview # preview the production build
93
93
  pnpm check # format/lint/typecheck
94
94
  pnpm check:fix # format/lint/typecheck with fixes
95
+ pnpm release patch # check, build, version, tag, and push a release
95
96
  ```
96
97
 
98
+ ## Releasing
99
+
100
+ After committing changes, run one of:
101
+
102
+ ```bash
103
+ pnpm release patch
104
+ pnpm release minor
105
+ pnpm release major
106
+ ```
107
+
108
+ The release script verifies a clean, up-to-date `main`, runs checks and build, bumps `package.json`, creates the matching `v*.*.*` tag, and pushes the branch plus tags. The GitHub release workflow publishes the npm package from the pushed tag.
109
+
97
110
  ## Tech stack
98
111
 
99
112
  Pico is built with:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alivault/pico",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "A local, keyboard-friendly browser workspace for Pi coding-agent sessions.",
5
5
  "license": "AGPL-3.0-only",
6
6
  "type": "module",
@@ -11,7 +11,9 @@
11
11
  ".output",
12
12
  "bin",
13
13
  "scripts/patch-react-jsx-dev-runtime.mjs",
14
+ "scripts/release.mjs",
14
15
  "public/screenshots",
16
+ "vendor/node-domexception",
15
17
  "README.md",
16
18
  "LICENSE"
17
19
  ],
@@ -39,18 +41,29 @@
39
41
  "format": "vp fmt",
40
42
  "check": "vp check",
41
43
  "check:fix": "vp check --fix",
42
- "update:pi": "pnpm update @mariozechner/pi-coding-agent --latest"
44
+ "release": "node ./scripts/release.mjs",
45
+ "update:pi": "pnpm update @earendil-works/pi-coding-agent --latest"
43
46
  },
44
47
  "dependencies": {
48
+ "@earendil-works/pi-coding-agent": "0.74.0",
49
+ "tslib": "^2.8.1"
50
+ },
51
+ "overrides": {
52
+ "encoding-sniffer": "1.0.2",
53
+ "node-domexception": "file:./vendor/node-domexception"
54
+ },
55
+ "devDependencies": {
45
56
  "@base-ui/react": "^1.4.0",
46
57
  "@dnd-kit/core": "^6.3.1",
47
58
  "@dnd-kit/sortable": "^10.0.0",
48
59
  "@dnd-kit/utilities": "^3.2.2",
49
60
  "@fontsource-variable/inter": "^5.2.8",
50
- "@mariozechner/pi-coding-agent": "0.73.1",
51
61
  "@pierre/diffs": "^1.1.20",
52
62
  "@pierre/trees": "1.0.0-beta.3",
63
+ "@rolldown/plugin-babel": "^0.2.3",
64
+ "@tailwindcss/typography": "^0.5.19",
53
65
  "@tailwindcss/vite": "^4.2.1",
66
+ "@tanstack/devtools-vite": "^0.6.0",
54
67
  "@tanstack/pacer": "^0.21.0",
55
68
  "@tanstack/react-devtools": "^0.10.0",
56
69
  "@tanstack/react-hotkeys": "^0.10.0",
@@ -62,6 +75,11 @@
62
75
  "@tanstack/react-store": "^0.11.0",
63
76
  "@tanstack/router-plugin": "^1.166.13",
64
77
  "@tanstack/store": "^0.11.0",
78
+ "@types/node": "^22.19.15",
79
+ "@types/react": "^19.2.14",
80
+ "@types/react-dom": "^19.2.3",
81
+ "@vitejs/plugin-react": "^6.0.1",
82
+ "babel-plugin-react-compiler": "^1.0.0",
65
83
  "class-variance-authority": "^0.7.1",
66
84
  "clsx": "^2.1.1",
67
85
  "cmdk": "^1.1.1",
@@ -74,32 +92,21 @@
74
92
  "react-dom": "^19.2.4",
75
93
  "react-markdown": "^10.1.0",
76
94
  "react-resizable-panels": "^4.10.0",
95
+ "react-scan": "^0.5.3",
77
96
  "remark-gfm": "^4.0.1",
78
97
  "shadcn": "^4.3.0",
79
98
  "sonner": "^2.0.7",
80
99
  "sugar-high": "^1.1.0",
81
100
  "tailwind-merge": "^3.5.0",
82
101
  "tailwindcss": "^4.2.1",
83
- "tslib": "^2.8.1",
84
102
  "tw-animate-css": "^1.4.0",
85
- "vaul": "^1.1.2",
86
- "vite-tsconfig-paths": "^5.1.4",
87
- "zod": "^4.3.6"
88
- },
89
- "devDependencies": {
90
- "@rolldown/plugin-babel": "^0.2.3",
91
- "@tailwindcss/typography": "^0.5.19",
92
- "@tanstack/devtools-vite": "^0.6.0",
93
- "@types/node": "^22.19.15",
94
- "@types/react": "^19.2.14",
95
- "@types/react-dom": "^19.2.3",
96
- "@vitejs/plugin-react": "^6.0.1",
97
- "babel-plugin-react-compiler": "^1.0.0",
98
- "react-scan": "^0.5.3",
99
103
  "typescript": "^5.9.3",
104
+ "vaul": "^1.1.2",
100
105
  "vite": "catalog:",
101
106
  "vite-plus": "catalog:",
102
- "web-vitals": "^5.1.0"
107
+ "vite-tsconfig-paths": "^5.1.4",
108
+ "web-vitals": "^5.1.0",
109
+ "zod": "^4.3.6"
103
110
  },
104
111
  "packageManager": "pnpm@10.33.0"
105
112
  }
@@ -0,0 +1,173 @@
1
+ #!/usr/bin/env node
2
+ import { spawnSync } from "node:child_process"
3
+ import fs from "node:fs"
4
+
5
+ const allowedReleaseTypes = new Set(["patch", "minor", "major"])
6
+ const releaseType = process.argv[2]
7
+ const releaseBranch = process.env.RELEASE_BRANCH ?? "main"
8
+
9
+ function usage() {
10
+ console.error(`Usage: pnpm release <patch|minor|major>
11
+
12
+ Runs local release checks, bumps package.json with pnpm version, creates the git tag, and pushes the branch plus tags. The GitHub release workflow publishes npm from the pushed tag.
13
+
14
+ Set RELEASE_BRANCH=<branch> to release from a branch other than main.`)
15
+ }
16
+
17
+ if (!releaseType || !allowedReleaseTypes.has(releaseType)) {
18
+ usage()
19
+ process.exit(1)
20
+ }
21
+
22
+ function run(command, args, options = {}) {
23
+ const result = spawnSync(command, args, {
24
+ encoding: "utf8",
25
+ stdio: options.capture ? "pipe" : "inherit",
26
+ })
27
+
28
+ if (result.error) {
29
+ throw result.error
30
+ }
31
+
32
+ if (result.status !== 0 && !options.allowFailure) {
33
+ const detail = options.capture
34
+ ? `\n${result.stderr || result.stdout || ""}`.trimEnd()
35
+ : ""
36
+ throw new Error(
37
+ `Command failed: ${[command, ...args].join(" ")}${detail ? `\n${detail}` : ""}`
38
+ )
39
+ }
40
+
41
+ return {
42
+ status: result.status ?? 0,
43
+ stdout: result.stdout?.trim() ?? "",
44
+ stderr: result.stderr?.trim() ?? "",
45
+ }
46
+ }
47
+
48
+ function readPackageJson() {
49
+ return JSON.parse(fs.readFileSync("package.json", "utf8"))
50
+ }
51
+
52
+ function ensureCleanWorkingTree() {
53
+ const status = run("git", ["status", "--porcelain"], { capture: true }).stdout
54
+ if (status) {
55
+ throw new Error(
56
+ `Working tree is not clean. Commit or stash changes before releasing.\n${status}`
57
+ )
58
+ }
59
+ }
60
+
61
+ function getNextVersion(version, type) {
62
+ const match = /^(\d+)\.(\d+)\.(\d+)$/.exec(version)
63
+ if (!match) {
64
+ throw new Error(`Unsupported package version: ${version}`)
65
+ }
66
+
67
+ let major = Number(match[1])
68
+ let minor = Number(match[2])
69
+ let patch = Number(match[3])
70
+
71
+ if (type === "major") {
72
+ major += 1
73
+ minor = 0
74
+ patch = 0
75
+ } else if (type === "minor") {
76
+ minor += 1
77
+ patch = 0
78
+ } else {
79
+ patch += 1
80
+ }
81
+
82
+ return `${major}.${minor}.${patch}`
83
+ }
84
+
85
+ function ensureOnReleaseBranch() {
86
+ const branch = run("git", ["branch", "--show-current"], {
87
+ capture: true,
88
+ }).stdout
89
+
90
+ if (branch !== releaseBranch) {
91
+ throw new Error(
92
+ `Releases must run from ${releaseBranch}. Current branch: ${branch || "detached HEAD"}`
93
+ )
94
+ }
95
+
96
+ return branch
97
+ }
98
+
99
+ function ensureBasedOnRemote(branch) {
100
+ run("git", ["fetch", "origin", branch, "--tags"])
101
+
102
+ const result = run(
103
+ "git",
104
+ ["merge-base", "--is-ancestor", `origin/${branch}`, "HEAD"],
105
+ {
106
+ allowFailure: true,
107
+ capture: true,
108
+ }
109
+ )
110
+
111
+ if (result.status !== 0) {
112
+ throw new Error(
113
+ `Local ${branch} is not based on origin/${branch}. Pull/rebase before releasing.`
114
+ )
115
+ }
116
+ }
117
+
118
+ function ensureTagAvailable(tag) {
119
+ const result = run(
120
+ "git",
121
+ ["rev-parse", "-q", "--verify", `refs/tags/${tag}`],
122
+ {
123
+ allowFailure: true,
124
+ capture: true,
125
+ }
126
+ )
127
+
128
+ if (result.status === 0) {
129
+ throw new Error(`Tag already exists: ${tag}`)
130
+ }
131
+ }
132
+
133
+ function ensureNpmVersionAvailable(name, version) {
134
+ const result = run("npm", ["view", `${name}@${version}`, "version"], {
135
+ allowFailure: true,
136
+ capture: true,
137
+ })
138
+
139
+ if (result.status === 0) {
140
+ throw new Error(`${name}@${version} is already published on npm.`)
141
+ }
142
+ }
143
+
144
+ try {
145
+ const branch = ensureOnReleaseBranch()
146
+ ensureCleanWorkingTree()
147
+ ensureBasedOnRemote(branch)
148
+ ensureCleanWorkingTree()
149
+
150
+ const packageJson = readPackageJson()
151
+ const nextVersion = getNextVersion(packageJson.version, releaseType)
152
+ const nextTag = `v${nextVersion}`
153
+
154
+ ensureTagAvailable(nextTag)
155
+ ensureNpmVersionAvailable(packageJson.name, nextVersion)
156
+
157
+ console.log(
158
+ `Releasing ${packageJson.name} ${packageJson.version} → ${nextVersion}`
159
+ )
160
+ run("pnpm", ["check"])
161
+ run("pnpm", ["build"])
162
+ ensureCleanWorkingTree()
163
+
164
+ run("pnpm", ["version", releaseType, "-m", "release v%s"])
165
+ run("git", ["push", "origin", branch, "--follow-tags"])
166
+
167
+ console.log(
168
+ `Released ${nextTag}. GitHub Actions will publish ${packageJson.name}@${nextVersion} to npm.`
169
+ )
170
+ } catch (error) {
171
+ console.error(error instanceof Error ? error.message : error)
172
+ process.exit(1)
173
+ }
@@ -0,0 +1,3 @@
1
+ "use strict"
2
+
3
+ module.exports = globalThis.DOMException
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "node-domexception",
3
+ "version": "1.0.0",
4
+ "description": "Compatibility shim that exports the native DOMException implementation.",
5
+ "main": "index.js",
6
+ "license": "MIT",
7
+ "engines": {
8
+ "node": ">=20.6.0"
9
+ }
10
+ }