From 6f6aafad39d2723e01c6416920b1dc7fbccc51c4 Mon Sep 17 00:00:00 2001 From: lilleman Date: Sun, 2 Aug 2026 14:57:07 +0200 Subject: [PATCH] =?UTF-8?q?Import=20ejs=20as=20default=20export=20?= =?UTF-8?q?=E2=80=94=20the=20v6=20ESM=20build=20exports=20only=20default?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/http/app.ts | 2 +- src/plugin-host/view-resolver.ts | 2 +- src/ui/auth-card.test.ts | 2 +- src/ui/data-table.test.ts | 2 +- src/ui/field.test.ts | 2 +- src/ui/filter-bar.test.ts | 2 +- src/ui/icons.test.ts | 2 +- src/ui/menu.test.ts | 2 +- src/ui/nav-tree.test.ts | 2 +- src/ui/pagination.test.ts | 2 +- src/ui/shell.test.ts | 2 +- src/ui/theme-switch.test.ts | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/http/app.ts b/src/http/app.ts index 47dab8c..81bf0e2 100644 --- a/src/http/app.ts +++ b/src/http/app.ts @@ -2,7 +2,7 @@ import { randomBytes, randomUUID } from "node:crypto"; import { createServer, type IncomingMessage, type Server, type ServerResponse } from "node:http"; import { dirname, join } from "node:path"; import { fileURLToPath } from "node:url"; -import * as ejs from "ejs"; +import ejs from "ejs"; import { type BuiltinRoute, matchBuiltinRoute, type RequestCsrf } from "./builtin-routes.ts"; import { buildPluginChrome, type PageChrome } from "../ui/chrome.ts"; import { buildContext, type RequestContext, type User } from "./context.ts"; diff --git a/src/plugin-host/view-resolver.ts b/src/plugin-host/view-resolver.ts index 4b880d9..fd3747b 100644 --- a/src/plugin-host/view-resolver.ts +++ b/src/plugin-host/view-resolver.ts @@ -5,7 +5,7 @@ // plugin may deliberately shadow a core partial). The router calls this for a `view` RouteResult. import { isAbsolute, join, relative } from "node:path"; -import * as ejs from "ejs"; +import ejs from "ejs"; const CONTROL_CHARS = /[\x00-\x1f]/; diff --git a/src/ui/auth-card.test.ts b/src/ui/auth-card.test.ts index 72a782d..9eb2ffb 100644 --- a/src/ui/auth-card.test.ts +++ b/src/ui/auth-card.test.ts @@ -2,7 +2,7 @@ import assert from "node:assert/strict"; import { dirname, join } from "node:path"; import { test } from "node:test"; import { fileURLToPath } from "node:url"; -import * as ejs from "ejs"; +import ejs from "ejs"; const authCard = join(dirname(fileURLToPath(import.meta.url)), "..", "..", "views", "partials", "auth-card.ejs"); const render = (data: Record = {}): Promise => ejs.renderFile(authCard, data); diff --git a/src/ui/data-table.test.ts b/src/ui/data-table.test.ts index cfa598c..fc6e31d 100644 --- a/src/ui/data-table.test.ts +++ b/src/ui/data-table.test.ts @@ -2,7 +2,7 @@ import assert from "node:assert/strict"; import { dirname, join } from "node:path"; import { test } from "node:test"; import { fileURLToPath } from "node:url"; -import * as ejs from "ejs"; +import ejs from "ejs"; const dataTable = join(dirname(fileURLToPath(import.meta.url)), "..", "..", "views", "partials", "data-table.ejs"); const render = (data: Record = {}): Promise => ejs.renderFile(dataTable, data); diff --git a/src/ui/field.test.ts b/src/ui/field.test.ts index 57ac509..cf9e3ec 100644 --- a/src/ui/field.test.ts +++ b/src/ui/field.test.ts @@ -2,7 +2,7 @@ import assert from "node:assert/strict"; import { dirname, join } from "node:path"; import { test } from "node:test"; import { fileURLToPath } from "node:url"; -import * as ejs from "ejs"; +import ejs from "ejs"; const field = join(dirname(fileURLToPath(import.meta.url)), "..", "..", "views", "partials", "field.ejs"); const render = (data: Record = {}): Promise => ejs.renderFile(field, data); diff --git a/src/ui/filter-bar.test.ts b/src/ui/filter-bar.test.ts index 6a92eb9..6f73f86 100644 --- a/src/ui/filter-bar.test.ts +++ b/src/ui/filter-bar.test.ts @@ -2,7 +2,7 @@ import assert from "node:assert/strict"; import { dirname, join } from "node:path"; import { test } from "node:test"; import { fileURLToPath } from "node:url"; -import * as ejs from "ejs"; +import ejs from "ejs"; const filterBar = join(dirname(fileURLToPath(import.meta.url)), "..", "..", "views", "partials", "filter-bar.ejs"); const render = (data: Record = {}): Promise => ejs.renderFile(filterBar, data); diff --git a/src/ui/icons.test.ts b/src/ui/icons.test.ts index 12a059c..0587733 100644 --- a/src/ui/icons.test.ts +++ b/src/ui/icons.test.ts @@ -3,7 +3,7 @@ import { readFileSync } from "node:fs"; import { dirname, join } from "node:path"; import { test } from "node:test"; import { fileURLToPath } from "node:url"; -import * as ejs from "ejs"; +import ejs from "ejs"; import { ICON_NAMES, buildIconSprite } from "./icons.ts"; const rootDir = join(dirname(fileURLToPath(import.meta.url)), "..", ".."); diff --git a/src/ui/menu.test.ts b/src/ui/menu.test.ts index 7c96eac..98cb0f7 100644 --- a/src/ui/menu.test.ts +++ b/src/ui/menu.test.ts @@ -2,7 +2,7 @@ import assert from "node:assert/strict"; import { dirname, join } from "node:path"; import { test } from "node:test"; import { fileURLToPath } from "node:url"; -import * as ejs from "ejs"; +import ejs from "ejs"; const menu = join(dirname(fileURLToPath(import.meta.url)), "..", "..", "views", "partials", "menu.ejs"); const render = (data: Record = {}): Promise => ejs.renderFile(menu, data); diff --git a/src/ui/nav-tree.test.ts b/src/ui/nav-tree.test.ts index fbc1a0e..dc08984 100644 --- a/src/ui/nav-tree.test.ts +++ b/src/ui/nav-tree.test.ts @@ -2,7 +2,7 @@ import assert from "node:assert/strict"; import { dirname, join } from "node:path"; import { test } from "node:test"; import { fileURLToPath } from "node:url"; -import * as ejs from "ejs"; +import ejs from "ejs"; const navTree = join(dirname(fileURLToPath(import.meta.url)), "..", "..", "views", "partials", "nav-tree.ejs"); const render = (data: Record = {}): Promise => ejs.renderFile(navTree, data); diff --git a/src/ui/pagination.test.ts b/src/ui/pagination.test.ts index 5f2d209..8ec234d 100644 --- a/src/ui/pagination.test.ts +++ b/src/ui/pagination.test.ts @@ -2,7 +2,7 @@ import assert from "node:assert/strict"; import { dirname, join } from "node:path"; import { test } from "node:test"; import { fileURLToPath } from "node:url"; -import * as ejs from "ejs"; +import ejs from "ejs"; const pagination = join(dirname(fileURLToPath(import.meta.url)), "..", "..", "views", "partials", "pagination.ejs"); const render = (data: Record = {}): Promise => ejs.renderFile(pagination, data); diff --git a/src/ui/shell.test.ts b/src/ui/shell.test.ts index ca2a807..45598b8 100644 --- a/src/ui/shell.test.ts +++ b/src/ui/shell.test.ts @@ -2,7 +2,7 @@ import assert from "node:assert/strict"; import { dirname, join } from "node:path"; import { test } from "node:test"; import { fileURLToPath } from "node:url"; -import * as ejs from "ejs"; +import ejs from "ejs"; const shell = join(dirname(fileURLToPath(import.meta.url)), "..", "..", "views", "partials", "shell.ejs"); const render = (data: Record = {}): Promise => ejs.renderFile(shell, data); diff --git a/src/ui/theme-switch.test.ts b/src/ui/theme-switch.test.ts index d1d25ec..155981e 100644 --- a/src/ui/theme-switch.test.ts +++ b/src/ui/theme-switch.test.ts @@ -2,7 +2,7 @@ import assert from "node:assert/strict"; import { dirname, join } from "node:path"; import { test } from "node:test"; import { fileURLToPath } from "node:url"; -import * as ejs from "ejs"; +import ejs from "ejs"; const themeSwitch = join(dirname(fileURLToPath(import.meta.url)), "..", "..", "views", "partials", "theme-switch.ejs"); const render = (data: Record = {}): Promise => ejs.renderFile(themeSwitch, data);