From b1ee5ccd8513ab218a833ecb359131e3529dc70f Mon Sep 17 00:00:00 2001 From: ncpa0cpl Date: Sun, 28 Jan 2024 13:33:35 +0100 Subject: [PATCH] chore: updated to the latest jsxte version --- package.json | 2 +- scripts/tmpl-builder.cjs | 8 +------- src/components/code-sample.tsx | 2 +- yarn.lock | 8 ++++---- 4 files changed, 7 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 9a98f30..9debe98 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "dprint": "^0.42.5", "esbuild": "^0.19.5", "htmx.org": "^1.9.7", - "jsxte": "^3.1.10-canary-99ea1f5a68f7eb363806037de4af6c5d92ba600b.0", + "jsxte": "3.2.0", "node-os-walk": "^1.0.2", "prettier": "^3.0.3", "prettier-plugin-jsdoc": "^1.1.1", diff --git a/scripts/tmpl-builder.cjs b/scripts/tmpl-builder.cjs index ec79eb6..1044726 100644 --- a/scripts/tmpl-builder.cjs +++ b/scripts/tmpl-builder.cjs @@ -7,7 +7,6 @@ const { evalModule } = require("./eval-module.cjs"); const { changeExt } = require("./change-ext.cjs"); const { ExtFilesCtx } = require("./external-files-context.cjs"); const crypto = require("crypto"); -const prettier = require("prettier"); function createHash(data, len) { return crypto.createHash("shake256", { outputLength: len }).update(data).digest("hex"); @@ -79,11 +78,6 @@ module.exports.buildTemplate = async function buildTemplate(template, outDir) { jsx(ExtFilesCtx.Provider, { value: { register: registerExternalFile } }, jsx(Component, {})), ); - const prettifiedHtml = await prettier.format(html, { - parser: "html", - embeddedLanguageFormatting: "off", - }); - const htmlRel = path.relative(templatesSrc, tsxFilename); const htmlOutFile = changeExt(path.join(outDir, htmlRel), "html"); @@ -91,7 +85,7 @@ module.exports.buildTemplate = async function buildTemplate(template, outDir) { // make sure directory exists await fs.promises.mkdir(baseDir, { recursive: true }); - await fs.promises.writeFile(htmlOutFile, prettifiedHtml, "utf8"); + await fs.promises.writeFile(htmlOutFile, html, "utf8"); await Promise.all( registeredExtFiles.map(({ contents, outFile }) => { diff --git a/src/components/code-sample.tsx b/src/components/code-sample.tsx index e64d5eb..b9d41d7 100644 --- a/src/components/code-sample.tsx +++ b/src/components/code-sample.tsx @@ -35,7 +35,7 @@ export async function CodeSample(props: JSXTE.PropsWithChildren<{}>, componentAp

Example:

- {`
${sanitized}
`} +
{`${sanitized}`}
diff --git a/yarn.lock b/yarn.lock index d5347f1..60e42d8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -537,10 +537,10 @@ jsxte-wc@^1.1.5: resolved "https://registry.yarnpkg.com/jsxte-wc/-/jsxte-wc-1.1.5.tgz#799b71a6297d31d92c90dbad826fd5bdfebfc6ff" integrity sha512-YawsSCI2zvGQJH5zaoVo9F9zeAEug+7yabVJBkKvAA+ngvTvdLUm/Bgg7oPbz9ZIY1jqjGTn6+kL7igzHXdlaQ== -jsxte@^3.1.10-canary-99ea1f5a68f7eb363806037de4af6c5d92ba600b.0: - version "3.1.10-canary-99ea1f5a68f7eb363806037de4af6c5d92ba600b.0" - resolved "https://registry.yarnpkg.com/jsxte/-/jsxte-3.1.10-canary-99ea1f5a68f7eb363806037de4af6c5d92ba600b.0.tgz#a19266485e6ba5a53f7e494c8529537e952c126c" - integrity sha512-iujg5M8ECjQAIr8S4jOgYoTX2zfwChnEIW9lArdjzsT8LYbUTevyc/UTNo9tTu5/VTMZUERj1XrN7cce5S4bYw== +jsxte@3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/jsxte/-/jsxte-3.2.0.tgz#9722fa3b15efea9a87351af2977889f6a85d1770" + integrity sha512-mh0HjcFfLBwfvYj3UwvpStvKT7Icq71sNHZlk8+mT0dunnuk6aPNZ/iHe/BtuWDEQp7XID1NpmeXxLn6YEMiSw== jsxte@^3.1.6: version "3.1.6"