@nightkatana/kronosys-app 1.0.0-beta.10 → 1.0.0-beta.11

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.
Files changed (2) hide show
  1. package/bin/kronosys.mjs +28 -8
  2. package/package.json +1 -1
package/bin/kronosys.mjs CHANGED
@@ -25,6 +25,7 @@ const inNodeModules =
25
25
  const isWindows = process.platform === "win32";
26
26
  const npmBin = process.platform === "win32" ? "npm.cmd" : "npm";
27
27
  const npxBin = process.platform === "win32" ? "npx.cmd" : "npx";
28
+ const psBin = process.platform === "win32" ? "powershell.exe" : null;
28
29
 
29
30
  const [, , command = "start", ...rest] = process.argv;
30
31
 
@@ -51,16 +52,18 @@ if (!commands[command]) {
51
52
 
52
53
  function runCommand(bin, args, env, cwd) {
53
54
  return new Promise((resolvePromise, rejectPromise) => {
55
+ const windowsArg = (arg) => `'${String(arg).replaceAll("'", "''")}'`;
56
+
54
57
  const child = isWindows
55
58
  ? spawn(
56
- process.env.ComSpec || "cmd.exe",
59
+ psBin,
57
60
  [
58
- "/d",
59
- "/s",
60
- "/c",
61
- [bin, ...args]
62
- .map((arg) => `"${String(arg).replaceAll('"', '\\"')}"`)
63
- .join(" "),
61
+ "-NoLogo",
62
+ "-NoProfile",
63
+ "-ExecutionPolicy",
64
+ "Bypass",
65
+ "-Command",
66
+ "& " + [bin, ...args].map(windowsArg).join(" "),
64
67
  ],
65
68
  {
66
69
  cwd,
@@ -129,9 +132,10 @@ async function main() {
129
132
  console.log("[kronosys] Installing runtime dependencies...");
130
133
  const installCode = await runCommand(
131
134
  npmBin,
132
- ["install", "--omit=dev", "--ignore-scripts", "--no-audit", "--no-fund"],
135
+ ["install", "--omit=dev", "--no-audit", "--no-fund"],
133
136
  {
134
137
  ...env,
138
+ HUSKY: "0",
135
139
  npm_config_cache:
136
140
  process.env.npm_config_cache ?? resolve(homedir(), ".npm"),
137
141
  },
@@ -140,6 +144,22 @@ async function main() {
140
144
  if (installCode !== 0) {
141
145
  process.exit(installCode);
142
146
  }
147
+
148
+ // Ensure native bindings are present for the current OS/ABI.
149
+ const rebuildCode = await runCommand(
150
+ npmBin,
151
+ ["rebuild", "better-sqlite3", "--no-audit", "--no-fund"],
152
+ {
153
+ ...env,
154
+ HUSKY: "0",
155
+ npm_config_cache:
156
+ process.env.npm_config_cache ?? resolve(homedir(), ".npm"),
157
+ },
158
+ runRoot,
159
+ );
160
+ if (rebuildCode !== 0) {
161
+ process.exit(rebuildCode);
162
+ }
143
163
  }
144
164
 
145
165
  // Production mode requires a Next build. Build once on first run.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nightkatana/kronosys-app",
3
- "version": "1.0.0-beta.10",
3
+ "version": "1.0.0-beta.11",
4
4
  "description": "Kronosys — application Next.js (UI + API + SQLite).",
5
5
  "license": "MIT",
6
6
  "author": "nightkatana",