@prisma/cli 8.0.0-rc.15-dev.106 → 8.0.0-rc.15-dev.108
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 +50 -12
- package/package.json +7 -7
package/dist/cli.js
CHANGED
|
@@ -5339,6 +5339,13 @@ function installWaitFailedError(repository, installUrl, inspectableInstallationC
|
|
|
5339
5339
|
//#endregion
|
|
5340
5340
|
//#region src/commands/git/connect.ts
|
|
5341
5341
|
/** The `git connect` command. */
|
|
5342
|
+
/** Where the deploy workflow's inputs and the minimal file are documented. */
|
|
5343
|
+
const WORKFLOW_DOCS_URL = "https://github.com/prisma/cloud-deploy-action#readme";
|
|
5344
|
+
/** The platform never builds on push; the repository's own Actions workflow
|
|
5345
|
+
* does, so a connection without one deploys nothing. Console import writes
|
|
5346
|
+
* the file through a setup pull request; this command does not. */
|
|
5347
|
+
const WORKFLOW_DETAIL = "Deploys run from the repository's GitHub Actions workflow (prisma/cloud-deploy-action), which must exist on each pushed branch; the platform does not build on push.";
|
|
5348
|
+
const WORKFLOW_NEXT_STEP = "If the repository has no .github/workflows/prisma-deploy.yml yet, add one running prisma/cloud-deploy-action@v1 with `id-token: write`; a push of any branch that lacks the file deploys nothing.";
|
|
5342
5349
|
/** The legacy wait line, printed once before the poll loop. */
|
|
5343
5350
|
const WAIT_MESSAGE = "Waiting for GitHub App installation or repository access approval...";
|
|
5344
5351
|
/**
|
|
@@ -5375,12 +5382,21 @@ async function resolveInstalledRepository(ctx, api, workspaceId, repository) {
|
|
|
5375
5382
|
if (match === null) throw installWaitFailedError(repository, installUrl, inspectableInstallationCount);
|
|
5376
5383
|
return match;
|
|
5377
5384
|
}
|
|
5385
|
+
/** The connect result in every mode: the connection card, plus the
|
|
5386
|
+
* workflow step the platform will not do for you. */
|
|
5378
5387
|
function connectPresentations(result) {
|
|
5379
5388
|
const connection = result.repositoryConnection;
|
|
5380
5389
|
return {
|
|
5381
5390
|
stdout: () => [],
|
|
5382
5391
|
json: () => result,
|
|
5383
|
-
next: () => [
|
|
5392
|
+
next: () => [{
|
|
5393
|
+
kind: "edit-file",
|
|
5394
|
+
label: WORKFLOW_NEXT_STEP
|
|
5395
|
+
}, {
|
|
5396
|
+
kind: "open-url",
|
|
5397
|
+
label: "Workflow reference (prisma/cloud-deploy-action)",
|
|
5398
|
+
url: WORKFLOW_DOCS_URL
|
|
5399
|
+
}],
|
|
5384
5400
|
human: () => [
|
|
5385
5401
|
{
|
|
5386
5402
|
kind: "summary",
|
|
@@ -5410,7 +5426,7 @@ function connectPresentations(result) {
|
|
|
5410
5426
|
},
|
|
5411
5427
|
{
|
|
5412
5428
|
kind: "list",
|
|
5413
|
-
items: [formatGitConnectionDetail(connection.status)]
|
|
5429
|
+
items: [formatGitConnectionDetail(connection.status), WORKFLOW_DETAIL]
|
|
5414
5430
|
}
|
|
5415
5431
|
]
|
|
5416
5432
|
};
|
|
@@ -5424,8 +5440,8 @@ const gitConnectCommand = defineCommand({
|
|
|
5424
5440
|
flags: { project: projectFlag$2 }
|
|
5425
5441
|
},
|
|
5426
5442
|
help: {
|
|
5427
|
-
summary: "Connect a project to a GitHub repository so every push
|
|
5428
|
-
description: "
|
|
5443
|
+
summary: "Connect a project to a GitHub repository so its deploy workflow deploys every push",
|
|
5444
|
+
description: "Links the repository to the project. Once connected, the repository's prisma/cloud-deploy-action workflow authenticates each run through GitHub's OIDC token and deploys every pushed branch to a matching Platform Branch, an isolated environment with its own services, databases, and buckets. The platform does not build on push itself: a repository without the workflow must add .github/workflows/prisma-deploy.yml (importing in the Console opens a pull request that adds it). If the Prisma GitHub App does not cover the repository yet, the command opens the install page and waits. Run without a URL to use this repository's origin remote.",
|
|
5429
5445
|
examples: [
|
|
5430
5446
|
"git connect",
|
|
5431
5447
|
"git connect git@github.com:prisma/prisma-cli.git",
|
|
@@ -13086,7 +13102,7 @@ const cliGroups = {
|
|
|
13086
13102
|
},
|
|
13087
13103
|
{
|
|
13088
13104
|
run: "git connect",
|
|
13089
|
-
brief: "Connect GitHub
|
|
13105
|
+
brief: "Connect GitHub; branches carrying the deploy workflow deploy on push"
|
|
13090
13106
|
},
|
|
13091
13107
|
{
|
|
13092
13108
|
run: "project env add KEY=value --role preview",
|
|
@@ -13144,8 +13160,8 @@ const cliGroups = {
|
|
|
13144
13160
|
description: "A Branch maps to a Git branch of the connected repository. Each is an isolated environment with its own services, databases, buckets, and environment variables: the production branch serves live traffic, every other branch is a preview."
|
|
13145
13161
|
},
|
|
13146
13162
|
git: {
|
|
13147
|
-
brief: "Manage the GitHub connection
|
|
13148
|
-
description: "Connecting a GitHub repository turns on deploy-on-push:
|
|
13163
|
+
brief: "Manage the GitHub connection behind deploy-on-push. Connect or disconnect a repository",
|
|
13164
|
+
description: "Connecting a GitHub repository turns on deploy-on-push: the repository's prisma/cloud-deploy-action workflow authenticates through the connection and deploys every pushed branch to a matching Platform Branch. The platform does not build on push; the workflow does. Disconnecting stops push deploys without touching anything already deployed."
|
|
13149
13165
|
},
|
|
13150
13166
|
service: {
|
|
13151
13167
|
brief: "Manage deployed services. Logs, versions, promote and rollback releases, custom domains",
|
|
@@ -13326,7 +13342,7 @@ function buildCli() {
|
|
|
13326
13342
|
},
|
|
13327
13343
|
{
|
|
13328
13344
|
run: "git connect",
|
|
13329
|
-
brief: "Connect GitHub
|
|
13345
|
+
brief: "Connect GitHub; branches carrying the deploy workflow deploy on push"
|
|
13330
13346
|
},
|
|
13331
13347
|
{
|
|
13332
13348
|
run: "deploy",
|
|
@@ -14536,7 +14552,13 @@ async function maybeWriteSkillsStaleNotice(runtime) {
|
|
|
14536
14552
|
if (config !== null && !config.check) return;
|
|
14537
14553
|
const agents = config?.agents ?? DEFAULT_AGENTS;
|
|
14538
14554
|
if (agents.length === 0) return;
|
|
14539
|
-
const
|
|
14555
|
+
const dirs = agentSkillDirs(agents);
|
|
14556
|
+
if (isFormat(flagTokens(runtime.argv), "markdown")) {
|
|
14557
|
+
const notice = renderStaleNoticeMarkdown(status, dirs);
|
|
14558
|
+
if (notice !== null) runtime.stdout.write(notice);
|
|
14559
|
+
return;
|
|
14560
|
+
}
|
|
14561
|
+
const notice = renderStaleNotice(status, dirs);
|
|
14540
14562
|
if (notice !== null) runtime.stderr.write(notice);
|
|
14541
14563
|
} catch {
|
|
14542
14564
|
return;
|
|
@@ -14547,11 +14569,23 @@ async function maybeWriteSkillsStaleNotice(runtime) {
|
|
|
14547
14569
|
function firstOutdatedSkillIn(status, dirs) {
|
|
14548
14570
|
return status.skills.find((skill) => skill.targets.some((target) => dirs.includes(target.dir) && (target.state === "stale" || target.state === "absent"))) ?? null;
|
|
14549
14571
|
}
|
|
14550
|
-
|
|
14572
|
+
/** The mismatch in words, without the stream's framing around it. */
|
|
14573
|
+
function staleNoticeSentence(status, dirs) {
|
|
14551
14574
|
const outdated = firstOutdatedSkillIn(status, dirs);
|
|
14552
14575
|
if (outdated === null) return null;
|
|
14553
14576
|
const synced = outdated.targets.find((target) => dirs.includes(target.dir) && target.state === "stale")?.syncedVersion;
|
|
14554
|
-
return `Prisma agent skills are out of date (installed ${outdated.library} ${outdated.version}, synced ${synced ?? "none"})
|
|
14577
|
+
return `Prisma agent skills are out of date (installed ${outdated.library} ${outdated.version}, synced ${synced ?? "none"})`;
|
|
14578
|
+
}
|
|
14579
|
+
function renderStaleNotice(status, dirs) {
|
|
14580
|
+
const sentence = staleNoticeSentence(status, dirs);
|
|
14581
|
+
return sentence === null ? null : `${sentence}. Run: ${getCliName()} skills sync\n`;
|
|
14582
|
+
}
|
|
14583
|
+
/** The same notice as a trailing section of the Markdown document, in
|
|
14584
|
+
* the heading-then-bullet shape the engine renders `### Diagnostics`
|
|
14585
|
+
* in. The leading blank line separates it from the command's output. */
|
|
14586
|
+
function renderStaleNoticeMarkdown(status, dirs) {
|
|
14587
|
+
const sentence = staleNoticeSentence(status, dirs);
|
|
14588
|
+
return sentence === null ? null : `\n### Notice\n${sentence}.\n- Sync agent skills: \`${getCliName()} skills sync\`\n`;
|
|
14555
14589
|
}
|
|
14556
14590
|
/** The shared flags that take a separate value, so the word after them
|
|
14557
14591
|
* is that value rather than the command being invoked. */
|
|
@@ -14586,7 +14620,10 @@ function isSuppressedByInvocation(runtime) {
|
|
|
14586
14620
|
if (group === "skills" || group === "init") return true;
|
|
14587
14621
|
if (argv.includes("--json") || argv.includes("--quiet") || argv.includes("-q")) return true;
|
|
14588
14622
|
if (argv.includes("--version")) return true;
|
|
14589
|
-
return argv
|
|
14623
|
+
return isFormat(argv, "json");
|
|
14624
|
+
}
|
|
14625
|
+
function isFormat(tokens, format) {
|
|
14626
|
+
return tokens.some((token, index) => token === `--format=${format}` || token === "--format" && tokens[index + 1] === format);
|
|
14590
14627
|
}
|
|
14591
14628
|
/** The file an explicit --config names, so the check reads the same
|
|
14592
14629
|
* config the command did. Discovery is otherwise cwd-only. */
|
|
@@ -14819,6 +14856,7 @@ async function main(proc, buildCliForRun = buildCli) {
|
|
|
14819
14856
|
env: proc.env,
|
|
14820
14857
|
argv: proc.argv.slice(2),
|
|
14821
14858
|
cwd: proc.cwd(),
|
|
14859
|
+
stdout: proc.stdout,
|
|
14822
14860
|
stderr: proc.stderr
|
|
14823
14861
|
});
|
|
14824
14862
|
return exitCode;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/cli",
|
|
3
|
-
"version": "8.0.0-rc.15-dev.
|
|
3
|
+
"version": "8.0.0-rc.15-dev.108",
|
|
4
4
|
"description": "Command-line interface for the Prisma Developer Platform.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -41,10 +41,10 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@manypkg/tools": "^2.1.2",
|
|
43
43
|
"@prisma/cli-engine": "0.4.0",
|
|
44
|
-
"@prisma/composer-cli": "0.20.0-dev.
|
|
44
|
+
"@prisma/composer-cli": "0.20.0-dev.5",
|
|
45
45
|
"@prisma/compute-sdk": "0.42.0",
|
|
46
46
|
"@prisma/management-api-sdk": "1.69.0",
|
|
47
|
-
"@prisma/orm-toolchain": "8.0.0-rc.11-dev.
|
|
47
|
+
"@prisma/orm-toolchain": "8.0.0-rc.11-dev.16",
|
|
48
48
|
"@vercel/detect-agent": "^1.2.3",
|
|
49
49
|
"better-result": "^2.9.2",
|
|
50
50
|
"cross-spawn": "^7.0.6",
|
|
@@ -53,11 +53,11 @@
|
|
|
53
53
|
"open": "^11.0.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@prisma/composer": "0.20.0-dev.
|
|
56
|
+
"@prisma/composer": "0.20.0-dev.5",
|
|
57
57
|
"@prisma/credentials-store": "^7.8.0",
|
|
58
|
-
"@repo/cli-conformance": "8.0.0-rc.15-dev.
|
|
59
|
-
"@repo/cli-telemetry": "8.0.0-rc.15-dev.
|
|
60
|
-
"@repo/tsconfig": "8.0.0-rc.15-dev.
|
|
58
|
+
"@repo/cli-conformance": "8.0.0-rc.15-dev.108",
|
|
59
|
+
"@repo/cli-telemetry": "8.0.0-rc.15-dev.108",
|
|
60
|
+
"@repo/tsconfig": "8.0.0-rc.15-dev.108",
|
|
61
61
|
"@types/node": "^22.19.19",
|
|
62
62
|
"@types/cross-spawn": "^6.0.6",
|
|
63
63
|
"tsdown": "^0.21.10",
|