@rexezuge/cli 1.14.0 → 1.15.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/README.md +51 -27
- package/dist/cli.d.ts +2 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +5 -2
- package/dist/cli.js.map +3 -3
- package/dist/commands/backup.d.ts +22 -0
- package/dist/commands/backup.d.ts.map +1 -0
- package/dist/commands/backup.js +3 -0
- package/dist/commands/backup.js.map +7 -0
- package/dist/commands/manifest.d.ts +8 -0
- package/dist/commands/manifest.d.ts.map +1 -0
- package/dist/commands/manifest.js +1 -0
- package/dist/commands/manifest.js.map +7 -0
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +1 -1
- package/dist/commands/sync.js.map +3 -3
- package/dist/doctor/checks/actions.d.ts +17 -0
- package/dist/doctor/checks/actions.d.ts.map +1 -0
- package/dist/doctor/checks/actions.js +1 -0
- package/dist/doctor/checks/actions.js.map +7 -0
- package/dist/doctor/checks/catalog.d.ts.map +1 -1
- package/dist/doctor/checks/catalog.js +1 -1
- package/dist/doctor/checks/catalog.js.map +3 -3
- package/dist/doctor/registry.d.ts.map +1 -1
- package/dist/doctor/registry.js +1 -1
- package/dist/doctor/registry.js.map +3 -3
- package/dist/manifest-plan.d.ts +58 -0
- package/dist/manifest-plan.d.ts.map +1 -0
- package/dist/manifest-plan.js +1 -0
- package/dist/manifest-plan.js.map +7 -0
- package/dist/repo.d.ts +10 -0
- package/dist/repo.d.ts.map +1 -1
- package/dist/repo.js +1 -1
- package/dist/repo.js.map +3 -3
- package/dist/sync/fixes.d.ts.map +1 -1
- package/dist/sync/fixes.js +6 -6
- package/dist/sync/fixes.js.map +3 -3
- package/dist/sync/plan.d.ts +6 -0
- package/dist/sync/plan.d.ts.map +1 -1
- package/dist/sync/plan.js +5 -3
- package/dist/sync/plan.js.map +3 -3
- package/dist/sync/run.d.ts +4 -0
- package/dist/sync/run.d.ts.map +1 -1
- package/dist/sync/run.js +1 -1
- package/dist/sync/run.js.map +2 -2
- package/dist/sync/tsconfig.d.ts +13 -0
- package/dist/sync/tsconfig.d.ts.map +1 -0
- package/dist/sync/tsconfig.js +5 -0
- package/dist/sync/tsconfig.js.map +7 -0
- package/dist/version.d.ts +5 -0
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +3 -3
- package/dist/workflow-callers.d.ts +2 -1
- package/dist/workflow-callers.d.ts.map +1 -1
- package/dist/workflow-callers.js +15 -14
- package/dist/workflow-callers.js.map +3 -3
- package/package.json +5 -4
package/dist/workflow-callers.js
CHANGED
|
@@ -1,34 +1,35 @@
|
|
|
1
|
-
var
|
|
1
|
+
var i=Object.defineProperty;var r=(e,n)=>i(e,"name",{value:n,configurable:!0});const t="Rexezuge-CloudflareWorkers/SDK/.github/workflows",u="v1",s={ci:{file:"continuous-integration.yml",workflow:"worker-ci",name:"Continuous Integration",on:`on:
|
|
2
2
|
push:
|
|
3
3
|
branches: [main]
|
|
4
4
|
pull_request:
|
|
5
|
+
repository_dispatch:
|
|
6
|
+
types: [upstream-sync]
|
|
5
7
|
workflow_dispatch:
|
|
6
|
-
|
|
8
|
+
`,permissions:["contents: write","pull-requests: write"]},cd:{file:"continuous-deployment.yml",workflow:"worker-cd",name:"Continuous Deployment",on:`on:
|
|
7
9
|
workflow_run:
|
|
8
10
|
workflows: ['Continuous Integration']
|
|
9
11
|
types: [completed]
|
|
10
12
|
branches: [main]
|
|
13
|
+
repository_dispatch:
|
|
14
|
+
types: [upstream-sync]
|
|
11
15
|
workflow_dispatch:
|
|
12
|
-
|
|
16
|
+
`,permissions:["contents: read"]},"version-update":{file:"scheduled-version-update.yml",workflow:"version-update",name:"Scheduled Version Update",on:`on:
|
|
13
17
|
schedule:
|
|
14
18
|
- cron: '0 0 1,15 * *'
|
|
15
19
|
workflow_dispatch:
|
|
16
|
-
|
|
20
|
+
`,permissions:["contents: write"]},"backup-d1":{file:"backup-d1.yml",workflow:"backup-d1",name:"Backup D1",on:`on:
|
|
17
21
|
schedule:
|
|
18
|
-
- cron: '
|
|
22
|
+
- cron: '15 4 * * *'
|
|
19
23
|
workflow_dispatch:
|
|
20
|
-
|
|
24
|
+
`,permissions:["contents: read"]},"backup-main":{file:"backup-main.yml",workflow:"backup-main",name:"Backup Main",on:`on:
|
|
21
25
|
push:
|
|
22
26
|
branches: [main]
|
|
23
27
|
schedule:
|
|
24
28
|
- cron: '0 0 5 * *'
|
|
25
|
-
|
|
29
|
+
`,permissions:["contents: read"]},"upstream-sync":{file:"upstream-sync.yml",workflow:"upstream-sync",name:"Upstream Sync",on:`on:
|
|
26
30
|
schedule:
|
|
27
|
-
- cron: '
|
|
31
|
+
- cron: '17 2 * * 1'
|
|
28
32
|
workflow_dispatch:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
`:"";return[`# A thin caller: the pipeline lives in ${t}/${n.workflow}.yml (tag v1).`,"# Jobs switch on .rexezuge.jsonc features; change behaviour there or in the SDK, not here.",`name: ${n.name}
|
|
33
|
-
`,n.on,`${o}jobs:`,` ${n.workflow}:`,` uses: ${t}/${n.workflow}.yml@v1`," secrets: inherit",""].join(`
|
|
34
|
-
`)}r(a,"renderCaller");function l(e){const n=["ci","cd","version-update"];return e?.features?.backupD1===!0&&n.push("backup-d1"),n.map(o=>({path:`.github/workflows/${c[o].file}`,content:a(o)}))}r(l,"callersFor");function p(e){const n=e.replace(/^.*\//,"").replace(/\.ya?ml$/,"");return{"continuous-integration":"ci",ci:"ci","worker-ci":"ci","continuous-deployment":"cd",cd:"cd",deploy:"cd","worker-cd":"cd","scheduled-version-update":"version-update","version-update":"version-update","backup-d1":"backup-d1","backup-main":"backup-main","upstream-sync":"upstream-sync"}[n]??null}r(p,"callerKindForFile");function d(e){return c[e].file}r(d,"callerFile");export{t as WORKFLOW_REF,u as WORKFLOW_TAG,d as callerFile,p as callerKindForFile,l as callersFor,a as renderCaller};
|
|
33
|
+
`,permissions:["contents: write"]}};function c(e){const n=s[e];return[`# A thin caller: the pipeline lives in ${t}/${n.workflow}.yml (tag v1).`,"# Jobs switch on .rexezuge.jsonc features; change behaviour there or in the SDK, not here.",`name: ${n.name}
|
|
34
|
+
`,n.on,"jobs:",` ${n.workflow}:`," permissions:",...n.permissions.map(o=>` ${o}`),` uses: ${t}/${n.workflow}.yml@v1`," secrets: inherit",""].join(`
|
|
35
|
+
`)}r(c,"renderCaller");function p(e){const n=["ci","cd","version-update"];return e?.features?.backupD1===!0&&n.push("backup-d1"),n.map(o=>({path:`.github/workflows/${s[o].file}`,content:c(o)}))}r(p,"callersFor");function l(e){const n=e.replace(/^.*\//,"").replace(/\.ya?ml$/,"");return{"continuous-integration":"ci",ci:"ci","worker-ci":"ci","continuous-deployment":"cd",cd:"cd",deploy:"cd","worker-cd":"cd","scheduled-version-update":"version-update","version-update":"version-update","backup-d1":"backup-d1","backup-main":"backup-main","upstream-sync":"upstream-sync"}[n]??null}r(l,"callerKindForFile");function d(e){return s[e].file}r(d,"callerFile");export{t as WORKFLOW_REF,u as WORKFLOW_TAG,d as callerFile,l as callerKindForFile,p as callersFor,c as renderCaller};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/workflow-callers.ts"],
|
|
4
|
-
"sourcesContent": ["import type { FamilyManifest } from '@rexezuge/tooling/manifest';\n\n/**\n * The SDK's reusable workflows, which a consumer calls instead of copying (RFC 0001, \"Repo workflows\").\n * They
|
|
5
|
-
"mappings": "+EAMO,MAAMA,EAAe,mDACfC,EAAe,
|
|
6
|
-
"names": ["WORKFLOW_REF", "WORKFLOW_TAG", "SPECS", "renderCaller", "kind", "spec", "
|
|
4
|
+
"sourcesContent": ["import type { FamilyManifest } from '@rexezuge/tooling/manifest';\n\n/**\n * The SDK's reusable workflows, which a consumer calls instead of copying (RFC 0001, \"Repo workflows\").\n * They live in the SDK's `.github/workflows` and the owner moves the `v1` tag after each release.\n */\nexport const WORKFLOW_REF = 'Rexezuge-CloudflareWorkers/SDK/.github/workflows';\nexport const WORKFLOW_TAG = 'v1';\n\nexport type CallerKind = 'ci' | 'cd' | 'version-update' | 'backup-d1' | 'backup-main' | 'upstream-sync';\n\ninterface CallerSpec {\n readonly file: string;\n readonly workflow: string;\n readonly name: string;\n readonly on: string;\n /**\n What the called workflow's jobs need. A reusable workflow can only narrow the caller's token, never widen it.\n */\n readonly permissions: readonly string[];\n}\n\nconst SPECS: Record<CallerKind, CallerSpec> = {\n ci: {\n file: 'continuous-integration.yml',\n workflow: 'worker-ci',\n name: 'Continuous Integration',\n on: 'on:\\n push:\\n branches: [main]\\n pull_request:\\n repository_dispatch:\\n types: [upstream-sync]\\n workflow_dispatch:\\n',\n // contents + pull-requests write: the Dependabot auto-merge job; contents write: the upstream-sync deploy dispatch.\n permissions: ['contents: write', 'pull-requests: write'],\n },\n cd: {\n file: 'continuous-deployment.yml',\n workflow: 'worker-cd',\n name: 'Continuous Deployment',\n on: \"on:\\n workflow_run:\\n workflows: ['Continuous Integration']\\n types: [completed]\\n branches: [main]\\n repository_dispatch:\\n types: [upstream-sync]\\n workflow_dispatch:\\n\",\n permissions: ['contents: read'],\n },\n 'version-update': {\n file: 'scheduled-version-update.yml',\n workflow: 'version-update',\n name: 'Scheduled Version Update',\n on: \"on:\\n schedule:\\n - cron: '0 0 1,15 * *'\\n workflow_dispatch:\\n\",\n permissions: ['contents: write'],\n },\n 'backup-d1': {\n file: 'backup-d1.yml',\n workflow: 'backup-d1',\n name: 'Backup D1',\n on: \"on:\\n schedule:\\n - cron: '15 4 * * *'\\n workflow_dispatch:\\n\",\n permissions: ['contents: read'],\n },\n 'backup-main': {\n file: 'backup-main.yml',\n workflow: 'backup-main',\n name: 'Backup Main',\n on: \"on:\\n push:\\n branches: [main]\\n schedule:\\n - cron: '0 0 5 * *'\\n\",\n permissions: ['contents: read'],\n },\n 'upstream-sync': {\n file: 'upstream-sync.yml',\n workflow: 'upstream-sync',\n name: 'Upstream Sync',\n on: \"on:\\n schedule:\\n - cron: '17 2 * * 1'\\n workflow_dispatch:\\n\",\n permissions: ['contents: write'],\n },\n};\n\n/**\n * A caller workflow: the whole file is one `uses:` of the SDK's reusable workflow with the repo's secrets.\n * Inputs (`with:`) are the repo's to add; `rexezuge sync` replaces a workflow that is not a caller and leaves one that is.\n */\nexport function renderCaller(kind: CallerKind): string {\n const spec = SPECS[kind];\n return [\n `# A thin caller: the pipeline lives in ${WORKFLOW_REF}/${spec.workflow}.yml (tag ${WORKFLOW_TAG}).`,\n `# Jobs switch on .rexezuge.jsonc features; change behaviour there or in the SDK, not here.`,\n `name: ${spec.name}\\n`,\n spec.on,\n 'jobs:',\n ` ${spec.workflow}:`,\n ' permissions:',\n ...spec.permissions.map((permission) => ` ${permission}`),\n ` uses: ${WORKFLOW_REF}/${spec.workflow}.yml@${WORKFLOW_TAG}`,\n ' secrets: inherit',\n '',\n ].join('\\n');\n}\n\n/**\n * The callers a repo with these features carries: CI, CD and the version bump always; the nightly D1 backup with `backupD1`.\n */\nexport function callersFor(manifest: FamilyManifest | null): Array<{ path: string; content: string }> {\n const kinds: CallerKind[] = ['ci', 'cd', 'version-update'];\n if (manifest?.features?.backupD1 === true) kinds.push('backup-d1');\n return kinds.map((kind) => ({ path: `.github/workflows/${SPECS[kind].file}`, content: renderCaller(kind) }));\n}\n\n/**\n * Which caller replaces a workflow file, by the file name a consumer repo uses. Unknown names return null:\n * a workflow the family has no equivalent for is the repo's own and is never replaced.\n */\nexport function callerKindForFile(file: string): CallerKind | null {\n const base = file.replace(/^.*\\//, '').replace(/\\.ya?ml$/, '');\n const table: Record<string, CallerKind> = {\n 'continuous-integration': 'ci',\n ci: 'ci',\n 'worker-ci': 'ci',\n 'continuous-deployment': 'cd',\n cd: 'cd',\n deploy: 'cd',\n 'worker-cd': 'cd',\n 'scheduled-version-update': 'version-update',\n 'version-update': 'version-update',\n 'backup-d1': 'backup-d1',\n 'backup-main': 'backup-main',\n 'upstream-sync': 'upstream-sync',\n };\n return table[base] ?? null;\n}\n\nexport function callerFile(kind: CallerKind): string {\n return SPECS[kind].file;\n}\n"],
|
|
5
|
+
"mappings": "+EAMO,MAAMA,EAAe,mDACfC,EAAe,KAetBC,EAAwC,CAC5C,GAAI,CACF,KAAM,6BACN,SAAU,YACV,KAAM,yBACN,GAAI;;;;;;;EAEJ,YAAa,CAAC,kBAAmB,sBAAsB,GAEzD,GAAI,CACF,KAAM,4BACN,SAAU,YACV,KAAM,wBACN,GAAI;;;;;;;;EACJ,YAAa,CAAC,gBAAgB,GAEhC,iBAAkB,CAChB,KAAM,+BACN,SAAU,iBACV,KAAM,2BACN,GAAI;;;;EACJ,YAAa,CAAC,iBAAiB,GAEjC,YAAa,CACX,KAAM,gBACN,SAAU,YACV,KAAM,YACN,GAAI;;;;EACJ,YAAa,CAAC,gBAAgB,GAEhC,cAAe,CACb,KAAM,kBACN,SAAU,cACV,KAAM,cACN,GAAI;;;;;EACJ,YAAa,CAAC,gBAAgB,GAEhC,gBAAiB,CACf,KAAM,oBACN,SAAU,gBACV,KAAM,gBACN,GAAI;;;;EACJ,YAAa,CAAC,iBAAiB,IAQ7B,SAAUC,EAAaC,EAAgB,CAC3C,MAAMC,EAAOH,EAAME,CAAI,EACvB,MAAO,CACL,0CAA0CJ,CAAY,IAAIK,EAAK,QAAQ,iBACvE,6FACA,SAASA,EAAK,IAAI;EAClBA,EAAK,GACL,QACA,KAAKA,EAAK,QAAQ,IAClB,mBACA,GAAGA,EAAK,YAAY,IAAKC,GAAe,SAASA,CAAU,EAAE,EAC7D,aAAaN,CAAY,IAAIK,EAAK,QAAQ,UAC1C,uBACA,IACA,KAAK;CAAI,CACb,CAfgBE,EAAAJ,EAAA,gBAoBV,SAAUK,EAAWC,EAA+B,CACxD,MAAMC,EAAsB,CAAC,KAAM,KAAM,gBAAgB,EACzD,OAAID,GAAU,UAAU,WAAa,IAAMC,EAAM,KAAK,WAAW,EAC1DA,EAAM,IAAKN,IAAU,CAAE,KAAM,qBAAqBF,EAAME,CAAI,EAAE,IAAI,GAAI,QAASD,EAAaC,CAAI,CAAC,EAAG,CAC7G,CAJgBG,EAAAC,EAAA,cAUV,SAAUG,EAAkBC,EAAY,CAC5C,MAAMC,EAAOD,EAAK,QAAQ,QAAS,EAAE,EAAE,QAAQ,WAAY,EAAE,EAe7D,MAd0C,CACxC,yBAA0B,KAC1B,GAAI,KACJ,YAAa,KACb,wBAAyB,KACzB,GAAI,KACJ,OAAQ,KACR,YAAa,KACb,2BAA4B,iBAC5B,iBAAkB,iBAClB,YAAa,YACb,cAAe,cACf,gBAAiB,iBAENC,CAAI,GAAK,IACxB,CAjBgBN,EAAAI,EAAA,qBAmBV,SAAUG,EAAWV,EAAgB,CACzC,OAAOF,EAAME,CAAI,EAAE,IACrB,CAFgBG,EAAAO,EAAA",
|
|
6
|
+
"names": ["WORKFLOW_REF", "WORKFLOW_TAG", "SPECS", "renderCaller", "kind", "spec", "permission", "__name", "callersFor", "manifest", "kinds", "callerKindForFile", "file", "base", "callerFile"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rexezuge/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.15.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -32,13 +32,14 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"jsonc-parser": "3.3.1",
|
|
35
|
-
"@rexezuge/
|
|
36
|
-
"@rexezuge/
|
|
35
|
+
"@rexezuge/identity": "1.15.0",
|
|
36
|
+
"@rexezuge/tooling": "1.15.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/node": "26.6.4",
|
|
40
40
|
"typescript": "6.0.3",
|
|
41
|
-
"vitest": "4.1.11"
|
|
41
|
+
"vitest": "4.1.11",
|
|
42
|
+
"yaml": "2.9.1"
|
|
42
43
|
},
|
|
43
44
|
"description": "The rexezuge command line: family scripts, doctor (conformance score) and sync (auto-fix) for Rexezuge-CloudflareWorkers repos. Dev-only.",
|
|
44
45
|
"scripts": {
|