diff --git a/.eslintrc.json b/.eslintrc.json index 7a403c2..a8b8350 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -22,5 +22,13 @@ "caughtErrorsIgnorePattern": "^_" } ] - } + }, + "overrides": [ + { + "files": ["types/**/*.d.ts"], + "rules": { + "@typescript-eslint/triple-slash-reference": "off" + } + } + ] } diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..1521c8b --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +dist diff --git a/package-lock.json b/package-lock.json index 947e0f9..cccfe95 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,6 +24,7 @@ "sass": "^1.97.3", "tsup": "^8.5.0", "typescript": "^5.9.3", + "unified": "^11.0.5", "vitest": "^2.1.9" }, "engines": { @@ -1896,8 +1897,8 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.2.tgz", "integrity": "sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==", + "devOptional": true, "license": "MIT", - "optional": true, "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -2514,8 +2515,8 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "license": "MIT", - "optional": true + "devOptional": true, + "license": "MIT" }, "node_modules/fast-deep-equal": { "version": "3.1.3", @@ -2949,8 +2950,8 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", + "devOptional": true, "license": "MIT", - "optional": true, "engines": { "node": ">=12" }, @@ -4138,8 +4139,8 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/trough/-/trough-2.2.0.tgz", "integrity": "sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==", + "devOptional": true, "license": "MIT", - "optional": true, "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -4283,6 +4284,27 @@ "dev": true, "license": "MIT" }, + "node_modules/unified": { + "version": "11.0.5", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.5.tgz", + "integrity": "sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA==", + "devOptional": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/unist-util-is": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.1.tgz", @@ -4372,6 +4394,7 @@ "integrity": "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==", "devOptional": true, "license": "MIT", + "peer": true, "dependencies": { "@types/unist": "^3.0.0", "vfile-message": "^4.0.0" diff --git a/package.json b/package.json index e2fcdc6..ca41021 100644 --- a/package.json +++ b/package.json @@ -55,8 +55,8 @@ }, "peerDependencies": { "@jackyzha0/quartz": "^4.5.2", - "preact": "^10.0.0", "hast-util-to-html": "^9.0.4", + "preact": "^10.0.0", "unified": "^11.0.5", "vfile": "^6.0.3" }, @@ -93,6 +93,7 @@ "sass": "^1.97.3", "tsup": "^8.5.0", "typescript": "^5.9.3", + "unified": "^11.0.5", "vitest": "^2.1.9" }, "quartz": { diff --git a/src/components/scripts.d.ts b/src/components/scripts.d.ts deleted file mode 100644 index 89df165..0000000 --- a/src/components/scripts.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -declare module "*.inline.ts" { - const content: string; - export default content; -} diff --git a/src/components/styles.d.ts b/src/components/styles.d.ts deleted file mode 100644 index 0a31e5e..0000000 --- a/src/components/styles.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -declare module "*.scss" { - const content: string; - export default content; -} diff --git a/types/globals.d.ts b/types/globals.d.ts index bb46b82..a9e71ae 100644 --- a/types/globals.d.ts +++ b/types/globals.d.ts @@ -1,7 +1,19 @@ +declare module "*.scss" { + const content: string; + export default content; +} + +declare module "*.inline.ts" { + const content: string; + export default content; +} + interface CustomEventMap { nav: CustomEvent<{ url: string }>; prenav: CustomEvent; themechange: CustomEvent<{ theme: "light" | "dark" }>; + readermodechange: CustomEvent<{ mode: "on" | "off" }>; + render: CustomEvent; } interface Document { @@ -18,4 +30,7 @@ interface Document { interface Window { addCleanup(fn: (...args: unknown[]) => void): void; + spaNavigate?(url: URL, isBack: boolean): Promise; } + +declare const fetchData: Promise>;