Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
f68d5d9
enabled Biome and format
rtbenfield Jun 12, 2026
c2f76e8
biome recommended settings
rtbenfield Jun 12, 2026
9f8dc0c
enable cognitive complexity lint rule
rtbenfield Jun 12, 2026
94b1548
enable no foreach lint rule
rtbenfield Jun 12, 2026
d814e48
enable no implicit coercions lint rule
rtbenfield Jun 12, 2026
36d2ff5
enable no conditional expect lint rule
rtbenfield Jun 12, 2026
b84856b
enable no floating promises lint rule
rtbenfield Jun 12, 2026
7e202bf
enable no for in lint rule
rtbenfield Jun 12, 2026
2100fd5
enable no loop func lint rule
rtbenfield Jun 12, 2026
48f0d4c
enable disposable lint rule
rtbenfield Jun 12, 2026
ae87e2b
enable no await in loops lint rule
rtbenfield Jun 12, 2026
8369f4c
enable no barrel file lint rule
rtbenfield Jun 12, 2026
0be7bb9
enable top level regex lint rule
rtbenfield Jun 12, 2026
5a61a24
enable collapsed else if lint rule
rtbenfield Jun 12, 2026
63f3c08
enable collapsed if lint rule
rtbenfield Jun 12, 2026
47516a7
enable no nested ternary lint rule
rtbenfield Jun 12, 2026
5df9efb
enable no parameter assign lint rule
rtbenfield Jun 12, 2026
621b41f
enable no var lint rule
rtbenfield Jun 12, 2026
2d7f3c9
enable guarded for in lint rule
rtbenfield Jun 12, 2026
0eec80d
enable static response methods lint rule
rtbenfield Jun 12, 2026
d6dac32
remove empty biome rule comments
rtbenfield Jun 12, 2026
aa69bbb
fix mask value regex backtracking
rtbenfield Jun 12, 2026
5a35625
fix constructable test mocks
rtbenfield Jun 12, 2026
53f61af
Add PR quality workflow
rtbenfield Jun 12, 2026
2bd3a59
Set Node 22.12.0 as minimum version
rtbenfield Jun 12, 2026
91c4f3f
address biome review feedback
rtbenfield Jun 12, 2026
4c12f7e
trigger ci
rtbenfield Jun 12, 2026
efea28e
fix ci typecheck
rtbenfield Jun 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# GitHub Workflows

- Pin all GitHub Actions to their commit SHA, not a tag. Append the tag as a comment for readability (e.g., `uses: actions/checkout@abc123... # v4.3.2`).
81 changes: 81 additions & 0 deletions .github/workflows/pr-quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: PR Quality

# This workflow owns required PR status checks. Add only jobs that should block
# merging when they fail.

on:
pull_request:

concurrency:
group: pr-quality-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
typecheck:
name: Type Check
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
Comment thread
coderabbitai[bot] marked this conversation as resolved.
with:
persist-credentials: false

- name: Set up pnpm
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8

- name: Set up Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: .node-version
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Type check
run: pnpm --recursive exec tsc --noEmit

lint:
name: Lint
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false

- name: Set up Biome
uses: biomejs/setup-biome@4c91541eaada48f67d7dbd7833600ce162b68f51 # v2.7.1

- name: Lint
run: biome ci .

test:
name: Test
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false

- name: Set up pnpm
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8

- name: Set up Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: .node-version
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Test
run: pnpm --recursive test
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22.12.0
63 changes: 63 additions & 0 deletions biome.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"$schema": "https://biomejs.dev/schemas/2.4.16/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"files": {
"ignoreUnknown": false
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"complexity": {
"noExcessiveCognitiveComplexity": "on",
"noForEach": "on",
"noImplicitCoercions": "on"
},
"nursery": {
"noConditionalExpect": "on",
"noFloatingPromises": "on",
"noForIn": "on",
"noLoopFunc": "on",
"useDisposables": "on"
},
"performance": {
"noAwaitInLoops": "on",
"noBarrelFile": "on",
"useTopLevelRegex": "on"
},
"style": {
"useCollapsedElseIf": "on",
"useCollapsedIf": "on",
"noNestedTernary": "on",
"noParameterAssign": "on"
},
"suspicious": {
"noVar": "on",
"useGuardForIn": "on",
"useStaticResponseMethods": "on"
}
}
},
"javascript": {
"formatter": {
"quoteStyle": "double"
}
},
"assist": {
"enabled": true,
"actions": {
"source": {
"organizeImports": "on"
}
}
}
}
27 changes: 13 additions & 14 deletions examples/next-smoke/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,27 @@ body {

body {
background:
radial-gradient(circle at top left, rgba(42, 125, 99, 0.18), transparent 28rem),
radial-gradient(circle at bottom right, rgba(197, 123, 74, 0.16), transparent 30rem),
radial-gradient(
circle at top left,
rgba(42, 125, 99, 0.18),
transparent 28rem
),
radial-gradient(
circle at bottom right,
rgba(197, 123, 74, 0.16),
transparent 30rem
),
var(--bg);
color: var(--text);
font-family:
"Iowan Old Style",
"Palatino Linotype",
"Book Antiqua",
Palatino,
Georgia,
"Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia,
serif;
}

code {
font-family:
"SFMono-Regular",
ui-monospace,
"Cascadia Mono",
"Segoe UI Mono",
Menlo,
Consolas,
monospace;
SFMono-Regular, ui-monospace, "Cascadia Mono", "Segoe UI Mono", Menlo,
Consolas, monospace;
background: rgba(42, 44, 39, 0.06);
border-radius: 0.5rem;
padding: 0.12rem 0.4rem;
Expand Down
3 changes: 2 additions & 1 deletion examples/next-smoke/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ export default function Home() {
<p className="eyebrow">Prisma CLI</p>
<h1>Next.js smoke app</h1>
<p className="lede">
This app exists to manually test the local source Prisma CLI from inside this repository.
This app exists to manually test the local source Prisma CLI from
inside this repository.
</p>
<ol className="steps">
<li>
Expand Down
10 changes: 2 additions & 8 deletions examples/next-smoke/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{
"compilerOptions": {
"target": "ES2017",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
Expand All @@ -30,7 +26,5 @@
".next/types/**/*.ts",
".next/dev/types/**/*.ts"
],
"exclude": [
"node_modules"
]
"exclude": ["node_modules"]
}
7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
{
"name": "prisma-cli",
"private": true,
"engines": {
"node": ">=22.12.0"
},
"packageManager": "pnpm@10.30.0",
"scripts": {
"build:cli": "pnpm --filter @prisma/cli build",
"build:compute": "pnpm --filter @prisma/compute build",
"format": "biome format . --write",
"lint": "biome check .",
"lint:fix": "biome check . --write",
"lint:skills": "node scripts/validate-skills.mjs",
"prepare": "skills add ./skills --skill '*' --agent universal claude-code -y",
"prepare:cli-publish": "node scripts/prepare-cli-publish.mjs",
Expand All @@ -15,6 +21,7 @@
"prisma": "tsx packages/cli/src/bin.ts"
},
"devDependencies": {
"@biomejs/biome": "2.4.16",
"gray-matter": "^4.0.3",
"pkg-pr-new": "^0.0.75",
"skills": "^1.5.9",
Expand Down
39 changes: 29 additions & 10 deletions packages/cli/src/adapters/git.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// biome-ignore-all lint/performance/useTopLevelRegex: Existing git URL parsing regexes are kept inline for readability.
import { execFile } from "node:child_process";
import { promisify } from "node:util";

Expand All @@ -11,13 +12,20 @@ export interface GitHubRepositoryReference {
url: string;
}

export async function readGitOriginRemote(cwd: string, signal?: AbortSignal): Promise<string | null> {
export async function readGitOriginRemote(
cwd: string,
signal?: AbortSignal,
): Promise<string | null> {
try {
const { stdout } = await execFileAsync("git", ["config", "--get", "remote.origin.url"], {
cwd,
timeout: 5_000,
signal,
});
const { stdout } = await execFileAsync(
"git",
["config", "--get", "remote.origin.url"],
{
cwd,
timeout: 5_000,
signal,
},
);
const remote = stdout.trim();
return remote.length > 0 ? remote : null;
} catch (error) {
Expand All @@ -30,9 +38,13 @@ function isAbortError(error: unknown): boolean {
return error instanceof Error && error.name === "AbortError";
}

export function parseGitHubRepositoryUrl(value: string): GitHubRepositoryReference | null {
export function parseGitHubRepositoryUrl(
value: string,
): GitHubRepositoryReference | null {
const input = value.trim();
const shorthand = input.match(/^git@github\.com:([^/\s]+)\/([^/\s]+?)(?:\.git)?$/);
const shorthand = input.match(
/^git@github\.com:([^/\s]+)\/([^/\s]+?)(?:\.git)?$/,
);

if (shorthand) {
return toGitHubRepositoryReference(shorthand[1], shorthand[2]);
Expand All @@ -49,7 +61,11 @@ export function parseGitHubRepositoryUrl(value: string): GitHubRepositoryReferen
return null;
}

if (parsed.protocol !== "https:" && parsed.protocol !== "http:" && parsed.protocol !== "ssh:") {
if (
parsed.protocol !== "https:" &&
parsed.protocol !== "http:" &&
parsed.protocol !== "ssh:"
) {
return null;
}

Expand All @@ -64,7 +80,10 @@ export function parseGitHubRepositoryUrl(value: string): GitHubRepositoryReferen
return toGitHubRepositoryReference(owner, name);
}

function toGitHubRepositoryReference(owner: string | undefined, name: string | undefined): GitHubRepositoryReference | null {
function toGitHubRepositoryReference(
owner: string | undefined,
name: string | undefined,
): GitHubRepositoryReference | null {
if (!owner || !name || owner.includes("/") || name.includes("/")) {
return null;
}
Expand Down
Loading
Loading