Skip to content

Commit

Permalink
chore: updated to the latest jsxte version
Browse files Browse the repository at this point in the history
  • Loading branch information
ncpa0cpl committed Jan 28, 2024
1 parent 5e234d2 commit b1ee5cc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 1 addition & 7 deletions scripts/tmpl-builder.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -79,19 +78,14 @@ 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");

const baseDir = path.dirname(htmlOutFile);

// 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 }) => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/code-sample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export async function CodeSample(props: JSXTE.PropsWithChildren<{}>, componentAp
<div class="flexbox column code-sample">
<h3 class={Typography.text}>Example:</h3>
<div is="code-sample">
{`<pre><code class="html language-html frame">${sanitized}</code></pre>`}
<pre>{`<code class="html language-html frame">${sanitized}</code>`}</pre>
</div>
</div>
<div class="flexbox column code-sample-result">
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit b1ee5cc

Please sign in to comment.