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
+3 -3
View File
@@ -4,13 +4,13 @@ Vite plugin for [Fresh](https://usefresh.dev).
## Usage
1. Run `deno install jsr:@fresh/plugin-vite npm:vite`
1. Run `deno install jsr:@paulaboks/sweet-vite npm:vite`
2. Ensure that your `deno.json` has the `fresh` import mapping:
```json
{
"imports": {
"fresh": "jsr:@fresh/core"
"sweet": "jsr:@paulaboks/sweet"
}
}
```
@@ -19,7 +19,7 @@ Vite plugin for [Fresh](https://usefresh.dev).
```diff
import { defineConfig } from "vite";
+ import { fresh } from "@fresh/plugin-vite";
+ import { fresh } from "@paulaboks/sweet-vite";
export default defineConfig({
plugins: [
@@ -1,5 +1,5 @@
import { useEffect, useState } from "preact/hooks";
import { Head } from "fresh/runtime";
import { Head } from "sweet/runtime";
export function HeadCounter() {
const [ready, setReady] = useState(false);
@@ -1,5 +1,5 @@
import { useEffect, useState } from "preact/hooks";
import { Head } from "fresh/runtime";
import { Head } from "sweet/runtime";
export function HeadMeta() {
const [ready, setReady] = useState(false);
+1 -1
View File
@@ -1,4 +1,4 @@
import { App, staticFiles, trailingSlashes } from "fresh";
import { App, staticFiles, trailingSlashes } from "sweet";
export const app = new App()
.use(staticFiles())
+1 -1
View File
@@ -1,4 +1,4 @@
import type { PageProps } from "fresh";
import type { PageProps } from "sweet";
import { AppNav } from "../islands/AppNav.tsx";
export default function App({ Component }: PageProps) {
@@ -1,3 +1,3 @@
import { BUILD_ID } from "@fresh/build-id";
import { BUILD_ID } from "@paulaboks/sweet-build-id";
export const handler = () => new Response(BUILD_ID);
@@ -1,4 +1,4 @@
import type { Middleware } from "@fresh/core";
import type { Middleware } from "@paulaboks/sweet";
const middleware1: Middleware<{ text: string }> = async (ctx) => {
ctx.state.text = "A";
@@ -1,4 +1,4 @@
import type { HandlerFn } from "@fresh/core";
import type { HandlerFn } from "@paulaboks/sweet";
export const handler: HandlerFn<null, { text: string }> = (ctx) =>
new Response(ctx.state.text);
@@ -1,4 +1,4 @@
import { Partial } from "@fresh/core/runtime";
import { Partial } from "@paulaboks/sweet/runtime";
import { ReadyIsland } from "../../islands/tests/Ready.tsx";
export default function Page() {
@@ -1,4 +1,4 @@
import { Partial } from "@fresh/core/runtime";
import { Partial } from "@paulaboks/sweet/runtime";
import { CounterHooks } from "../../islands/tests/CounterHooks.tsx";
export default function Page() {
+1 -1
View File
@@ -1,4 +1,4 @@
import { createDefine } from "@fresh/core";
import { createDefine } from "@paulaboks/sweet";
// deno-lint-ignore no-explicit-any
export const define = createDefine<any>();
+1 -1
View File
@@ -1,5 +1,5 @@
import { defineConfig } from "vite";
import { fresh } from "@fresh/plugin-vite";
import { fresh } from "@paulaboks/sweet-vite";
import inspect from "vite-plugin-inspect";
import tailwind from "@tailwindcss/vite";
+2 -2
View File
@@ -1,5 +1,5 @@
{
"name": "@fresh/plugin-vite",
"name": "@paulaboks/sweet-vite",
"version": "1.1.2",
"license": "MIT",
"exports": {
@@ -33,7 +33,7 @@
"@types/node": "npm:@types/node@^24.1.0",
"@types/qs": "npm:@types/qs@^6.14.0",
"feed": "npm:feed@^5.1.0",
"fresh": "jsr:@fresh/core@^2.0.0",
"sweet": "jsr:@paulaboks/sweet@^2.0.0",
"ioredis": "npm:ioredis@^5.7.0",
"mime-db": "npm:mime-db@^1.54.0",
"pg": "npm:pg@^8.16.3",
+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)(\?.*)?$/;
+1 -1
View File
@@ -1,4 +1,4 @@
import { App, staticFiles } from "@fresh/core";
import { App, staticFiles } from "@paulaboks/sweet";
export const app = new App({ basePath: "/ui" })
.use(staticFiles())
@@ -1,5 +1,5 @@
import { defineConfig } from "vite";
import { fresh } from "@fresh/plugin-vite";
import { fresh } from "@paulaboks/sweet-vite";
export default defineConfig({
base: "/ui/",
@@ -1,4 +1,4 @@
import { App, staticFiles } from "@fresh/core";
import { App, staticFiles } from "@paulaboks/sweet";
export const app = new App()
.use(staticFiles())
@@ -1,5 +1,5 @@
import { defineConfig } from "vite";
import { fresh } from "@fresh/plugin-vite";
import { fresh } from "@paulaboks/sweet-vite";
export default defineConfig({
plugins: [fresh()],
@@ -1,4 +1,4 @@
import { App, staticFiles } from "@fresh/core";
import { App, staticFiles } from "@paulaboks/sweet";
export const app = new App()
.use(staticFiles())
@@ -1,5 +1,5 @@
import { defineConfig } from "vite";
import { fresh } from "@fresh/plugin-vite";
import { fresh } from "@paulaboks/sweet-vite";
export default defineConfig({
plugins: [fresh()],
@@ -1,6 +1,6 @@
{
"imports": {
"fresh": "jsr:@fresh/core",
"sweet": "jsr:@paulaboks/sweet",
"@preact/signals": "npm:@preact/signals@^1.3.0",
"preact": "npm:preact@^10.26.1",
"preact/": "npm:/preact@^10.26.1/"
@@ -1,3 +1,3 @@
import { App } from "fresh";
import { App } from "sweet";
export const app = new App().fsRoutes();
@@ -1,5 +1,5 @@
import { defineConfig } from "vite";
import { fresh } from "@fresh/plugin-vite";
import { fresh } from "@paulaboks/sweet-vite";
export default defineConfig({
plugins: [fresh()],
+1 -1
View File
@@ -1,3 +1,3 @@
import { App } from "@fresh/core";
import { App } from "@paulaboks/sweet";
export const app = new App().fsRoutes();
@@ -1,5 +1,5 @@
import { defineConfig } from "vite";
import { fresh } from "@fresh/plugin-vite";
import { fresh } from "@paulaboks/sweet-vite";
export default defineConfig({
plugins: [fresh()],
+1 -1
View File
@@ -1,3 +1,3 @@
import { App } from "@fresh/core";
import { App } from "@paulaboks/sweet";
export const app = new App().get("/", () => new Response("ok"));
@@ -1,5 +1,5 @@
import { defineConfig } from "vite";
import { fresh } from "@fresh/plugin-vite";
import { fresh } from "@paulaboks/sweet-vite";
export default defineConfig({
plugins: [fresh()],
+1 -1
View File
@@ -1,3 +1,3 @@
import { App } from "@fresh/core";
import { App } from "@paulaboks/sweet";
export const app = new App().get("/ok", () => new Response("ok")).fsRoutes();
@@ -1,5 +1,5 @@
import { defineConfig } from "vite";
import { fresh } from "@fresh/plugin-vite";
import { fresh } from "@paulaboks/sweet-vite";
export default defineConfig({
plugins: [fresh()],
+1 -1
View File
@@ -1,4 +1,4 @@
import { App, staticFiles } from "@fresh/core";
import { App, staticFiles } from "@paulaboks/sweet";
export const app = new App()
.use(staticFiles())
@@ -1,5 +1,5 @@
import { defineConfig } from "vite";
import { fresh } from "@fresh/plugin-vite";
import { fresh } from "@paulaboks/sweet-vite";
export default defineConfig({
plugins: [fresh()],
@@ -1,4 +1,4 @@
import { App, staticFiles } from "@fresh/core";
import { App, staticFiles } from "@paulaboks/sweet";
export const app = new App()
.use(staticFiles())
@@ -1,4 +1,4 @@
import type { PageProps } from "fresh";
import type { PageProps } from "sweet";
import { CssModulesNonIsland } from "../components/CssModuleNonIsland.tsx";
export default function App({ Component }: PageProps) {
@@ -1,4 +1,4 @@
import { createDefine } from "@fresh/core";
import { createDefine } from "@paulaboks/sweet";
// deno-lint-ignore no-explicit-any
export const define = createDefine<any>();
@@ -1,5 +1,5 @@
import { defineConfig } from "vite";
import { fresh } from "@fresh/plugin-vite";
import { fresh } from "@paulaboks/sweet-vite";
export default defineConfig({
plugins: [fresh()],
+1 -1
View File
@@ -1,4 +1,4 @@
import { App, staticFiles } from "@fresh/core";
import { App, staticFiles } from "@paulaboks/sweet";
export const app = new App()
.use(staticFiles())
@@ -1,5 +1,5 @@
import { defineConfig } from "vite";
import { fresh } from "@fresh/plugin-vite";
import { fresh } from "@paulaboks/sweet-vite";
export default defineConfig({
plugins: [fresh({
+1 -1
View File
@@ -1,3 +1,3 @@
import { App } from "@fresh/core";
import { App } from "@paulaboks/sweet";
export const app = new App().fsRoutes();
@@ -1,4 +1,4 @@
import type { PageProps } from "@fresh/core";
import type { PageProps } from "@paulaboks/sweet";
export default function App(props: PageProps) {
return (
@@ -1,5 +1,5 @@
import { defineConfig } from "vite";
import { fresh } from "@fresh/plugin-vite";
import { fresh } from "@paulaboks/sweet-vite";
import tailwindcss from "@tailwindcss/vite";
export default defineConfig({
@@ -1,3 +1,3 @@
import { App } from "@fresh/core";
import { App } from "@paulaboks/sweet";
export const app = new App().fsRoutes();
@@ -1,5 +1,5 @@
import { defineConfig } from "vite";
import { fresh } from "@fresh/plugin-vite";
import { fresh } from "@paulaboks/sweet-vite";
import tailwindcss from "@tailwindcss/vite";
export default defineConfig({
@@ -1,7 +1,7 @@
{
"imports": {
"fresh": "jsr:@fresh/core@^2.0.0",
"@fresh/plugin-vite": "jsr:@fresh/plugin-vite@^1.0.0",
"sweet": "jsr:@paulaboks/sweet@^2.0.0",
"@paulaboks/sweet-vite": "jsr:@paulaboks/sweet-vite@^1.0.0",
"preact": "npm:preact@^10.27.2",
"preact/": "npm:/preact@^10.27.2/"
}
@@ -1,3 +1,3 @@
import { App } from "fresh";
import { App } from "sweet";
export const app = new App().fsRoutes();
@@ -1,5 +1,5 @@
import { defineConfig } from "vite";
import { fresh } from "@fresh/plugin-vite";
import { fresh } from "@paulaboks/sweet-vite";
export default defineConfig({
plugins: [fresh()],
@@ -1,4 +1,4 @@
import { App, staticFiles } from "@fresh/core";
import { App, staticFiles } from "@paulaboks/sweet";
export const app = new App()
.use(staticFiles())
@@ -1,5 +1,5 @@
import { defineConfig } from "vite";
import { fresh } from "@fresh/plugin-vite";
import { fresh } from "@paulaboks/sweet-vite";
import { VitePWA } from "vite-plugin-pwa";
export default defineConfig({
+1 -1
View File
@@ -60,7 +60,7 @@ export async function prepareDevServer(fixtureDir: string) {
await Deno.writeTextFile(
path.join(tmp.dir, "vite.config.ts"),
`import { defineConfig } from "vite";
import { fresh } from "@fresh/plugin-vite";
import { fresh } from "@paulaboks/sweet-vite";
export default defineConfig({
plugins: [