@prisma-next/cli 0.10.0-dev.25 → 0.10.0-dev.27

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma-next/cli",
3
- "version": "0.10.0-dev.25",
3
+ "version": "0.10.0-dev.27",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -14,15 +14,15 @@
14
14
  "dependencies": {
15
15
  "@clack/prompts": "^1.3.0",
16
16
  "@dagrejs/dagre": "^3.0.0",
17
- "@prisma-next/config": "0.10.0-dev.25",
18
- "@prisma-next/contract": "0.10.0-dev.25",
19
- "@prisma-next/emitter": "0.10.0-dev.25",
20
- "@prisma-next/errors": "0.10.0-dev.25",
21
- "@prisma-next/framework-components": "0.10.0-dev.25",
22
- "@prisma-next/migration-tools": "0.10.0-dev.25",
23
- "@prisma-next/psl-printer": "0.10.0-dev.25",
24
- "@prisma-next/cli-telemetry": "0.10.0-dev.25",
25
- "@prisma-next/utils": "0.10.0-dev.25",
17
+ "@prisma-next/config": "0.10.0-dev.27",
18
+ "@prisma-next/contract": "0.10.0-dev.27",
19
+ "@prisma-next/emitter": "0.10.0-dev.27",
20
+ "@prisma-next/errors": "0.10.0-dev.27",
21
+ "@prisma-next/framework-components": "0.10.0-dev.27",
22
+ "@prisma-next/migration-tools": "0.10.0-dev.27",
23
+ "@prisma-next/psl-printer": "0.10.0-dev.27",
24
+ "@prisma-next/cli-telemetry": "0.10.0-dev.27",
25
+ "@prisma-next/utils": "0.10.0-dev.27",
26
26
  "arktype": "^2.2.0",
27
27
  "c12": "^3.3.4",
28
28
  "ci-info": "^4.3.1",
@@ -39,14 +39,14 @@
39
39
  "wrap-ansi": "^10.0.0"
40
40
  },
41
41
  "devDependencies": {
42
- "@prisma-next/sql-contract": "0.10.0-dev.25",
43
- "@prisma-next/sql-contract-emitter": "0.10.0-dev.25",
44
- "@prisma-next/sql-contract-ts": "0.10.0-dev.25",
45
- "@prisma-next/sql-operations": "0.10.0-dev.25",
46
- "@prisma-next/sql-runtime": "0.10.0-dev.25",
47
- "@prisma-next/test-utils": "0.10.0-dev.25",
48
- "@prisma-next/tsconfig": "0.10.0-dev.25",
49
- "@prisma-next/tsdown": "0.10.0-dev.25",
42
+ "@prisma-next/sql-contract": "0.10.0-dev.27",
43
+ "@prisma-next/sql-contract-emitter": "0.10.0-dev.27",
44
+ "@prisma-next/sql-contract-ts": "0.10.0-dev.27",
45
+ "@prisma-next/sql-operations": "0.10.0-dev.27",
46
+ "@prisma-next/sql-runtime": "0.10.0-dev.27",
47
+ "@prisma-next/test-utils": "0.10.0-dev.27",
48
+ "@prisma-next/tsconfig": "0.10.0-dev.27",
49
+ "@prisma-next/tsdown": "0.10.0-dev.27",
50
50
  "@types/node": "24.10.4",
51
51
  "tsdown": "0.22.0",
52
52
  "typescript": "5.9.3",
@@ -51,7 +51,6 @@ import { type ProbeOutcome, type ProbeOverrides, probeServerVersion } from './pr
51
51
  import { findStaleArtefacts, removeDependency } from './reinit-cleanup';
52
52
  import {
53
53
  DEFAULT_SKILL_SOURCES,
54
- formatClaudeSkillInstallCommand,
55
54
  formatSkillInstallCommand,
56
55
  LEGACY_SKILL_FILE,
57
56
  runProjectLevelSkillInstall,
@@ -485,10 +484,9 @@ export async function runInit(
485
484
  // `--no-install` therefore skips only dependency installation and
486
485
  // contract emission; `--no-skill` is the explicit escape hatch for
487
486
  // skipping skills.
488
- const manualProjectSkillCommands = DEFAULT_SKILL_SOURCES.flatMap((source) => [
489
- formatSkillInstallCommand(install.effectivePm, source),
490
- formatClaudeSkillInstallCommand(install.effectivePm, source),
491
- ]);
487
+ const manualProjectSkillCommands = DEFAULT_SKILL_SOURCES.map((source) =>
488
+ formatSkillInstallCommand({ pm: install.effectivePm, source }),
489
+ );
492
490
  const manualProjectSkillSummary = manualProjectSkillCommands.map((c) => `\`${c}\``).join(' && ');
493
491
  let skillRegistered = false;
494
492
  if (!inputs.installProjectSkill) {
@@ -15,8 +15,8 @@ export const DEFAULT_SKILL_BASE = 'prisma/prisma-next';
15
15
 
16
16
  /**
17
17
  * One discovery scope inside the Prisma Next monorepo. The CLI emits
18
- * one `skills add <base>/<subpath>[#ref] --all` invocation per source
19
- * during `init`.
18
+ * one `skills add <base>/<subpath>[#ref] --agent ... --skill '*' -y`
19
+ * invocation per source during `init`.
20
20
  *
21
21
  * `ref` semantics:
22
22
  * - `cli`: pin to the CLI's own package version (lockstep with the
@@ -73,6 +73,21 @@ function isLocalPath(base: string): boolean {
73
73
  return base.startsWith('/') || /^[a-zA-Z]:[\\/]/.test(base);
74
74
  }
75
75
 
76
+ /** Agent slugs accepted by the upstream `skills add --agent` flag. */
77
+ export type SkillAgent = 'cursor' | 'claude-code' | 'codex' | 'windsurf';
78
+
79
+ /**
80
+ * Agents passed to every project-level init install. Upstream `skills add`
81
+ * is the source of truth for per-agent install behaviour; the CLI lists
82
+ * every supported runtime on one invocation and delegates the rest.
83
+ */
84
+ export const DEFAULT_SKILL_AGENTS: readonly SkillAgent[] = [
85
+ 'cursor',
86
+ 'claude-code',
87
+ 'codex',
88
+ 'windsurf',
89
+ ];
90
+
76
91
  /**
77
92
  * Build the `<base>/<subpath>[#ref]` URL the `skills` CLI will
78
93
  * resolve. Exported for unit tests so the per-source format can be
@@ -94,37 +109,36 @@ export function formatSkillSourceUrl(source: SkillSource): string {
94
109
  * rest of the install step so a single project consistently uses one
95
110
  * runner.
96
111
  *
97
- * `--all` auto-selects every skill in the cluster and every detected
98
- * agent runtime, skipping the multi-select prompts the `skills` CLI
99
- * shows by default. A non-interactive scaffold step cannot present
100
- * prompts.
112
+ * `--agent` takes space-separated slugs on one flag; `--skill '*'` and `-y`
113
+ * skip the multi-select prompts a non-interactive scaffold step cannot show.
101
114
  *
102
115
  * Exported for unit tests so the per-PM dispatch can be asserted
103
116
  * without a live subprocess.
104
117
  */
105
- export function formatSkillInstallCommand(pm: PackageManager, source: SkillSource): string {
106
- const args = ['skills@latest', 'add', formatSkillSourceUrl(source), '--all'];
107
- return formatPackageManagerCommand(pm, args);
108
- }
109
-
110
- /**
111
- * `skills add --all` should cover Claude Code, but upstream currently skips
112
- * project-local Claude symlinks when `.claude/` does not already exist. Run
113
- * the explicit Claude Code install as well so fresh projects get
114
- * `.claude/skills` without asking users to create that folder first.
115
- */
116
- export function formatClaudeSkillInstallCommand(pm: PackageManager, source: SkillSource): string {
117
- const args = [
118
+ export function formatSkillInstallCommand(args: {
119
+ readonly pm: PackageManager;
120
+ readonly source: SkillSource;
121
+ readonly agents?: readonly SkillAgent[];
122
+ }): string {
123
+ const agents = args.agents ?? DEFAULT_SKILL_AGENTS;
124
+ const cliArgs = [
118
125
  'skills@latest',
119
126
  'add',
120
- formatSkillSourceUrl(source),
127
+ formatSkillSourceUrl(args.source),
121
128
  '--agent',
122
- 'claude-code',
129
+ ...agents,
123
130
  '--skill',
124
131
  "'*'",
125
132
  '-y',
126
133
  ];
127
- return formatPackageManagerCommand(pm, args);
134
+ return formatPackageManagerCommand(args.pm, cliArgs);
135
+ }
136
+
137
+ /**
138
+ * Ordered skill-install commands for one init run. Exported for unit tests.
139
+ */
140
+ export function resolveProjectSkillInstallCommands(pm: PackageManager): readonly string[] {
141
+ return DEFAULT_SKILL_SOURCES.map((source) => formatSkillInstallCommand({ pm, source }));
128
142
  }
129
143
 
130
144
  function formatPackageManagerCommand(pm: PackageManager, args: readonly string[]): string {
@@ -176,10 +190,7 @@ export async function runProjectLevelSkillInstall(ctx: {
176
190
  readonly filesWritten: readonly string[];
177
191
  }): Promise<{ readonly ok: true; readonly commands: readonly string[] }> {
178
192
  const commands: string[] = [];
179
- const installCommands = DEFAULT_SKILL_SOURCES.flatMap((source) => [
180
- formatSkillInstallCommand(ctx.pm, source),
181
- formatClaudeSkillInstallCommand(ctx.pm, source),
182
- ]);
193
+ const installCommands = resolveProjectSkillInstallCommands(ctx.pm);
183
194
 
184
195
  for (const command of installCommands) {
185
196
  const { file, args } = commandToExec(command);
@@ -65,11 +65,9 @@ model User {
65
65
  function schemaSampleTsPostgres(): string {
66
66
  return `\`\`\`typescript
67
67
  import { defineContract } from '@prisma-next/postgres/contract-builder';
68
- import sqlFamily from '@prisma-next/postgres/family';
69
- import postgresTarget from '@prisma-next/postgres/target';
70
68
 
71
69
  export const contract = defineContract(
72
- { family: sqlFamily, target: postgresTarget },
70
+ {},
73
71
  ({ field, model }) => ({
74
72
  models: {
75
73
  User: model('User', {
@@ -89,11 +87,9 @@ export const contract = defineContract(
89
87
  function schemaSampleTsMongo(): string {
90
88
  return `\`\`\`typescript
91
89
  import { defineContract } from '@prisma-next/mongo/contract-builder';
92
- import mongoFamily from '@prisma-next/mongo/family';
93
- import mongoTarget from '@prisma-next/mongo/target';
94
90
 
95
91
  export const contract = defineContract(
96
- { family: mongoFamily, target: mongoTarget },
92
+ {},
97
93
  ({ field, model }) => ({
98
94
  models: {
99
95
  User: model('User', {
@@ -161,11 +157,9 @@ model Post {
161
157
 
162
158
  function starterSchemaTsPostgres(): string {
163
159
  return `import { defineContract } from '@prisma-next/postgres/contract-builder';
164
- import sqlFamily from '@prisma-next/postgres/family';
165
- import postgresTarget from '@prisma-next/postgres/target';
166
160
 
167
161
  export const contract = defineContract(
168
- { family: sqlFamily, target: postgresTarget },
162
+ {},
169
163
  ({ field, model, rel }) => ({
170
164
  models: {
171
165
  User: model('User', {
@@ -203,11 +197,9 @@ export const contract = defineContract(
203
197
 
204
198
  function starterSchemaTsMongo(): string {
205
199
  return `import { defineContract } from '@prisma-next/mongo/contract-builder';
206
- import mongoFamily from '@prisma-next/mongo/family';
207
- import mongoTarget from '@prisma-next/mongo/target';
208
200
 
209
201
  export const contract = defineContract(
210
- { family: mongoFamily, target: mongoTarget },
202
+ {},
211
203
  ({ field, model, rel }) => ({
212
204
  models: {
213
205
  User: model('User', {