sv 0.15.3 → 0.15.4

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/bin.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { _ as name, a as detectPackageManager, d as program, g as helpConfig, h as forwardExitCode, l as from, n as add, r as create, u as Command, v as version } from "./engine-DSL32Woe.mjs";
2
+ import { _ as name, a as detectPackageManager, d as program, g as helpConfig, h as forwardExitCode, l as from, n as add, r as create, u as Command, v as version } from "./engine-Hqu9lWdb.mjs";
3
3
  import { color, resolveCommandArray } from "@sveltejs/sv-utils";
4
4
  import process from "node:process";
5
5
  import { execSync } from "node:child_process";
@@ -1394,7 +1394,7 @@ ${r ? import_picocolors.default.cyan(x$1) : ""}
1394
1394
  //#endregion
1395
1395
  //#region package.json
1396
1396
  var name = "sv";
1397
- var version = "0.15.3";
1397
+ var version = "0.15.4";
1398
1398
  //#endregion
1399
1399
  //#region src/core/errors.ts
1400
1400
  var UnsupportedError = class extends Error {
@@ -6097,7 +6097,7 @@ function createOptionBuilder(options) {
6097
6097
  }
6098
6098
  //#endregion
6099
6099
  //#region src/addons/common.ts
6100
- const ESLINT_VERSION = "^10.2.0";
6100
+ const ESLINT_VERSION = "^10.4.0";
6101
6101
  const addEslintConfigPrettier = transforms.script(({ ast, js }) => {
6102
6102
  const sveltePluginImport = ast.body.filter((n) => n.type === "ImportDeclaration").find((n) => n.type === "ImportDeclaration" && n.source.value === "eslint-plugin-svelte" && n.specifiers?.some((n) => n.type === "ImportDefaultSpecifier"));
6103
6103
  let svelteImportName;
@@ -6314,7 +6314,7 @@ var better_auth_default = defineAddon({
6314
6314
  });
6315
6315
  js.imports.addNamed(ast, {
6316
6316
  imports: ["User", "Session"],
6317
- from: "better-auth/minimal",
6317
+ from: "better-auth",
6318
6318
  isType: true
6319
6319
  });
6320
6320
  const locals = js.kit.addGlobalAppInterface(ast, { name: "Locals" });
@@ -7053,7 +7053,6 @@ var eslint_default = defineAddon({
7053
7053
  const typescript = language === "ts";
7054
7054
  const prettierInstalled = Boolean(dependencyVersion("prettier"));
7055
7055
  sv.devDependency("eslint", ESLINT_VERSION);
7056
- sv.devDependency("@eslint/compat", "^2.0.4");
7057
7056
  sv.devDependency("eslint-plugin-svelte", "^3.17.0");
7058
7057
  sv.devDependency("globals", "^17.4.0");
7059
7058
  sv.devDependency("@eslint/js", "^10.0.1");
@@ -7169,7 +7168,7 @@ var eslint_default = defineAddon({
7169
7168
  as: "js"
7170
7169
  });
7171
7170
  js.imports.addNamed(ast, {
7172
- from: "@eslint/compat",
7171
+ from: "eslint/config",
7173
7172
  imports: ["includeIgnoreFile"]
7174
7173
  });
7175
7174
  js.imports.addDefault(ast, {
@@ -7556,7 +7555,7 @@ var playwright_default = defineAddon({
7556
7555
  homepage: "https://playwright.dev",
7557
7556
  options: {},
7558
7557
  run: ({ sv, language, file, isKit, directory }) => {
7559
- sv.devDependency("@playwright/test", "^1.59.1");
7558
+ sv.devDependency("@playwright/test", "^1.60.0");
7560
7559
  sv.file(file.package, transforms.json(({ data, json }) => {
7561
7560
  json.packageScriptsUpsert(data, "test:e2e", "playwright test");
7562
7561
  json.packageScriptsUpsert(data, "test:e2e", "playwright install", { mode: "prepend" });
@@ -8000,7 +7999,7 @@ const officialAddons$1 = {
8000
7999
  if (componentTesting) {
8001
8000
  sv.devDependency("@vitest/browser-playwright", "^4.1.3");
8002
8001
  sv.devDependency("vitest-browser-svelte", "^2.1.0");
8003
- sv.devDependency("playwright", "^1.59.1");
8002
+ sv.devDependency("playwright", "^1.60.0");
8004
8003
  }
8005
8004
  sv.file(file.package, transforms.json(({ data, json }) => {
8006
8005
  json.packageScriptsUpsert(data, "test:unit", "vitest");
@@ -1,4 +1,4 @@
1
- import { c as defineAddonOptions, m as create$1, o as officialAddons, s as defineAddon, t as add, y as svDeprecated } from "../engine-DSL32Woe.mjs";
1
+ import { c as defineAddonOptions, m as create$1, o as officialAddons, s as defineAddon, t as add, y as svDeprecated } from "../engine-Hqu9lWdb.mjs";
2
2
  //#region src/index.ts
3
3
  function create(cwdOrOptions, legacyOptions) {
4
4
  if (typeof cwdOrOptions === "string") {
@@ -55,6 +55,12 @@ type PrepareServerOptions = {
55
55
  page: Page;
56
56
  buildCommand?: string;
57
57
  previewCommand?: string;
58
+ /**
59
+ * Vitest's `expect`, injected by `createSetupTest`. Used to make a Vitest-counted
60
+ * assertion that the preview loaded, which also satisfies `requireAssertions` for
61
+ * tests that otherwise only assert through Playwright's (untracked) `expect`.
62
+ */
63
+ expect?: VitestContext["expect"];
58
64
  };
59
65
  type PrepareServerReturn = {
60
66
  url: string;
@@ -64,10 +70,11 @@ declare function prepareServer({
64
70
  cwd,
65
71
  page,
66
72
  buildCommand,
67
- previewCommand
73
+ previewCommand,
74
+ expect
68
75
  }: PrepareServerOptions): Promise<PrepareServerReturn>;
69
76
  type PlaywrightContext = Pick<typeof _$_playwright_test0, "chromium">;
70
- type VitestContext = Pick<typeof _$vitest, "inject" | "test" | "beforeAll" | "beforeEach">;
77
+ type VitestContext = Pick<typeof _$vitest, "inject" | "test" | "beforeAll" | "beforeEach" | "expect">;
71
78
  declare function createSetupTest(vitest: VitestContext, playwright?: PlaywrightContext): <Addons extends AddonMap>(addons: Addons, options?: SetupTestOptions<Addons>) => {
72
79
  test: _$vitest.TestAPI<Fixtures>;
73
80
  testCases: Array<AddonTestCase<AddonMap>>;
@@ -1,4 +1,4 @@
1
- import { S as __toESM, b as __commonJSMin, f as R, i as addPnpmAllowBuilds, m as create, p as z, t as add, x as __require } from "../engine-DSL32Woe.mjs";
1
+ import { S as __toESM, b as __commonJSMin, f as R, i as addPnpmAllowBuilds, m as create, p as z, t as add, x as __require } from "../engine-Hqu9lWdb.mjs";
2
2
  import fs from "node:fs";
3
3
  import path from "node:path";
4
4
  import process$1 from "node:process";
@@ -736,7 +736,7 @@ function setupGlobal({ TEST_DIR, pre, post }) {
736
736
  };
737
737
  };
738
738
  }
739
- async function prepareServer({ cwd, page, buildCommand = "pnpm build", previewCommand = "pnpm preview" }) {
739
+ async function prepareServer({ cwd, page, buildCommand = "pnpm build", previewCommand = "pnpm preview", expect }) {
740
740
  if (buildCommand) execSync(buildCommand, {
741
741
  cwd,
742
742
  stdio: "pipe"
@@ -746,8 +746,13 @@ async function prepareServer({ cwd, page, buildCommand = "pnpm build", previewCo
746
746
  command: previewCommand
747
747
  });
748
748
  page.setDefaultNavigationTimeout(62e3);
749
+ await page.route("**/.well-known/appspecific/com.chrome.devtools.json", (route) => route.fulfill({
750
+ status: 404,
751
+ body: ""
752
+ }));
749
753
  try {
750
- await page.goto(url);
754
+ const response = await page.goto(url);
755
+ expect?.(response?.ok(), `preview server did not serve ${url}`)?.toBe(true);
751
756
  } catch (e) {
752
757
  await close();
753
758
  throw e;
@@ -759,7 +764,7 @@ async function prepareServer({ cwd, page, buildCommand = "pnpm build", previewCo
759
764
  }
760
765
  function createSetupTest(vitest, playwright) {
761
766
  return function setupTest(addons, options) {
762
- const { inject, test: vitestTest, beforeAll, beforeEach } = vitest;
767
+ const { inject, test: vitestTest, beforeAll, beforeEach, expect } = vitest;
763
768
  const test = vitestTest.extend({});
764
769
  const cwd = inject("testDir");
765
770
  const templatesDir = inject("templatesDir");
@@ -845,7 +850,10 @@ function createSetupTest(vitest, playwright) {
845
850
  return {
846
851
  test,
847
852
  testCases,
848
- prepareServer
853
+ prepareServer: (options) => prepareServer({
854
+ expect,
855
+ ...options
856
+ })
849
857
  };
850
858
  };
851
859
  }
@@ -1,6 +1,6 @@
1
- import { expect } from '@playwright/test';
2
1
  import fs from 'node:fs';
3
2
  import path from 'node:path';
3
+ import { expect } from 'vitest';
4
4
  import addon from '../src/index.js';
5
5
  import { setupTest } from './setup/suite.js';
6
6
 
@@ -22,12 +22,12 @@
22
22
  "access": "public"
23
23
  },
24
24
  "peerDependencies": {
25
- "sv": "latest"
25
+ "sv": "^0.15.4"
26
26
  },
27
27
  "devDependencies": {
28
- "sv": "latest",
29
- "@sveltejs/sv-utils": "latest",
30
- "@playwright/test": "^1.59.1",
28
+ "sv": "^0.15.4",
29
+ "@sveltejs/sv-utils": "^0.2.2",
30
+ "@playwright/test": "^1.60.0",
31
31
  "@types/node": "^25.5.2",
32
32
  "tsdown": "^0.21.7",
33
33
  "vitest": "^4.1.3"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sv",
3
- "version": "0.15.3",
3
+ "version": "0.15.4",
4
4
  "type": "module",
5
5
  "description": "A command line interface (CLI) for creating and maintaining Svelte applications",
6
6
  "license": "MIT",