release prep 1.0.0: changelog dated and filled, drop stale URLs, add consumer smoke script
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Assistant: claude-code Assistant-Model: sonnet Assistant-Process: 299063@bnt-lap001 Assistant-Session: 53eb1e1c-c13a-4277-9ce2-3702960d93f7
This commit is contained in:
parent
3d576386a0
commit
d748e2fa22
4 changed files with 40 additions and 19 deletions
25
scripts/consumer-smoke.sh
Executable file
25
scripts/consumer-smoke.sh
Executable file
|
|
@ -0,0 +1,25 @@
|
|||
#!/usr/bin/env bash
|
||||
# Pack the package, install the tarball into an empty project, and check the
|
||||
# published entry points (ESM import, CJS require, CSS) load. Guards the
|
||||
# exports map and bundle globals, which Jest (source-only) cannot see.
|
||||
set -euo pipefail
|
||||
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
TMP="$(mktemp -d)"
|
||||
trap 'rm -rf "$TMP"' EXIT
|
||||
cd "$ROOT" && npm run build:prod >/dev/null
|
||||
TARBALL="$(npm pack --pack-destination "$TMP" 2>/dev/null | tail -1)"
|
||||
cd "$TMP" && npm init -y >/dev/null
|
||||
npm i --no-audit --no-fund marked@13 jsdom "./$TARBALL" >/dev/null 2>&1
|
||||
SETUP="const {JSDOM}=require('jsdom');const d=new JSDOM('<!doctype html><body></body>',{url:'http://localhost/'});
|
||||
globalThis.window=globalThis;globalThis.document=d.window.document;globalThis.location=d.window.location;
|
||||
globalThis.localStorage=d.window.localStorage;globalThis.navigator=d.window.navigator;"
|
||||
# The library is browser-only; unhandled indexedDB rejections after load are expected, so check markers, not exit codes.
|
||||
check() { # check <marker> <label> <node args...>
|
||||
local marker="$1" label="$2"; shift 2
|
||||
local out; out="$(node "$@" 2>&1 || true)"
|
||||
grep -q "^$marker" <<<"$out" || { echo "FAIL: $label"; exit 1; }
|
||||
}
|
||||
check 'CJS ok' "CJS require" -e "$SETUP const m=require('testdrive-jsui');console.log('CJS ok',typeof m)"
|
||||
check 'ESM ok' "ESM import" -e "$SETUP import('testdrive-jsui').then(m=>console.log('ESM ok',typeof m.default))"
|
||||
check 'CSS ok' "style.css" -e "console.log('CSS ok',require.resolve('testdrive-jsui/style.css'))"
|
||||
echo "consumer smoke: ESM, CJS, CSS ok"
|
||||
Loading…
Add table
Add a link
Reference in a new issue