Prepare datamodel for multi-environment (#1765)
Co-authored-by: justsomelegs <[email protected]> Co-authored-by: codex <[email protected]> Co-authored-by: Cursor Agent <[email protected]> Co-authored-by: cursor[bot] <206951365+cursor[bot]@users.noreply.github.com>
This commit is contained in:
121 files changed
+10195
-4958
No files matched your search
@@ -0,0 +1,19 @@
|
||||
import { scopedProjectKey, scopeProjectRef } from "@t3tools/client-runtime";
|
||||
import type { ScopedProjectRef } from "@t3tools/contracts";
|
||||
import type { Project } from "./types";
|
||||
|
||||
export function deriveLogicalProjectKey(
|
||||
project: Pick<Project, "environmentId" | "id" | "repositoryIdentity">,
|
||||
): string {
|
||||
return (
|
||||
project.repositoryIdentity?.canonicalKey ??
|
||||
scopedProjectKey(scopeProjectRef(project.environmentId, project.id))
|
||||
);
|
||||
}
|
||||
|
||||
export function deriveLogicalProjectKeyFromRef(
|
||||
projectRef: ScopedProjectRef,
|
||||
project: Pick<Project, "repositoryIdentity"> | null | undefined,
|
||||
): string {
|
||||
return project?.repositoryIdentity?.canonicalKey ?? scopedProjectKey(projectRef);
|
||||
}
|
||||
Reference in new issue
Block a user