tina4-nodejs 3.13.164 → 3.13.165
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/CLAUDE.md +2 -2
- package/package.json +1 -1
- package/packages/cli/dist/bin.js +732 -653
- package/packages/cli/src/bin.ts +5 -2
- package/packages/cli/src/commands/lint.ts +3 -1
- package/packages/core/dist/index.js +653 -576
- package/packages/core/src/batchSpawn.ts +129 -0
- package/packages/core/src/devAdmin.ts +7 -8
- package/packages/core/src/fakeData.ts +4 -1
- package/packages/core/src/mcp.ts +4 -1
- package/packages/core/src/portTakeover.ts +31 -13
- package/packages/core/src/projectIndex.ts +3 -4
- package/packages/core/src/projectIndexStorage.ts +9 -1
- package/packages/core/src/response.ts +4 -1
- package/packages/core/src/routeDiscovery.ts +8 -2
- package/packages/core/src/server.ts +18 -15
- package/packages/core/src/session.ts +5 -0
- package/packages/core/src/sessionHandlers/databaseHandler.ts +16 -0
- package/packages/orm/dist/index.js +687 -610
- package/packages/orm/src/model.ts +2 -1
- package/types/core/src/batchSpawn.d.ts +28 -0
- package/types/core/src/portTakeover.d.ts +15 -0
- package/types/core/src/projectIndexStorage.d.ts +5 -0
- package/types/core/src/session.d.ts +5 -0
- package/types/core/src/sessionHandlers/databaseHandler.d.ts +8 -0
package/packages/cli/src/bin.ts
CHANGED
|
@@ -19,7 +19,7 @@ import { generate, GENERATORS, RESOLUTION_ENVELOPE_VERSION, RESOLUTION_FLAGS } f
|
|
|
19
19
|
import { runSeeds } from "./commands/seed.js";
|
|
20
20
|
import { queueCommand, QUEUE_FLAGS, QUEUE_SUBCOMMAND_NAMES } from "./commands/queue.js";
|
|
21
21
|
import { buildImage } from "./commands/build.js";
|
|
22
|
-
import {
|
|
22
|
+
import { spawnSyncAllowingBatch } from "../../core/src/batchSpawn.js";
|
|
23
23
|
import { existsSync, readFileSync } from "node:fs";
|
|
24
24
|
import { dirname, join } from "node:path";
|
|
25
25
|
import { findOnPath } from "./util.js";
|
|
@@ -557,7 +557,10 @@ export function delegateToClient(command: string, args: string[]): number {
|
|
|
557
557
|
|
|
558
558
|
// stdio is inherited, so the client's interactive prompts (setup) and colour
|
|
559
559
|
// output work exactly as if it had been invoked directly.
|
|
560
|
-
|
|
560
|
+
// A tina4.cmd / tina4.bat client is accepted above, so it must be startable:
|
|
561
|
+
// Node will not spawn a batch file without a shell, and a plain shell would
|
|
562
|
+
// not escape the user's arguments.
|
|
563
|
+
const result = spawnSyncAllowingBatch(client, [command, ...args], {
|
|
561
564
|
stdio: "inherit",
|
|
562
565
|
env: { ...process.env, [DELEGATION_GUARD_ENV]: command },
|
|
563
566
|
});
|
|
@@ -46,6 +46,7 @@ import { createRequire } from "node:module";
|
|
|
46
46
|
import { dirname, join, relative } from "node:path";
|
|
47
47
|
import { findOnPath } from "../util.js";
|
|
48
48
|
import { spawnSync } from "node:child_process";
|
|
49
|
+
import { spawnSyncAllowingBatch } from "../../../core/src/batchSpawn.js";
|
|
49
50
|
|
|
50
51
|
// Source extensions we count as lintable app code. `.d.ts` declaration files are
|
|
51
52
|
// deliberately excluded — they carry no runnable code for `node --check` and are
|
|
@@ -237,7 +238,8 @@ function bootstrapEslint(cwd: string, noInstall: boolean): EslintSetup {
|
|
|
237
238
|
}
|
|
238
239
|
if (!bin) {
|
|
239
240
|
console.log(" · installing eslint (npm i -D eslint @eslint/js typescript-eslint)...");
|
|
240
|
-
|
|
241
|
+
// On Windows npm is npm.cmd, which Node will not spawn without a shell.
|
|
242
|
+
const rc = spawnSyncAllowingBatch(npm, ["install", "-D", "eslint", "@eslint/js", "typescript-eslint"], { cwd, stdio: "inherit" }).status;
|
|
241
243
|
if (rc === 0) bin = resolveEslintBin(cwd);
|
|
242
244
|
else console.log(" · could not install eslint — using the zero-dependency baseline.");
|
|
243
245
|
}
|