feat: import fresh from fresh (#2479)
Instead of importing as `@fresh/core`.
This commit is contained in:
+5
-5
@@ -367,7 +367,7 @@ ${GRADIENT_CSS}
|
||||
// Skip this and be silent if there is a network issue.
|
||||
}
|
||||
|
||||
const MAIN_TS = `import { App, staticFiles, fsRoutes } from "@fresh/core";
|
||||
const MAIN_TS = `import { App, staticFiles, fsRoutes } from "fresh";
|
||||
import { State } from "./utils.ts";
|
||||
|
||||
export const app = new App<State>();
|
||||
@@ -406,7 +406,7 @@ export function Button(props: ButtonProps) {
|
||||
`;
|
||||
await writeFile("components/Button.tsx", COMPONENTS_BUTTON_TSX);
|
||||
|
||||
const UTILS_TS = `import { createDefine } from "@fresh/core";
|
||||
const UTILS_TS = `import { createDefine } from "fresh";
|
||||
|
||||
// deno-lint-ignore no-empty-interface
|
||||
export interface State {}
|
||||
@@ -444,7 +444,7 @@ export default define.page(function Home() {
|
||||
})`;
|
||||
await writeFile("routes/index.tsx", ROUTES_HOME);
|
||||
|
||||
const APP_WRAPPER = `import { type PageProps } from "@fresh/core";
|
||||
const APP_WRAPPER = `import { type PageProps } from "fresh";
|
||||
|
||||
export default function App({ Component }: PageProps) {
|
||||
return (
|
||||
@@ -484,7 +484,7 @@ export default function Counter(props: CounterProps) {
|
||||
|
||||
const DEV_TS = `#!/usr/bin/env -S deno run -A --watch=static/,routes/
|
||||
${useTailwind ? `import { tailwind } from "@fresh/plugin-tailwind";\n` : ""};
|
||||
import { Builder } from "@fresh/core/dev";
|
||||
import { Builder } from "fresh/dev";
|
||||
import { app } from "./main.ts";
|
||||
|
||||
const builder = new Builder();
|
||||
@@ -514,7 +514,7 @@ if (Deno.args.includes("build")) {
|
||||
},
|
||||
exclude: ["**/_fresh/*"],
|
||||
imports: {
|
||||
"@fresh/core": `jsr:@fresh/core@^${FRESH_VERSION}`,
|
||||
"fresh": `jsr:@fresh/core@^${FRESH_VERSION}`,
|
||||
"@fresh/plugin-tailwind":
|
||||
`jsr:@fresh/plugin-tailwind@^${FRESH_TAILWIND_VERSION}`,
|
||||
"preact": `npm:preact@^${PREACT_VERSION}`,
|
||||
|
||||
@@ -29,8 +29,8 @@ async function patchProject(dir: string): Promise<void> {
|
||||
);
|
||||
|
||||
json.imports = rootJson.imports;
|
||||
json.imports["@fresh/core"] = "../src/mod.ts";
|
||||
json.imports["@fresh/core/dev"] = "../src/dev/mod.ts";
|
||||
json.imports["fresh"] = "../src/mod.ts";
|
||||
json.imports["fresh/dev"] = "../src/dev/mod.ts";
|
||||
json.imports["@fresh/plugin-tailwind"] = "../plugin-tailwindcss/mod.ts";
|
||||
|
||||
await Deno.writeTextFile(jsonPath, JSON.stringify(json, null, 2));
|
||||
|
||||
Reference in New Issue
Block a user