@dreamboard-games/cli 0.1.30-alpha.3 → 0.1.30-alpha.4
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/agent-verifier/agent-workspace-verifier.mjs +16 -16
- package/dist/agent-verifier/{chunk-XGWCY624.mjs → chunk-27EEIZCI.mjs} +2 -2
- package/dist/agent-verifier/{chunk-SH5JKYOB.mjs → chunk-5NYBTZB4.mjs} +3 -3
- package/dist/agent-verifier/{chunk-O4YCPU7C.mjs → chunk-C3VW3DTA.mjs} +6 -10
- package/dist/agent-verifier/{chunk-O4YCPU7C.mjs.map → chunk-C3VW3DTA.mjs.map} +1 -1
- package/dist/agent-verifier/chunk-H6XDQJ3N.mjs +11 -0
- package/dist/agent-verifier/{chunk-S34FRJHS.mjs → chunk-IDVQXGAO.mjs} +2 -2
- package/dist/agent-verifier/{chunk-3UKQVWLV.mjs → chunk-JO5AMVZU.mjs} +3 -3
- package/dist/agent-verifier/{chunk-VS573ERH.mjs → chunk-JZTH3EMV.mjs} +2 -2
- package/dist/agent-verifier/{chunk-W3N3QJ4V.mjs → chunk-KDBSVLCF.mjs} +4 -4
- package/dist/agent-verifier/{chunk-7WWGFAAU.mjs → chunk-MW2QIWWA.mjs} +3 -3
- package/dist/agent-verifier/{chunk-E7SSWJXJ.mjs → chunk-ON62IGWK.mjs} +6 -6
- package/dist/agent-verifier/chunk-QBAF7EYR.mjs +214 -0
- package/dist/agent-verifier/chunk-QBAF7EYR.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-HGMUAL33.mjs → chunk-QZH6IEZS.mjs} +2 -2
- package/dist/agent-verifier/{chunk-LUZ7KE6H.mjs → chunk-XKCJBIRY.mjs} +4 -8
- package/dist/agent-verifier/{chunk-LUZ7KE6H.mjs.map → chunk-XKCJBIRY.mjs.map} +1 -1
- package/dist/agent-verifier/{chunk-JGT4P4UD.mjs → chunk-YDIOW2BO.mjs} +2 -2
- package/dist/agent-verifier/{chunk-A64ZZUZV.mjs → chunk-Z6OZWUIZ.mjs} +3 -3
- package/dist/agent-verifier/{compile-TEQVA46V.mjs → compile-576O7TYP.mjs} +12 -12
- package/dist/agent-verifier/{global-config-Y2NTSK4R.mjs → global-config-NYCSCAUI.mjs} +3 -3
- package/dist/agent-verifier/{keychain-backend-SPQWGKZN.mjs → keychain-backend-A3MRWLPF.mjs} +2 -2
- package/dist/agent-verifier/{local-files-JFOQQZDL.mjs → local-files-QVJ2H3MH.mjs} +6 -6
- package/dist/agent-verifier/{local-typecheck-XVGWI75X.mjs → local-typecheck-2JWG5IGL.mjs} +2 -2
- package/dist/agent-verifier/{materialize-workspace-ZAVGQQSF.mjs → materialize-workspace-OZKOQCSQ.mjs} +7 -7
- package/dist/agent-verifier/{project-state-K576C2TE.mjs → project-state-XKUSCFSV.mjs} +2 -2
- package/dist/agent-verifier/{prompt-MJRJMOGQ.mjs → prompt-VKHMCQT6.mjs} +2 -2
- package/dist/agent-verifier/{reducer-bundle-preflight-LXNJUBKL.mjs → reducer-bundle-preflight-7NYZF5ZT.mjs} +6 -6
- package/dist/agent-verifier/reducer-contract-preflight-COD2CO22.mjs +11 -0
- package/dist/agent-verifier/{reducer-native-test-harness-CHX5MBL5.mjs → reducer-native-test-harness-QC7HZUK4.mjs} +9 -9
- package/dist/agent-verifier/{static-scaffold-R7SVDRQI.mjs → static-scaffold-JBUE3ROP.mjs} +6 -6
- package/dist/agent-verifier/{sync-THAI546U.mjs → sync-C6S3OGCD.mjs} +15 -15
- package/dist/agent-verifier/{test-AFAQFKOB.mjs → test-Y5UGQV7J.mjs} +12 -12
- package/dist/agent-verifier/{workspace-codegen-2ZMQRIKJ.mjs → workspace-codegen-WPZHMATU.mjs} +2 -2
- package/dist/agent-verifier/{workspace-dependencies-NOOQBK6I.mjs → workspace-dependencies-B6A2ZX55.mjs} +2 -2
- package/dist/chunk-2H7UOFLK.js +11 -0
- package/dist/{chunk-N7XPNNUI.js → chunk-3NRROR4P.js} +3 -3
- package/dist/{chunk-TAQKH67O.js → chunk-M4SCKH5M.js} +8 -2224
- package/dist/chunk-M4SCKH5M.js.map +1 -0
- package/dist/{global-config-S4ZIPECE.js → global-config-YBFEGJQG.js} +3 -3
- package/dist/index.js +4 -4
- package/dist/internal.js +3 -3
- package/dist/{keychain-backend-HDF4TZDL.js → keychain-backend-JHTXAKWC.js} +2 -2
- package/dist/{prompt-NDV3AE5L.js → prompt-GMZABCJC.js} +2 -2
- package/package.json +1 -1
- package/dist/agent-verifier/chunk-SKI2ESE5.mjs +0 -44
- package/dist/agent-verifier/chunk-UIZNWRM6.mjs +0 -2432
- package/dist/agent-verifier/chunk-UIZNWRM6.mjs.map +0 -1
- package/dist/agent-verifier/reducer-contract-preflight-TUMQ43JV.mjs +0 -11
- package/dist/chunk-SEGVTWSK.js +0 -44
- package/dist/chunk-TAQKH67O.js.map +0 -1
- /package/dist/agent-verifier/{chunk-XGWCY624.mjs.map → chunk-27EEIZCI.mjs.map} +0 -0
- /package/dist/agent-verifier/{chunk-SH5JKYOB.mjs.map → chunk-5NYBTZB4.mjs.map} +0 -0
- /package/dist/agent-verifier/{chunk-SKI2ESE5.mjs.map → chunk-H6XDQJ3N.mjs.map} +0 -0
- /package/dist/agent-verifier/{chunk-S34FRJHS.mjs.map → chunk-IDVQXGAO.mjs.map} +0 -0
- /package/dist/agent-verifier/{chunk-3UKQVWLV.mjs.map → chunk-JO5AMVZU.mjs.map} +0 -0
- /package/dist/agent-verifier/{chunk-VS573ERH.mjs.map → chunk-JZTH3EMV.mjs.map} +0 -0
- /package/dist/agent-verifier/{chunk-W3N3QJ4V.mjs.map → chunk-KDBSVLCF.mjs.map} +0 -0
- /package/dist/agent-verifier/{chunk-7WWGFAAU.mjs.map → chunk-MW2QIWWA.mjs.map} +0 -0
- /package/dist/agent-verifier/{chunk-E7SSWJXJ.mjs.map → chunk-ON62IGWK.mjs.map} +0 -0
- /package/dist/agent-verifier/{chunk-HGMUAL33.mjs.map → chunk-QZH6IEZS.mjs.map} +0 -0
- /package/dist/agent-verifier/{chunk-JGT4P4UD.mjs.map → chunk-YDIOW2BO.mjs.map} +0 -0
- /package/dist/agent-verifier/{chunk-A64ZZUZV.mjs.map → chunk-Z6OZWUIZ.mjs.map} +0 -0
- /package/dist/agent-verifier/{compile-TEQVA46V.mjs.map → compile-576O7TYP.mjs.map} +0 -0
- /package/dist/agent-verifier/{global-config-Y2NTSK4R.mjs.map → global-config-NYCSCAUI.mjs.map} +0 -0
- /package/dist/agent-verifier/{keychain-backend-SPQWGKZN.mjs.map → keychain-backend-A3MRWLPF.mjs.map} +0 -0
- /package/dist/agent-verifier/{local-files-JFOQQZDL.mjs.map → local-files-QVJ2H3MH.mjs.map} +0 -0
- /package/dist/agent-verifier/{local-typecheck-XVGWI75X.mjs.map → local-typecheck-2JWG5IGL.mjs.map} +0 -0
- /package/dist/agent-verifier/{materialize-workspace-ZAVGQQSF.mjs.map → materialize-workspace-OZKOQCSQ.mjs.map} +0 -0
- /package/dist/agent-verifier/{project-state-K576C2TE.mjs.map → project-state-XKUSCFSV.mjs.map} +0 -0
- /package/dist/agent-verifier/{prompt-MJRJMOGQ.mjs.map → prompt-VKHMCQT6.mjs.map} +0 -0
- /package/dist/agent-verifier/{reducer-bundle-preflight-LXNJUBKL.mjs.map → reducer-bundle-preflight-7NYZF5ZT.mjs.map} +0 -0
- /package/dist/agent-verifier/{reducer-contract-preflight-TUMQ43JV.mjs.map → reducer-contract-preflight-COD2CO22.mjs.map} +0 -0
- /package/dist/agent-verifier/{reducer-native-test-harness-CHX5MBL5.mjs.map → reducer-native-test-harness-QC7HZUK4.mjs.map} +0 -0
- /package/dist/agent-verifier/{static-scaffold-R7SVDRQI.mjs.map → static-scaffold-JBUE3ROP.mjs.map} +0 -0
- /package/dist/agent-verifier/{sync-THAI546U.mjs.map → sync-C6S3OGCD.mjs.map} +0 -0
- /package/dist/agent-verifier/{test-AFAQFKOB.mjs.map → test-Y5UGQV7J.mjs.map} +0 -0
- /package/dist/agent-verifier/{workspace-codegen-2ZMQRIKJ.mjs.map → workspace-codegen-WPZHMATU.mjs.map} +0 -0
- /package/dist/agent-verifier/{workspace-dependencies-NOOQBK6I.mjs.map → workspace-dependencies-B6A2ZX55.mjs.map} +0 -0
- /package/dist/{chunk-SEGVTWSK.js.map → chunk-2H7UOFLK.js.map} +0 -0
- /package/dist/{chunk-N7XPNNUI.js.map → chunk-3NRROR4P.js.map} +0 -0
- /package/dist/{global-config-S4ZIPECE.js.map → global-config-YBFEGJQG.js.map} +0 -0
- /package/dist/{keychain-backend-HDF4TZDL.js.map → keychain-backend-JHTXAKWC.js.map} +0 -0
- /package/dist/{prompt-NDV3AE5L.js.map → prompt-GMZABCJC.js.map} +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __export = (target, all) => {
|
|
4
|
+
for (var name in all)
|
|
5
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export {
|
|
9
|
+
__export
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=chunk-H6XDQJ3N.mjs.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
CLIENT_PROBLEM_TYPES,
|
|
4
4
|
SERVER_PROBLEM_TYPES,
|
|
5
5
|
zProblemDetails
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-C3VW3DTA.mjs";
|
|
7
7
|
|
|
8
8
|
// src/utils/problem-types.ts
|
|
9
9
|
var CLI_PROBLEM_TYPES = {
|
|
@@ -219,4 +219,4 @@ export {
|
|
|
219
219
|
isStaleContractArtifactError,
|
|
220
220
|
formatCliError
|
|
221
221
|
};
|
|
222
|
-
//# sourceMappingURL=chunk-
|
|
222
|
+
//# sourceMappingURL=chunk-IDVQXGAO.mjs.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
getStoredSession,
|
|
4
4
|
loadGlobalConfig,
|
|
5
5
|
setCredentials
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5NYBTZB4.mjs";
|
|
7
7
|
import {
|
|
8
8
|
IS_PUBLISHED_BUILD,
|
|
9
9
|
PUBLISHED_ENVIRONMENT,
|
|
@@ -1105,7 +1105,7 @@ function createConsola2(options = {}) {
|
|
|
1105
1105
|
defaults: { level },
|
|
1106
1106
|
stdout: process.stdout,
|
|
1107
1107
|
stderr: process.stderr,
|
|
1108
|
-
prompt: (...args) => import("./prompt-
|
|
1108
|
+
prompt: (...args) => import("./prompt-VKHMCQT6.mjs").then((m) => m.prompt(...args)),
|
|
1109
1109
|
reporters: options.reporters || [
|
|
1110
1110
|
options.fancy ?? !(T || R) ? new FancyReporter() : new BasicReporter()
|
|
1111
1111
|
],
|
|
@@ -1741,4 +1741,4 @@ export {
|
|
|
1741
1741
|
assertCompilerPortableDependencies,
|
|
1742
1742
|
assertReleaseEnvironmentPortableDependencies
|
|
1743
1743
|
};
|
|
1744
|
-
//# sourceMappingURL=chunk-
|
|
1744
|
+
//# sourceMappingURL=chunk-JO5AMVZU.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
__export
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-H6XDQJ3N.mjs";
|
|
5
5
|
|
|
6
6
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/external.js
|
|
7
7
|
var external_exports = {};
|
|
@@ -14520,4 +14520,4 @@ config(en_default());
|
|
|
14520
14520
|
export {
|
|
14521
14521
|
external_exports
|
|
14522
14522
|
};
|
|
14523
|
-
//# sourceMappingURL=chunk-
|
|
14523
|
+
//# sourceMappingURL=chunk-JZTH3EMV.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
toDreamboardApiError
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-IDVQXGAO.mjs";
|
|
5
5
|
import {
|
|
6
6
|
createGameRevision,
|
|
7
7
|
createProjectSourceBlobUploadSession,
|
|
@@ -15,10 +15,10 @@ import {
|
|
|
15
15
|
listProjectCompiledResults,
|
|
16
16
|
queueProjectRevisionCompile,
|
|
17
17
|
uploadInitialProjection
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-C3VW3DTA.mjs";
|
|
19
19
|
import {
|
|
20
20
|
external_exports
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-JZTH3EMV.mjs";
|
|
22
22
|
|
|
23
23
|
// ../../node_modules/.pnpm/citty@0.2.2/node_modules/citty/dist/index.mjs
|
|
24
24
|
import { parseArgs as parseArgs$1 } from "util";
|
|
@@ -621,4 +621,4 @@ export {
|
|
|
621
621
|
uploadInitialProjectionSdk,
|
|
622
622
|
uploadProjectSourceBlobsSdk
|
|
623
623
|
};
|
|
624
|
-
//# sourceMappingURL=chunk-
|
|
624
|
+
//# sourceMappingURL=chunk-KDBSVLCF.mjs.map
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
import {
|
|
10
10
|
isDynamicSeedPath,
|
|
11
11
|
materializeManifest
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-C3VW3DTA.mjs";
|
|
13
13
|
import {
|
|
14
14
|
resolveCliRepoRoot
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-QBAF7EYR.mjs";
|
|
16
16
|
import {
|
|
17
17
|
ensureDir,
|
|
18
18
|
exists,
|
|
@@ -726,4 +726,4 @@ export {
|
|
|
726
726
|
resolveStaticAssetRoot,
|
|
727
727
|
resolveSdkDependencyRange
|
|
728
728
|
};
|
|
729
|
-
//# sourceMappingURL=chunk-
|
|
729
|
+
//# sourceMappingURL=chunk-MW2QIWWA.mjs.map
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
import {
|
|
3
3
|
bundleTypeScriptModuleText,
|
|
4
4
|
importTypeScriptModule
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-XKCJBIRY.mjs";
|
|
6
6
|
import {
|
|
7
7
|
STALE_CONTRACT_ARTIFACT_CODE,
|
|
8
8
|
isStaleContractArtifactError,
|
|
9
9
|
toDreamboardApiError
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-IDVQXGAO.mjs";
|
|
11
11
|
import {
|
|
12
12
|
loadManifest
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-27EEIZCI.mjs";
|
|
14
14
|
import {
|
|
15
15
|
REDUCER_TESTING_TYPES_WRAPPER_CONTENT,
|
|
16
16
|
buildReducerTestingContractContent
|
|
@@ -22,10 +22,10 @@ import {
|
|
|
22
22
|
getSessionSnapshot,
|
|
23
23
|
hashContent,
|
|
24
24
|
startGame
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-C3VW3DTA.mjs";
|
|
26
26
|
import {
|
|
27
27
|
external_exports
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-JZTH3EMV.mjs";
|
|
29
29
|
import {
|
|
30
30
|
ensureDir,
|
|
31
31
|
exists,
|
|
@@ -3134,4 +3134,4 @@ export {
|
|
|
3134
3134
|
generateReducerNativeArtifacts,
|
|
3135
3135
|
runReducerNativeScenarios
|
|
3136
3136
|
};
|
|
3137
|
-
//# sourceMappingURL=chunk-
|
|
3137
|
+
//# sourceMappingURL=chunk-ON62IGWK.mjs.map
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/utils/repo-root.ts
|
|
4
|
+
import { existsSync } from "fs";
|
|
5
|
+
import path from "path";
|
|
6
|
+
import { fileURLToPath } from "url";
|
|
7
|
+
function isRepoRoot(candidate) {
|
|
8
|
+
return existsSync(path.join(candidate, "pnpm-workspace.yaml")) && existsSync(path.join(candidate, "apps", "dreamboard-cli", "package.json"));
|
|
9
|
+
}
|
|
10
|
+
function resolveCliRepoRoot(importMetaUrl = import.meta.url) {
|
|
11
|
+
let current = path.dirname(fileURLToPath(importMetaUrl));
|
|
12
|
+
while (true) {
|
|
13
|
+
if (isRepoRoot(current)) {
|
|
14
|
+
return current;
|
|
15
|
+
}
|
|
16
|
+
const parent = path.dirname(current);
|
|
17
|
+
if (parent === current) {
|
|
18
|
+
break;
|
|
19
|
+
}
|
|
20
|
+
current = parent;
|
|
21
|
+
}
|
|
22
|
+
throw new Error(
|
|
23
|
+
`Could not resolve Dreamboard CLI repo root from ${importMetaUrl}.`
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// src/utils/repo-local-package-resolution.ts
|
|
28
|
+
import { existsSync as existsSync2, readdirSync, readFileSync } from "fs";
|
|
29
|
+
import { createRequire } from "module";
|
|
30
|
+
import path2 from "path";
|
|
31
|
+
var PACKAGE_INFO_CACHE = /* @__PURE__ */ new Map();
|
|
32
|
+
function normalizeRepoRoot(options) {
|
|
33
|
+
return options?.repoRoot ?? resolveCliRepoRoot(import.meta.url);
|
|
34
|
+
}
|
|
35
|
+
function readPackageInfos(repoRoot) {
|
|
36
|
+
const cached = PACKAGE_INFO_CACHE.get(repoRoot);
|
|
37
|
+
if (cached) {
|
|
38
|
+
return cached;
|
|
39
|
+
}
|
|
40
|
+
const packageInfos = /* @__PURE__ */ new Map();
|
|
41
|
+
const addPackageInfo = (packageRoot) => {
|
|
42
|
+
const packageJsonPath = path2.join(packageRoot, "package.json");
|
|
43
|
+
if (!existsSync2(packageJsonPath)) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const parsed = JSON.parse(readFileSync(packageJsonPath, "utf8"));
|
|
47
|
+
if (!parsed.name || !parsed.name.startsWith("@dreamboard/") && !parsed.name.startsWith("@dreamboard-games/") || parsed.exports === void 0) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
packageInfos.set(parsed.name, {
|
|
51
|
+
rootDir: packageRoot,
|
|
52
|
+
exports: parsed.exports
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
for (const workspaceDirName of ["packages", "apps"]) {
|
|
56
|
+
const workspaceRoot = path2.join(repoRoot, workspaceDirName);
|
|
57
|
+
if (!existsSync2(workspaceRoot)) {
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
for (const entry of readdirSync(workspaceRoot, { withFileTypes: true })) {
|
|
61
|
+
if (!entry.isDirectory()) {
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
addPackageInfo(path2.join(workspaceRoot, entry.name));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
for (const nodeModulesRoot of [
|
|
68
|
+
path2.join(repoRoot, "node_modules"),
|
|
69
|
+
path2.join(repoRoot, "apps", "dreamboard-cli", "node_modules")
|
|
70
|
+
]) {
|
|
71
|
+
for (const scopeName of ["@dreamboard", "@dreamboard-games"]) {
|
|
72
|
+
const scopeRoot = path2.join(nodeModulesRoot, scopeName);
|
|
73
|
+
if (!existsSync2(scopeRoot)) {
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
for (const entry of readdirSync(scopeRoot, { withFileTypes: true })) {
|
|
77
|
+
if (!entry.isDirectory() && !entry.isSymbolicLink()) {
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
addPackageInfo(path2.join(scopeRoot, entry.name));
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
PACKAGE_INFO_CACHE.set(repoRoot, packageInfos);
|
|
85
|
+
return packageInfos;
|
|
86
|
+
}
|
|
87
|
+
function parseDreamboardPackageSpecifier(specifier) {
|
|
88
|
+
if (!specifier.startsWith("@dreamboard/") && !specifier.startsWith("@dreamboard-games/")) {
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
const segments = specifier.split("/");
|
|
92
|
+
if (segments.length < 2) {
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
const packageName = `${segments[0]}/${segments[1]}`;
|
|
96
|
+
const subpath = segments.length === 2 ? "." : `./${segments.slice(2).join("/")}`;
|
|
97
|
+
return { packageName, subpath };
|
|
98
|
+
}
|
|
99
|
+
function resolveSourceTarget(exportEntry) {
|
|
100
|
+
if (typeof exportEntry === "string") {
|
|
101
|
+
return exportEntry;
|
|
102
|
+
}
|
|
103
|
+
if (typeof exportEntry === "object" && exportEntry !== null && "dreamboard-source" in exportEntry && typeof exportEntry["dreamboard-source"] === "string") {
|
|
104
|
+
return exportEntry["dreamboard-source"];
|
|
105
|
+
}
|
|
106
|
+
if (typeof exportEntry === "object" && exportEntry !== null && "bun" in exportEntry && typeof exportEntry.bun === "string") {
|
|
107
|
+
return exportEntry.bun;
|
|
108
|
+
}
|
|
109
|
+
if (typeof exportEntry === "object" && exportEntry !== null && "import" in exportEntry && typeof exportEntry.import === "string") {
|
|
110
|
+
return exportEntry.import;
|
|
111
|
+
}
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
function resolveSourceTargetForSubpath(options) {
|
|
115
|
+
if (typeof options.exportsField !== "object" || options.exportsField === null || Array.isArray(options.exportsField)) {
|
|
116
|
+
return options.subpath === "." ? resolveSourceTarget(options.exportsField) : null;
|
|
117
|
+
}
|
|
118
|
+
const exportsMap = options.exportsField;
|
|
119
|
+
if (options.subpath === ".") {
|
|
120
|
+
return resolveSourceTarget(exportsMap["."]) ?? resolveSourceTarget(exportsMap);
|
|
121
|
+
}
|
|
122
|
+
const exactTarget = resolveSourceTarget(exportsMap[options.subpath]);
|
|
123
|
+
if (exactTarget) {
|
|
124
|
+
return exactTarget;
|
|
125
|
+
}
|
|
126
|
+
const wildcardEntries = Object.entries(exportsMap).filter(([key]) => key.includes("*")).sort(([left], [right]) => right.length - left.length);
|
|
127
|
+
for (const [pattern, exportEntry] of wildcardEntries) {
|
|
128
|
+
const starIndex = pattern.indexOf("*");
|
|
129
|
+
const prefix = pattern.slice(0, starIndex);
|
|
130
|
+
const suffix = pattern.slice(starIndex + 1);
|
|
131
|
+
if (!options.subpath.startsWith(prefix) || !options.subpath.endsWith(suffix)) {
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
134
|
+
const wildcardValue = options.subpath.slice(
|
|
135
|
+
prefix.length,
|
|
136
|
+
options.subpath.length - suffix.length
|
|
137
|
+
);
|
|
138
|
+
const targetPattern = resolveSourceTarget(exportEntry);
|
|
139
|
+
if (!targetPattern) {
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
return targetPattern.replace("*", wildcardValue);
|
|
143
|
+
}
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
function resolveRepoLocalPackageSource(specifier, options) {
|
|
147
|
+
const parsedSpecifier = parseDreamboardPackageSpecifier(specifier);
|
|
148
|
+
if (!parsedSpecifier) {
|
|
149
|
+
return null;
|
|
150
|
+
}
|
|
151
|
+
let repoRoot;
|
|
152
|
+
try {
|
|
153
|
+
repoRoot = normalizeRepoRoot(options);
|
|
154
|
+
} catch {
|
|
155
|
+
return null;
|
|
156
|
+
}
|
|
157
|
+
const packageInfo = readPackageInfos(repoRoot).get(
|
|
158
|
+
parsedSpecifier.packageName
|
|
159
|
+
);
|
|
160
|
+
if (!packageInfo) {
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
163
|
+
const sourceTarget = resolveSourceTargetForSubpath({
|
|
164
|
+
exportsField: packageInfo.exports,
|
|
165
|
+
subpath: parsedSpecifier.subpath
|
|
166
|
+
});
|
|
167
|
+
if (!sourceTarget) {
|
|
168
|
+
return null;
|
|
169
|
+
}
|
|
170
|
+
return path2.join(packageInfo.rootDir, sourceTarget);
|
|
171
|
+
}
|
|
172
|
+
var cliPackageRequire = createRequire(import.meta.url);
|
|
173
|
+
function resolvableFromDirectory(specifier, directory) {
|
|
174
|
+
try {
|
|
175
|
+
createRequire(path2.join(directory, "noop.js")).resolve(specifier);
|
|
176
|
+
return true;
|
|
177
|
+
} catch {
|
|
178
|
+
return false;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
function resolveCliBundledPackage(specifier) {
|
|
182
|
+
try {
|
|
183
|
+
return cliPackageRequire.resolve(specifier);
|
|
184
|
+
} catch {
|
|
185
|
+
return null;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
function createRepoLocalPackageResolutionPlugin(options) {
|
|
189
|
+
return {
|
|
190
|
+
name: "dreamboard-repo-local-package-resolution",
|
|
191
|
+
setup(build) {
|
|
192
|
+
build.onResolve({ filter: /^@dreamboard(?:-games)?\// }, (args) => {
|
|
193
|
+
const resolvedPath = resolveRepoLocalPackageSource(args.path, options);
|
|
194
|
+
if (resolvedPath) {
|
|
195
|
+
return { path: resolvedPath };
|
|
196
|
+
}
|
|
197
|
+
if (resolvableFromDirectory(args.path, args.resolveDir)) {
|
|
198
|
+
return null;
|
|
199
|
+
}
|
|
200
|
+
const bundledPath = resolveCliBundledPackage(args.path);
|
|
201
|
+
if (bundledPath) {
|
|
202
|
+
return { path: bundledPath };
|
|
203
|
+
}
|
|
204
|
+
return null;
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export {
|
|
211
|
+
resolveCliRepoRoot,
|
|
212
|
+
createRepoLocalPackageResolutionPlugin
|
|
213
|
+
};
|
|
214
|
+
//# sourceMappingURL=chunk-QBAF7EYR.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/repo-root.ts","../../src/utils/repo-local-package-resolution.ts"],"sourcesContent":["import { existsSync } from \"node:fs\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nfunction isRepoRoot(candidate: string): boolean {\n return (\n existsSync(path.join(candidate, \"pnpm-workspace.yaml\")) &&\n existsSync(path.join(candidate, \"apps\", \"dreamboard-cli\", \"package.json\"))\n );\n}\n\nexport function resolveCliRepoRoot(importMetaUrl: string = import.meta.url) {\n let current = path.dirname(fileURLToPath(importMetaUrl));\n\n while (true) {\n if (isRepoRoot(current)) {\n return current;\n }\n\n const parent = path.dirname(current);\n if (parent === current) {\n break;\n }\n current = parent;\n }\n\n throw new Error(\n `Could not resolve Dreamboard CLI repo root from ${importMetaUrl}.`,\n );\n}\n","import { existsSync, readdirSync, readFileSync } from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport path from \"node:path\";\nimport type { Plugin } from \"esbuild\";\nimport { resolveCliRepoRoot } from \"./repo-root.js\";\n\ntype RepoLocalPackageInfo = {\n rootDir: string;\n exports: unknown;\n};\n\ntype RepoLocalPackageResolutionOptions = {\n repoRoot?: string;\n};\n\nconst PACKAGE_INFO_CACHE = new Map<string, Map<string, RepoLocalPackageInfo>>();\n\nfunction normalizeRepoRoot(\n options?: RepoLocalPackageResolutionOptions,\n): string {\n return options?.repoRoot ?? resolveCliRepoRoot(import.meta.url);\n}\n\nfunction readPackageInfos(repoRoot: string): Map<string, RepoLocalPackageInfo> {\n const cached = PACKAGE_INFO_CACHE.get(repoRoot);\n if (cached) {\n return cached;\n }\n\n const packageInfos = new Map<string, RepoLocalPackageInfo>();\n const addPackageInfo = (packageRoot: string): void => {\n const packageJsonPath = path.join(packageRoot, \"package.json\");\n if (!existsSync(packageJsonPath)) {\n return;\n }\n\n const parsed = JSON.parse(readFileSync(packageJsonPath, \"utf8\")) as {\n name?: string;\n exports?: unknown;\n };\n if (\n !parsed.name ||\n (!parsed.name.startsWith(\"@dreamboard/\") &&\n !parsed.name.startsWith(\"@dreamboard-games/\")) ||\n parsed.exports === undefined\n ) {\n return;\n }\n\n packageInfos.set(parsed.name, {\n rootDir: packageRoot,\n exports: parsed.exports,\n });\n };\n\n for (const workspaceDirName of [\"packages\", \"apps\"]) {\n const workspaceRoot = path.join(repoRoot, workspaceDirName);\n if (!existsSync(workspaceRoot)) {\n continue;\n }\n\n for (const entry of readdirSync(workspaceRoot, { withFileTypes: true })) {\n if (!entry.isDirectory()) {\n continue;\n }\n addPackageInfo(path.join(workspaceRoot, entry.name));\n }\n }\n\n for (const nodeModulesRoot of [\n path.join(repoRoot, \"node_modules\"),\n path.join(repoRoot, \"apps\", \"dreamboard-cli\", \"node_modules\"),\n ]) {\n for (const scopeName of [\"@dreamboard\", \"@dreamboard-games\"]) {\n const scopeRoot = path.join(nodeModulesRoot, scopeName);\n if (!existsSync(scopeRoot)) {\n continue;\n }\n\n for (const entry of readdirSync(scopeRoot, { withFileTypes: true })) {\n if (!entry.isDirectory() && !entry.isSymbolicLink()) {\n continue;\n }\n addPackageInfo(path.join(scopeRoot, entry.name));\n }\n }\n }\n\n PACKAGE_INFO_CACHE.set(repoRoot, packageInfos);\n return packageInfos;\n}\n\nfunction parseDreamboardPackageSpecifier(specifier: string): {\n packageName: string;\n subpath: string;\n} | null {\n if (\n !specifier.startsWith(\"@dreamboard/\") &&\n !specifier.startsWith(\"@dreamboard-games/\")\n ) {\n return null;\n }\n\n const segments = specifier.split(\"/\");\n if (segments.length < 2) {\n return null;\n }\n\n const packageName = `${segments[0]}/${segments[1]}`;\n const subpath =\n segments.length === 2 ? \".\" : `./${segments.slice(2).join(\"/\")}`;\n return { packageName, subpath };\n}\n\nfunction resolveSourceTarget(exportEntry: unknown): string | null {\n if (typeof exportEntry === \"string\") {\n return exportEntry;\n }\n if (\n typeof exportEntry === \"object\" &&\n exportEntry !== null &&\n \"dreamboard-source\" in exportEntry &&\n typeof (exportEntry as { \"dreamboard-source\"?: unknown })[\n \"dreamboard-source\"\n ] === \"string\"\n ) {\n return (exportEntry as { \"dreamboard-source\": string })[\n \"dreamboard-source\"\n ];\n }\n if (\n typeof exportEntry === \"object\" &&\n exportEntry !== null &&\n \"bun\" in exportEntry &&\n typeof (exportEntry as { bun?: unknown }).bun === \"string\"\n ) {\n return (exportEntry as { bun: string }).bun;\n }\n if (\n typeof exportEntry === \"object\" &&\n exportEntry !== null &&\n \"import\" in exportEntry &&\n typeof (exportEntry as { import?: unknown }).import === \"string\"\n ) {\n return (exportEntry as { import: string }).import;\n }\n return null;\n}\n\nfunction resolveSourceTargetForSubpath(options: {\n exportsField: unknown;\n subpath: string;\n}): string | null {\n if (\n typeof options.exportsField !== \"object\" ||\n options.exportsField === null ||\n Array.isArray(options.exportsField)\n ) {\n return options.subpath === \".\"\n ? resolveSourceTarget(options.exportsField)\n : null;\n }\n\n const exportsMap = options.exportsField as Record<string, unknown>;\n if (options.subpath === \".\") {\n return (\n resolveSourceTarget(exportsMap[\".\"]) ?? resolveSourceTarget(exportsMap)\n );\n }\n const exactTarget = resolveSourceTarget(exportsMap[options.subpath]);\n if (exactTarget) {\n return exactTarget;\n }\n\n const wildcardEntries = Object.entries(exportsMap)\n .filter(([key]) => key.includes(\"*\"))\n .sort(([left], [right]) => right.length - left.length);\n for (const [pattern, exportEntry] of wildcardEntries) {\n const starIndex = pattern.indexOf(\"*\");\n const prefix = pattern.slice(0, starIndex);\n const suffix = pattern.slice(starIndex + 1);\n if (\n !options.subpath.startsWith(prefix) ||\n !options.subpath.endsWith(suffix)\n ) {\n continue;\n }\n\n const wildcardValue = options.subpath.slice(\n prefix.length,\n options.subpath.length - suffix.length,\n );\n const targetPattern = resolveSourceTarget(exportEntry);\n if (!targetPattern) {\n continue;\n }\n return targetPattern.replace(\"*\", wildcardValue);\n }\n\n return null;\n}\n\nexport function resolveRepoLocalPackageSource(\n specifier: string,\n options?: RepoLocalPackageResolutionOptions,\n): string | null {\n const parsedSpecifier = parseDreamboardPackageSpecifier(specifier);\n if (!parsedSpecifier) {\n return null;\n }\n\n let repoRoot: string;\n try {\n repoRoot = normalizeRepoRoot(options);\n } catch {\n return null;\n }\n\n const packageInfo = readPackageInfos(repoRoot).get(\n parsedSpecifier.packageName,\n );\n if (!packageInfo) {\n return null;\n }\n\n const sourceTarget = resolveSourceTargetForSubpath({\n exportsField: packageInfo.exports,\n subpath: parsedSpecifier.subpath,\n });\n if (!sourceTarget) {\n return null;\n }\n\n return path.join(packageInfo.rootDir, sourceTarget);\n}\n\nconst cliPackageRequire = createRequire(import.meta.url);\n\nfunction resolvableFromDirectory(\n specifier: string,\n directory: string,\n): boolean {\n try {\n createRequire(path.join(directory, \"noop.js\")).resolve(specifier);\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Resolve a `@dreamboard-games/*` specifier against the CLI package's own\n * dependency tree. This keeps manifest evaluation working in workspaces that\n * have not installed their dependencies yet (for example right after\n * `dreamboard clone`), where the installed CLI's pinned SDK is the only\n * available copy.\n */\nfunction resolveCliBundledPackage(specifier: string): string | null {\n try {\n return cliPackageRequire.resolve(specifier);\n } catch {\n return null;\n }\n}\n\nexport function createRepoLocalPackageResolutionPlugin(\n options?: RepoLocalPackageResolutionOptions,\n): Plugin {\n return {\n name: \"dreamboard-repo-local-package-resolution\",\n setup(build) {\n build.onResolve({ filter: /^@dreamboard(?:-games)?\\// }, (args) => {\n const resolvedPath = resolveRepoLocalPackageSource(args.path, options);\n if (resolvedPath) {\n return { path: resolvedPath };\n }\n // Prefer the workspace's own installed copy when present; returning\n // null lets esbuild perform its normal node_modules resolution.\n if (resolvableFromDirectory(args.path, args.resolveDir)) {\n return null;\n }\n const bundledPath = resolveCliBundledPackage(args.path);\n if (bundledPath) {\n return { path: bundledPath };\n }\n return null;\n });\n },\n };\n}\n"],"mappings":";;;AAAA,SAAS,kBAAkB;AAC3B,OAAO,UAAU;AACjB,SAAS,qBAAqB;AAE9B,SAAS,WAAW,WAA4B;AAC9C,SACE,WAAW,KAAK,KAAK,WAAW,qBAAqB,CAAC,KACtD,WAAW,KAAK,KAAK,WAAW,QAAQ,kBAAkB,cAAc,CAAC;AAE7E;AAEO,SAAS,mBAAmB,gBAAwB,YAAY,KAAK;AAC1E,MAAI,UAAU,KAAK,QAAQ,cAAc,aAAa,CAAC;AAEvD,SAAO,MAAM;AACX,QAAI,WAAW,OAAO,GAAG;AACvB,aAAO;AAAA,IACT;AAEA,UAAM,SAAS,KAAK,QAAQ,OAAO;AACnC,QAAI,WAAW,SAAS;AACtB;AAAA,IACF;AACA,cAAU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,eAAO;AAAA,MACT,CAAC;AAAA,IACH;AAAA,EACF;AACF;","names":["existsSync","path","path","existsSync"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
ensureProjectSdk,
|
|
4
4
|
loadRemoteProjectIdentity
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-KDBSVLCF.mjs";
|
|
6
6
|
import {
|
|
7
7
|
updateProjectState
|
|
8
8
|
} from "./chunk-776W3UGV.mjs";
|
|
@@ -36,4 +36,4 @@ async function resolveRemoteProject(options) {
|
|
|
36
36
|
export {
|
|
37
37
|
resolveRemoteProject
|
|
38
38
|
};
|
|
39
|
-
//# sourceMappingURL=chunk-
|
|
39
|
+
//# sourceMappingURL=chunk-QZH6IEZS.mjs.map
|
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
createRepoLocalPackageResolutionPlugin,
|
|
4
|
-
require_main,
|
|
5
4
|
resolveCliRepoRoot
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import {
|
|
8
|
-
__toESM
|
|
9
|
-
} from "./chunk-SKI2ESE5.mjs";
|
|
5
|
+
} from "./chunk-QBAF7EYR.mjs";
|
|
10
6
|
|
|
11
7
|
// src/utils/ts-module-loader.ts
|
|
12
|
-
var import_esbuild = __toESM(require_main(), 1);
|
|
13
8
|
import { mkdtemp, rm, writeFile } from "fs/promises";
|
|
14
9
|
import { tmpdir } from "os";
|
|
15
10
|
import path from "path";
|
|
16
11
|
import { pathToFileURL } from "url";
|
|
12
|
+
import { build } from "esbuild";
|
|
17
13
|
var ESBUILD_EXTERNALS = [
|
|
18
14
|
"playwright",
|
|
19
15
|
"playwright-core",
|
|
@@ -39,7 +35,7 @@ function resolveSourceCheckoutBuildContext() {
|
|
|
39
35
|
}
|
|
40
36
|
async function bundleTypeScriptModuleText(entryPath, options = {}) {
|
|
41
37
|
const sourceCheckoutContext = resolveSourceCheckoutBuildContext();
|
|
42
|
-
const result = await
|
|
38
|
+
const result = await build({
|
|
43
39
|
entryPoints: [entryPath],
|
|
44
40
|
bundle: true,
|
|
45
41
|
format: "esm",
|
|
@@ -76,4 +72,4 @@ export {
|
|
|
76
72
|
bundleTypeScriptModuleText,
|
|
77
73
|
importTypeScriptModule
|
|
78
74
|
};
|
|
79
|
-
//# sourceMappingURL=chunk-
|
|
75
|
+
//# sourceMappingURL=chunk-XKCJBIRY.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/ts-module-loader.ts"],"sourcesContent":["import { mkdtemp, rm, writeFile } from \"node:fs/promises\";\nimport { tmpdir } from \"node:os\";\nimport path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { build } from \"esbuild\";\nimport { resolveCliRepoRoot } from \"./repo-root.js\";\nimport { createRepoLocalPackageResolutionPlugin } from \"./repo-local-package-resolution.js\";\n\nconst ESBUILD_EXTERNALS = [\n \"playwright\",\n \"playwright-core\",\n \"chromium-bidi\",\n \"electron\",\n];\n\nfunction resolveSourceCheckoutBuildContext(): {\n nodePaths: string[];\n plugins: ReturnType<typeof createRepoLocalPackageResolutionPlugin>[];\n} {\n try {\n const repoRoot = resolveCliRepoRoot(import.meta.url);\n return {\n nodePaths: [\n path.join(repoRoot, \"apps\", \"dreamboard-cli\", \"node_modules\"),\n path.join(repoRoot, \"node_modules\"),\n ],\n plugins: [createRepoLocalPackageResolutionPlugin({ repoRoot })],\n };\n } catch {\n return {\n nodePaths: [path.join(process.cwd(), \"node_modules\")],\n plugins: [],\n };\n }\n}\n\nexport async function bundleTypeScriptModuleText(\n entryPath: string,\n options: { external?: readonly string[] } = {},\n): Promise<string> {\n const sourceCheckoutContext = resolveSourceCheckoutBuildContext();\n const result = await build({\n entryPoints: [entryPath],\n bundle: true,\n format: \"esm\",\n platform: \"node\",\n target: \"node24\",\n sourcemap: \"inline\",\n external: [...ESBUILD_EXTERNALS, ...(options.external ?? [])],\n nodePaths: sourceCheckoutContext.nodePaths,\n plugins: sourceCheckoutContext.plugins,\n write: false,\n });\n\n const output = result.outputFiles?.[0];\n if (!output) {\n throw new Error(`Failed to bundle TypeScript module '${entryPath}'.`);\n }\n return output.text;\n}\n\nexport async function importTypeScriptModule<T>(entryPath: string): Promise<T> {\n const tempDir = await mkdtemp(path.join(tmpdir(), \"dreamboard-ts-module-\"));\n const outfile = path.join(\n tempDir,\n `${path.basename(entryPath).replace(/\\.[^.]+$/u, \"\")}.mjs`,\n );\n\n try {\n const bundledText = await bundleTypeScriptModuleText(entryPath);\n await writeFile(outfile, bundledText);\n\n return (await import(pathToFileURL(outfile).href)) as T;\n } finally {\n await rm(tempDir, { recursive: true, force: true });\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/utils/ts-module-loader.ts"],"sourcesContent":["import { mkdtemp, rm, writeFile } from \"node:fs/promises\";\nimport { tmpdir } from \"node:os\";\nimport path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { build } from \"esbuild\";\nimport { resolveCliRepoRoot } from \"./repo-root.js\";\nimport { createRepoLocalPackageResolutionPlugin } from \"./repo-local-package-resolution.js\";\n\nconst ESBUILD_EXTERNALS = [\n \"playwright\",\n \"playwright-core\",\n \"chromium-bidi\",\n \"electron\",\n];\n\nfunction resolveSourceCheckoutBuildContext(): {\n nodePaths: string[];\n plugins: ReturnType<typeof createRepoLocalPackageResolutionPlugin>[];\n} {\n try {\n const repoRoot = resolveCliRepoRoot(import.meta.url);\n return {\n nodePaths: [\n path.join(repoRoot, \"apps\", \"dreamboard-cli\", \"node_modules\"),\n path.join(repoRoot, \"node_modules\"),\n ],\n plugins: [createRepoLocalPackageResolutionPlugin({ repoRoot })],\n };\n } catch {\n return {\n nodePaths: [path.join(process.cwd(), \"node_modules\")],\n plugins: [],\n };\n }\n}\n\nexport async function bundleTypeScriptModuleText(\n entryPath: string,\n options: { external?: readonly string[] } = {},\n): Promise<string> {\n const sourceCheckoutContext = resolveSourceCheckoutBuildContext();\n const result = await build({\n entryPoints: [entryPath],\n bundle: true,\n format: \"esm\",\n platform: \"node\",\n target: \"node24\",\n sourcemap: \"inline\",\n external: [...ESBUILD_EXTERNALS, ...(options.external ?? [])],\n nodePaths: sourceCheckoutContext.nodePaths,\n plugins: sourceCheckoutContext.plugins,\n write: false,\n });\n\n const output = result.outputFiles?.[0];\n if (!output) {\n throw new Error(`Failed to bundle TypeScript module '${entryPath}'.`);\n }\n return output.text;\n}\n\nexport async function importTypeScriptModule<T>(entryPath: string): Promise<T> {\n const tempDir = await mkdtemp(path.join(tmpdir(), \"dreamboard-ts-module-\"));\n const outfile = path.join(\n tempDir,\n `${path.basename(entryPath).replace(/\\.[^.]+$/u, \"\")}.mjs`,\n );\n\n try {\n const bundledText = await bundleTypeScriptModuleText(entryPath);\n await writeFile(outfile, bundledText);\n\n return (await import(pathToFileURL(outfile).href)) as T;\n } finally {\n await rm(tempDir, { recursive: true, force: true });\n }\n}\n"],"mappings":";;;;;;;AAAA,SAAS,SAAS,IAAI,iBAAiB;AACvC,SAAS,cAAc;AACvB,OAAO,UAAU;AACjB,SAAS,qBAAqB;AAC9B,SAAS,aAAa;AAItB,IAAM,oBAAoB;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,SAAS,oCAGP;AACA,MAAI;AACF,UAAM,WAAW,mBAAmB,YAAY,GAAG;AACnD,WAAO;AAAA,MACL,WAAW;AAAA,QACT,KAAK,KAAK,UAAU,QAAQ,kBAAkB,cAAc;AAAA,QAC5D,KAAK,KAAK,UAAU,cAAc;AAAA,MACpC;AAAA,MACA,SAAS,CAAC,uCAAuC,EAAE,SAAS,CAAC,CAAC;AAAA,IAChE;AAAA,EACF,QAAQ;AACN,WAAO;AAAA,MACL,WAAW,CAAC,KAAK,KAAK,QAAQ,IAAI,GAAG,cAAc,CAAC;AAAA,MACpD,SAAS,CAAC;AAAA,IACZ;AAAA,EACF;AACF;AAEA,eAAsB,2BACpB,WACA,UAA4C,CAAC,GAC5B;AACjB,QAAM,wBAAwB,kCAAkC;AAChE,QAAM,SAAS,MAAM,MAAM;AAAA,IACzB,aAAa,CAAC,SAAS;AAAA,IACvB,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,UAAU,CAAC,GAAG,mBAAmB,GAAI,QAAQ,YAAY,CAAC,CAAE;AAAA,IAC5D,WAAW,sBAAsB;AAAA,IACjC,SAAS,sBAAsB;AAAA,IAC/B,OAAO;AAAA,EACT,CAAC;AAED,QAAM,SAAS,OAAO,cAAc,CAAC;AACrC,MAAI,CAAC,QAAQ;AACX,UAAM,IAAI,MAAM,uCAAuC,SAAS,IAAI;AAAA,EACtE;AACA,SAAO,OAAO;AAChB;AAEA,eAAsB,uBAA0B,WAA+B;AAC7E,QAAM,UAAU,MAAM,QAAQ,KAAK,KAAK,OAAO,GAAG,uBAAuB,CAAC;AAC1E,QAAM,UAAU,KAAK;AAAA,IACnB;AAAA,IACA,GAAG,KAAK,SAAS,SAAS,EAAE,QAAQ,aAAa,EAAE,CAAC;AAAA,EACtD;AAEA,MAAI;AACF,UAAM,cAAc,MAAM,2BAA2B,SAAS;AAC9D,UAAM,UAAU,SAAS,WAAW;AAEpC,WAAQ,MAAM,OAAO,cAAc,OAAO,EAAE;AAAA,EAC9C,UAAE;AACA,UAAM,GAAG,SAAS,EAAE,WAAW,MAAM,OAAO,KAAK,CAAC;AAAA,EACpD;AACF;","names":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
importTypeScriptModule
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-XKCJBIRY.mjs";
|
|
5
5
|
|
|
6
6
|
// src/services/project/reducer-contract-preflight.ts
|
|
7
7
|
import path from "path";
|
|
@@ -42,4 +42,4 @@ async function assertReducerContractPreflight(projectRoot) {
|
|
|
42
42
|
export {
|
|
43
43
|
assertReducerContractPreflight
|
|
44
44
|
};
|
|
45
|
-
//# sourceMappingURL=chunk-
|
|
45
|
+
//# sourceMappingURL=chunk-YDIOW2BO.mjs.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
importTypeScriptModule
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-XKCJBIRY.mjs";
|
|
5
5
|
import {
|
|
6
6
|
external_exports
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-JZTH3EMV.mjs";
|
|
8
8
|
|
|
9
9
|
// src/services/project/reducer-bundle-preflight.ts
|
|
10
10
|
import path from "path";
|
|
@@ -258,4 +258,4 @@ export {
|
|
|
258
258
|
runReducerBundleSmoke,
|
|
259
259
|
assertReducerBundleSmoke
|
|
260
260
|
};
|
|
261
|
-
//# sourceMappingURL=chunk-
|
|
261
|
+
//# sourceMappingURL=chunk-Z6OZWUIZ.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
resolveRemoteProject
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-QZH6IEZS.mjs";
|
|
5
5
|
import {
|
|
6
6
|
CONFIG_FLAG_ARGS,
|
|
7
7
|
defineCommand,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
parseCompileCommandArgs,
|
|
10
10
|
queueProjectRevisionCompileSdk,
|
|
11
11
|
waitForCompiledResultJobSdk
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-KDBSVLCF.mjs";
|
|
13
13
|
import {
|
|
14
14
|
getProjectAuthoringState,
|
|
15
15
|
getProjectPendingAuthoringSync,
|
|
@@ -20,33 +20,33 @@ import {
|
|
|
20
20
|
} from "./chunk-UIOLGH4A.mjs";
|
|
21
21
|
import {
|
|
22
22
|
formatCliError
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-IDVQXGAO.mjs";
|
|
24
24
|
import {
|
|
25
25
|
assertCompilerPortableDependencies,
|
|
26
26
|
assertReleaseEnvironmentPortableDependencies,
|
|
27
27
|
consola,
|
|
28
28
|
resolveProjectContext
|
|
29
|
-
} from "./chunk-
|
|
30
|
-
import "./chunk-
|
|
29
|
+
} from "./chunk-JO5AMVZU.mjs";
|
|
30
|
+
import "./chunk-5NYBTZB4.mjs";
|
|
31
31
|
import {
|
|
32
32
|
getLocalDiff
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-27EEIZCI.mjs";
|
|
34
34
|
import {
|
|
35
35
|
assertCliStaticScaffoldComplete
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-MW2QIWWA.mjs";
|
|
37
37
|
import "./chunk-F2DIOJJZ.mjs";
|
|
38
38
|
import {
|
|
39
39
|
updateProjectState
|
|
40
40
|
} from "./chunk-776W3UGV.mjs";
|
|
41
|
-
import "./chunk-
|
|
42
|
-
import "./chunk-
|
|
43
|
-
import "./chunk-
|
|
41
|
+
import "./chunk-C3VW3DTA.mjs";
|
|
42
|
+
import "./chunk-JZTH3EMV.mjs";
|
|
43
|
+
import "./chunk-QBAF7EYR.mjs";
|
|
44
44
|
import "./chunk-NAK77WXW.mjs";
|
|
45
45
|
import "./chunk-TAEQKBJB.mjs";
|
|
46
46
|
import "./chunk-IAYRNVUC.mjs";
|
|
47
47
|
import "./chunk-ZEELHSY3.mjs";
|
|
48
48
|
import "./chunk-H76MT5UR.mjs";
|
|
49
|
-
import "./chunk-
|
|
49
|
+
import "./chunk-H6XDQJ3N.mjs";
|
|
50
50
|
|
|
51
51
|
// src/commands/compile.ts
|
|
52
52
|
function formatDiagnosticsSummary(diagnostics) {
|
|
@@ -309,4 +309,4 @@ var compile_default = defineCommand({
|
|
|
309
309
|
export {
|
|
310
310
|
compile_default as default
|
|
311
311
|
};
|
|
312
|
-
//# sourceMappingURL=compile-
|
|
312
|
+
//# sourceMappingURL=compile-576O7TYP.mjs.map
|
|
@@ -4,15 +4,15 @@ import {
|
|
|
4
4
|
getGlobalConfigPath,
|
|
5
5
|
loadGlobalConfig,
|
|
6
6
|
saveGlobalConfig
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-5NYBTZB4.mjs";
|
|
8
8
|
import "./chunk-TAEQKBJB.mjs";
|
|
9
9
|
import "./chunk-IAYRNVUC.mjs";
|
|
10
10
|
import "./chunk-H76MT5UR.mjs";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-H6XDQJ3N.mjs";
|
|
12
12
|
export {
|
|
13
13
|
getGlobalAuthPath,
|
|
14
14
|
getGlobalConfigPath,
|
|
15
15
|
loadGlobalConfig,
|
|
16
16
|
saveGlobalConfig
|
|
17
17
|
};
|
|
18
|
-
//# sourceMappingURL=global-config-
|
|
18
|
+
//# sourceMappingURL=global-config-NYCSCAUI.mjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import "./chunk-
|
|
2
|
+
import "./chunk-H6XDQJ3N.mjs";
|
|
3
3
|
|
|
4
4
|
// src/config/keychain-backend.ts
|
|
5
5
|
var KEYCHAIN_SERVICE = "dreamboard-cli";
|
|
@@ -132,4 +132,4 @@ export {
|
|
|
132
132
|
_setKeyringModuleForTests,
|
|
133
133
|
tryKeychainBackend
|
|
134
134
|
};
|
|
135
|
-
//# sourceMappingURL=keychain-backend-
|
|
135
|
+
//# sourceMappingURL=keychain-backend-A3MRWLPF.mjs.map
|
|
@@ -14,17 +14,17 @@ import {
|
|
|
14
14
|
writeSnapshot,
|
|
15
15
|
writeSnapshotFromFiles,
|
|
16
16
|
writeSourceFiles
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-27EEIZCI.mjs";
|
|
18
18
|
import {
|
|
19
19
|
computeManifestHash
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-C3VW3DTA.mjs";
|
|
21
|
+
import "./chunk-JZTH3EMV.mjs";
|
|
22
|
+
import "./chunk-QBAF7EYR.mjs";
|
|
23
23
|
import "./chunk-NAK77WXW.mjs";
|
|
24
24
|
import "./chunk-TAEQKBJB.mjs";
|
|
25
25
|
import "./chunk-IAYRNVUC.mjs";
|
|
26
26
|
import "./chunk-H76MT5UR.mjs";
|
|
27
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-H6XDQJ3N.mjs";
|
|
28
28
|
export {
|
|
29
29
|
collectLocalFiles,
|
|
30
30
|
computeManifestHash,
|
|
@@ -42,4 +42,4 @@ export {
|
|
|
42
42
|
writeSnapshotFromFiles,
|
|
43
43
|
writeSourceFiles
|
|
44
44
|
};
|
|
45
|
-
//# sourceMappingURL=local-files-
|
|
45
|
+
//# sourceMappingURL=local-files-QVJ2H3MH.mjs.map
|
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
runLocalTypecheck
|
|
4
4
|
} from "./chunk-UIOLGH4A.mjs";
|
|
5
5
|
import "./chunk-H76MT5UR.mjs";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-H6XDQJ3N.mjs";
|
|
7
7
|
export {
|
|
8
8
|
runLocalTypecheck
|
|
9
9
|
};
|
|
10
|
-
//# sourceMappingURL=local-typecheck-
|
|
10
|
+
//# sourceMappingURL=local-typecheck-2JWG5IGL.mjs.map
|