@altertable/cli 1.7.0 → 1.9.0
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/cli.js +1354 -17
- package/package.json +4 -2
package/dist/cli.js
CHANGED
|
@@ -7035,7 +7035,7 @@ var require_public_api = __commonJS(function(exports) {
|
|
|
7035
7035
|
});
|
|
7036
7036
|
|
|
7037
7037
|
// src/version.ts
|
|
7038
|
-
var VERSION = "1.
|
|
7038
|
+
var VERSION = "1.9.0";
|
|
7039
7039
|
var USER_AGENT = `altertable-cli/${VERSION}`;
|
|
7040
7040
|
|
|
7041
7041
|
// src/lib/transport-defaults.ts
|
|
@@ -10078,6 +10078,12 @@ function buildAuthorizeUrl(params, oauthBase) {
|
|
|
10078
10078
|
if (scope) {
|
|
10079
10079
|
query.set("scope", scope);
|
|
10080
10080
|
}
|
|
10081
|
+
if (params.organization !== undefined) {
|
|
10082
|
+
query.set("organization", params.organization);
|
|
10083
|
+
}
|
|
10084
|
+
if (params.environment !== undefined) {
|
|
10085
|
+
query.set("environment", params.environment);
|
|
10086
|
+
}
|
|
10081
10087
|
return `${oauthBase}/authorize?${query.toString()}`;
|
|
10082
10088
|
}
|
|
10083
10089
|
function resolveAuthServer(oauthBase) {
|
|
@@ -10191,13 +10197,13 @@ function openBrowser(url) {
|
|
|
10191
10197
|
child.unref();
|
|
10192
10198
|
} catch {}
|
|
10193
10199
|
}
|
|
10194
|
-
async function runLoginFlow(sink, oauthBase) {
|
|
10200
|
+
async function runLoginFlow(sink, oauthBase, selection = {}) {
|
|
10195
10201
|
const verifier = generateRandomCodeVerifier();
|
|
10196
10202
|
const challenge = await calculatePKCECodeChallenge(verifier);
|
|
10197
10203
|
const state = generateRandomState();
|
|
10198
10204
|
const server = await startLoopbackServer(state);
|
|
10199
10205
|
try {
|
|
10200
|
-
const authorizeUrl = buildAuthorizeUrl({ redirectUri: server.redirectUri, challenge, state }, oauthBase);
|
|
10206
|
+
const authorizeUrl = buildAuthorizeUrl({ redirectUri: server.redirectUri, challenge, state, ...selection }, oauthBase);
|
|
10201
10207
|
sink.writeHuman(renderDisplayText([span("Opening your browser to sign in\u2026", "subtle")]));
|
|
10202
10208
|
sink.writeHuman(renderDisplayText([
|
|
10203
10209
|
span("If it doesn't open, visit: ", "subtle"),
|
|
@@ -11416,6 +11422,7 @@ var loginCommand = defineCommand({
|
|
|
11416
11422
|
description: "Sign in with your browser (OAuth) and store the session.",
|
|
11417
11423
|
examples: [
|
|
11418
11424
|
"altertable login",
|
|
11425
|
+
"altertable login --org acme --env staging",
|
|
11419
11426
|
"altertable login --replace-profile",
|
|
11420
11427
|
'altertable login --service-account "CI Bot" --scope analytics:ro',
|
|
11421
11428
|
'altertable login --service-account "CI Bot" --scope ro'
|
|
@@ -11438,6 +11445,16 @@ var loginCommand = defineCommand({
|
|
|
11438
11445
|
type: "boolean",
|
|
11439
11446
|
description: "Store the login session in the current profile instead of switching profiles"
|
|
11440
11447
|
},
|
|
11448
|
+
org: {
|
|
11449
|
+
type: "string",
|
|
11450
|
+
valueHint: "SLUG",
|
|
11451
|
+
description: "Preselect this organization in the browser authorization page"
|
|
11452
|
+
},
|
|
11453
|
+
env: {
|
|
11454
|
+
type: "string",
|
|
11455
|
+
valueHint: "SLUG",
|
|
11456
|
+
description: "Preselect this environment in the browser authorization page"
|
|
11457
|
+
},
|
|
11441
11458
|
"service-account": {
|
|
11442
11459
|
type: "string",
|
|
11443
11460
|
valueHint: "LABEL",
|
|
@@ -11652,12 +11669,20 @@ async function completeServiceAccountLogin(oauthResponse, whoami, args, controlP
|
|
|
11652
11669
|
}
|
|
11653
11670
|
async function runLogin(args, sink) {
|
|
11654
11671
|
const serviceAccountRequest = parseServiceAccountLoginArgs(args);
|
|
11672
|
+
for (const flag of ["org", "env"]) {
|
|
11673
|
+
if (args[flag] !== undefined && args[flag].trim().length === 0) {
|
|
11674
|
+
throw new ConfigurationError(`--${flag} requires a non-empty slug.`);
|
|
11675
|
+
}
|
|
11676
|
+
}
|
|
11655
11677
|
applyLoginDataPlaneUrl(args);
|
|
11656
11678
|
assertNoEnvConfigMode();
|
|
11657
11679
|
assertInteractiveLogin();
|
|
11658
11680
|
const currentProfile = resolveWorkingProfile(getCliContext().profile);
|
|
11659
11681
|
const { controlPlane, oauthBase, managementApiBase } = resolveLoginEndpoints(args, currentProfile);
|
|
11660
|
-
const oauthResponse = await runLoginFlow(sink, oauthBase
|
|
11682
|
+
const oauthResponse = await runLoginFlow(sink, oauthBase, {
|
|
11683
|
+
organization: args.org,
|
|
11684
|
+
environment: args.env
|
|
11685
|
+
});
|
|
11661
11686
|
const whoami = await fetchLoginWhoami(oauthResponse, managementApiBase);
|
|
11662
11687
|
if (serviceAccountRequest) {
|
|
11663
11688
|
await completeServiceAccountLogin(oauthResponse, whoami, args, controlPlane, managementApiBase, serviceAccountRequest, sink);
|
|
@@ -12121,7 +12146,7 @@ function storedLakehouseCredentialsExpired(profileName) {
|
|
|
12121
12146
|
if (Number.isNaN(expiry)) {
|
|
12122
12147
|
throw new CliError("Stored lakehouse credential expiry is corrupted. Run 'altertable logout' and try again.", { exitCode: EXIT_CONFIG });
|
|
12123
12148
|
}
|
|
12124
|
-
return Date.now() >= expiry;
|
|
12149
|
+
return Date.now() + 5 * 60 * 1000 >= expiry;
|
|
12125
12150
|
}
|
|
12126
12151
|
function envLakehouseCredential() {
|
|
12127
12152
|
const envToken = readEnv("ALTERTABLE_BASIC_AUTH_TOKEN");
|
|
@@ -12265,7 +12290,18 @@ async function sendManagementRequest(context, method, endpoint, body) {
|
|
|
12265
12290
|
});
|
|
12266
12291
|
return parseApiJson(response);
|
|
12267
12292
|
}
|
|
12268
|
-
|
|
12293
|
+
var pendingCredentials = new Map;
|
|
12294
|
+
function provisionLakehouseCredential(context) {
|
|
12295
|
+
const pending = pendingCredentials.get(context.profile);
|
|
12296
|
+
if (pending)
|
|
12297
|
+
return pending;
|
|
12298
|
+
const renewal = createLakehouseCredential(context).finally(() => {
|
|
12299
|
+
pendingCredentials.delete(context.profile);
|
|
12300
|
+
});
|
|
12301
|
+
pendingCredentials.set(context.profile, renewal);
|
|
12302
|
+
return renewal;
|
|
12303
|
+
}
|
|
12304
|
+
async function createLakehouseCredential(context) {
|
|
12269
12305
|
if (isFromEnvProfile(context.profile)) {
|
|
12270
12306
|
throw new ConfigurationError("Lakehouse credentials are not auto-provisioned while environment configuration is active. Set ALTERTABLE_BASIC_AUTH_TOKEN or ALTERTABLE_LAKEHOUSE_USERNAME/PASSWORD.");
|
|
12271
12307
|
}
|
|
@@ -12346,7 +12382,8 @@ async function sendWithAuthRecovery(request, context, send) {
|
|
|
12346
12382
|
if (!isRecoverableLakehouseAuthFailure(request, error, context.profile)) {
|
|
12347
12383
|
throw error;
|
|
12348
12384
|
}
|
|
12349
|
-
const
|
|
12385
|
+
const latest = optionalAuth(() => getLakehouseAuthHeader(context.profile));
|
|
12386
|
+
const authHeader = latest && latest !== options.authHeader ? latest : await provisionLakehouseCredential(context);
|
|
12350
12387
|
return send({ ...options, authHeader });
|
|
12351
12388
|
}
|
|
12352
12389
|
}
|
|
@@ -12425,7 +12462,7 @@ function buildLakehouseQueryCancelRequest(input) {
|
|
|
12425
12462
|
};
|
|
12426
12463
|
}
|
|
12427
12464
|
function buildLakehouseVerifyRequest() {
|
|
12428
|
-
return buildLakehouseQueryRequest({ statement: "SELECT 1" }, false);
|
|
12465
|
+
return { ...buildLakehouseQueryRequest({ statement: "SELECT 1" }, false), retry: true };
|
|
12429
12466
|
}
|
|
12430
12467
|
|
|
12431
12468
|
// src/lib/progress.ts
|
|
@@ -15640,7 +15677,7 @@ var catalogsCreateCommand = defineCommand({
|
|
|
15640
15677
|
metadata: {
|
|
15641
15678
|
name: "create",
|
|
15642
15679
|
description: "Create an Altertable catalog.",
|
|
15643
|
-
examples: ["altertable
|
|
15680
|
+
examples: ["altertable catalog create Analytics"]
|
|
15644
15681
|
},
|
|
15645
15682
|
args: {
|
|
15646
15683
|
name: {
|
|
@@ -15702,13 +15739,13 @@ async function fetchManagementCatalogRows(environment, execution) {
|
|
|
15702
15739
|
}
|
|
15703
15740
|
|
|
15704
15741
|
// src/commands/catalogs/index.ts
|
|
15705
|
-
var
|
|
15742
|
+
var catalogCommand = defineCommand({
|
|
15706
15743
|
metadata: {
|
|
15707
|
-
name: "
|
|
15744
|
+
name: "catalog",
|
|
15708
15745
|
commandGroup: "platform",
|
|
15709
15746
|
invocations: ["direct", "subcommand"],
|
|
15710
15747
|
description: "Manage catalogs (databases and connections) in the current environment.",
|
|
15711
|
-
examples: ["altertable
|
|
15748
|
+
examples: ["altertable catalog", "altertable catalog create Analytics"]
|
|
15712
15749
|
},
|
|
15713
15750
|
subcommands: {
|
|
15714
15751
|
create: catalogsCreateCommand
|
|
@@ -15726,6 +15763,15 @@ var catalogsCommand = defineCommand({
|
|
|
15726
15763
|
}, sink);
|
|
15727
15764
|
}
|
|
15728
15765
|
});
|
|
15766
|
+
var catalogsCommand = defineCommand({
|
|
15767
|
+
...catalogCommand,
|
|
15768
|
+
metadata: {
|
|
15769
|
+
name: "catalogs",
|
|
15770
|
+
hidden: true,
|
|
15771
|
+
description: "Alias for altertable catalog.",
|
|
15772
|
+
invocations: ["direct", "subcommand"]
|
|
15773
|
+
}
|
|
15774
|
+
});
|
|
15729
15775
|
|
|
15730
15776
|
// src/commands/duckdb/index.ts
|
|
15731
15777
|
import { spawnSync as spawnSync3 } from "child_process";
|
|
@@ -19386,11 +19432,11 @@ function formatApiRoutes(rows, emptyMessage = "No operations found.", options =
|
|
|
19386
19432
|
}
|
|
19387
19433
|
|
|
19388
19434
|
// src/commands/api/routes.ts
|
|
19389
|
-
var
|
|
19435
|
+
var apiRouteCommand = defineCommand({
|
|
19390
19436
|
metadata: {
|
|
19391
|
-
name: "
|
|
19437
|
+
name: "route",
|
|
19392
19438
|
description: "List management API paths and methods from the bundled OpenAPI spec.",
|
|
19393
|
-
examples: ["altertable api
|
|
19439
|
+
examples: ["altertable api route", "altertable api route createDatabase"]
|
|
19394
19440
|
},
|
|
19395
19441
|
args: {
|
|
19396
19442
|
operation: {
|
|
@@ -19403,6 +19449,10 @@ var apiRoutesCommand = defineCommand({
|
|
|
19403
19449
|
await runApiRoutesCommand(sink, optionalStringArg(args, "operation"));
|
|
19404
19450
|
}
|
|
19405
19451
|
});
|
|
19452
|
+
var apiRoutesCommand = defineCommand({
|
|
19453
|
+
...apiRouteCommand,
|
|
19454
|
+
metadata: { name: "routes", hidden: true, description: "Alias for altertable api route." }
|
|
19455
|
+
});
|
|
19406
19456
|
async function runApiRoutesCommand(sink, operationId) {
|
|
19407
19457
|
const operation = operationId ? apiOperationDetails(operationId) : undefined;
|
|
19408
19458
|
await writeCommandOutput(operation ? {
|
|
@@ -19425,13 +19475,14 @@ var apiCommand = defineCommand({
|
|
|
19425
19475
|
description: "Management REST API \u2014 HTTP invoker and OpenAPI spec.",
|
|
19426
19476
|
examples: [
|
|
19427
19477
|
"altertable api /whoami",
|
|
19428
|
-
"altertable api
|
|
19478
|
+
"altertable api route",
|
|
19429
19479
|
"altertable api /environments/production/connections",
|
|
19430
19480
|
'altertable api /service_accounts -X POST -F label="CI Bot"'
|
|
19431
19481
|
]
|
|
19432
19482
|
},
|
|
19433
19483
|
args: API_HTTP_BASE_ARGS,
|
|
19434
19484
|
subcommands: {
|
|
19485
|
+
route: apiRouteCommand,
|
|
19435
19486
|
routes: apiRoutesCommand,
|
|
19436
19487
|
spec: apiSpecCommand
|
|
19437
19488
|
},
|
|
@@ -21977,12 +22028,1294 @@ var doctorCommand = defineCommand({
|
|
|
21977
22028
|
}
|
|
21978
22029
|
});
|
|
21979
22030
|
|
|
22031
|
+
// src/commands/app/build.ts
|
|
22032
|
+
import { join as join6 } from "path";
|
|
22033
|
+
|
|
22034
|
+
// src/commands/app/lib/run.ts
|
|
22035
|
+
import { readFileSync as readFileSync6 } from "fs";
|
|
22036
|
+
import { join as join5, resolve as resolve3 } from "path";
|
|
22037
|
+
function appDirectory(value) {
|
|
22038
|
+
if (value !== undefined && (typeof value !== "string" || value.length === 0)) {
|
|
22039
|
+
throw new CliError("--dir requires a directory path.");
|
|
22040
|
+
}
|
|
22041
|
+
return value === undefined ? process.cwd() : resolve3(value);
|
|
22042
|
+
}
|
|
22043
|
+
function assertAppOutputMode(json, agent) {
|
|
22044
|
+
if (json || agent) {
|
|
22045
|
+
throw new CliError("App scripts stream their own output and cannot use --json or --agent.");
|
|
22046
|
+
}
|
|
22047
|
+
}
|
|
22048
|
+
function requireAppScripts(directory, required) {
|
|
22049
|
+
let packageJson;
|
|
22050
|
+
try {
|
|
22051
|
+
packageJson = JSON.parse(readFileSync6(join5(directory, "package.json"), "utf8"));
|
|
22052
|
+
} catch {
|
|
22053
|
+
throw new ConfigurationError(`Cannot read a valid package.json in ${directory}.`);
|
|
22054
|
+
}
|
|
22055
|
+
const scripts = typeof packageJson === "object" && packageJson !== null && "scripts" in packageJson ? packageJson.scripts : undefined;
|
|
22056
|
+
if (typeof scripts !== "object" || scripts === null) {
|
|
22057
|
+
throw new ConfigurationError(`Data app in ${directory} needs scripts in package.json.`);
|
|
22058
|
+
}
|
|
22059
|
+
for (const script of required) {
|
|
22060
|
+
if (typeof scripts[script] !== "string") {
|
|
22061
|
+
throw new ConfigurationError(`Data app in ${directory} needs a "${script}" script in package.json.`);
|
|
22062
|
+
}
|
|
22063
|
+
}
|
|
22064
|
+
}
|
|
22065
|
+
async function runAppCommand(command, directory, appEnvironment, signal) {
|
|
22066
|
+
const env = copyProcessEnv();
|
|
22067
|
+
for (const key of Object.keys(env)) {
|
|
22068
|
+
if (key.startsWith("ALTERTABLE_"))
|
|
22069
|
+
delete env[key];
|
|
22070
|
+
}
|
|
22071
|
+
Object.assign(env, appEnvironment);
|
|
22072
|
+
env.BUN_BE_BUN = "1";
|
|
22073
|
+
const arguments_ = command === "install" ? ["install"] : command === "install-frozen" ? ["install", "--frozen-lockfile"] : ["run", command];
|
|
22074
|
+
const child = Bun.spawn([process.execPath, ...arguments_], {
|
|
22075
|
+
cwd: directory,
|
|
22076
|
+
env,
|
|
22077
|
+
stdin: "inherit",
|
|
22078
|
+
stdout: "inherit",
|
|
22079
|
+
stderr: "inherit"
|
|
22080
|
+
});
|
|
22081
|
+
function interrupt() {
|
|
22082
|
+
child.kill("SIGINT");
|
|
22083
|
+
}
|
|
22084
|
+
function terminate() {
|
|
22085
|
+
child.kill("SIGTERM");
|
|
22086
|
+
}
|
|
22087
|
+
process.on("SIGINT", interrupt);
|
|
22088
|
+
process.on("SIGTERM", terminate);
|
|
22089
|
+
signal?.addEventListener("abort", terminate, { once: true });
|
|
22090
|
+
if (signal?.aborted)
|
|
22091
|
+
terminate();
|
|
22092
|
+
try {
|
|
22093
|
+
return await child.exited;
|
|
22094
|
+
} finally {
|
|
22095
|
+
process.off("SIGINT", interrupt);
|
|
22096
|
+
process.off("SIGTERM", terminate);
|
|
22097
|
+
signal?.removeEventListener("abort", terminate);
|
|
22098
|
+
}
|
|
22099
|
+
}
|
|
22100
|
+
|
|
22101
|
+
// src/commands/app/build.ts
|
|
22102
|
+
var appBuildCommand = defineCommand({
|
|
22103
|
+
metadata: {
|
|
22104
|
+
name: "build",
|
|
22105
|
+
description: "Typecheck and build a data app without Altertable credentials.",
|
|
22106
|
+
examples: ["altertable app build", "altertable app build --dir ./my-app"]
|
|
22107
|
+
},
|
|
22108
|
+
args: {
|
|
22109
|
+
dir: { type: "string", description: "App directory (default: current directory)." }
|
|
22110
|
+
},
|
|
22111
|
+
async run({ args, runtime, sink }) {
|
|
22112
|
+
assertAppOutputMode(runtime.context.json, runtime.context.agent);
|
|
22113
|
+
const directory = appDirectory(args.dir);
|
|
22114
|
+
requireAppScripts(directory, ["typecheck", "build"]);
|
|
22115
|
+
const installExitCode = await runAppCommand("install", directory);
|
|
22116
|
+
if (installExitCode !== 0)
|
|
22117
|
+
return { exitCode: EXIT_GENERIC };
|
|
22118
|
+
const typecheckExitCode = await runAppCommand("typecheck", directory);
|
|
22119
|
+
if (typecheckExitCode !== 0)
|
|
22120
|
+
return { exitCode: EXIT_GENERIC };
|
|
22121
|
+
const exitCode = await runAppCommand("build", directory);
|
|
22122
|
+
if (exitCode !== 0)
|
|
22123
|
+
return { exitCode: EXIT_GENERIC };
|
|
22124
|
+
sink.writeHuman(`Built data app in ${join6(directory, "dist")}.`);
|
|
22125
|
+
}
|
|
22126
|
+
});
|
|
22127
|
+
|
|
22128
|
+
// src/commands/app/create.ts
|
|
22129
|
+
import { mkdir as mkdir2, rm, writeFile as writeFile2 } from "fs/promises";
|
|
22130
|
+
import { dirname as dirname4, join as join7, resolve as resolve4 } from "path";
|
|
22131
|
+
|
|
22132
|
+
// src/commands/app/lib/distribution.ts
|
|
22133
|
+
import { fileURLToPath } from "url";
|
|
22134
|
+
var dataAppDirectory = fileURLToPath(new URL("../../../../../data-app/", import.meta.url));
|
|
22135
|
+
function createAppFiles(payload, identity) {
|
|
22136
|
+
const files = { ...payload.starter };
|
|
22137
|
+
const packageJson = JSON.parse(files["package.json"]);
|
|
22138
|
+
packageJson.name = identity.name;
|
|
22139
|
+
files["package.json"] = `${JSON.stringify(packageJson, null, 2)}
|
|
22140
|
+
`;
|
|
22141
|
+
const app = JSON.parse(files["app.json"]);
|
|
22142
|
+
app.title = identity.title;
|
|
22143
|
+
app.scope = identity.scope;
|
|
22144
|
+
files["app.json"] = `${JSON.stringify(app, null, 2)}
|
|
22145
|
+
`;
|
|
22146
|
+
const oldName = JSON.stringify(JSON.parse(payload.starter["package.json"]).name);
|
|
22147
|
+
files["bun.lock"] = files["bun.lock"].replace(`"name": ${oldName}`, `"name": ${JSON.stringify(identity.name)}`);
|
|
22148
|
+
return files;
|
|
22149
|
+
}
|
|
22150
|
+
|
|
22151
|
+
// src/commands/app/lib/payload.ts
|
|
22152
|
+
var dataAppPayload = { starter: { ".gitignore": `node_modules/
|
|
22153
|
+
dist/
|
|
22154
|
+
.env*
|
|
22155
|
+
`, ".oxfmtrc.json": `{
|
|
22156
|
+
"$schema": "./node_modules/oxfmt/configuration_schema.json",
|
|
22157
|
+
"ignorePatterns": ["dist/**", "bun.lock"]
|
|
22158
|
+
}
|
|
22159
|
+
`, ".oxlintrc.json": `{
|
|
22160
|
+
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
|
22161
|
+
"plugins": ["eslint", "typescript", "unicorn", "oxc", "react", "jsx-a11y"],
|
|
22162
|
+
"categories": {
|
|
22163
|
+
"correctness": "error"
|
|
22164
|
+
},
|
|
22165
|
+
"options": {
|
|
22166
|
+
"typeAware": true
|
|
22167
|
+
},
|
|
22168
|
+
"rules": {
|
|
22169
|
+
"react/unsupported-syntax": "error",
|
|
22170
|
+
"eslint/no-restricted-imports": [
|
|
22171
|
+
"error",
|
|
22172
|
+
{
|
|
22173
|
+
"patterns": [
|
|
22174
|
+
{
|
|
22175
|
+
"regex": "^\\\\.\\\\.?/",
|
|
22176
|
+
"message": "Use #app/* or #config for app-owned files."
|
|
22177
|
+
}
|
|
22178
|
+
]
|
|
22179
|
+
}
|
|
22180
|
+
]
|
|
22181
|
+
}
|
|
22182
|
+
}
|
|
22183
|
+
`, "AGENTS.md": "# Build this data app\n\nInspect source data, time coverage and existing definitions before choosing an exploration. For broad questions, investigate complementary angles. Build conclusions from observed results; do not present association as cause. Keep copy concise and relevant to the reader.\n\nRead `node_modules/@altertable/data-app/AGENTS.md` and its [app authoring guide](node_modules/@altertable/data-app/docs/app-authoring.md) before changing the app. Run `bun install --frozen-lockfile` if the package is not installed.\n\n| Task | App-owned files | Read next |\n| --- | --- | --- |\n| Connect a source, define a query, or change inputs | `app.json`, `src/operations.ts`, optional `src/variables.ts` | [Data and operation authoring](docs/data.md) |\n| Build a view, filters, request states, or Present steps | `src/App.tsx`, `src/styles.css` | [View authoring](docs/views.md) |\n| Explain the exploration or define terms | `src/data-context.ts` or `.tsx` | [Data guidance](docs/data.md), [context APIs](node_modules/@altertable/data-app/docs/react.md#find-ui-by-task) |\n| Change title, scope, or brand | `app.json` | [Config and appearance APIs](node_modules/@altertable/data-app/docs/app-authoring.md) |\n| Find a component, hook, or parser | Read the installed package docs | [Package authoring guide](node_modules/@altertable/data-app/docs/app-authoring.md) |\n| Replace the local server with hosting | `src/server.ts` | [Server authorization boundary](node_modules/@altertable/data-app/docs/server.md) |\n\nEdit app-owned source and use public package APIs. Do not edit installed package files. The generated connectivity screen is scaffolding, not an example analysis.\n\nRun `altertable app check --lakehouse` with the matching profile, then inspect the exploration at phone and desktop widths. Verify that its findings and interactions answer the user's question.\n", "README.md": `# Getting started
|
|
22184
|
+
|
|
22185
|
+
This starter runs a lightweight SQL query to check the lakehouse connection. \u201CConnected\u201D appears only after that query succeeds; having a configured profile alone is not enough. The check does not establish access to specific datasets.
|
|
22186
|
+
|
|
22187
|
+
The generated screen is a setup state. Its operation and data context contain no analytical example to copy. Discover the relevant data and build the exploration around the user's question; broad questions deserve more than one useful angle.
|
|
22188
|
+
|
|
22189
|
+
## Run locally
|
|
22190
|
+
|
|
22191
|
+
Configure a profile with lakehouse access, then run from this directory:
|
|
22192
|
+
|
|
22193
|
+
\`\`\`fish
|
|
22194
|
+
altertable app dev
|
|
22195
|
+
\`\`\`
|
|
22196
|
+
|
|
22197
|
+
The CLI prints the local URL. Use \`altertable app dev --port 3022\` to choose a port.
|
|
22198
|
+
|
|
22199
|
+
## Author the app
|
|
22200
|
+
|
|
22201
|
+
Start with the [authoring router](AGENTS.md) for data and view changes, or the [package authoring guide](node_modules/@altertable/data-app/docs/app-authoring.md) to find components, hooks, and contracts.
|
|
22202
|
+
|
|
22203
|
+
## Check and upgrade
|
|
22204
|
+
|
|
22205
|
+
Run \`altertable app check\` to check the app locally. Use \`altertable app check --lakehouse\` to execute each operation's declared \`checks\` against the selected profile.
|
|
22206
|
+
|
|
22207
|
+
\`altertable app upgrade\` pins the package version tested with your CLI and updates the lockfile. It preserves app code and does not downgrade a newer installed package. Restart a running preview after upgrading.
|
|
22208
|
+
|
|
22209
|
+
## Version control
|
|
22210
|
+
|
|
22211
|
+
Commit app source, \`package.json\`, and \`bun.lock\`. A fresh clone installs \`@altertable/data-app\` from npm with \`bun install --frozen-lockfile\`; installation needs registry access or a populated Bun cache. Keep custom code in \`src/\`.
|
|
22212
|
+
`, "app.json": `{
|
|
22213
|
+
"schemaVersion": 1,
|
|
22214
|
+
"title": "Getting started",
|
|
22215
|
+
"scope": { "organization": "Your organization", "environment": "your environment" },
|
|
22216
|
+
"appearance": {
|
|
22217
|
+
"mode": "light",
|
|
22218
|
+
"baseColor": "neutral",
|
|
22219
|
+
"accentColor": "#405d47",
|
|
22220
|
+
"density": "comfortable",
|
|
22221
|
+
"cornerRadius": "medium",
|
|
22222
|
+
"elevation": "subtle",
|
|
22223
|
+
"typography": { "body": "system", "heading": "system" }
|
|
22224
|
+
}
|
|
22225
|
+
}
|
|
22226
|
+
`, "bun.lock": `{
|
|
22227
|
+
"lockfileVersion": 2,
|
|
22228
|
+
"configVersion": 1,
|
|
22229
|
+
"workspaces": {
|
|
22230
|
+
"": {
|
|
22231
|
+
"name": "data-app-starter",
|
|
22232
|
+
"dependencies": {
|
|
22233
|
+
"@altertable/data-app": "0.61.0",
|
|
22234
|
+
"react": "19.3.0",
|
|
22235
|
+
"react-dom": "19.3.0",
|
|
22236
|
+
},
|
|
22237
|
+
"devDependencies": {
|
|
22238
|
+
"@types/bun": "1.4.2",
|
|
22239
|
+
"@types/react": "19.3.0",
|
|
22240
|
+
"@types/react-dom": "19.3.0",
|
|
22241
|
+
"oxfmt": "0.70.0",
|
|
22242
|
+
"oxlint": "1.85.0",
|
|
22243
|
+
"oxlint-tsgolint": "7.0.2003",
|
|
22244
|
+
"typescript": "7.0.2",
|
|
22245
|
+
},
|
|
22246
|
+
},
|
|
22247
|
+
},
|
|
22248
|
+
"packages": {
|
|
22249
|
+
"@altertable/data-app": ["@altertable/data-app@0.61.0", "", { "dependencies": { "@floating-ui/react": "0.27.20", "@internationalized/date": "3.12.4", "@tanstack/react-query": "5.104.0", "fuzzysort": "4.0.2", "lucide-react": "1.48.0", "react-aria-components": "1.21.1" }, "peerDependencies": { "react": ">=19.2.0", "react-dom": ">=19.2.0" } }, "sha512-68nAEv/G0C7ZJ6P+Y0kAEBXEG4cMvEqORJYqR1/9dd+CeEYHMJDN4v20/7VUnYnEfz6reXJGyuKq3MMv6zbhpA=="],
|
|
22250
|
+
|
|
22251
|
+
"@floating-ui/core": ["@floating-ui/core@1.8.0", "", { "dependencies": { "@floating-ui/utils": "^0.2.12" } }, "sha512-0CIZ5itps/8x7BG8dEIhs53BvCUH2PCoogtakwRTut+Arm58sJooJ0AuZhLw2HJYIR5cMLNPBSS728sPho2khQ=="],
|
|
22252
|
+
|
|
22253
|
+
"@floating-ui/dom": ["@floating-ui/dom@1.8.0", "", { "dependencies": { "@floating-ui/core": "^1.8.0", "@floating-ui/utils": "^0.2.12" } }, "sha512-yXSrzeHZBTZadLOlfyhCkJHNeLJnHRnRInwdZ40L7ZiaAtrBwoYlsDrX3v5zB1Utk7CLfzcOVnVVWoXEky7Ceg=="],
|
|
22254
|
+
|
|
22255
|
+
"@floating-ui/react": ["@floating-ui/react@0.27.20", "", { "dependencies": { "@floating-ui/react-dom": "^2.1.9", "@floating-ui/utils": "^0.2.12", "tabbable": "^6.0.0" }, "peerDependencies": { "react": ">=17.0.0", "react-dom": ">=17.0.0" } }, "sha512-CMqMy7OaXl9W0eq1Uy7L7i2Y/anPvHmFmESd2CEw0t5YvZhcVCeo4MBevAmswRllX7Y2dEidA4ozGPunLSTQpw=="],
|
|
22256
|
+
|
|
22257
|
+
"@floating-ui/react-dom": ["@floating-ui/react-dom@2.1.9", "", { "dependencies": { "@floating-ui/dom": "^1.8.0" }, "peerDependencies": { "react": ">=16.8.0", "react-dom": ">=16.8.0" } }, "sha512-JDjEFGCpImxDCA7JJKviA0M9+RtmJdj0m/NVU5IMgBK+AmZouAQQ7/+2GLH0GXXY0YMw9oXPB8hKdbPYg5QLYg=="],
|
|
22258
|
+
|
|
22259
|
+
"@floating-ui/utils": ["@floating-ui/utils@0.2.12", "", {}, "sha512-HpCo8tmWzLVad5s2d19EhAz5zqrrQ6s69qd6moPMQvkOuSwDT1YgRfWSVuc4ennqrgv3OHppiOGMQ7oC13yIww=="],
|
|
22260
|
+
|
|
22261
|
+
"@internationalized/date": ["@internationalized/date@3.12.4", "", { "dependencies": { "@swc/helpers": "^0.5.0" } }, "sha512-M1dEn4c1U1HsSlaVR8upZtSqvXrTkHDfv18H01uCSJyjVLDxnBR38v/fMxecmlwXKR4i9HeZcmgQAPE6A+aGJQ=="],
|
|
22262
|
+
|
|
22263
|
+
"@internationalized/number": ["@internationalized/number@3.6.8", "", { "dependencies": { "@swc/helpers": "^0.5.0" } }, "sha512-8UmMFia46DUt+k97zKd9fKWXcWHR+k8ae3eYzILETuT2KbIvLyOfac7zesw+sJdRAAZ7Q9pM1Mk22aXp2LD0Ig=="],
|
|
22264
|
+
|
|
22265
|
+
"@internationalized/string": ["@internationalized/string@3.2.10", "", { "dependencies": { "@swc/helpers": "^0.5.0" } }, "sha512-PDx6//vHSpRnHfxqMqto11zQvhsaU74O3mKv2F/0eicGZcl9NLjQmGlbHz/LsJh5tLKp4A4L7ZVTzN1/MmMTvA=="],
|
|
22266
|
+
|
|
22267
|
+
"@oxfmt/binding-android-arm-eabi": ["@oxfmt/binding-android-arm-eabi@0.70.0", "", { "os": "android", "cpu": "arm" }, "sha512-Xd7YO4/T2axEj6FTLcj4Why3mTBqFMg+x24xtorT4Lb2+1g82090GH0a/4U1m0pABGYiix2bq1pqkYrmV3f0Sw=="],
|
|
22268
|
+
|
|
22269
|
+
"@oxfmt/binding-android-arm64": ["@oxfmt/binding-android-arm64@0.70.0", "", { "os": "android", "cpu": "arm64" }, "sha512-x9rlMYyKXdgKdYyUJzGsK1ZV8P4di/J32ipzcS6Jet6p9r9UAh28neXIMtdlSaJJycdi61Z4YkcLKLpk8ueFjg=="],
|
|
22270
|
+
|
|
22271
|
+
"@oxfmt/binding-darwin-arm64": ["@oxfmt/binding-darwin-arm64@0.70.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-IUTUPvrBVYy7POh4stXzRdz4IVC/1QSaviCWoyenSlOhGu0X9j5K07vCTM9biLjAA2Zs31l0Rj5vvRpj9n95wA=="],
|
|
22272
|
+
|
|
22273
|
+
"@oxfmt/binding-darwin-x64": ["@oxfmt/binding-darwin-x64@0.70.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-vw745q870oTd6J517O24asoX4/E+eK0nxYIFoedSLqgJ+nI5En7+ZS82iZSHZ69zevQrnOXiyHP01dA+t8xD8w=="],
|
|
22274
|
+
|
|
22275
|
+
"@oxfmt/binding-freebsd-x64": ["@oxfmt/binding-freebsd-x64@0.70.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-NO14EgSM9dFkcg+MfGPxvsKqXYs9LKaxPrOKXpv1R0rLokGGFDcCq6dBMq18dE4wlpFOovX0UZY2uh1P30O7QA=="],
|
|
22276
|
+
|
|
22277
|
+
"@oxfmt/binding-linux-arm-gnueabihf": ["@oxfmt/binding-linux-arm-gnueabihf@0.70.0", "", { "os": "linux", "cpu": "arm" }, "sha512-139OEhHarj9CYoJ/i9gXlPv4KLBGtLj2toseOWYFf09QwlhklaZk+wW3aOvlqoeZtuayvkoSNVWra7WJ21s3VQ=="],
|
|
22278
|
+
|
|
22279
|
+
"@oxfmt/binding-linux-arm-musleabihf": ["@oxfmt/binding-linux-arm-musleabihf@0.70.0", "", { "os": "linux", "cpu": "arm" }, "sha512-GEh2PY3IWTE0M24eNhTduountANSbWyDmMnzFSQE/nGg/bjPugbUgiGuFu+xdqcQSd/HKSwH80/F2yVVD48yhA=="],
|
|
22280
|
+
|
|
22281
|
+
"@oxfmt/binding-linux-arm64-gnu": ["@oxfmt/binding-linux-arm64-gnu@0.70.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-En5i+UJmZSPxuSf47F2Hl5YOzKB0bicQLnGQkeTCMQ35cWLtbrSwACJKfiLqRZrk05DwSnsJkhBRaM3OURtIaA=="],
|
|
22282
|
+
|
|
22283
|
+
"@oxfmt/binding-linux-arm64-musl": ["@oxfmt/binding-linux-arm64-musl@0.70.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-WWOoV5W9Im3flVwOVrWn/2DUlOF8v5vcCip+kcNuaMpulRCh6nzzt1Su2vcL2F908YJIXNV3HvegbBHuyLwKHg=="],
|
|
22284
|
+
|
|
22285
|
+
"@oxfmt/binding-linux-ppc64-gnu": ["@oxfmt/binding-linux-ppc64-gnu@0.70.0", "", { "os": "linux", "cpu": "ppc64" }, "sha512-YUouneIqW+5n7aE8xx/zeZ6/utr/KH7oykcGoFyd8Uz8uh591T1oKlnoWA3BsRq/ZR42oY1w4MUYvS/0e/MQOA=="],
|
|
22286
|
+
|
|
22287
|
+
"@oxfmt/binding-linux-riscv64-gnu": ["@oxfmt/binding-linux-riscv64-gnu@0.70.0", "", { "os": "linux", "cpu": "none" }, "sha512-iEnMf21S5aGVa4hViDGY8sAQ/AHyCu2JPyrQF8P06wtHhSkD1YJBeT4m/KiGewgf7+a5XCYSCRIPcRQa1xwEoQ=="],
|
|
22288
|
+
|
|
22289
|
+
"@oxfmt/binding-linux-riscv64-musl": ["@oxfmt/binding-linux-riscv64-musl@0.70.0", "", { "os": "linux", "cpu": "none" }, "sha512-91Sdniaj20fQzyMeCxMDzTP4c9s4RB8dGQ308xHhDR0n6U7+1Xq7N9klE7mfXq8iV3lRmIGSXi5X23Hn/0XX/g=="],
|
|
22290
|
+
|
|
22291
|
+
"@oxfmt/binding-linux-s390x-gnu": ["@oxfmt/binding-linux-s390x-gnu@0.70.0", "", { "os": "linux", "cpu": "s390x" }, "sha512-uUV30M6E+2TKKGMaKiwfeL4RZrviHXlUxsrYJ/jFBb+1EZy+pnFT+hF73eeWdzh5NqPOAnw0iiMAIqjqiLZPFg=="],
|
|
22292
|
+
|
|
22293
|
+
"@oxfmt/binding-linux-x64-gnu": ["@oxfmt/binding-linux-x64-gnu@0.70.0", "", { "os": "linux", "cpu": "x64" }, "sha512-ivMcX6kNDPhqtbOaBt/ItFlLlTlXNHLgRuNmxP6Na6UuYXRT10llpJcAPbGeRgjjb3Qzv4jwPp3fB0hui50WNQ=="],
|
|
22294
|
+
|
|
22295
|
+
"@oxfmt/binding-linux-x64-musl": ["@oxfmt/binding-linux-x64-musl@0.70.0", "", { "os": "linux", "cpu": "x64" }, "sha512-w+S+fERxYmlZSyZlJK/U292FjyBoH8cCEj21/tYJX6atX5kNSn+HDkhlFQKT2zcMwUW0uAtUL/bOrlwJZwqRdA=="],
|
|
22296
|
+
|
|
22297
|
+
"@oxfmt/binding-openharmony-arm64": ["@oxfmt/binding-openharmony-arm64@0.70.0", "", { "os": "none", "cpu": "arm64" }, "sha512-Zlom1Xkx257R8bk4ZI4zJsrGno2opknz1+5v5baka3nn4FPyvNSdh8JUL4CdN1S1OWRMvJ9UJQ+RfIqGGCUEfA=="],
|
|
22298
|
+
|
|
22299
|
+
"@oxfmt/binding-win32-arm64-msvc": ["@oxfmt/binding-win32-arm64-msvc@0.70.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-FQgPW5R17vzt7cgrJ8eG/dqX00o2xHsqFeLfw4xzA9FRHpN/DjFo9YDonvIIXGxiEuS9F/jZPnGO+KHNKuCo4Q=="],
|
|
22300
|
+
|
|
22301
|
+
"@oxfmt/binding-win32-ia32-msvc": ["@oxfmt/binding-win32-ia32-msvc@0.70.0", "", { "os": "win32", "cpu": "ia32" }, "sha512-ZfZublNhZ+XBndMiXhkiLlPE+XyGRDa0CweeTL6t1fZypfCh1LTg7e5CvnOeTBunq15MskOcRempumSPGAaCQA=="],
|
|
22302
|
+
|
|
22303
|
+
"@oxfmt/binding-win32-x64-msvc": ["@oxfmt/binding-win32-x64-msvc@0.70.0", "", { "os": "win32", "cpu": "x64" }, "sha512-HlIZEn+WzLQL0DszNzldiRl/DPRCX5R0Vkt6qeUPR1YHwy52hZZo4x6HoTOVmKRP2wUiwPGtKsihNY/f8KRaBg=="],
|
|
22304
|
+
|
|
22305
|
+
"@oxlint-tsgolint/darwin-arm64": ["@oxlint-tsgolint/darwin-arm64@7.0.2003", "", { "os": "darwin", "cpu": "arm64" }, "sha512-TgV33rXr6ueXBwvc+0nssUkTBSXHJxv77I8p4RCjDjCnvexHtmoPiudVRDfj3S3puMDdeQdHW6jdUgUPy3nr/w=="],
|
|
22306
|
+
|
|
22307
|
+
"@oxlint-tsgolint/darwin-x64": ["@oxlint-tsgolint/darwin-x64@7.0.2003", "", { "os": "darwin", "cpu": "x64" }, "sha512-hY3FMAjIaPDdK3FNxyRXRfHPOFeoBn6dmnLyKZgQ2IbTTD1adXhl6PfCIqHhCPvurigv7nf7mYuWZZ19MmJzmg=="],
|
|
22308
|
+
|
|
22309
|
+
"@oxlint-tsgolint/linux-arm64": ["@oxlint-tsgolint/linux-arm64@7.0.2003", "", { "os": "linux", "cpu": "arm64" }, "sha512-eAET4JpyfBbg8SO0K74o4R55tEjVC292pIyxGOw2XGf8x/HrPNyxwQ478jMYOM54FIVOHc8sJ6VRHxluy6lucw=="],
|
|
22310
|
+
|
|
22311
|
+
"@oxlint-tsgolint/linux-x64": ["@oxlint-tsgolint/linux-x64@7.0.2003", "", { "os": "linux", "cpu": "x64" }, "sha512-GXdyO/XyqDJ3s/llR/oOktLsYNjZtWSQBy0JMc+/0gsNPvTcseKPhn9c6KcFyWmnr6H4vljYALbujonqSzzEGw=="],
|
|
22312
|
+
|
|
22313
|
+
"@oxlint-tsgolint/win32-arm64": ["@oxlint-tsgolint/win32-arm64@7.0.2003", "", { "os": "win32", "cpu": "arm64" }, "sha512-TWauXnPfet0VgpmrstoAK58eJ4gbuwPUuUTQmYQAzE/RG1CpnxXtrKUJULf6lyerPE4KN3gM+DflIA1hOH+38Q=="],
|
|
22314
|
+
|
|
22315
|
+
"@oxlint-tsgolint/win32-x64": ["@oxlint-tsgolint/win32-x64@7.0.2003", "", { "os": "win32", "cpu": "x64" }, "sha512-DoRmfe7j8VqNlukp8liRVW45GQDhzRccNenjD/pdzelgtffW47pCMd1xbJLkPaPbKnTwID3onn3VZlL7JbebEA=="],
|
|
22316
|
+
|
|
22317
|
+
"@oxlint/binding-android-arm-eabi": ["@oxlint/binding-android-arm-eabi@1.85.0", "", { "os": "android", "cpu": "arm" }, "sha512-q2KO/Zso9UT+OMn0NF9ywn4E4t0MI3yxiDhNyhsQ7DyQJrC4FhFE4TXOi4bktFnOWXTMds8qZSbpv2XwRaNOBg=="],
|
|
22318
|
+
|
|
22319
|
+
"@oxlint/binding-android-arm64": ["@oxlint/binding-android-arm64@1.85.0", "", { "os": "android", "cpu": "arm64" }, "sha512-SxLN3ALjoT9NNdvpjEevGeHvfzTAFrF0NBYB5tzK7/GtCKMze3j1e/m/X2ozqGj2U9hfGG/dg/OG8vpVK4PiDA=="],
|
|
22320
|
+
|
|
22321
|
+
"@oxlint/binding-darwin-arm64": ["@oxlint/binding-darwin-arm64@1.85.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-Y/Sup/J4f0f9UGsSd/xyCNTeWL+gepO63GBdEDAfue9nBsnk9zMmnIXx1O6b1V8C90vB5nucYNZ0pbMXAp8zJA=="],
|
|
22322
|
+
|
|
22323
|
+
"@oxlint/binding-darwin-x64": ["@oxlint/binding-darwin-x64@1.85.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-ApOSNC04ynpDTwvBD+//0wyfODRSbEzvRoKpX8teffmc27z8AockwSNeMXGJXn5KP85eahDgR/2llICWLkzcnw=="],
|
|
22324
|
+
|
|
22325
|
+
"@oxlint/binding-freebsd-x64": ["@oxlint/binding-freebsd-x64@1.85.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-bNrVrCOA/kHky3Tu79IXWXe5bhIgLXfUuUEDHlAGOHUk96MkvDZ1ecaQF19rwstrnaqfP1o9nBTqzIr9+ZHkUg=="],
|
|
22326
|
+
|
|
22327
|
+
"@oxlint/binding-linux-arm-gnueabihf": ["@oxlint/binding-linux-arm-gnueabihf@1.85.0", "", { "os": "linux", "cpu": "arm" }, "sha512-NUrzOJ1s/EqsVvfn2L/1D8Wro2LPIZUbihL8kOJLh5fEdGEN3rdOGUYq3HwnUIL8sjpoP+4N6RaGrgmMJnaMPw=="],
|
|
22328
|
+
|
|
22329
|
+
"@oxlint/binding-linux-arm-musleabihf": ["@oxlint/binding-linux-arm-musleabihf@1.85.0", "", { "os": "linux", "cpu": "arm" }, "sha512-UJXrAT3E/RWkEqXLIs2ehETja1qfgkPb+5gwLIIS+o/6cf+grHvoOXTa5997a/YNQfcJS0DRBTOfZt95cvOI1g=="],
|
|
22330
|
+
|
|
22331
|
+
"@oxlint/binding-linux-arm64-gnu": ["@oxlint/binding-linux-arm64-gnu@1.85.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-lK40QLjI0HxigO7CjDDshEtfYIeiYS0020v5BHFPqN4uuQBQxd2K9LNom2dW15o9F1937quSCRVp4ZsVhdbYdg=="],
|
|
22332
|
+
|
|
22333
|
+
"@oxlint/binding-linux-arm64-musl": ["@oxlint/binding-linux-arm64-musl@1.85.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-c2zbdBwGKreHXwRx3gWBuFGJxLhxgsg6YlZ+3H+RgRusU/UEV9jNwJ3HGYK+nRo0LvBa7mt6Kj86xoVotUo8cw=="],
|
|
22334
|
+
|
|
22335
|
+
"@oxlint/binding-linux-ppc64-gnu": ["@oxlint/binding-linux-ppc64-gnu@1.85.0", "", { "os": "linux", "cpu": "ppc64" }, "sha512-tlt/Hy8lZ97/lCPmCgw/B3k/mwh+BzaIPbPkldZEly7TwLmx0xe2CQcaW2g/rR0dOgS9JNGCZsMEqLhUNMGvaw=="],
|
|
22336
|
+
|
|
22337
|
+
"@oxlint/binding-linux-riscv64-gnu": ["@oxlint/binding-linux-riscv64-gnu@1.85.0", "", { "os": "linux", "cpu": "none" }, "sha512-3tNR9Xey82X0zKuY1d8hJ6Rc9gwRDurmqGLnQZa5xqOXy8/YyiqFXjAtugkKLY82obOlpK1eSiDRlgcNPuxtIg=="],
|
|
22338
|
+
|
|
22339
|
+
"@oxlint/binding-linux-riscv64-musl": ["@oxlint/binding-linux-riscv64-musl@1.85.0", "", { "os": "linux", "cpu": "none" }, "sha512-wbGRd5PqCcjkJFHhZuZ2OBSUQY9czlQsoA/cQQB9JK/L9mC5MQgGoKAh+xd8QjA5V+0D3j+Qd1lAWn1I8zlelA=="],
|
|
22340
|
+
|
|
22341
|
+
"@oxlint/binding-linux-s390x-gnu": ["@oxlint/binding-linux-s390x-gnu@1.85.0", "", { "os": "linux", "cpu": "s390x" }, "sha512-3Sn0kSrE4DPZCWV/8o+n4x3aFZxI9ulMnkYlwCbJ8eUVkwRK2IerohE/A/z3SNbCwoPFOCJmGE5Avrq0rrvdvQ=="],
|
|
22342
|
+
|
|
22343
|
+
"@oxlint/binding-linux-x64-gnu": ["@oxlint/binding-linux-x64-gnu@1.85.0", "", { "os": "linux", "cpu": "x64" }, "sha512-JY2pxxYfB62bAGfejljVCqc44etItehPuAyaeSAdMuEMtwNA00ggMnS66lC1oIhos6oOXUkuU6mZ9bpFh3BqWg=="],
|
|
22344
|
+
|
|
22345
|
+
"@oxlint/binding-linux-x64-musl": ["@oxlint/binding-linux-x64-musl@1.85.0", "", { "os": "linux", "cpu": "x64" }, "sha512-5k74vZ6qJBjBHEOlBk9B/iv68Yu0F1Afw/vvT2ar6OGCqEeXLaSjXz2n/IPCbhLG22UoKoYEJTzpYraRdcp6PA=="],
|
|
22346
|
+
|
|
22347
|
+
"@oxlint/binding-openharmony-arm64": ["@oxlint/binding-openharmony-arm64@1.85.0", "", { "os": "none", "cpu": "arm64" }, "sha512-GbAl5qt5TCkPLXTaIISZJnugrcBhra6rodcXc9jYt620UtdsTt71NlNmJmm0frxzFpd54x/G+MkitEJA8I/BoA=="],
|
|
22348
|
+
|
|
22349
|
+
"@oxlint/binding-win32-arm64-msvc": ["@oxlint/binding-win32-arm64-msvc@1.85.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-kjmws5MK0et2swk4ND85D7NVQyDHw162i6whtZDLUA/lo6FQyBZDcmMRCMcVZcNrAhIaftVb00x9ChGDOjjNJA=="],
|
|
22350
|
+
|
|
22351
|
+
"@oxlint/binding-win32-ia32-msvc": ["@oxlint/binding-win32-ia32-msvc@1.85.0", "", { "os": "win32", "cpu": "ia32" }, "sha512-eSsIJx9n4yxvOqYTZyPEMyEXRmE60XH7xGAU7i0Qbsn1lf6Za3CWJ9aRd82oSFKXaxhp+sA6/yMJVRIpLpna6A=="],
|
|
22352
|
+
|
|
22353
|
+
"@oxlint/binding-win32-x64-msvc": ["@oxlint/binding-win32-x64-msvc@1.85.0", "", { "os": "win32", "cpu": "x64" }, "sha512-pBebIPUpKKhWrhSMWhy8TdAZBewiXnfxmaAGxhzxM1068GagqFaTwgKlU6e+UyJ2sPR+VoHouhXuGJkQjsrDvA=="],
|
|
22354
|
+
|
|
22355
|
+
"@react-types/shared": ["@react-types/shared@3.36.1", "", { "peerDependencies": { "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1" } }, "sha512-AzsuD9OfxTOZMMvTRhlN3oHBwOmFN7tDh27LzqmHt4+uOgPhJT7ZM7/kVs/8/o0WxayMUIk3hBmCFRHv1FUoag=="],
|
|
22356
|
+
|
|
22357
|
+
"@swc/helpers": ["@swc/helpers@0.5.23", "", { "dependencies": { "tslib": "^2.8.0" } }, "sha512-5lSsMOTXURePglDfvuAQUqkGek9Hg2kksOYay2m0+XR++b2NWYL/4sWyuvVBIs8oKnJaxkdi9whaL/sqN13afw=="],
|
|
22358
|
+
|
|
22359
|
+
"@tanstack/query-core": ["@tanstack/query-core@5.104.0", "", {}, "sha512-JrC2r/JQlXt7khBSdUpsgxNvybzOg+aITa+ARRMlP2AFo93Y8vIqz077rp+e61mJetSZ0T6AJbwW1JHer1vrPQ=="],
|
|
22360
|
+
|
|
22361
|
+
"@tanstack/react-query": ["@tanstack/react-query@5.104.0", "", { "dependencies": { "@tanstack/query-core": "5.104.0" }, "peerDependencies": { "react": "^18 || ^19" } }, "sha512-e1TZmDCQnWIfiDVryIHeA6Idj+Lfx1hORLOhXS/l5wcgvtVD4yYqbTDl378sGQKIi2cSgb0TEMC9cKK8GGoJEw=="],
|
|
22362
|
+
|
|
22363
|
+
"@types/bun": ["@types/bun@1.4.2", "", { "dependencies": { "bun-types": "1.4.2" } }, "sha512-GimotNn7+ZV0uVArItBbriZsR1oNf0+WTzPkdcFrzShI7k2norL0uzEaJT8T33dWr7O/c9ZDuAFQrctKCi72oQ=="],
|
|
22364
|
+
|
|
22365
|
+
"@types/node": ["@types/node@26.6.3", "", { "dependencies": { "undici-types": "~8.9.0" } }, "sha512-dsqMQQoeTLqu9wynDD00q573mNzso3IdQOAfHRJqLCcmCFPoGo9A1bDpUcv/9tnKpErQWv9uKeGfl37EIS02Yg=="],
|
|
22366
|
+
|
|
22367
|
+
"@types/react": ["@types/react@19.3.0", "", { "dependencies": { "csstype": "^3.2.2" } }, "sha512-N0rFCuH9YoxG9/m61l9MfpJKfmLOVU0em7ipIz6TRgSSkvReLB9vL85GB+yr8Bs5leqpvg96JSwF4ZS1s4viQg=="],
|
|
22368
|
+
|
|
22369
|
+
"@types/react-dom": ["@types/react-dom@19.3.0", "", { "peerDependencies": { "@types/react": "^19.3.0" } }, "sha512-ZI7bU42mZXXKHn/qNLEw2IrbiINU7X5+vfgdixBHkCNpYWXjKgfQ/P+uyGb5CjOLB9UcnTeg3rylQtV2hym44Q=="],
|
|
22370
|
+
|
|
22371
|
+
"@typescript/typescript-aix-ppc64": ["@typescript/typescript-aix-ppc64@7.0.2", "", { "os": "aix", "cpu": "ppc64" }, "sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ=="],
|
|
22372
|
+
|
|
22373
|
+
"@typescript/typescript-darwin-arm64": ["@typescript/typescript-darwin-arm64@7.0.2", "", { "os": "darwin", "cpu": "arm64" }, "sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA=="],
|
|
22374
|
+
|
|
22375
|
+
"@typescript/typescript-darwin-x64": ["@typescript/typescript-darwin-x64@7.0.2", "", { "os": "darwin", "cpu": "x64" }, "sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA=="],
|
|
22376
|
+
|
|
22377
|
+
"@typescript/typescript-freebsd-arm64": ["@typescript/typescript-freebsd-arm64@7.0.2", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ=="],
|
|
22378
|
+
|
|
22379
|
+
"@typescript/typescript-freebsd-x64": ["@typescript/typescript-freebsd-x64@7.0.2", "", { "os": "freebsd", "cpu": "x64" }, "sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw=="],
|
|
22380
|
+
|
|
22381
|
+
"@typescript/typescript-linux-arm": ["@typescript/typescript-linux-arm@7.0.2", "", { "os": "linux", "cpu": "arm" }, "sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ=="],
|
|
22382
|
+
|
|
22383
|
+
"@typescript/typescript-linux-arm64": ["@typescript/typescript-linux-arm64@7.0.2", "", { "os": "linux", "cpu": "arm64" }, "sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ=="],
|
|
22384
|
+
|
|
22385
|
+
"@typescript/typescript-linux-loong64": ["@typescript/typescript-linux-loong64@7.0.2", "", { "os": "linux", "cpu": "none" }, "sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ=="],
|
|
22386
|
+
|
|
22387
|
+
"@typescript/typescript-linux-mips64el": ["@typescript/typescript-linux-mips64el@7.0.2", "", { "os": "linux", "cpu": "none" }, "sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA=="],
|
|
22388
|
+
|
|
22389
|
+
"@typescript/typescript-linux-ppc64": ["@typescript/typescript-linux-ppc64@7.0.2", "", { "os": "linux", "cpu": "ppc64" }, "sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA=="],
|
|
22390
|
+
|
|
22391
|
+
"@typescript/typescript-linux-riscv64": ["@typescript/typescript-linux-riscv64@7.0.2", "", { "os": "linux", "cpu": "none" }, "sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ=="],
|
|
22392
|
+
|
|
22393
|
+
"@typescript/typescript-linux-s390x": ["@typescript/typescript-linux-s390x@7.0.2", "", { "os": "linux", "cpu": "s390x" }, "sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw=="],
|
|
22394
|
+
|
|
22395
|
+
"@typescript/typescript-linux-x64": ["@typescript/typescript-linux-x64@7.0.2", "", { "os": "linux", "cpu": "x64" }, "sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A=="],
|
|
22396
|
+
|
|
22397
|
+
"@typescript/typescript-netbsd-arm64": ["@typescript/typescript-netbsd-arm64@7.0.2", "", { "os": "none", "cpu": "arm64" }, "sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA=="],
|
|
22398
|
+
|
|
22399
|
+
"@typescript/typescript-netbsd-x64": ["@typescript/typescript-netbsd-x64@7.0.2", "", { "os": "none", "cpu": "x64" }, "sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA=="],
|
|
22400
|
+
|
|
22401
|
+
"@typescript/typescript-openbsd-arm64": ["@typescript/typescript-openbsd-arm64@7.0.2", "", { "os": "openbsd", "cpu": "arm64" }, "sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ=="],
|
|
22402
|
+
|
|
22403
|
+
"@typescript/typescript-openbsd-x64": ["@typescript/typescript-openbsd-x64@7.0.2", "", { "os": "openbsd", "cpu": "x64" }, "sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg=="],
|
|
22404
|
+
|
|
22405
|
+
"@typescript/typescript-sunos-x64": ["@typescript/typescript-sunos-x64@7.0.2", "", { "os": "sunos", "cpu": "x64" }, "sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g=="],
|
|
22406
|
+
|
|
22407
|
+
"@typescript/typescript-win32-arm64": ["@typescript/typescript-win32-arm64@7.0.2", "", { "os": "win32", "cpu": "arm64" }, "sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ=="],
|
|
22408
|
+
|
|
22409
|
+
"@typescript/typescript-win32-x64": ["@typescript/typescript-win32-x64@7.0.2", "", { "os": "win32", "cpu": "x64" }, "sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g=="],
|
|
22410
|
+
|
|
22411
|
+
"aria-hidden": ["aria-hidden@1.2.6", "", { "dependencies": { "tslib": "^2.0.0" } }, "sha512-ik3ZgC9dY/lYVVM++OISsaYDeg1tb0VtP5uL3ouh1koGOaUMDPpbFIei4JkFimWUFPn90sbMNMXQAIVOlnYKJA=="],
|
|
22412
|
+
|
|
22413
|
+
"bun-types": ["bun-types@1.4.2", "", { "dependencies": { "@types/node": "*" } }, "sha512-bxV1FgK7yBIzjRe5zBozIM4Bem11ZJcCXSrjWRG3YWLt8yFDePu4cLjpebO8OvPeIE9trbyPF4fuj3Cia4Fj3w=="],
|
|
22414
|
+
|
|
22415
|
+
"client-only": ["client-only@0.0.1", "", {}, "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA=="],
|
|
22416
|
+
|
|
22417
|
+
"clsx": ["clsx@2.1.1", "", {}, "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA=="],
|
|
22418
|
+
|
|
22419
|
+
"csstype": ["csstype@3.2.3", "", {}, "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ=="],
|
|
22420
|
+
|
|
22421
|
+
"fuzzysort": ["fuzzysort@4.0.2", "", {}, "sha512-3c7yD6rK1EXIsqpcu1ZVzXJugODWNMzvUij6yTiziaAHrpNS8kzFOI9mJLE8pmG4K9JOaVgzQRgklfOEk8f4Tg=="],
|
|
22422
|
+
|
|
22423
|
+
"lucide-react": ["lucide-react@1.48.0", "", { "peerDependencies": { "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-R0CIKY/fXiC6y9xRBADgsK+VW2p/pcTJOMhLZf1T+uG+vJUvyUR02nGOgmIIC7MPkiNK4Ox8QDnbqF8rJYWPZQ=="],
|
|
22424
|
+
|
|
22425
|
+
"oxfmt": ["oxfmt@0.70.0", "", { "dependencies": { "tinypool": "2.1.2" }, "optionalDependencies": { "@oxfmt/binding-android-arm-eabi": "0.70.0", "@oxfmt/binding-android-arm64": "0.70.0", "@oxfmt/binding-darwin-arm64": "0.70.0", "@oxfmt/binding-darwin-x64": "0.70.0", "@oxfmt/binding-freebsd-x64": "0.70.0", "@oxfmt/binding-linux-arm-gnueabihf": "0.70.0", "@oxfmt/binding-linux-arm-musleabihf": "0.70.0", "@oxfmt/binding-linux-arm64-gnu": "0.70.0", "@oxfmt/binding-linux-arm64-musl": "0.70.0", "@oxfmt/binding-linux-ppc64-gnu": "0.70.0", "@oxfmt/binding-linux-riscv64-gnu": "0.70.0", "@oxfmt/binding-linux-riscv64-musl": "0.70.0", "@oxfmt/binding-linux-s390x-gnu": "0.70.0", "@oxfmt/binding-linux-x64-gnu": "0.70.0", "@oxfmt/binding-linux-x64-musl": "0.70.0", "@oxfmt/binding-openharmony-arm64": "0.70.0", "@oxfmt/binding-win32-arm64-msvc": "0.70.0", "@oxfmt/binding-win32-ia32-msvc": "0.70.0", "@oxfmt/binding-win32-x64-msvc": "0.70.0" }, "peerDependencies": { "svelte": "^5.0.0", "vite-plus": "*" }, "optionalPeers": ["svelte", "vite-plus"], "bin": { "oxfmt": "bin/oxfmt" } }, "sha512-IsHxZ4y0wQLLMhnrJblBJgZsLDzfULrJnAw5j/QqsTlMa/m3AqsbToi+W71uhBGaqlqq/PbbjvHc09TJwdv3Tw=="],
|
|
22426
|
+
|
|
22427
|
+
"oxlint": ["oxlint@1.85.0", "", { "optionalDependencies": { "@oxlint/binding-android-arm-eabi": "1.85.0", "@oxlint/binding-android-arm64": "1.85.0", "@oxlint/binding-darwin-arm64": "1.85.0", "@oxlint/binding-darwin-x64": "1.85.0", "@oxlint/binding-freebsd-x64": "1.85.0", "@oxlint/binding-linux-arm-gnueabihf": "1.85.0", "@oxlint/binding-linux-arm-musleabihf": "1.85.0", "@oxlint/binding-linux-arm64-gnu": "1.85.0", "@oxlint/binding-linux-arm64-musl": "1.85.0", "@oxlint/binding-linux-ppc64-gnu": "1.85.0", "@oxlint/binding-linux-riscv64-gnu": "1.85.0", "@oxlint/binding-linux-riscv64-musl": "1.85.0", "@oxlint/binding-linux-s390x-gnu": "1.85.0", "@oxlint/binding-linux-x64-gnu": "1.85.0", "@oxlint/binding-linux-x64-musl": "1.85.0", "@oxlint/binding-openharmony-arm64": "1.85.0", "@oxlint/binding-win32-arm64-msvc": "1.85.0", "@oxlint/binding-win32-ia32-msvc": "1.85.0", "@oxlint/binding-win32-x64-msvc": "1.85.0" }, "peerDependencies": { "oxlint-tsgolint": ">=7.0.2001", "vite-plus": "*" }, "optionalPeers": ["oxlint-tsgolint", "vite-plus"], "bin": { "oxlint": "bin/oxlint" } }, "sha512-bc26s97nuvPj1ViyPsqmKecVkUWFMEdtayO8MaQ6oiLfs1pj94cQlZZhrh4BPNlr9HQosjhIlwgZKsfcwmcNgg=="],
|
|
22428
|
+
|
|
22429
|
+
"oxlint-tsgolint": ["oxlint-tsgolint@7.0.2003", "", { "optionalDependencies": { "@oxlint-tsgolint/darwin-arm64": "7.0.2003", "@oxlint-tsgolint/darwin-x64": "7.0.2003", "@oxlint-tsgolint/linux-arm64": "7.0.2003", "@oxlint-tsgolint/linux-x64": "7.0.2003", "@oxlint-tsgolint/win32-arm64": "7.0.2003", "@oxlint-tsgolint/win32-x64": "7.0.2003" }, "bin": { "tsgolint": "./bin/tsgolint.js" } }, "sha512-VnK4zlqgmgq/7ZcjzCk/WpN8kKFsYGcB85Io9qT3wL4K8Un3RKmJkp793crNETieMusPMKOA4a+Mw2wbteI6TQ=="],
|
|
22430
|
+
|
|
22431
|
+
"react": ["react@19.3.0", "", {}, "sha512-E8LUcbtBWt20bbl2YoHfx4ZDBdxVTfOKtCZn9cDSJ4l6/nuoApcpIBcj47t2wZoVX8g2ZHuMHbiShgCR1T5Sog=="],
|
|
22432
|
+
|
|
22433
|
+
"react-aria": ["react-aria@3.52.1", "", { "dependencies": { "@internationalized/date": "^3.12.4", "@internationalized/number": "^3.6.8", "@internationalized/string": "^3.2.10", "@react-types/shared": "^3.36.1", "@swc/helpers": "^0.5.0", "aria-hidden": "^1.2.3", "clsx": "^2.0.0", "react-stately": "3.50.0", "use-sync-external-store": "^1.6.0" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1", "react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1" } }, "sha512-fdZZruC9/x/joCg0mhKGs5aHpwrXLCSZ4GOJmhhYyiE0ffyEsk9MLFt9LCOCF9tn8ErTD+UDQP4oDUSlZkmpCg=="],
|
|
22434
|
+
|
|
22435
|
+
"react-aria-components": ["react-aria-components@1.21.1", "", { "dependencies": { "@internationalized/date": "^3.12.4", "@internationalized/string": "^3.2.10", "@react-types/shared": "^3.36.1", "@swc/helpers": "^0.5.0", "client-only": "^0.0.1", "react-aria": "3.52.1", "react-stately": "3.50.0" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1", "react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1" } }, "sha512-J88WflYY0z+EhLX0ce+GjFlQ3ag3ubIgfUTjpKSrBQBu92Xtl4Ub9o118HItUddtbk1Ido0jzyPy94/klZy1hg=="],
|
|
22436
|
+
|
|
22437
|
+
"react-dom": ["react-dom@19.3.0", "", { "dependencies": { "scheduler": "^0.28.0" }, "peerDependencies": { "react": "^19.3.0" } }, "sha512-JDk8dgif51OjFoDE70+OT9ICyYr+69HlmihNwp1+Nsfbna3t5sIiCa9ZJktDmQ4/1b/rn26hIAR2uYXDMr5r0Q=="],
|
|
22438
|
+
|
|
22439
|
+
"react-stately": ["react-stately@3.50.0", "", { "dependencies": { "@internationalized/date": "^3.12.4", "@internationalized/number": "^3.6.8", "@internationalized/string": "^3.2.10", "@react-types/shared": "^3.36.1", "@swc/helpers": "^0.5.0", "use-sync-external-store": "^1.6.0" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1" } }, "sha512-TnckvpDQGU0672wEaLZqdzvhuSeXWjgW6vijMWxiKOxc8CosQUfPGISdcZyfHqjX3XMjEtRxj4w9HumvX4h4mw=="],
|
|
22440
|
+
|
|
22441
|
+
"scheduler": ["scheduler@0.28.0", "", {}, "sha512-juorfCmIkIw8tT+p5BXSm6PJjQF/ycEYmKyzURCIt/RaZIhL+PulbQ9Yu2z1HdOJDdqDTlxA1+xKBmHXJsczAw=="],
|
|
22442
|
+
|
|
22443
|
+
"tabbable": ["tabbable@6.5.0", "", {}, "sha512-wieBHXygIm7OyQOu5hQlkk62/WyCFYGlWg7L6/ZCUZwx0o398Zkn4pVmMyfYhfMG8kGrj/Krt8eIk6UKC6VzwA=="],
|
|
22444
|
+
|
|
22445
|
+
"tinypool": ["tinypool@2.1.2", "", {}, "sha512-9YodfrxS9g9IbFr/KOjE5bAeJ0p61n3bW6mqvy0jtoeKd1kTW1Cxm0oulm6KX2lyM9Gl6WIe8nEbY7LWv5ZJww=="],
|
|
22446
|
+
|
|
22447
|
+
"tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
|
|
22448
|
+
|
|
22449
|
+
"typescript": ["typescript@7.0.2", "", { "optionalDependencies": { "@typescript/typescript-aix-ppc64": "7.0.2", "@typescript/typescript-darwin-arm64": "7.0.2", "@typescript/typescript-darwin-x64": "7.0.2", "@typescript/typescript-freebsd-arm64": "7.0.2", "@typescript/typescript-freebsd-x64": "7.0.2", "@typescript/typescript-linux-arm": "7.0.2", "@typescript/typescript-linux-arm64": "7.0.2", "@typescript/typescript-linux-loong64": "7.0.2", "@typescript/typescript-linux-mips64el": "7.0.2", "@typescript/typescript-linux-ppc64": "7.0.2", "@typescript/typescript-linux-riscv64": "7.0.2", "@typescript/typescript-linux-s390x": "7.0.2", "@typescript/typescript-linux-x64": "7.0.2", "@typescript/typescript-netbsd-arm64": "7.0.2", "@typescript/typescript-netbsd-x64": "7.0.2", "@typescript/typescript-openbsd-arm64": "7.0.2", "@typescript/typescript-openbsd-x64": "7.0.2", "@typescript/typescript-sunos-x64": "7.0.2", "@typescript/typescript-win32-arm64": "7.0.2", "@typescript/typescript-win32-x64": "7.0.2" }, "bin": { "tsc": "bin/tsc" } }, "sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA=="],
|
|
22450
|
+
|
|
22451
|
+
"undici-types": ["undici-types@8.9.0", "", {}, "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg=="],
|
|
22452
|
+
|
|
22453
|
+
"use-sync-external-store": ["use-sync-external-store@1.7.0", "", { "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-6L+EeigHMQhdaIPNIFUKwfWJSwWFQ8gJbJ2DLOs5sDIegTwR9fRxvnM3uciHKjIZhFz+KAv2emhWMRvDmMcY8A=="],
|
|
22454
|
+
}
|
|
22455
|
+
}
|
|
22456
|
+
`, "bunfig.toml": `[install]
|
|
22457
|
+
exact = true
|
|
22458
|
+
`, "docs/data.md": `# Data authoring
|
|
22459
|
+
|
|
22460
|
+
Inspect catalogs, time coverage, and existing definitions before selecting the exploration. Explore several useful angles for broad requests. Use bounded queries and observed results.
|
|
22461
|
+
|
|
22462
|
+
| File | Owns |
|
|
22463
|
+
| --- | --- |
|
|
22464
|
+
| \`app.json\` | Title, verified scope, and appearance. |
|
|
22465
|
+
| \`src/operations.ts\` | Bounded server-side queries, validation, and fixed live-check inputs. Credentials stay on the server. |
|
|
22466
|
+
| \`src/variables.ts\` | Optional reader-controlled defaults, URL state, and operation inputs. |
|
|
22467
|
+
| \`src/data-context.ts\` or \`.tsx\` | Exploration description, glossary, named queries, and optional source identifiers. |
|
|
22468
|
+
| \`src/App.tsx\` | Questions, filters, result states, cards, and optional story. |
|
|
22469
|
+
|
|
22470
|
+
[Execute named queries](../node_modules/@altertable/data-app/docs/contract.md) and [bind evidence](../node_modules/@altertable/data-app/docs/react.md#bind-evidence) using the runtime contracts. Prefer a date variable for ongoing questions; choose a fixed period for deliberate historical explorations.
|
|
22471
|
+
|
|
22472
|
+
\`app check --lakehouse\` verifies declared operations and known profile scope. Environment-only credentials may not identify an organization; verify source identity during discovery when that metadata is unavailable.
|
|
22473
|
+
`, "docs/views.md": `# View authoring
|
|
22474
|
+
|
|
22475
|
+
Lead with a supported finding and provide complementary ways to explore the question. Check actual content at phone and desktop widths in both themes.
|
|
22476
|
+
|
|
22477
|
+
[Bind a view](../node_modules/@altertable/data-app/docs/react.md#bind-a-view) for variables, request states, shared skeletons, metrics and comparisons. [Bind evidence](../node_modules/@altertable/data-app/docs/react.md#bind-evidence) for glossary definitions and Present steps. The [UI map](../node_modules/@altertable/data-app/docs/react.md#find-ui-by-task) routes other components to their types.
|
|
22478
|
+
`, "package.json": `{
|
|
22479
|
+
"name": "data-app-starter",
|
|
22480
|
+
"private": true,
|
|
22481
|
+
"type": "module",
|
|
22482
|
+
"imports": {
|
|
22483
|
+
"#app/*": "./src/*",
|
|
22484
|
+
"#config": "./app.json"
|
|
22485
|
+
},
|
|
22486
|
+
"scripts": {
|
|
22487
|
+
"typecheck": "tsc --noEmit",
|
|
22488
|
+
"lint": "oxlint --type-aware src",
|
|
22489
|
+
"format": "oxfmt src",
|
|
22490
|
+
"format:check": "oxfmt --check src",
|
|
22491
|
+
"dev": "bun --hot src/server.ts",
|
|
22492
|
+
"build": "bun build src/index.html --outdir=dist --production"
|
|
22493
|
+
},
|
|
22494
|
+
"dependencies": {
|
|
22495
|
+
"@altertable/data-app": "0.61.0",
|
|
22496
|
+
"react": "19.3.0",
|
|
22497
|
+
"react-dom": "19.3.0"
|
|
22498
|
+
},
|
|
22499
|
+
"devDependencies": {
|
|
22500
|
+
"@types/bun": "1.4.2",
|
|
22501
|
+
"@types/react": "19.3.0",
|
|
22502
|
+
"@types/react-dom": "19.3.0",
|
|
22503
|
+
"oxfmt": "0.70.0",
|
|
22504
|
+
"oxlint": "1.85.0",
|
|
22505
|
+
"oxlint-tsgolint": "7.0.2003",
|
|
22506
|
+
"typescript": "7.0.2"
|
|
22507
|
+
}
|
|
22508
|
+
}
|
|
22509
|
+
`, "src/App.tsx": `import { GettingStarted } from "@altertable/data-app/react";
|
|
22510
|
+
import { dataContext } from "#app/data-context.ts";
|
|
22511
|
+
import app from "#config";
|
|
22512
|
+
|
|
22513
|
+
/** Connectivity-only screen. Investigate the requested question, then replace this with a view
|
|
22514
|
+
* that leads with a supported finding and explores the useful angles behind it. */
|
|
22515
|
+
export function App() {
|
|
22516
|
+
return <GettingStarted config={app} dataContext={dataContext} />;
|
|
22517
|
+
}
|
|
22518
|
+
`, "src/assets.d.ts": `declare module "*.css";
|
|
22519
|
+
`, "src/data-context.ts": `import { createDataContext } from "@altertable/data-app/react";
|
|
22520
|
+
import { connectionQueryNames } from "@altertable/data-app/contract";
|
|
22521
|
+
|
|
22522
|
+
/** Setup context only. Replace it with the exploration's scope, exact definitions, limitations,
|
|
22523
|
+
* and query evidence after inspecting the source data. */
|
|
22524
|
+
export const dataContext = createDataContext(connectionQueryNames)({
|
|
22525
|
+
description:
|
|
22526
|
+
"This starter runs a lightweight query to verify that the selected lakehouse profile can execute SQL. It does not check access to individual datasets. Replace the check with a query that answers a real question before sharing the app.",
|
|
22527
|
+
glossary: {
|
|
22528
|
+
connectionVerified: {
|
|
22529
|
+
term: "Connected",
|
|
22530
|
+
definition: "The latest connection-check query completed successfully.",
|
|
22531
|
+
queryNames: [connectionQueryNames.connection],
|
|
22532
|
+
},
|
|
22533
|
+
},
|
|
22534
|
+
});
|
|
22535
|
+
`, "src/favicon.svg": `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 51 44">
|
|
22536
|
+
<style>
|
|
22537
|
+
path { fill: #01050b; }
|
|
22538
|
+
@media (prefers-color-scheme: dark) {
|
|
22539
|
+
path { fill: #fff; }
|
|
22540
|
+
}
|
|
22541
|
+
</style>
|
|
22542
|
+
<path
|
|
22543
|
+
fill-rule="evenodd"
|
|
22544
|
+
clip-rule="evenodd"
|
|
22545
|
+
d="M40.3274 28.9788L35.9663 28.8378L34.9541 28.6881L18.1066 10.301L24.1073 0L26.8738 0.545413L41.5212 25.6848L40.3274 28.9788ZM20.5319 20.1112L18.1894 15.6731L14.6154 16.2904L0 41.378L0.894584 44H12.9453L20.5769 20.4134L20.5319 20.1112ZM44.9804 31.6253L20.3808 36.9197L17.5838 41.2974L19.9001 44H49.2036L51 41.9551L44.9804 31.6253Z"
|
|
22546
|
+
/>
|
|
22547
|
+
</svg>
|
|
22548
|
+
`, "src/index.html": `<!doctype html>
|
|
22549
|
+
<html lang="en">
|
|
22550
|
+
<head>
|
|
22551
|
+
<meta charset="UTF-8" />
|
|
22552
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
22553
|
+
<meta name="theme-color" content="#ffffff" />
|
|
22554
|
+
<title>Altertable app</title>
|
|
22555
|
+
<link rel="icon" href="./favicon.svg" type="image/svg+xml" />
|
|
22556
|
+
<script type="module" src="./main.tsx"></script>
|
|
22557
|
+
</head>
|
|
22558
|
+
<body>
|
|
22559
|
+
<div id="root"></div>
|
|
22560
|
+
</body>
|
|
22561
|
+
</html>
|
|
22562
|
+
`, "src/main.tsx": `import "@altertable/data-app/react/styles.css";
|
|
22563
|
+
import { mountDataApp } from "@altertable/data-app/react";
|
|
22564
|
+
import { App } from "#app/App.tsx";
|
|
22565
|
+
import app from "#config";
|
|
22566
|
+
|
|
22567
|
+
mountDataApp({ config: app, component: App });
|
|
22568
|
+
`, "src/operations.ts": `import { connectionCheck } from "@altertable/data-app/contract";
|
|
22569
|
+
|
|
22570
|
+
/** Connectivity probe only: its successful query supplies no analytical result. Replace it with
|
|
22571
|
+
* bounded, validated operations that cover the questions the finished app will answer. */
|
|
22572
|
+
export const operations = { connection: connectionCheck() };
|
|
22573
|
+
`, "src/server.ts": `import page from "#app/index.html";
|
|
22574
|
+
import { serveLocalApp } from "@altertable/data-app/server/bun";
|
|
22575
|
+
import { operations } from "#app/operations.ts";
|
|
22576
|
+
import app from "#config";
|
|
22577
|
+
|
|
22578
|
+
serveLocalApp({ page, operations, title: app.title });
|
|
22579
|
+
`, "tsconfig.json": `{
|
|
22580
|
+
"compilerOptions": {
|
|
22581
|
+
"target": "ESNext",
|
|
22582
|
+
"module": "Preserve",
|
|
22583
|
+
"moduleResolution": "bundler",
|
|
22584
|
+
"allowImportingTsExtensions": true,
|
|
22585
|
+
"resolveJsonModule": true,
|
|
22586
|
+
"jsx": "react-jsx",
|
|
22587
|
+
"strict": true,
|
|
22588
|
+
"noEmit": true,
|
|
22589
|
+
"skipLibCheck": true,
|
|
22590
|
+
"types": ["bun"]
|
|
22591
|
+
},
|
|
22592
|
+
"include": ["src"]
|
|
22593
|
+
}
|
|
22594
|
+
` } };
|
|
22595
|
+
|
|
22596
|
+
// src/commands/app/create.ts
|
|
22597
|
+
var appCreateCommand = defineCommand({
|
|
22598
|
+
metadata: {
|
|
22599
|
+
name: "create",
|
|
22600
|
+
description: "Create a data app project with a live connection check.",
|
|
22601
|
+
examples: [
|
|
22602
|
+
"altertable app create product-pulse",
|
|
22603
|
+
"altertable app create product-pulse --dir ./apps/product-pulse",
|
|
22604
|
+
"altertable --profile production app create product-pulse"
|
|
22605
|
+
]
|
|
22606
|
+
},
|
|
22607
|
+
args: {
|
|
22608
|
+
name: { type: "positional", description: "App name in kebab-case", required: true },
|
|
22609
|
+
dir: { type: "string", description: "Destination directory (default: ./<name>)." },
|
|
22610
|
+
"without-profile": {
|
|
22611
|
+
type: "boolean",
|
|
22612
|
+
description: "Create an offline scaffold with organization and environment placeholders."
|
|
22613
|
+
}
|
|
22614
|
+
},
|
|
22615
|
+
async run({ args, runtime, execution, sink }) {
|
|
22616
|
+
const name = String(args.name);
|
|
22617
|
+
if (name.length > 64 || !/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(name)) {
|
|
22618
|
+
throw new CliError("App name must be lowercase kebab-case, start with a letter, and be at most 64 characters.");
|
|
22619
|
+
}
|
|
22620
|
+
if (args.dir !== undefined && (typeof args.dir !== "string" || args.dir.length === 0)) {
|
|
22621
|
+
throw new CliError("--dir requires a directory path.");
|
|
22622
|
+
}
|
|
22623
|
+
const directory = resolve4(args.dir ?? name);
|
|
22624
|
+
const title = name.split("-").map((word) => word[0].toUpperCase() + word.slice(1)).join(" ");
|
|
22625
|
+
const explicitProfile = runtime.context.profile !== undefined || readEnv("ALTERTABLE_PROFILE") !== undefined;
|
|
22626
|
+
const withoutProfile = args["without-profile"] === true;
|
|
22627
|
+
if (withoutProfile && explicitProfile) {
|
|
22628
|
+
throw new CliError("--without-profile cannot be combined with --profile.");
|
|
22629
|
+
}
|
|
22630
|
+
const candidateProfile = execution.profile;
|
|
22631
|
+
const organizationSlug = configGet("organization_slug", candidateProfile).trim();
|
|
22632
|
+
const organizationName = configGet("organization_name", candidateProfile).trim();
|
|
22633
|
+
const environment = configGet("api_key_env", candidateProfile).trim();
|
|
22634
|
+
if (!withoutProfile && (!organizationSlug || !environment)) {
|
|
22635
|
+
throw new CliError(`Profile "${candidateProfile}" needs an organization and environment before it can seed a data app. Run \`altertable login --org <org> --env <env>\` to connect, or use \`--without-profile\` for an offline scaffold.`);
|
|
22636
|
+
}
|
|
22637
|
+
const profileName = withoutProfile ? undefined : candidateProfile;
|
|
22638
|
+
const scope = {
|
|
22639
|
+
organization: profileName ? organizationName || organizationSlug : "Your organization",
|
|
22640
|
+
environment: profileName ? environment : "your environment"
|
|
22641
|
+
};
|
|
22642
|
+
const files = Object.entries(createAppFiles(dataAppPayload, { name, title, scope }));
|
|
22643
|
+
await mkdir2(dirname4(directory), { recursive: true });
|
|
22644
|
+
try {
|
|
22645
|
+
await mkdir2(directory);
|
|
22646
|
+
} catch (error) {
|
|
22647
|
+
if (error instanceof Error && "code" in error && error.code === "EEXIST") {
|
|
22648
|
+
throw new CliError(`Directory already exists: ${directory}`);
|
|
22649
|
+
}
|
|
22650
|
+
throw new CliError(`Could not create data app directory: ${directory}`, { cause: error });
|
|
22651
|
+
}
|
|
22652
|
+
try {
|
|
22653
|
+
for (const [path, content] of files) {
|
|
22654
|
+
await mkdir2(dirname4(join7(directory, path)), { recursive: true });
|
|
22655
|
+
await writeFile2(join7(directory, path), content, { flag: "wx" });
|
|
22656
|
+
}
|
|
22657
|
+
} catch (error) {
|
|
22658
|
+
await rm(directory, { recursive: true, force: true });
|
|
22659
|
+
throw new CliError(`Could not create data app in ${directory}.`, { cause: error });
|
|
22660
|
+
}
|
|
22661
|
+
const nextSteps = profileName ? ["app dev", "app check", "app build"].map((command) => `altertable --profile ${profileName} ${command}`) : [
|
|
22662
|
+
"Set organization and environment in app.json.",
|
|
22663
|
+
"Select a matching profile, or configure one with `altertable login --org <org> --env <env>`.",
|
|
22664
|
+
"altertable app dev",
|
|
22665
|
+
"altertable app check --lakehouse",
|
|
22666
|
+
"altertable app build"
|
|
22667
|
+
];
|
|
22668
|
+
const result = {
|
|
22669
|
+
name,
|
|
22670
|
+
directory,
|
|
22671
|
+
scope,
|
|
22672
|
+
scopeSource: profileName ? "profile" : "placeholder",
|
|
22673
|
+
...profileName ? { profile: profileName, organizationSlug } : {},
|
|
22674
|
+
files: files.map(([path]) => path),
|
|
22675
|
+
nextSteps
|
|
22676
|
+
};
|
|
22677
|
+
if (sink.json)
|
|
22678
|
+
sink.writeJson(result);
|
|
22679
|
+
else if (profileName)
|
|
22680
|
+
sink.writeHuman(`Created ${title} in ${directory}.
|
|
22681
|
+
Scope: ${scope.organization} / ${scope.environment} (profile ${profileName}).
|
|
22682
|
+
From that directory, run \`${nextSteps[0]}\`.`);
|
|
22683
|
+
else
|
|
22684
|
+
sink.writeHuman(`Created ${title} in ${directory} with placeholder scope.
|
|
22685
|
+
Before previewing, set the organization and environment in app.json and select a matching profile (or run \`altertable login --org <org> --env <env>\`).
|
|
22686
|
+
You can run \`altertable app build\` from that directory now.`);
|
|
22687
|
+
}
|
|
22688
|
+
});
|
|
22689
|
+
|
|
22690
|
+
// src/commands/app/lib/scope.ts
|
|
22691
|
+
import { readFile as readFile2 } from "fs/promises";
|
|
22692
|
+
import { join as join8 } from "path";
|
|
22693
|
+
function assertAppScope(scope, profile) {
|
|
22694
|
+
const value = scope;
|
|
22695
|
+
if (!value || typeof value.organization !== "string" || !value.organization.trim() || typeof value.environment !== "string" || !value.environment.trim() || Boolean(profile.organization) && ![profile.organization, profile.organizationName].includes(value.organization) || Boolean(profile.environment) && value.environment !== profile.environment) {
|
|
22696
|
+
throw new ConfigurationError("app.json scope does not match the selected profile. Select the matching profile or update the app scope before querying.");
|
|
22697
|
+
}
|
|
22698
|
+
}
|
|
22699
|
+
async function checkAppScope(directory, profile) {
|
|
22700
|
+
let manifest;
|
|
22701
|
+
try {
|
|
22702
|
+
manifest = JSON.parse(await readFile2(join8(directory, "app.json"), "utf8"));
|
|
22703
|
+
} catch {
|
|
22704
|
+
throw new ConfigurationError("Cannot read a valid app.json for profile scope verification.");
|
|
22705
|
+
}
|
|
22706
|
+
assertAppScope(manifest?.scope, {
|
|
22707
|
+
organization: configGet("organization_slug", profile).trim(),
|
|
22708
|
+
organizationName: configGet("organization_name", profile).trim(),
|
|
22709
|
+
environment: isFromEnvProfile(profile) ? readEnv("ALTERTABLE_ENV") : configGet("api_key_env", profile).trim()
|
|
22710
|
+
});
|
|
22711
|
+
}
|
|
22712
|
+
|
|
22713
|
+
// src/commands/app/lib/dev-proxy.ts
|
|
22714
|
+
import { randomBytes as randomBytes5, timingSafeEqual } from "crypto";
|
|
22715
|
+
function startAppDevProxy(execution, send = sendHttpStream) {
|
|
22716
|
+
const token = randomBytes5(32).toString("hex");
|
|
22717
|
+
const server = Bun.serve({
|
|
22718
|
+
hostname: "127.0.0.1",
|
|
22719
|
+
port: 0,
|
|
22720
|
+
idleTimeout: 60,
|
|
22721
|
+
async fetch(request) {
|
|
22722
|
+
const supplied = request.headers.get("authorization")?.replace(/^Bearer /, "") ?? "";
|
|
22723
|
+
const valid = supplied.length === token.length && timingSafeEqual(Buffer.from(supplied), Buffer.from(token));
|
|
22724
|
+
if (!valid)
|
|
22725
|
+
return new Response("Unauthorized", { status: 401 });
|
|
22726
|
+
if (request.method !== "POST" || new URL(request.url).pathname !== "/query") {
|
|
22727
|
+
return new Response("Not found", { status: 404 });
|
|
22728
|
+
}
|
|
22729
|
+
const body = await request.text();
|
|
22730
|
+
if (body.length > 1e5)
|
|
22731
|
+
return new Response("Query too large", { status: 413 });
|
|
22732
|
+
try {
|
|
22733
|
+
const stream = await send({
|
|
22734
|
+
plane: "lakehouse",
|
|
22735
|
+
method: "POST",
|
|
22736
|
+
endpoint: "/query",
|
|
22737
|
+
body,
|
|
22738
|
+
contentType: "application/json"
|
|
22739
|
+
}, execution);
|
|
22740
|
+
return new Response(stream, {
|
|
22741
|
+
headers: { "content-type": "application/x-ndjson", "cache-control": "no-store" }
|
|
22742
|
+
});
|
|
22743
|
+
} catch (error) {
|
|
22744
|
+
if (error instanceof HttpError) {
|
|
22745
|
+
return new Response("Lakehouse query failed", { status: error.status ?? 502 });
|
|
22746
|
+
}
|
|
22747
|
+
if (error instanceof ConfigurationError) {
|
|
22748
|
+
console.error(`Data app lakehouse access failed for profile ${execution.profile}. Run \`altertable login\` or update the profile, then retry.`);
|
|
22749
|
+
return new Response("Lakehouse access needs attention", { status: 401 });
|
|
22750
|
+
}
|
|
22751
|
+
console.error(`Data app lakehouse query failed for profile ${execution.profile}.`);
|
|
22752
|
+
return new Response("Lakehouse query failed", { status: 502 });
|
|
22753
|
+
}
|
|
22754
|
+
}
|
|
22755
|
+
});
|
|
22756
|
+
return {
|
|
22757
|
+
environment: {
|
|
22758
|
+
ALTERTABLE_DATA_PROXY_URL: `http://127.0.0.1:${server.port}`,
|
|
22759
|
+
ALTERTABLE_DATA_PROXY_TOKEN: token
|
|
22760
|
+
},
|
|
22761
|
+
stop: () => server.stop(true)
|
|
22762
|
+
};
|
|
22763
|
+
}
|
|
22764
|
+
|
|
22765
|
+
// src/commands/app/dev.ts
|
|
22766
|
+
var appDevCommand = defineCommand({
|
|
22767
|
+
metadata: {
|
|
22768
|
+
name: "dev",
|
|
22769
|
+
description: "Preview a data app locally with lakehouse access.",
|
|
22770
|
+
examples: [
|
|
22771
|
+
"altertable app dev",
|
|
22772
|
+
"altertable app dev --port 3022",
|
|
22773
|
+
"altertable --profile staging app dev --dir ./my-app"
|
|
22774
|
+
]
|
|
22775
|
+
},
|
|
22776
|
+
args: {
|
|
22777
|
+
dir: { type: "string", description: "App directory (default: current directory)." },
|
|
22778
|
+
port: { type: "string", description: "Local dev server port (1\u201365535; default: app setting)." }
|
|
22779
|
+
},
|
|
22780
|
+
async run({ args, execution, runtime }) {
|
|
22781
|
+
assertAppOutputMode(runtime.context.json, runtime.context.agent);
|
|
22782
|
+
const port = appPort(args.port);
|
|
22783
|
+
const directory = appDirectory(args.dir);
|
|
22784
|
+
requireAppScripts(directory, ["dev"]);
|
|
22785
|
+
await checkAppScope(directory, execution.profile);
|
|
22786
|
+
const installExitCode = await runAppCommand("install", directory);
|
|
22787
|
+
if (installExitCode !== 0)
|
|
22788
|
+
return { exitCode: EXIT_GENERIC };
|
|
22789
|
+
const proxy = startAppDevProxy(execution);
|
|
22790
|
+
try {
|
|
22791
|
+
const environment = {
|
|
22792
|
+
...proxy.environment,
|
|
22793
|
+
...port ? { PORT: port } : {}
|
|
22794
|
+
};
|
|
22795
|
+
const exitCode = await runAppCommand("dev", directory, environment);
|
|
22796
|
+
return { exitCode: exitCode === 0 ? 0 : EXIT_GENERIC };
|
|
22797
|
+
} finally {
|
|
22798
|
+
await proxy.stop();
|
|
22799
|
+
}
|
|
22800
|
+
}
|
|
22801
|
+
});
|
|
22802
|
+
function appPort(value) {
|
|
22803
|
+
if (value === undefined)
|
|
22804
|
+
return;
|
|
22805
|
+
if (typeof value !== "string" || !/^[1-9]\d{0,4}$/.test(value) || Number(value) > 65535) {
|
|
22806
|
+
throw new CliError("--port must be an integer from 1 to 65535.");
|
|
22807
|
+
}
|
|
22808
|
+
return value;
|
|
22809
|
+
}
|
|
22810
|
+
|
|
22811
|
+
// src/commands/app/check.ts
|
|
22812
|
+
import { readFile as readFile4, readdir } from "fs/promises";
|
|
22813
|
+
import { join as join10 } from "path";
|
|
22814
|
+
|
|
22815
|
+
// src/commands/app/lib/package.ts
|
|
22816
|
+
import { readFile as readFile3 } from "fs/promises";
|
|
22817
|
+
import { join as join9 } from "path";
|
|
22818
|
+
var dataAppPackage = "@altertable/data-app";
|
|
22819
|
+
function recommendedDataAppVersion() {
|
|
22820
|
+
const version = JSON.parse(dataAppPayload.starter["package.json"]).dependencies[dataAppPackage];
|
|
22821
|
+
if (typeof version !== "string" || !/^\d+\.\d+\.\d+(?:-[\w.-]+)?$/.test(version)) {
|
|
22822
|
+
throw new ConfigurationError("The CLI starter must pin a published data app version.");
|
|
22823
|
+
}
|
|
22824
|
+
return version;
|
|
22825
|
+
}
|
|
22826
|
+
async function readAppPackage(directory) {
|
|
22827
|
+
try {
|
|
22828
|
+
const source = await readFile3(join9(directory, "package.json"), "utf8");
|
|
22829
|
+
const manifest = JSON.parse(source);
|
|
22830
|
+
if (!isRecord(manifest) || !isRecord(manifest.dependencies) || Object.values(manifest.dependencies).some((value) => typeof value !== "string"))
|
|
22831
|
+
throw new Error;
|
|
22832
|
+
return { source, manifest };
|
|
22833
|
+
} catch {
|
|
22834
|
+
throw new ConfigurationError(`Cannot read a valid package.json in ${directory}.`);
|
|
22835
|
+
}
|
|
22836
|
+
}
|
|
22837
|
+
async function requirePublishedDataApp(directory) {
|
|
22838
|
+
const { manifest } = await readAppPackage(directory);
|
|
22839
|
+
const reference = manifest.dependencies?.[dataAppPackage];
|
|
22840
|
+
if (!reference || !/^[\d~^<>=*]/.test(reference)) {
|
|
22841
|
+
throw new ConfigurationError(`package.json needs a published ${dataAppPackage} version or range.`);
|
|
22842
|
+
}
|
|
22843
|
+
let lock;
|
|
22844
|
+
try {
|
|
22845
|
+
lock = await readFile3(join9(directory, "bun.lock"), "utf8");
|
|
22846
|
+
} catch {
|
|
22847
|
+
throw new ConfigurationError(`Cannot read a valid bun.lock in ${directory}.`);
|
|
22848
|
+
}
|
|
22849
|
+
const { packages } = readAppLock(lock, directory, reference);
|
|
22850
|
+
const version = lockedVersion(packages, dataAppPackage);
|
|
22851
|
+
if (!version || !Bun.semver.satisfies(version, reference)) {
|
|
22852
|
+
throw new ConfigurationError("bun.lock does not resolve the declared data app package. Run bun install before checking.");
|
|
22853
|
+
}
|
|
22854
|
+
}
|
|
22855
|
+
function readAppLock(source, directory, reference) {
|
|
22856
|
+
try {
|
|
22857
|
+
const value = parseJsonc(source);
|
|
22858
|
+
const workspaces = isRecord(value) && value.workspaces;
|
|
22859
|
+
const root = isRecord(workspaces) && workspaces[""];
|
|
22860
|
+
const dependencies = isRecord(root) && root.dependencies;
|
|
22861
|
+
if (!isRecord(value) || !isRecord(value.packages) || !isRecord(dependencies) || reference !== undefined && dependencies[dataAppPackage] !== reference)
|
|
22862
|
+
throw new Error;
|
|
22863
|
+
return { packages: value.packages };
|
|
22864
|
+
} catch {
|
|
22865
|
+
throw new ConfigurationError(`Cannot read a valid bun.lock matching package.json in ${directory}.`);
|
|
22866
|
+
}
|
|
22867
|
+
}
|
|
22868
|
+
function lockedVersion(packages, name) {
|
|
22869
|
+
const entry = packages[name];
|
|
22870
|
+
if (!Array.isArray(entry) || typeof entry[0] !== "string")
|
|
22871
|
+
return;
|
|
22872
|
+
const version = entry[0].slice(`${name}@`.length);
|
|
22873
|
+
return entry[0].startsWith(`${name}@`) && /^\d+\.\d+\.\d+(?:-[\w.-]+)?$/.test(version) ? version : undefined;
|
|
22874
|
+
}
|
|
22875
|
+
function recommendedDataAppPeers() {
|
|
22876
|
+
const { packages } = readAppLock(dataAppPayload.starter["bun.lock"], "CLI starter", recommendedDataAppVersion());
|
|
22877
|
+
const entry = packages[dataAppPackage];
|
|
22878
|
+
const metadata = Array.isArray(entry) && entry.find((value) => isRecord(value) && isRecord(value.peerDependencies));
|
|
22879
|
+
if (!isRecord(metadata) || !isRecord(metadata.peerDependencies) || Object.values(metadata.peerDependencies).some((value) => typeof value !== "string")) {
|
|
22880
|
+
throw new ConfigurationError("The CLI starter lockfile needs data app peer dependencies.");
|
|
22881
|
+
}
|
|
22882
|
+
return metadata.peerDependencies;
|
|
22883
|
+
}
|
|
22884
|
+
function parseJsonc(source) {
|
|
22885
|
+
let withoutComments = "";
|
|
22886
|
+
let inString = false;
|
|
22887
|
+
let escaped = false;
|
|
22888
|
+
for (let index = 0;index < source.length; index++) {
|
|
22889
|
+
const character = source[index];
|
|
22890
|
+
const next = source[index + 1];
|
|
22891
|
+
if (inString) {
|
|
22892
|
+
withoutComments += character;
|
|
22893
|
+
if (escaped)
|
|
22894
|
+
escaped = false;
|
|
22895
|
+
else if (character === "\\")
|
|
22896
|
+
escaped = true;
|
|
22897
|
+
else if (character === '"')
|
|
22898
|
+
inString = false;
|
|
22899
|
+
} else if (character === '"') {
|
|
22900
|
+
inString = true;
|
|
22901
|
+
withoutComments += character;
|
|
22902
|
+
} else if (character === "/" && next === "/") {
|
|
22903
|
+
while (index < source.length && source[index] !== `
|
|
22904
|
+
`)
|
|
22905
|
+
index++;
|
|
22906
|
+
withoutComments += `
|
|
22907
|
+
`;
|
|
22908
|
+
} else if (character === "/" && next === "*") {
|
|
22909
|
+
index += 2;
|
|
22910
|
+
while (index < source.length && !(source[index] === "*" && source[index + 1] === "/"))
|
|
22911
|
+
index++;
|
|
22912
|
+
if (index >= source.length)
|
|
22913
|
+
throw new Error("Unterminated JSONC comment");
|
|
22914
|
+
index++;
|
|
22915
|
+
withoutComments += " ";
|
|
22916
|
+
} else {
|
|
22917
|
+
withoutComments += character;
|
|
22918
|
+
}
|
|
22919
|
+
}
|
|
22920
|
+
if (inString)
|
|
22921
|
+
throw new Error("Unterminated JSONC string");
|
|
22922
|
+
let withoutTrailingCommas = "";
|
|
22923
|
+
inString = false;
|
|
22924
|
+
escaped = false;
|
|
22925
|
+
for (let index = 0;index < withoutComments.length; index++) {
|
|
22926
|
+
const character = withoutComments[index];
|
|
22927
|
+
if (inString) {
|
|
22928
|
+
withoutTrailingCommas += character;
|
|
22929
|
+
if (escaped)
|
|
22930
|
+
escaped = false;
|
|
22931
|
+
else if (character === "\\")
|
|
22932
|
+
escaped = true;
|
|
22933
|
+
else if (character === '"')
|
|
22934
|
+
inString = false;
|
|
22935
|
+
} else if (character === '"') {
|
|
22936
|
+
inString = true;
|
|
22937
|
+
withoutTrailingCommas += character;
|
|
22938
|
+
} else if (character === "," && /^[\s]*[}\]]/.test(withoutComments.slice(index + 1))) {
|
|
22939
|
+
continue;
|
|
22940
|
+
} else {
|
|
22941
|
+
withoutTrailingCommas += character;
|
|
22942
|
+
}
|
|
22943
|
+
}
|
|
22944
|
+
return JSON.parse(withoutTrailingCommas);
|
|
22945
|
+
}
|
|
22946
|
+
|
|
22947
|
+
// src/commands/app/lib/project-check.js.txt
|
|
22948
|
+
var project_check_js_default = `import { readFile } from "node:fs/promises";
|
|
22949
|
+
import { join } from "node:path";
|
|
22950
|
+
import { pathToFileURL } from "node:url";
|
|
22951
|
+
|
|
22952
|
+
const appFile = (path) => pathToFileURL(join(process.cwd(), path)).href;
|
|
22953
|
+
|
|
22954
|
+
async function check() {
|
|
22955
|
+
const manifest = JSON.parse(await readFile("app.json", "utf8"));
|
|
22956
|
+
try {
|
|
22957
|
+
const { parseAppearance } = await import("@altertable/data-app/appearance");
|
|
22958
|
+
parseAppearance(manifest.appearance);
|
|
22959
|
+
} catch {
|
|
22960
|
+
throw new Error("app.json has invalid appearance settings.");
|
|
22961
|
+
}
|
|
22962
|
+
|
|
22963
|
+
let operations;
|
|
22964
|
+
try {
|
|
22965
|
+
({ operations } = await import(appFile("src/operations.ts")));
|
|
22966
|
+
} catch (error) {
|
|
22967
|
+
throw new Error(
|
|
22968
|
+
\`Cannot load src/operations.ts: \${error instanceof Error ? error.message : "unknown error"}\`,
|
|
22969
|
+
);
|
|
22970
|
+
}
|
|
22971
|
+
if (!operations || typeof operations !== "object" || Array.isArray(operations)) {
|
|
22972
|
+
throw new Error("src/operations.ts must export operations.");
|
|
22973
|
+
}
|
|
22974
|
+
const names = Object.keys(operations);
|
|
22975
|
+
if (!names.length) throw new Error("src/operations.ts needs at least one operation.");
|
|
22976
|
+
for (const name of names) {
|
|
22977
|
+
const operation = operations[name];
|
|
22978
|
+
if (
|
|
22979
|
+
!/^[a-z][a-z0-9-]*$/.test(name) ||
|
|
22980
|
+
!operation ||
|
|
22981
|
+
typeof operation.input !== "function" ||
|
|
22982
|
+
typeof operation.output !== "function" ||
|
|
22983
|
+
typeof operation.run !== "function" ||
|
|
22984
|
+
!Array.isArray(operation.checks) ||
|
|
22985
|
+
!operation.checks.length ||
|
|
22986
|
+
!Number.isInteger(operation.policy?.maxQueryRows) ||
|
|
22987
|
+
operation.policy.maxQueryRows < 1 ||
|
|
22988
|
+
!Number.isInteger(operation.policy.maxDurationMs) ||
|
|
22989
|
+
operation.policy.maxDurationMs < 1 ||
|
|
22990
|
+
(operation.policy.maxResponseBytes !== undefined &&
|
|
22991
|
+
(!Number.isInteger(operation.policy.maxResponseBytes) ||
|
|
22992
|
+
operation.policy.maxResponseBytes < 1))
|
|
22993
|
+
) {
|
|
22994
|
+
throw new Error(\`Operation "\${name}" needs input and output parsers, check inputs, and limits.\`);
|
|
22995
|
+
}
|
|
22996
|
+
for (const input of operation.checks) {
|
|
22997
|
+
try {
|
|
22998
|
+
operation.input(input);
|
|
22999
|
+
} catch {
|
|
23000
|
+
throw new Error(\`Operation "\${name}" has invalid check inputs.\`);
|
|
23001
|
+
}
|
|
23002
|
+
}
|
|
23003
|
+
}
|
|
23004
|
+
|
|
23005
|
+
if (await Bun.file("src/index.html").exists()) {
|
|
23006
|
+
const bundle = await Bun.build({
|
|
23007
|
+
entrypoints: ["src/index.html"],
|
|
23008
|
+
target: "browser",
|
|
23009
|
+
write: false,
|
|
23010
|
+
plugins: [{
|
|
23011
|
+
name: "data-app-browser-boundary",
|
|
23012
|
+
setup(build) {
|
|
23013
|
+
build.onResolve({ filter: /^@altertable\\/data-app\\/server(?:\\/|$)/ }, () => {
|
|
23014
|
+
throw new Error("Browser code cannot import server transport. Use import type for server types.");
|
|
23015
|
+
});
|
|
23016
|
+
build.onLoad({ filter: /\\.[cm]?[jt]sx?$/ }, ({ path }) => {
|
|
23017
|
+
const normalized = path.replaceAll("\\\\", "/");
|
|
23018
|
+
const root = process.cwd().replaceAll("\\\\", "/");
|
|
23019
|
+
if (normalized === \`\${root}/src/operations.ts\` ||
|
|
23020
|
+
normalized === \`\${root}/src/server.ts\` ||
|
|
23021
|
+
/node_modules\\/@altertable\\/data-app\\/(?:dist\\/(?:server|local)\\.js|src\\/server\\/[^/]+\\.[jt]s)$/.test(normalized)) {
|
|
23022
|
+
throw new Error("Browser code cannot import server operations or transport. Use import type for operation types.");
|
|
23023
|
+
}
|
|
23024
|
+
});
|
|
23025
|
+
},
|
|
23026
|
+
}],
|
|
23027
|
+
});
|
|
23028
|
+
if (!bundle.success) throw new Error(\`Client import boundary failed: \${bundle.logs.join("\\n")}\`);
|
|
23029
|
+
}
|
|
23030
|
+
|
|
23031
|
+
if (process.argv[1] !== "--lakehouse") return;
|
|
23032
|
+
const { createDataHandler } = await import("@altertable/data-app/server");
|
|
23033
|
+
const { localLakehouse } = await import("@altertable/data-app/server/bun");
|
|
23034
|
+
const handle = createDataHandler(operations, async () => ({
|
|
23035
|
+
lakehouse: localLakehouse(process.env),
|
|
23036
|
+
canDiscloseSql: true,
|
|
23037
|
+
}));
|
|
23038
|
+
for (const [name, operation] of Object.entries(operations)) {
|
|
23039
|
+
for (const input of operation.checks) {
|
|
23040
|
+
const response = await handle(
|
|
23041
|
+
new Request(\`http://localhost/api/data/\${name}\`, {
|
|
23042
|
+
method: "POST",
|
|
23043
|
+
headers: { "content-type": "application/json" },
|
|
23044
|
+
body: JSON.stringify(input),
|
|
23045
|
+
}),
|
|
23046
|
+
);
|
|
23047
|
+
if (!response.ok)
|
|
23048
|
+
throw new Error(\`Live check failed for operation "\${name}" (\${response.status}).\`);
|
|
23049
|
+
}
|
|
23050
|
+
}
|
|
23051
|
+
}
|
|
23052
|
+
|
|
23053
|
+
try {
|
|
23054
|
+
await check();
|
|
23055
|
+
} catch (error) {
|
|
23056
|
+
console.error(error instanceof Error ? error.message : "Data app validation failed.");
|
|
23057
|
+
process.exitCode = 1;
|
|
23058
|
+
}
|
|
23059
|
+
`;
|
|
23060
|
+
|
|
23061
|
+
// src/commands/app/check.ts
|
|
23062
|
+
var appCheckCommand = defineCommand({
|
|
23063
|
+
metadata: {
|
|
23064
|
+
name: "check",
|
|
23065
|
+
description: "Validate a data app's format, lint, types, contracts, build, and client credential boundary.",
|
|
23066
|
+
examples: ["altertable app check", "altertable app check --lakehouse"]
|
|
23067
|
+
},
|
|
23068
|
+
args: {
|
|
23069
|
+
dir: { type: "string", description: "App directory (default: current directory)." },
|
|
23070
|
+
lakehouse: {
|
|
23071
|
+
type: "boolean",
|
|
23072
|
+
description: "Run each operation\u2019s declared checks against the selected lakehouse."
|
|
23073
|
+
}
|
|
23074
|
+
},
|
|
23075
|
+
async run({ args, execution, runtime, sink }) {
|
|
23076
|
+
assertAppOutputMode(runtime.context.json, runtime.context.agent);
|
|
23077
|
+
const directory = appDirectory(args.dir);
|
|
23078
|
+
requireAppScripts(directory, ["format:check", "lint", "typecheck", "build"]);
|
|
23079
|
+
const manifest = await readManifest(directory);
|
|
23080
|
+
if (args.lakehouse)
|
|
23081
|
+
await checkAppScope(directory, execution.profile);
|
|
23082
|
+
await requirePublishedDataApp(directory);
|
|
23083
|
+
if (await runAppCommand("install-frozen", directory) !== 0)
|
|
23084
|
+
return { exitCode: EXIT_GENERIC };
|
|
23085
|
+
if (await runAppCommand("format:check", directory) !== 0)
|
|
23086
|
+
return { exitCode: EXIT_GENERIC };
|
|
23087
|
+
if (await runAppCommand("lint", directory) !== 0)
|
|
23088
|
+
return { exitCode: EXIT_GENERIC };
|
|
23089
|
+
if (await runAppCommand("typecheck", directory) !== 0)
|
|
23090
|
+
return { exitCode: EXIT_GENERIC };
|
|
23091
|
+
await checkAppProject(directory);
|
|
23092
|
+
if (await runAppCommand("build", directory) !== 0)
|
|
23093
|
+
return { exitCode: EXIT_GENERIC };
|
|
23094
|
+
await checkClientBundle(directory);
|
|
23095
|
+
if (args.lakehouse) {
|
|
23096
|
+
const verified = await configureVerify(["lakehouse"], execution);
|
|
23097
|
+
if (!verified.verified.lakehouse)
|
|
23098
|
+
throw new ConfigurationError(verified.errors[0]?.message ?? "Lakehouse credentials verification failed.");
|
|
23099
|
+
const credentials = getLakehouseCredentialPair(execution.profile);
|
|
23100
|
+
await checkClientBundle(directory, [credentials.password]);
|
|
23101
|
+
await checkAppProject(directory, {
|
|
23102
|
+
ALTERTABLE_API_BASE: resolveApiBase(execution.profile),
|
|
23103
|
+
ALTERTABLE_LAKEHOUSE_USERNAME: credentials.user,
|
|
23104
|
+
ALTERTABLE_LAKEHOUSE_PASSWORD: credentials.password
|
|
23105
|
+
});
|
|
23106
|
+
}
|
|
23107
|
+
sink.writeHuman(`Checked ${manifest.title}: format, lint, types, operation contracts, build, and client credential scan passed${args.lakehouse ? "; lakehouse operation checks passed" : ""}.`);
|
|
23108
|
+
}
|
|
23109
|
+
});
|
|
23110
|
+
async function readManifest(directory) {
|
|
23111
|
+
let value;
|
|
23112
|
+
try {
|
|
23113
|
+
value = JSON.parse(await readFile4(join10(directory, "app.json"), "utf8"));
|
|
23114
|
+
} catch {
|
|
23115
|
+
throw new ConfigurationError(`Cannot read a valid app.json in ${directory}.`);
|
|
23116
|
+
}
|
|
23117
|
+
if (typeof value !== "object" || value === null || !("schemaVersion" in value) || value.schemaVersion !== 1 || !("title" in value) || typeof value.title !== "string" || !value.title.trim()) {
|
|
23118
|
+
throw new ConfigurationError("app.json needs schemaVersion 1 and a title.");
|
|
23119
|
+
}
|
|
23120
|
+
return value;
|
|
23121
|
+
}
|
|
23122
|
+
async function checkAppProject(directory, lakehouseEnvironment) {
|
|
23123
|
+
const env = copyProcessEnv();
|
|
23124
|
+
for (const key of Object.keys(env)) {
|
|
23125
|
+
if (key.startsWith("ALTERTABLE_"))
|
|
23126
|
+
delete env[key];
|
|
23127
|
+
}
|
|
23128
|
+
Object.assign(env, lakehouseEnvironment);
|
|
23129
|
+
env.BUN_BE_BUN = "1";
|
|
23130
|
+
const child = Bun.spawn([
|
|
23131
|
+
process.execPath,
|
|
23132
|
+
"-e",
|
|
23133
|
+
project_check_js_default,
|
|
23134
|
+
"--",
|
|
23135
|
+
lakehouseEnvironment ? "--lakehouse" : "--contract"
|
|
23136
|
+
], { cwd: directory, env, stdin: "ignore", stdout: "inherit", stderr: "inherit" });
|
|
23137
|
+
if (await child.exited !== 0) {
|
|
23138
|
+
throw new ConfigurationError("Data app validation failed.");
|
|
23139
|
+
}
|
|
23140
|
+
}
|
|
23141
|
+
async function checkClientBundle(directory, secrets = []) {
|
|
23142
|
+
const dist = join10(directory, "dist");
|
|
23143
|
+
let files;
|
|
23144
|
+
try {
|
|
23145
|
+
files = await readdir(dist);
|
|
23146
|
+
} catch {
|
|
23147
|
+
throw new ConfigurationError("Build did not create dist/.");
|
|
23148
|
+
}
|
|
23149
|
+
const clientScripts = files.filter((name) => /^index(?:-[\w]+)?\.js$/.test(name));
|
|
23150
|
+
if (!files.includes("index.html") || !clientScripts.length) {
|
|
23151
|
+
throw new ConfigurationError("Build needs dist/index.html and a client JavaScript bundle.");
|
|
23152
|
+
}
|
|
23153
|
+
const clientAssets = [];
|
|
23154
|
+
async function visit(path, prefix = "") {
|
|
23155
|
+
for (const entry of await readdir(path, { withFileTypes: true })) {
|
|
23156
|
+
const name = prefix ? `${prefix}/${entry.name}` : entry.name;
|
|
23157
|
+
if (entry.isDirectory())
|
|
23158
|
+
await visit(join10(path, entry.name), name);
|
|
23159
|
+
else if (entry.isFile() && name !== "server.js" && name !== "server.js.map")
|
|
23160
|
+
clientAssets.push(name);
|
|
23161
|
+
}
|
|
23162
|
+
}
|
|
23163
|
+
await visit(dist);
|
|
23164
|
+
for (const name of clientAssets) {
|
|
23165
|
+
const content = await readFile4(join10(dist, name), "utf8");
|
|
23166
|
+
if (/ALTERTABLE_(?:API_BASE|LAKEHOUSE_USERNAME|LAKEHOUSE_PASSWORD|BASIC_AUTH_TOKEN|API_KEY|DATA_PROXY_URL|DATA_PROXY_TOKEN)/.test(content)) {
|
|
23167
|
+
throw new ConfigurationError(`Client asset ${name} contains a credential environment reference.`);
|
|
23168
|
+
}
|
|
23169
|
+
if (secrets.some((secret) => secret.length >= 8 && content.includes(secret))) {
|
|
23170
|
+
throw new ConfigurationError(`Client asset ${name} contains a lakehouse credential value.`);
|
|
23171
|
+
}
|
|
23172
|
+
}
|
|
23173
|
+
}
|
|
23174
|
+
|
|
23175
|
+
// src/commands/app/upgrade.ts
|
|
23176
|
+
import { readFile as readFile5, writeFile as writeFile3 } from "fs/promises";
|
|
23177
|
+
import { join as join11 } from "path";
|
|
23178
|
+
var appUpgradeCommand = defineCommand({
|
|
23179
|
+
metadata: {
|
|
23180
|
+
name: "upgrade",
|
|
23181
|
+
description: "Update the data app package to the CLI's tested version.",
|
|
23182
|
+
examples: ["altertable app upgrade", "altertable app upgrade --dir ./my-app"]
|
|
23183
|
+
},
|
|
23184
|
+
args: { dir: { type: "string", description: "App directory (default: current directory)." } },
|
|
23185
|
+
async run({ args, sink }) {
|
|
23186
|
+
const directory = appDirectory(args.dir);
|
|
23187
|
+
const upgraded = await upgradeApp(directory);
|
|
23188
|
+
const { packages } = readAppLock(await readFile5(join11(directory, "bun.lock"), "utf8"), directory);
|
|
23189
|
+
const version = lockedVersion(packages, dataAppPackage);
|
|
23190
|
+
if (sink.json) {
|
|
23191
|
+
sink.writeJson({
|
|
23192
|
+
directory,
|
|
23193
|
+
upgraded,
|
|
23194
|
+
runtimeVersion: version,
|
|
23195
|
+
nextSteps: upgraded ? [
|
|
23196
|
+
"Run `altertable app check` in the app directory.",
|
|
23197
|
+
"Restart any running `altertable app dev` server."
|
|
23198
|
+
] : []
|
|
23199
|
+
});
|
|
23200
|
+
} else {
|
|
23201
|
+
sink.writeHuman(upgraded ? `Updated data app package to ${version}. Run \`altertable app check\`, then restart any running \`altertable app dev\` server.` : `Data app package ${version} is already current.`);
|
|
23202
|
+
}
|
|
23203
|
+
}
|
|
23204
|
+
});
|
|
23205
|
+
async function upgradeApp(directory, options = {}) {
|
|
23206
|
+
const version = recommendedDataAppVersion();
|
|
23207
|
+
const { source: originalPackage, manifest } = await readAppPackage(directory);
|
|
23208
|
+
const reference = manifest.dependencies?.[dataAppPackage];
|
|
23209
|
+
if (!reference || !/^[\d~^<>=*]/.test(reference)) {
|
|
23210
|
+
throw new ConfigurationError(`package.json must reference the published ${dataAppPackage} package.`);
|
|
23211
|
+
}
|
|
23212
|
+
let lock;
|
|
23213
|
+
try {
|
|
23214
|
+
lock = await readFile5(join11(directory, "bun.lock"), "utf8");
|
|
23215
|
+
} catch {
|
|
23216
|
+
throw new ConfigurationError(`Cannot read a valid bun.lock in ${directory}.`);
|
|
23217
|
+
}
|
|
23218
|
+
const { packages } = readAppLock(lock, directory, reference);
|
|
23219
|
+
const installedVersion = lockedVersion(packages, dataAppPackage);
|
|
23220
|
+
if (!installedVersion || !Bun.semver.satisfies(installedVersion, reference)) {
|
|
23221
|
+
throw new ConfigurationError("bun.lock does not resolve the declared data app package. Run bun install before upgrading.");
|
|
23222
|
+
}
|
|
23223
|
+
if (Bun.semver.order(installedVersion, version) > 0)
|
|
23224
|
+
return false;
|
|
23225
|
+
const defaults = JSON.parse(dataAppPayload.starter["package.json"]).dependencies;
|
|
23226
|
+
let packageChanged = reference !== version;
|
|
23227
|
+
for (const [name, range] of Object.entries(recommendedDataAppPeers())) {
|
|
23228
|
+
const existing = manifest.dependencies?.[name] ?? manifest.devDependencies?.[name];
|
|
23229
|
+
const resolved = lockedVersion(packages, name);
|
|
23230
|
+
if (existing && resolved && Bun.semver.satisfies(resolved, existing) && Bun.semver.satisfies(resolved, range))
|
|
23231
|
+
continue;
|
|
23232
|
+
if (existing)
|
|
23233
|
+
throw new ConfigurationError(`Data app package needs ${name}@${range}; app declares ${existing}. Update package.json and bun.lock before upgrading.`);
|
|
23234
|
+
const fallback = defaults[name];
|
|
23235
|
+
if (!fallback || !Bun.semver.satisfies(fallback, range))
|
|
23236
|
+
throw new ConfigurationError(`Add ${name}@${range} before upgrading.`);
|
|
23237
|
+
manifest.dependencies[name] = fallback;
|
|
23238
|
+
packageChanged = true;
|
|
23239
|
+
}
|
|
23240
|
+
if (!packageChanged)
|
|
23241
|
+
return false;
|
|
23242
|
+
manifest.dependencies[dataAppPackage] = version;
|
|
23243
|
+
const nextPackage = `${JSON.stringify(manifest, null, 2)}
|
|
23244
|
+
`;
|
|
23245
|
+
try {
|
|
23246
|
+
await writeFile3(join11(directory, "package.json"), nextPackage);
|
|
23247
|
+
await (options.resolveLock ?? resolveLockfile)(directory);
|
|
23248
|
+
const resolved = readAppLock(await readFile5(join11(directory, "bun.lock"), "utf8"), directory, version);
|
|
23249
|
+
if (lockedVersion(resolved.packages, dataAppPackage) !== version)
|
|
23250
|
+
throw new ConfigurationError("Dependency resolution did not lock the tested data app version.");
|
|
23251
|
+
for (const [name, range] of Object.entries(recommendedDataAppPeers())) {
|
|
23252
|
+
const peerVersion = lockedVersion(resolved.packages, name);
|
|
23253
|
+
if (!peerVersion || !Bun.semver.satisfies(peerVersion, range))
|
|
23254
|
+
throw new ConfigurationError(`Resolved ${name} is incompatible with data app's ${range} peer requirement.`);
|
|
23255
|
+
}
|
|
23256
|
+
await writeFile3(join11(directory, "package.json"), nextPackage);
|
|
23257
|
+
} catch (error) {
|
|
23258
|
+
const restored = await Promise.allSettled([
|
|
23259
|
+
writeFile3(join11(directory, "package.json"), originalPackage),
|
|
23260
|
+
writeFile3(join11(directory, "bun.lock"), lock)
|
|
23261
|
+
]);
|
|
23262
|
+
if (restored.some((result) => result.status === "rejected"))
|
|
23263
|
+
throw new ConfigurationError("Upgrade failed and could not restore package.json and bun.lock.", { cause: error });
|
|
23264
|
+
throw error;
|
|
23265
|
+
}
|
|
23266
|
+
return true;
|
|
23267
|
+
}
|
|
23268
|
+
async function resolveLockfile(directory) {
|
|
23269
|
+
const env = copyProcessEnv();
|
|
23270
|
+
for (const key of Object.keys(env))
|
|
23271
|
+
if (key.startsWith("ALTERTABLE_"))
|
|
23272
|
+
delete env[key];
|
|
23273
|
+
const child = Bun.spawn([process.execPath, "update", "@altertable/data-app", "--lockfile-only", "--ignore-scripts"], {
|
|
23274
|
+
cwd: directory,
|
|
23275
|
+
env: { ...env, BUN_BE_BUN: "1" },
|
|
23276
|
+
stdout: "pipe",
|
|
23277
|
+
stderr: "pipe"
|
|
23278
|
+
});
|
|
23279
|
+
const [stdout, stderr, code] = await Promise.all([
|
|
23280
|
+
new Response(child.stdout).text(),
|
|
23281
|
+
new Response(child.stderr).text(),
|
|
23282
|
+
child.exited
|
|
23283
|
+
]);
|
|
23284
|
+
if (code !== 0)
|
|
23285
|
+
throw new ConfigurationError(`Could not resolve data app dependencies; upgrade rolled back.
|
|
23286
|
+
${stderr || stdout}`);
|
|
23287
|
+
}
|
|
23288
|
+
|
|
23289
|
+
// src/commands/app/index.ts
|
|
23290
|
+
var appCommand = defineCommand({
|
|
23291
|
+
metadata: {
|
|
23292
|
+
name: "app",
|
|
23293
|
+
commandGroup: "platform",
|
|
23294
|
+
description: "Create, develop, check, build, and upgrade data apps.",
|
|
23295
|
+
examples: [
|
|
23296
|
+
"altertable app create my-app",
|
|
23297
|
+
"altertable app dev",
|
|
23298
|
+
"altertable app check",
|
|
23299
|
+
"altertable app build",
|
|
23300
|
+
"altertable app upgrade"
|
|
23301
|
+
]
|
|
23302
|
+
},
|
|
23303
|
+
subcommands: {
|
|
23304
|
+
create: appCreateCommand,
|
|
23305
|
+
dev: appDevCommand,
|
|
23306
|
+
build: appBuildCommand,
|
|
23307
|
+
check: appCheckCommand,
|
|
23308
|
+
upgrade: appUpgradeCommand
|
|
23309
|
+
}
|
|
23310
|
+
});
|
|
23311
|
+
|
|
21980
23312
|
// src/commands/index.ts
|
|
21981
23313
|
function buildTopLevelCommands(getMainCommand) {
|
|
21982
23314
|
return {
|
|
21983
23315
|
login: loginCommand,
|
|
21984
23316
|
logout: logoutCommand,
|
|
21985
23317
|
profile: profileCommand,
|
|
23318
|
+
catalog: catalogCommand,
|
|
21986
23319
|
catalogs: catalogsCommand,
|
|
21987
23320
|
query: queryCommand,
|
|
21988
23321
|
schema: schemaCommand,
|
|
@@ -21992,6 +23325,7 @@ function buildTopLevelCommands(getMainCommand) {
|
|
|
21992
23325
|
upsert: upsertCommand,
|
|
21993
23326
|
api: apiCommand,
|
|
21994
23327
|
doctor: doctorCommand,
|
|
23328
|
+
app: appCommand,
|
|
21995
23329
|
update: updateCommand,
|
|
21996
23330
|
completion: createCompletionCommand(getMainCommand)
|
|
21997
23331
|
};
|
|
@@ -22758,7 +24092,7 @@ function buildMainCommand() {
|
|
|
22758
24092
|
examples: [
|
|
22759
24093
|
"altertable profile configure",
|
|
22760
24094
|
"altertable profile show",
|
|
22761
|
-
"altertable api
|
|
24095
|
+
"altertable api route",
|
|
22762
24096
|
"altertable api /environments/production/databases",
|
|
22763
24097
|
'altertable query "SELECT * FROM analytics.main.events ORDER BY timestamp DESC LIMIT 10"'
|
|
22764
24098
|
]
|
|
@@ -22812,6 +24146,9 @@ async function bootstrap() {
|
|
|
22812
24146
|
}
|
|
22813
24147
|
validateEnvironment();
|
|
22814
24148
|
const selection = await executeCommand(main, rawArgs);
|
|
24149
|
+
if (selection.command !== main && !selection.command.run && selection.command.subcommands) {
|
|
24150
|
+
await showAltertableUsage(selection.command, selection.parent, main);
|
|
24151
|
+
}
|
|
22815
24152
|
await maybeShowUpdateNotice({
|
|
22816
24153
|
context: getCliContext(),
|
|
22817
24154
|
commandName: selection.commandPath.at(0)
|