Comparing version 1.0.2 to 1.0.3-rc0
@@ -79,2 +79,11 @@ import { PagefindService } from "./service.js"; | ||
/** | ||
* @type {import('pagefindService').close} | ||
*/ | ||
export const close = () => new Promise((resolve, reject) => { | ||
persistentService?.close(null); | ||
persistentService = null; | ||
resolve(null); | ||
}); | ||
/** | ||
* @param {number} indexId | ||
@@ -81,0 +90,0 @@ * @returns {import ('pagefindService').PagefindIndex} |
@@ -50,3 +50,3 @@ import child_process from 'child_process'; | ||
/** | ||
* @param {Error} err | ||
* @param {Error?} err | ||
*/ | ||
@@ -57,3 +57,14 @@ close(err) { | ||
} | ||
this.backend?.unref?.(); | ||
this.backend?.stdout?.destroy?.() | ||
this.backend?.stdin?.destroy?.() | ||
this.backend?.kill?.(); | ||
this.backend = null; | ||
for (const [, cb] of Object.entries(this.callbacks)) { | ||
cb({ | ||
exception: new Error("Pagefind backend closed"), | ||
err: null, | ||
result: null | ||
}) | ||
} | ||
} | ||
@@ -60,0 +71,0 @@ |
{ | ||
"name": "pagefind", | ||
"version": "1.0.2", | ||
"version": "1.0.3-rc0", | ||
"type": "module", | ||
@@ -22,7 +22,7 @@ "description": "Implement search on any static website.", | ||
"optionalDependencies": { | ||
"@pagefind/linux-x64": "1.0.2", | ||
"@pagefind/linux-arm64": "1.0.2", | ||
"@pagefind/darwin-x64": "1.0.2", | ||
"@pagefind/darwin-arm64": "1.0.2", | ||
"@pagefind/windows-x64": "1.0.2" | ||
"@pagefind/linux-x64": "1.0.3-rc0", | ||
"@pagefind/linux-arm64": "1.0.3-rc0", | ||
"@pagefind/darwin-x64": "1.0.3-rc0", | ||
"@pagefind/darwin-arm64": "1.0.3-rc0", | ||
"@pagefind/windows-x64": "1.0.3-rc0" | ||
}, | ||
@@ -29,0 +29,0 @@ "keywords": [ |
@@ -6,2 +6,12 @@ /** | ||
/** | ||
* Close the Pagefind service and clean up, stopping the binary altogether. | ||
* | ||
* Service _will_ be restarted if any new calls are made to any other function. | ||
* | ||
* Calling functions on an existing index after calling close() is undefined behavior, | ||
* as that index may map to a new index after the service has restarted. | ||
*/ | ||
export function close(): Promise<null>; | ||
export interface PagefindServiceConfig { | ||
@@ -207,2 +217,2 @@ /** | ||
*/ | ||
declare function deleteIndex(): Promise<null>; | ||
declare function deleteIndex(): Promise<null>; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36450
907
1