@take-out/scripts 0.4.14 → 0.4.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@take-out/scripts",
3
- "version": "0.4.14",
3
+ "version": "0.4.16",
4
4
  "type": "module",
5
5
  "main": "./src/cmd.ts",
6
6
  "sideEffects": false,
@@ -29,8 +29,8 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@clack/prompts": "^0.8.2",
32
- "@take-out/helpers": "0.4.14",
33
- "@take-out/run": "0.4.14",
32
+ "@take-out/helpers": "0.4.16",
33
+ "@take-out/run": "0.4.16",
34
34
  "picocolors": "^1.1.1"
35
35
  }
36
36
  }
@@ -8,14 +8,23 @@ await cmd`ensure zero-sqlite3 native module is built`.run(async ({ $, fs }) => {
8
8
  return
9
9
  }
10
10
 
11
- // bun trustedDependencies doesn't reliably build native modules
12
- const result = await $`cd node_modules/@rocicorp/zero-sqlite3 && npm run build-release`
11
+ // bun trustedDependencies doesn't reliably run zero-sqlite3's install script,
12
+ // so build/fetch the native module ourselves. run the package's OWN install
13
+ // chain (`npm run install` = `prebuild-install || <binding exists?> ||
14
+ // node-gyp rebuild`), which prefers the PREBUILT binary and only source-builds
15
+ // as a last resort. @rocicorp/zero-sqlite3 >=1.1.2 is prebuilt-ONLY — its npm
16
+ // tarball omits generated headers (e.g. unicode_case_data.h), so a direct
17
+ // `npm run build-release` (node-gyp) fails; prebuild-install is the supported
18
+ // path. success is "the binding now exists" (the install chain can exit
19
+ // non-zero from a failed prebuild-install fallback even when an earlier step
20
+ // already produced the binding).
21
+ const result = await $`cd node_modules/@rocicorp/zero-sqlite3 && npm run install`
13
22
  .quiet()
14
23
  .nothrow()
15
24
 
16
- if (result.exitCode !== 0) {
25
+ if (!fs.existsSync(SQLITE_NODE_PATH)) {
17
26
  console.error(
18
- 'zero-sqlite3 build failed, will fall back to wasm:',
27
+ 'zero-sqlite3 native module unavailable, will fall back to wasm:',
19
28
  result.stderr.toString(),
20
29
  )
21
30
  }