@xera-ai/web 0.8.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -283,9 +283,9 @@ import { pathToFileURL } from "url";
283
283
  import { writeAuthState } from "@xera-ai/core";
284
284
  async function runAuthSetup(input) {
285
285
  const mod = await import(pathToFileURL(input.setupScriptPath).href);
286
- const fn = mod.default;
286
+ const fn = mod.default ?? mod.web;
287
287
  if (typeof fn !== "function") {
288
- throw new Error(`Auth setup script at ${input.setupScriptPath} must default-export a function (see defineAuthSetup).`);
288
+ throw new Error(`Auth setup script at ${input.setupScriptPath} must export a defineAuthSetup function as default or named "web" export.`);
289
289
  }
290
290
  const context = await input.browser.newContext();
291
291
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xera-ai/web",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -24,7 +24,7 @@
24
24
  "@cucumber/gherkin": "39.1.0",
25
25
  "@cucumber/messages": "32.3.1",
26
26
  "@playwright/test": "1.60.0",
27
- "@xera-ai/core": "^0.8.0",
27
+ "@xera-ai/core": "^0.8.1",
28
28
  "fflate": "0.8.3"
29
29
  }
30
30
  }
@@ -14,10 +14,12 @@ export interface RunAuthSetupInput {
14
14
 
15
15
  export async function runAuthSetup(input: RunAuthSetupInput): Promise<void> {
16
16
  const mod = await import(pathToFileURL(input.setupScriptPath).href);
17
- const fn = mod.default;
17
+ // Support both `export default defineAuthSetup(...)` and `export const web = defineAuthSetup(...)`.
18
+ // The named `web` export is the scaffold default for mixed-shape projects (web + http in one file).
19
+ const fn = mod.default ?? mod.web;
18
20
  if (typeof fn !== 'function') {
19
21
  throw new Error(
20
- `Auth setup script at ${input.setupScriptPath} must default-export a function (see defineAuthSetup).`,
22
+ `Auth setup script at ${input.setupScriptPath} must export a defineAuthSetup function as default or named "web" export.`,
21
23
  );
22
24
  }
23
25
  const context = await input.browser.newContext();