@take-out/scripts 0.4.3-1775767446169 → 0.4.3-1775848829010

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.3-1775767446169",
3
+ "version": "0.4.3-1775848829010",
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.3-1775767446169",
33
- "@take-out/run": "0.4.3-1775767446169",
32
+ "@take-out/helpers": "0.4.3-1775848829010",
33
+ "@take-out/run": "0.4.3-1775848829010",
34
34
  "picocolors": "^1.1.1"
35
35
  }
36
36
  }
@@ -16,17 +16,13 @@ await cmd`bootstrap project workspace and build initial packages`.run(
16
16
 
17
17
  // check if critical packages are built
18
18
  if (hasPackages) {
19
- const needsBuild =
20
- !fs.existsSync(`./packages/helpers/dist`) ||
21
- !fs.existsSync(`./packages/cli/dist/esm`)
22
-
23
- if (needsBuild) {
19
+ if (!fs.existsSync(`./packages/helpers/dist`)) {
24
20
  // build helpers first as other packages depend on it
25
21
  await $`cd packages/helpers && bun run build`
26
-
27
- // then build all other packages in parallel
28
- await $`bun ./packages/run/src/run.ts build --no-root`
29
22
  }
23
+
24
+ // then build all other packages in parallel
25
+ await $`bun ./packages/run/src/run.ts build --no-root`
30
26
  }
31
27
 
32
28
  // show welcome message if not onboarded
@@ -0,0 +1,22 @@
1
+ import { cmd } from './cmd'
2
+
3
+ const SQLITE_NODE_PATH =
4
+ 'node_modules/@rocicorp/zero-sqlite3/build/Release/better_sqlite3.node'
5
+
6
+ await cmd`ensure zero-sqlite3 native module is built`.run(async ({ $, fs }) => {
7
+ if (fs.existsSync(SQLITE_NODE_PATH)) {
8
+ return
9
+ }
10
+
11
+ // bun trustedDependencies doesn't reliably build native modules
12
+ const result = await $`cd node_modules/@rocicorp/zero-sqlite3 && npm run build-release`
13
+ .quiet()
14
+ .nothrow()
15
+
16
+ if (result.exitCode !== 0) {
17
+ console.error(
18
+ 'zero-sqlite3 build failed, will fall back to wasm:',
19
+ result.stderr.toString()
20
+ )
21
+ }
22
+ })
@@ -103,7 +103,7 @@ fi
103
103
 
104
104
  // log any stale cleanup so the next deploy's logs show who left it
105
105
  const staleMatch = acquireOut.match(/STALE_META_START\n([\s\S]*?)\nSTALE_META_END/)
106
- if (staleMatch) {
106
+ if (staleMatch?.[1]) {
107
107
  console.warn(`deploy-lock: cleared stale lock (older than ${maxAge}m) left by:`)
108
108
  for (const line of staleMatch[1].split('\n')) {
109
109
  console.warn(` ${line}`)