dreamboard 0.1.5 → 0.1.6
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/dist/index.js +86 -14
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -22393,6 +22393,12 @@ var UI_SDK_NODE_MODULES = path8.join(
|
|
|
22393
22393
|
"ui-sdk",
|
|
22394
22394
|
"node_modules"
|
|
22395
22395
|
);
|
|
22396
|
+
var TYPESCRIPT_CLI = path8.join(
|
|
22397
|
+
WORKSPACE_NODE_MODULES,
|
|
22398
|
+
"typescript",
|
|
22399
|
+
"bin",
|
|
22400
|
+
"tsc"
|
|
22401
|
+
);
|
|
22396
22402
|
async function pathExists(targetPath) {
|
|
22397
22403
|
try {
|
|
22398
22404
|
await lstat(targetPath);
|
|
@@ -22413,6 +22419,12 @@ async function ensureSymlink(targetPath, linkPath) {
|
|
|
22413
22419
|
);
|
|
22414
22420
|
}
|
|
22415
22421
|
async function ensureTypecheckDependencies(projectRoot) {
|
|
22422
|
+
if (!await pathExists(WORKSPACE_NODE_MODULES)) {
|
|
22423
|
+
return `Skipping local typecheck: workspace dependencies are not installed at ${WORKSPACE_NODE_MODULES}.`;
|
|
22424
|
+
}
|
|
22425
|
+
if (!await pathExists(UI_SDK_NODE_MODULES)) {
|
|
22426
|
+
return `Skipping local typecheck: ui-sdk dependencies are not installed at ${UI_SDK_NODE_MODULES}.`;
|
|
22427
|
+
}
|
|
22416
22428
|
await ensureSymlink(
|
|
22417
22429
|
WORKSPACE_NODE_MODULES,
|
|
22418
22430
|
path8.join(projectRoot, "node_modules")
|
|
@@ -22421,15 +22433,46 @@ async function ensureTypecheckDependencies(projectRoot) {
|
|
|
22421
22433
|
UI_SDK_NODE_MODULES,
|
|
22422
22434
|
path8.join(projectRoot, "ui", "node_modules")
|
|
22423
22435
|
);
|
|
22436
|
+
return null;
|
|
22424
22437
|
}
|
|
22425
|
-
async function
|
|
22426
|
-
await
|
|
22427
|
-
|
|
22428
|
-
|
|
22429
|
-
|
|
22438
|
+
async function resolveTypecheckRunner() {
|
|
22439
|
+
if (await pathExists(TYPESCRIPT_CLI)) {
|
|
22440
|
+
return {
|
|
22441
|
+
command: process.execPath,
|
|
22442
|
+
argsPrefix: [TYPESCRIPT_CLI]
|
|
22443
|
+
};
|
|
22444
|
+
}
|
|
22445
|
+
const globalTscAvailable = await new Promise((resolve) => {
|
|
22446
|
+
const child = spawn("tsc", ["--version"], {
|
|
22430
22447
|
env: process.env,
|
|
22431
|
-
stdio:
|
|
22448
|
+
stdio: "ignore"
|
|
22449
|
+
});
|
|
22450
|
+
child.on("error", () => {
|
|
22451
|
+
resolve(false);
|
|
22432
22452
|
});
|
|
22453
|
+
child.on("close", (code) => {
|
|
22454
|
+
resolve(code === 0);
|
|
22455
|
+
});
|
|
22456
|
+
});
|
|
22457
|
+
if (!globalTscAvailable) {
|
|
22458
|
+
return null;
|
|
22459
|
+
}
|
|
22460
|
+
return {
|
|
22461
|
+
command: "tsc",
|
|
22462
|
+
argsPrefix: []
|
|
22463
|
+
};
|
|
22464
|
+
}
|
|
22465
|
+
async function runTypecheckProject(runner, projectRoot, projectPath) {
|
|
22466
|
+
return new Promise((resolve, reject) => {
|
|
22467
|
+
const child = spawn(
|
|
22468
|
+
runner.command,
|
|
22469
|
+
[...runner.argsPrefix, "--noEmit", "-p", projectPath],
|
|
22470
|
+
{
|
|
22471
|
+
cwd: projectRoot,
|
|
22472
|
+
env: process.env,
|
|
22473
|
+
stdio: ["ignore", "pipe", "pipe"]
|
|
22474
|
+
}
|
|
22475
|
+
);
|
|
22433
22476
|
let stdout = "";
|
|
22434
22477
|
let stderr = "";
|
|
22435
22478
|
child.stdout.on("data", (chunk) => {
|
|
@@ -22439,11 +22482,7 @@ async function runLocalTypecheck(projectRoot) {
|
|
|
22439
22482
|
stderr += chunk.toString();
|
|
22440
22483
|
});
|
|
22441
22484
|
child.on("error", (error48) => {
|
|
22442
|
-
reject(
|
|
22443
|
-
new Error(
|
|
22444
|
-
`Failed to start local typecheck. Ensure Bun is installed and available on PATH. ${error48.message}`
|
|
22445
|
-
)
|
|
22446
|
-
);
|
|
22485
|
+
reject(new Error(`Failed to start local typecheck. ${error48.message}`));
|
|
22447
22486
|
});
|
|
22448
22487
|
child.on("close", (code) => {
|
|
22449
22488
|
const output = [stdout, stderr].filter(Boolean).join("\n").trim();
|
|
@@ -22454,6 +22493,34 @@ async function runLocalTypecheck(projectRoot) {
|
|
|
22454
22493
|
});
|
|
22455
22494
|
});
|
|
22456
22495
|
}
|
|
22496
|
+
async function runLocalTypecheck(projectRoot) {
|
|
22497
|
+
const dependencySkipReason = await ensureTypecheckDependencies(projectRoot);
|
|
22498
|
+
if (dependencySkipReason) {
|
|
22499
|
+
return {
|
|
22500
|
+
success: true,
|
|
22501
|
+
skipped: true,
|
|
22502
|
+
output: dependencySkipReason
|
|
22503
|
+
};
|
|
22504
|
+
}
|
|
22505
|
+
const runner = await resolveTypecheckRunner();
|
|
22506
|
+
if (!runner) {
|
|
22507
|
+
return {
|
|
22508
|
+
success: true,
|
|
22509
|
+
skipped: true,
|
|
22510
|
+
output: "Skipping local typecheck: TypeScript CLI was not found in workspace dependencies or on PATH."
|
|
22511
|
+
};
|
|
22512
|
+
}
|
|
22513
|
+
for (const projectPath of ["app/tsconfig.json", "ui/tsconfig.json"]) {
|
|
22514
|
+
const result = await runTypecheckProject(runner, projectRoot, projectPath);
|
|
22515
|
+
if (!result.success) {
|
|
22516
|
+
return result;
|
|
22517
|
+
}
|
|
22518
|
+
}
|
|
22519
|
+
return {
|
|
22520
|
+
success: true,
|
|
22521
|
+
output: ""
|
|
22522
|
+
};
|
|
22523
|
+
}
|
|
22457
22524
|
|
|
22458
22525
|
// src/commands/push.ts
|
|
22459
22526
|
function isSourcePath(filePath) {
|
|
@@ -22571,15 +22638,20 @@ var push_default = defineCommand({
|
|
|
22571
22638
|
if (!parsedArgs["skip-local-check"]) {
|
|
22572
22639
|
consola.start("Running local typecheck...");
|
|
22573
22640
|
const typecheckResult = await runLocalTypecheck(projectRoot);
|
|
22574
|
-
if (
|
|
22641
|
+
if (typecheckResult.skipped) {
|
|
22642
|
+
if (typecheckResult.output) {
|
|
22643
|
+
consola.warn(typecheckResult.output);
|
|
22644
|
+
}
|
|
22645
|
+
} else if (!typecheckResult.success) {
|
|
22575
22646
|
if (typecheckResult.output) {
|
|
22576
22647
|
consola.error(typecheckResult.output);
|
|
22577
22648
|
}
|
|
22578
22649
|
throw new Error(
|
|
22579
22650
|
"Local typecheck failed. Fix the diagnostics or re-run with --skip-local-check."
|
|
22580
22651
|
);
|
|
22652
|
+
} else {
|
|
22653
|
+
consola.success("Local typecheck passed.");
|
|
22581
22654
|
}
|
|
22582
|
-
consola.success("Local typecheck passed.");
|
|
22583
22655
|
}
|
|
22584
22656
|
const ruleChanged = diff.modified.includes(RULE_FILE) || diff.added.includes(RULE_FILE);
|
|
22585
22657
|
const manifestChanged = diff.modified.includes(MANIFEST_FILE) || diff.added.includes(MANIFEST_FILE);
|
|
@@ -26141,7 +26213,7 @@ var subCommands = {
|
|
|
26141
26213
|
var main = defineCommand({
|
|
26142
26214
|
meta: {
|
|
26143
26215
|
name: "dreamboard",
|
|
26144
|
-
version: "0.1.
|
|
26216
|
+
version: "0.1.6",
|
|
26145
26217
|
description: "Dreamboard CLI \u2014 game development platform"
|
|
26146
26218
|
},
|
|
26147
26219
|
subCommands
|