From 19a036666ebf3aa0c6d21d3ccbee7ba52b1e5bab Mon Sep 17 00:00:00 2001 From: Marcos Candeia Date: Sun, 12 May 2024 21:40:47 -0300 Subject: [PATCH] Remove VFS code Signed-off-by: Marcos Candeia --- import_map.json | 4 ++-- plugins/tailwind/mod.ts | 40 ++++++++++++++-------------------------- 2 files changed, 16 insertions(+), 28 deletions(-) diff --git a/import_map.json b/import_map.json index ecfd370..48efac8 100644 --- a/import_map.json +++ b/import_map.json @@ -1,7 +1,7 @@ { "imports": { "deco-sites/std/": "./", - "deco/": "https://denopkg.com/deco-cx/deco@1.62.2/", + "deco/": "https://denopkg.com/deco-cx/deco@1.66.0/", "partytown/": "https://deno.land/x/partytown@0.3.4/", "$fresh/": "https://deno.land/x/fresh@1.6.1/", "preact": "https://esm.sh/preact@10.15.1", @@ -11,4 +11,4 @@ "@preact/signals-core": "https://esm.sh/@preact/signals-core@1.3.0", "std/": "https://deno.land/std@0.182.0/" } -} \ No newline at end of file +} diff --git a/plugins/tailwind/mod.ts b/plugins/tailwind/mod.ts index c8697a4..eccb60d 100644 --- a/plugins/tailwind/mod.ts +++ b/plugins/tailwind/mod.ts @@ -1,10 +1,9 @@ import type { Plugin } from "$fresh/server.ts"; -import { resolveDeps } from "./deno.ts"; import { Context } from "deco/deco.ts"; -import { VFS } from "deco/runtime/fs/mod.ts"; import { walk } from "std/fs/walk.ts"; import { join, toFileUrl } from "std/path/mod.ts"; import { bundle, Config, loadTailwindConfig } from "./bundler.ts"; +import { resolveDeps } from "./deno.ts"; export type { Config } from "./bundler.ts"; const root: string = Deno.cwd(); @@ -102,35 +101,24 @@ export const plugin = (config?: Config): Plugin => { const ctx = Context.active(); const withReleaseContent = async (config: Config) => { - const ctx = Context.active(); const allTsxFiles = new Map(); - const vfs = ctx.fs; - if (!vfs || !(vfs instanceof VFS)) { - // init search graph with local FS - const roots = new Set(); - - for await ( - const entry of walk(Deno.cwd(), { - includeDirs: false, - includeFiles: true, - }) - ) { - if (entry.path.endsWith(".tsx") || entry.path.includes("/apps/")) { - roots.add(toFileUrl(entry.path).href); - } - } - - await resolveDeps([...roots.values()], allTsxFiles); - } else { - // init search graph with virtual FS - for (const [path, file] of Object.entries(vfs.fileSystem)) { - if (path.endsWith(".tsx") && file.content) { - allTsxFiles.set(path, file.content); - } + // init search graph with local FS + const roots = new Set(); + + for await ( + const entry of walk(Deno.cwd(), { + includeDirs: false, + includeFiles: true, + }) + ) { + if (entry.path.endsWith(".tsx") || entry.path.includes("/apps/")) { + roots.add(toFileUrl(entry.path).href); } } + await resolveDeps([...roots.values()], allTsxFiles); + return { ...config, content: [...allTsxFiles.values()].map((content) => ({