Skip to content
Merged
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
5 changes: 3 additions & 2 deletions docs/sdk-sync.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,15 @@ checks every embedded SDK asset against the SDK's own pins. The SDK pins the
official OPFS proxy but never loads it, and the published package leaves it out;
the packer embeds it only when the supplied package has it.

To build against an authenticated LAB SDK package:
To build against an authenticated LAB or staging SDK package:

```sh
npm ci
node esbuild.config.mjs production --lab --native-sdk /absolute/path/to/sdk/package
node esbuild.config.mjs production --staging --native-sdk /absolute/path/to/sdk/package
```

Do not publish a LAB build.
Do not publish a LAB or staging build.

Unit tests exercise real vault IO for concurrent edits, renames, deletes,
conflict-publication recovery, upload recovery, ownership transitions and fixed
Expand Down
2 changes: 1 addition & 1 deletion scripts/native-assets.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { createHash } from "node:crypto";
export async function nativeAssets() {
const index = process.argv.indexOf("--native-sdk");
const sdk = resolve(index < 0 ? "node_modules/@mdbase-dev/sdk" : process.argv[index + 1]);
const environment = process.argv.includes("--lab") ? "lab" : "production";
const environment = process.argv.includes("--lab") ? "lab" : process.argv.includes("--staging") ? "staging" : "production";
const trust = readFileSync(resolve(sdk, "dist/application/packaged-trust.js"), "utf8");
if (!trust.includes(`"environment":"${environment}"`)) throw new Error(`Native SDK must be authentically packaged for ${environment}; no environment retargeting`);
const declaration = readFileSync(resolve(sdk, "dist/application/declaration.js"), "utf8");
Expand Down
2 changes: 1 addition & 1 deletion src/sync/native/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const manifest = { ...template, homepage: `${location.origin}/`, redirect_uris:
const namespace = new URL(location.href).searchParams.get("vault");
if (!namespace) throw new Error("Missing stable vault storage namespace");

declare const __MDBASE_ENVIRONMENT__: "lab" | "production";
declare const __MDBASE_ENVIRONMENT__: "lab" | "staging" | "production";
let bridge: MessagePort | null = null;
const queued: any[] = [];
if (parent === window) throw new Error("Native SDK must run inside its owning vault");
Expand Down
Loading