From 97414aaae2c1af945900eef45e751cd4d2ad6734 Mon Sep 17 00:00:00 2001 From: saberzero1 Date: Sat, 14 Mar 2026 22:02:17 +0100 Subject: [PATCH] chore: commit dist/ and remove prepare script Pre-built output is now committed to the repository so that Quartz can skip the build step during plugin installation. The prepare script is removed to prevent redundant builds when installing from npm/git. --- .gitignore | 1 - dist/components/index.js | 28 +++ dist/components/index.js.map | 1 + dist/index.js | 210 +++++++++++++++++++ dist/index.js.map | 1 + dist/types.js | 3 + dist/types.js.map | 1 + package-lock.json | 394 +++++------------------------------ package.json | 1 - 9 files changed, 299 insertions(+), 341 deletions(-) create mode 100644 dist/components/index.js create mode 100644 dist/components/index.js.map create mode 100644 dist/index.js create mode 100644 dist/index.js.map create mode 100644 dist/types.js create mode 100644 dist/types.js.map diff --git a/.gitignore b/.gitignore index 657842b..ef88793 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,6 @@ node_modules/ .pnp.js # Build output -dist/ build/ *.tsbuildinfo diff --git a/dist/components/index.js b/dist/components/index.js new file mode 100644 index 0000000..d693785 --- /dev/null +++ b/dist/components/index.js @@ -0,0 +1,28 @@ +import { jsx } from 'preact/jsx-runtime'; + +// src/util/lang.ts +function classNames(...classes) { + return classes.filter(Boolean).join(" "); +} + +// src/components/styles/example.scss +var example_default = ".example-component {\n padding: 8px 16px;\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n color: white;\n border-radius: 4px;\n font-weight: 600;\n display: inline-block;\n}"; + +// src/components/scripts/example.inline.ts +var example_inline_default = 'function c(){let e=window.location.pathname;return e.startsWith("/")&&(e=e.slice(1)),e.endsWith("/")&&(e=e.slice(0,-1)),e||"index"}function r(){let e=document.querySelectorAll(".example-component");if(e.length===0)return;let t=[];function o(n){(n.ctrlKey||n.metaKey)&&n.shiftKey&&n.key.toLowerCase()==="e"&&(n.preventDefault(),console.log("[ExampleComponent] Keyboard shortcut triggered!"))}document.addEventListener("keydown",o),t.push(()=>document.removeEventListener("keydown",o));for(let n of e){let i=()=>{console.log("[ExampleComponent] Clicked!")};n.addEventListener("click",i),t.push(()=>n.removeEventListener("click",i))}typeof window<"u"&&window.addCleanup&&window.addCleanup(()=>{t.forEach(n=>n())}),console.log("[ExampleComponent] Initialized with",e.length,"component(s)")}document.addEventListener("nav",e=>{let t=e.detail?.url||c();console.log("[ExampleComponent] Navigation to:",t),r()});document.addEventListener("render",()=>{console.log("[ExampleComponent] Render event - re-initializing"),r()});document.addEventListener("prenav",()=>{let e=document.querySelector(".example-component");e&&sessionStorage.setItem("exampleScrollTop",e.scrollTop?.toString()||"0")});\n'; +var ExampleComponent_default = ((opts) => { + const { prefix = "", suffix = "", className = "example-component" } = opts ?? {}; + const Component = (props) => { + const frontmatter = props.fileData?.frontmatter; + const title = frontmatter?.title ?? "Untitled"; + const fullText = `${prefix}${title}${suffix}`; + return /* @__PURE__ */ jsx("div", { class: classNames(className), children: fullText }); + }; + Component.css = example_default; + Component.afterDOMLoaded = example_inline_default; + return Component; +}); + +export { ExampleComponent_default as ExampleComponent }; +//# sourceMappingURL=index.js.map +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/components/index.js.map b/dist/components/index.js.map new file mode 100644 index 0000000..6e5507d --- /dev/null +++ b/dist/components/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/util/lang.ts","../../src/components/styles/example.scss","../../src/components/scripts/example.inline.ts","../../src/components/ExampleComponent.tsx"],"names":[],"mappings":";;;AAAO,SAAS,cAAc,OAAA,EAAwD;AACpF,EAAA,OAAO,OAAA,CAAQ,MAAA,CAAO,OAAO,CAAA,CAAE,KAAK,GAAG,CAAA;AACzC;;;ACFA,IAAA,eAAA,GAAA,wMAAA;;;ACAA,IAAA,sBAAA,GAAA,mqCAAA;ACgBA,IAAO,wBAAA,IAAS,CAAC,IAAA,KAAmC;AAClD,EAAA,MAAM,EAAE,SAAS,EAAA,EAAI,MAAA,GAAS,IAAI,SAAA,GAAY,mBAAA,EAAoB,GAAI,IAAA,IAAQ,EAAC;AAE/E,EAAA,MAAM,SAAA,GAA6B,CAAC,KAAA,KAAgC;AAClE,IAAA,MAAM,WAAA,GAAc,MAAM,QAAA,EAAU,WAAA;AACpC,IAAA,MAAM,KAAA,GAAQ,aAAa,KAAA,IAAS,UAAA;AACpC,IAAA,MAAM,WAAW,CAAA,EAAG,MAAM,CAAA,EAAG,KAAK,GAAG,MAAM,CAAA,CAAA;AAE3C,IAAA,2BAAQ,KAAA,EAAA,EAAI,KAAA,EAAO,UAAA,CAAW,SAAS,GAAI,QAAA,EAAA,QAAA,EAAS,CAAA;AAAA,EACtD,CAAA;AAEA,EAAA,SAAA,CAAU,GAAA,GAAM,eAAA;AAChB,EAAA,SAAA,CAAU,cAAA,GAAiB,sBAAA;AAE3B,EAAA,OAAO,SAAA;AACT,CAAA","file":"index.js","sourcesContent":["export function classNames(...classes: (string | undefined | null | false)[]): string {\n return classes.filter(Boolean).join(\" \");\n}\n",".example-component {\n padding: 8px 16px;\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n color: white;\n border-radius: 4px;\n font-weight: 600;\n display: inline-block;\n}","function c(){let e=window.location.pathname;return e.startsWith(\"/\")&&(e=e.slice(1)),e.endsWith(\"/\")&&(e=e.slice(0,-1)),e||\"index\"}function r(){let e=document.querySelectorAll(\".example-component\");if(e.length===0)return;let t=[];function o(n){(n.ctrlKey||n.metaKey)&&n.shiftKey&&n.key.toLowerCase()===\"e\"&&(n.preventDefault(),console.log(\"[ExampleComponent] Keyboard shortcut triggered!\"))}document.addEventListener(\"keydown\",o),t.push(()=>document.removeEventListener(\"keydown\",o));for(let n of e){let i=()=>{console.log(\"[ExampleComponent] Clicked!\")};n.addEventListener(\"click\",i),t.push(()=>n.removeEventListener(\"click\",i))}typeof window<\"u\"&&window.addCleanup&&window.addCleanup(()=>{t.forEach(n=>n())}),console.log(\"[ExampleComponent] Initialized with\",e.length,\"component(s)\")}document.addEventListener(\"nav\",e=>{let t=e.detail?.url||c();console.log(\"[ExampleComponent] Navigation to:\",t),r()});document.addEventListener(\"render\",()=>{console.log(\"[ExampleComponent] Render event - re-initializing\"),r()});document.addEventListener(\"prenav\",()=>{let e=document.querySelector(\".example-component\");e&&sessionStorage.setItem(\"exampleScrollTop\",e.scrollTop?.toString()||\"0\")});\n","import type {\n QuartzComponent,\n QuartzComponentProps,\n QuartzComponentConstructor,\n} from \"@quartz-community/types\";\nimport { classNames } from \"../util/lang\";\nimport style from \"./styles/example.scss\";\n// @ts-expect-error - inline script import handled by Quartz bundler\nimport script from \"./scripts/example.inline.ts\";\n\nexport interface ExampleComponentOptions {\n prefix?: string;\n suffix?: string;\n className?: string;\n}\n\nexport default ((opts?: ExampleComponentOptions) => {\n const { prefix = \"\", suffix = \"\", className = \"example-component\" } = opts ?? {};\n\n const Component: QuartzComponent = (props: QuartzComponentProps) => {\n const frontmatter = props.fileData?.frontmatter as { title?: string } | undefined;\n const title = frontmatter?.title ?? \"Untitled\";\n const fullText = `${prefix}${title}${suffix}`;\n\n return
{fullText}
;\n };\n\n Component.css = style;\n Component.afterDOMLoaded = script;\n\n return Component;\n}) satisfies QuartzComponentConstructor;\n"]} \ No newline at end of file diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 0000000..a9999f2 --- /dev/null +++ b/dist/index.js @@ -0,0 +1,210 @@ +import remarkGfm from 'remark-gfm'; +import rehypeSlug from 'rehype-slug'; +import { findAndReplace } from 'mdast-util-find-and-replace'; +import { visit } from 'unist-util-visit'; +import path from 'path'; +import fs from 'fs/promises'; +import { jsx } from 'preact/jsx-runtime'; + +// src/transformer.ts +var defaultOptions = { + highlightToken: "==", + headingClass: "example-plugin-heading", + enableGfm: true, + addHeadingSlugs: true +}; +var escapeRegExp = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); +var remarkHighlightToken = (token) => { + const escapedToken = escapeRegExp(token); + const pattern = new RegExp(`${escapedToken}([^ +]+?)${escapedToken}`, "g"); + return () => (tree, _file) => { + findAndReplace(tree, [ + [ + pattern, + (_match, value) => ({ + type: "strong", + children: [{ type: "text", value }] + }) + ] + ]); + }; +}; +var rehypeHeadingClass = (className) => { + return () => (tree, _file) => { + visit(tree, "element", (node) => { + if (!/^h[1-6]$/.test(node.tagName)) { + return; + } + const existing = node.properties?.className; + const classes = Array.isArray(existing) ? existing.filter((value) => typeof value === "string") : typeof existing === "string" ? [existing] : []; + node.properties = { + ...node.properties, + className: [...classes, className] + }; + }); + }; +}; +var ExampleTransformer = (userOptions) => { + const options = { ...defaultOptions, ...userOptions }; + return { + name: "ExampleTransformer", + textTransform(_ctx, src) { + return src.endsWith("\n") ? src : `${src} +`; + }, + markdownPlugins() { + const plugins = [remarkHighlightToken(options.highlightToken)]; + if (options.enableGfm) { + plugins.unshift(remarkGfm); + } + return plugins; + }, + htmlPlugins() { + const plugins = [rehypeHeadingClass(options.headingClass)]; + if (options.addHeadingSlugs) { + plugins.unshift(rehypeSlug); + } + return plugins; + }, + externalResources() { + return { + css: [ + { + content: `.${options.headingClass} { letter-spacing: 0.02em; }`, + inline: true + } + ], + js: [ + { + contentType: "inline", + loadTime: "afterDOMReady", + script: "document.documentElement.dataset.exampleTransformer = 'true'" + } + ], + additionalHead: [] + }; + } + }; +}; + +// src/filter.ts +var defaultOptions2 = { + allowDrafts: false, + excludeTags: ["private"], + excludePathPrefixes: ["_drafts/", "_private/"] +}; +var normalizeTag = (tag) => typeof tag === "string" ? tag.trim().toLowerCase() : ""; +var includesTag = (tags, excludedTags) => { + if (!Array.isArray(tags)) { + return false; + } + const normalizedExcluded = excludedTags.map((tag) => tag.toLowerCase()); + return tags.some((tag) => normalizedExcluded.includes(normalizeTag(tag))); +}; +var ExampleFilter = (userOptions) => { + const options = { ...defaultOptions2, ...userOptions }; + return { + name: "ExampleFilter", + shouldPublish(_ctx, [_tree, vfile]) { + const frontmatter = vfile.data?.frontmatter ?? {}; + const isDraft = frontmatter.draft === true || frontmatter.draft === "true"; + if (isDraft && !options.allowDrafts) { + return false; + } + if (includesTag(frontmatter.tags, options.excludeTags)) { + return false; + } + const filePath = typeof vfile.data?.filePath === "string" ? vfile.data.filePath : ""; + const normalizedPath = filePath.replace(/\\/g, "/"); + if (options.excludePathPrefixes.some((prefix) => normalizedPath.startsWith(prefix))) { + return false; + } + return true; + } + }; +}; +var defaultOptions3 = { + manifestSlug: "plugin-manifest", + includeFrontmatter: true, + metadata: { + generator: "Quartz Plugin Template" + } +}; +var joinSegments = (...segments) => segments.filter((segment) => segment.length > 0).join("/").replace(/\/+/g, "/"); +var writeFile = async (outputDir, slug, ext, content) => { + const outputPath = joinSegments(outputDir, `${slug}${ext}`); + await fs.mkdir(path.dirname(outputPath), { recursive: true }); + await fs.writeFile(outputPath, content); + return outputPath; +}; +var ExampleEmitter = (userOptions) => { + const options = { ...defaultOptions3, ...userOptions }; + const emitManifest = async (ctx, content) => { + const manifest = { + ...options.metadata, + generatedAt: (/* @__PURE__ */ new Date()).toISOString(), + pages: content.map(([_tree, vfile]) => { + const frontmatter = vfile.data?.frontmatter ?? {}; + return { + slug: vfile.data?.slug ?? null, + title: frontmatter.title ?? null, + tags: frontmatter.tags ?? null, + filePath: vfile.data?.filePath ?? null, + frontmatter: options.includeFrontmatter ? frontmatter : void 0 + }; + }) + }; + let json = `${JSON.stringify(manifest, null, 2)} +`; + if (options.transformManifest) { + json = options.transformManifest(json); + } + const output = await writeFile( + ctx.argv.output, + options.manifestSlug, + ".json", + json + ); + return [output]; + }; + return { + name: "ExampleEmitter", + async emit(ctx, content, _resources) { + return emitManifest(ctx, content); + }, + async *partialEmit(ctx, content, _resources, _changeEvents) { + const outputPaths = await emitManifest(ctx, content); + for (const outputPath of outputPaths) { + yield outputPath; + } + } + }; +}; + +// src/util/lang.ts +function classNames(...classes) { + return classes.filter(Boolean).join(" "); +} + +// src/components/styles/example.scss +var example_default = ".example-component {\n padding: 8px 16px;\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n color: white;\n border-radius: 4px;\n font-weight: 600;\n display: inline-block;\n}"; + +// src/components/scripts/example.inline.ts +var example_inline_default = 'function c(){let e=window.location.pathname;return e.startsWith("/")&&(e=e.slice(1)),e.endsWith("/")&&(e=e.slice(0,-1)),e||"index"}function r(){let e=document.querySelectorAll(".example-component");if(e.length===0)return;let t=[];function o(n){(n.ctrlKey||n.metaKey)&&n.shiftKey&&n.key.toLowerCase()==="e"&&(n.preventDefault(),console.log("[ExampleComponent] Keyboard shortcut triggered!"))}document.addEventListener("keydown",o),t.push(()=>document.removeEventListener("keydown",o));for(let n of e){let i=()=>{console.log("[ExampleComponent] Clicked!")};n.addEventListener("click",i),t.push(()=>n.removeEventListener("click",i))}typeof window<"u"&&window.addCleanup&&window.addCleanup(()=>{t.forEach(n=>n())}),console.log("[ExampleComponent] Initialized with",e.length,"component(s)")}document.addEventListener("nav",e=>{let t=e.detail?.url||c();console.log("[ExampleComponent] Navigation to:",t),r()});document.addEventListener("render",()=>{console.log("[ExampleComponent] Render event - re-initializing"),r()});document.addEventListener("prenav",()=>{let e=document.querySelector(".example-component");e&&sessionStorage.setItem("exampleScrollTop",e.scrollTop?.toString()||"0")});\n'; +var ExampleComponent_default = ((opts) => { + const { prefix = "", suffix = "", className = "example-component" } = opts ?? {}; + const Component = (props) => { + const frontmatter = props.fileData?.frontmatter; + const title = frontmatter?.title ?? "Untitled"; + const fullText = `${prefix}${title}${suffix}`; + return /* @__PURE__ */ jsx("div", { class: classNames(className), children: fullText }); + }; + Component.css = example_default; + Component.afterDOMLoaded = example_inline_default; + return Component; +}); + +export { ExampleComponent_default as ExampleComponent, ExampleEmitter, ExampleFilter, ExampleTransformer }; +//# sourceMappingURL=index.js.map +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/index.js.map b/dist/index.js.map new file mode 100644 index 0000000..3188573 --- /dev/null +++ b/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/transformer.ts","../src/filter.ts","../src/emitter.ts","../src/util/lang.ts","../src/components/styles/example.scss","../src/components/scripts/example.inline.ts","../src/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I,KAAA,EAAO,UAAA,CAAW,SAAS,GAAI,QAAA,EAAA,QAAA,EAAS,CAAA;AAAA,EACtD,CAAA;AAEA,EAAA,SAAA,CAAU,GAAA,GAAM,eAAA;AAChB,EAAA,SAAA,CAAU,cAAA,GAAiB,sBAAA;AAE3B,EAAA,OAAO,SAAA;AACT,CAAA","file":"index.js","sourcesContent":["import type { PluggableList, Plugin } from \"unified\";\nimport type { Root as MdastRoot } from \"mdast\";\nimport type { Root as HastRoot, Element } from \"hast\";\nimport type { VFile } from \"vfile\";\nimport remarkGfm from \"remark-gfm\";\nimport rehypeSlug from \"rehype-slug\";\nimport { findAndReplace } from \"mdast-util-find-and-replace\";\nimport { visit } from \"unist-util-visit\";\nimport type { QuartzTransformerPlugin, BuildCtx } from \"@quartz-community/types\";\nimport type { ExampleTransformerOptions } from \"./types\";\n\nconst defaultOptions: ExampleTransformerOptions = {\n highlightToken: \"==\",\n headingClass: \"example-plugin-heading\",\n enableGfm: true,\n addHeadingSlugs: true,\n};\n\nconst escapeRegExp = (value: string) => value.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n\nconst remarkHighlightToken = (token: string): Plugin<[], MdastRoot> => {\n const escapedToken = escapeRegExp(token);\n const pattern = new RegExp(`${escapedToken}([^\\n]+?)${escapedToken}`, \"g\");\n return () => (tree: MdastRoot, _file: VFile) => {\n findAndReplace(tree, [\n [\n pattern,\n (_match: string, value: string) => ({\n type: \"strong\",\n children: [{ type: \"text\", value }],\n }),\n ],\n ]);\n };\n};\n\nconst rehypeHeadingClass = (className: string): Plugin<[], HastRoot> => {\n return () => (tree: HastRoot, _file: VFile) => {\n visit(tree, \"element\", (node: Element) => {\n if (!/^h[1-6]$/.test(node.tagName)) {\n return;\n }\n\n const existing = node.properties?.className;\n const classes: string[] = Array.isArray(existing)\n ? existing.filter((value): value is string => typeof value === \"string\")\n : typeof existing === \"string\"\n ? [existing]\n : [];\n node.properties = {\n ...node.properties,\n className: [...classes, className],\n };\n });\n };\n};\n\n/**\n * Example transformer showing remark/rehype usage and resource injection.\n */\nexport const ExampleTransformer: QuartzTransformerPlugin> = (\n userOptions?: Partial,\n) => {\n const options = { ...defaultOptions, ...userOptions };\n return {\n name: \"ExampleTransformer\",\n textTransform(_ctx: BuildCtx, src: string) {\n return src.endsWith(\"\\n\") ? src : `${src}\\n`;\n },\n markdownPlugins(): PluggableList {\n const plugins: PluggableList = [remarkHighlightToken(options.highlightToken)];\n if (options.enableGfm) {\n plugins.unshift(remarkGfm);\n }\n return plugins;\n },\n htmlPlugins(): PluggableList {\n const plugins: PluggableList = [rehypeHeadingClass(options.headingClass)];\n if (options.addHeadingSlugs) {\n plugins.unshift(rehypeSlug);\n }\n return plugins;\n },\n externalResources() {\n return {\n css: [\n {\n content: `.${options.headingClass} { letter-spacing: 0.02em; }`,\n inline: true,\n },\n ],\n js: [\n {\n contentType: \"inline\",\n loadTime: \"afterDOMReady\",\n script: \"document.documentElement.dataset.exampleTransformer = 'true'\",\n },\n ],\n additionalHead: [],\n };\n },\n };\n};\n","import type { QuartzFilterPlugin, ProcessedContent, BuildCtx } from \"@quartz-community/types\";\nimport type { ExampleFilterOptions } from \"./types\";\n\nconst defaultOptions: ExampleFilterOptions = {\n allowDrafts: false,\n excludeTags: [\"private\"],\n excludePathPrefixes: [\"_drafts/\", \"_private/\"],\n};\n\nconst normalizeTag = (tag: unknown) => (typeof tag === \"string\" ? tag.trim().toLowerCase() : \"\");\n\nconst includesTag = (tags: unknown, excludedTags: string[]) => {\n if (!Array.isArray(tags)) {\n return false;\n }\n\n const normalizedExcluded = excludedTags.map((tag) => tag.toLowerCase());\n return tags.some((tag) => normalizedExcluded.includes(normalizeTag(tag)));\n};\n\n/**\n * Example filter that removes drafts, tagged pages, and excluded path prefixes.\n */\nexport const ExampleFilter: QuartzFilterPlugin> = (\n userOptions?: Partial,\n) => {\n const options = { ...defaultOptions, ...userOptions };\n return {\n name: \"ExampleFilter\",\n shouldPublish(_ctx: BuildCtx, [_tree, vfile]: ProcessedContent) {\n const frontmatter = (vfile.data?.frontmatter ?? {}) as {\n draft?: boolean | string;\n tags?: string[];\n };\n const isDraft = frontmatter.draft === true || frontmatter.draft === \"true\";\n if (isDraft && !options.allowDrafts) {\n return false;\n }\n\n if (includesTag(frontmatter.tags, options.excludeTags)) {\n return false;\n }\n\n const filePath = typeof vfile.data?.filePath === \"string\" ? vfile.data.filePath : \"\";\n const normalizedPath = filePath.replace(/\\\\/g, \"/\");\n if (options.excludePathPrefixes.some((prefix) => normalizedPath.startsWith(prefix))) {\n return false;\n }\n\n return true;\n },\n };\n};\n","import path from \"node:path\";\nimport fs from \"node:fs/promises\";\nimport type {\n QuartzEmitterPlugin,\n ProcessedContent,\n BuildCtx,\n FilePath,\n FullSlug,\n} from \"@quartz-community/types\";\nimport type { ExampleEmitterOptions } from \"./types\";\n\nconst defaultOptions: ExampleEmitterOptions = {\n manifestSlug: \"plugin-manifest\",\n includeFrontmatter: true,\n metadata: {\n generator: \"Quartz Plugin Template\",\n },\n};\n\nconst joinSegments = (...segments: string[]) =>\n segments\n .filter((segment) => segment.length > 0)\n .join(\"/\")\n .replace(/\\/+/g, \"/\") as FilePath;\n\nconst writeFile = async (\n outputDir: string,\n slug: FullSlug,\n ext: `.${string}` | \"\",\n content: string,\n) => {\n const outputPath = joinSegments(outputDir, `${slug}${ext}`) as FilePath;\n await fs.mkdir(path.dirname(outputPath), { recursive: true });\n await fs.writeFile(outputPath, content);\n return outputPath;\n};\n\n/**\n * Example emitter that writes a JSON manifest of content metadata.\n */\nexport const ExampleEmitter: QuartzEmitterPlugin> = (\n userOptions?: Partial,\n) => {\n const options = { ...defaultOptions, ...userOptions };\n const emitManifest = async (ctx: BuildCtx, content: ProcessedContent[]) => {\n const manifest = {\n ...options.metadata,\n generatedAt: new Date().toISOString(),\n pages: content.map(([_tree, vfile]) => {\n const frontmatter = (vfile.data?.frontmatter ?? {}) as {\n title?: string;\n tags?: string[];\n [key: string]: unknown;\n };\n return {\n slug: vfile.data?.slug ?? null,\n title: frontmatter.title ?? null,\n tags: frontmatter.tags ?? null,\n filePath: vfile.data?.filePath ?? null,\n frontmatter: options.includeFrontmatter ? frontmatter : undefined,\n };\n }),\n };\n\n let json = `${JSON.stringify(manifest, null, 2)}\\n`;\n if (options.transformManifest) {\n json = options.transformManifest(json);\n }\n\n const output = await writeFile(\n ctx.argv.output,\n options.manifestSlug as FullSlug,\n \".json\",\n json,\n );\n return [output];\n };\n\n return {\n name: \"ExampleEmitter\",\n async emit(ctx, content, _resources) {\n return emitManifest(ctx, content);\n },\n async *partialEmit(ctx, content, _resources, _changeEvents) {\n const outputPaths = await emitManifest(ctx, content);\n for (const outputPath of outputPaths) {\n yield outputPath;\n }\n },\n };\n};\n","export function classNames(...classes: (string | undefined | null | false)[]): string {\n return classes.filter(Boolean).join(\" \");\n}\n",".example-component {\n padding: 8px 16px;\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n color: white;\n border-radius: 4px;\n font-weight: 600;\n display: inline-block;\n}","function c(){let e=window.location.pathname;return e.startsWith(\"/\")&&(e=e.slice(1)),e.endsWith(\"/\")&&(e=e.slice(0,-1)),e||\"index\"}function r(){let e=document.querySelectorAll(\".example-component\");if(e.length===0)return;let t=[];function o(n){(n.ctrlKey||n.metaKey)&&n.shiftKey&&n.key.toLowerCase()===\"e\"&&(n.preventDefault(),console.log(\"[ExampleComponent] Keyboard shortcut triggered!\"))}document.addEventListener(\"keydown\",o),t.push(()=>document.removeEventListener(\"keydown\",o));for(let n of e){let i=()=>{console.log(\"[ExampleComponent] Clicked!\")};n.addEventListener(\"click\",i),t.push(()=>n.removeEventListener(\"click\",i))}typeof window<\"u\"&&window.addCleanup&&window.addCleanup(()=>{t.forEach(n=>n())}),console.log(\"[ExampleComponent] Initialized with\",e.length,\"component(s)\")}document.addEventListener(\"nav\",e=>{let t=e.detail?.url||c();console.log(\"[ExampleComponent] Navigation to:\",t),r()});document.addEventListener(\"render\",()=>{console.log(\"[ExampleComponent] Render event - re-initializing\"),r()});document.addEventListener(\"prenav\",()=>{let e=document.querySelector(\".example-component\");e&&sessionStorage.setItem(\"exampleScrollTop\",e.scrollTop?.toString()||\"0\")});\n","import type {\n QuartzComponent,\n QuartzComponentProps,\n QuartzComponentConstructor,\n} from \"@quartz-community/types\";\nimport { classNames } from \"../util/lang\";\nimport style from \"./styles/example.scss\";\n// @ts-expect-error - inline script import handled by Quartz bundler\nimport script from \"./scripts/example.inline.ts\";\n\nexport interface ExampleComponentOptions {\n prefix?: string;\n suffix?: string;\n className?: string;\n}\n\nexport default ((opts?: ExampleComponentOptions) => {\n const { prefix = \"\", suffix = \"\", className = \"example-component\" } = opts ?? {};\n\n const Component: QuartzComponent = (props: QuartzComponentProps) => {\n const frontmatter = props.fileData?.frontmatter as { title?: string } | undefined;\n const title = frontmatter?.title ?? \"Untitled\";\n const fullText = `${prefix}${title}${suffix}`;\n\n return
{fullText}
;\n };\n\n Component.css = style;\n Component.afterDOMLoaded = script;\n\n return Component;\n}) satisfies QuartzComponentConstructor;\n"]} \ No newline at end of file diff --git a/dist/types.js b/dist/types.js new file mode 100644 index 0000000..6bd95cc --- /dev/null +++ b/dist/types.js @@ -0,0 +1,3 @@ + +//# sourceMappingURL=types.js.map +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/dist/types.js.map b/dist/types.js.map new file mode 100644 index 0000000..efc9e48 --- /dev/null +++ b/dist/types.js.map @@ -0,0 +1 @@ +{"version":3,"sources":[],"names":[],"mappings":"","file":"types.js"} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 7f98115..45b5617 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,16 +10,7 @@ "license": "MIT", "dependencies": { "@quartz-community/types": "github:quartz-community/types", - "mdast-util-find-and-replace": "^3.0.1", - "rehype-slug": "^6.0.0", - "remark-gfm": "^4.0.1", - "remark-parse": "^11.0.0", - "remark-stringify": "^11.0.0", - "tsup": "^8.5.0", - "typescript": "^5.9.3", - "unified": "^11.0.5", - "unist-util-visit": "^5.0.0", - "vfile": "^6.0.3" + "remark-stringify": "^11.0.0" }, "devDependencies": { "@types/hast": "^3.0.4", @@ -32,6 +23,8 @@ "preact": "^10.28.2", "prettier": "^3.6.2", "sass": "^1.97.3", + "tsup": "^8.5.0", + "typescript": "^5.9.3", "vitest": "^2.1.9" }, "engines": { @@ -40,14 +33,42 @@ }, "peerDependencies": { "@jackyzha0/quartz": "^4.5.2", - "preact": "^10.0.0" + "mdast-util-find-and-replace": "^3.0.1", + "preact": "^10.0.0", + "rehype-slug": "^6.0.0", + "remark-gfm": "^4.0.1", + "remark-parse": "^11.0.0", + "unified": "^11.0.5", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.3" }, "peerDependenciesMeta": { "@jackyzha0/quartz": { "optional": true }, + "mdast-util-find-and-replace": { + "optional": true + }, "preact": { "optional": false + }, + "rehype-slug": { + "optional": true + }, + "remark-gfm": { + "optional": true + }, + "remark-parse": { + "optional": true + }, + "unified": { + "optional": true + }, + "unist-util-visit": { + "optional": true + }, + "vfile": { + "optional": true } } }, @@ -1360,6 +1381,7 @@ "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", "integrity": "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==", "license": "MIT", + "optional": true, "dependencies": { "@types/ms": "*" } @@ -1392,7 +1414,8 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz", "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==", - "license": "MIT" + "license": "MIT", + "optional": true }, "node_modules/@types/node": { "version": "24.10.13", @@ -1912,16 +1935,6 @@ "node": ">=6" } }, - "node_modules/ccount": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz", - "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==", - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, "node_modules/chai": { "version": "5.3.3", "resolved": "https://registry.npmjs.org/chai/-/chai-5.3.3.tgz", @@ -2598,12 +2611,6 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, - "node_modules/github-slugger": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/github-slugger/-/github-slugger-2.0.0.tgz", - "integrity": "sha512-IaOQ9puYtjrkq7Y0Ygl9KDZnrf/aiUJYUpVf89y8kyaxbRG7Y1SrX/jaumrv81vc61+kiMempujsM3Yw7w5qcw==", - "license": "ISC" - }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -2717,32 +2724,6 @@ "node": ">=8" } }, - "node_modules/hast-util-heading-rank": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/hast-util-heading-rank/-/hast-util-heading-rank-3.0.0.tgz", - "integrity": "sha512-EJKb8oMUXVHcWZTDepnr+WNbfnXKFNf9duMesmr4S8SXTJBJ9M4Yok08pu9vxdJwdlGRhVumk9mEhkEvKGifwA==", - "license": "MIT", - "dependencies": { - "@types/hast": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/hast-util-to-string": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/hast-util-to-string/-/hast-util-to-string-3.0.1.tgz", - "integrity": "sha512-XelQVTDWvqcl3axRfI0xSeoVKzyIFPwsAGSLIsKdJKQMXDYJS4WYrBNF/8J7RdhIcFI2BOHgAifggsvsxp/3+A==", - "license": "MIT", - "dependencies": { - "@types/hast": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, "node_modules/ignore": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", @@ -3011,21 +2992,12 @@ "@jridgewell/sourcemap-codec": "^1.5.5" } }, - "node_modules/markdown-table": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-3.0.4.tgz", - "integrity": "sha512-wiYz4+JrLyb/DqW2hkFJxP7Vd7JuTDm77fvbM8VfEQdmSMqcImWeeRbHwZjBjIFki/VaMK2BhFi7oUUZeM5bqw==", - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, "node_modules/mdast-util-find-and-replace": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-3.0.2.tgz", "integrity": "sha512-Tmd1Vg/m3Xz43afeNxDIhWRtFZgM2VLyaf4vSTYwudTyeuTneoL3qtWMA5jeLyz/O1vDJmmV4QuScFCA2tBPwg==", "license": "MIT", + "optional": true, "dependencies": { "@types/mdast": "^4.0.0", "escape-string-regexp": "^5.0.0", @@ -3042,6 +3014,7 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", "license": "MIT", + "optional": true, "engines": { "node": ">=12" }, @@ -3054,6 +3027,7 @@ "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.2.tgz", "integrity": "sha512-uZhTV/8NBuw0WHkPTrCqDOl0zVe1BIng5ZtHoDk49ME1qqcjYmmLmOf0gELgcRMxN4w2iuIeVso5/6QymSrgmA==", "license": "MIT", + "optional": true, "dependencies": { "@types/mdast": "^4.0.0", "@types/unist": "^3.0.0", @@ -3073,107 +3047,6 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/mdast-util-gfm": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-3.1.0.tgz", - "integrity": "sha512-0ulfdQOM3ysHhCJ1p06l0b0VKlhU0wuQs3thxZQagjcjPrlFRqY215uZGHHJan9GEAXd9MbfPjFJz+qMkVR6zQ==", - "license": "MIT", - "dependencies": { - "mdast-util-from-markdown": "^2.0.0", - "mdast-util-gfm-autolink-literal": "^2.0.0", - "mdast-util-gfm-footnote": "^2.0.0", - "mdast-util-gfm-strikethrough": "^2.0.0", - "mdast-util-gfm-table": "^2.0.0", - "mdast-util-gfm-task-list-item": "^2.0.0", - "mdast-util-to-markdown": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-gfm-autolink-literal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-2.0.1.tgz", - "integrity": "sha512-5HVP2MKaP6L+G6YaxPNjuL0BPrq9orG3TsrZ9YXbA3vDw/ACI4MEsnoDpn6ZNm7GnZgtAcONJyPhOP8tNJQavQ==", - "license": "MIT", - "dependencies": { - "@types/mdast": "^4.0.0", - "ccount": "^2.0.0", - "devlop": "^1.0.0", - "mdast-util-find-and-replace": "^3.0.0", - "micromark-util-character": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-gfm-footnote": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-footnote/-/mdast-util-gfm-footnote-2.1.0.tgz", - "integrity": "sha512-sqpDWlsHn7Ac9GNZQMeUzPQSMzR6Wv0WKRNvQRg0KqHh02fpTz69Qc1QSseNX29bhz1ROIyNyxExfawVKTm1GQ==", - "license": "MIT", - "dependencies": { - "@types/mdast": "^4.0.0", - "devlop": "^1.1.0", - "mdast-util-from-markdown": "^2.0.0", - "mdast-util-to-markdown": "^2.0.0", - "micromark-util-normalize-identifier": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-gfm-strikethrough": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-2.0.0.tgz", - "integrity": "sha512-mKKb915TF+OC5ptj5bJ7WFRPdYtuHv0yTRxK2tJvi+BDqbkiG7h7u/9SI89nRAYcmap2xHQL9D+QG/6wSrTtXg==", - "license": "MIT", - "dependencies": { - "@types/mdast": "^4.0.0", - "mdast-util-from-markdown": "^2.0.0", - "mdast-util-to-markdown": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-gfm-table": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-table/-/mdast-util-gfm-table-2.0.0.tgz", - "integrity": "sha512-78UEvebzz/rJIxLvE7ZtDd/vIQ0RHv+3Mh5DR96p7cS7HsBhYIICDBCu8csTNWNO6tBWfqXPWekRuj2FNOGOZg==", - "license": "MIT", - "dependencies": { - "@types/mdast": "^4.0.0", - "devlop": "^1.0.0", - "markdown-table": "^3.0.0", - "mdast-util-from-markdown": "^2.0.0", - "mdast-util-to-markdown": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-gfm-task-list-item": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-2.0.0.tgz", - "integrity": "sha512-IrtvNvjxC1o06taBAVJznEnkiHxLFTzgonUdy8hzFVeDun0uTjxxrRGVaNFqkU1wJR3RBPEfsxmU6jDWPofrTQ==", - "license": "MIT", - "dependencies": { - "@types/mdast": "^4.0.0", - "devlop": "^1.0.0", - "mdast-util-from-markdown": "^2.0.0", - "mdast-util-to-markdown": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, "node_modules/mdast-util-phrasing": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-4.1.0.tgz", @@ -3247,6 +3120,7 @@ } ], "license": "MIT", + "optional": true, "dependencies": { "@types/debug": "^4.0.0", "debug": "^4.0.0", @@ -3282,6 +3156,7 @@ } ], "license": "MIT", + "optional": true, "dependencies": { "decode-named-character-reference": "^1.0.0", "devlop": "^1.0.0", @@ -3301,127 +3176,6 @@ "micromark-util-types": "^2.0.0" } }, - "node_modules/micromark-extension-gfm": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-3.0.0.tgz", - "integrity": "sha512-vsKArQsicm7t0z2GugkCKtZehqUm31oeGBV/KVSorWSy8ZlNAv7ytjFhvaryUiCUJYqs+NoE6AFhpQvBTM6Q4w==", - "license": "MIT", - "dependencies": { - "micromark-extension-gfm-autolink-literal": "^2.0.0", - "micromark-extension-gfm-footnote": "^2.0.0", - "micromark-extension-gfm-strikethrough": "^2.0.0", - "micromark-extension-gfm-table": "^2.0.0", - "micromark-extension-gfm-tagfilter": "^2.0.0", - "micromark-extension-gfm-task-list-item": "^2.0.0", - "micromark-util-combine-extensions": "^2.0.0", - "micromark-util-types": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/micromark-extension-gfm-autolink-literal": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-2.1.0.tgz", - "integrity": "sha512-oOg7knzhicgQ3t4QCjCWgTmfNhvQbDDnJeVu9v81r7NltNCVmhPy1fJRX27pISafdjL+SVc4d3l48Gb6pbRypw==", - "license": "MIT", - "dependencies": { - "micromark-util-character": "^2.0.0", - "micromark-util-sanitize-uri": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/micromark-extension-gfm-footnote": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-2.1.0.tgz", - "integrity": "sha512-/yPhxI1ntnDNsiHtzLKYnE3vf9JZ6cAisqVDauhp4CEHxlb4uoOTxOCJ+9s51bIB8U1N1FJ1RXOKTIlD5B/gqw==", - "license": "MIT", - "dependencies": { - "devlop": "^1.0.0", - "micromark-core-commonmark": "^2.0.0", - "micromark-factory-space": "^2.0.0", - "micromark-util-character": "^2.0.0", - "micromark-util-normalize-identifier": "^2.0.0", - "micromark-util-sanitize-uri": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/micromark-extension-gfm-strikethrough": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-2.1.0.tgz", - "integrity": "sha512-ADVjpOOkjz1hhkZLlBiYA9cR2Anf8F4HqZUO6e5eDcPQd0Txw5fxLzzxnEkSkfnD0wziSGiv7sYhk/ktvbf1uw==", - "license": "MIT", - "dependencies": { - "devlop": "^1.0.0", - "micromark-util-chunked": "^2.0.0", - "micromark-util-classify-character": "^2.0.0", - "micromark-util-resolve-all": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/micromark-extension-gfm-table": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-2.1.1.tgz", - "integrity": "sha512-t2OU/dXXioARrC6yWfJ4hqB7rct14e8f7m0cbI5hUmDyyIlwv5vEtooptH8INkbLzOatzKuVbQmAYcbWoyz6Dg==", - "license": "MIT", - "dependencies": { - "devlop": "^1.0.0", - "micromark-factory-space": "^2.0.0", - "micromark-util-character": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/micromark-extension-gfm-tagfilter": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-2.0.0.tgz", - "integrity": "sha512-xHlTOmuCSotIA8TW1mDIM6X2O1SiX5P9IuDtqGonFhEK0qgRI4yeC6vMxEV2dgyr2TiD+2PQ10o+cOhdVAcwfg==", - "license": "MIT", - "dependencies": { - "micromark-util-types": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/micromark-extension-gfm-task-list-item": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-2.1.0.tgz", - "integrity": "sha512-qIBZhqxqI6fjLDYFTBIa4eivDMnP+OZqsNwmQ3xNLE4Cxwc+zfQEfbs6tzAo2Hjq+bh6q5F+Z8/cksrLFYWQQw==", - "license": "MIT", - "dependencies": { - "devlop": "^1.0.0", - "micromark-factory-space": "^2.0.0", - "micromark-util-character": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, "node_modules/micromark-factory-destination": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-2.0.1.tgz", @@ -3437,6 +3191,7 @@ } ], "license": "MIT", + "optional": true, "dependencies": { "micromark-util-character": "^2.0.0", "micromark-util-symbol": "^2.0.0", @@ -3458,6 +3213,7 @@ } ], "license": "MIT", + "optional": true, "dependencies": { "devlop": "^1.0.0", "micromark-util-character": "^2.0.0", @@ -3480,6 +3236,7 @@ } ], "license": "MIT", + "optional": true, "dependencies": { "micromark-util-character": "^2.0.0", "micromark-util-types": "^2.0.0" @@ -3500,6 +3257,7 @@ } ], "license": "MIT", + "optional": true, "dependencies": { "micromark-factory-space": "^2.0.0", "micromark-util-character": "^2.0.0", @@ -3522,6 +3280,7 @@ } ], "license": "MIT", + "optional": true, "dependencies": { "micromark-factory-space": "^2.0.0", "micromark-util-character": "^2.0.0", @@ -3564,6 +3323,7 @@ } ], "license": "MIT", + "optional": true, "dependencies": { "micromark-util-symbol": "^2.0.0" } @@ -3604,6 +3364,7 @@ } ], "license": "MIT", + "optional": true, "dependencies": { "micromark-util-chunked": "^2.0.0", "micromark-util-types": "^2.0.0" @@ -3664,7 +3425,8 @@ "url": "https://opencollective.com/unified" } ], - "license": "MIT" + "license": "MIT", + "optional": true }, "node_modules/micromark-util-html-tag-name": { "version": "2.0.1", @@ -3680,7 +3442,8 @@ "url": "https://opencollective.com/unified" } ], - "license": "MIT" + "license": "MIT", + "optional": true }, "node_modules/micromark-util-normalize-identifier": { "version": "2.0.1", @@ -3697,6 +3460,7 @@ } ], "license": "MIT", + "optional": true, "dependencies": { "micromark-util-symbol": "^2.0.0" } @@ -3716,6 +3480,7 @@ } ], "license": "MIT", + "optional": true, "dependencies": { "micromark-util-types": "^2.0.0" } @@ -3735,6 +3500,7 @@ } ], "license": "MIT", + "optional": true, "dependencies": { "micromark-util-character": "^2.0.0", "micromark-util-encode": "^2.0.0", @@ -3756,6 +3522,7 @@ } ], "license": "MIT", + "optional": true, "dependencies": { "devlop": "^1.0.0", "micromark-util-chunked": "^2.0.0", @@ -4218,57 +3985,6 @@ "url": "https://paulmillr.com/funding/" } }, - "node_modules/rehype-slug": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/rehype-slug/-/rehype-slug-6.0.0.tgz", - "integrity": "sha512-lWyvf/jwu+oS5+hL5eClVd3hNdmwM1kAC0BUvEGD19pajQMIzcNUd/k9GsfQ+FfECvX+JE+e9/btsKH0EjJT6A==", - "license": "MIT", - "dependencies": { - "@types/hast": "^3.0.0", - "github-slugger": "^2.0.0", - "hast-util-heading-rank": "^3.0.0", - "hast-util-to-string": "^3.0.0", - "unist-util-visit": "^5.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-gfm": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/remark-gfm/-/remark-gfm-4.0.1.tgz", - "integrity": "sha512-1quofZ2RQ9EWdeN34S79+KExV1764+wCUGop5CPL1WGdD0ocPpu91lzPGbwWMECpEpd42kJGQwzRfyov9j4yNg==", - "license": "MIT", - "dependencies": { - "@types/mdast": "^4.0.0", - "mdast-util-gfm": "^3.0.0", - "micromark-extension-gfm": "^3.0.0", - "remark-parse": "^11.0.0", - "remark-stringify": "^11.0.0", - "unified": "^11.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-parse": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-11.0.0.tgz", - "integrity": "sha512-FCxlKLNGknS5ba/1lmpYijMUzX2esxW5xQqjWxw2eHFfS2MSdaHVINFmhjo+qN1WhZhNimq0dZATN9pH0IDrpA==", - "license": "MIT", - "dependencies": { - "@types/mdast": "^4.0.0", - "mdast-util-from-markdown": "^2.0.0", - "micromark-util-types": "^2.0.0", - "unified": "^11.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, "node_modules/remark-stringify": { "version": "11.0.0", "resolved": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-11.0.0.tgz", diff --git a/package.json b/package.json index 38d3c3e..fe25409 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,6 @@ "sideEffects": false, "scripts": { "build": "tsup", - "prepare": "npm run build", "dev": "tsup --watch", "lint": "eslint . --max-warnings=0", "format": "prettier . --check",