ref0-git 0.12.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/apps/github/generated/git-rest.ts +152 -3
- package/app/apps/github/migrations/postgres/0001_auth.sql +8 -1
- package/app/apps/github/migrations/sql/0005_repo_grants.sql +10 -0
- package/app/apps/github/src/clients/allowed.ts +9 -4
- package/app/apps/github/src/components/repos/your-repos.tsx +57 -11
- package/app/apps/github/src/context/context.ts +45 -2
- package/app/apps/github/src/context/repo-grants.ts +35 -0
- package/app/apps/github/src/hooks/repos.ts +14 -3
- package/app/apps/github/src/policy.ts +485 -92
- package/app/apps/github/src/routes/$owner/$repo/settings/access.tsx +1 -1
- package/app/apps/github/src/routes/index.tsx +2 -1
- package/app/apps/github/src/settings/access-page.tsx +308 -0
- package/app/apps/github/src/settings/access.ts +156 -0
- package/app/apps/github/src/settings/settings-layout.tsx +0 -16
- package/app/apps/github/src/signin/auth.ts +2 -0
- package/app/apps/github/src/signin/orgs.ts +57 -14
- package/app/apps/github/src/signin/repo-grants.ts +141 -0
- package/app/pnpm-workspace.yaml +2 -2
- package/dist/cli/child.mjs +73 -3
- package/dist/cli/commands.mjs +2 -0
- package/dist/cli/documents.mjs +42 -2
- package/dist/cli/keys.mjs +431 -0
- package/dist/cli/main.mjs +148 -0
- package/dist/cli/prompt.mjs +40 -1
- package/dist/cli/ref0-git.mjs +4 -141
- package/dist/cli/setup.mjs +115 -13
- package/dist/cli/sign-in.mjs +1 -1
- package/dist/cli/tools-node.mjs +20 -0
- package/dist/cli/tools.mjs +12 -0
- package/dist/init/app.mjs +3 -1
- package/dist/init/git-module.mjs +11 -6
- package/dist/init/metadata.mjs +1 -1
- package/dist/init/template.mjs +1 -0
- package/dist/init/templates.mjs +15 -10
- package/dist/init/versions.mjs +1 -1
- package/package.json +5 -5
package/dist/init/templates.mjs
CHANGED
|
@@ -12,14 +12,19 @@ var templates_default = {
|
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
14
|
"slot": "githubImport",
|
|
15
|
-
"text": "import {\n Apps,\n Deployments,\n GitHub,\n Inbox,\n Releases,\n Search,\n Streams,\n Webhooks,\n} from '@ref0/github';"
|
|
15
|
+
"text": "import {\n Apps,\n Deployments,\n GitHub,\n Inbox,\n Releases,\n RepoGrants,\n Search,\n Streams,\n Webhooks,\n} from '@ref0/github';"
|
|
16
16
|
},
|
|
17
|
-
"\nimport * as Languages from '@ref0/github/languages';\n",
|
|
17
|
+
"\nimport * as Collaborators from '@ref0/github/collaborators';\nimport * as Languages from '@ref0/github/languages';\n",
|
|
18
18
|
{
|
|
19
19
|
"slot": "infraImport",
|
|
20
20
|
"text": "import {\n layer,\n layerR2,\n layerR2Signed,\n toJobObject,\n toRecordsObject,\n} from '@ref0/infra/cloudflare';"
|
|
21
21
|
},
|
|
22
|
-
"\nimport xdiff from '@ref0/xdiff-wasm/xdiff.wasm';\nimport { env as bindings } from 'cloudflare:workers';\
|
|
22
|
+
"\nimport xdiff from '@ref0/xdiff-wasm/xdiff.wasm';\nimport { env as bindings } from 'cloudflare:workers';\n",
|
|
23
|
+
{
|
|
24
|
+
"slot": "effectImport",
|
|
25
|
+
"text": "import * as Effect from 'effect/Effect';\n"
|
|
26
|
+
},
|
|
27
|
+
"import * as FetchHttpClient from 'effect/http/FetchHttpClient';\nimport * as Layer from 'effect/Layer';\nimport * as ManagedRuntime from 'effect/ManagedRuntime';\n\nimport { hostLayer, peopleOver, repoListOn, runOn, tokenCallsOn } from './context/host.ts';\nimport { repoGrantsDropped } from './context/repo-grants.ts';\nimport { repoIcons } from './context/repo-icons.ts';\nimport type { Env } from './env.ts';\nimport {\n admin,\n approvalPage,\n type GrantsPolicy,\n hostPolicy,\n hostRules,\n type Identify,\n} from './policy.ts';\nimport { privateReposOf } from './private-repos.ts';\nimport { readyAdapter, readyAuth, starterAuth } from './signin/auth.ts';\nimport { avatars } from './signin/avatars.ts';\nimport { appAuth } from './signin/host-session.ts';\nimport { orgsOver } from './signin/orgs.ts';\nimport { grantsOver } from './signin/repo-grants.ts';\nimport { sealKey } from './signin/seal.ts';\n\n// SAFETY: `wrangler.jsonc` ",
|
|
23
28
|
{
|
|
24
29
|
"slot": "safety",
|
|
25
30
|
"text": "binds the objects, the bucket and D1"
|
|
@@ -27,13 +32,13 @@ var templates_default = {
|
|
|
27
32
|
" and sets `APP_ORIGIN`; the\n// secrets come from `wrangler secret put`, or `.dev.vars` locally.\nexport const env = bindings as Env;\n\n",
|
|
28
33
|
{
|
|
29
34
|
"slot": "bucket",
|
|
30
|
-
"text": "const {\n R2_ACCOUNT_ID: accountId,\n R2_ACCESS_KEY_ID: accessKeyId,\n R2_SECRET_ACCESS_KEY: secretAccessKey,\n} = env;\n\n// With R2's S3 credentials, the bucket signs parts, and a push's pack past 64 MiB may upload to\n// it in parts, past Workers' 100 MB body.\nconst signed =\n accountId === undefined || accessKeyId === undefined || secretAccessKey === undefined\n ? undefined\n : layerR2Signed(env.PACKS, {\n accountId,\n bucket: env.PACKS_BUCKET,\n accessKeyId,\n secretAccessKey,\n });\n\nconst bucket = signed ?? layerR2(env.PACKS);\n\nconst uploads =\n signed === undefined\n ? Layer.empty\n : Layer.provide(Git.layerUploads({ above: 64 * 1024 * 1024 }), signed);\n\n"
|
|
35
|
+
"text": "const {\n R2_ACCOUNT_ID: accountId,\n R2_ACCESS_KEY_ID: accessKeyId,\n R2_SECRET_ACCESS_KEY: secretAccessKey,\n} = env;\n\n// With R2's S3 credentials, the bucket signs parts, and a push's pack past 64 MiB may upload to\n// it in parts, past Workers' 100 MB body.\nconst signed =\n accountId === undefined || accessKeyId === undefined || secretAccessKey === undefined\n ? undefined\n : layerR2Signed(env.PACKS, {\n accountId,\n bucket: env.PACKS_BUCKET,\n accessKeyId,\n secretAccessKey,\n });\n\n// With none, Git LFS's bytes go through the Worker, under its CPU and body limits: a warning\n// says so once an isolate, as the runtime builds the bucket.\nconst unsigned = Layer.effectDiscard(\n Effect.logWarning(\n \"LFS: through the Worker (no signing key). Run `ref0-git keys` in the Worker's folder to sign its links straight to R2\",\n ),\n);\n\nconst bucket = signed ?? Layer.merge(layerR2(env.PACKS), unsigned);\n\nconst uploads =\n signed === undefined\n ? Layer.empty\n : Layer.provide(Git.layerUploads({ above: 64 * 1024 * 1024 }), signed);\n\n"
|
|
31
36
|
},
|
|
32
37
|
{
|
|
33
38
|
"slot": "queueMerge",
|
|
34
39
|
"text": "/**\n * How the queue writes an entry's link onto `main`: a merge commit, by the person who added it, as\n * a pull request's merge button writes one, and titled as GitHub titles it for a pull request's\n * entry, keyed `pr-<number>`.\n */\nconst queueMerge = ({ entry, at }: MergeInput): MergePlan => {\n const [owner = ''] = entry.repo.split('/');\n const branch = entry.source.replace(/^refs\\/heads\\//, '');\n const pull = /^pr-([1-9]\\d*)$/.exec(entry.key)?.[1];\n const title =\n pull === undefined ? `Merge ${branch}` : `Merge pull request #${pull} from ${owner}/${branch}`;\n const login = entry.subject?.id ?? entry.actor.id;\n const hostname = new URL(env.APP_ORIGIN).hostname;\n\n return {\n method: 'merge',\n message: `${title}\\n`,\n author: { name: login, email: `${login}@users.noreply.${hostname}`, at, offset: 0 },\n };\n};\n\n"
|
|
35
40
|
},
|
|
36
|
-
"/** The key sessions and host sessions are sealed under, derived once an isolate from its secret. */\nexport const sessionKey = sealKey(env.SESSION_SECRET);\n\n/**\n * Who owns what, and the drop-in's people and orgs, over Better Auth's tables, which `auth` makes\n * at the first request that reads them.\n */\nexport const directory = orgsOver(async () => readyAdapter(await auth()));\n\n/** People's, orgs' and repos' pictures, in Better Auth's database, as `directory` reads it. */\nexport const pictures = avatars(async () => readyAdapter(await auth()));\n\nexport const policy = hostPolicy(directory, {\n origin: env.APP_ORIGIN,\n avatars: pictures,\n privateRepos: async (prefix, most, host) => privateReposOf(repoListOn(run))(prefix, most, host),\n repoName: async (internalId, signal) =>\n (await runtime.runPromise(RepoRecords.record(internalId), { signal }))?.name,\n});\n\n",
|
|
41
|
+
"/** The key sessions and host sessions are sealed under, derived once an isolate from its secret. */\nexport const sessionKey = sealKey(env.SESSION_SECRET);\n\n/**\n * Who owns what, and the drop-in's people and orgs, over Better Auth's tables, which `auth` makes\n * at the first request that reads them.\n */\nexport const directory = orgsOver(async () => readyAdapter(await auth()));\n\n/** People's, orgs' and repos' pictures, in Better Auth's database, as `directory` reads it. */\nexport const pictures = avatars(async () => readyAdapter(await auth()));\n\n/** Each repo's grants to people, its collaborators, in Better Auth's database, as `directory` reads it. */\nexport const grants = grantsOver(async () => readyAdapter(await auth()));\n\nexport const policy: GrantsPolicy = hostPolicy(directory, {\n origin: env.APP_ORIGIN,\n avatars: pictures,\n privateRepos: async (prefix, most, host) => privateReposOf(repoListOn(run))(prefix, most, host),\n repoName: async (internalId, signal) =>\n (await runtime.runPromise(RepoRecords.record(internalId), { signal }))?.name,\n // Who else may do what on a repo, by its grants, and which repo a token over one names now.\n grants,\n repoId: async (name, signal) =>\n (await runtime.runPromise(RepoRecords.pin(name), { signal }))?.internalId,\n});\n\n",
|
|
37
42
|
{
|
|
38
43
|
"slot": "adapter",
|
|
39
44
|
"text": "/** The records and job objects, and the bucket. */\nconst adapter = Layer.merge(layer({ records: env.RECORDS, jobs: env.JOBS }), bucket);"
|
|
@@ -48,7 +53,7 @@ var templates_default = {
|
|
|
48
53
|
"slot": "releases",
|
|
49
54
|
"text": " // A release's assets, in the bucket beside the packs.\n Releases.layer(),\n"
|
|
50
55
|
},
|
|
51
|
-
" // `org:` and `user:` search an owner's repos, its private ones by the policy's hook.\n Search.layer({ readableRepos: policy.readableRepos }),\n // Without it, a repo's `language` and `license` answer null.\n Languages.layer(),\n // A repo's and an org's hooks, each delivery a `fetch`, and GitHub Apps, whose hooks they send.\n // @effect-diagnostics-next-line unstableApiUsage:off\n Layer.provideMerge(Apps.layer(), Webhooks.layer().pipe(Layer.provide(FetchHttpClient.layer))),\n // GitHub's Event Streams over Git's event feeds, which a pull request's page follows.\n Streams.layer(),\n // A deleted repo's icon, removed however the repo was deleted.\n repoIcons(pictures),\n).pipe(\n Layer.provideMerge(GitHub.layer()),\n Layer.provideMerge(peopleOver(policy.people)),\n Layer.provideMerge(\n Layer.mergeAll(\n Rest.layer(),\n",
|
|
56
|
+
" // `org:` and `user:` search an owner's repos, its private ones by the policy's hook.\n Search.layer({ readableRepos: policy.readableRepos }),\n // Without it, a repo's `language` and `license` answer null.\n Languages.layer(),\n // A repo's and an org's hooks, each delivery a `fetch`, and GitHub Apps, whose hooks they send.\n // @effect-diagnostics-next-line unstableApiUsage:off\n Layer.provideMerge(Apps.layer(), Webhooks.layer().pipe(Layer.provide(FetchHttpClient.layer))),\n // GitHub's Event Streams over Git's event feeds, which a pull request's page follows.\n Streams.layer(),\n // A deleted repo's icon, removed however the repo was deleted.\n repoIcons(pictures),\n // A repo's collaborators and teams, which its settings list and change.\n Collaborators.layer(),\n // A deleted repo's collaborators, removed however the repo was deleted.\n repoGrantsDropped(grants),\n).pipe(\n Layer.provideMerge(GitHub.layer()),\n // The directory, and a repo's collaborators, which its settings list and change: the drop-in\n // takes both as it's built.\n Layer.provideMerge(Layer.merge(peopleOver(policy.people), RepoGrants.layer(policy.repoGrants))),\n Layer.provideMerge(\n Layer.mergeAll(\n Rest.layer(),\n",
|
|
52
57
|
{
|
|
53
58
|
"slot": "lfs",
|
|
54
59
|
"text": " // Git LFS, its objects in the bucket beside the packs. An upload through the Worker may use\n // `limits.cpu_ms` from wrangler.jsonc: raise both together.\n Lfs.layer({ cpuMs: 300_000 }),\n"
|
|
@@ -66,13 +71,13 @@ var templates_default = {
|
|
|
66
71
|
appGitNode: [
|
|
67
72
|
{
|
|
68
73
|
"slot": "head",
|
|
69
|
-
"text": "import {\n Git,\n Lfs,\n Merges,\n MergeQueue,\n Objects,\n RepoRecords,\n Rest,\n SignIn,\n Tokens,\n} from '@ref0/git';\nimport type { MergeInput, MergePlan } from '@ref0/git';\nimport {\n Apps,\n Deployments,\n GitHub,\n Inbox,\n Releases,\n Search,\n Streams,\n Webhooks,\n} from '@ref0/github';\nimport * as Languages from '@ref0/github/languages';\nimport {\n layer,\n layerR2,\n layerR2Signed,\n toJobObject,\n toRecordsObject,\n} from '@ref0/infra/cloudflare';\nimport xdiff from '@ref0/xdiff-wasm/xdiff.wasm';\nimport { env as bindings } from 'cloudflare:workers';\nimport * as FetchHttpClient from 'effect/http/FetchHttpClient';\nimport * as Layer from 'effect/Layer';\nimport * as ManagedRuntime from 'effect/ManagedRuntime';\n\nimport { hostLayer, peopleOver, repoListOn, runOn, tokenCallsOn } from './context/host.ts';\nimport { repoIcons } from './context/repo-icons.ts';\nimport type { Env } from './env.ts';\nimport {
|
|
74
|
+
"text": "import {\n Git,\n Lfs,\n Merges,\n MergeQueue,\n Objects,\n RepoRecords,\n Rest,\n SignIn,\n Tokens,\n} from '@ref0/git';\nimport type { MergeInput, MergePlan } from '@ref0/git';\nimport {\n Apps,\n Deployments,\n GitHub,\n Inbox,\n Releases,\n RepoGrants,\n Search,\n Streams,\n Webhooks,\n} from '@ref0/github';\nimport * as Collaborators from '@ref0/github/collaborators';\nimport * as Languages from '@ref0/github/languages';\nimport {\n layer,\n layerR2,\n layerR2Signed,\n toJobObject,\n toRecordsObject,\n} from '@ref0/infra/cloudflare';\nimport xdiff from '@ref0/xdiff-wasm/xdiff.wasm';\nimport { env as bindings } from 'cloudflare:workers';\nimport * as Effect from 'effect/Effect';\nimport * as FetchHttpClient from 'effect/http/FetchHttpClient';\nimport * as Layer from 'effect/Layer';\nimport * as ManagedRuntime from 'effect/ManagedRuntime';\n\nimport { hostLayer, peopleOver, repoListOn, runOn, tokenCallsOn } from './context/host.ts';\nimport { repoGrantsDropped } from './context/repo-grants.ts';\nimport { repoIcons } from './context/repo-icons.ts';\nimport type { Env } from './env.ts';\nimport {\n admin,\n approvalPage,\n type GrantsPolicy,\n hostPolicy,\n hostRules,\n type Identify,\n} from './policy.ts';\nimport { privateReposOf } from './private-repos.ts';\nimport { readyAdapter, readyAuth, starterAuth } from './signin/auth.ts';\nimport { avatars } from './signin/avatars.ts';\nimport { appAuth } from './signin/host-session.ts';\nimport { orgsOver } from './signin/orgs.ts';\nimport { grantsOver } from './signin/repo-grants.ts';\nimport { sealKey } from './signin/seal.ts';\n\n// SAFETY: `wrangler.jsonc` binds the objects, the bucket and D1 and sets `APP_ORIGIN`; the\n// secrets come from `wrangler secret put`, or `.dev.vars` locally.\nexport const env = bindings as Env;\n\nconst {\n R2_ACCOUNT_ID: accountId,\n R2_ACCESS_KEY_ID: accessKeyId,\n R2_SECRET_ACCESS_KEY: secretAccessKey,\n} = env;\n\n// With R2's S3 credentials, the bucket signs parts, and a push's pack past 64 MiB may upload to\n// it in parts, past Workers' 100 MB body.\nconst signed =\n accountId === undefined || accessKeyId === undefined || secretAccessKey === undefined\n ? undefined\n : layerR2Signed(env.PACKS, {\n accountId,\n bucket: env.PACKS_BUCKET,\n accessKeyId,\n secretAccessKey,\n });\n\n// With none, Git LFS's bytes go through the Worker, under its CPU and body limits: a warning\n// says so once an isolate, as the runtime builds the bucket.\nconst unsigned = Layer.effectDiscard(\n Effect.logWarning(\n \"LFS: through the Worker (no signing key). Run `ref0-git keys` in the Worker's folder to sign its links straight to R2\",\n ),\n);\n\nconst bucket = signed ?? Layer.merge(layerR2(env.PACKS), unsigned);\n\nconst uploads =\n signed === undefined\n ? Layer.empty\n : Layer.provide(Git.layerUploads({ above: 64 * 1024 * 1024 }), signed);\n\n"
|
|
70
75
|
},
|
|
71
76
|
{
|
|
72
77
|
"slot": "queueMerge",
|
|
73
78
|
"text": "/**\n * How the queue writes an entry's link onto `main`: a merge commit, by the person who added it, as\n * a pull request's merge button writes one, and titled as GitHub titles it for a pull request's\n * entry, keyed `pr-<number>`.\n */\nconst queueMerge = ({ entry, at }: MergeInput): MergePlan => {\n const [owner = ''] = entry.repo.split('/');\n const branch = entry.source.replace(/^refs\\/heads\\//, '');\n const pull = /^pr-([1-9]\\d*)$/.exec(entry.key)?.[1];\n const title =\n pull === undefined ? `Merge ${branch}` : `Merge pull request #${pull} from ${owner}/${branch}`;\n const login = entry.subject?.id ?? entry.actor.id;\n const hostname = new URL(env.APP_ORIGIN).hostname;\n\n return {\n method: 'merge',\n message: `${title}\\n`,\n author: { name: login, email: `${login}@users.noreply.${hostname}`, at, offset: 0 },\n };\n};\n\n"
|
|
74
79
|
},
|
|
75
|
-
"/** The key sessions and host sessions are sealed under, derived once an isolate from its secret. */\nexport const sessionKey = sealKey(env.SESSION_SECRET);\n\n/**\n * Who owns what, and the drop-in's people and orgs, over Better Auth's tables, which `auth` makes\n * at the first request that reads them.\n */\nexport const directory = orgsOver(async () => readyAdapter(await auth()));\n\n/** People's, orgs' and repos' pictures, in Better Auth's database, as `directory` reads it. */\nexport const pictures = avatars(async () => readyAdapter(await auth()));\n\nexport const policy = hostPolicy(directory, {\n origin: env.APP_ORIGIN,\n avatars: pictures,\n privateRepos: async (prefix, most, host) => privateReposOf(repoListOn(run))(prefix, most, host),\n repoName: async (internalId, signal) =>\n (await runtime.runPromise(RepoRecords.record(internalId), { signal }))?.name,\n});\n\n",
|
|
80
|
+
"/** The key sessions and host sessions are sealed under, derived once an isolate from its secret. */\nexport const sessionKey = sealKey(env.SESSION_SECRET);\n\n/**\n * Who owns what, and the drop-in's people and orgs, over Better Auth's tables, which `auth` makes\n * at the first request that reads them.\n */\nexport const directory = orgsOver(async () => readyAdapter(await auth()));\n\n/** People's, orgs' and repos' pictures, in Better Auth's database, as `directory` reads it. */\nexport const pictures = avatars(async () => readyAdapter(await auth()));\n\n/** Each repo's grants to people, its collaborators, in Better Auth's database, as `directory` reads it. */\nexport const grants = grantsOver(async () => readyAdapter(await auth()));\n\nexport const policy: GrantsPolicy = hostPolicy(directory, {\n origin: env.APP_ORIGIN,\n avatars: pictures,\n privateRepos: async (prefix, most, host) => privateReposOf(repoListOn(run))(prefix, most, host),\n repoName: async (internalId, signal) =>\n (await runtime.runPromise(RepoRecords.record(internalId), { signal }))?.name,\n // Who else may do what on a repo, by its grants, and which repo a token over one names now.\n grants,\n repoId: async (name, signal) =>\n (await runtime.runPromise(RepoRecords.pin(name), { signal }))?.internalId,\n});\n\n",
|
|
76
81
|
{
|
|
77
82
|
"slot": "adapter",
|
|
78
83
|
"text": "/** The records and job objects, and the bucket. */\nconst adapter = Layer.merge(layer({ records: env.RECORDS, jobs: env.JOBS }), bucket);"
|
|
@@ -87,7 +92,7 @@ var templates_default = {
|
|
|
87
92
|
"slot": "releases",
|
|
88
93
|
"text": " // A release's assets, in the bucket beside the packs.\n Releases.layer(),\n"
|
|
89
94
|
},
|
|
90
|
-
" // `org:` and `user:` search an owner's repos, its private ones by the policy's hook.\n Search.layer({ readableRepos: policy.readableRepos }),\n // Without it, a repo's `language` and `license` answer null.\n Languages.layer(),\n // A repo's and an org's hooks, each delivery a `fetch`, and GitHub Apps, whose hooks they send.\n // @effect-diagnostics-next-line unstableApiUsage:off\n Layer.provideMerge(Apps.layer(), Webhooks.layer().pipe(Layer.provide(FetchHttpClient.layer))),\n // GitHub's Event Streams over Git's event feeds, which a pull request's page follows.\n Streams.layer(),\n // A deleted repo's icon, removed however the repo was deleted.\n repoIcons(pictures),\n).pipe(\n Layer.provideMerge(GitHub.layer()),\n Layer.provideMerge(peopleOver(policy.people)),\n Layer.provideMerge(\n Layer.mergeAll(\n Rest.layer(),\n",
|
|
95
|
+
" // `org:` and `user:` search an owner's repos, its private ones by the policy's hook.\n Search.layer({ readableRepos: policy.readableRepos }),\n // Without it, a repo's `language` and `license` answer null.\n Languages.layer(),\n // A repo's and an org's hooks, each delivery a `fetch`, and GitHub Apps, whose hooks they send.\n // @effect-diagnostics-next-line unstableApiUsage:off\n Layer.provideMerge(Apps.layer(), Webhooks.layer().pipe(Layer.provide(FetchHttpClient.layer))),\n // GitHub's Event Streams over Git's event feeds, which a pull request's page follows.\n Streams.layer(),\n // A deleted repo's icon, removed however the repo was deleted.\n repoIcons(pictures),\n // A repo's collaborators and teams, which its settings list and change.\n Collaborators.layer(),\n // A deleted repo's collaborators, removed however the repo was deleted.\n repoGrantsDropped(grants),\n).pipe(\n Layer.provideMerge(GitHub.layer()),\n // The directory, and a repo's collaborators, which its settings list and change: the drop-in\n // takes both as it's built.\n Layer.provideMerge(Layer.merge(peopleOver(policy.people), RepoGrants.layer(policy.repoGrants))),\n Layer.provideMerge(\n Layer.mergeAll(\n Rest.layer(),\n",
|
|
91
96
|
{
|
|
92
97
|
"slot": "lfs",
|
|
93
98
|
"text": " // Git LFS, its objects in the bucket beside the packs. An upload through the Worker may use\n // `limits.cpu_ms` from wrangler.jsonc: raise both together.\n Lfs.layer({ cpuMs: 300_000 }),\n"
|
|
@@ -215,7 +220,7 @@ var templates_default = {
|
|
|
215
220
|
", and sets `ADMINS`.\nconst env = bindings as Env;\n\n/**\n * Who `ADMIN_TOKEN` signs in as, while it's set: it mints a listed admin's first `admin` token, and\n * nothing else. No login can be it.\n */\nconst bootstrap = { id: '_admin' };\n\n/**\n * The host's admins: `ADMINS`, from `wrangler.jsonc`'s vars, logins between commas. Each signs in\n * as themselves with an `admin` token, and makes repos, mints tokens and pushes. Adding one is a\n * vars edit and a deploy. A login that can't be one stops the Worker's start, so a deploy that\n * names it fails.\n */\nconst admins = new Set(\n (env.ADMINS ?? '')\n .split(',')\n .map((login) => login.trim())\n .filter((login) => login !== ''),\n);\n\nfor (const login of admins) {\n if (login === bootstrap.id || new TextEncoder().encode(login).length > maxActorIdLength) {\n throw new Error(`ADMINS names '${login}', which can't be a login`);\n }\n}\n\n",
|
|
216
221
|
{
|
|
217
222
|
"slot": "bucket",
|
|
218
|
-
"text": "const {\n R2_ACCOUNT_ID: accountId,\n R2_ACCESS_KEY_ID: accessKeyId,\n R2_SECRET_ACCESS_KEY: secretAccessKey,\n} = env;\n\n// With R2's S3 credentials, the bucket signs parts, and a push's pack past 64 MiB may upload to\n// it in parts, past Workers' 100 MB body.\nconst signed =\n accountId === undefined || accessKeyId === undefined || secretAccessKey === undefined\n ? undefined\n : layerR2Signed(env.PACKS, {\n accountId,\n bucket: env.PACKS_BUCKET,\n accessKeyId,\n secretAccessKey,\n });\n\n/** The records and job objects, and the packs' bucket. */\nconst adapter = Layer.merge(\n layer({ records: env.RECORDS, jobs: env.JOBS }),\n signed ?? layerR2(env.PACKS),\n);\n\n"
|
|
223
|
+
"text": "const {\n R2_ACCOUNT_ID: accountId,\n R2_ACCESS_KEY_ID: accessKeyId,\n R2_SECRET_ACCESS_KEY: secretAccessKey,\n} = env;\n\n// With R2's S3 credentials, the bucket signs parts, and a push's pack past 64 MiB may upload to\n// it in parts, past Workers' 100 MB body.\nconst signed =\n accountId === undefined || accessKeyId === undefined || secretAccessKey === undefined\n ? undefined\n : layerR2Signed(env.PACKS, {\n accountId,\n bucket: env.PACKS_BUCKET,\n accessKeyId,\n secretAccessKey,\n });\n\n// With none, Git LFS's bytes go through the Worker, under its CPU and body limits: a warning\n// says so once an isolate, as the runtime builds the bucket.\nconst unsigned = Layer.effectDiscard(\n Effect.logWarning(\n \"LFS: through the Worker (no signing key). Run `ref0-git keys` in the Worker's folder to sign its links straight to R2\",\n ),\n);\n\n/** The records and job objects, and the packs' bucket. */\nconst adapter = Layer.merge(\n layer({ records: env.RECORDS, jobs: env.JOBS }),\n signed ?? Layer.merge(layerR2(env.PACKS), unsigned),\n);\n\n"
|
|
219
224
|
},
|
|
220
225
|
{
|
|
221
226
|
"slot": "merge",
|
package/dist/init/versions.mjs
CHANGED
|
@@ -56,5 +56,5 @@ const initPacked = (name, at) => {
|
|
|
56
56
|
* the release, or the tarball `--from-checkout` names for that package. One it wrote moves to this
|
|
57
57
|
* run's spec; any other is the person's, a tarball of their own in `vendor/` too, and stays.
|
|
58
58
|
*/
|
|
59
|
-
const initWrote = (name, spec) => spec === "0.
|
|
59
|
+
const initWrote = (name, spec) => spec === "0.14.0" || spec !== void 0 && packedPath(name).test(spec);
|
|
60
60
|
export { catalog, contentNamed, frameworkPackages, initPacked, initWrote, nodeAppPackages, nodePackages, peerPackages, published, release, specOf, storePackages, unpacked, vercelPackages };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ref0-git",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "ref0-git, the CLI for a Git host built on @ref0/git, and git-remote-ref0, its remote helper",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@effect/platform-node-shared": "4.1.7",
|
|
27
|
-
"@ref0/git": "0.
|
|
28
|
-
"@ref0/infra": "0.
|
|
27
|
+
"@ref0/git": "0.14.0",
|
|
28
|
+
"@ref0/infra": "0.14.0",
|
|
29
29
|
"diff": "9.0.0",
|
|
30
30
|
"effect": "^4.1.7"
|
|
31
31
|
},
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"@effect/vitest": "4.1.7",
|
|
35
35
|
"@libsql/client": "0.18.0",
|
|
36
36
|
"@libsql/kysely-libsql": "0.4.1",
|
|
37
|
-
"@ref0/github": "0.
|
|
38
|
-
"@ref0/xdiff-wasm": "0.
|
|
37
|
+
"@ref0/github": "0.14.0",
|
|
38
|
+
"@ref0/xdiff-wasm": "0.14.0",
|
|
39
39
|
"@tanstack/react-start": "1.169.7",
|
|
40
40
|
"@types/node": "24.19.4",
|
|
41
41
|
"@types/pg": "8.23.1",
|