Start renaming

This commit is contained in:
2026-11-11 11:45:20 -03:00
parent ae22ec5276
commit 216d54a0ae
179 changed files with 890 additions and 449 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
/**
* Used internally by the `@fresh/plugin-vite` to add HMR support
* Used internally by the `@paulaboks/sweet-vite` to add HMR support
* for Fresh running in the browser.
*
* **Do not** import this module directly.
+5 -2
View File
@@ -21,7 +21,7 @@ import {
UniqueNamer,
UPDATE_INTERVAL,
updateCheck,
} from "@fresh/core/internal-dev";
} from "@paulaboks/sweet/internal-dev";
import { checkImports } from "./plugins/verify_imports.ts";
import { isBuiltin } from "node:module";
import { load as stdLoadEnv } from "@std/dotenv";
@@ -45,7 +45,7 @@ export type {
* @example Basic usage
* ```ts vite.config.ts
* import { defineConfig } from "vite";
* import { fresh } from "@fresh/plugin-vite";
* import { fresh } from "@paulaboks/sweet-vite";
*
* export default defineConfig({
* plugins: [
@@ -282,3 +282,6 @@ async function loadEnvFile(envPath: string) {
// Ignore
}
}
/** Alias of {@linkcode fresh}: the Vite plugin for Sweet. */
export { fresh as sweet };
+1 -1
View File
@@ -3,7 +3,7 @@ import type { Plugin } from "vite";
export function buildIdPlugin(): Plugin {
let buildId = "";
const regex = /^(jsr:)?@fresh\/build-id(@.*)?$/;
const regex = /^(jsr:)?@paulaboks\/sweet-build-id(@.*)?$/;
return {
name: "fresh:build-id",
@@ -28,7 +28,7 @@ export function clientEntryPlugin(options: ResolvedFreshViteConfig): Plugin {
if (id === modName) {
return `\0${modName}`;
} else if (id === "fresh:client-quirks") {
return "@fresh/plugin-vite/client";
return "@paulaboks/sweet-vite/client";
} else if (id === modNameUser) {
return clientEntry;
}
@@ -49,9 +49,9 @@ export function clientEntryPlugin(options: ResolvedFreshViteConfig): Plugin {
return `
${isDev ? 'import "preact/debug"' : ""}
export * from "fresh/runtime-client";
export * from "sweet/runtime-client";
${exists ? `import "fresh:client-entry-user";` : ""}
import "@fresh/plugin-vite/client";`;
import "@paulaboks/sweet-vite/client";`;
},
},
};
@@ -1,6 +1,6 @@
import type { Plugin, ViteDevServer } from "vite";
import { pathWithRoot, type ResolvedFreshViteConfig } from "../utils.ts";
import { crawlFsItem, specToName } from "fresh/internal-dev";
import { crawlFsItem, specToName } from "sweet/internal-dev";
import * as path from "@std/path";
export function clientSnapshot(options: ResolvedFreshViteConfig): Plugin[] {
@@ -1,7 +1,7 @@
import type { DevEnvironment, Plugin } from "vite";
import * as path from "@std/path";
import { contentType as getStdContentType } from "@std/media-types/content-type";
import { ASSET_CACHE_BUST_KEY, upgradeSourceMap } from "fresh/internal";
import { ASSET_CACHE_BUST_KEY, upgradeSourceMap } from "sweet/internal";
import { createRequest, sendResponse } from "@remix-run/node-fetch-server";
import { hashCode } from "../shared.ts";
import type { ResolvedFreshViteConfig } from "../utils.ts";
@@ -4,7 +4,7 @@ import {
type PendingStaticFile,
prepareStaticFile,
writeCompiledEntry,
} from "fresh/internal-dev";
} from "sweet/internal-dev";
import { pathWithRoot, type ResolvedFreshViteConfig } from "../utils.ts";
import * as path from "@std/path";
@@ -92,7 +92,7 @@ export function registerStaticFile(prepared) {
if (isDev) {
code = `import "preact/debug";
import { setErrorInterceptor as internalErrorIntercept } from "fresh/internal";
import { setErrorInterceptor as internalErrorIntercept } from "sweet/internal";
${code}
export function setErrorInterceptor(fn) {
@@ -15,7 +15,7 @@ import {
specToName,
toPosix,
UniqueNamer,
} from "fresh/internal-dev";
} from "sweet/internal-dev";
import {
JS_REG,
pathWithRoot,
+1 -1
View File
@@ -1,5 +1,5 @@
import * as path from "@std/path";
import type { FsRouteFileNoMod, UniqueNamer } from "fresh/internal-dev";
import type { FsRouteFileNoMod, UniqueNamer } from "sweet/internal-dev";
import type { ImportCheck } from "./plugins/verify_imports.ts";
export const JS_REG = /\.([tj]sx?|[mc]?[tj]s)(\?.*)?$/;