g1t/apps/web/app/lib/registry-paths.ts

31 lines1,607 bytesCodeBlame

Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.

Packages, with a container registry on g1t.sh; workspaces deleted whole and kept 30 days; Members for every member1/**
2 * Which requests to g1t.sh belong to a service other than the site: git
3 * over HTTPS (the repos service) and the package registries (the packages
4 * service). `workers/app.ts` hands each to its binding as it is.
5 */
6
7const GIT_PATH = /\/(info\/refs|git-upload-pack|git-receive-pack)$/;
8/** The container registry: OCI Distribution's `/v2/`, and its token endpoint at `/v2/token`. */
9const REGISTRY_PATH = /^\/v2(?:\/|$)/;
npm on g1t.sh: publish and install @<workspace>/<name> with the npm CLI and a g1t token10/** The npm registry: `/-/npm/`, which `.npmrc` names for a workspace's scope. */
11const NPM_PATH = /^\/-\/npm(?:\/|$)/;
Composer from the workspace's own repositories, and go get from g1t.sh12/** The Composer registries: `/-/composer/<workspace>/`, one per workspace. */
13const COMPOSER_PATH = /^\/-\/composer\//;
Cargo on g1t.sh: a sparse registry per workspace, cargo publish/add/yank/search with a g1t token; npm rows show their version14/** The Cargo registries: `/-/cargo/<workspace>/`, a sparse index and its web API, one per workspace. */
15const CARGO_PATH = /^\/-\/cargo\//;
Merge branch 'worktree-agent-a6a121745e81f639f'16/** The Maven repositories: `/-/maven/<workspace>/`, in the standard layout, one per workspace. */
17const MAVEN_PATH = /^\/-\/maven\//;
18/** The NuGet feeds: `/-/nuget/<workspace>/v3/index.json` and what it names, one per workspace. */
19const NUGET_PATH = /^\/-\/nuget\//;
20/** The RubyGems registries: `/-/rubygems/<workspace>/`, the compact index and `gem push`, one per workspace. */
21const RUBYGEMS_PATH = /^\/-\/rubygems\//;
22
23const REGISTRY_PATHS = [REGISTRY_PATH, NPM_PATH, COMPOSER_PATH, CARGO_PATH, MAVEN_PATH, NUGET_PATH, RUBYGEMS_PATH];
Packages, with a container registry on g1t.sh; workspaces deleted whole and kept 30 days; Members for every member24
25export type ServicePath = "git" | "packages" | null;
26
27export function servicePath(pathname: string): ServicePath {
Merge branch 'worktree-agent-a6a121745e81f639f'28 if (REGISTRY_PATHS.some((path) => path.test(pathname))) return "packages";
Packages, with a container registry on g1t.sh; workspaces deleted whole and kept 30 days; Members for every member29 if (GIT_PATH.test(pathname)) return "git";
30 return null;
31}

This file's history is long; its oldest lines are credited to the oldest commit read.