Skip to content
Draft
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
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# vite-plus preview build registry bridge (auto-added by vp)
registry=https://registry-bridge.viteplus.dev/
2 changes: 1 addition & 1 deletion apps/web/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import vinext from "vinext";
import { defineConfig } from "vite";
import { defineConfig } from "vite-plus";
import { kvDataAdapter } from "@vinext/cloudflare/cache/kv-data-adapter";
import { imageAdapter } from "@vinext/cloudflare/images/images-optimizer";
import { cloudflare } from "@cloudflare/vite-plugin";
Expand Down
1 change: 1 addition & 0 deletions packages/cloudflare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"devDependencies": {
"@types/node": "catalog:",
"vinext": "workspace:*",
"vite": "catalog:",
"vite-plus": "catalog:"
},
"peerDependencies": {
Expand Down
1,462 changes: 790 additions & 672 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

17 changes: 15 additions & 2 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ catalog:
typescript: ^5.7.0
use-count-up: 3.0.1
validator: ^13.15.26
vite: npm:@voidzero-dev/vite-plus-core@0.2.1
vite: npm:@voidzero-dev/vite-plus-core@0.0.0-commit.d31f7b6818544e8261b9ccce2374a5e32a8b666f
vite-plugin-commonjs: ^0.10.4
vite-plus: 0.2.1
vite-plus: 0.0.0-commit.d31f7b6818544e8261b9ccce2374a5e32a8b666f
vite-tsconfig-paths: ^6.1.1
vitest: 4.1.9
web-vitals: ^4.2.4
Expand All @@ -102,8 +102,10 @@ overrides:
peerDependencyRules:
allowAny:
- vite
- vitest
allowedVersions:
vite: "*"
vitest: "*"
ignoreMissing:
- next
- webpack
Expand Down Expand Up @@ -131,3 +133,14 @@ allowBuilds:
# MSW's postinstall only copies a service worker into ./public for browser
# mocking. We exclusively use msw/node, so the postinstall is unnecessary.
msw: false
minimumReleaseAgeExclude:
- vite-plus
- "@voidzero-dev/*"
- oxlint
- "@oxlint/*"
- oxlint-tsgolint
- "@oxlint-tsgolint/*"
- oxfmt
- "@oxfmt/*"
- vitest
- "@vitest/*"
2 changes: 1 addition & 1 deletion scripts/performance-trace.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { tmpdir } from "node:os";
import { join, resolve } from "node:path";
import { promisify } from "node:util";
import { gzip } from "node:zlib";
import { afterEach, describe, expect, test } from "vitest";
import { afterEach, describe, expect, test } from "vite-plus/test";
import {
profileToFlameGraph,
readGzipProfile,
Expand Down
2 changes: 1 addition & 1 deletion tests/_msw/setup.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { afterAll, afterEach, beforeAll } from "vitest";
import { afterAll, afterEach, beforeAll } from "vite-plus/test";
import { server } from "./server.js";

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/app-browser-stream.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { afterEach, beforeEach, describe, expect, it, vi } from "vite-plus/test";
import {
chunksToReadableStream,
createProgressiveRscStream,
Expand Down
2 changes: 1 addition & 1 deletion tests/app-client-reference-preloader.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, it } from "vitest";
import { describe, expect, it } from "vite-plus/test";
import { createClientReferencePreloader } from "../packages/vinext/src/server/app-client-reference-preloader.js";

function createDeferred(): { promise: Promise<void>; resolve: () => void } {
Expand Down
2 changes: 1 addition & 1 deletion tests/app-prerender-static-params.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, it, vi } from "vitest";
import { describe, expect, it, vi } from "vite-plus/test";
import { createAppPrerenderStaticParamsResolver } from "../packages/vinext/src/server/app-prerender-static-params.js";

describe("createAppPrerenderStaticParamsResolver", () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/app-route-module-loader.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, it, vi } from "vitest";
import { describe, expect, it, vi } from "vite-plus/test";
import {
ensureAppRouteModulesLoaded,
loadAppInterceptLayouts,
Expand Down
2 changes: 1 addition & 1 deletion tests/app-router-client-preloading.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, it } from "vitest";
import { describe, expect, it } from "vite-plus/test";

describe("Client reference preloading (Issue #256)", () => {
it("preloading correctly warms the memoize cache", async () => {
Expand Down
4 changes: 2 additions & 2 deletions tests/app-router-dev-server.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import http from "node:http";
import fsp from "node:fs/promises";
import { type ViteDevServer } from "vite";
import { afterAll, beforeAll, describe, expect, it } from "vitest";
import { type ViteDevServer } from "vite-plus";
import { afterAll, beforeAll, describe, expect, it } from "vite-plus/test";
import { APP_FIXTURE_DIR, fetchHtml, startFixtureServer } from "./helpers.js";

function decodeHtmlText(text: string): string {
Expand Down
4 changes: 2 additions & 2 deletions tests/app-router-external-rewrite.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import zlib from "node:zlib";
import { type ViteDevServer } from "vite";
import { beforeAll, afterAll, describe, expect, it } from "vitest";
import { type ViteDevServer } from "vite-plus";
import { beforeAll, afterAll, describe, expect, it } from "vite-plus/test";
import { APP_FIXTURE_DIR, startFixtureServer } from "./helpers.js";

describe("App Router external rewrite proxy credential forwarding", () => {
Expand Down
4 changes: 2 additions & 2 deletions tests/app-router-font-google-prod.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fs from "node:fs";
import path from "node:path";
import { createBuilder } from "vite";
import { beforeAll, afterAll, describe, expect, it } from "vitest";
import { createBuilder } from "vite-plus";
import { beforeAll, afterAll, describe, expect, it } from "vite-plus/test";
import vinext from "../packages/vinext/src/index.js";

describe("App Router Production server self-hosted next/font/google headers", () => {
Expand Down
4 changes: 2 additions & 2 deletions tests/app-router-global-not-found-css-order.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
import fs from "node:fs";
import path from "node:path";
import { pathToFileURL } from "node:url";
import { createBuilder, preview } from "vite";
import { afterAll, beforeAll, describe, expect, it } from "vitest";
import { createBuilder, preview } from "vite-plus";
import { afterAll, beforeAll, describe, expect, it } from "vite-plus/test";
import vinext from "../packages/vinext/src/index.js";

const FIXTURE_DIR = path.resolve(import.meta.dirname, "./fixtures/global-not-found-css-order");
Expand Down
2 changes: 1 addition & 1 deletion tests/app-router-isr-codegen.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, it } from "vitest";
import { describe, expect, it } from "vite-plus/test";
import { generateRscEntry } from "../packages/vinext/src/entries/app-rsc-entry.js";
import type { AppRoute } from "../packages/vinext/src/routing/app-router.js";

Expand Down
4 changes: 2 additions & 2 deletions tests/app-router-malformed-url.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type ViteDevServer } from "vite";
import { beforeAll, afterAll, describe, expect, it } from "vitest";
import { type ViteDevServer } from "vite-plus";
import { beforeAll, afterAll, describe, expect, it } from "vite-plus/test";
import { APP_FIXTURE_DIR, startFixtureServer } from "./helpers.js";

describe("App Router dev server malformed URL handling", () => {
Expand Down
4 changes: 2 additions & 2 deletions tests/app-router-metadata-routes.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from "node:path";
import { type ViteDevServer } from "vite";
import { beforeAll, afterAll, describe, expect, it } from "vitest";
import { type ViteDevServer } from "vite-plus";
import { beforeAll, afterAll, describe, expect, it } from "vite-plus/test";
import { APP_FIXTURE_DIR, startFixtureServer } from "./helpers.js";

describe("metadata routes integration (App Router)", () => {
Expand Down
4 changes: 2 additions & 2 deletions tests/app-router-middleware-next-request.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type ViteDevServer } from "vite";
import { beforeAll, afterAll, describe, expect, it } from "vitest";
import { type ViteDevServer } from "vite-plus";
import { beforeAll, afterAll, describe, expect, it } from "vite-plus/test";
import { APP_FIXTURE_DIR, fetchHtml, startFixtureServer } from "./helpers.js";

describe("App Router middleware with NextRequest", () => {
Expand Down
4 changes: 2 additions & 2 deletions tests/app-router-next-config-codegen.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import fs from "node:fs";
import os from "node:os";
import path from "node:path";
import { createServer } from "vite";
import { describe, expect, it } from "vitest";
import { createServer } from "vite-plus";
import { describe, expect, it } from "vite-plus/test";
import { generateRscEntry } from "../packages/vinext/src/entries/app-rsc-entry.js";
import { generateSsrEntry } from "../packages/vinext/src/entries/app-ssr-entry.js";
import vinext from "../packages/vinext/src/index.js";
Expand Down
4 changes: 2 additions & 2 deletions tests/app-router-next-config-dev.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type ViteDevServer } from "vite";
import { beforeAll, afterAll, describe, expect, it } from "vitest";
import { type ViteDevServer } from "vite-plus";
import { beforeAll, afterAll, describe, expect, it } from "vite-plus/test";
import { APP_FIXTURE_DIR, fetchHtml, startFixtureServer } from "./helpers.js";

describe("App Router next.config.js features (dev server integration)", () => {
Expand Down
4 changes: 2 additions & 2 deletions tests/app-router-origin-check.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type ViteDevServer } from "vite";
import { beforeAll, afterAll, describe, expect, it } from "vitest";
import { type ViteDevServer } from "vite-plus";
import { beforeAll, afterAll, describe, expect, it } from "vite-plus/test";
import { APP_FIXTURE_DIR, startFixtureServer } from "./helpers.js";

describe("App Router dev server origin check", () => {
Expand Down
6 changes: 3 additions & 3 deletions tests/app-router-production-build.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import fs from "node:fs";
import os from "node:os";
import path from "node:path";
import { pathToFileURL } from "node:url";
import { createBuilder } from "vite";
import { afterAll, describe, expect, it, vi } from "vitest";
import { createBuilder } from "vite-plus";
import { afterAll, describe, expect, it, vi } from "vite-plus/test";
import vinext from "../packages/vinext/src/index.js";
import { APP_FIXTURE_DIR } from "./helpers.js";

Expand Down Expand Up @@ -473,7 +473,7 @@ export function GET(request) {
}, 120000);

it("serves production build via preview server", async () => {
const { preview } = await import("vite");
const { preview } = await import("vite-plus");

const previewServer = await preview({
root: APP_FIXTURE_DIR,
Expand Down
4 changes: 2 additions & 2 deletions tests/app-router-production-server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import fs from "node:fs";
import http from "node:http";
import os from "node:os";
import path from "node:path";
import { createBuilder } from "vite";
import { afterAll, beforeAll, describe, expect, it } from "vitest";
import { createBuilder } from "vite-plus";
import { afterAll, beforeAll, describe, expect, it } from "vite-plus/test";
import vinext from "../packages/vinext/src/index.js";
import { APP_FIXTURE_DIR } from "./helpers.js";

Expand Down
4 changes: 2 additions & 2 deletions tests/app-router-proxy-conventions.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fs from "node:fs/promises";
import path from "node:path";
import { afterEach, describe, expect, it } from "vitest";
import type { ViteDevServer } from "vite";
import { afterEach, describe, expect, it } from "vite-plus/test";
import type { ViteDevServer } from "vite-plus";
import { createIsolatedFixture, startFixtureServer } from "./helpers.js";

const FIXTURE_DIR = path.resolve(import.meta.dirname, "./fixtures/proxy-conventions");
Expand Down
2 changes: 1 addition & 1 deletion tests/app-router-rsc-flight-hint.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, it } from "vitest";
import { describe, expect, it } from "vite-plus/test";
import { generateRscEntry } from "../packages/vinext/src/entries/app-rsc-entry.js";
import type { AppRoute } from "../packages/vinext/src/routing/app-router.js";

Expand Down
12 changes: 6 additions & 6 deletions tests/app-router-rsc-plugin.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import fs from "node:fs";
import os from "node:os";
import path from "node:path";
import { type ViteDevServer } from "vite";
import { beforeAll, afterAll, describe, expect, it } from "vitest";
import { type ViteDevServer } from "vite-plus";
import { beforeAll, afterAll, describe, expect, it } from "vite-plus/test";
import vinext from "../packages/vinext/src/index.js";
import { APP_FIXTURE_DIR, fetchHtml, RSC_ENTRIES } from "./helpers.js";

Expand All @@ -15,7 +15,7 @@ describe("RSC plugin auto-registration", () => {
// The plugin should auto-detect the app/ directory and inject RSC.
// Note: appDir is passed because process.cwd() differs from root in tests.
// In real projects, cwd === root so appDir is not needed.
const { createServer } = await import("vite");
const { createServer } = await import("vite-plus");
server = await createServer({
root: APP_FIXTURE_DIR,
configFile: false,
Expand Down Expand Up @@ -50,7 +50,7 @@ describe("RSC plugin auto-registration", () => {
});

it("serves the browser bootstrap in dev when deploymentId is configured", async () => {
const { createServer } = await import("vite");
const { createServer } = await import("vite-plus");
const deploymentServer = await createServer({
root: APP_FIXTURE_DIR,
configFile: false,
Expand Down Expand Up @@ -84,7 +84,7 @@ describe("RSC plugin auto-registration", () => {
}, 30_000);

it("does not double-register when RSC plugin is already present", async () => {
const { createServer } = await import("vite");
const { createServer } = await import("vite-plus");
const rsc = (await import("@vitejs/plugin-rsc")).default;

// Create a server with BOTH vinext({ rsc: false }) and explicit rsc().
Expand Down Expand Up @@ -112,7 +112,7 @@ describe("RSC plugin auto-registration", () => {
}, 30000);

it("throws an error when user double-registers rsc() alongside auto-registration", async () => {
const { createBuilder } = await import("vite");
const { createBuilder } = await import("vite-plus");
const rsc = (await import("@vitejs/plugin-rsc")).default;

// vinext() auto-registers @vitejs/plugin-rsc when app/ is detected.
Expand Down
2 changes: 1 addition & 1 deletion tests/app-router-static-export.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import fs from "node:fs";
import path from "node:path";
import { afterAll, beforeAll, describe, expect, it } from "vitest";
import { afterAll, beforeAll, describe, expect, it } from "vite-plus/test";
import { APP_FIXTURE_DIR, buildAppFixture } from "./helpers.js";

describe("App Router Static export", () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/app-router-worker-entry.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fs from "node:fs";
import os from "node:os";
import path from "node:path";
import { describe, expect, it, vi } from "vitest";
import { describe, expect, it, vi } from "vite-plus/test";

describe("App Router Production server worker entry compatibility", () => {
it("accepts Worker-style default exports from dist/server/index.js", async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/app-rsc-stream-hints.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, it } from "vitest";
import { describe, expect, it } from "vite-plus/test";
import { normalizeReactFlightPreloadHints } from "../packages/vinext/src/server/rsc-stream-hints.js";

function streamFromChunks(chunks: string[]): ReadableStream<Uint8Array> {
Expand Down
2 changes: 1 addition & 1 deletion tests/app-segment-config.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, it } from "vitest";
import { describe, expect, it } from "vite-plus/test";
import {
isEdgeRuntime,
resolveAppPageFetchCacheMode,
Expand Down
2 changes: 1 addition & 1 deletion tests/app-static-generation.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, it } from "vitest";
import { describe, expect, it } from "vite-plus/test";
import {
createStaticGenerationHeadersContext,
getAppPageStaticGenerationErrorMessage,
Expand Down
2 changes: 1 addition & 1 deletion tests/asset-prefix.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { describe, it, expect, afterAll } from "vite-plus/test";
import fs from "node:fs";
import os from "node:os";
import path from "node:path";
import { build, createBuilder } from "vite";
import { build, createBuilder } from "vite-plus";
import vinext from "../packages/vinext/src/index.js";
import {
isAbsoluteAssetPrefix,
Expand Down
2 changes: 1 addition & 1 deletion tests/build-optimization.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import fsp from "node:fs/promises";
import os from "node:os";
import path from "node:path";
import { describe, it, expect, beforeEach, afterEach } from "vite-plus/test";
import { createBuilder, parseAst } from "vite";
import { createBuilder, parseAst } from "vite-plus";
import { augmentSsrManifestFromBundle as _augmentSsrManifestFromBundle } from "../packages/vinext/src/build/ssr-manifest.js";
import {
hasExportAllCandidate as _hasExportAllCandidate,
Expand Down
2 changes: 1 addition & 1 deletion tests/build-time-classification-integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ export default function ForceStaticLayout({ children }) {
const { default: vinext } = await import(
pathToFileURL(path.join(workspaceRoot, "packages/vinext/src/index.ts")).href
);
const { createBuilder } = await import("vite");
const { createBuilder } = await import("vite-plus");
// No minify override: build with vinext's production defaults, which minify
// the server environments (vinext:server-minify-defaults). The assertions
// below are minify-robust by design — see the file header.
Expand Down
4 changes: 2 additions & 2 deletions tests/cache-adapters-build.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import fs from "node:fs";
import os from "node:os";
import path from "node:path";
import { pathToFileURL } from "node:url";
import { createBuilder } from "vite";
import { createBuilder } from "vite-plus";
import { afterEach, describe, expect, it } from "vite-plus/test";
import vinext from "../packages/vinext/src/index.js";

Expand All @@ -28,7 +28,7 @@ const cfPluginPath = path.resolve(

type CloudflarePluginFactory = (opts?: {
viteEnvironment?: { name: string; childEnvironments?: string[] };
}) => import("vite").Plugin;
}) => import("vite-plus").Plugin;

function writeFixtureFile(root: string, filePath: string, content: string) {
const absPath = path.join(root, filePath);
Expand Down
2 changes: 1 addition & 1 deletion tests/client-reference-dedup.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, it, expect } from "vite-plus/test";
import type { Plugin } from "vite";
import type { Plugin } from "vite-plus";
import vinext from "../packages/vinext/src/index.js";
import {
extractPackageName,
Expand Down
Loading
Loading