craftz

Fixed when it's packed

The browsers and the Workers' date, as the rules use them, written in when the package is built.

From source, they're worked out from browser-compat-data and cf, as browsers.ts and runtime.ts do. The package can't carry those, since browser-compat-data alone is megabytes and cf is a dev dependency. So vp pack works them out once and writes them in as __PINNED__, and the published command uses the values it was built with.

That's what the rules want anyway. Both move only when pnpm align moves their packages, so a version of craftz always means one list and one date.

declare const __PINNED__: { browsers: string[]; date: string } | undefined;

const pinned = typeof __PINNED__ === "undefined" ? undefined : __PINNED__;

/** The browsers the rules' floors name, as Vite's `build.target` takes them. */
export const BROWSERS: string[] = pinned?.browsers ?? (await import("./browsers.ts")).BROWSERS;

/** The compatibility date every Worker runs at. */
export const COMPATIBILITY_DATE: string =
  pinned?.date ?? (await import("./runtime.ts")).COMPATIBILITY_DATE;