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.d.ts b/dist/components/index.d.ts new file mode 100644 index 0000000..168021f --- /dev/null +++ b/dist/components/index.d.ts @@ -0,0 +1,2 @@ +export { Search, SearchOptions } from '../index.js'; +import '@quartz-community/types'; diff --git a/dist/index.d.ts b/dist/index.d.ts new file mode 100644 index 0000000..9baea26 --- /dev/null +++ b/dist/index.d.ts @@ -0,0 +1,8 @@ +import { QuartzComponent } from '@quartz-community/types'; + +interface SearchOptions { + enablePreview: boolean; +} +declare const _default: (userOpts?: Partial) => QuartzComponent; + +export { _default as Search, type SearchOptions }; diff --git a/package-lock.json b/package-lock.json index 409dd2e..1248b47 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,10 +10,7 @@ "license": "MIT", "dependencies": { "@quartz-community/types": "github:quartz-community/types", - "@quartz-community/utils": "github:quartz-community/utils", - "flexsearch": "^0.8.212", - "tsup": "^8.5.0", - "typescript": "^5.9.3" + "@quartz-community/utils": "github:quartz-community/utils" }, "devDependencies": { "@types/flexsearch": "^0.7.6", @@ -27,6 +24,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": { @@ -35,12 +34,16 @@ }, "peerDependencies": { "@jackyzha0/quartz": "^4.5.2", + "flexsearch": "^0.8.212", "preact": "^10.0.0" }, "peerDependenciesMeta": { "@jackyzha0/quartz": { "optional": true }, + "flexsearch": { + "optional": true + }, "preact": { "optional": false } @@ -2657,34 +2660,6 @@ "dev": true, "license": "ISC" }, - "node_modules/flexsearch": { - "version": "0.8.212", - "resolved": "https://registry.npmjs.org/flexsearch/-/flexsearch-0.8.212.tgz", - "integrity": "sha512-wSyJr1GUWoOOIISRu+X2IXiOcVfg9qqBRyCPRUdLMIGJqPzMo+jMRlvE83t14v1j0dRMEaBbER/adQjp6Du2pw==", - "funding": [ - { - "type": "github", - "url": "https://github.com/ts-thomas" - }, - { - "type": "paypal", - "url": "https://www.paypal.com/donate/?hosted_button_id=GEVR88FC9BWRW" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/flexsearch" - }, - { - "type": "patreon", - "url": "https://patreon.com/user?u=96245532" - }, - { - "type": "liberapay", - "url": "https://liberapay.com/ts-thomas" - } - ], - "license": "Apache-2.0" - }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -4082,7 +4057,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "nanoid": "^3.3.11", "picocolors": "^1.1.1", diff --git a/package.json b/package.json index 68dacbe..23f78ac 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,6 @@ "sideEffects": false, "scripts": { "build": "tsup", - "prepare": "npm run build", "dev": "tsup --watch", "lint": "eslint . --max-warnings=0", "format": "prettier . --check",