@rebasepro/cli 0.13.0 → 0.13.1-canary.gc77922a
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/commands/init.d.ts
CHANGED
|
@@ -68,4 +68,26 @@ export declare function formatCdTarget(cwd: string, targetDirectory: string): st
|
|
|
68
68
|
* triggering the non-TTY error. */
|
|
69
69
|
export declare function printInitHelp(): void;
|
|
70
70
|
export declare function createRebaseApp(rawArgs: string[]): Promise<void>;
|
|
71
|
+
/**
|
|
72
|
+
* The runtime image tag to pin, given the version of the CLI doing the scaffolding.
|
|
73
|
+
*
|
|
74
|
+
* Only a stable release publishes `rebasepro/server` — a multi-arch build on
|
|
75
|
+
* every push to main would cost minutes per commit for an image nobody pulls.
|
|
76
|
+
* So pinning a prerelease CLI's own version writes a tag that cannot exist, and
|
|
77
|
+
* `docker compose up` fails on `manifest unknown`, which is the same dead end
|
|
78
|
+
* as the missing-repository bug this pinning was added to prevent.
|
|
79
|
+
*
|
|
80
|
+
* A prerelease therefore falls back to `latest`, which is correct rather than
|
|
81
|
+
* merely available: a bundle's manifest declares the runtime range it needs
|
|
82
|
+
* (`^1`), the image supplies only `@rebasepro/server`, and the framework a
|
|
83
|
+
* bundle runs is installed from its own `deps.declared` at boot. The current
|
|
84
|
+
* stable runtime boots a canary bundle by design.
|
|
85
|
+
*
|
|
86
|
+
* A floating tag is a real cost — it is what pinning exists to avoid — so say
|
|
87
|
+
* so in the file rather than leaving a reader to discover it.
|
|
88
|
+
*/
|
|
89
|
+
export declare function resolveRuntimeImageTag(cliVersion: string): {
|
|
90
|
+
tag: string;
|
|
91
|
+
note?: string;
|
|
92
|
+
};
|
|
71
93
|
export declare function configureEnvFile(targetDirectory: string, databaseUrl?: string): Promise<void>;
|
package/dist/index.es.js
CHANGED
|
@@ -1789,7 +1789,7 @@ async function createProject$1(options) {
|
|
|
1789
1789
|
console.log(` ${chalk.cyan(runDev.join(" "))}`);
|
|
1790
1790
|
}
|
|
1791
1791
|
console.log("");
|
|
1792
|
-
console.log(isBaas ? chalk.gray("This starts a headless API (Hono + PostgreSQL). There are no collection files: ") + chalk.gray("the API is derived from your database schema. Once it serves a table, docs are at /api/swagger.") : chalk.gray("This starts both the backend (Hono + PostgreSQL)") + chalk.gray(" and the frontend (Vite + React) concurrently."));
|
|
1792
|
+
console.log(isBaas ? introspected ? chalk.gray("This starts a headless API (Hono + PostgreSQL) over the collections just ") + chalk.gray("generated from your database in config/collections. Edit them to change what the ") + chalk.gray("API exposes; docs are at /api/swagger.") : chalk.gray("This starts a headless API (Hono + PostgreSQL). There are no collection files: ") + chalk.gray("the API is derived from your database schema. Once it serves a table, docs are at /api/swagger.") : chalk.gray("This starts both the backend (Hono + PostgreSQL)") + chalk.gray(" and the frontend (Vite + React) concurrently."));
|
|
1793
1793
|
console.log("");
|
|
1794
1794
|
console.log(chalk.gray("Docs: https://rebase.pro/docs"));
|
|
1795
1795
|
console.log(chalk.gray("GitHub: https://github.com/rebasepro/rebase"));
|
|
@@ -2013,6 +2013,32 @@ function readCliVersion() {
|
|
|
2013
2013
|
} catch {}
|
|
2014
2014
|
return "latest";
|
|
2015
2015
|
}
|
|
2016
|
+
/**
|
|
2017
|
+
* The runtime image tag to pin, given the version of the CLI doing the scaffolding.
|
|
2018
|
+
*
|
|
2019
|
+
* Only a stable release publishes `rebasepro/server` — a multi-arch build on
|
|
2020
|
+
* every push to main would cost minutes per commit for an image nobody pulls.
|
|
2021
|
+
* So pinning a prerelease CLI's own version writes a tag that cannot exist, and
|
|
2022
|
+
* `docker compose up` fails on `manifest unknown`, which is the same dead end
|
|
2023
|
+
* as the missing-repository bug this pinning was added to prevent.
|
|
2024
|
+
*
|
|
2025
|
+
* A prerelease therefore falls back to `latest`, which is correct rather than
|
|
2026
|
+
* merely available: a bundle's manifest declares the runtime range it needs
|
|
2027
|
+
* (`^1`), the image supplies only `@rebasepro/server`, and the framework a
|
|
2028
|
+
* bundle runs is installed from its own `deps.declared` at boot. The current
|
|
2029
|
+
* stable runtime boots a canary bundle by design.
|
|
2030
|
+
*
|
|
2031
|
+
* A floating tag is a real cost — it is what pinning exists to avoid — so say
|
|
2032
|
+
* so in the file rather than leaving a reader to discover it.
|
|
2033
|
+
*/
|
|
2034
|
+
function resolveRuntimeImageTag(cliVersion) {
|
|
2035
|
+
if (/^\d+\.\d+\.\d+-/.test(cliVersion)) return {
|
|
2036
|
+
tag: "latest",
|
|
2037
|
+
note: `# Scaffolded by a prerelease CLI (${cliVersion}), which publishes no runtime image,\n# so this floats to the newest stable runtime. Pin an exact version once you
|
|
2038
|
+
# deploy: a moving tag changes what you are running with no version changing.`
|
|
2039
|
+
};
|
|
2040
|
+
return { tag: cliVersion };
|
|
2041
|
+
}
|
|
2016
2042
|
async function configureEnvFile(targetDirectory, databaseUrl) {
|
|
2017
2043
|
const envExamplePath = path.join(targetDirectory, ".env.example");
|
|
2018
2044
|
const envPath = path.join(targetDirectory, ".env");
|
|
@@ -2031,8 +2057,9 @@ async function configureEnvFile(targetDirectory, databaseUrl) {
|
|
|
2031
2057
|
envContent = envContent.replace(/^#\s*REBASE_SERVICE_KEY=.*$/m, `REBASE_SERVICE_KEY=${serviceKey}`);
|
|
2032
2058
|
const composeApiPort = /^PORT=(\d+)/m.exec(envContent)?.[1] ?? "3001";
|
|
2033
2059
|
envContent = envContent.replace(/^#\s*CORS_ORIGINS=.*$/m, `CORS_ORIGINS=http://localhost:${composeApiPort}`);
|
|
2034
|
-
const runtimeVersion = readCliVersion();
|
|
2035
|
-
|
|
2060
|
+
const { tag: runtimeVersion, note } = resolveRuntimeImageTag(readCliVersion());
|
|
2061
|
+
const pinned = `${note ? `${note}\n` : ""}REBASE_VERSION=${runtimeVersion}`;
|
|
2062
|
+
envContent = /^#?\s*REBASE_VERSION=.*$/m.test(envContent) ? envContent.replace(/^#?\s*REBASE_VERSION=.*$/m, pinned) : `${envContent.trimEnd()}\n\n# The Rebase runtime image tag docker-compose.yml pulls.\n# Change this and restart to upgrade; your project bundle is untouched.\n${pinned}\n`;
|
|
2036
2063
|
if (databaseUrl) {
|
|
2037
2064
|
if (/[\r\n]/.test(databaseUrl)) throw new Error("Invalid DATABASE_URL: multiline values are not allowed.");
|
|
2038
2065
|
const { pinSearchPath } = await import("@rebasepro/server-postgres");
|
|
@@ -3345,6 +3372,20 @@ async function devCommand(rawArgs) {
|
|
|
3345
3372
|
} catch {}
|
|
3346
3373
|
/** Whether the frontend has been launched (we only launch it once). */
|
|
3347
3374
|
let frontendLaunched = false;
|
|
3375
|
+
try {
|
|
3376
|
+
const activePlugin = getActiveBackendPlugin(backendDir);
|
|
3377
|
+
const pluginCli = activePlugin ? resolvePluginCliScript(backendDir, activePlugin) : null;
|
|
3378
|
+
if (pluginCli) await execa(tsxBin, [
|
|
3379
|
+
pluginCli,
|
|
3380
|
+
"schema",
|
|
3381
|
+
"stale",
|
|
3382
|
+
"--fix"
|
|
3383
|
+
], {
|
|
3384
|
+
cwd: backendDir,
|
|
3385
|
+
stdio: "inherit",
|
|
3386
|
+
env
|
|
3387
|
+
});
|
|
3388
|
+
} catch {}
|
|
3348
3389
|
if (shouldGenerate) {
|
|
3349
3390
|
console.log(chalk.gray(" → Ensuring schema and SDK are generated on start..."));
|
|
3350
3391
|
try {
|
|
@@ -5663,7 +5704,8 @@ async function skillsCommand(subcommand, rawArgs) {
|
|
|
5663
5704
|
}
|
|
5664
5705
|
/**
|
|
5665
5706
|
* Agents named explicitly on the command line, e.g. `--agent claude --agent cursor`
|
|
5666
|
-
* (also accepts a comma-separated list). Returns null when none were
|
|
5707
|
+
* (also accepts a comma-separated list, and `all`). Returns null when none were
|
|
5708
|
+
* given.
|
|
5667
5709
|
*/
|
|
5668
5710
|
function parseAgentFlags(rawArgs) {
|
|
5669
5711
|
const requested = [];
|
|
@@ -5673,6 +5715,7 @@ function parseAgentFlags(rawArgs) {
|
|
|
5673
5715
|
if (value && !value.startsWith("-")) requested.push(...value.split(",").map((v) => v.trim()).filter(Boolean));
|
|
5674
5716
|
}
|
|
5675
5717
|
if (requested.length === 0) return null;
|
|
5718
|
+
if (requested.includes("all")) return Object.keys(AGENTS);
|
|
5676
5719
|
const valid = Object.keys(AGENTS);
|
|
5677
5720
|
const unknown = requested.filter((a) => !valid.includes(a));
|
|
5678
5721
|
if (unknown.length > 0) {
|
|
@@ -5700,6 +5743,7 @@ async function skillsInstall(rawArgs = []) {
|
|
|
5700
5743
|
if (!process.stdin.isTTY) {
|
|
5701
5744
|
console.error(chalk.red("Cannot prompt: this is a non-interactive terminal (no TTY)."));
|
|
5702
5745
|
console.error(chalk.yellow(` Name the agents explicitly, e.g. rebase skills install --agent ${Object.keys(AGENTS)[0]}`));
|
|
5746
|
+
console.error(chalk.yellow(" Or install for every supported agent: rebase skills install --agent all"));
|
|
5703
5747
|
console.error(chalk.gray(` Available: ${Object.keys(AGENTS).join(", ")}`));
|
|
5704
5748
|
process.exit(1);
|
|
5705
5749
|
}
|
|
@@ -5747,13 +5791,16 @@ ${chalk.green.bold("Subcommands")}
|
|
|
5747
5791
|
|
|
5748
5792
|
${chalk.green.bold("Options")}
|
|
5749
5793
|
${chalk.blue("--agent, -a")} Agent(s) to install for, skipping detection and the prompt.
|
|
5750
|
-
Repeat the flag or pass a comma-separated list.
|
|
5751
|
-
|
|
5794
|
+
Repeat the flag or pass a comma-separated list, or ${chalk.bold("all")}.
|
|
5795
|
+
Required without a TTY: a scaffolded project carries a marker
|
|
5796
|
+
file for every agent, so detection cannot pick one for you.
|
|
5797
|
+
Available: ${Object.keys(AGENTS).join(", ")}, all
|
|
5752
5798
|
|
|
5753
5799
|
${chalk.green.bold("Examples")}
|
|
5754
5800
|
${chalk.cyan("rebase skills install")}
|
|
5755
5801
|
${chalk.cyan("rebase skills install --agent claude")}
|
|
5756
5802
|
${chalk.cyan("rebase skills install --agent claude,cursor")}
|
|
5803
|
+
${chalk.cyan("rebase skills install --agent all")} ${chalk.gray("# scripted / CI")}
|
|
5757
5804
|
`);
|
|
5758
5805
|
}
|
|
5759
5806
|
//#endregion
|
|
@@ -10893,6 +10940,6 @@ function telemetryNotice() {
|
|
|
10893
10940
|
return chalk.gray(`Usage sharing: ${sharing ? "on" : "off"} — ${chalk.cyan("rebase telemetry")} to inspect or change\n`);
|
|
10894
10941
|
}
|
|
10895
10942
|
//#endregion
|
|
10896
|
-
export { CURRENT_RUNTIME_RANGE, DEFAULT_BUNDLE_DIR, DEFAULT_CONFIG_DIR, DEFAULT_CRONS_DIR, DEFAULT_FUNCTIONS_DIR, DEFAULT_SCHEMA_FILE, DEV_PORT_FILENAME, MANIFEST_FILENAME, ManifestError, TEMPLATE_PLACEHOLDER_FILES, appsCommand, assessManagedCompatibility, authCommand, buildBundle, buildCommand, buildInitQuestions, buildStaticBundle, buildableApps, cloudCommand, collectDeclaredDependencies, configureEnvFile, createRebaseApp, dbCommand, detectFrameworkDepDrift, detectNativeDependencies, detectPackageManager, detectStorageAuthorize, devCommand, doctorCommand, ejectCommand, entry, findBackendApp, findBackendDir, findEnvFile, findFrontendDir, findProjectRoot, findUnusedServerEntry, foldStaticIntoBundle, formatCdTarget, generateSdkCommand, getActiveBackendPlugin, getPMCommands, getProjectPort, isIdentifierLike, isPnpmAvailable, loadManifest, manifestExists, manifestPath, normalizeEsmSpecifiers, pnpmAvailabilityFromProbe, positionals, printInitHelp, requireBackendDir, requireProjectRoot, resetPnpmAvailabilityCache, resolveBackendPaths, resolveCliVersion, resolveExampleBaseUrl, resolveLocalBin, resolvePluginCliScript, resolveStartPort, resolveTsx, schemaCommand, startCommand, synthesizeManifest, validateManifest, validateProjectName, validateTsxInstallation, writeManifest };
|
|
10943
|
+
export { CURRENT_RUNTIME_RANGE, DEFAULT_BUNDLE_DIR, DEFAULT_CONFIG_DIR, DEFAULT_CRONS_DIR, DEFAULT_FUNCTIONS_DIR, DEFAULT_SCHEMA_FILE, DEV_PORT_FILENAME, MANIFEST_FILENAME, ManifestError, TEMPLATE_PLACEHOLDER_FILES, appsCommand, assessManagedCompatibility, authCommand, buildBundle, buildCommand, buildInitQuestions, buildStaticBundle, buildableApps, cloudCommand, collectDeclaredDependencies, configureEnvFile, createRebaseApp, dbCommand, detectFrameworkDepDrift, detectNativeDependencies, detectPackageManager, detectStorageAuthorize, devCommand, doctorCommand, ejectCommand, entry, findBackendApp, findBackendDir, findEnvFile, findFrontendDir, findProjectRoot, findUnusedServerEntry, foldStaticIntoBundle, formatCdTarget, generateSdkCommand, getActiveBackendPlugin, getPMCommands, getProjectPort, isIdentifierLike, isPnpmAvailable, loadManifest, manifestExists, manifestPath, normalizeEsmSpecifiers, pnpmAvailabilityFromProbe, positionals, printInitHelp, requireBackendDir, requireProjectRoot, resetPnpmAvailabilityCache, resolveBackendPaths, resolveCliVersion, resolveExampleBaseUrl, resolveLocalBin, resolvePluginCliScript, resolveRuntimeImageTag, resolveStartPort, resolveTsx, schemaCommand, startCommand, synthesizeManifest, validateManifest, validateProjectName, validateTsxInstallation, writeManifest };
|
|
10897
10944
|
|
|
10898
10945
|
//# sourceMappingURL=index.es.js.map
|