@xanots/sdk 0.0.3-beta.0 → 0.0.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/CHANGELOG.md +80 -0
- package/README.md +35 -2
- package/dist/agent-file-refresh-IJ7GN2FJ.js +17 -0
- package/dist/bin.js +12 -153
- package/dist/{capture-HUV5BNTC.js → capture-7PO6SGB4.js} +2 -2
- package/dist/{chunk-WRYT2PAX.js → chunk-7SISR3CS.js} +24 -36
- package/dist/{chunk-7DKX2SPN.js → chunk-ACQCK4DT.js} +4 -4
- package/dist/{chunk-XQ22GLYS.js → chunk-AJ7JQ4OU.js} +5 -5
- package/dist/{chunk-EWFHDJY5.js → chunk-ALNQCWAW.js} +2 -2
- package/dist/{chunk-55VHDNW5.js → chunk-BPEEGJJA.js} +108 -3
- package/dist/{chunk-U3G2UW65.js → chunk-CYJ7R3AD.js} +3 -3
- package/dist/{agent-file-refresh-J3KY54E5.js → chunk-D6OGU2AI.js} +5 -6
- package/dist/{chunk-VVXPK6SE.js → chunk-DUC3PXDG.js} +150 -45
- package/dist/{chunk-4HKZH6YK.js → chunk-EAIR6VUL.js} +235 -10
- package/dist/chunk-ERQZFWIW.js +22 -0
- package/dist/{chunk-TQUO2OXY.js → chunk-FN4OQT2J.js} +4 -4
- package/dist/{chunk-FY6LXRR6.js → chunk-KGNJM4LN.js} +2 -2
- package/dist/{chunk-HJPTWBLH.js → chunk-MFIHIS6B.js} +2 -2
- package/dist/{chunk-F6JCFRKO.js → chunk-PXXLBXOP.js} +2 -2
- package/dist/{chunk-YZ4GU6F5.js → chunk-QUUB7HYK.js} +5 -838
- package/dist/{chunk-HKAX756N.js → chunk-SWIXWJIY.js} +3 -3
- package/dist/{chunk-76QBEIGO.js → chunk-T4XPCJRF.js} +3 -2
- package/dist/chunk-T6N3VMMO.js +173 -0
- package/dist/{chunk-CBL57QBQ.js → chunk-VKD3EBKG.js} +112 -21
- package/dist/{chunk-MWLNBSTY.js → chunk-VWGJQTNA.js} +3 -3
- package/dist/chunk-WGDAOOXG.js +845 -0
- package/dist/{chunk-4YMD2OOZ.js → chunk-XHEXOES3.js} +1 -1
- package/dist/{chunk-4HT3BNZ7.js → chunk-YUBJLB6G.js} +10 -2
- package/dist/{chunk-5L4X5LS6.js → chunk-YUPQOLFX.js} +77 -2
- package/dist/{chunk-QO4I5OYF.js → chunk-YYSJAAJM.js} +36 -3
- package/dist/{chunk-P3TTMWUP.js → chunk-ZOYMZZ3S.js} +8 -1
- package/dist/chunk-ZSYZTGJH.js +81 -0
- package/dist/cli.d.ts +15 -0
- package/dist/cli.js +8 -8
- package/dist/{codegen-command-EXLKZ2ZI.js → codegen-command-Z7WQMOJ7.js} +21 -20
- package/dist/{completion-2PVZK6YX.js → completion-4GYN752B.js} +2 -2
- package/dist/{deploy-command-SXX6RJWM.js → deploy-command-M2S4HHLC.js} +26 -26
- package/dist/{env-target-3EGIPR4D.js → env-target-GSFCYHKZ.js} +6 -6
- package/dist/{ephemeral-command-OGOYP7D6.js → ephemeral-command-6WJW7LP6.js} +24 -24
- package/dist/index.d.ts +2 -2
- package/dist/index.js +13 -7
- package/dist/init-command-GJUPWTKA.js +30 -0
- package/dist/internal.d.ts +2 -2
- package/dist/internal.js +53 -7
- package/dist/{io-AMIKRLPC.js → io-7VIA5SON.js} +3 -3
- package/dist/{live-diff-RXSJCVJ7.js → live-diff-FP4SFNT4.js} +2 -2
- package/dist/{lock-3CVKALKT.js → lock-KXOJIGCG.js} +2 -2
- package/dist/{lock-commands-R22J54XV.js → lock-commands-7IH7RSSP.js} +9 -9
- package/dist/{login-command-ACJF6KWQ.js → login-command-QM5SBBI2.js} +2 -2
- package/dist/{logout-command-MX3MJS5U.js → logout-command-THPASOHM.js} +2 -2
- package/dist/{loop-SAWAOUFO.js → loop-7SAIGRCZ.js} +3 -3
- package/dist/{marketplace-command-XJIWL4YP.js → marketplace-command-463DT7O7.js} +11 -25
- package/dist/meta-client-OW5WKWW7.js +1 -1
- package/dist/node.d.ts +2 -2
- package/dist/node.js +18 -12
- package/dist/onboard-command-EHOHKQQU.js +36 -0
- package/dist/{profile-command-SWJ3SPKR.js → profile-command-EUWPVWED.js} +6 -6
- package/dist/{release-command-6PLMLGDK.js → release-command-M4CVNTWL.js} +25 -25
- package/dist/{sandbox-details-command-HJE5SPVG.js → sandbox-details-command-BRII3QHG.js} +5 -5
- package/dist/{sandbox-export-command-QCJY4GMV.js → sandbox-export-command-PCZ5FL4U.js} +8 -8
- package/dist/scaffold.js +4 -2
- package/dist/{store-g45zwB33.d.ts → store-BJONDJoZ.d.ts} +171 -2
- package/dist/{test-command-LLPXKT35.js → test-command-U4G5Y3UM.js} +10 -10
- package/dist/upgrade-command-CKJ4BS2P.js +177 -0
- package/dist/{validate-command-WAT3ZJT3.js → validate-command-S5N37JRP.js} +12 -12
- package/dist/{workspace-command-JKMI7RZ4.js → workspace-command-RALSEJSW.js} +28 -27
- package/dist/workspace-export-AJMGN3CQ.js +1 -1
- package/guides/README.md +30 -0
- package/guides/authoring.md +642 -0
- package/guides/cli.md +191 -0
- package/guides/codegen.md +83 -0
- package/guides/coverage.md +67 -0
- package/guides/deploying.md +340 -0
- package/guides/environment.md +132 -0
- package/guides/object-kinds.md +376 -0
- package/guides/project-structure.md +43 -0
- package/guides/scaffold.md +198 -0
- package/guides/typed-frontend.md +201 -0
- package/llms/kinds-agent-mcp.md +2 -1
- package/llms/kinds-knowledge.md +20 -0
- package/llms/object-kinds.md +1 -0
- package/llms-full.txt +27 -3
- package/llms.txt +3 -2
- package/manifest.json +30 -3
- package/package.json +5 -2
- package/dist/.build-fingerprint +0 -1
- package/dist/chunk-47WDWMBJ.js +0 -14
- package/dist/init-command-6DGXEVZD.js +0 -29
|
@@ -2,11 +2,17 @@ import {
|
|
|
2
2
|
presetFilePath,
|
|
3
3
|
resolveAiPresets,
|
|
4
4
|
scaffoldProject
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-7SISR3CS.js";
|
|
6
|
+
import {
|
|
7
|
+
runNpmCapturingStderr
|
|
8
|
+
} from "./chunk-ZSYZTGJH.js";
|
|
6
9
|
import {
|
|
7
10
|
DEFAULT_FRAMEWORK,
|
|
8
11
|
allFrontendPresets,
|
|
9
12
|
findFrontendPreset,
|
|
13
|
+
resolveFrameworkFlag
|
|
14
|
+
} from "./chunk-WGDAOOXG.js";
|
|
15
|
+
import {
|
|
10
16
|
initLanding,
|
|
11
17
|
renderApiTs,
|
|
12
18
|
renderCnUtil,
|
|
@@ -20,9 +26,8 @@ import {
|
|
|
20
26
|
renderTsconfig,
|
|
21
27
|
renderViteConfig,
|
|
22
28
|
renderXanoExampleMd,
|
|
23
|
-
renderXanoIndex
|
|
24
|
-
|
|
25
|
-
} from "./chunk-YZ4GU6F5.js";
|
|
29
|
+
renderXanoIndex
|
|
30
|
+
} from "./chunk-QUUB7HYK.js";
|
|
26
31
|
import {
|
|
27
32
|
DEFAULT_DARK_MODE,
|
|
28
33
|
curatedThemes,
|
|
@@ -39,18 +44,214 @@ import {
|
|
|
39
44
|
} from "./chunk-6DHJVLYP.js";
|
|
40
45
|
import {
|
|
41
46
|
readVersion
|
|
42
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-DUC3PXDG.js";
|
|
48
|
+
import {
|
|
49
|
+
UsageError
|
|
50
|
+
} from "./chunk-KGNJM4LN.js";
|
|
43
51
|
import {
|
|
44
52
|
blank,
|
|
45
53
|
detail,
|
|
46
54
|
info,
|
|
47
55
|
step,
|
|
48
56
|
style,
|
|
49
|
-
success
|
|
57
|
+
success,
|
|
58
|
+
warn
|
|
50
59
|
} from "./chunk-EZG76F7R.js";
|
|
51
60
|
|
|
52
61
|
// src/emit/init-command.ts
|
|
53
|
-
import {
|
|
62
|
+
import { writeFileSync } from "fs";
|
|
63
|
+
import { basename, join as join2, resolve } from "path";
|
|
64
|
+
|
|
65
|
+
// src/emit/init-modules.ts
|
|
66
|
+
import { existsSync, readFileSync } from "fs";
|
|
67
|
+
import { join } from "path";
|
|
68
|
+
import { pathToFileURL } from "url";
|
|
69
|
+
function parseMarketplaceFlag(values) {
|
|
70
|
+
const packages = [];
|
|
71
|
+
for (const value of values) {
|
|
72
|
+
for (const raw of value.split(",")) {
|
|
73
|
+
const pkg = raw.trim();
|
|
74
|
+
if (pkg === "") continue;
|
|
75
|
+
if (pkg.startsWith("-")) {
|
|
76
|
+
throw new UsageError(
|
|
77
|
+
`\`--marketplace\`: "${pkg}" starts with a dash, so npm would read it as a flag, not a package.`,
|
|
78
|
+
{ helpFor: { command: "init" } }
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
if (!packages.includes(pkg)) packages.push(pkg);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return packages;
|
|
85
|
+
}
|
|
86
|
+
function packageNameOf(specifier) {
|
|
87
|
+
const at = specifier.lastIndexOf("@");
|
|
88
|
+
return at > 0 ? specifier.slice(0, at) : specifier;
|
|
89
|
+
}
|
|
90
|
+
function readOptionRefs(raw) {
|
|
91
|
+
if (typeof raw !== "object" || raw === null) return {};
|
|
92
|
+
const refs = {};
|
|
93
|
+
for (const [name, value] of Object.entries(raw)) {
|
|
94
|
+
if (typeof value !== "object" || value === null) continue;
|
|
95
|
+
const entry = value;
|
|
96
|
+
const pkg = entry["package"];
|
|
97
|
+
const exported = entry["export"];
|
|
98
|
+
if (typeof pkg === "string" && pkg !== "" && typeof exported === "string" && exported !== "") {
|
|
99
|
+
refs[name] = { package: pkg, export: exported };
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return refs;
|
|
103
|
+
}
|
|
104
|
+
function bindingNameFor(register) {
|
|
105
|
+
const bare = register.replace(/^register/, "");
|
|
106
|
+
return bare === "" ? "handle" : bare[0].toLowerCase() + bare.slice(1);
|
|
107
|
+
}
|
|
108
|
+
function readInstalledManifest(dir, pkg) {
|
|
109
|
+
const path = join(dir, "node_modules", ...pkg.split("/"), "package.json");
|
|
110
|
+
if (!existsSync(path)) return null;
|
|
111
|
+
try {
|
|
112
|
+
return JSON.parse(readFileSync(path, "utf8"));
|
|
113
|
+
} catch {
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
function entryFileOf(dir, pkg, manifest) {
|
|
118
|
+
const root = join(dir, "node_modules", ...pkg.split("/"));
|
|
119
|
+
const exports = manifest["exports"];
|
|
120
|
+
const dot = typeof exports === "object" && exports !== null ? exports["."] : void 0;
|
|
121
|
+
const nested = typeof dot === "object" && dot !== null ? dot["import"] ?? dot["default"] : typeof dot === "string" ? dot : void 0;
|
|
122
|
+
const candidate = nested ?? manifest["module"] ?? manifest["main"];
|
|
123
|
+
if (typeof candidate !== "string") return null;
|
|
124
|
+
const file = join(root, candidate);
|
|
125
|
+
return existsSync(file) ? file : null;
|
|
126
|
+
}
|
|
127
|
+
async function readRegistration(dir, pkg) {
|
|
128
|
+
const manifest = readInstalledManifest(dir, pkg);
|
|
129
|
+
if (manifest === null) return { unwired: "it is not in node_modules after the install" };
|
|
130
|
+
const declared = manifest["xanots"];
|
|
131
|
+
if (typeof declared === "object" && declared !== null) {
|
|
132
|
+
const field = declared;
|
|
133
|
+
const register = field["register"];
|
|
134
|
+
if (typeof register === "string" && register !== "") {
|
|
135
|
+
return {
|
|
136
|
+
pkg,
|
|
137
|
+
register,
|
|
138
|
+
binding: field["returns"] === "handle" ? bindingNameFor(register) : null,
|
|
139
|
+
options: readOptionRefs(field["options"]),
|
|
140
|
+
source: "manifest"
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
const entry = entryFileOf(dir, pkg, manifest);
|
|
145
|
+
if (entry === null) return { unwired: "its package.json names no entry we could read" };
|
|
146
|
+
let names;
|
|
147
|
+
try {
|
|
148
|
+
const loaded = await import(pathToFileURL(entry).href);
|
|
149
|
+
names = Object.keys(loaded).filter(
|
|
150
|
+
(name) => /^register[A-Z]/.test(name) && typeof loaded[name] === "function"
|
|
151
|
+
);
|
|
152
|
+
} catch (error) {
|
|
153
|
+
return { unwired: `importing it failed (${error instanceof Error ? error.message : String(error)})` };
|
|
154
|
+
}
|
|
155
|
+
if (names.length === 0) {
|
|
156
|
+
return {
|
|
157
|
+
unwired: `it exports no register* function, and its package.json has no "xanots" field`
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
if (names.length > 1) {
|
|
161
|
+
return {
|
|
162
|
+
unwired: `it exports ${names.length} register* functions (${names.join(", ")}) \u2014 its package.json needs a "xanots" field naming the one to call`
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
return { pkg, register: names[0], binding: null, options: {}, source: "exports" };
|
|
166
|
+
}
|
|
167
|
+
function renderXanoIndexWithModules(appName, modules) {
|
|
168
|
+
const byPackage = /* @__PURE__ */ new Map();
|
|
169
|
+
const add = (pkg, name) => {
|
|
170
|
+
const names = byPackage.get(pkg) ?? /* @__PURE__ */ new Set();
|
|
171
|
+
names.add(name);
|
|
172
|
+
byPackage.set(pkg, names);
|
|
173
|
+
};
|
|
174
|
+
for (const m of modules) {
|
|
175
|
+
add(m.pkg, m.register);
|
|
176
|
+
for (const ref of Object.values(m.options)) add(ref.package, ref.export);
|
|
177
|
+
}
|
|
178
|
+
const imports = [...byPackage].map(([pkg, names]) => `import { ${[...names].sort().join(", ")} } from "${pkg}";`).join("\n");
|
|
179
|
+
const calls = modules.map((m) => {
|
|
180
|
+
const entries = Object.entries(m.options);
|
|
181
|
+
const opts = entries.length === 0 ? "" : `, { ${entries.map(([name, ref]) => `${name}: ${ref.export}`).join(", ")} }`;
|
|
182
|
+
const call = `${m.register}(app${opts});`;
|
|
183
|
+
return m.binding === null ? call : `const ${m.binding} = ${call}`;
|
|
184
|
+
}).join("\n");
|
|
185
|
+
const handles = modules.filter((m) => m.binding !== null);
|
|
186
|
+
const handleNote = handles.length === 0 ? "" : `
|
|
187
|
+
*
|
|
188
|
+
* ${handles.map((m) => `\`${m.binding}\` is ${m.pkg}'s handle \u2014 its endpoints and helpers.`).join("\n * ")}`;
|
|
189
|
+
return `import { workspace } from "@xanots/sdk";
|
|
190
|
+
${imports}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* The ${appName} backend.
|
|
194
|
+
*
|
|
195
|
+
* A workspace is assembled by registering typed objects onto a workspace()
|
|
196
|
+
* instance and default-exporting it. The add-ons below were installed by
|
|
197
|
+
* \`xanots init --marketplace\` and registered for you.
|
|
198
|
+
*
|
|
199
|
+
* Each register* call mutates the workspace, so the order does not matter and
|
|
200
|
+
* the thing exported is the workspace itself. Add your own tables and endpoints
|
|
201
|
+
* beside them \u2014 xano/EXAMPLE.md walks through the first one.${handleNote}
|
|
202
|
+
*/
|
|
203
|
+
const app = workspace("${appName}");
|
|
204
|
+
|
|
205
|
+
${calls}
|
|
206
|
+
|
|
207
|
+
export default app;
|
|
208
|
+
`;
|
|
209
|
+
}
|
|
210
|
+
function isPeerConflict(stderr) {
|
|
211
|
+
return /ERESOLVE|peer dep|peerinvalid/i.test(stderr);
|
|
212
|
+
}
|
|
213
|
+
async function installModules(dir, packages) {
|
|
214
|
+
const installed = [];
|
|
215
|
+
const failed = [];
|
|
216
|
+
const legacyPeer = [];
|
|
217
|
+
const registered = [];
|
|
218
|
+
const unwired = [];
|
|
219
|
+
for (const specifier of packages) {
|
|
220
|
+
step(`Adding ${specifier}`);
|
|
221
|
+
let result = runNpmCapturingStderr(["install", specifier], dir);
|
|
222
|
+
if (result.status !== 0 && isPeerConflict(result.stderr)) {
|
|
223
|
+
warn(
|
|
224
|
+
`${specifier} declares a peer range this CLI does not satisfy \u2014 retrying with --legacy-peer-deps.`
|
|
225
|
+
);
|
|
226
|
+
result = runNpmCapturingStderr(["install", specifier, "--legacy-peer-deps"], dir);
|
|
227
|
+
if (result.status === 0) legacyPeer.push(specifier);
|
|
228
|
+
}
|
|
229
|
+
if (result.status !== 0) {
|
|
230
|
+
failed.push(specifier);
|
|
231
|
+
warn(`npm install ${specifier} failed \u2014 the module was not added.`);
|
|
232
|
+
continue;
|
|
233
|
+
}
|
|
234
|
+
installed.push(specifier);
|
|
235
|
+
const pkg = packageNameOf(specifier);
|
|
236
|
+
const registration = await readRegistration(dir, pkg);
|
|
237
|
+
if ("unwired" in registration) unwired.push({ pkg, reason: registration.unwired });
|
|
238
|
+
else registered.push(registration);
|
|
239
|
+
}
|
|
240
|
+
const present = new Set(installed.map(packageNameOf));
|
|
241
|
+
const writable = [];
|
|
242
|
+
for (const registration of registered) {
|
|
243
|
+
const missing = Object.values(registration.options).map((ref) => ref.package).filter((pkg) => !present.has(pkg));
|
|
244
|
+
if (missing.length === 0) {
|
|
245
|
+
writable.push(registration);
|
|
246
|
+
continue;
|
|
247
|
+
}
|
|
248
|
+
unwired.push({
|
|
249
|
+
pkg: registration.pkg,
|
|
250
|
+
reason: `it needs ${[...new Set(missing)].join(", ")}, which this project does not have`
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
return { installed, failed, legacyPeer, registered: writable, unwired };
|
|
254
|
+
}
|
|
54
255
|
|
|
55
256
|
// src/emit/frontend-resolve.ts
|
|
56
257
|
import { createInterface } from "readline/promises";
|
|
@@ -91,7 +292,7 @@ async function resolveFrontendPreset(flag) {
|
|
|
91
292
|
|
|
92
293
|
// src/emit/theme-resolve.ts
|
|
93
294
|
import { createInterface as createInterface2 } from "readline/promises";
|
|
94
|
-
import { readFileSync } from "fs";
|
|
295
|
+
import { readFileSync as readFileSync2 } from "fs";
|
|
95
296
|
import { resolve as resolvePath } from "path";
|
|
96
297
|
function isRegistryRef(value) {
|
|
97
298
|
return /^https?:\/\//i.test(value) || value.toLowerCase().endsWith(".json");
|
|
@@ -113,7 +314,7 @@ async function loadRegistryTheme(ref) {
|
|
|
113
314
|
const path = resolvePath(ref);
|
|
114
315
|
let text;
|
|
115
316
|
try {
|
|
116
|
-
text =
|
|
317
|
+
text = readFileSync2(path, "utf8");
|
|
117
318
|
} catch (err) {
|
|
118
319
|
throw new Error(
|
|
119
320
|
`Could not read the theme file ${path}: ${err instanceof Error ? err.message : String(err)}`
|
|
@@ -280,6 +481,30 @@ async function runInitCommand(args) {
|
|
|
280
481
|
if (presets.length > 0) {
|
|
281
482
|
info(`AI instructions: ${presets.map(presetFilePath).join(", ")}`);
|
|
282
483
|
}
|
|
484
|
+
const modules = parseMarketplaceFlag(args.marketplace);
|
|
485
|
+
if (modules.length > 0) {
|
|
486
|
+
blank();
|
|
487
|
+
const outcome = await installModules(targetDir, modules);
|
|
488
|
+
if (outcome.registered.length > 0) {
|
|
489
|
+
writeFileSync(
|
|
490
|
+
join2(targetDir, "xano", "index.ts"),
|
|
491
|
+
renderXanoIndexWithModules(appName, outcome.registered),
|
|
492
|
+
"utf8"
|
|
493
|
+
);
|
|
494
|
+
info(
|
|
495
|
+
`Registered in xano/index.ts: ${outcome.registered.map((m) => m.pkg).join(", ")}`
|
|
496
|
+
);
|
|
497
|
+
}
|
|
498
|
+
for (const module of outcome.unwired) {
|
|
499
|
+
warn(`${module.pkg} is installed but not registered \u2014 ${module.reason}.`);
|
|
500
|
+
detail(`Import it in xano/index.ts and register it onto the workspace yourself.`);
|
|
501
|
+
}
|
|
502
|
+
if (outcome.legacyPeer.length > 0) {
|
|
503
|
+
warn(
|
|
504
|
+
`Installed with --legacy-peer-deps: ${outcome.legacyPeer.join(", ")}. npm refused the tree on peer ranges, so this one is not the tree npm would build on its own.`
|
|
505
|
+
);
|
|
506
|
+
}
|
|
507
|
+
}
|
|
283
508
|
blank();
|
|
284
509
|
success("Project ready.");
|
|
285
510
|
const cdHint = targetDir === process.cwd() ? "" : ` cd ${targetArg}
|
|
@@ -304,4 +529,4 @@ export {
|
|
|
304
529
|
projectShellFiles,
|
|
305
530
|
runInitCommand
|
|
306
531
|
};
|
|
307
|
-
//# sourceMappingURL=chunk-
|
|
532
|
+
//# sourceMappingURL=chunk-EAIR6VUL.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// src/emit/project-dir.ts
|
|
2
|
+
import { existsSync, readFileSync } from "fs";
|
|
3
|
+
import { join } from "path";
|
|
4
|
+
function assertProjectDir(dir, ctx) {
|
|
5
|
+
const manifest = join(dir, "package.json");
|
|
6
|
+
if (!existsSync(manifest)) {
|
|
7
|
+
throw new Error(`No package.json in ${dir} \u2014 ${ctx.what}.
|
|
8
|
+
${ctx.remedy}`);
|
|
9
|
+
}
|
|
10
|
+
try {
|
|
11
|
+
JSON.parse(readFileSync(manifest, "utf8"));
|
|
12
|
+
} catch (err) {
|
|
13
|
+
throw new Error(
|
|
14
|
+
`${manifest} is not valid JSON, so npm cannot install into it \u2014 fix it and re-run. (${err instanceof Error ? err.message : String(err)})`
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export {
|
|
20
|
+
assertProjectDir
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=chunk-ERQZFWIW.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
realtimeChannelGuid,
|
|
7
7
|
realtimeServerRefName,
|
|
8
8
|
resolveRealtimeServerRef
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-CYJ7R3AD.js";
|
|
10
10
|
import {
|
|
11
11
|
assertCanonical,
|
|
12
12
|
assertOneOf,
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
resolveAuthRef,
|
|
26
26
|
resolveMockKeys,
|
|
27
27
|
warnLiveDatasource
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-YUPQOLFX.js";
|
|
29
29
|
import {
|
|
30
30
|
encodeStatement
|
|
31
31
|
} from "./chunk-5XZ744TS.js";
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
lockKey,
|
|
36
36
|
realtimeMessageSeedName,
|
|
37
37
|
resolveRef
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-YUBJLB6G.js";
|
|
39
39
|
|
|
40
40
|
// src/kinds/canonical.ts
|
|
41
41
|
function resolveCanonicalToken(label, payloadKey, accessor, def, override) {
|
|
@@ -667,4 +667,4 @@ export {
|
|
|
667
667
|
addonKind,
|
|
668
668
|
addon
|
|
669
669
|
};
|
|
670
|
-
//# sourceMappingURL=chunk-
|
|
670
|
+
//# sourceMappingURL=chunk-FN4OQT2J.js.map
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
liveSubcommandNames,
|
|
20
20
|
renderArgs,
|
|
21
21
|
suggest
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-YYSJAAJM.js";
|
|
23
23
|
|
|
24
24
|
// src/emit/help.ts
|
|
25
25
|
function table(rows, s, indent = " ", fixedWidth) {
|
|
@@ -245,4 +245,4 @@ export {
|
|
|
245
245
|
reportFailure,
|
|
246
246
|
exitCodeOf
|
|
247
247
|
};
|
|
248
|
-
//# sourceMappingURL=chunk-
|
|
248
|
+
//# sourceMappingURL=chunk-KGNJM4LN.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
parseLock,
|
|
6
6
|
serializeLock
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-YUBJLB6G.js";
|
|
8
8
|
|
|
9
9
|
// src/lock/io.ts
|
|
10
10
|
import { readFileSync, existsSync } from "fs";
|
|
@@ -35,4 +35,4 @@ export {
|
|
|
35
35
|
readLockFile,
|
|
36
36
|
writeLockFile
|
|
37
37
|
};
|
|
38
|
-
//# sourceMappingURL=chunk-
|
|
38
|
+
//# sourceMappingURL=chunk-MFIHIS6B.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
c,
|
|
3
3
|
resp
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YUPQOLFX.js";
|
|
5
5
|
|
|
6
6
|
// src/values/expect.ts
|
|
7
7
|
var TEST_EXPECT_TYPES = [
|
|
@@ -90,4 +90,4 @@ export {
|
|
|
90
90
|
TEST_EXPECT_TYPES,
|
|
91
91
|
expect
|
|
92
92
|
};
|
|
93
|
-
//# sourceMappingURL=chunk-
|
|
93
|
+
//# sourceMappingURL=chunk-PXXLBXOP.js.map
|