Comparing version 1.0.0 to 1.0.1-rc0
@@ -7,8 +7,11 @@ import os from 'os'; | ||
/** | ||
* @param {string} execname | ||
* @param {string[]} execnames | ||
* @returns {string} | ||
*/ | ||
export function resolveBinaryPath(execname) { | ||
const env_var = process.env[`${execname.toUpperCase()}_BINARY_PATH`]; | ||
if (env_var) return env_var; | ||
export function resolveBinaryPath(execnames = []) { | ||
for (const execname of execnames) { | ||
const env_var = process.env[`${execname.toUpperCase()}_BINARY_PATH`]; | ||
if (env_var) return env_var; | ||
} | ||
@@ -18,16 +21,18 @@ const cpu = process.env.npm_config_arch || os.arch(); | ||
const executable = platform === 'windows' ? `${execname}.exe` : execname; | ||
for (const execname of execnames) { | ||
const executable = platform === 'windows' ? `${execname}.exe` : execname; | ||
try { | ||
return require.resolve(`@${execname}/${platform}-${cpu}/bin/${executable}`); | ||
} catch (e) { | ||
throw new Error( | ||
[ | ||
`Failed to install ${execname}. Most likely the platform ${platform}-${cpu} is not yet a supported architecture.`, | ||
`Please open an issue at https://github.com/CloudCannon/${execname} and paste this error message in full.`, | ||
`If you believe this package should be compatible with your system,`, | ||
`you can try downloading a release binary directly from https://github.com/CloudCannon/${execname}/releases` | ||
].join('\n') | ||
); | ||
try { | ||
return require.resolve(`@${execname}/${platform}-${cpu}/bin/${executable}`); | ||
} catch (e) { } | ||
} | ||
throw new Error( | ||
[ | ||
`Failed to install either of [${execnames.join(', ')}]. Most likely the platform ${platform}-${cpu} is not yet a supported architecture.`, | ||
`Please open an issue at https://github.com/CloudCannon/pagefind and paste this error message in full.`, | ||
`If you believe this package should be compatible with your system,`, | ||
`you can try downloading a release binary directly from https://github.com/CloudCannon/pagefind/releases` | ||
].join('\n') | ||
); | ||
} |
@@ -22,3 +22,3 @@ import child_process from 'child_process'; | ||
*/ | ||
this.backend = child_process.spawn(resolveBinaryPath("pagefind"), [`--service`], { | ||
this.backend = child_process.spawn(resolveBinaryPath(["pagefind_extended", "pagefind"]), [`--service`], { | ||
windowsHide: true, | ||
@@ -25,0 +25,0 @@ stdio: ['pipe', 'pipe', 'inherit'], |
{ | ||
"name": "pagefind", | ||
"version": "1.0.0", | ||
"version": "1.0.1-rc0", | ||
"type": "module", | ||
@@ -22,7 +22,7 @@ "description": "Implement search on any static website.", | ||
"optionalDependencies": { | ||
"@pagefind/linux-x64": "1.0.0", | ||
"@pagefind/linux-arm64": "1.0.0", | ||
"@pagefind/darwin-x64": "1.0.0", | ||
"@pagefind/darwin-arm64": "1.0.0", | ||
"@pagefind/windows-x64": "1.0.0" | ||
"@pagefind/linux-x64": "1.0.1-rc0", | ||
"@pagefind/linux-arm64": "1.0.1-rc0", | ||
"@pagefind/darwin-x64": "1.0.1-rc0", | ||
"@pagefind/darwin-arm64": "1.0.1-rc0", | ||
"@pagefind/windows-x64": "1.0.1-rc0" | ||
}, | ||
@@ -29,0 +29,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
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
35500
878
1