@rebasepro/cli 0.25.0 → 0.25.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-setup-B5AKHOgt.js → agent-setup-BYb2Tbdz.js} +2 -2
- package/dist/{agent-setup-B5AKHOgt.js.map → agent-setup-BYb2Tbdz.js.map} +1 -1
- package/dist/{api-keys-Tm7zvAPe.js → api-keys-CSMbsmAn.js} +3 -4
- package/dist/{api-keys-Tm7zvAPe.js.map → api-keys-CSMbsmAn.js.map} +1 -1
- package/dist/{apps-BsU_ILbP.js → apps-iBXNZhVN.js} +6 -7
- package/dist/{apps-BsU_ILbP.js.map → apps-iBXNZhVN.js.map} +1 -1
- package/dist/{atlas-dev-database-OWtqnG7W.js → atlas-dev-database-BusbHP6n.js} +4 -4
- package/dist/{atlas-dev-database-OWtqnG7W.js.map → atlas-dev-database-BusbHP6n.js.map} +1 -1
- package/dist/{auth-Vl2hFKXP.js → auth-DRsTWPky.js} +6 -7
- package/dist/{auth-Vl2hFKXP.js.map → auth-DRsTWPky.js.map} +1 -1
- package/dist/{branch-pointer-9DnwkFJJ.js → branch-pointer-Bn_FjNld.js} +1 -1
- package/dist/{build-BBgT8EJZ.js → build-et7Rccxi.js} +6 -7
- package/dist/{build-BBgT8EJZ.js.map → build-et7Rccxi.js.map} +1 -1
- package/dist/{bundle-DtCCCr4w.js → bundle-DlqkDYSe.js} +3 -3
- package/dist/{bundle-DtCCCr4w.js.map → bundle-DlqkDYSe.js.map} +1 -1
- package/dist/{cloud-BpH0_bmV.js → cloud-B-ZIjHrA.js} +10 -11
- package/dist/{cloud-BpH0_bmV.js.map → cloud-B-ZIjHrA.js.map} +1 -1
- package/dist/commands/dev.d.ts +12 -0
- package/dist/commands/generate_sdk.d.ts +4 -2
- package/dist/commands/init.d.ts +20 -0
- package/dist/commands/start.d.ts +10 -0
- package/dist/commands/upgrade.d.ts +12 -0
- package/dist/{consent-ClRHmcxf.js → consent-BaB-eQKG.js} +2 -2
- package/dist/{consent-ClRHmcxf.js.map → consent-BaB-eQKG.js.map} +1 -1
- package/dist/{console-CEGm0XNc.js → console-BlD9kjFW.js} +4 -4
- package/dist/{console-CEGm0XNc.js.map → console-BlD9kjFW.js.map} +1 -1
- package/dist/{context-CyflUrKg.js → context-DHiiiJ5C.js} +3 -4
- package/dist/context-DHiiiJ5C.js.map +1 -0
- package/dist/{daemon-CknkDjd6.js → daemon-DDMRbz4T.js} +160 -5
- package/dist/daemon-DDMRbz4T.js.map +1 -0
- package/dist/{daemon-entry-CbLRrgzy.js → daemon-entry-zOC1revO.js} +6 -3
- package/dist/daemon-entry-zOC1revO.js.map +1 -0
- package/dist/{db-CRNpA5mH.js → db-9P6MnmdC.js} +90 -50
- package/dist/db-9P6MnmdC.js.map +1 -0
- package/dist/{derive-CsoFGAnK.js → derive-MTdClnkc.js} +2 -2
- package/dist/{derive-CsoFGAnK.js.map → derive-MTdClnkc.js.map} +1 -1
- package/dist/{dev-C0pbMmhS.js → dev-BDN_OKXA.js} +183 -23
- package/dist/dev-BDN_OKXA.js.map +1 -0
- package/dist/dev-db/daemon.d.ts +41 -0
- package/dist/dev-db/pull.d.ts +33 -5
- package/dist/dev-db/state.d.ts +9 -0
- package/dist/{dev-preflight-unHpiYO1.js → dev-preflight-FT9GbJVj.js} +73 -27
- package/dist/dev-preflight-FT9GbJVj.js.map +1 -0
- package/dist/{dev-server-B1UYifZJ.js → dev-server-CIZwAfZa.js} +14 -3
- package/dist/dev-server-CIZwAfZa.js.map +1 -0
- package/dist/{doctor-CATRdWm6.js → doctor-D8YXz7df.js} +6 -6
- package/dist/doctor-D8YXz7df.js.map +1 -0
- package/dist/{eject-DuasTr-F.js → eject-izG2KjMo.js} +3 -4
- package/dist/{eject-DuasTr-F.js.map → eject-izG2KjMo.js.map} +1 -1
- package/dist/{fold-static-hDHtDfTq.js → fold-static-CybSay_W.js} +3 -3
- package/dist/{fold-static-hDHtDfTq.js.map → fold-static-CybSay_W.js.map} +1 -1
- package/dist/{generate_sdk-Cvg5jjJF.js → generate_sdk-B4R65oUV.js} +21 -11
- package/dist/generate_sdk-B4R65oUV.js.map +1 -0
- package/dist/index.es.js +36 -37
- package/dist/index.es.js.map +1 -1
- package/dist/{init-BWAwHPtz.js → init-DYaeppEN.js} +50 -62
- package/dist/init-DYaeppEN.js.map +1 -0
- package/dist/invoked-command-CG_rIa_o.js +55 -0
- package/dist/invoked-command-CG_rIa_o.js.map +1 -0
- package/dist/last-dev-database-B_75fxZC.js +2 -0
- package/dist/{manifest-DRp0UVTj.js → manifest-nvPdLlJY.js} +2 -2
- package/dist/{manifest-DRp0UVTj.js.map → manifest-nvPdLlJY.js.map} +1 -1
- package/dist/{normalize-imports-BoBVh5tU.js → normalize-imports-BYw8ad87.js} +3 -3
- package/dist/{normalize-imports-BoBVh5tU.js.map → normalize-imports-BYw8ad87.js.map} +1 -1
- package/dist/{prepare-DdnU70z8.js → prepare-1rVNd2PF.js} +5 -4
- package/dist/{prepare-DdnU70z8.js.map → prepare-1rVNd2PF.js.map} +1 -1
- package/dist/project-g4K6kV1t.js +701 -0
- package/dist/project-g4K6kV1t.js.map +1 -0
- package/dist/{pull-C3PXduzl.js → pull-DDMpsZ5r.js} +131 -24
- package/dist/pull-DDMpsZ5r.js.map +1 -0
- package/dist/refusal-ReeeGP8a.js +26 -0
- package/dist/refusal-ReeeGP8a.js.map +1 -0
- package/dist/resolve-BQUAC3Wi.js +2 -0
- package/dist/{resources-BdNRDEAy.js → resources-CovP8AZ-.js} +4 -5
- package/dist/{resources-BdNRDEAy.js.map → resources-CovP8AZ-.js.map} +1 -1
- package/dist/{schema-B0-p6T1O.js → schema-nuxvvc50.js} +5 -6
- package/dist/{schema-B0-p6T1O.js.map → schema-nuxvvc50.js.map} +1 -1
- package/dist/{skills-DfnTeyRz.js → skills-DeUIsZcT.js} +3 -4
- package/dist/{skills-DfnTeyRz.js.map → skills-DeUIsZcT.js.map} +1 -1
- package/dist/{start-BmEZkS0n.js → start-RzZqDroW.js} +20 -7
- package/dist/start-RzZqDroW.js.map +1 -0
- package/dist/{state-CCB-FAQ9.js → state-CYdBvnwA.js} +3 -2
- package/dist/state-CYdBvnwA.js.map +1 -0
- package/dist/{status-BJ26yZOo.js → status-D9Zm88NZ.js} +8 -9
- package/dist/{status-BJ26yZOo.js.map → status-D9Zm88NZ.js.map} +1 -1
- package/dist/{storage-DKPUBTWG.js → storage-BB3umRfw.js} +3 -4
- package/dist/{storage-DKPUBTWG.js.map → storage-BB3umRfw.js.map} +1 -1
- package/dist/{telemetry-EMFRVRQi.js → telemetry-HfU5uAh1.js} +2 -2
- package/dist/{telemetry-EMFRVRQi.js.map → telemetry-HfU5uAh1.js.map} +1 -1
- package/dist/{telemetry-m9czTNGR.js → telemetry-TseNLk6X.js} +4 -4
- package/dist/{telemetry-m9czTNGR.js.map → telemetry-TseNLk6X.js.map} +1 -1
- package/dist/{upgrade-DjihWuZL.js → upgrade-apiPKKE_.js} +26 -4
- package/dist/{upgrade-DjihWuZL.js.map → upgrade-apiPKKE_.js.map} +1 -1
- package/dist/utils/args.d.ts +32 -3
- package/dist/utils/boot-retry.d.ts +41 -0
- package/dist/utils/dev-preflight.d.ts +34 -1
- package/dist/utils/dev-server.d.ts +11 -0
- package/dist/utils/project.d.ts +5 -1
- package/dist/utils/unknown-command.d.ts +4 -0
- package/package.json +7 -7
- package/templates/resource-graphs/blank.json +25 -0
- package/templates/resource-graphs/blog.json +28 -0
- package/templates/resource-graphs/ecommerce.json +28 -0
- package/templates/resource-graphs/headless.json +22 -0
- package/templates/template/.env.example +5 -4
- package/templates/template/frontend/src/App.tsx +10 -9
- package/dist/args-BX0YD14a.js +0 -266
- package/dist/args-BX0YD14a.js.map +0 -1
- package/dist/context-CyflUrKg.js.map +0 -1
- package/dist/daemon-CknkDjd6.js.map +0 -1
- package/dist/daemon-entry-CbLRrgzy.js.map +0 -1
- package/dist/db-CRNpA5mH.js.map +0 -1
- package/dist/dev-C0pbMmhS.js.map +0 -1
- package/dist/dev-preflight-unHpiYO1.js.map +0 -1
- package/dist/dev-server-B1UYifZJ.js.map +0 -1
- package/dist/doctor-CATRdWm6.js.map +0 -1
- package/dist/generate_sdk-Cvg5jjJF.js.map +0 -1
- package/dist/init-BWAwHPtz.js.map +0 -1
- package/dist/last-dev-database-c_dKz1S3.js +0 -2
- package/dist/project-Wp2zoyeN.js +0 -349
- package/dist/project-Wp2zoyeN.js.map +0 -1
- package/dist/pull-C3PXduzl.js.map +0 -1
- package/dist/resolve-CNQjsatH.js +0 -2
- package/dist/start-BmEZkS0n.js.map +0 -1
- package/dist/state-CCB-FAQ9.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as setConsent, d as configPath, f as readConfig, r as previewEvent, s as readProjectPolicy, t as endpoint } from "./telemetry-
|
|
2
|
-
import {
|
|
3
|
-
import { r as renderPreview, t as describeState } from "./consent-
|
|
1
|
+
import { a as setConsent, d as configPath, f as readConfig, r as previewEvent, s as readProjectPolicy, t as endpoint } from "./telemetry-HfU5uAh1.js";
|
|
2
|
+
import { C as wantsHelp, T as unknownCommand, b as parseCommandArgs } from "./project-g4K6kV1t.js";
|
|
3
|
+
import { r as renderPreview, t as describeState } from "./consent-BaB-eQKG.js";
|
|
4
4
|
import chalk from "chalk";
|
|
5
5
|
//#region src/commands/telemetry.ts
|
|
6
6
|
/**
|
|
@@ -125,4 +125,4 @@ ${chalk.gray("URLs, hostnames, error messages, stack traces, or exact record cou
|
|
|
125
125
|
//#endregion
|
|
126
126
|
export { TELEMETRY_SUBCOMMANDS, telemetryCommand };
|
|
127
127
|
|
|
128
|
-
//# sourceMappingURL=telemetry-
|
|
128
|
+
//# sourceMappingURL=telemetry-TseNLk6X.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry-m9czTNGR.js","names":[],"sources":["../src/commands/telemetry.ts"],"sourcesContent":["import chalk from \"chalk\";\n\nimport { describeState, renderPreview } from \"../telemetry/consent\";\nimport { configPath, endpoint, previewEvent, readConfig, readProjectPolicy, setConsent } from \"../telemetry\";\nimport { parseCommandArgs, wantsHelp } from \"../utils/args\";\nimport { unknownCommand } from \"../utils/unknown-command\";\n\n/**\n * `rebase telemetry` — the command that makes the rest of it inspectable.\n *\n * The whole subsystem asks for trust it cannot otherwise earn, and the cheapest\n * way to earn it is to stop describing the payload and print it. `show` runs\n * the same builder the sender uses, so what appears here is what would go, not\n * a documentation comment that quietly fell out of date two releases ago.\n */\n/** Everything the switch below dispatches, for the did-you-mean. */\nexport const TELEMETRY_SUBCOMMANDS = [\"status\", \"show\", \"enable\", \"disable\"] as const;\n\nexport async function telemetryCommand(rawArgs: string[]): Promise<void> {\n // Checked before parsing, because `--help` is answered by the dispatcher\n // and never by a handler. It used to be checked after a `filter(a =>\n // !a.startsWith(\"-\"))` that stripped every flag off the line, so `rebase\n // telemetry --help` reached `case undefined` and printed the status page.\n if (wantsHelp(rawArgs)) {\n printHelp();\n return;\n }\n\n // Strictly, like every other family. That `filter` was not \"be lenient\": it\n // deleted every `-`-prefixed token before dispatch, so `rebase telemetry\n // --frobnicate` printed the status page and exited 0, and a mistyped\n // `--disable` looked exactly like asking for the status. `parseCommandArgs`\n // is the CLI's one rule for an undeclared flag, and the comment at the top\n // of `utils/args.ts` is why: guessing that an unknown flag was meant as\n // something else is the unsafe branch.\n const { positionals } = parseCommandArgs({\n spec: {},\n rawArgs,\n commandWords: 1,\n command: \"telemetry\",\n maxPositionals: 1\n });\n const subcommand = positionals[0];\n\n switch (subcommand) {\n case \"status\":\n case undefined:\n printStatus();\n return;\n case \"show\":\n printPayload();\n return;\n case \"enable\":\n if (!setConsent(true)) {\n console.error(chalk.red(`Could not write ${configPath()} — sharing was not enabled.`));\n process.exitCode = 1;\n return;\n }\n console.log(chalk.green(\"Anonymous usage sharing enabled.\"));\n console.log(chalk.gray(`Inspect what gets sent with ${chalk.cyan(\"rebase telemetry show\")}.`));\n return;\n case \"disable\":\n if (!setConsent(false)) {\n // The failure direction that matters. Someone turning sharing\n // off must never be left believing it worked — so this is loud,\n // non-zero, and points at the switch that needs no disk.\n console.error(chalk.red(`Could not write ${configPath()} — sharing is still ON.`));\n console.error(chalk.yellow(`Set ${chalk.cyan(\"REBASE_TELEMETRY_DISABLED=1\")} in your environment instead; it needs no file.`));\n process.exitCode = 1;\n return;\n }\n console.log(chalk.gray(\"Anonymous usage sharing disabled. Nothing further will be sent.\"));\n return;\n default:\n // Printing the help and setting exit 1 said nothing about *why*:\n // the page that came back looked like the page `rebase telemetry\n // --help` prints, and the only difference was an exit code nobody\n // reads at a prompt.\n unknownCommand(subcommand, TELEMETRY_SUBCOMMANDS, \"telemetry\");\n }\n}\n\nfunction printStatus(): void {\n console.log(\"\");\n console.log(` Status: ${describeState()}`);\n if (readProjectPolicy() === \"ignored_opt_in\") {\n // Said out loud rather than silently ignored: a maintainer who wrote\n // `\"telemetry\": true` believes they turned something on, and leaving\n // them to believe it is worse than refusing.\n console.log(\"\");\n console.log(chalk.yellow(\" Note: this project's rebase.json sets \\\"telemetry\\\": true, which is ignored.\"));\n console.log(chalk.gray(\" A committed file cannot consent on behalf of everyone who clones it.\"));\n console.log(chalk.gray(` Only \"telemetry\": false is honoured there. Use ${chalk.cyan(\"rebase telemetry enable\")}.`));\n }\n console.log(` Endpoint: ${chalk.gray(endpoint())}`);\n console.log(` Config: ${chalk.gray(configPath())}`);\n console.log(\"\");\n console.log(chalk.gray(` ${chalk.cyan(\"rebase telemetry show\")} prints the exact payload.`));\n console.log(\"\");\n}\n\nfunction printPayload(): void {\n const config = readConfig();\n if (config.enabled !== true) {\n // Deliberately still prints one. The consent prompt points here so the\n // question can stay short, and someone deciding whether to say yes is\n // exactly the person who most needs to see the payload — telling them\n // to enable sharing first, in order to find out what sharing sends,\n // is the wrong way round.\n console.log(\"\");\n console.log(` ${describeState()}`);\n console.log(\"\");\n console.log(chalk.gray(\" Nothing is being sent. This is what WOULD be sent if you said yes:\"));\n console.log(\"\");\n console.log(renderPreview(\"cli.dev\", { first_run: false }).split(\"\\n\").map((l) => \" \" + l).join(\"\\n\"));\n console.log(\"\");\n console.log(chalk.gray(` Start sharing with ${chalk.cyan(\"rebase telemetry enable\")}.`));\n console.log(\"\");\n return;\n }\n\n // A representative event rather than a synthetic one: `cli.dev` is the\n // event that fires most often, so it is the one worth being sure about.\n const event = previewEvent(\"cli.dev\", { first_run: false }, process.cwd());\n console.log(\"\");\n console.log(chalk.gray(\" Sent to \") + chalk.gray(endpoint()) + chalk.gray(\", for example:\"));\n console.log(\"\");\n console.log(JSON.stringify(event, null, 2).split(\"\\n\").map((l) => \" \" + l).join(\"\\n\"));\n console.log(\"\");\n console.log(chalk.gray(\" Both ids are random. Neither is derived from your machine, your\"));\n console.log(chalk.gray(\" hostname, your project name or anything you have typed.\"));\n console.log(\"\");\n}\n\nfunction printHelp(): void {\n console.log(`\n${chalk.bold(\"rebase telemetry\")} — anonymous usage sharing (off until you say yes; ${chalk.cyan(\"rebase init\")} asks)\n\n${chalk.bold(\"Commands\")}\n ${chalk.blue(\"status\")} Whether anything is being shared, and why ${chalk.gray(\"(default)\")}\n ${chalk.blue(\"show\")} Print the exact payload that would be sent\n ${chalk.blue(\"enable\")} Start sharing\n ${chalk.blue(\"disable\")} Stop sharing, permanently\n\n${chalk.bold(\"Project policy\")}\n ${chalk.blue('\"telemetry\": false')} in ${chalk.blue(\"rebase.json\")} disables sharing for everyone who\n clones the repository, overriding each developer's own choice.\n ${chalk.gray('\"telemetry\": true is ignored — a committed file cannot consent for others.')}\n\n${chalk.bold(\"Environment\")}\n ${chalk.blue(\"DO_NOT_TRACK\")} Set to disable, across every tool that honours it\n ${chalk.blue(\"REBASE_TELEMETRY_DISABLED\")} Set to disable Rebase specifically\n ${chalk.blue(\"REBASE_TELEMETRY_ENDPOINT\")} Send elsewhere — your own collector, for instance\n\n${chalk.gray(\"Never shared: project names, paths, collection or table names, database\")}\n${chalk.gray(\"URLs, hostnames, error messages, stack traces, or exact record counts.\")}\n`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AAM,KAAK,mEAAmE,CAAC;CAC3F,QAAQ,IAAI,MAAM,KAAK,2DAA2D,CAAC;CACnF,QAAQ,IAAI,EAAE;AAClB;AAEA,SAAS,YAAkB;CACvB,QAAQ,IAAI;EACd,MAAM,KAAK,kBAAkB,EAAE,qDAAqD,MAAM,KAAK,aAAa,EAAE;;EAE9G,MAAM,KAAK,UAAU,EAAE;IACrB,MAAM,KAAK,QAAQ,EAAE,iDAAiD,MAAM,KAAK,WAAW,EAAE;IAC9F,MAAM,KAAK,MAAM,EAAE;IACnB,MAAM,KAAK,QAAQ,EAAE;IACrB,MAAM,KAAK,SAAS,EAAE;;EAExB,MAAM,KAAK,gBAAgB,EAAE;IAC3B,MAAM,KAAK,sBAAoB,EAAE,MAAM,MAAM,KAAK,aAAa,EAAE;;IAEjE,MAAM,KAAK,8EAA4E,EAAE;;EAE3F,MAAM,KAAK,aAAa,EAAE;IACxB,MAAM,KAAK,cAAc,EAAE;IAC3B,MAAM,KAAK,2BAA2B,EAAE;IACxC,MAAM,KAAK,2BAA2B,EAAE;;EAE1C,MAAM,KAAK,yEAAyE,EAAE;EACtF,MAAM,KAAK,wEAAwE,EAAE;CACtF;AACD"}
|
|
1
|
+
{"version":3,"file":"telemetry-TseNLk6X.js","names":[],"sources":["../src/commands/telemetry.ts"],"sourcesContent":["import chalk from \"chalk\";\n\nimport { describeState, renderPreview } from \"../telemetry/consent\";\nimport { configPath, endpoint, previewEvent, readConfig, readProjectPolicy, setConsent } from \"../telemetry\";\nimport { parseCommandArgs, wantsHelp } from \"../utils/args\";\nimport { unknownCommand } from \"../utils/unknown-command\";\n\n/**\n * `rebase telemetry` — the command that makes the rest of it inspectable.\n *\n * The whole subsystem asks for trust it cannot otherwise earn, and the cheapest\n * way to earn it is to stop describing the payload and print it. `show` runs\n * the same builder the sender uses, so what appears here is what would go, not\n * a documentation comment that quietly fell out of date two releases ago.\n */\n/** Everything the switch below dispatches, for the did-you-mean. */\nexport const TELEMETRY_SUBCOMMANDS = [\"status\", \"show\", \"enable\", \"disable\"] as const;\n\nexport async function telemetryCommand(rawArgs: string[]): Promise<void> {\n // Checked before parsing, because `--help` is answered by the dispatcher\n // and never by a handler. It used to be checked after a `filter(a =>\n // !a.startsWith(\"-\"))` that stripped every flag off the line, so `rebase\n // telemetry --help` reached `case undefined` and printed the status page.\n if (wantsHelp(rawArgs)) {\n printHelp();\n return;\n }\n\n // Strictly, like every other family. That `filter` was not \"be lenient\": it\n // deleted every `-`-prefixed token before dispatch, so `rebase telemetry\n // --frobnicate` printed the status page and exited 0, and a mistyped\n // `--disable` looked exactly like asking for the status. `parseCommandArgs`\n // is the CLI's one rule for an undeclared flag, and the comment at the top\n // of `utils/args.ts` is why: guessing that an unknown flag was meant as\n // something else is the unsafe branch.\n const { positionals } = parseCommandArgs({\n spec: {},\n rawArgs,\n commandWords: 1,\n command: \"telemetry\",\n maxPositionals: 1\n });\n const subcommand = positionals[0];\n\n switch (subcommand) {\n case \"status\":\n case undefined:\n printStatus();\n return;\n case \"show\":\n printPayload();\n return;\n case \"enable\":\n if (!setConsent(true)) {\n console.error(chalk.red(`Could not write ${configPath()} — sharing was not enabled.`));\n process.exitCode = 1;\n return;\n }\n console.log(chalk.green(\"Anonymous usage sharing enabled.\"));\n console.log(chalk.gray(`Inspect what gets sent with ${chalk.cyan(\"rebase telemetry show\")}.`));\n return;\n case \"disable\":\n if (!setConsent(false)) {\n // The failure direction that matters. Someone turning sharing\n // off must never be left believing it worked — so this is loud,\n // non-zero, and points at the switch that needs no disk.\n console.error(chalk.red(`Could not write ${configPath()} — sharing is still ON.`));\n console.error(chalk.yellow(`Set ${chalk.cyan(\"REBASE_TELEMETRY_DISABLED=1\")} in your environment instead; it needs no file.`));\n process.exitCode = 1;\n return;\n }\n console.log(chalk.gray(\"Anonymous usage sharing disabled. Nothing further will be sent.\"));\n return;\n default:\n // Printing the help and setting exit 1 said nothing about *why*:\n // the page that came back looked like the page `rebase telemetry\n // --help` prints, and the only difference was an exit code nobody\n // reads at a prompt.\n unknownCommand(subcommand, TELEMETRY_SUBCOMMANDS, \"telemetry\");\n }\n}\n\nfunction printStatus(): void {\n console.log(\"\");\n console.log(` Status: ${describeState()}`);\n if (readProjectPolicy() === \"ignored_opt_in\") {\n // Said out loud rather than silently ignored: a maintainer who wrote\n // `\"telemetry\": true` believes they turned something on, and leaving\n // them to believe it is worse than refusing.\n console.log(\"\");\n console.log(chalk.yellow(\" Note: this project's rebase.json sets \\\"telemetry\\\": true, which is ignored.\"));\n console.log(chalk.gray(\" A committed file cannot consent on behalf of everyone who clones it.\"));\n console.log(chalk.gray(` Only \"telemetry\": false is honoured there. Use ${chalk.cyan(\"rebase telemetry enable\")}.`));\n }\n console.log(` Endpoint: ${chalk.gray(endpoint())}`);\n console.log(` Config: ${chalk.gray(configPath())}`);\n console.log(\"\");\n console.log(chalk.gray(` ${chalk.cyan(\"rebase telemetry show\")} prints the exact payload.`));\n console.log(\"\");\n}\n\nfunction printPayload(): void {\n const config = readConfig();\n if (config.enabled !== true) {\n // Deliberately still prints one. The consent prompt points here so the\n // question can stay short, and someone deciding whether to say yes is\n // exactly the person who most needs to see the payload — telling them\n // to enable sharing first, in order to find out what sharing sends,\n // is the wrong way round.\n console.log(\"\");\n console.log(` ${describeState()}`);\n console.log(\"\");\n console.log(chalk.gray(\" Nothing is being sent. This is what WOULD be sent if you said yes:\"));\n console.log(\"\");\n console.log(renderPreview(\"cli.dev\", { first_run: false }).split(\"\\n\").map((l) => \" \" + l).join(\"\\n\"));\n console.log(\"\");\n console.log(chalk.gray(` Start sharing with ${chalk.cyan(\"rebase telemetry enable\")}.`));\n console.log(\"\");\n return;\n }\n\n // A representative event rather than a synthetic one: `cli.dev` is the\n // event that fires most often, so it is the one worth being sure about.\n const event = previewEvent(\"cli.dev\", { first_run: false }, process.cwd());\n console.log(\"\");\n console.log(chalk.gray(\" Sent to \") + chalk.gray(endpoint()) + chalk.gray(\", for example:\"));\n console.log(\"\");\n console.log(JSON.stringify(event, null, 2).split(\"\\n\").map((l) => \" \" + l).join(\"\\n\"));\n console.log(\"\");\n console.log(chalk.gray(\" Both ids are random. Neither is derived from your machine, your\"));\n console.log(chalk.gray(\" hostname, your project name or anything you have typed.\"));\n console.log(\"\");\n}\n\nfunction printHelp(): void {\n console.log(`\n${chalk.bold(\"rebase telemetry\")} — anonymous usage sharing (off until you say yes; ${chalk.cyan(\"rebase init\")} asks)\n\n${chalk.bold(\"Commands\")}\n ${chalk.blue(\"status\")} Whether anything is being shared, and why ${chalk.gray(\"(default)\")}\n ${chalk.blue(\"show\")} Print the exact payload that would be sent\n ${chalk.blue(\"enable\")} Start sharing\n ${chalk.blue(\"disable\")} Stop sharing, permanently\n\n${chalk.bold(\"Project policy\")}\n ${chalk.blue('\"telemetry\": false')} in ${chalk.blue(\"rebase.json\")} disables sharing for everyone who\n clones the repository, overriding each developer's own choice.\n ${chalk.gray('\"telemetry\": true is ignored — a committed file cannot consent for others.')}\n\n${chalk.bold(\"Environment\")}\n ${chalk.blue(\"DO_NOT_TRACK\")} Set to disable, across every tool that honours it\n ${chalk.blue(\"REBASE_TELEMETRY_DISABLED\")} Set to disable Rebase specifically\n ${chalk.blue(\"REBASE_TELEMETRY_ENDPOINT\")} Send elsewhere — your own collector, for instance\n\n${chalk.gray(\"Never shared: project names, paths, collection or table names, database\")}\n${chalk.gray(\"URLs, hostnames, error messages, stack traces, or exact record counts.\")}\n`);\n}\n"],"mappings":";;;;;;;;;;;;;;AAgBA,IAAa,wBAAwB;CAAC;CAAU;CAAQ;CAAU;AAAS;AAE3E,eAAsB,iBAAiB,SAAkC;CAKrE,IAAI,UAAU,OAAO,GAAG;EACpB,UAAU;EACV;CACJ;CASA,MAAM,EAAE,gBAAgB,iBAAiB;EACrC,MAAM,CAAC;EACP;EACA,cAAc;EACd,SAAS;EACT,gBAAgB;CACpB,CAAC;CACD,MAAM,aAAa,YAAY;CAE/B,QAAQ,YAAR;EACI,KAAK;EACL,KAAK,KAAA;GACD,YAAY;GACZ;EACJ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IACrB,MAAM,KAAK,SAAS,EAAE;;EAExB,MAAM,KAAK,gBAAgB,EAAE;IAC3B,MAAM,KAAK,sBAAoB,EAAE,MAAM,MAAM,KAAK,aAAa,EAAE;;IAEjE,MAAM,KAAK,8EAA4E,EAAE;;EAE3F,MAAM,KAAK,aAAa,EAAE;IACxB,MAAM,KAAK,cAAc,EAAE;IAC3B,MAAM,KAAK,2BAA2B,EAAE;IACxC,MAAM,KAAK,2BAA2B,EAAE;;EAE1C,MAAM,KAAK,yEAAyE,EAAE;EACtF,MAAM,KAAK,wEAAwE,EAAE;CACtF;AACD"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { n as getPMCommands } from "./package-manager-DSEOwTqM.js";
|
|
2
|
-
import { i as failAsJson, p as requireProjectRoot } from "./project-
|
|
3
|
-
import {
|
|
4
|
-
import { o as ManifestError, p as loadManifest } from "./manifest-DRp0UVTj.js";
|
|
2
|
+
import { C as wantsHelp, b as parseCommandArgs, i as failAsJson, p as requireProjectRoot } from "./project-g4K6kV1t.js";
|
|
3
|
+
import { o as ManifestError, p as loadManifest } from "./manifest-nvPdLlJY.js";
|
|
5
4
|
import chalk from "chalk";
|
|
6
5
|
import fs from "fs";
|
|
7
6
|
import path from "path";
|
|
@@ -1250,8 +1249,10 @@ async function upgradeCommand(rawArgs, io = defaultIo) {
|
|
|
1250
1249
|
dryRun,
|
|
1251
1250
|
wouldRefuse: dryRun ? downgradeRefusal : null
|
|
1252
1251
|
};
|
|
1252
|
+
const databaseNotice = wrote ? await runningDatabaseNotice(projectRoot, plan.target) : [];
|
|
1253
1253
|
if (json) {
|
|
1254
1254
|
console.log(JSON.stringify(result, null, 2));
|
|
1255
|
+
for (const line of databaseNotice) console.error(line);
|
|
1255
1256
|
return;
|
|
1256
1257
|
}
|
|
1257
1258
|
printOutcome(plan, {
|
|
@@ -1261,6 +1262,27 @@ async function upgradeCommand(rawArgs, io = defaultIo) {
|
|
|
1261
1262
|
installLine,
|
|
1262
1263
|
wouldRefuse: dryRun ? downgradeRefusal : null
|
|
1263
1264
|
});
|
|
1265
|
+
if (databaseNotice.length > 0) {
|
|
1266
|
+
for (const line of databaseNotice) console.log(chalk.yellow(line));
|
|
1267
|
+
console.log("");
|
|
1268
|
+
}
|
|
1269
|
+
}
|
|
1270
|
+
/**
|
|
1271
|
+
* What to say about this project's managed database when an older CLI started
|
|
1272
|
+
* it, or nothing.
|
|
1273
|
+
*
|
|
1274
|
+
* The daemon outlives every command and the database proxy runs inside it, so
|
|
1275
|
+
* moving the pins does not move the proxy: the old one, with whatever the
|
|
1276
|
+
* upgrade fixed in it, kept serving until `rebase db stop` or thirty idle
|
|
1277
|
+
* minutes — and under a running `rebase dev` it never idles. The upgraded CLI
|
|
1278
|
+
* restarts it when nothing is connected (`daemonOutdated`); this says so, and
|
|
1279
|
+
* what to do while something is.
|
|
1280
|
+
*/
|
|
1281
|
+
async function runningDatabaseNotice(projectRoot, target) {
|
|
1282
|
+
const { daemonOutdated, findRunningDaemon } = await import("./daemon-DDMRbz4T.js").then((n) => n.t);
|
|
1283
|
+
const state = await findRunningDaemon(projectRoot);
|
|
1284
|
+
if (!state || !daemonOutdated(state.cliVersion, target)) return [];
|
|
1285
|
+
return [`⚠ This project's development database is still running, started by ${state.cliVersion ? `Rebase CLI ${state.cliVersion}` : "an earlier Rebase CLI"}, and its database proxy is that CLI's until it restarts.`, ` The next command that needs it restarts it on ${target} when nothing is connected to it. While \`rebase dev\` runs, stop it, then run \`rebase db stop\`. Data is kept.`];
|
|
1264
1286
|
}
|
|
1265
1287
|
/** Changes grouped by file, then what was left alone and why, then overrides. */
|
|
1266
1288
|
function printSummary(plan, dryRun) {
|
|
@@ -1337,4 +1359,4 @@ function printOutcome(plan, outcome) {
|
|
|
1337
1359
|
//#endregion
|
|
1338
1360
|
export { upgradeCommand };
|
|
1339
1361
|
|
|
1340
|
-
//# sourceMappingURL=upgrade-
|
|
1362
|
+
//# sourceMappingURL=upgrade-apiPKKE_.js.map
|