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 member | 1 | /** |
| 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 | ||
| 7 | const 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`. */ | |
| 9 | const REGISTRY_PATH = /^\/v2(?:\/|$)/; | |
| npm on g1t.sh: publish and install @<workspace>/<name> with the npm CLI and a g1t token | 10 | /** The npm registry: `/-/npm/`, which `.npmrc` names for a workspace's scope. */ |
| 11 | const NPM_PATH = /^\/-\/npm(?:\/|$)/; | |
| Composer from the workspace's own repositories, and go get from g1t.sh | 12 | /** The Composer registries: `/-/composer/<workspace>/`, one per workspace. */ |
| 13 | const COMPOSER_PATH = /^\/-\/composer\//; | |
| Packages, with a container registry on g1t.sh; workspaces deleted whole and kept 30 days; Members for every member | 14 | |
| 15 | export type ServicePath = "git" | "packages" | null; | |
| 16 | ||
| 17 | export function servicePath(pathname: string): ServicePath { | |
| Composer from the workspace's own repositories, and go get from g1t.sh | 18 | if (REGISTRY_PATH.test(pathname) || NPM_PATH.test(pathname) || COMPOSER_PATH.test(pathname)) return "packages"; |
| Packages, with a container registry on g1t.sh; workspaces deleted whole and kept 30 days; Members for every member | 19 | if (GIT_PATH.test(pathname)) return "git"; |
| 20 | return null; | |
| 21 | } |