Files
com.pearcal/package.json
Your NameandClaude Opus 5 3d15740b59 fix(build): make bundle:ui build what actually ships, and stop verify clobbering it
Closes #132.

`npm run bundle:ui` bundled src/ui/App.jsx with --global-name=PearCalApp and a
manual JSX factory. Everything that actually ships - the CLAUDE.md Android and
iOS commands, release.sh, and therefore the committed assets/app-ui.bundle -
bundles src/ui/main.jsx as a plain IIFE with automatic JSX. Both wrote to the
same path, so running the documented command replaced the shipping bundle with
a different artifact that has no entry point wired, and git status said only
"modified". It bit twice on 2026-07-23.

Measured before and after rather than assumed:

  old bundle:ui       784,534 bytes   (App.jsx + global name, no entry point)
  what ships        1,414,532 bytes
  new bundle:ui     1,414,532 bytes   md5 5484d83d… - identical, git sees no change

The quoting is the part worth not repeating. Writing the define as
--define:process.env.NODE_ENV=\"production\" inside a package.json script does
NOT survive: npm hands the line to sh, sh strips the bare double quotes, and
esbuild receives the identifier `production` rather than the string. That
produced a third distinct artifact - correct entrypoint, wrong output. Single
quotes around the escaped pair are what make it reach esbuild intact.

Also split the verify gate off the shipped artifact entirely. `npm run verify`
now builds the UI to node_modules/.cache (gitignored, so it can never surface
in git status) purely to prove it compiles. A gate that rewrites a tracked
build output is the other half of what made this bug invisible.

Deleted assets/index.html, the only consumer of window.PearCalApp and the one
thing that made the old form look load-bearing. It is dead: the mobile WebView
builds its own HTML inline in app/index.tsx and injects the bundle, which
self-mounts via main.jsx's createRoot; the Electron renderer has its own
index.html that never mentions PearCalApp; and nothing in the repo, any build
script or app.json references the file. It had not been touched since the
initial commit.

release.sh keeps its inlined bundle commands - what a release builds should be
visible where it runs - but its comment claiming bundle:ui differs is no longer
true, so it now says what is actually the case. No release command changed.

Verified: `npm run bundle:ui` reproduces the committed bundle byte-for-byte,
and `npm run verify` leaves assets/ untouched. 266 tests pass.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NEd2k9F1HgR3JHdB8spury
2026-07-26 15:13:13 -05:00

67 lines
2.2 KiB
JSON

{
"private": true,
"name": "pearcal-native",
"main": "expo-router/entry",
"scripts": {
"start": "expo start",
"android": "expo run:android",
"ios": "expo run:ios",
"bundle:bare": "bare-pack --linked --defer fs --defer path src/bare.js -o assets/bare-universal.bundle",
"bundle:ui": "esbuild src/ui/main.jsx --bundle --format=iife --jsx=automatic --define:process.env.NODE_ENV='\"production\"' --outfile=assets/app-ui.bundle",
"test": "node --test test/*.test.js",
"bundle:ui:check": "esbuild src/ui/main.jsx --bundle --format=iife --jsx=automatic --define:process.env.NODE_ENV='\"production\"' --outfile=node_modules/.cache/pearcal-ui-verify.bundle",
"verify": "npm test && npm run bundle:bare && npm run bundle:ui:check",
"postinstall": "patch-package"
},
"author": "Holepunch",
"license": "MIT",
"bugs": {
"url": "https://github.com/holepunchto/bare-expo/issues"
},
"homepage": "https://github.com/holepunchto/bare-expo#readme",
"dependencies": {
"@fontsource/manrope": "^5.2.8",
"@phosphor-icons/react": "^2.1.10",
"autobase": "^7.25.1",
"b4a": "^1.8.0",
"blind-peering": "^2.0.1",
"corestore": "^7.8.0",
"expo": "^54.0.10",
"expo-build-properties": "^1.0.9",
"expo-clipboard": "~8.0.8",
"expo-constants": "^18.0.9",
"expo-file-system": "~19.0.21",
"expo-linking": "^8.0.8",
"expo-router": "^6.0.8",
"expo-secure-store": "~15.0.8",
"expo-system-ui": "^6.0.7",
"hyperbee": "^2.27.3",
"hypercore": "^11.26.0",
"hyperdht": "^6.33.0",
"hyperswarm": "^4.17.0",
"keet-identity-key": "^3.1.0",
"qrcode": "^1.5.4",
"react": "^19.1.4",
"react-dom": "^19.1.4",
"react-native": "^0.81.4",
"react-native-b4a": "^0.0.4",
"react-native-bare-kit": "^0.12.2",
"react-native-safe-area-context": "^5.4.0",
"react-native-screens": "^4.23.0",
"react-native-webview": "13.15.0",
"sodium-universal": "^5.0.1",
"bare-process": "^4.4.1"
},
"devDependencies": {
"@types/react": "^19.1.3",
"bare-bundle": "^1.10.0",
"bare-pack": "^2.0.0",
"esbuild": "^0.27.3",
"patch-package": "^8.0.1",
"prettier": "^3.3.3",
"prettier-config-standard": "^7.0.0",
"typescript": "^5.3.3"
},
"version": "1.0.0"
}