@neat.is/core 0.10.3-dev.20260930 → 0.10.3
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.cjs +46 -18
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +46 -18
- package/dist/cli.js.map +1 -1
- package/package.json +2 -2
package/dist/cli.cjs
CHANGED
|
@@ -30607,6 +30607,15 @@ function bindUrl(webUrl, projectId) {
|
|
|
30607
30607
|
function onboardingUrl(webUrl) {
|
|
30608
30608
|
return `${webUrl}/onboarding`;
|
|
30609
30609
|
}
|
|
30610
|
+
async function offerLocalExtraction(input, d, out, readLine) {
|
|
30611
|
+
const run = d.orchestrator;
|
|
30612
|
+
if (!run || !readLine) return false;
|
|
30613
|
+
const answer = (await readLine("Build it now? [Y/n] "))?.trim().toLowerCase();
|
|
30614
|
+
if (answer === "n" || answer === "no") return false;
|
|
30615
|
+
out("");
|
|
30616
|
+
const code = await run(d.cwd ?? process.cwd(), {});
|
|
30617
|
+
return code === 0;
|
|
30618
|
+
}
|
|
30610
30619
|
async function runPostLoginConnect(input) {
|
|
30611
30620
|
const d = input.deps;
|
|
30612
30621
|
const out = d.out ?? ((line) => console.log(line));
|
|
@@ -30616,9 +30625,27 @@ async function runPostLoginConnect(input) {
|
|
|
30616
30625
|
const readLine = d.readLine;
|
|
30617
30626
|
const repo = await detect6(cwd);
|
|
30618
30627
|
out("");
|
|
30628
|
+
const cmd = commandPrefix();
|
|
30629
|
+
const syncLine = `${cmd} sync --to ${input.project.name}`;
|
|
30619
30630
|
if (!repo) {
|
|
30620
30631
|
out("This directory has no GitHub remote, so it can't be bound to the project.");
|
|
30621
|
-
|
|
30632
|
+
const hasGraph = await (d.hasLocalGraph ?? hasLocalSnapshot)(cwd);
|
|
30633
|
+
if (!hasGraph) {
|
|
30634
|
+
out(`A graph of this directory has to be built first, then pushed to ${input.project.name}.`);
|
|
30635
|
+
const built = await offerLocalExtraction(input, d, out, readLine);
|
|
30636
|
+
out("");
|
|
30637
|
+
if (built) {
|
|
30638
|
+
out(`Now push it to ${input.project.name}:`);
|
|
30639
|
+
out(` ${syncLine}`);
|
|
30640
|
+
} else {
|
|
30641
|
+
out(`When you're ready, build it and push it to ${input.project.name}:`);
|
|
30642
|
+
out(` ${cmd}`);
|
|
30643
|
+
out(` ${syncLine}`);
|
|
30644
|
+
}
|
|
30645
|
+
out(` Manage projects and repos: ${input.webUrl}`);
|
|
30646
|
+
return;
|
|
30647
|
+
}
|
|
30648
|
+
out(` Push its graph instead: ${syncLine}`);
|
|
30622
30649
|
out(` Manage projects and repos: ${input.webUrl}`);
|
|
30623
30650
|
return;
|
|
30624
30651
|
}
|
|
@@ -30652,18 +30679,18 @@ async function runPostLoginConnect(input) {
|
|
|
30652
30679
|
out("");
|
|
30653
30680
|
if (!hasGraph) {
|
|
30654
30681
|
out("There is no local graph to push yet. Build one, then push it:");
|
|
30655
|
-
out(
|
|
30656
|
-
out(`
|
|
30682
|
+
out(` ${cmd}`);
|
|
30683
|
+
out(` ${syncLine}`);
|
|
30657
30684
|
return;
|
|
30658
30685
|
}
|
|
30659
30686
|
out("Push the local graph with:");
|
|
30660
|
-
out(`
|
|
30687
|
+
out(` ${syncLine}`);
|
|
30661
30688
|
return;
|
|
30662
30689
|
}
|
|
30663
30690
|
out("");
|
|
30664
30691
|
out("No problem \u2014 when you want this repo in the graph:");
|
|
30665
30692
|
out(` Bind it: ${bindUrl(input.webUrl, input.project.id)}`);
|
|
30666
|
-
out(` Or push it:
|
|
30693
|
+
out(` Or push it: ${syncLine}`);
|
|
30667
30694
|
}
|
|
30668
30695
|
|
|
30669
30696
|
// src/login-sso.ts
|
|
@@ -30842,7 +30869,7 @@ async function runSsoLogin(opts, deps) {
|
|
|
30842
30869
|
...deps.signal ? { signal: deps.signal } : {}
|
|
30843
30870
|
});
|
|
30844
30871
|
if (waited.kind === "aborted") {
|
|
30845
|
-
out(
|
|
30872
|
+
out(`Stopped. Run \`${commandPrefix()} login\` again once your project is up.`);
|
|
30846
30873
|
return 130;
|
|
30847
30874
|
}
|
|
30848
30875
|
if (waited.kind === "timeout") {
|
|
@@ -30910,7 +30937,7 @@ async function runSsoLogin(opts, deps) {
|
|
|
30910
30937
|
}
|
|
30911
30938
|
});
|
|
30912
30939
|
out("");
|
|
30913
|
-
out(
|
|
30940
|
+
out(`Run \`${commandPrefix()} logout\` to switch back to your local daemon.`);
|
|
30914
30941
|
}
|
|
30915
30942
|
return 0;
|
|
30916
30943
|
}
|
|
@@ -34938,23 +34965,24 @@ async function tryOrchestrator(cmd, parsed, overrides = {}) {
|
|
|
34938
34965
|
return result.exitCode;
|
|
34939
34966
|
}
|
|
34940
34967
|
async function runWelcomeFlow(parsed) {
|
|
34968
|
+
const runLocal = async (cwd, opts) => await tryOrchestrator(
|
|
34969
|
+
cwd,
|
|
34970
|
+
{
|
|
34971
|
+
...parsed,
|
|
34972
|
+
...opts?.project !== void 0 ? { project: opts.project } : {},
|
|
34973
|
+
...opts?.noInstrument !== void 0 ? { noInstrument: opts.noInstrument } : {},
|
|
34974
|
+
...opts?.yes !== void 0 ? { yes: opts.yes } : {}
|
|
34975
|
+
},
|
|
34976
|
+
{ skipBanner: opts?.headerShown === true }
|
|
34977
|
+
) ?? 0;
|
|
34941
34978
|
return runWelcome({
|
|
34942
|
-
login: (loginArgv) => runLoginCommand(loginArgv),
|
|
34979
|
+
login: (loginArgv) => runLoginCommand(loginArgv, { connect: { orchestrator: runLocal } }),
|
|
34943
34980
|
// What the person chose at the door reaches the orchestrator as the flags they
|
|
34944
34981
|
// stand for: the name as `--project`, the instrument answer as `--no-instrument`
|
|
34945
34982
|
// or as `yes` (which keeps the orchestrator's own prompt quiet, since the door
|
|
34946
34983
|
// already asked). `headerShown` isn't a flag anyone can type — it says the
|
|
34947
34984
|
// door's wordmark already opened this run, so the orchestrator's banner is skipped.
|
|
34948
|
-
orchestrator:
|
|
34949
|
-
cwd,
|
|
34950
|
-
{
|
|
34951
|
-
...parsed,
|
|
34952
|
-
...opts?.project !== void 0 ? { project: opts.project } : {},
|
|
34953
|
-
...opts?.noInstrument !== void 0 ? { noInstrument: opts.noInstrument } : {},
|
|
34954
|
-
...opts?.yes !== void 0 ? { yes: opts.yes } : {}
|
|
34955
|
-
},
|
|
34956
|
-
{ skipBanner: opts?.headerShown === true }
|
|
34957
|
-
) ?? 0,
|
|
34985
|
+
orchestrator: runLocal,
|
|
34958
34986
|
// An explicit flag is an answer; don't ask again.
|
|
34959
34987
|
instrumentFlagGiven: parsed.noInstrument || parsed.dryRun
|
|
34960
34988
|
});
|