skullmaster 0.2.0-next.4 → 0.2.0-next.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.mjs CHANGED
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { cac } from "cac";
3
+ import { cancel, confirm, isCancel, select, text } from "@clack/prompts";
3
4
  import { serve } from "@hono/node-server";
4
5
  import { Hono } from "hono";
5
6
  import { cors } from "hono/cors";
@@ -10,9 +11,8 @@ import { JSDOM } from "jsdom";
10
11
  import pkg from "@babel/generator";
11
12
  import * as t from "@babel/types";
12
13
  import { jsxText } from "@babel/types";
13
- import { cancel, isCancel, select, text } from "@clack/prompts";
14
14
  import { readFile as readFile$1, writeFile as writeFile$1 } from "fs/promises";
15
- import { mkdirSync, writeFileSync } from "node:fs";
15
+ import { mkdirSync, readdirSync, rmSync, writeFileSync } from "node:fs";
16
16
  //#region src/shared/constants.ts
17
17
  const DEFAULT_PORT = 8008;
18
18
  //#endregion
@@ -376,7 +376,7 @@ const skipNode = {
376
376
  const DATA_NAT_H = "data-natural-h";
377
377
  const DATA_NAT_W = "data-natural-w";
378
378
  const DATA_IMAGE_SKELETON = "data-image-skeleton";
379
- function createSkeletonSrc(width, height, color = "#e5e7eb") {
379
+ function createSkeletonSrc(width, height, color = "#808080") {
380
380
  const w = Number(width) || 400;
381
381
  const h = Number(height) || 300;
382
382
  return `data:image/svg+xml,${encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" width="${w}" height="${h}" viewBox="0 0 ${w} ${h}" preserveAspectRatio="none"><rect width="100%" height="100%" fill="${color}"/></svg>`)}`;
@@ -604,7 +604,10 @@ async function serveCommand(config, port) {
604
604
  }));
605
605
  const db = await SkeletonCacheDB.create(config);
606
606
  app.get("/health", (c) => {
607
- return c.json({ ok: true });
607
+ return c.json({
608
+ ok: true,
609
+ config: config.configJson()
610
+ });
608
611
  });
609
612
  app.post("/skeletons", async (c) => {
610
613
  const body = await c.req.json();
@@ -712,11 +715,43 @@ function ensureLazyImport(sourceFile) {
712
715
  async function generateInitialRegistry(outDir, projectType) {
713
716
  const isTs = projectType.endsWith("ts");
714
717
  const ext = isTs ? "tsx" : "jsx";
715
- const skeletonPropsType = isTs ? `
716
- import "@skullmaster/react/style.css"
718
+ const skullTypes = isTs ? `
719
+ export type SkullTweaks = {
720
+ /** Exclude this element and its entire subtree from skeleton generation. */
721
+ hideSubTree?: boolean;
722
+ /** Render this element as transparent (layout preserved) in the skeleton. */
723
+ isTransparent?: boolean;
724
+ };
725
+
726
+ export type WithDataSkull = HTMLAttributes<HTMLElement> & {
727
+ "data-skullmaster": string;
728
+ "data-skip-skull"?: boolean;
729
+ "data-depth"?: "-1";
730
+ };
731
+ ` : "";
732
+ const skullUtils = `
733
+ const buildSkullAttributes = ({ hideSubTree, isTransparent }${isTs ? ": SkullTweaks" : ""})${isTs ? ": Omit<WithDataSkull, \"data-skullmaster\">" : ""} => {
734
+ return {
735
+ "data-skip-skull": hideSubTree,
736
+ "data-depth": isTransparent ? "-1" : undefined,
737
+ };
738
+ };
717
739
 
740
+ export const markAsSkull = (name: string, tweaks${isTs ? ": SkullTweaks" : ""} = {})${isTs ? ": WithDataSkull" : ""} => {
741
+ return {
742
+ "data-skullmaster": name,
743
+ ...buildSkullAttributes(tweaks),
744
+ };
745
+ };
746
+
747
+ export const tweakForSkull = (tweaks${isTs ? ": SkullTweaks" : ""} = {})${isTs ? ": Omit<WithDataSkull, \"data-skullmaster\">" : ""} => {
748
+ return buildSkullAttributes(tweaks);
749
+ };
750
+ `;
751
+ const skeletonPropsType = isTs ? `
718
752
  type SkeletonProps = {
719
- name: string;
753
+ name: keyof typeof registry | (string & {});
754
+ defaultBoneProps?: ComponentProps<typeof DefaultBone>;
720
755
  };
721
756
  ` : "";
722
757
  await writeFile(`${outDir}/registry.${ext}`, `
@@ -725,30 +760,29 @@ type SkeletonProps = {
725
760
  /* biome-ignore-all lint */
726
761
  /* @ts-nocheck */
727
762
 
728
- /**
763
+ /**
729
764
  * Auto-generated by Skullmaster.
730
765
  *
731
766
  * Do not edit this file manually.
732
767
  * Use Skullmaster commands to add, update, or remove skeletons.
733
768
  *
734
- * To remove unused skeletons:
735
- * pnpm skeleton prune
736
769
  */
737
770
 
738
-
771
+ import "@skullmaster/react/style.css";
739
772
  import DefaultBone from "./skeletons/DefaultBone";
773
+ ${isTs ? "import { type ComponentProps, type HTMLAttributes, lazy } from \"react\";" : ""}
740
774
 
741
- const registry${isTs ? ": Record<string, any>" : ""} = {};
742
-
743
- ${skeletonPropsType}
775
+ const registry = {default: lazy(() => import("./skeletons/DefaultBone"))}${isTs ? " as const" : ""};
744
776
 
777
+ ${skullTypes}${skeletonPropsType}${skullUtils}
745
778
  export default function Skeleton({
746
779
  name,
780
+ defaultBoneProps = {},
747
781
  }${isTs ? ": SkeletonProps" : ""}) {
748
782
  const Component = registry[name];
749
783
 
750
784
  if (!Component) {
751
- return <DefaultBone />;
785
+ return <DefaultBone {...defaultBoneProps} />;
752
786
  }
753
787
 
754
788
  return <Component />;
@@ -756,12 +790,10 @@ export default function Skeleton({
756
790
  `, "utf8");
757
791
  }
758
792
  async function generateRegistry(operation, isTs, registryPath) {
759
- let project;
760
- if (isTs) project = new Project({ tsConfigFilePath: "tsconfig.json" });
761
- else project = new Project();
793
+ const project = isTs ? new Project({ tsConfigFilePath: "tsconfig.json" }) : new Project();
762
794
  const sourceFile = project.addSourceFileAtPath(registryPath);
763
795
  ensureLazyImport(sourceFile);
764
- const registry = sourceFile.getVariableDeclaration("registry")?.getInitializerIfKind(SyntaxKind.ObjectLiteralExpression);
796
+ const registry = sourceFile.getVariableDeclaration("registry")?.getInitializerIfKind(SyntaxKind.AsExpression)?.getExpressionIfKind(SyntaxKind.ObjectLiteralExpression) ?? sourceFile.getVariableDeclaration("registry")?.getInitializerIfKind(SyntaxKind.ObjectLiteralExpression);
765
797
  if (!registry) throw new Error("Unable to locate registry object, have you ran skullmaster init??");
766
798
  const existingComponents = new Set(registry.getProperties().filter((property) => property.getKind() === SyntaxKind.PropertyAssignment).map((property) => property.asKindOrThrow(SyntaxKind.PropertyAssignment)).map((property) => property.getName().replace(/['"]/g, "")));
767
799
  for (let component of operation.components) {
@@ -772,6 +804,11 @@ async function generateRegistry(operation, isTs, registryPath) {
772
804
  initializer: `lazy(() => import("./skeletons/${component}"))`
773
805
  });
774
806
  }
807
+ if (isTs) {
808
+ const declaration = sourceFile.getVariableDeclarationOrThrow("registry");
809
+ const initializer = declaration.getInitializer();
810
+ if (initializer && !initializer.isKind(SyntaxKind.AsExpression)) declaration.setInitializer(`${initializer.getText()} as const`);
811
+ }
775
812
  sourceFile.formatText();
776
813
  await sourceFile.save();
777
814
  project.saveSync();
@@ -802,11 +839,14 @@ async function updateCacheRegistry(operation, outDir) {
802
839
  //#endregion
803
840
  //#region src/init/default-bone.ts
804
841
  async function defaultBone(target) {
805
- await writeFile(target, `/* eslint-disable */
842
+ await writeFile(target, `
843
+ /* eslint-disable */
806
844
  /* oxlint-disable */
807
845
  /* biome-ignore-all lint */
808
846
  /* @ts-nocheck */
809
847
 
848
+ import type { HTMLProps } from "react";
849
+
810
850
  /**
811
851
  * Auto-generated by Skullmaster.
812
852
  *
@@ -816,8 +856,10 @@ async function defaultBone(target) {
816
856
  * You may freely customize or replace this component to match the
817
857
  * loading experience of your application.
818
858
  */
819
- export default function DefaultBone() {
820
- return <div>loading...</div>;
859
+ type DefaultBoneProps = HTMLProps<HTMLDivElement>;
860
+
861
+ export default function DefaultBone(props: DefaultBoneProps) {
862
+ return <div {...props}>loading...</div>;
821
863
  }
822
864
  `, "utf8");
823
865
  }
@@ -830,7 +872,7 @@ var Config = class {
830
872
  this.outDir = outDir;
831
873
  this.projectType = projectType;
832
874
  }
833
- async initialize() {
875
+ async initialize(forceReset) {
834
876
  log.info("Initializing project structure...");
835
877
  if (!await fileExists(this.outDir)) {
836
878
  mkdirSync(this.outDir, { recursive: true });
@@ -840,19 +882,22 @@ var Config = class {
840
882
  if (!await fileExists(skeletonsDirectoryPath)) {
841
883
  mkdirSync(skeletonsDirectoryPath, { recursive: true });
842
884
  log.success(`Created skeletons directory: ${skeletonsDirectoryPath}`);
885
+ } else if (forceReset) {
886
+ for (const file of readdirSync(skeletonsDirectoryPath)) rmSync(`${skeletonsDirectoryPath}/${file}`, { recursive: true });
887
+ log.success(`Cleared skeletons directory: ${skeletonsDirectoryPath}`);
843
888
  } else log.gray(`Skeletons directory exists: ${skeletonsDirectoryPath}`);
844
889
  const registryFilePath = this.getRegistryPath();
845
- if (!await fileExists(registryFilePath)) {
890
+ if (forceReset || !await fileExists(registryFilePath)) {
846
891
  await generateInitialRegistry(this.outDir, this.projectType);
847
892
  log.success(`Created registry: ${registryFilePath}`);
848
893
  } else log.gray(`Registry exists: ${registryFilePath}`);
849
894
  const cachePath = this.getCachePath();
850
- if (!await fileExists(cachePath)) {
895
+ if (forceReset || !await fileExists(cachePath)) {
851
896
  writeFileSync(cachePath, JSON.stringify({}), "utf8");
852
897
  log.success(`Created cache: ${cachePath}`);
853
898
  } else log.gray(`Cache exists: ${cachePath}`);
854
899
  const defaultBonePath = this.getDefSkeletonPath();
855
- if (!await fileExists(defaultBonePath)) {
900
+ if (forceReset || !await fileExists(defaultBonePath)) {
856
901
  await defaultBone(defaultBonePath);
857
902
  log.success(`Created default bone: ${defaultBonePath}`);
858
903
  } else log.gray(`Default bone exists: ${defaultBonePath}`);
@@ -879,6 +924,12 @@ var Config = class {
879
924
  getRegistryPath() {
880
925
  return `${this.outDir}/registry.${this.getExt()}`;
881
926
  }
927
+ configJson() {
928
+ return {
929
+ projectType: this.projectType,
930
+ outDir: this.outDir
931
+ };
932
+ }
882
933
  };
883
934
  //#endregion
884
935
  //#region src/cli.ts
@@ -889,6 +940,16 @@ cli.command("serve", "Start 💀 dev server").option("--port <port>", "Port", {
889
940
  await config.initialize();
890
941
  await serveCommand(config, Number(options.port));
891
942
  });
943
+ cli.command("reset", "Reset Skullmaster to its initial state").action(async () => {
944
+ const proceed = await confirm({ message: "This will wipe out all present generated skeletons and reset the registry. Are you sure?" });
945
+ if (isCancel(proceed) || !proceed) {
946
+ cancel("Reset cancelled.");
947
+ process.exit(0);
948
+ }
949
+ const preferences = await collectPreferences();
950
+ await new Config(preferences.outDir, preferences.project).initialize(true);
951
+ log.success("Reset complete");
952
+ });
892
953
  cli.help();
893
954
  cli.parse();
894
955
  //#endregion
package/dist/cli.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.mjs","names":["htmlNodeToJsx","readFile","writeFile"],"sources":["../src/shared/constants.ts","../src/shared/schema.ts","../src/shared/log.ts","../src/cache/index.ts","../src/generate-target/index.ts","../../excarnate/dist/index.mjs","../src/transform/index.ts","../src/utils/to-pascal-case.ts","../src/utils/fnv1a.ts","../src/commands/serve.ts","../src/init/is-file-exists.ts","../src/constants.ts","../src/init/collect-preferences.ts","../src/init/ensure-lazy-imports.ts","../src/init/registry.ts","../src/init/cache-registry.ts","../src/init/default-bone.ts","../src/init/preferences.ts","../src/cli.ts"],"sourcesContent":["export const DEFAULT_PORT = 8008;\nexport const EMPTY_SET_DEFAULT_DIR = \"skullmaster\";\nexport const DATA_NAT_H = \"data-natural-h\";\nexport const DATA_NAT_W = \"data-natural-w\";\n","import z from \"zod\";\n\nexport const SkeletonPayloadInputSchema = z.record(\n z.string(),\n z.object({\n component: z.string(),\n html: z.string(),\n }),\n);\n\nexport const SkeletonCacheEntrySchema = z.record(\n z.string(),\n z.object({\n component: z.string(),\n html: z.string(),\n hash: z.string(),\n }),\n);\n\nexport type SkeletonPayloadInput = z.infer<typeof SkeletonPayloadInputSchema>;\n\nexport type SkeletonCacheEntry = z.infer<typeof SkeletonCacheEntrySchema>;\n","export const log = {\n success: (message: string) => console.log(`\\x1b[32m[💀] ${message}\\x1b[0m`),\n info: (message: string) => console.log(`\\x1b[36m[💀] ${message}\\x1b[0m`),\n warn: (message: string) => console.log(`\\x1b[33m[💀] ${message}\\x1b[0m`),\n error: (message: string) => console.log(`\\x1b[31m[💀] ${message}\\x1b[0m`),\n gray: (message: string) => console.log(`\\x1b[90m[💀] ${message}\\x1b[0m`),\n};\n","import { readFile } from \"node:fs/promises\";\nimport type { Config } from \"../init/preferences\";\nimport { type SkeletonCacheEntry, SkeletonCacheEntrySchema } from \"../shared\";\n\nexport class SkeletonCacheDB {\n private data: SkeletonCacheEntry = {};\n config: Config;\n private constructor(config: Config) {\n this.config = config;\n }\n\n static async create(config: Config) {\n const db = new SkeletonCacheDB(config);\n\n await db.load();\n\n return db;\n }\n\n private async load() {\n try {\n const file = await readFile(this.config.getCachePath(), \"utf8\");\n\n const parsed = JSON.parse(file);\n\n this.data = SkeletonCacheEntrySchema.parse(parsed);\n } catch {\n this.data = {};\n\n await this.config.cache({ type: \"replace\", cacheEntry: {} });\n }\n }\n\n get(key: string) {\n return this.data[key];\n }\n getComponentNames(): string[] {\n return Object.values(this.data).map((entry) => entry.component);\n }\n\n async set(key: string, value: SkeletonCacheEntry[string]) {\n this.data[key] = value;\n this.config.cache({ type: \"update\", componentName: key, payload: value });\n }\n}\n","import { Project, QuoteKind, ScriptKind } from \"ts-morph\";\n\ntype GenerateTargetOptions = {\n project: Project;\n filePath: string;\n componentName: string;\n body: string;\n};\n\nexport default function generateTarget({\n project,\n filePath,\n componentName,\n body,\n}: GenerateTargetOptions) {\n project.manipulationSettings.set({\n quoteKind: QuoteKind.Double,\n });\n\n const file = project.createSourceFile(filePath, \"\", {\n overwrite: true,\n scriptKind: ScriptKind.TSX,\n });\n\n file.insertText(\n 0,\n `/* eslint-disable */\n/* prettier-ignore-start */\n\n/**\n * Auto-generated by Skullmaster.\n *\n * DO NOT EDIT THIS FILE MANUALLY.\n * Changes may be overwritten on the next generation.\n */\n\n`,\n );\n\n file.addFunction({\n name: componentName,\n isDefaultExport: true,\n statements: [`return (${body});`],\n });\n\n file.addStatements(`\n/* prettier-ignore-end */\n`);\n}\n","import * as t from \"@babel/types\";\nimport { jsxText } from \"@babel/types\";\n//#region src/executor.ts\nfunction buildExecutor(rules) {\n\treturn (ctx) => {\n\t\tlet current = ctx;\n\t\tfor (const rule of rules) {\n\t\t\tif (!rule.match(current)) continue;\n\t\t\tcurrent = rule.transform(current);\n\t\t\tif (rule.skipAllRest) break;\n\t\t}\n\t\treturn current;\n\t};\n}\n//#endregion\n//#region src/helpers/sanitize-attr-value.ts\nfunction sanitizeAttrValue(value) {\n\treturn value.replace(/\"/g, \"'\").replace(/\\\\/g, \"/\");\n}\n//#endregion\n//#region src/helpers/jsx.ts\nfunction createJsxStringAttribute(name, value) {\n\treturn t.jsxAttribute(t.jsxIdentifier(name), t.stringLiteral(sanitizeAttrValue(value)));\n}\nfunction createJsxExpressionAttribute(name, expression) {\n\treturn t.jsxAttribute(t.jsxIdentifier(name), t.jsxExpressionContainer(expression));\n}\nfunction findJsxAttribute(attributes, name) {\n\treturn attributes.find((attr) => t.isJSXAttribute(attr) && t.isJSXIdentifier(attr.name) && attr.name.name === name);\n}\nfunction findStringJsxAttribute(attributes, name) {\n\tconst attr = findJsxAttribute(attributes, name);\n\tif (!attr?.value || !t.isStringLiteral(attr.value)) return;\n\treturn attr;\n}\nfunction createJsxElement(tagName, children, attributes = []) {\n\treturn t.jsxElement(t.jsxOpeningElement(t.jsxIdentifier(tagName), attributes, false), t.jsxClosingElement(t.jsxIdentifier(tagName)), children, false);\n}\n//#endregion\n//#region src/constants.ts\nconst DEPTH_ATTRIBUTE = \"data-depth\";\nconst TEXT_CLASSNAME = \"empty-set__text\";\nconst SKELETON_CLASSNAME = \"empty-set__skeleton\";\n//#endregion\n//#region src/exceptions/target-mismatch.ts\nvar TargetElementMismatchError = class extends Error {\n\tconstructor(expected, actual) {\n\t\tsuper(`Expected target element to be ${expected}, but got ${actual}`);\n\t\tthis.name = \"TargetElementMismatchError\";\n\t}\n};\n//#endregion\n//#region src/helpers/attribute-replace-map.ts\nconst ATTRIBUTE_MAP = {\n\tclass: \"className\",\n\tfor: \"htmlFor\",\n\ttabindex: \"tabIndex\",\n\treadonly: \"readOnly\",\n\tmaxlength: \"maxLength\",\n\tminlength: \"minLength\",\n\tcolspan: \"colSpan\",\n\trowspan: \"rowSpan\",\n\tcontenteditable: \"contentEditable\",\n\tautocapitalize: \"autoCapitalize\",\n\tautocomplete: \"autoComplete\",\n\tautofocus: \"autoFocus\",\n\tspellcheck: \"spellCheck\",\n\tcrossorigin: \"crossOrigin\",\n\treferrerpolicy: \"referrerPolicy\",\n\tstrokewidth: \"strokeWidth\",\n\t\"stroke-width\": \"strokeWidth\",\n\tstrokelinecap: \"strokeLinecap\",\n\t\"stroke-linecap\": \"strokeLinecap\",\n\tstrokelinejoin: \"strokeLinejoin\",\n\t\"stroke-linejoin\": \"strokeLinejoin\",\n\tstrokemiterlimit: \"strokeMiterlimit\",\n\t\"stroke-miterlimit\": \"strokeMiterlimit\",\n\tstrokedasharray: \"strokeDasharray\",\n\t\"stroke-dasharray\": \"strokeDasharray\",\n\tstrokedashoffset: \"strokeDashoffset\",\n\t\"stroke-dashoffset\": \"strokeDashoffset\",\n\tstrokeopacity: \"strokeOpacity\",\n\t\"stroke-opacity\": \"strokeOpacity\",\n\tfillopacity: \"fillOpacity\",\n\t\"fill-opacity\": \"fillOpacity\",\n\tfillrule: \"fillRule\",\n\t\"fill-rule\": \"fillRule\",\n\tcliprule: \"clipRule\",\n\t\"clip-rule\": \"clipRule\",\n\tclippath: \"clipPath\",\n\t\"clip-path\": \"clipPath\",\n\tstopcolor: \"stopColor\",\n\t\"stop-color\": \"stopColor\",\n\tstopopacity: \"stopOpacity\",\n\t\"stop-opacity\": \"stopOpacity\",\n\tviewbox: \"viewBox\",\n\txlinkhref: \"xlinkHref\",\n\t\"xlink:href\": \"xlinkHref\",\n\txmlspace: \"xmlSpace\",\n\t\"xml:space\": \"xmlSpace\"\n};\n//#endregion\n//#region src/helpers/attr-normalize.ts\nfunction normalizeAttributeName(name) {\n\tconst lower = name.toLowerCase();\n\tif (ATTRIBUTE_MAP[lower]) return ATTRIBUTE_MAP[lower];\n\tif (lower.startsWith(\"data-\") || lower.startsWith(\"aria-\")) return lower;\n\treturn name.replace(/-([a-z])/g, (_, char) => char.toUpperCase());\n}\n//#endregion\n//#region src/helpers/is-style.ts\nconst STYLE_ATTRIBUTES = /* @__PURE__ */ new Set([\n\t\"class\",\n\t\"style\",\n\t\"type\",\n\t\"fill\",\n\t\"fill-opacity\",\n\t\"fill-rule\",\n\t\"src\",\n\t\"stroke\",\n\t\"stroke-width\",\n\t\"stroke-opacity\",\n\t\"stroke-linecap\",\n\t\"stroke-linejoin\",\n\t\"stroke-dasharray\",\n\t\"stroke-dashoffset\",\n\t\"opacity\",\n\t\"role\",\n\t\"width\",\n\t\"height\",\n\t\"x\",\n\t\"y\",\n\t\"cx\",\n\t\"cy\",\n\t\"r\",\n\t\"rx\",\n\t\"ry\",\n\t\"viewbox\",\n\t\"transform\",\n\t\"d\",\n\t\"points\"\n]);\nfunction shouldKeepAttribute(name) {\n\tconst lowerName = name.toLowerCase();\n\treturn lowerName.startsWith(\"data-\") || lowerName.startsWith(\"aria-\") || STYLE_ATTRIBUTES.has(lowerName);\n}\n//#endregion\n//#region src/helpers/parse-style.ts\nfunction parseStyle(style) {\n\tconst properties = [];\n\tfor (const rule of style.split(\";\")) {\n\t\tconst trimmedRule = rule.trim();\n\t\tif (!trimmedRule) continue;\n\t\tconst colonIndex = trimmedRule.indexOf(\":\");\n\t\tif (colonIndex === -1) continue;\n\t\tconst rawKey = trimmedRule.slice(0, colonIndex).trim();\n\t\tconst rawValue = trimmedRule.slice(colonIndex + 1).trim();\n\t\tconst key = rawKey.replace(/-([a-z])/g, (_, char) => char.toUpperCase());\n\t\tconst keyNode = key.startsWith(\"--\") || key.includes(\"-\") ? t.stringLiteral(key) : t.identifier(key);\n\t\tproperties.push(t.objectProperty(keyNode, t.stringLiteral(rawValue)));\n\t}\n\treturn t.objectExpression(properties);\n}\n//#endregion\n//#region src/rules/populate-attrs.ts\nconst populateAttrs = {\n\tid: \"populate-attrs\",\n\tmatch: (ctx) => ctx.element.nodeType === 1,\n\ttransform: (ctx) => {\n\t\tconst element = ctx.element;\n\t\tconst attributes = [];\n\t\tconst tagName = element.tagName.toLowerCase();\n\t\tif (ctx.target?.element && ctx.target?.element !== tagName) throw new TargetElementMismatchError(tagName, ctx.target.element);\n\t\tif (!element.hasAttribute(\"data-depth\")) attributes.push(createJsxStringAttribute(DEPTH_ATTRIBUTE, String(ctx.depth % 4)));\n\t\tfor (const attr of element.attributes) {\n\t\t\tif (!shouldKeepAttribute(attr.name)) continue;\n\t\t\tconst name = normalizeAttributeName(attr.name);\n\t\t\tconst value = attr.value;\n\t\t\tif (name === \"style\") {\n\t\t\t\tattributes.push(createJsxExpressionAttribute(\"style\", parseStyle(value)));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tattributes.push(createJsxStringAttribute(name, value));\n\t\t}\n\t\treturn {\n\t\t\t...ctx,\n\t\t\ttarget: {\n\t\t\t\telement: tagName,\n\t\t\t\tattributes\n\t\t\t}\n\t\t};\n\t}\n};\n//#endregion\n//#region src/matchers.ts\nconst atDepth = (depth) => (ctx) => ctx.depth === depth;\nconst isTagNamesIn = (elements) => (ctx) => ctx.element.nodeType === 1 && elements.includes(ctx.element.tagName.toLowerCase());\n//#endregion\n//#region src/rules/process-svg.ts\nconst processSvg = {\n\tid: \"process-svg\",\n\tskipAllRest: true,\n\tmatch: isTagNamesIn([\"svg\"]),\n\ttransform: (ctx) => {\n\t\treturn {\n\t\t\t...ctx,\n\t\t\ttarget: {\n\t\t\t\t...ctx.target,\n\t\t\t\telement: \"svg\",\n\t\t\t\tchildren: []\n\t\t\t}\n\t\t};\n\t}\n};\n//#endregion\n//#region src/rules/remove-node.ts\nconst removeReduntantNode = {\n\tid: \"remove-node\",\n\tskipAllRest: true,\n\tmatch: isTagNamesIn([\n\t\t\"html\",\n\t\t\"script\",\n\t\t\"style\",\n\t\t\"head\",\n\t\t\"meta\",\n\t\t\"link\",\n\t\t\"noscript\",\n\t\t\"template\",\n\t\t\"audio\",\n\t\t\"video\",\n\t\t\"source\",\n\t\t\"track\",\n\t\t\"iframe\",\n\t\t\"embed\",\n\t\t\"object\",\n\t\t\"title\",\n\t\t\"base\",\n\t\t\"defs\",\n\t\t\"symbol\",\n\t\t\"html\",\n\t\t\"canvas\",\n\t\t\"map\",\n\t\t\"area\",\n\t\t\"picture\",\n\t\t\"portal\"\n\t]),\n\ttransform: (ctx) => {\n\t\treturn {\n\t\t\t...ctx,\n\t\t\ttarget: null\n\t\t};\n\t}\n};\n//#endregion\n//#region src/rules/root-skeleton-attrs.ts\nconst addRootSkeletonsAttrs = {\n\tid: \"add-root-skeleton-attrs\",\n\tmatch: (ctx) => ctx.element.nodeType === 1 && atDepth(0)(ctx),\n\ttransform: (ctx) => {\n\t\tconst tagName = ctx.element.tagName.toLowerCase();\n\t\tif (ctx.target?.element && ctx.target.element !== tagName) throw new TargetElementMismatchError(tagName, ctx.target.element);\n\t\tconst existingTarget = ctx.target ?? {\n\t\t\telement: tagName,\n\t\t\tattributes: []\n\t\t};\n\t\tconst existingAttrs = existingTarget.attributes ?? [];\n\t\tconst classNameAttr = findStringJsxAttribute(existingAttrs, \"className\");\n\t\tconst attributes = [...classNameAttr ? existingAttrs.map((attr) => attr === classNameAttr ? {\n\t\t\t...attr,\n\t\t\tvalue: {\n\t\t\t\t...classNameAttr.value,\n\t\t\t\tvalue: `${classNameAttr.value.value} ${SKELETON_CLASSNAME}`\n\t\t\t}\n\t\t} : attr) : [...existingAttrs, createJsxStringAttribute(\"className\", SKELETON_CLASSNAME)]];\n\t\tif (!findJsxAttribute(attributes, \"role\")) attributes.push(createJsxStringAttribute(\"role\", \"status\"));\n\t\tif (!findJsxAttribute(attributes, \"aria-live\")) attributes.push(createJsxStringAttribute(\"aria-live\", \"polite\"));\n\t\tif (!findJsxAttribute(attributes, \"aria-busy\")) attributes.push(createJsxStringAttribute(\"aria-busy\", \"true\"));\n\t\treturn {\n\t\t\t...ctx,\n\t\t\ttarget: {\n\t\t\t\t...existingTarget,\n\t\t\t\telement: tagName,\n\t\t\t\tattributes\n\t\t\t}\n\t\t};\n\t}\n};\n//#endregion\n//#region src/rules/skip-node.ts\nconst skipNode = {\n\tid: \"skip-node\",\n\tskipAllRest: true,\n\tmatch: (ctx) => ctx.element.nodeType === 1 && ctx.element.hasAttribute(\"data-skip-skull\"),\n\ttransform: (ctx) => ({\n\t\t...ctx,\n\t\ttarget: null\n\t})\n};\n//#endregion\n//#region src/rules/transform-img.ts\nconst DATA_NAT_H = \"data-natural-h\";\nconst DATA_NAT_W = \"data-natural-w\";\nconst DATA_IMAGE_SKELETON = \"data-image-skeleton\";\nfunction createSkeletonSrc(width, height, color = \"#e5e7eb\") {\n\tconst w = Number(width) || 400;\n\tconst h = Number(height) || 300;\n\treturn `data:image/svg+xml,${encodeURIComponent(`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"${w}\" height=\"${h}\" viewBox=\"0 0 ${w} ${h}\" preserveAspectRatio=\"none\"><rect width=\"100%\" height=\"100%\" fill=\"${color}\"/></svg>`)}`;\n}\nconst transformImg = {\n\tid: \"transform-img\",\n\tmatch: (ctx) => ctx.element.nodeType === 1 && ctx.element.tagName.toLowerCase() === \"img\",\n\ttransform: (ctx) => {\n\t\tif (!ctx.target) throw new Error(\"Target must be defined before transforming an image element.\");\n\t\tconst attrs = ctx.target.attributes ?? [];\n\t\tconst naturalWidthAttr = findStringJsxAttribute(attrs, DATA_NAT_W);\n\t\tconst naturalHeightAttr = findStringJsxAttribute(attrs, DATA_NAT_H);\n\t\tconst naturalWidth = naturalWidthAttr?.value?.value;\n\t\tconst naturalHeight = naturalHeightAttr?.value?.value;\n\t\tconst placeholderSrc = createSkeletonSrc(naturalWidth, naturalHeight);\n\t\tconst attributes = [\n\t\t\t...attrs.filter((attr) => {\n\t\t\t\tif (!t.isJSXAttribute(attr)) return false;\n\t\t\t\tconst name = t.isJSXIdentifier(attr.name) ? attr.name.name : void 0;\n\t\t\t\treturn ![\n\t\t\t\t\t\"src\",\n\t\t\t\t\t\"srcSet\",\n\t\t\t\t\t\"sizes\",\n\t\t\t\t\t\"loading\",\n\t\t\t\t\t\"decoding\",\n\t\t\t\t\t\"fetchPriority\",\n\t\t\t\t\tDATA_NAT_W,\n\t\t\t\t\tDATA_NAT_H,\n\t\t\t\t\tDATA_IMAGE_SKELETON\n\t\t\t\t].includes(name ?? \"\");\n\t\t\t}),\n\t\t\tcreateJsxStringAttribute(\"src\", placeholderSrc),\n\t\t\tcreateJsxStringAttribute(DATA_IMAGE_SKELETON, \"true\")\n\t\t];\n\t\treturn {\n\t\t\t...ctx,\n\t\t\ttarget: {\n\t\t\t\t...ctx.target,\n\t\t\t\tattributes\n\t\t\t}\n\t\t};\n\t}\n};\n//#endregion\n//#region src/rules/transform-interactive.ts\nconst INTERACTIVE_TAGS = /* @__PURE__ */ new Set([\n\t\"input\",\n\t\"textarea\",\n\t\"select\",\n\t\"option\",\n\t\"optgroup\",\n\t\"button\",\n\t\"label\",\n\t\"fieldset\",\n\t\"legend\",\n\t\"output\",\n\t\"datalist\",\n\t\"a\",\n\t\"details\",\n\t\"summary\",\n\t\"audio\",\n\t\"video\",\n\t\"iframe\",\n\t\"embed\",\n\t\"object\",\n\t\"dialog\"\n]);\nconst INTERACTIVE_ROLES = /* @__PURE__ */ new Set([\n\t\"button\",\n\t\"link\",\n\t\"tab\",\n\t\"menuitem\",\n\t\"checkbox\",\n\t\"radio\",\n\t\"switch\",\n\t\"option\",\n\t\"combobox\",\n\t\"textbox\",\n\t\"searchbox\",\n\t\"slider\",\n\t\"spinbutton\",\n\t\"listbox\",\n\t\"treeitem\",\n\t\"gridcell\",\n\t\"rowheader\",\n\t\"columnheader\"\n]);\nconst ARIA_ATTRIBUTES_TO_REMOVE = /* @__PURE__ */ new Set([\n\t\"role\",\n\t\"aria-label\",\n\t\"aria-labelledby\",\n\t\"aria-describedby\",\n\t\"aria-controls\",\n\t\"aria-expanded\",\n\t\"aria-haspopup\",\n\t\"aria-pressed\",\n\t\"aria-selected\",\n\t\"aria-checked\",\n\t\"aria-current\",\n\t\"contenteditable\",\n\t\"tabindex\",\n\t\"aria-hidden\",\n\t\"data-skeleton-interactive\"\n]);\nconst transformInteractiveElements = {\n\tid: \"transform-interactive-elements\",\n\tmatch: (ctx) => {\n\t\tif (ctx.element.nodeType !== 1) return false;\n\t\tconst element = ctx.element;\n\t\tconst tag = element.tagName.toLowerCase();\n\t\tif (INTERACTIVE_TAGS.has(tag)) return true;\n\t\tconst role = element.getAttribute(\"role\")?.toLowerCase();\n\t\tif (role && INTERACTIVE_ROLES.has(role)) return true;\n\t\tif (element.hasAttribute(\"contenteditable\")) return true;\n\t\tif (element.hasAttribute(\"tabindex\")) return true;\n\t\treturn false;\n\t},\n\ttransform: (ctx) => {\n\t\tif (!ctx.target) return ctx;\n\t\tconst attributes = (ctx.target.attributes ?? []).filter((attribute) => {\n\t\t\tconst name = attribute.type === \"JSXAttribute\" && attribute.name?.name ? String(attribute.name.name).toLowerCase() : \"\";\n\t\t\treturn !ARIA_ATTRIBUTES_TO_REMOVE.has(name);\n\t\t});\n\t\tattributes.push(createJsxStringAttribute(\"data-skeleton-interactive\", \"true\"), createJsxStringAttribute(\"aria-hidden\", \"true\"), createJsxExpressionAttribute(\"tabIndex\", t.numericLiteral(-1)));\n\t\treturn {\n\t\t\t...ctx,\n\t\t\ttarget: {\n\t\t\t\t...ctx.target,\n\t\t\t\tattributes\n\t\t\t}\n\t\t};\n\t}\n};\n//#endregion\n//#region src/helpers/hash.ts\nfunction spacePreservedObfuscator(input) {\n\tif (!input) return null;\n\treturn [...input].map((char) => char === \" \" ? \" \" : \"█\").join(\"\");\n}\n//#endregion\n//#region src/index.ts\nconst executor = buildExecutor([\n\tskipNode,\n\t{\n\t\tid: \"transform-text\",\n\t\tskipAllRest: true,\n\t\tmatch: (ctx) => ctx.element.nodeType === 3,\n\t\ttransform: (ctx) => {\n\t\t\tconst text = spacePreservedObfuscator(ctx.element.textContent?.trim());\n\t\t\tif (!text) return ctx;\n\t\t\tconst isHeading = ctx.parentNode?.nodeName.toLowerCase().startsWith(\"h\");\n\t\t\tif (![\"p\", \"label\"].includes(ctx.parentNode?.nodeName.toLowerCase() ?? \"\") && !isHeading) return {\n\t\t\t\t...ctx,\n\t\t\t\ttarget: {\n\t\t\t\t\telement: \"TEXT\",\n\t\t\t\t\tchildren: [jsxText(text)]\n\t\t\t\t}\n\t\t\t};\n\t\t\treturn {\n\t\t\t\t...ctx,\n\t\t\t\ttarget: {\n\t\t\t\t\telement: \"span\",\n\t\t\t\t\tattributes: [\n\t\t\t\t\t\tcreateJsxStringAttribute(\"className\", TEXT_CLASSNAME),\n\t\t\t\t\t\tcreateJsxStringAttribute(\"data-text-node\", \"true\"),\n\t\t\t\t\t\tcreateJsxStringAttribute(DEPTH_ATTRIBUTE, ctx.parentDepth ?? String(ctx.depth))\n\t\t\t\t\t],\n\t\t\t\t\tchildren: [jsxText(text)]\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t},\n\tremoveReduntantNode,\n\tpopulateAttrs,\n\tprocessSvg,\n\ttransformImg,\n\ttransformInteractiveElements,\n\taddRootSkeletonsAttrs\n]);\nfunction excarnate(element, depth, parentNode = null, parentDepth) {\n\tconst target = executor({\n\t\telement,\n\t\tdepth,\n\t\tparentNode,\n\t\tparentDepth\n\t}).target;\n\tif (!target) return null;\n\tconst { children, element: tagName, attributes } = target;\n\tif (tagName === \"TEXT\") return children?.[0] ?? null;\n\tif (children) return createJsxElement(tagName, children, attributes);\n\tconst { childNodes } = element ?? { childNodes: [] };\n\treturn createJsxElement(tagName, Array.from(childNodes).map((child) => excarnate(child, depth + 1, element, depth.toString())).filter(Boolean), attributes);\n}\n//#endregion\nexport { excarnate as default };\n\n//# sourceMappingURL=index.mjs.map","import { JSDOM } from \"jsdom\";\nimport pkg from \"@babel/generator\";\n\n// @ts-ignore\nconst generate = pkg.default;\n\nimport htmlNodeToJsx from \"@skullmaster/excarnate\";\n\nexport function transformInput(html: string) {\n const dom = new JSDOM(html);\n\n const root = dom.window.document.body.firstElementChild;\n\n if (!root) {\n throw new Error(\"No root element found\");\n }\n\n const jsxAst = htmlNodeToJsx(root, 0);\n\n if (!jsxAst) {\n throw new Error(\"Failed to generate JSX AST\");\n }\n\n const result = generate(jsxAst, {\n jsescOption: {\n minimal: true,\n },\n });\n\n return result.code;\n}\n","export function toPascalCase(input: string): string {\n return input\n .trim()\n .replace(/['\"]/g, \"\")\n .split(/[^a-zA-Z0-9]+/)\n .filter(Boolean)\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n .join(\"\");\n}\n","export function fnv1a(str: string): number {\n let hash = 0x811c9dc5;\n\n for (let i = 0; i < str.length; i++) {\n hash ^= str.charCodeAt(i);\n hash = Math.imul(hash, 0x01000193);\n }\n\n return hash >>> 0;\n}\n","import { serve } from \"@hono/node-server\";\nimport { Hono } from \"hono\";\nimport { cors } from \"hono/cors\";\nimport { Project } from \"ts-morph\";\nimport { SkeletonCacheDB } from \"../cache\";\nimport generateTarget from \"../generate-target\";\nimport { transformInput } from \"../transform\";\nimport { toPascalCase } from \"../utils/to-pascal-case\";\nimport { fnv1a } from \"../utils/fnv1a\";\nimport type { Config } from \"../init/preferences\";\nimport { log, SkeletonPayloadInputSchema } from \"../shared\";\n\nexport async function serveCommand(config: Config, port: number) {\n const app = new Hono();\n\n app.use(\n \"*\",\n cors({\n origin: \"*\",\n allowMethods: [\"GET\", \"POST\", \"OPTIONS\"],\n allowHeaders: [\"Content-Type\", \"Authorization\"],\n }),\n );\n\n const db = await SkeletonCacheDB.create(config);\n\n app.get(\"/health\", (c) => {\n return c.json({\n ok: true,\n });\n });\n\n app.post(\"/skeletons\", async (c) => {\n const body = await c.req.json();\n\n const result = SkeletonPayloadInputSchema.parse(body);\n\n const project = new Project();\n const entries = Object.entries(result).map(async ([key, value]) => {\n const componentName = toPascalCase(value.component);\n const transformedHtml = transformInput(value.html);\n const hash = fnv1a(transformedHtml).toString();\n const cached = db.get(key);\n const shouldSkip = cached && cached.hash === hash;\n\n if (shouldSkip) {\n return;\n }\n\n generateTarget({\n project,\n filePath: `${config.getSkeletonPath()}/${componentName}.${config.getExt()}`,\n componentName,\n body: transformedHtml,\n });\n\n await db.set(key, {\n component: value.component,\n html: transformedHtml,\n hash,\n });\n });\n await Promise.all(entries);\n config.registry({ type: \"add\", components: db.getComponentNames() });\n await project.save();\n\n return c.json({\n sucess: true,\n });\n });\n\n serve(\n {\n fetch: app.fetch,\n port,\n },\n (info) => {\n log.info(`Server running at http://localhost:${info.port}`);\n },\n );\n}\n","import { access } from \"node:fs/promises\";\n\nexport default async function fileExists(path: string): Promise<boolean> {\n try {\n await access(path);\n return true;\n } catch {\n return false;\n }\n}\n","export const CONFIG_PATH = \"skullmaster.config.json\";\n","import { cancel, isCancel, select, text } from \"@clack/prompts\";\nimport fileExists from \"./is-file-exists\";\nimport { readFile, writeFile } from \"fs/promises\";\nimport { CONFIG_PATH } from \"../constants\";\n\nexport type Preferences = {\n outDir: string;\n project: string;\n};\n\nexport default async function collectPreferences(): Promise<Preferences> {\n const isAlreadyInitialized = await fileExists(CONFIG_PATH);\n if (isAlreadyInitialized) {\n return JSON.parse(await readFile(`./${CONFIG_PATH}`, \"utf-8\"));\n }\n\n const outDir = await text({\n message: \"Where do you want to output the generated files?\",\n placeholder: \"src/skeletons\",\n initialValue: \"src/skeletons\",\n validate(value) {\n if (value?.length === 0) return `Value is required!`;\n },\n });\n if (isCancel(outDir)) {\n cancel(\"Operation cancelled.\");\n process.exit(0);\n }\n\n const projectType = await select({\n message: \"Pick a project type.\",\n initialValue: \"react-ts\",\n options: [\n { value: \"react-ts\", label: \"React with TypeScript\" },\n { value: \"react-js\", label: \"React\" },\n ],\n });\n\n if (isCancel(projectType)) {\n cancel(\"Operation cancelled.\");\n process.exit(0);\n }\n\n const preferences = {\n outDir,\n project: projectType.toString(),\n };\n await writeFile(`./${CONFIG_PATH}`, JSON.stringify(preferences, null, 2), \"utf-8\");\n\n return preferences;\n}\n","import { SourceFile } from \"ts-morph\";\n\nexport function ensureLazyImport(sourceFile: SourceFile) {\n const reactImport = sourceFile.getImportDeclaration(\n (d) => d.getModuleSpecifierValue() === \"react\",\n );\n\n if (!reactImport) {\n sourceFile.addImportDeclaration({\n moduleSpecifier: \"react\",\n namedImports: [\"lazy\"],\n });\n\n return;\n }\n\n const hasLazy = reactImport.getNamedImports().some((i) => i.getName() === \"lazy\");\n\n if (!hasLazy) {\n reactImport.addNamedImport(\"lazy\");\n }\n}\n","import { Project, SyntaxKind } from \"ts-morph\";\nimport { writeFile } from \"node:fs/promises\";\nimport { ensureLazyImport } from \"./ensure-lazy-imports\";\nimport { toPascalCase } from \"../utils/to-pascal-case\";\n\nexport async function generateInitialRegistry(outDir: string, projectType: string) {\n const isTs = projectType.endsWith(\"ts\");\n\n const ext = isTs ? \"tsx\" : \"jsx\";\n\n const skeletonPropsType = isTs\n ? `\nimport \"@skullmaster/react/style.css\"\n\ntype SkeletonProps = {\n name: string;\n};\n`\n : \"\";\n\n await writeFile(\n `${outDir}/registry.${ext}`,\n `\n/* eslint-disable */\n/* oxlint-disable */\n/* biome-ignore-all lint */\n/* @ts-nocheck */\n\n /**\n * Auto-generated by Skullmaster.\n *\n * Do not edit this file manually.\n * Use Skullmaster commands to add, update, or remove skeletons.\n *\n * To remove unused skeletons:\n * pnpm skeleton prune\n */\n\n\nimport DefaultBone from \"./skeletons/DefaultBone\";\n\nconst registry${isTs ? \": Record<string, any>\" : \"\"} = {};\n\n${skeletonPropsType}\n\nexport default function Skeleton({\n name,\n}${isTs ? \": SkeletonProps\" : \"\"}) {\n const Component = registry[name];\n\n if (!Component) {\n return <DefaultBone />;\n }\n\n return <Component />;\n}\n`,\n \"utf8\",\n );\n}\n\nexport type RegistryOperation =\n | { type: \"init\"; components: string[] }\n | { type: \"add\"; components: string[] };\n\nexport async function generateRegistry(\n operation: RegistryOperation,\n isTs: boolean,\n registryPath: string,\n) {\n let project: Project;\n if (isTs) {\n project = new Project({\n tsConfigFilePath: \"tsconfig.json\",\n });\n } else {\n project = new Project();\n }\n\n const sourceFile = project.addSourceFileAtPath(registryPath);\n\n ensureLazyImport(sourceFile);\n\n const registry = sourceFile\n .getVariableDeclaration(\"registry\")\n ?.getInitializerIfKind(SyntaxKind.ObjectLiteralExpression);\n\n if (!registry) {\n throw new Error(\"Unable to locate registry object, have you ran skullmaster init??\");\n }\n\n const existingComponents = new Set(\n registry\n .getProperties()\n .filter((property) => property.getKind() === SyntaxKind.PropertyAssignment)\n .map((property) => property.asKindOrThrow(SyntaxKind.PropertyAssignment))\n .map((property) => property.getName().replace(/['\"]/g, \"\")),\n );\n\n for (let component of operation.components) {\n component = toPascalCase(component);\n if (existingComponents.has(component)) {\n continue;\n }\n\n registry.addPropertyAssignment({\n name: `\"${component}\"`,\n initializer: `lazy(() => import(\"./skeletons/${component}\"))`,\n });\n }\n\n sourceFile.formatText();\n\n await sourceFile.save();\n\n project.saveSync();\n}\n","import { readFile, writeFile } from \"node:fs/promises\";\nimport z from \"zod\";\nimport fileExists from \"./is-file-exists\";\nimport { fnv1a } from \"../utils/fnv1a\";\nimport { SkeletonCacheEntrySchema } from \"../shared\";\n\nexport type CacheOperation =\n | { type: \"replace\"; cacheEntry: z.infer<typeof SkeletonCacheEntrySchema> }\n | { type: \"delete\"; componentName: string }\n | {\n type: \"update\";\n componentName: string;\n payload: z.infer<typeof SkeletonCacheEntrySchema>[string];\n };\n\nexport async function updateCacheRegistry(operation: CacheOperation, outDir: string) {\n const cacheFilePath = outDir;\n let cacheEntries: z.infer<typeof SkeletonCacheEntrySchema> = {};\n if (!(await fileExists(cacheFilePath))) {\n await writeFile(cacheFilePath, JSON.stringify({}), \"utf8\");\n } else {\n cacheEntries = SkeletonCacheEntrySchema.parse(\n JSON.parse(await readFile(cacheFilePath, \"utf8\")),\n );\n }\n switch (operation.type) {\n case \"replace\":\n await writeFile(cacheFilePath, JSON.stringify(operation.cacheEntry), \"utf8\");\n break;\n case \"delete\":\n delete cacheEntries[operation.componentName];\n await writeFile(cacheFilePath, JSON.stringify(cacheEntries), \"utf8\");\n break;\n case \"update\":\n cacheEntries[operation.componentName] = {\n ...operation.payload,\n hash: fnv1a(operation.payload.html).toString(),\n };\n await writeFile(cacheFilePath, JSON.stringify(cacheEntries), \"utf8\");\n }\n}\n","import { writeFile } from \"node:fs/promises\";\n\nexport default async function defaultBone(target: string) {\n await writeFile(\n target,\n `/* eslint-disable */\n/* oxlint-disable */\n/* biome-ignore-all lint */\n/* @ts-nocheck */\n\n/**\n * Auto-generated by Skullmaster.\n *\n * This is the default fallback skeleton component displayed when a\n * matching skeleton implementation cannot be found in the registry.\n *\n * You may freely customize or replace this component to match the\n * loading experience of your application.\n */\nexport default function DefaultBone() {\n return <div>loading...</div>;\n}\n`,\n \"utf8\",\n );\n}\n","import { mkdirSync, writeFileSync } from \"node:fs\";\nimport fileExists from \"./is-file-exists\";\nimport { generateInitialRegistry, generateRegistry, type RegistryOperation } from \"./registry\";\nimport { updateCacheRegistry, type CacheOperation } from \"./cache-registry\";\nimport defaultBone from \"./default-bone\";\nimport { log } from \"../shared\";\n\nexport class Config {\n outDir: string;\n projectType: string;\n\n constructor(outDir: string, projectType: string) {\n this.outDir = outDir;\n this.projectType = projectType;\n }\n async initialize() {\n log.info(\"Initializing project structure...\");\n if (!(await fileExists(this.outDir))) {\n mkdirSync(this.outDir, { recursive: true });\n log.success(`Created output directory: ${this.outDir}`);\n } else {\n log.gray(`Output directory exists: ${this.outDir}`);\n }\n const skeletonsDirectoryPath = this.getSkeletonPath();\n if (!(await fileExists(skeletonsDirectoryPath))) {\n mkdirSync(skeletonsDirectoryPath, { recursive: true });\n log.success(`Created skeletons directory: ${skeletonsDirectoryPath}`);\n } else {\n log.gray(`Skeletons directory exists: ${skeletonsDirectoryPath}`);\n }\n const registryFilePath = this.getRegistryPath();\n if (!(await fileExists(registryFilePath))) {\n await generateInitialRegistry(this.outDir, this.projectType);\n log.success(`Created registry: ${registryFilePath}`);\n } else {\n log.gray(`Registry exists: ${registryFilePath}`);\n }\n const cachePath = this.getCachePath();\n if (!(await fileExists(cachePath))) {\n writeFileSync(cachePath, JSON.stringify({}), \"utf8\");\n log.success(`Created cache: ${cachePath}`);\n } else {\n log.gray(`Cache exists: ${cachePath}`);\n }\n const defaultBonePath = this.getDefSkeletonPath();\n if (!(await fileExists(defaultBonePath))) {\n await defaultBone(defaultBonePath);\n log.success(`Created default bone: ${defaultBonePath}`);\n } else {\n log.gray(`Default bone exists: ${defaultBonePath}`);\n }\n log.success(\"Initialization complete\");\n }\n async cache(op: CacheOperation) {\n return await updateCacheRegistry(op, this.getCachePath());\n }\n async registry(op: RegistryOperation) {\n return generateRegistry(op, this.projectType.endsWith(\"ts\"), this.getRegistryPath());\n }\n getCachePath() {\n return `${this.outDir}/cache.json`;\n }\n getSkeletonPath() {\n return `${this.outDir}/skeletons`;\n }\n getDefSkeletonPath() {\n return `${this.getSkeletonPath()}/DefaultBone.${this.getExt()}`;\n }\n getExt() {\n return this.projectType.endsWith(\"ts\") ? \"tsx\" : \"jsx\";\n }\n getRegistryPath() {\n return `${this.outDir}/registry.${this.getExt()}`;\n }\n}\n","#!/usr/bin/env node\n\nimport { cac } from \"cac\";\nimport { serveCommand } from \"./commands/serve\";\nimport collectPreferences from \"./init/collect-preferences\";\nimport { Config } from \"./init/preferences\";\nimport { DEFAULT_PORT } from \"./shared\";\n\nconst cli = cac(\"💀\");\n\ncli\n .command(\"serve\", \"Start 💀 dev server\")\n .option(\"--port <port>\", \"Port\", {\n default: DEFAULT_PORT,\n })\n .action(async (options) => {\n const preferences = await collectPreferences();\n const config = new Config(preferences.outDir, preferences.project);\n await config.initialize();\n await serveCommand(config, Number(options.port));\n });\n\ncli.help();\ncli.parse();\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,MAAa,eAAe;;;ACE5B,MAAa,6BAA6B,EAAE,OAC1C,EAAE,OAAO,GACT,EAAE,OAAO;CACP,WAAW,EAAE,OAAO;CACpB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ACA,MAAM,SAAS,IAAuB;EACpC,OAAO,iBAAiB,IAAI,KAAK,YAAY,SAAS,IAAI,GAAG,KAAK,gBAAgB,CAAC;CACrF;CACA,eAAe;EACb,OAAO,GAAG,KAAK,OAAO;CACxB;CACA,kBAAkB;EAChB,OAAO,GAAG,KAAK,OAAO;CACxB;CACA,qBAAqB;EACnB,OAAO,GAAG,KAAK,gBAAgB,EAAE,eAAe,KAAK,OAAO;CAC9D;CACA,SAAS;EACP,OAAO,KAAK,YAAY,SAAS,IAAI,IAAI,QAAQ;CACnD;CACA,kBAAkB;EAChB,OAAO,GAAG,KAAK,OAAO,YAAY,KAAK,OAAO;CAChD;AACF;;;AClEA,MAAM,MAAM,IAAI,IAAI;AAEpB,IACG,QAAQ,SAAS,qBAAqB,CAAC,CACvC,OAAO,iBAAiB,QAAQ,EAC/B,SAAS,aACX,CAAC,CAAC,CACD,OAAO,OAAO,YAAY;CACzB,MAAM,cAAc,MAAM,mBAAmB;CAC7C,MAAM,SAAS,IAAI,OAAO,YAAY,QAAQ,YAAY,OAAO;CACjE,MAAM,OAAO,WAAW;CACxB,MAAM,aAAa,QAAQ,OAAO,QAAQ,IAAI,CAAC;AACjD,CAAC;AAEH,IAAI,KAAK;AACT,IAAI,MAAM"}
1
+ {"version":3,"file":"cli.mjs","names":["htmlNodeToJsx","readFile","writeFile"],"sources":["../src/shared/constants.ts","../src/shared/schema.ts","../src/shared/log.ts","../src/cache/index.ts","../src/generate-target/index.ts","../../excarnate/dist/index.mjs","../src/transform/index.ts","../src/utils/to-pascal-case.ts","../src/utils/fnv1a.ts","../src/commands/serve.ts","../src/init/is-file-exists.ts","../src/constants.ts","../src/init/collect-preferences.ts","../src/init/ensure-lazy-imports.ts","../src/init/registry.ts","../src/init/cache-registry.ts","../src/init/default-bone.ts","../src/init/preferences.ts","../src/cli.ts"],"sourcesContent":["export const DEFAULT_PORT = 8008;\nexport const EMPTY_SET_DEFAULT_DIR = \"skullmaster\";\nexport const DATA_NAT_H = \"data-natural-h\";\nexport const DATA_NAT_W = \"data-natural-w\";\n","import z from \"zod\";\n\nexport const SkeletonPayloadInputSchema = z.record(\n z.string(),\n z.object({\n component: z.string(),\n html: z.string(),\n }),\n);\n\nexport const SkeletonCacheEntrySchema = z.record(\n z.string(),\n z.object({\n component: z.string(),\n html: z.string(),\n hash: z.string(),\n }),\n);\n\nexport type SkeletonPayloadInput = z.infer<typeof SkeletonPayloadInputSchema>;\n\nexport type SkeletonCacheEntry = z.infer<typeof SkeletonCacheEntrySchema>;\n","export const log = {\n success: (message: string) => console.log(`\\x1b[32m[💀] ${message}\\x1b[0m`),\n info: (message: string) => console.log(`\\x1b[36m[💀] ${message}\\x1b[0m`),\n warn: (message: string) => console.log(`\\x1b[33m[💀] ${message}\\x1b[0m`),\n error: (message: string) => console.log(`\\x1b[31m[💀] ${message}\\x1b[0m`),\n gray: (message: string) => console.log(`\\x1b[90m[💀] ${message}\\x1b[0m`),\n};\n","import { readFile } from \"node:fs/promises\";\nimport type { Config } from \"../init/preferences\";\nimport { type SkeletonCacheEntry, SkeletonCacheEntrySchema } from \"../shared\";\n\nexport class SkeletonCacheDB {\n private data: SkeletonCacheEntry = {};\n config: Config;\n private constructor(config: Config) {\n this.config = config;\n }\n\n static async create(config: Config) {\n const db = new SkeletonCacheDB(config);\n\n await db.load();\n\n return db;\n }\n\n private async load() {\n try {\n const file = await readFile(this.config.getCachePath(), \"utf8\");\n\n const parsed = JSON.parse(file);\n\n this.data = SkeletonCacheEntrySchema.parse(parsed);\n } catch {\n this.data = {};\n\n await this.config.cache({ type: \"replace\", cacheEntry: {} });\n }\n }\n\n get(key: string) {\n return this.data[key];\n }\n getComponentNames(): string[] {\n return Object.values(this.data).map((entry) => entry.component);\n }\n\n async set(key: string, value: SkeletonCacheEntry[string]) {\n this.data[key] = value;\n this.config.cache({ type: \"update\", componentName: key, payload: value });\n }\n}\n","import { Project, QuoteKind, ScriptKind } from \"ts-morph\";\n\ntype GenerateTargetOptions = {\n project: Project;\n filePath: string;\n componentName: string;\n body: string;\n};\n\nexport default function generateTarget({\n project,\n filePath,\n componentName,\n body,\n}: GenerateTargetOptions) {\n project.manipulationSettings.set({\n quoteKind: QuoteKind.Double,\n });\n\n const file = project.createSourceFile(filePath, \"\", {\n overwrite: true,\n scriptKind: ScriptKind.TSX,\n });\n\n file.insertText(\n 0,\n `/* eslint-disable */\n/* prettier-ignore-start */\n\n/**\n * Auto-generated by Skullmaster.\n *\n * DO NOT EDIT THIS FILE MANUALLY.\n * Changes may be overwritten on the next generation.\n */\n\n`,\n );\n\n file.addFunction({\n name: componentName,\n isDefaultExport: true,\n statements: [`return (${body});`],\n });\n\n file.addStatements(`\n/* prettier-ignore-end */\n`);\n}\n","import * as t from \"@babel/types\";\nimport { jsxText } from \"@babel/types\";\n//#region src/executor.ts\nfunction buildExecutor(rules) {\n\treturn (ctx) => {\n\t\tlet current = ctx;\n\t\tfor (const rule of rules) {\n\t\t\tif (!rule.match(current)) continue;\n\t\t\tcurrent = rule.transform(current);\n\t\t\tif (rule.skipAllRest) break;\n\t\t}\n\t\treturn current;\n\t};\n}\n//#endregion\n//#region src/helpers/sanitize-attr-value.ts\nfunction sanitizeAttrValue(value) {\n\treturn value.replace(/\"/g, \"'\").replace(/\\\\/g, \"/\");\n}\n//#endregion\n//#region src/helpers/jsx.ts\nfunction createJsxStringAttribute(name, value) {\n\treturn t.jsxAttribute(t.jsxIdentifier(name), t.stringLiteral(sanitizeAttrValue(value)));\n}\nfunction createJsxExpressionAttribute(name, expression) {\n\treturn t.jsxAttribute(t.jsxIdentifier(name), t.jsxExpressionContainer(expression));\n}\nfunction findJsxAttribute(attributes, name) {\n\treturn attributes.find((attr) => t.isJSXAttribute(attr) && t.isJSXIdentifier(attr.name) && attr.name.name === name);\n}\nfunction findStringJsxAttribute(attributes, name) {\n\tconst attr = findJsxAttribute(attributes, name);\n\tif (!attr?.value || !t.isStringLiteral(attr.value)) return;\n\treturn attr;\n}\nfunction createJsxElement(tagName, children, attributes = []) {\n\treturn t.jsxElement(t.jsxOpeningElement(t.jsxIdentifier(tagName), attributes, false), t.jsxClosingElement(t.jsxIdentifier(tagName)), children, false);\n}\n//#endregion\n//#region src/constants.ts\nconst DEPTH_ATTRIBUTE = \"data-depth\";\nconst TEXT_CLASSNAME = \"empty-set__text\";\nconst SKELETON_CLASSNAME = \"empty-set__skeleton\";\n//#endregion\n//#region src/exceptions/target-mismatch.ts\nvar TargetElementMismatchError = class extends Error {\n\tconstructor(expected, actual) {\n\t\tsuper(`Expected target element to be ${expected}, but got ${actual}`);\n\t\tthis.name = \"TargetElementMismatchError\";\n\t}\n};\n//#endregion\n//#region src/helpers/attribute-replace-map.ts\nconst ATTRIBUTE_MAP = {\n\tclass: \"className\",\n\tfor: \"htmlFor\",\n\ttabindex: \"tabIndex\",\n\treadonly: \"readOnly\",\n\tmaxlength: \"maxLength\",\n\tminlength: \"minLength\",\n\tcolspan: \"colSpan\",\n\trowspan: \"rowSpan\",\n\tcontenteditable: \"contentEditable\",\n\tautocapitalize: \"autoCapitalize\",\n\tautocomplete: \"autoComplete\",\n\tautofocus: \"autoFocus\",\n\tspellcheck: \"spellCheck\",\n\tcrossorigin: \"crossOrigin\",\n\treferrerpolicy: \"referrerPolicy\",\n\tstrokewidth: \"strokeWidth\",\n\t\"stroke-width\": \"strokeWidth\",\n\tstrokelinecap: \"strokeLinecap\",\n\t\"stroke-linecap\": \"strokeLinecap\",\n\tstrokelinejoin: \"strokeLinejoin\",\n\t\"stroke-linejoin\": \"strokeLinejoin\",\n\tstrokemiterlimit: \"strokeMiterlimit\",\n\t\"stroke-miterlimit\": \"strokeMiterlimit\",\n\tstrokedasharray: \"strokeDasharray\",\n\t\"stroke-dasharray\": \"strokeDasharray\",\n\tstrokedashoffset: \"strokeDashoffset\",\n\t\"stroke-dashoffset\": \"strokeDashoffset\",\n\tstrokeopacity: \"strokeOpacity\",\n\t\"stroke-opacity\": \"strokeOpacity\",\n\tfillopacity: \"fillOpacity\",\n\t\"fill-opacity\": \"fillOpacity\",\n\tfillrule: \"fillRule\",\n\t\"fill-rule\": \"fillRule\",\n\tcliprule: \"clipRule\",\n\t\"clip-rule\": \"clipRule\",\n\tclippath: \"clipPath\",\n\t\"clip-path\": \"clipPath\",\n\tstopcolor: \"stopColor\",\n\t\"stop-color\": \"stopColor\",\n\tstopopacity: \"stopOpacity\",\n\t\"stop-opacity\": \"stopOpacity\",\n\tviewbox: \"viewBox\",\n\txlinkhref: \"xlinkHref\",\n\t\"xlink:href\": \"xlinkHref\",\n\txmlspace: \"xmlSpace\",\n\t\"xml:space\": \"xmlSpace\"\n};\n//#endregion\n//#region src/helpers/attr-normalize.ts\nfunction normalizeAttributeName(name) {\n\tconst lower = name.toLowerCase();\n\tif (ATTRIBUTE_MAP[lower]) return ATTRIBUTE_MAP[lower];\n\tif (lower.startsWith(\"data-\") || lower.startsWith(\"aria-\")) return lower;\n\treturn name.replace(/-([a-z])/g, (_, char) => char.toUpperCase());\n}\n//#endregion\n//#region src/helpers/is-style.ts\nconst STYLE_ATTRIBUTES = /* @__PURE__ */ new Set([\n\t\"class\",\n\t\"style\",\n\t\"type\",\n\t\"fill\",\n\t\"fill-opacity\",\n\t\"fill-rule\",\n\t\"src\",\n\t\"stroke\",\n\t\"stroke-width\",\n\t\"stroke-opacity\",\n\t\"stroke-linecap\",\n\t\"stroke-linejoin\",\n\t\"stroke-dasharray\",\n\t\"stroke-dashoffset\",\n\t\"opacity\",\n\t\"role\",\n\t\"width\",\n\t\"height\",\n\t\"x\",\n\t\"y\",\n\t\"cx\",\n\t\"cy\",\n\t\"r\",\n\t\"rx\",\n\t\"ry\",\n\t\"viewbox\",\n\t\"transform\",\n\t\"d\",\n\t\"points\"\n]);\nfunction shouldKeepAttribute(name) {\n\tconst lowerName = name.toLowerCase();\n\treturn lowerName.startsWith(\"data-\") || lowerName.startsWith(\"aria-\") || STYLE_ATTRIBUTES.has(lowerName);\n}\n//#endregion\n//#region src/helpers/parse-style.ts\nfunction parseStyle(style) {\n\tconst properties = [];\n\tfor (const rule of style.split(\";\")) {\n\t\tconst trimmedRule = rule.trim();\n\t\tif (!trimmedRule) continue;\n\t\tconst colonIndex = trimmedRule.indexOf(\":\");\n\t\tif (colonIndex === -1) continue;\n\t\tconst rawKey = trimmedRule.slice(0, colonIndex).trim();\n\t\tconst rawValue = trimmedRule.slice(colonIndex + 1).trim();\n\t\tconst key = rawKey.replace(/-([a-z])/g, (_, char) => char.toUpperCase());\n\t\tconst keyNode = key.startsWith(\"--\") || key.includes(\"-\") ? t.stringLiteral(key) : t.identifier(key);\n\t\tproperties.push(t.objectProperty(keyNode, t.stringLiteral(rawValue)));\n\t}\n\treturn t.objectExpression(properties);\n}\n//#endregion\n//#region src/rules/populate-attrs.ts\nconst populateAttrs = {\n\tid: \"populate-attrs\",\n\tmatch: (ctx) => ctx.element.nodeType === 1,\n\ttransform: (ctx) => {\n\t\tconst element = ctx.element;\n\t\tconst attributes = [];\n\t\tconst tagName = element.tagName.toLowerCase();\n\t\tif (ctx.target?.element && ctx.target?.element !== tagName) throw new TargetElementMismatchError(tagName, ctx.target.element);\n\t\tif (!element.hasAttribute(\"data-depth\")) attributes.push(createJsxStringAttribute(DEPTH_ATTRIBUTE, String(ctx.depth % 4)));\n\t\tfor (const attr of element.attributes) {\n\t\t\tif (!shouldKeepAttribute(attr.name)) continue;\n\t\t\tconst name = normalizeAttributeName(attr.name);\n\t\t\tconst value = attr.value;\n\t\t\tif (name === \"style\") {\n\t\t\t\tattributes.push(createJsxExpressionAttribute(\"style\", parseStyle(value)));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tattributes.push(createJsxStringAttribute(name, value));\n\t\t}\n\t\treturn {\n\t\t\t...ctx,\n\t\t\ttarget: {\n\t\t\t\telement: tagName,\n\t\t\t\tattributes\n\t\t\t}\n\t\t};\n\t}\n};\n//#endregion\n//#region src/matchers.ts\nconst atDepth = (depth) => (ctx) => ctx.depth === depth;\nconst isTagNamesIn = (elements) => (ctx) => ctx.element.nodeType === 1 && elements.includes(ctx.element.tagName.toLowerCase());\n//#endregion\n//#region src/rules/process-svg.ts\nconst processSvg = {\n\tid: \"process-svg\",\n\tskipAllRest: true,\n\tmatch: isTagNamesIn([\"svg\"]),\n\ttransform: (ctx) => {\n\t\treturn {\n\t\t\t...ctx,\n\t\t\ttarget: {\n\t\t\t\t...ctx.target,\n\t\t\t\telement: \"svg\",\n\t\t\t\tchildren: []\n\t\t\t}\n\t\t};\n\t}\n};\n//#endregion\n//#region src/rules/remove-node.ts\nconst removeReduntantNode = {\n\tid: \"remove-node\",\n\tskipAllRest: true,\n\tmatch: isTagNamesIn([\n\t\t\"html\",\n\t\t\"script\",\n\t\t\"style\",\n\t\t\"head\",\n\t\t\"meta\",\n\t\t\"link\",\n\t\t\"noscript\",\n\t\t\"template\",\n\t\t\"audio\",\n\t\t\"video\",\n\t\t\"source\",\n\t\t\"track\",\n\t\t\"iframe\",\n\t\t\"embed\",\n\t\t\"object\",\n\t\t\"title\",\n\t\t\"base\",\n\t\t\"defs\",\n\t\t\"symbol\",\n\t\t\"html\",\n\t\t\"canvas\",\n\t\t\"map\",\n\t\t\"area\",\n\t\t\"picture\",\n\t\t\"portal\"\n\t]),\n\ttransform: (ctx) => {\n\t\treturn {\n\t\t\t...ctx,\n\t\t\ttarget: null\n\t\t};\n\t}\n};\n//#endregion\n//#region src/rules/root-skeleton-attrs.ts\nconst addRootSkeletonsAttrs = {\n\tid: \"add-root-skeleton-attrs\",\n\tmatch: (ctx) => ctx.element.nodeType === 1 && atDepth(0)(ctx),\n\ttransform: (ctx) => {\n\t\tconst tagName = ctx.element.tagName.toLowerCase();\n\t\tif (ctx.target?.element && ctx.target.element !== tagName) throw new TargetElementMismatchError(tagName, ctx.target.element);\n\t\tconst existingTarget = ctx.target ?? {\n\t\t\telement: tagName,\n\t\t\tattributes: []\n\t\t};\n\t\tconst existingAttrs = existingTarget.attributes ?? [];\n\t\tconst classNameAttr = findStringJsxAttribute(existingAttrs, \"className\");\n\t\tconst attributes = [...classNameAttr ? existingAttrs.map((attr) => attr === classNameAttr ? {\n\t\t\t...attr,\n\t\t\tvalue: {\n\t\t\t\t...classNameAttr.value,\n\t\t\t\tvalue: `${classNameAttr.value.value} ${SKELETON_CLASSNAME}`\n\t\t\t}\n\t\t} : attr) : [...existingAttrs, createJsxStringAttribute(\"className\", SKELETON_CLASSNAME)]];\n\t\tif (!findJsxAttribute(attributes, \"role\")) attributes.push(createJsxStringAttribute(\"role\", \"status\"));\n\t\tif (!findJsxAttribute(attributes, \"aria-live\")) attributes.push(createJsxStringAttribute(\"aria-live\", \"polite\"));\n\t\tif (!findJsxAttribute(attributes, \"aria-busy\")) attributes.push(createJsxStringAttribute(\"aria-busy\", \"true\"));\n\t\treturn {\n\t\t\t...ctx,\n\t\t\ttarget: {\n\t\t\t\t...existingTarget,\n\t\t\t\telement: tagName,\n\t\t\t\tattributes\n\t\t\t}\n\t\t};\n\t}\n};\n//#endregion\n//#region src/rules/skip-node.ts\nconst skipNode = {\n\tid: \"skip-node\",\n\tskipAllRest: true,\n\tmatch: (ctx) => ctx.element.nodeType === 1 && ctx.element.hasAttribute(\"data-skip-skull\"),\n\ttransform: (ctx) => ({\n\t\t...ctx,\n\t\ttarget: null\n\t})\n};\n//#endregion\n//#region src/rules/transform-img.ts\nconst DATA_NAT_H = \"data-natural-h\";\nconst DATA_NAT_W = \"data-natural-w\";\nconst DATA_IMAGE_SKELETON = \"data-image-skeleton\";\nfunction createSkeletonSrc(width, height, color = \"#808080\") {\n\tconst w = Number(width) || 400;\n\tconst h = Number(height) || 300;\n\treturn `data:image/svg+xml,${encodeURIComponent(`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"${w}\" height=\"${h}\" viewBox=\"0 0 ${w} ${h}\" preserveAspectRatio=\"none\"><rect width=\"100%\" height=\"100%\" fill=\"${color}\"/></svg>`)}`;\n}\nconst transformImg = {\n\tid: \"transform-img\",\n\tmatch: (ctx) => ctx.element.nodeType === 1 && ctx.element.tagName.toLowerCase() === \"img\",\n\ttransform: (ctx) => {\n\t\tif (!ctx.target) throw new Error(\"Target must be defined before transforming an image element.\");\n\t\tconst attrs = ctx.target.attributes ?? [];\n\t\tconst naturalWidthAttr = findStringJsxAttribute(attrs, DATA_NAT_W);\n\t\tconst naturalHeightAttr = findStringJsxAttribute(attrs, DATA_NAT_H);\n\t\tconst naturalWidth = naturalWidthAttr?.value?.value;\n\t\tconst naturalHeight = naturalHeightAttr?.value?.value;\n\t\tconst placeholderSrc = createSkeletonSrc(naturalWidth, naturalHeight);\n\t\tconst attributes = [\n\t\t\t...attrs.filter((attr) => {\n\t\t\t\tif (!t.isJSXAttribute(attr)) return false;\n\t\t\t\tconst name = t.isJSXIdentifier(attr.name) ? attr.name.name : void 0;\n\t\t\t\treturn ![\n\t\t\t\t\t\"src\",\n\t\t\t\t\t\"srcSet\",\n\t\t\t\t\t\"sizes\",\n\t\t\t\t\t\"loading\",\n\t\t\t\t\t\"decoding\",\n\t\t\t\t\t\"fetchPriority\",\n\t\t\t\t\tDATA_NAT_W,\n\t\t\t\t\tDATA_NAT_H,\n\t\t\t\t\tDATA_IMAGE_SKELETON\n\t\t\t\t].includes(name ?? \"\");\n\t\t\t}),\n\t\t\tcreateJsxStringAttribute(\"src\", placeholderSrc),\n\t\t\tcreateJsxStringAttribute(DATA_IMAGE_SKELETON, \"true\")\n\t\t];\n\t\treturn {\n\t\t\t...ctx,\n\t\t\ttarget: {\n\t\t\t\t...ctx.target,\n\t\t\t\tattributes\n\t\t\t}\n\t\t};\n\t}\n};\n//#endregion\n//#region src/rules/transform-interactive.ts\nconst INTERACTIVE_TAGS = /* @__PURE__ */ new Set([\n\t\"input\",\n\t\"textarea\",\n\t\"select\",\n\t\"option\",\n\t\"optgroup\",\n\t\"button\",\n\t\"label\",\n\t\"fieldset\",\n\t\"legend\",\n\t\"output\",\n\t\"datalist\",\n\t\"a\",\n\t\"details\",\n\t\"summary\",\n\t\"audio\",\n\t\"video\",\n\t\"iframe\",\n\t\"embed\",\n\t\"object\",\n\t\"dialog\"\n]);\nconst INTERACTIVE_ROLES = /* @__PURE__ */ new Set([\n\t\"button\",\n\t\"link\",\n\t\"tab\",\n\t\"menuitem\",\n\t\"checkbox\",\n\t\"radio\",\n\t\"switch\",\n\t\"option\",\n\t\"combobox\",\n\t\"textbox\",\n\t\"searchbox\",\n\t\"slider\",\n\t\"spinbutton\",\n\t\"listbox\",\n\t\"treeitem\",\n\t\"gridcell\",\n\t\"rowheader\",\n\t\"columnheader\"\n]);\nconst ARIA_ATTRIBUTES_TO_REMOVE = /* @__PURE__ */ new Set([\n\t\"role\",\n\t\"aria-label\",\n\t\"aria-labelledby\",\n\t\"aria-describedby\",\n\t\"aria-controls\",\n\t\"aria-expanded\",\n\t\"aria-haspopup\",\n\t\"aria-pressed\",\n\t\"aria-selected\",\n\t\"aria-checked\",\n\t\"aria-current\",\n\t\"contenteditable\",\n\t\"tabindex\",\n\t\"aria-hidden\",\n\t\"data-skeleton-interactive\"\n]);\nconst transformInteractiveElements = {\n\tid: \"transform-interactive-elements\",\n\tmatch: (ctx) => {\n\t\tif (ctx.element.nodeType !== 1) return false;\n\t\tconst element = ctx.element;\n\t\tconst tag = element.tagName.toLowerCase();\n\t\tif (INTERACTIVE_TAGS.has(tag)) return true;\n\t\tconst role = element.getAttribute(\"role\")?.toLowerCase();\n\t\tif (role && INTERACTIVE_ROLES.has(role)) return true;\n\t\tif (element.hasAttribute(\"contenteditable\")) return true;\n\t\tif (element.hasAttribute(\"tabindex\")) return true;\n\t\treturn false;\n\t},\n\ttransform: (ctx) => {\n\t\tif (!ctx.target) return ctx;\n\t\tconst attributes = (ctx.target.attributes ?? []).filter((attribute) => {\n\t\t\tconst name = attribute.type === \"JSXAttribute\" && attribute.name?.name ? String(attribute.name.name).toLowerCase() : \"\";\n\t\t\treturn !ARIA_ATTRIBUTES_TO_REMOVE.has(name);\n\t\t});\n\t\tattributes.push(createJsxStringAttribute(\"data-skeleton-interactive\", \"true\"), createJsxStringAttribute(\"aria-hidden\", \"true\"), createJsxExpressionAttribute(\"tabIndex\", t.numericLiteral(-1)));\n\t\treturn {\n\t\t\t...ctx,\n\t\t\ttarget: {\n\t\t\t\t...ctx.target,\n\t\t\t\tattributes\n\t\t\t}\n\t\t};\n\t}\n};\n//#endregion\n//#region src/helpers/hash.ts\nfunction spacePreservedObfuscator(input) {\n\tif (!input) return null;\n\treturn [...input].map((char) => char === \" \" ? \" \" : \"█\").join(\"\");\n}\n//#endregion\n//#region src/index.ts\nconst executor = buildExecutor([\n\tskipNode,\n\t{\n\t\tid: \"transform-text\",\n\t\tskipAllRest: true,\n\t\tmatch: (ctx) => ctx.element.nodeType === 3,\n\t\ttransform: (ctx) => {\n\t\t\tconst text = spacePreservedObfuscator(ctx.element.textContent?.trim());\n\t\t\tif (!text) return ctx;\n\t\t\tconst isHeading = ctx.parentNode?.nodeName.toLowerCase().startsWith(\"h\");\n\t\t\tif (![\"p\", \"label\"].includes(ctx.parentNode?.nodeName.toLowerCase() ?? \"\") && !isHeading) return {\n\t\t\t\t...ctx,\n\t\t\t\ttarget: {\n\t\t\t\t\telement: \"TEXT\",\n\t\t\t\t\tchildren: [jsxText(text)]\n\t\t\t\t}\n\t\t\t};\n\t\t\treturn {\n\t\t\t\t...ctx,\n\t\t\t\ttarget: {\n\t\t\t\t\telement: \"span\",\n\t\t\t\t\tattributes: [\n\t\t\t\t\t\tcreateJsxStringAttribute(\"className\", TEXT_CLASSNAME),\n\t\t\t\t\t\tcreateJsxStringAttribute(\"data-text-node\", \"true\"),\n\t\t\t\t\t\tcreateJsxStringAttribute(DEPTH_ATTRIBUTE, ctx.parentDepth ?? String(ctx.depth))\n\t\t\t\t\t],\n\t\t\t\t\tchildren: [jsxText(text)]\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t},\n\tremoveReduntantNode,\n\tpopulateAttrs,\n\tprocessSvg,\n\ttransformImg,\n\ttransformInteractiveElements,\n\taddRootSkeletonsAttrs\n]);\nfunction excarnate(element, depth, parentNode = null, parentDepth) {\n\tconst target = executor({\n\t\telement,\n\t\tdepth,\n\t\tparentNode,\n\t\tparentDepth\n\t}).target;\n\tif (!target) return null;\n\tconst { children, element: tagName, attributes } = target;\n\tif (tagName === \"TEXT\") return children?.[0] ?? null;\n\tif (children) return createJsxElement(tagName, children, attributes);\n\tconst { childNodes } = element ?? { childNodes: [] };\n\treturn createJsxElement(tagName, Array.from(childNodes).map((child) => excarnate(child, depth + 1, element, depth.toString())).filter(Boolean), attributes);\n}\n//#endregion\nexport { excarnate as default };\n\n//# sourceMappingURL=index.mjs.map","import { JSDOM } from \"jsdom\";\nimport pkg from \"@babel/generator\";\n\n// @ts-ignore\nconst generate = pkg.default;\n\nimport htmlNodeToJsx from \"@skullmaster/excarnate\";\n\nexport function transformInput(html: string) {\n const dom = new JSDOM(html);\n\n const root = dom.window.document.body.firstElementChild;\n\n if (!root) {\n throw new Error(\"No root element found\");\n }\n\n const jsxAst = htmlNodeToJsx(root, 0);\n\n if (!jsxAst) {\n throw new Error(\"Failed to generate JSX AST\");\n }\n\n const result = generate(jsxAst, {\n jsescOption: {\n minimal: true,\n },\n });\n\n return result.code;\n}\n","export function toPascalCase(input: string): string {\n return input\n .trim()\n .replace(/['\"]/g, \"\")\n .split(/[^a-zA-Z0-9]+/)\n .filter(Boolean)\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n .join(\"\");\n}\n","export function fnv1a(str: string): number {\n let hash = 0x811c9dc5;\n\n for (let i = 0; i < str.length; i++) {\n hash ^= str.charCodeAt(i);\n hash = Math.imul(hash, 0x01000193);\n }\n\n return hash >>> 0;\n}\n","import { serve } from \"@hono/node-server\";\nimport { Hono } from \"hono\";\nimport { cors } from \"hono/cors\";\nimport { Project } from \"ts-morph\";\nimport { SkeletonCacheDB } from \"../cache\";\nimport generateTarget from \"../generate-target\";\nimport { transformInput } from \"../transform\";\nimport { toPascalCase } from \"../utils/to-pascal-case\";\nimport { fnv1a } from \"../utils/fnv1a\";\nimport type { Config } from \"../init/preferences\";\nimport { log, SkeletonPayloadInputSchema } from \"../shared\";\n\nexport async function serveCommand(config: Config, port: number) {\n const app = new Hono();\n\n app.use(\n \"*\",\n cors({\n origin: \"*\",\n allowMethods: [\"GET\", \"POST\", \"OPTIONS\"],\n allowHeaders: [\"Content-Type\", \"Authorization\"],\n }),\n );\n\n const db = await SkeletonCacheDB.create(config);\n\n app.get(\"/health\", (c) => {\n return c.json({\n ok: true,\n config: config.configJson(),\n });\n });\n\n app.post(\"/skeletons\", async (c) => {\n const body = await c.req.json();\n\n const result = SkeletonPayloadInputSchema.parse(body);\n\n const project = new Project();\n const entries = Object.entries(result).map(async ([key, value]) => {\n const componentName = toPascalCase(value.component);\n const transformedHtml = transformInput(value.html);\n const hash = fnv1a(transformedHtml).toString();\n const cached = db.get(key);\n const shouldSkip = cached && cached.hash === hash;\n\n if (shouldSkip) {\n return;\n }\n\n generateTarget({\n project,\n filePath: `${config.getSkeletonPath()}/${componentName}.${config.getExt()}`,\n componentName,\n body: transformedHtml,\n });\n\n await db.set(key, {\n component: value.component,\n html: transformedHtml,\n hash,\n });\n });\n await Promise.all(entries);\n config.registry({ type: \"add\", components: db.getComponentNames() });\n await project.save();\n\n return c.json({\n sucess: true,\n });\n });\n\n serve(\n {\n fetch: app.fetch,\n port,\n },\n (info) => {\n log.info(`Server running at http://localhost:${info.port}`);\n },\n );\n}\n","import { access } from \"node:fs/promises\";\n\nexport default async function fileExists(path: string): Promise<boolean> {\n try {\n await access(path);\n return true;\n } catch {\n return false;\n }\n}\n","export const CONFIG_PATH = \"skullmaster.config.json\";\n","import { cancel, isCancel, select, text } from \"@clack/prompts\";\nimport fileExists from \"./is-file-exists\";\nimport { readFile, writeFile } from \"fs/promises\";\nimport { CONFIG_PATH } from \"../constants\";\n\nexport type Preferences = {\n outDir: string;\n project: string;\n};\n\nexport default async function collectPreferences(): Promise<Preferences> {\n const isAlreadyInitialized = await fileExists(CONFIG_PATH);\n if (isAlreadyInitialized) {\n return JSON.parse(await readFile(`./${CONFIG_PATH}`, \"utf-8\"));\n }\n\n const outDir = await text({\n message: \"Where do you want to output the generated files?\",\n placeholder: \"src/skeletons\",\n initialValue: \"src/skeletons\",\n validate(value) {\n if (value?.length === 0) return `Value is required!`;\n },\n });\n if (isCancel(outDir)) {\n cancel(\"Operation cancelled.\");\n process.exit(0);\n }\n\n const projectType = await select({\n message: \"Pick a project type.\",\n initialValue: \"react-ts\",\n options: [\n { value: \"react-ts\", label: \"React with TypeScript\" },\n { value: \"react-js\", label: \"React\" },\n ],\n });\n\n if (isCancel(projectType)) {\n cancel(\"Operation cancelled.\");\n process.exit(0);\n }\n\n const preferences = {\n outDir,\n project: projectType.toString(),\n };\n await writeFile(`./${CONFIG_PATH}`, JSON.stringify(preferences, null, 2), \"utf-8\");\n\n return preferences;\n}\n","import { SourceFile } from \"ts-morph\";\n\nexport function ensureLazyImport(sourceFile: SourceFile) {\n const reactImport = sourceFile.getImportDeclaration(\n (d) => d.getModuleSpecifierValue() === \"react\",\n );\n\n if (!reactImport) {\n sourceFile.addImportDeclaration({\n moduleSpecifier: \"react\",\n namedImports: [\"lazy\"],\n });\n\n return;\n }\n\n const hasLazy = reactImport.getNamedImports().some((i) => i.getName() === \"lazy\");\n\n if (!hasLazy) {\n reactImport.addNamedImport(\"lazy\");\n }\n}\n","import { Project, SyntaxKind } from \"ts-morph\";\nimport { writeFile } from \"node:fs/promises\";\nimport { ensureLazyImport } from \"./ensure-lazy-imports\";\nimport { toPascalCase } from \"../utils/to-pascal-case\";\n\nexport async function generateInitialRegistry(outDir: string, projectType: string) {\n const isTs = projectType.endsWith(\"ts\");\n\n const ext = isTs ? \"tsx\" : \"jsx\";\n\n const skullTypes = isTs\n ? `\nexport type SkullTweaks = {\n /** Exclude this element and its entire subtree from skeleton generation. */\n hideSubTree?: boolean;\n /** Render this element as transparent (layout preserved) in the skeleton. */\n isTransparent?: boolean;\n};\n\nexport type WithDataSkull = HTMLAttributes<HTMLElement> & {\n \"data-skullmaster\": string;\n \"data-skip-skull\"?: boolean;\n \"data-depth\"?: \"-1\";\n};\n`\n : \"\";\n\n const skullUtils = `\nconst buildSkullAttributes = ({ hideSubTree, isTransparent }${\n isTs ? \": SkullTweaks\" : \"\"\n })${isTs ? ': Omit<WithDataSkull, \"data-skullmaster\">' : \"\"} => {\n return {\n \"data-skip-skull\": hideSubTree,\n \"data-depth\": isTransparent ? \"-1\" : undefined,\n };\n};\n\nexport const markAsSkull = (name: string, tweaks${\n isTs ? \": SkullTweaks\" : \"\"\n } = {})${isTs ? \": WithDataSkull\" : \"\"} => {\n return {\n \"data-skullmaster\": name,\n ...buildSkullAttributes(tweaks),\n };\n};\n\nexport const tweakForSkull = (tweaks${\n isTs ? \": SkullTweaks\" : \"\"\n } = {})${isTs ? ': Omit<WithDataSkull, \"data-skullmaster\">' : \"\"} => {\n return buildSkullAttributes(tweaks);\n};\n`;\n\n const skeletonPropsType = isTs\n ? `\ntype SkeletonProps = {\n name: keyof typeof registry | (string & {});\n defaultBoneProps?: ComponentProps<typeof DefaultBone>;\n};\n`\n : \"\";\n\n await writeFile(\n `${outDir}/registry.${ext}`,\n `\n/* eslint-disable */\n/* oxlint-disable */\n/* biome-ignore-all lint */\n/* @ts-nocheck */\n\n/**\n * Auto-generated by Skullmaster.\n *\n * Do not edit this file manually.\n * Use Skullmaster commands to add, update, or remove skeletons.\n *\n */\n\nimport \"@skullmaster/react/style.css\";\nimport DefaultBone from \"./skeletons/DefaultBone\";\n${isTs ? 'import { type ComponentProps, type HTMLAttributes, lazy } from \"react\";' : \"\"}\n\nconst registry = {default: lazy(() => import(\"./skeletons/DefaultBone\"))}${isTs ? \" as const\" : \"\"};\n\n${skullTypes}${skeletonPropsType}${skullUtils}\nexport default function Skeleton({\n name,\n defaultBoneProps = {},\n}${isTs ? \": SkeletonProps\" : \"\"}) {\n const Component = registry[name];\n\n if (!Component) {\n return <DefaultBone {...defaultBoneProps} />;\n }\n\n return <Component />;\n}\n`,\n \"utf8\",\n );\n}\nexport type RegistryOperation =\n | { type: \"init\"; components: string[] }\n | { type: \"add\"; components: string[] };\n\nexport async function generateRegistry(\n operation: RegistryOperation,\n isTs: boolean,\n registryPath: string,\n) {\n const project = isTs\n ? new Project({\n tsConfigFilePath: \"tsconfig.json\",\n })\n : new Project();\n\n const sourceFile = project.addSourceFileAtPath(registryPath);\n\n ensureLazyImport(sourceFile);\n\n const registry =\n sourceFile\n .getVariableDeclaration(\"registry\")\n ?.getInitializerIfKind(SyntaxKind.AsExpression)\n ?.getExpressionIfKind(SyntaxKind.ObjectLiteralExpression) ??\n sourceFile\n .getVariableDeclaration(\"registry\")\n ?.getInitializerIfKind(SyntaxKind.ObjectLiteralExpression);\n\n if (!registry) {\n throw new Error(\"Unable to locate registry object, have you ran skullmaster init??\");\n }\n\n const existingComponents = new Set(\n registry\n .getProperties()\n .filter((property) => property.getKind() === SyntaxKind.PropertyAssignment)\n .map((property) => property.asKindOrThrow(SyntaxKind.PropertyAssignment))\n .map((property) => property.getName().replace(/['\"]/g, \"\")),\n );\n\n for (let component of operation.components) {\n component = toPascalCase(component);\n\n if (existingComponents.has(component)) {\n continue;\n }\n\n registry.addPropertyAssignment({\n name: `\"${component}\"`,\n initializer: `lazy(() => import(\"./skeletons/${component}\"))`,\n });\n }\n\n if (isTs) {\n const declaration = sourceFile.getVariableDeclarationOrThrow(\"registry\");\n\n const initializer = declaration.getInitializer();\n\n if (initializer && !initializer.isKind(SyntaxKind.AsExpression)) {\n declaration.setInitializer(`${initializer.getText()} as const`);\n }\n }\n\n sourceFile.formatText();\n\n await sourceFile.save();\n\n project.saveSync();\n}\n","import { readFile, writeFile } from \"node:fs/promises\";\nimport z from \"zod\";\nimport fileExists from \"./is-file-exists\";\nimport { fnv1a } from \"../utils/fnv1a\";\nimport { SkeletonCacheEntrySchema } from \"../shared\";\n\nexport type CacheOperation =\n | { type: \"replace\"; cacheEntry: z.infer<typeof SkeletonCacheEntrySchema> }\n | { type: \"delete\"; componentName: string }\n | {\n type: \"update\";\n componentName: string;\n payload: z.infer<typeof SkeletonCacheEntrySchema>[string];\n };\n\nexport async function updateCacheRegistry(operation: CacheOperation, outDir: string) {\n const cacheFilePath = outDir;\n let cacheEntries: z.infer<typeof SkeletonCacheEntrySchema> = {};\n if (!(await fileExists(cacheFilePath))) {\n await writeFile(cacheFilePath, JSON.stringify({}), \"utf8\");\n } else {\n cacheEntries = SkeletonCacheEntrySchema.parse(\n JSON.parse(await readFile(cacheFilePath, \"utf8\")),\n );\n }\n switch (operation.type) {\n case \"replace\":\n await writeFile(cacheFilePath, JSON.stringify(operation.cacheEntry), \"utf8\");\n break;\n case \"delete\":\n delete cacheEntries[operation.componentName];\n await writeFile(cacheFilePath, JSON.stringify(cacheEntries), \"utf8\");\n break;\n case \"update\":\n cacheEntries[operation.componentName] = {\n ...operation.payload,\n hash: fnv1a(operation.payload.html).toString(),\n };\n await writeFile(cacheFilePath, JSON.stringify(cacheEntries), \"utf8\");\n }\n}\n","import { writeFile } from \"node:fs/promises\";\n\nexport default async function defaultBone(target: string) {\n await writeFile(\n target,\n `\n/* eslint-disable */\n/* oxlint-disable */\n/* biome-ignore-all lint */\n/* @ts-nocheck */\n\nimport type { HTMLProps } from \"react\";\n\n/**\n * Auto-generated by Skullmaster.\n *\n * This is the default fallback skeleton component displayed when a\n * matching skeleton implementation cannot be found in the registry.\n *\n * You may freely customize or replace this component to match the\n * loading experience of your application.\n */\ntype DefaultBoneProps = HTMLProps<HTMLDivElement>;\n\nexport default function DefaultBone(props: DefaultBoneProps) {\n return <div {...props}>loading...</div>;\n}\n`,\n \"utf8\",\n );\n}\n","import { mkdirSync, readdirSync, rmSync, writeFileSync } from \"node:fs\";\nimport fileExists from \"./is-file-exists\";\nimport { generateInitialRegistry, generateRegistry, type RegistryOperation } from \"./registry\";\nimport { updateCacheRegistry, type CacheOperation } from \"./cache-registry\";\nimport defaultBone from \"./default-bone\";\nimport { log } from \"../shared\";\n\nexport class Config {\n outDir: string;\n projectType: string;\n\n constructor(outDir: string, projectType: string) {\n this.outDir = outDir;\n this.projectType = projectType;\n }\n async initialize(forceReset?: boolean) {\n log.info(\"Initializing project structure...\");\n if (!(await fileExists(this.outDir))) {\n mkdirSync(this.outDir, { recursive: true });\n log.success(`Created output directory: ${this.outDir}`);\n } else {\n log.gray(`Output directory exists: ${this.outDir}`);\n }\n const skeletonsDirectoryPath = this.getSkeletonPath();\n if (!(await fileExists(skeletonsDirectoryPath))) {\n mkdirSync(skeletonsDirectoryPath, { recursive: true });\n log.success(`Created skeletons directory: ${skeletonsDirectoryPath}`);\n } else if (forceReset) {\n for (const file of readdirSync(skeletonsDirectoryPath)) {\n rmSync(`${skeletonsDirectoryPath}/${file}`, { recursive: true });\n }\n log.success(`Cleared skeletons directory: ${skeletonsDirectoryPath}`);\n } else {\n log.gray(`Skeletons directory exists: ${skeletonsDirectoryPath}`);\n }\n const registryFilePath = this.getRegistryPath();\n if (forceReset || !(await fileExists(registryFilePath))) {\n await generateInitialRegistry(this.outDir, this.projectType);\n log.success(`Created registry: ${registryFilePath}`);\n } else {\n log.gray(`Registry exists: ${registryFilePath}`);\n }\n const cachePath = this.getCachePath();\n if (forceReset || !(await fileExists(cachePath))) {\n writeFileSync(cachePath, JSON.stringify({}), \"utf8\");\n log.success(`Created cache: ${cachePath}`);\n } else {\n log.gray(`Cache exists: ${cachePath}`);\n }\n const defaultBonePath = this.getDefSkeletonPath();\n if (forceReset || !(await fileExists(defaultBonePath))) {\n await defaultBone(defaultBonePath);\n log.success(`Created default bone: ${defaultBonePath}`);\n } else {\n log.gray(`Default bone exists: ${defaultBonePath}`);\n }\n log.success(\"Initialization complete\");\n }\n async cache(op: CacheOperation) {\n return await updateCacheRegistry(op, this.getCachePath());\n }\n async registry(op: RegistryOperation) {\n return generateRegistry(op, this.projectType.endsWith(\"ts\"), this.getRegistryPath());\n }\n getCachePath() {\n return `${this.outDir}/cache.json`;\n }\n getSkeletonPath() {\n return `${this.outDir}/skeletons`;\n }\n getDefSkeletonPath() {\n return `${this.getSkeletonPath()}/DefaultBone.${this.getExt()}`;\n }\n getExt() {\n return this.projectType.endsWith(\"ts\") ? \"tsx\" : \"jsx\";\n }\n getRegistryPath() {\n return `${this.outDir}/registry.${this.getExt()}`;\n }\n configJson() {\n return { projectType: this.projectType, outDir: this.outDir };\n }\n}\n","#!/usr/bin/env node\n\nimport { cac } from \"cac\";\nimport { cancel, isCancel, confirm } from \"@clack/prompts\";\nimport { serveCommand } from \"./commands/serve\";\nimport collectPreferences from \"./init/collect-preferences\";\nimport { Config } from \"./init/preferences\";\nimport { DEFAULT_PORT, log } from \"./shared\";\n\nconst cli = cac(\"💀\");\n\ncli\n .command(\"serve\", \"Start 💀 dev server\")\n .option(\"--port <port>\", \"Port\", {\n default: DEFAULT_PORT,\n })\n .action(async (options) => {\n const preferences = await collectPreferences();\n const config = new Config(preferences.outDir, preferences.project);\n await config.initialize();\n await serveCommand(config, Number(options.port));\n });\n\ncli.command(\"reset\", \"Reset Skullmaster to its initial state\").action(async () => {\n const proceed = await confirm({\n message:\n \"This will wipe out all present generated skeletons and reset the registry. Are you sure?\",\n });\n\n if (isCancel(proceed) || !proceed) {\n cancel(\"Reset cancelled.\");\n process.exit(0);\n }\n\n const preferences = await collectPreferences();\n const config = new Config(preferences.outDir, preferences.project);\n await config.initialize(true);\n log.success(\"Reset complete\");\n});\n\ncli.help();\ncli.parse();\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,MAAa,eAAe;;;ACE5B,MAAa,6BAA6B,EAAE,OAC1C,EAAE,OAAO,GACT,EAAE,OAAO;CACP,WAAW,EAAE,OAAO;CACpB,MAAM,EAAE,OAAO;AACjB,CAAC,CACH;AAEA,MAAa,2BAA2B,EAAE,OACxC,EAAE,OAAO,GACT,EAAE,OAAO;CACP,WAAW,EAAE,OAAO;CACpB,MAAM,EAAE,OAAO;CACf,MAAM,EAAE,OAAO;AACjB,CAAC,CACH;;;ACjBA,MAAa,MAAM;CACjB,UAAU,YAAoB,QAAQ,IAA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M,SAAS,IAAI,OAAO,YAAY,QAAQ,YAAY,OAAO;CACjE,MAAM,OAAO,WAAW;CACxB,MAAM,aAAa,QAAQ,OAAO,QAAQ,IAAI,CAAC;AACjD,CAAC;AAEH,IAAI,QAAQ,SAAS,wCAAwC,CAAC,CAAC,OAAO,YAAY;CAChF,MAAM,UAAU,MAAM,QAAQ,EAC5B,SACE,2FACJ,CAAC;CAED,IAAI,SAAS,OAAO,KAAK,CAAC,SAAS;EACjC,OAAO,kBAAkB;EACzB,QAAQ,KAAK,CAAC;CAChB;CAEA,MAAM,cAAc,MAAM,mBAAmB;CAE7C,MAAM,IADa,OAAO,YAAY,QAAQ,YAAY,OAC/C,CAAC,CAAC,WAAW,IAAI;CAC5B,IAAI,QAAQ,gBAAgB;AAC9B,CAAC;AAED,IAAI,KAAK;AACT,IAAI,MAAM"}
package/package.json CHANGED
@@ -1,8 +1,7 @@
1
1
  {
2
2
  "name": "skullmaster",
3
- "version": "0.2.0-next.4",
3
+ "version": "0.2.0-next.6",
4
4
  "private": false,
5
- "description": "A simple example library built by tsdown",
6
5
  "homepage": "https://www.ajth.in/skullmaster/",
7
6
  "bugs": {
8
7
  "url": "https://github.com/ajth-in/skullmaster/issues"
@@ -19,8 +18,7 @@
19
18
  ],
20
19
  "type": "module",
21
20
  "exports": {
22
- ".": "./dist/index.mjs",
23
- "./cli": "./dist/cli.mjs",
21
+ ".": "./dist/cli.mjs",
24
22
  "./package.json": "./package.json"
25
23
  },
26
24
  "publishConfig": {
@@ -50,9 +48,9 @@
50
48
  "oxlint": "^1.0.0",
51
49
  "tsdown": "^0.22.0",
52
50
  "typescript": "^6.0.3",
53
- "@skullmaster/excarnate": "0.2.0-next.3",
54
- "@skullmaster/typescript-config": "0.0.0",
55
- "@skullmaster/oxlint-config": "0.0.0"
51
+ "@skullmaster/excarnate": "0.2.0-next.5",
52
+ "@skullmaster/oxlint-config": "0.0.0",
53
+ "@skullmaster/typescript-config": "0.0.0"
56
54
  },
57
55
  "scripts": {
58
56
  "build": "tsdown",
package/dist/index.d.mts DELETED
@@ -1,5 +0,0 @@
1
- //#region src/index.d.ts
2
- declare function fn(): string;
3
- //#endregion
4
- export { fn };
5
- //# sourceMappingURL=index.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";iBAAgB"}
package/dist/index.mjs DELETED
@@ -1,8 +0,0 @@
1
- //#region src/index.ts
2
- function fn() {
3
- return "Hello, tsdown!";
4
- }
5
- //#endregion
6
- export { fn };
7
-
8
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["export function fn() {\n return \"Hello, tsdown!\";\n}\n"],"mappings":";AAAA,SAAgB,KAAK;CACnB,OAAO;AACT"}