Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"@clack/prompts": "^1.5.0",
"@prisma/compute-sdk": "0.31.0",
"@prisma/credentials-store": "^7.8.0",
"@prisma/management-api-sdk": "^1.44.0",
"@prisma/management-api-sdk": "^1.46.0",
"better-result": "^2.9.2",
"colorette": "^2.0.20",
"commander": "^14.0.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/controllers/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1157,9 +1157,9 @@
...deployment.deployment,
live: providerLiveDeploymentId
? deployment.deployment.id === providerLiveDeploymentId
: knownLiveDeploymentId
? deployment.deployment.id === knownLiveDeploymentId
: deployment.deployment.live,

Check notice on line 1162 in packages/cli/src/controllers/app.ts

View workflow job for this annotation

GitHub Actions / Lint

lint/style/noNestedTernary

Do not nest ternary expressions.
},
},
warnings: [],
Expand Down Expand Up @@ -1538,10 +1538,10 @@
});
}

await sleep(
Math.min(pollIntervalMs, Math.max(deadline - Date.now(), 0)),
context.runtime.signal,
);

Check notice on line 1544 in packages/cli/src/controllers/app.ts

View workflow job for this annotation

GitHub Actions / Lint

lint/performance/noAwaitInLoops

Avoid using await inside loops.
current = await target.provider
.showDomain(current.id, { signal: context.runtime.signal })
.catch((error) => {
Expand Down Expand Up @@ -2103,7 +2103,7 @@
const compute = await resolveComputeManagementContext(
context,
options?.configTarget,
commandName.replace(/^app /, ""),

Check warning on line 2106 in packages/cli/src/controllers/app.ts

View workflow job for this annotation

GitHub Actions / Lint

lint/performance/useTopLevelRegex

This regex literal is not defined in the top level scope. This can lead to performance issues if this function is called frequently.
);
const branch = resolveDomainBranch(options?.branchName);
if (toBranchKind(branch.name) !== "production") {
Expand Down Expand Up @@ -2271,14 +2271,14 @@
}

return labels.every((label) =>
/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/.test(label),

Check warning on line 2274 in packages/cli/src/controllers/app.ts

View workflow job for this annotation

GitHub Actions / Lint

lint/performance/useTopLevelRegex

This regex literal is not defined in the top level scope. This can lead to performance issues if this function is called frequently.
);
}

function sameDomainHostname(left: string, right: string): boolean {
return (
left.trim().replace(/\.$/, "").toLowerCase() ===

Check warning on line 2280 in packages/cli/src/controllers/app.ts

View workflow job for this annotation

GitHub Actions / Lint

lint/performance/useTopLevelRegex

This regex literal is not defined in the top level scope. This can lead to performance issues if this function is called frequently.
right.trim().replace(/\.$/, "").toLowerCase()

Check warning on line 2281 in packages/cli/src/controllers/app.ts

View workflow job for this annotation

GitHub Actions / Lint

lint/performance/useTopLevelRegex

This regex literal is not defined in the top level scope. This can lead to performance issues if this function is called frequently.
);
}

Expand All @@ -2288,7 +2288,7 @@
type: domain.type,
url: domain.url,
hostname: domain.hostname,
computeServiceId: domain.computeServiceId,
appId: domain.appId,
status: domain.status,
foundryStatus: domain.foundryStatus,
failureReason: domain.failureReason,
Expand Down Expand Up @@ -2366,7 +2366,7 @@
}
}

function domainCommandError(

Check notice on line 2369 in packages/cli/src/controllers/app.ts

View workflow job for this annotation

GitHub Actions / Lint

lint/complexity/noExcessiveCognitiveComplexity

Excessive complexity of 26 detected (max: 15).
command: AppDomainCommand,
error: unknown,
hostname: string,
Expand Down Expand Up @@ -2503,7 +2503,7 @@
text.includes("no cname") ||
text.includes("cname record") ||
text.includes("no a/aaaa") ||
/\bcname(?:s)?\s+to\b/.test(text)

Check warning on line 2506 in packages/cli/src/controllers/app.ts

View workflow job for this annotation

GitHub Actions / Lint

lint/performance/useTopLevelRegex

This regex literal is not defined in the top level scope. This can lead to performance issues if this function is called frequently.
);
}

Expand Down Expand Up @@ -2532,7 +2532,7 @@

function extractDomainDnsTarget(error: DomainApiError): string | null {
const text = `${error.hint ?? ""} ${error.message}`;
const match = /\b((?:[a-z0-9-]+\.)+prisma\.build)\b/i.exec(text);

Check warning on line 2535 in packages/cli/src/controllers/app.ts

View workflow job for this annotation

GitHub Actions / Lint

lint/performance/useTopLevelRegex

This regex literal is not defined in the top level scope. This can lead to performance issues if this function is called frequently.
return match?.[1]?.toLowerCase() ?? null;
}

Expand Down Expand Up @@ -2568,7 +2568,7 @@
return 0;
}

const match = /^(\d+)(ms|s|m|h)$/.exec(trimmed);

Check warning on line 2571 in packages/cli/src/controllers/app.ts

View workflow job for this annotation

GitHub Actions / Lint

lint/performance/useTopLevelRegex

This regex literal is not defined in the top level scope. This can lead to performance issues if this function is called frequently.
if (!match) {
throw usageError(
`Invalid timeout "${value}"`,
Expand All @@ -2584,11 +2584,11 @@
const multiplier =
unit === "h"
? 60 * 60 * 1000
: unit === "m"
? 60 * 1000
: unit === "s"
? 1000
: 1;

Check notice on line 2591 in packages/cli/src/controllers/app.ts

View workflow job for this annotation

GitHub Actions / Lint

lint/style/noNestedTernary

Do not nest ternary expressions.

Check notice on line 2591 in packages/cli/src/controllers/app.ts

View workflow job for this annotation

GitHub Actions / Lint

lint/style/noNestedTernary

Do not nest ternary expressions.
return amount * multiplier;
}

Expand Down Expand Up @@ -3362,7 +3362,7 @@
listProjects: () =>
listRealWorkspaceProjects(
client,
authState.workspace!,

Check warning on line 3365 in packages/cli/src/controllers/app.ts

View workflow job for this annotation

GitHub Actions / Lint

lint/style/noNonNullAssertion

Forbidden non-null assertion.
context.runtime.signal,
),
commandName: options?.commandName,
Expand Down Expand Up @@ -3396,7 +3396,7 @@
};
}

async function resolveDeployProjectContext(

Check notice on line 3399 in packages/cli/src/controllers/app.ts

View workflow job for this annotation

GitHub Actions / Lint

lint/complexity/noExcessiveCognitiveComplexity

Excessive complexity of 18 detected (max: 15).
context: CommandContext,
client: ManagementApiClient,
provider: ReturnType<typeof createAppProvider>,
Expand Down Expand Up @@ -4071,7 +4071,7 @@
continue;
}

const configFile = await detectFrameworkConfigFile(cwd, framework, signal);

Check notice on line 4074 in packages/cli/src/controllers/app.ts

View workflow job for this annotation

GitHub Actions / Lint

lint/performance/noAwaitInLoops

Avoid using await inside loops.
if (
!configFile.exists &&
!hasAnyPackageDependency(packageJson, framework.detectPackages)
Expand All @@ -4084,8 +4084,8 @@
const annotation =
framework.key === "nextjs" && configFile.standalone
? "standalone output detected"
: configFile.exists
? `detected from ${path.basename(configFile.path!)}`

Check warning on line 4088 in packages/cli/src/controllers/app.ts

View workflow job for this annotation

GitHub Actions / Lint

lint/style/noNonNullAssertion

Forbidden non-null assertion.
: "detected from package.json";

Check notice on line 4089 in packages/cli/src/controllers/app.ts

View workflow job for this annotation

GitHub Actions / Lint

lint/style/noNestedTernary

Do not nest ternary expressions.

return {
Expand All @@ -4108,10 +4108,10 @@
const filePath = path.join(cwd, candidate);
signal.throwIfAborted();
try {
const content = await readFile(filePath, { encoding: "utf8", signal });

Check notice on line 4111 in packages/cli/src/controllers/app.ts

View workflow job for this annotation

GitHub Actions / Lint

lint/performance/noAwaitInLoops

Avoid using await inside loops.
return {
exists: true,
standalone: /\boutput\s*:\s*["'`]standalone["'`]/.test(content),

Check warning on line 4114 in packages/cli/src/controllers/app.ts

View workflow job for this annotation

GitHub Actions / Lint

lint/performance/useTopLevelRegex

This regex literal is not defined in the top level scope. This can lead to performance issues if this function is called frequently.
path: filePath,
};
} catch (error) {
Expand Down Expand Up @@ -4785,7 +4785,7 @@
});
}

function appDeployFailedError(

Check notice on line 4788 in packages/cli/src/controllers/app.ts

View workflow job for this annotation

GitHub Actions / Lint

lint/complexity/noExcessiveCognitiveComplexity

Excessive complexity of 21 detected (max: 15).
error: unknown,
progress: DeployProgressState,
): CliError {
Expand Down
10 changes: 5 additions & 5 deletions packages/cli/src/lib/app/app-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export interface DomainRecord {
type: "custom-domain";
url: string;
hostname: string;
computeServiceId: string;
appId: string;
status: DomainStatus;
foundryStatus: string;
failureReason: string | null;
Expand Down Expand Up @@ -791,7 +791,7 @@ interface RawDomainRecord {
type: "custom-domain";
url: string;
hostname: string;
computeServiceId: string;
appId: string;
status: DomainStatus;
foundryStatus: string;
failureReason: string | null;
Expand Down Expand Up @@ -926,12 +926,12 @@ async function listComputeServices(

async function listComputeServiceDomains(
client: ManagementApiClient,
computeServiceId: string,
appId: string,
signal?: AbortSignal,
): Promise<DomainRecord[]> {
const result = await client.GET("/v1/apps/{appId}/domains", {
params: {
path: { appId: computeServiceId },
path: { appId: appId },
},
signal,
});
Expand All @@ -953,7 +953,7 @@ function normalizeDomainRecord(domain: RawDomainRecord): DomainRecord {
type: domain.type,
url: domain.url,
hostname: domain.hostname,
computeServiceId: domain.computeServiceId,
appId: domain.appId,
status: domain.status,
foundryStatus: domain.foundryStatus,
failureReason: domain.failureReason,
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/types/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export interface AppDomainSummary {
type: "custom-domain";
url: string;
hostname: string;
computeServiceId: string;
appId: string;
status: AppDomainStatus;
foundryStatus: string;
failureReason: string | null;
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/tests/app-controller.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function createDomain(
overrides: Partial<{
id: string;
hostname: string;
computeServiceId: string;
appId: string;
status:
| "pending_dns"
| "verifying"
Expand All @@ -116,7 +116,7 @@ function createDomain(
type: "custom-domain" as const,
url: `https://api.prisma.io/v1/domains/${overrides.id ?? "dom_123"}`,
hostname,
computeServiceId: overrides.computeServiceId ?? "app_1",
appId: overrides.appId ?? "app_1",
status: overrides.status ?? "pending_dns",
foundryStatus: overrides.status ?? "pending_dns",
failureReason: overrides.failureReason ?? null,
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/tests/app-presenter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function createDomain(
type: "custom-domain",
url: "https://api.prisma.io/v1/domains/dom_123",
hostname: "shop.acme.com",
computeServiceId: "app_1",
appId: "app_1",
status: "pending_dns",
foundryStatus: "pending",
failureReason: null,
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/tests/app-provider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ describe("preview app provider", () => {
type: "custom-domain",
url: "https://api.prisma.io/v1/domains/dom_123",
hostname: "shop.acme.com",
computeServiceId: "app_1",
appId: "app_1",
status: "active",
foundryStatus: "active",
failureReason: null,
Expand Down Expand Up @@ -465,7 +465,7 @@ describe("preview app provider", () => {
type: "custom-domain",
url: "https://api.prisma.io/v1/domains/dom_123",
hostname: "other.acme.com",
computeServiceId: "app_1",
appId: "app_1",
status: "active",
foundryStatus: "active",
failureReason: null,
Expand Down
16 changes: 8 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading