Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ beans/
.github/workflows/ # release.yml: manual signed Beans releases; test.yml: full PR/manual test matrix; docs.yml: PR/manual doc check; catalog.yml: PR/manual catalog/index check
```

`pnpm run android` rebuilds the Rust core for Android, then builds and runs the Expo dev client on the Android emulator. `cd mobile && pnpm run core` rebuilds the Rust core for both phone platforms; `pnpm run mobile:dev` is the iOS development loop described below.
See [Phone development](docs/architecture/phone-app.md#development-loop) for phone rebuild commands.

`pnpm run dev` runs the macOS Beans Dev loop; `pnpm run build` produces the Beans release bundle. See [macOS development and builds](docs/architecture/macos-app.md#development-and-builds) for rebuild, launch and SDK-stamping mechanisms. `pnpm run relay` runs a local relay. The [phone development loop](docs/architecture/phone-app.md#development-loop) fingerprints native inputs, rebuilds stale pieces and leaves production Beans processes alone.

Expand Down
2 changes: 1 addition & 1 deletion desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"solid-js": "2.0.0-rc.21"
},
"devDependencies": {
"@solidjs/vite-plugin": "3.0.0-next.56",
"@solidjs/vite-plugin": "3.0.0-next.57",
"mygo-cli": "0.1.22",
"playwright": "1.59.1",
"typescript": "^7",
Expand Down
2 changes: 2 additions & 0 deletions docs/architecture/phone-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,6 @@ The production app icon uses the coral Beans mark. Editable SVG masters in `desi

## Development loop

`pnpm run android` rebuilds the Rust core for Android, then builds and runs the Expo dev client on the Android emulator. `cd mobile && pnpm run core` rebuilds the Rust core for both phone platforms; `pnpm run mobile:dev` is the iOS development loop described here.

`pnpm run mobile:dev` (`scripts/mobile.ts`) is the Beans Dev phone loop on the iOS Simulator, or on `--device <name or udid>`: it fingerprints the crates the phone links, the prebuild inputs (Expo config, assets, `package.json`, plugins, targets), the pod inputs with the checkout's path, and the native module sources (stamps in `mobile/.expo/dev-stamps.json`), rebuilds what is stale (`pnpm run core ios`, a clean `expo prebuild`, `pod install`, `expo run:ios`), starts Metro, and opens the dev client on it. A Rust save while it runs rebuilds the core and installs the app again. The Mac and phone loops leave production Beans processes alone, so all builds run side by side.
8 changes: 2 additions & 6 deletions docs/architecture/website.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,9 @@ The Windows download resolves both the staged `Beans Setup <version>.exe` name a

The Vercel project `hr-teconologia/beans` connects to `bloodf/beans` on GitHub. Pushes to `main` target production at `usebeans.app`; other branches create previews. Its root directory is `web`, with source files outside that directory enabled. Installation runs `cd .. && pnpm install --frozen-lockfile`, and the build runs `pnpm run build`.

The project's Ignored Build Step compares `VERCEL_GIT_PREVIOUS_SHA` with `HEAD` for `web/`, `desktop/`, the root `package.json` and `bun.lock`, `crates/models/catalog.json`, `crates/cli/marketplace/index.json`, and `.vercelignore`. These paths cover the site, embedded desktop demo, workspace dependencies and served catalogs. An unchanged diff skips the build. A missing previous deployment SHA or unavailable Git history allows the build. Vercel's automatic affected-project detection is disabled so it cannot skip changes to the served catalogs outside the JavaScript workspaces.
The Ignored Build Step in `web/vercel.json` runs `sh ./vercel-ignore.sh` within the 256-character configuration limit. The script requires `VERCEL_GIT_PREVIOUS_SHA` to be a full 40- or 64-character hexadecimal ID of an available Git commit before comparing it with `HEAD` for the site, embedded desktop demo, root package and pnpm lock/workspace settings, Blobatar package, served catalogs and `.vercelignore`. Only a successful unchanged diff skips the build. Missing previous deployment SHA or unavailable Git history returns exit 1 to run the build instead of failing deployment with Git's error status. Vercel's automatic affected-project detection is disabled so it cannot skip changes to served catalogs outside the JavaScript workspaces.

`.vercelignore` retains Git metadata so the Ignored Build Step can compare commits. This filter is stored in the Vercel project settings and runs from `web`:

```sh
test -n "$VERCEL_GIT_PREVIOUS_SHA" && git diff --quiet "$VERCEL_GIT_PREVIOUS_SHA" HEAD -- . ../desktop ../package.json ../bun.lock ../crates/models/catalog.json ../crates/cli/marketplace/index.json ../.vercelignore
```
`.vercelignore` retains Git metadata for this comparison. The repository configuration overrides the project's Ignored Build Step and runs from `web`. `python3 scripts/test_vercel_ignore.py` verifies unchanged, changed, empty and unavailable previous revisions using real temporary Git commits.

## Landing-page motion

Expand Down
67 changes: 21 additions & 46 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ allowBuilds:
lightningcss: true
sharp: true
workerd: true
minimumReleaseAgeExclude:
- '@solidjs/vite-plugin@3.0.0-next.57'
87 changes: 87 additions & 0 deletions scripts/test_vercel_ignore.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
import json
import os
from pathlib import Path
import subprocess
import tempfile
import unittest


COMMAND = json.loads((Path(__file__).resolve().parents[1] / "web/vercel.json").read_text())["ignoreCommand"]


class IgnoreBuildTest(unittest.TestCase):
def test_sha256_commit(self):
with tempfile.TemporaryDirectory(prefix="beans-vercel-sha256-") as directory:
root = Path(directory)
web = root / "web"
web.mkdir()
(web / "vercel-ignore.sh").write_bytes((Path(__file__).resolve().parents[1] / "web/vercel-ignore.sh").read_bytes())
subprocess.run(["git", "init", "-q", "--object-format=sha256"], cwd=root, check=True, capture_output=True)
subprocess.run(["git", "add", "."], cwd=root, check=True, capture_output=True)
subprocess.run(["git", "-c", "user.name=Beans test", "-c", "user.email=test@example.invalid", "commit", "-qm", "initial"], cwd=root, check=True, capture_output=True)
previous = subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=root, text=True).strip()
self.assertEqual(len(previous), 64)
env = {**os.environ, "VERCEL_GIT_PREVIOUS_SHA": previous}
self.assertEqual(subprocess.run(["sh", "-c", COMMAND], cwd=web, env=env, capture_output=True).returncode, 0)
(web / "page.txt").write_text("changed")
subprocess.run(["git", "add", "."], cwd=root, check=True, capture_output=True)
subprocess.run(["git", "-c", "user.name=Beans test", "-c", "user.email=test@example.invalid", "commit", "-qm", "changed"], cwd=root, check=True, capture_output=True)
self.assertEqual(subprocess.run(["sh", "-c", COMMAND], cwd=web, env=env, capture_output=True).returncode, 1)

def test_real_git_inputs(self):
with tempfile.TemporaryDirectory(prefix="beans-vercel-ignore-") as directory:
root = Path(directory)
web = root / "web"
web.mkdir()
self.assertLessEqual(len(COMMAND), 256)
(web / "vercel-ignore.sh").write_bytes((Path(__file__).resolve().parents[1] / "web/vercel-ignore.sh").read_bytes())

def git(*args):
return subprocess.run(["git", *args], cwd=root, check=True, capture_output=True, text=True).stdout.strip()

def ignored(previous):
env = {**os.environ, "VERCEL_GIT_PREVIOUS_SHA": previous}
return subprocess.run(["sh", "-c", COMMAND], cwd=web, env=env, capture_output=True).returncode

git("init", "-q")
git("config", "user.name", "Beans test")
git("config", "user.email", "test@example.invalid")
(web / "page.txt").write_text("initial")
(root / "pnpm-lock.yaml").write_text("initial")
git("add", ".")
git("commit", "-qm", "initial")
initial = git("rev-parse", "HEAD")
self.assertEqual(ignored(initial), 0)
self.assertEqual(ignored(""), 1)
self.assertEqual(ignored("f" * 40), 1)
for invalid in ("--cached", "--quiet", "HEAD", "refs/heads/main", "g" * 40, "a" * 39, "a" * 41, "a" * 63, "a" * 65, "f" * 64):
with self.subTest(previous=invalid):
self.assertEqual(ignored(invalid), 1)
missing_env = dict(os.environ)
missing_env.pop("VERCEL_GIT_PREVIOUS_SHA", None)
self.assertEqual(subprocess.run(["sh", "-c", COMMAND], cwd=web, env=missing_env, capture_output=True).returncode, 1)
blob = git("rev-parse", "HEAD:web/page.txt")
tree = git("rev-parse", "HEAD^{tree}")
self.assertEqual(ignored(blob), 1)
self.assertEqual(ignored(tree), 1)
(root / ".git").rename(root / "git-unavailable")
try:
self.assertEqual(ignored(initial), 1)
finally:
(root / "git-unavailable").rename(root / ".git")
(web / "page.txt").write_text("changed")
git("commit", "-qam", "website change")
self.assertEqual(ignored(initial), 1)
website = git("rev-parse", "HEAD")
(root / "pnpm-lock.yaml").write_text("changed")
git("commit", "-qam", "dependency change")
self.assertEqual(ignored(website), 1)
dependency = git("rev-parse", "HEAD")
(root / "Cargo.lock").write_text("Rust-only change")
git("add", ".")
git("commit", "-qm", "unrelated Rust change")
self.assertEqual(ignored(dependency), 0)


if __name__ == "__main__":
unittest.main()
10 changes: 10 additions & 0 deletions web/vercel-ignore.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh
case "$VERCEL_GIT_PREVIOUS_SHA" in
''|*[!0123456789abcdefABCDEF]*) exit 1 ;;
esac
case "${#VERCEL_GIT_PREVIOUS_SHA}" in
40|64) ;;
*) exit 1 ;;
esac
test "$(git cat-file -t "$VERCEL_GIT_PREVIOUS_SHA")" = commit || exit 1
git diff --quiet "$VERCEL_GIT_PREVIOUS_SHA" HEAD -- . ../desktop ../package.json ../pnpm-lock.yaml ../pnpm-workspace.yaml ../.npmrc ../packages/beans-blobatar ../crates/models/catalog.json ../crates/cli/marketplace/index.json ../.vercelignore; result=$?; test "$result" -eq 0
3 changes: 2 additions & 1 deletion web/vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@
]
}
],
"installCommand": "pnpm install --frozen-lockfile"
"installCommand": "pnpm install --frozen-lockfile",
"ignoreCommand": "sh ./vercel-ignore.sh"
}
Loading