From d2d0499843aaf0904a8113d9c4f7d7de5a3fb285 Mon Sep 17 00:00:00 2001 From: Ethan Davidson <31261035+EthanThatOneKid@users.noreply.github.com> Date: Tue, 5 Nov 2024 18:35:21 -0800 Subject: [PATCH] semver 0.0.9: update module exports --- cli/codegen.ts | 22 ++++++++++++++-------- deno.json | 8 ++++---- lib/global_attributes.ts | 5 +++++ 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/cli/codegen.ts b/cli/codegen.ts index 0d513bc..d5d358d 100644 --- a/cli/codegen.ts +++ b/cli/codegen.ts @@ -54,6 +54,15 @@ export const voidElements = [ */ const voidElementSet = new Set(voidElements); +/** + * generatedFilePreludeString is the comment at the top of generated files. + */ +const generatedFilePreludeString = `/** +* @fileoverview +* +* This file was generated. Do not modify this file directly. +*/`; + /** * isVoid returns true if the given tag is a void element. */ @@ -71,6 +80,7 @@ if (import.meta.main) { undefined, { overwrite: true }, ); + globalAttrsFile.addStatements(generatedFilePreludeString); const globalAttrsInterface = globalAttrsFile.addInterface({ isExported: true, name: "GlobalAttributes", @@ -149,9 +159,9 @@ if (import.meta.main) { // Update the deno.json exports. const denoConfig = JSON.parse(await Deno.readTextFile("./deno.json")); denoConfig.exports = { - "./cli/codegen.ts": "./cli/codegen.ts", - "./lib/global_attributes.ts": "./lib/global_attributes.ts", - "./lib/render.ts": "./lib/render.ts", + "./cli/codegen": "./cli/codegen.ts", + "./lib/global-attributes": "./lib/global_attributes.ts", + "./lib/render": "./lib/render.ts", ".": "./mod.ts", ...Object.fromEntries(descriptors.map((descriptor) => [ `./${descriptor.tag}`, @@ -184,11 +194,7 @@ export function addElementFile( ); // Add file prelude. - sourceFile.addStatements(`/** -* @fileoverview -* -* This file was generated. Do not modify this file directly. -*/`); + sourceFile.addStatements(generatedFilePreludeString); // Add the type imports. sourceFile.addImportDeclaration({ diff --git a/deno.json b/deno.json index 4710ac8..c73dce9 100644 --- a/deno.json +++ b/deno.json @@ -1,7 +1,7 @@ { "lock": false, "name": "@fartlabs/ht", - "version": "0.0.8", + "version": "0.0.9", "imports": { "@mdn/browser-compat-data": "npm:@mdn/browser-compat-data@^5.5.19", "@std/text": "jsr:@std/text@^1.0.8", @@ -12,9 +12,9 @@ "molt": "deno run -A jsr:@molt/cli -w" }, "exports": { - "./cli/codegen.ts": "./cli/codegen.ts", - "./lib/global_attributes.ts": "./lib/global_attributes.ts", - "./lib/render.ts": "./lib/render.ts", + "./cli/codegen": "./cli/codegen.ts", + "./lib/global-attributes": "./lib/global_attributes.ts", + "./lib/render": "./lib/render.ts", ".": "./mod.ts", "./a": "./a.ts", "./abbr": "./abbr.ts", diff --git a/lib/global_attributes.ts b/lib/global_attributes.ts index f493aae..4a1db39 100644 --- a/lib/global_attributes.ts +++ b/lib/global_attributes.ts @@ -1,3 +1,8 @@ +/** + * @fileoverview + * + * This file was generated. Do not modify this file directly. + */ /** * GlobalAttributes are the global attributes for HTML elements. * @see