lurqrun 0.1.6 → 0.1.7
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 +18 -10
- package/dist/auditHandler-JCOJSUYW.js +23 -0
- package/dist/bin/lurq.js +3090 -23306
- package/dist/browserAuth-B6G27USY.js +95 -0
- package/dist/cache-DKI34SVS.js +12 -0
- package/dist/check-2FDGUOV7.js +192 -0
- package/dist/checkUpgrade-F2WESBPM.js +103 -0
- package/dist/chunk-2VMOWSRY.js +300 -0
- package/dist/chunk-3GHJR7XR.js +2049 -0
- package/dist/chunk-3N3Q3DSW.js +214 -0
- package/dist/chunk-4ESO33J6.js +34 -0
- package/dist/chunk-4F7ZESPO.js +132 -0
- package/dist/chunk-4KCPOMG6.js +68 -0
- package/dist/chunk-4ZYCIMY4.js +155 -0
- package/dist/chunk-63MUJNZL.js +318 -0
- package/dist/chunk-6AAEVQ7I.js +6336 -0
- package/dist/chunk-6EQ3ARXA.js +304 -0
- package/dist/chunk-6L3U7DZ5.js +23 -0
- package/dist/chunk-AHBP533R.js +220 -0
- package/dist/chunk-B43LCXBM.js +223 -0
- package/dist/chunk-BCANRN5B.js +33 -0
- package/dist/chunk-BUALU27S.js +123 -0
- package/dist/chunk-BULZAX2U.js +1554 -0
- package/dist/chunk-BV32UNLL.js +154 -0
- package/dist/chunk-C6GLE626.js +160 -0
- package/dist/chunk-CIDWNUAP.js +145 -0
- package/dist/chunk-CUP36ND3.js +2126 -0
- package/dist/chunk-CW5HJ3LX.js +96 -0
- package/dist/chunk-DB2VF5UD.js +315 -0
- package/dist/chunk-DWAGCNEL.js +210 -0
- package/dist/chunk-EA3DP5HG.js +293 -0
- package/dist/chunk-ELGCAM7P.js +184 -0
- package/dist/chunk-FW6BD2NO.js +1915 -0
- package/dist/chunk-GE37NVLN.js +15 -0
- package/dist/chunk-GPTKSNR6.js +171 -0
- package/dist/chunk-GRJXQBQZ.js +793 -0
- package/dist/chunk-HWBBVLOT.js +92 -0
- package/dist/chunk-I2JUKN6Z.js +24 -0
- package/dist/chunk-I3M2KJXB.js +56 -0
- package/dist/chunk-IQ4SDKKY.js +733 -0
- package/dist/chunk-J5FZYN4A.js +116 -0
- package/dist/chunk-L6N4JFW2.js +263 -0
- package/dist/chunk-LBFGSSF2.js +126 -0
- package/dist/chunk-LEGPB7DO.js +81 -0
- package/dist/chunk-LO35HLQZ.js +219 -0
- package/dist/chunk-LRD4GBYE.js +73 -0
- package/dist/chunk-LUAKDHLZ.js +40 -0
- package/dist/chunk-LYMPYETA.js +965 -0
- package/dist/chunk-M6NYEXCW.js +38 -0
- package/dist/chunk-MHUEVBVO.js +35 -0
- package/dist/chunk-MYGSLK44.js +37 -0
- package/dist/chunk-NH5I4KHH.js +201 -0
- package/dist/chunk-OQS4GUSI.js +1391 -0
- package/dist/chunk-PSX3GIAN.js +176 -0
- package/dist/chunk-Q5VPF4WI.js +26 -0
- package/dist/chunk-QKGYDMWB.js +7409 -0
- package/dist/chunk-QSL6QN5X.js +115 -0
- package/dist/chunk-SHCEBP3J.js +107 -0
- package/dist/chunk-SJOVFF7B.js +201 -0
- package/dist/chunk-ST2X2GYN.js +373 -0
- package/dist/chunk-TNTXWSYA.js +19 -0
- package/dist/chunk-U5AT3TD4.js +2128 -0
- package/dist/chunk-UDVNA7EA.js +483 -0
- package/dist/chunk-VL2E5T2A.js +109 -0
- package/dist/chunk-VLRHFMGJ.js +58 -0
- package/dist/chunk-WHX2ZFCG.js +4048 -0
- package/dist/chunk-WQ23REYT.js +37 -0
- package/dist/chunk-XBIDMHSK.js +15425 -0
- package/dist/chunk-Y5GI7RL3.js +66 -0
- package/dist/client-IRKAMDYZ.js +15 -0
- package/dist/commands-FIL5ET6P.js +911 -0
- package/dist/compat-R3UTFQ5Q.js +201 -0
- package/dist/dashboardIssue-WYYMBFIB.js +192 -0
- package/dist/diff-GZA2774U.js +13 -0
- package/dist/dist-4XXIXHHZ.js +12945 -0
- package/dist/e2b-FVPHDULZ.js +172 -0
- package/dist/extract-NKGKLIVT.js +444 -0
- package/dist/fetch-QYTUJVG2.js +22 -0
- package/dist/firstTouch-QQTJH4QX.js +55 -0
- package/dist/handlers-GEJAVZDK.js +53 -0
- package/dist/http-ETPYMBGD.js +5360 -0
- package/dist/ingestQueue-VKN4KBIF.js +35 -0
- package/dist/install-EK3W2COX.js +20 -0
- package/dist/installSkill-VQJWJVCL.js +52 -0
- package/dist/inventory-5AWSLJYU.js +31 -0
- package/dist/local-XPZMRH5R.js +13 -0
- package/dist/mcp-3JHD5SUZ.js +472 -0
- package/dist/mcpHandlers-QFN4MCFL.js +22 -0
- package/dist/mcpScan-QZHWENIP.js +1871 -0
- package/dist/mcpScanWorkflow-JPYCBGC4.js +81 -0
- package/dist/mcpStack-BYJCZNIV.js +20 -0
- package/dist/packages-THVFMWFP.js +42 -0
- package/dist/plan-V4OEI3J4.js +463 -0
- package/dist/planView-JRXGCG2N.js +79 -0
- package/dist/policy-3P6BGRDN.js +115 -0
- package/dist/references-6N7VEPHT.js +14 -0
- package/dist/release-4U4ABNSJ.js +128 -0
- package/dist/remote-YGCXYI4V.js +32 -0
- package/dist/reportRuns-CKQQYLY4.js +64 -0
- package/dist/sandbox-MEZLAODF.js +39 -0
- package/dist/server-KFUD5X57.js +55 -0
- package/dist/surface-V62GE554.js +141 -0
- package/dist/surface-YL6O67W3.js +36 -0
- package/dist/surfaceHandlers-X2IZKA3E.js +20 -0
- package/dist/typecheck-X7U5ELMR.js +268 -0
- package/dist/types-M5JP2W3D.js +10 -0
- package/dist/uninstall-P7RGBX6G.js +174 -0
- package/dist/upgrade-NQ5IWFZB.js +596 -0
- package/dist/upgradePlan-A4LRKLEG.js +146 -0
- package/dist/userConfig-Z3GQE776.js +20 -0
- package/dist/watch-DGFMWUDL.js +214 -0
- package/package.json +26 -21
- package/templates/agent-rules.md +4 -4
- package/templates/skill-instructions.md +13 -14
- package/dist/bin/lurq.js.map +0 -1
- package/dist/index.d.ts +0 -805
- package/dist/index.js +0 -23570
- package/dist/index.js.map +0 -1
- package/drizzle/0000_confused_fabian_cortez.sql +0 -54
- package/drizzle/0001_aspiring_timeslip.sql +0 -15
- package/drizzle/0002_lyrical_lila_cheney.sql +0 -14
- package/drizzle/0003_violet_giant_girl.sql +0 -14
- package/drizzle/0004_slim_valeria_richards.sql +0 -15
- package/drizzle/0005_petite_luke_cage.sql +0 -12
- package/drizzle/0006_calm_nighthawk.sql +0 -3
- package/drizzle/0007_slimy_naoko.sql +0 -1
- package/drizzle/0008_peaceful_tigra.sql +0 -1
- package/drizzle/0009_smooth_harrier.sql +0 -10
- package/drizzle/0010_curved_amphibian.sql +0 -2
- package/drizzle/0011_compat_provenance_closures.sql +0 -11
- package/drizzle/0012_api_surfaces.sql +0 -9
- package/drizzle/0013_nice_thanos.sql +0 -1
- package/drizzle/0014_luxuriant_malcolm_colcord.sql +0 -10
- package/drizzle/0015_past_fat_cobra.sql +0 -11
- package/drizzle/0016_futuristic_junta.sql +0 -50
- package/drizzle/0017_absent_grandmaster.sql +0 -20
- package/drizzle/0018_rainy_proemial_gods.sql +0 -1
- package/drizzle/0019_dashing_korvac.sql +0 -11
- package/drizzle/0020_normal_vulture.sql +0 -3
- package/drizzle/0021_dazzling_blue_shield.sql +0 -17
- package/drizzle/0022_massive_ghost_rider.sql +0 -24
- package/drizzle/0023_next_shatterstar.sql +0 -1
- package/drizzle/0024_dusty_maelstrom.sql +0 -15
- package/drizzle/0025_gifted_harpoon.sql +0 -5
- package/drizzle/0026_awesome_mordo.sql +0 -1
- package/drizzle/0027_charming_ulik.sql +0 -2
- package/drizzle/0028_romantic_loners.sql +0 -2
- package/drizzle/0029_busy_korvac.sql +0 -16
- package/drizzle/0030_steady_mathemanic.sql +0 -6
- package/drizzle/0031_redundant_maginty.sql +0 -2
- package/drizzle/0032_stack_resolutions.sql +0 -14
- package/drizzle/0033_graceful_tyger_tiger.sql +0 -3
- package/drizzle/0034_uneven_thunderbird.sql +0 -1
- package/drizzle/0035_api_key_scopes.sql +0 -1
- package/drizzle/0036_policy_audit.sql +0 -21
- package/drizzle/0037_subscription_seats.sql +0 -1
- package/drizzle/0038_symbol_offsets.sql +0 -2
- package/drizzle/0039_mcp_runtime_scans.sql +0 -80
- package/drizzle/0040_subscription_overage_and_interval.sql +0 -4
- package/drizzle/0041_account_email.sql +0 -38
- package/drizzle/0042_alert_channels.sql +0 -21
- package/drizzle/meta/0000_snapshot.json +0 -370
- package/drizzle/meta/0001_snapshot.json +0 -482
- package/drizzle/meta/0002_snapshot.json +0 -575
- package/drizzle/meta/0003_snapshot.json +0 -667
- package/drizzle/meta/0004_snapshot.json +0 -769
- package/drizzle/meta/0005_snapshot.json +0 -864
- package/drizzle/meta/0006_snapshot.json +0 -882
- package/drizzle/meta/0007_snapshot.json +0 -876
- package/drizzle/meta/0008_snapshot.json +0 -882
- package/drizzle/meta/0009_snapshot.json +0 -948
- package/drizzle/meta/0010_snapshot.json +0 -969
- package/drizzle/meta/0011_snapshot.json +0 -1049
- package/drizzle/meta/0012_snapshot.json +0 -1115
- package/drizzle/meta/0013_snapshot.json +0 -1121
- package/drizzle/meta/0014_snapshot.json +0 -1190
- package/drizzle/meta/0015_snapshot.json +0 -1280
- package/drizzle/meta/0016_snapshot.json +0 -1683
- package/drizzle/meta/0017_snapshot.json +0 -1834
- package/drizzle/meta/0018_snapshot.json +0 -1834
- package/drizzle/meta/0019_snapshot.json +0 -1909
- package/drizzle/meta/0020_snapshot.json +0 -1921
- package/drizzle/meta/0021_snapshot.json +0 -2045
- package/drizzle/meta/0022_snapshot.json +0 -2246
- package/drizzle/meta/0023_snapshot.json +0 -2252
- package/drizzle/meta/0024_snapshot.json +0 -2375
- package/drizzle/meta/0025_snapshot.json +0 -2407
- package/drizzle/meta/0026_snapshot.json +0 -2413
- package/drizzle/meta/0027_snapshot.json +0 -2425
- package/drizzle/meta/0028_snapshot.json +0 -2438
- package/drizzle/meta/0029_snapshot.json +0 -2546
- package/drizzle/meta/0030_snapshot.json +0 -2586
- package/drizzle/meta/0031_snapshot.json +0 -2598
- package/drizzle/meta/0032_snapshot.json +0 -2699
- package/drizzle/meta/0033_snapshot.json +0 -2712
- package/drizzle/meta/0034_snapshot.json +0 -2719
- package/drizzle/meta/0035_snapshot.json +0 -2726
- package/drizzle/meta/0036_snapshot.json +0 -2876
- package/drizzle/meta/0037_snapshot.json +0 -2883
- package/drizzle/meta/0038_snapshot.json +0 -2895
- package/drizzle/meta/0039_snapshot.json +0 -3501
- package/drizzle/meta/0040_snapshot.json +0 -3527
- package/drizzle/meta/0041_snapshot.json +0 -3824
- package/drizzle/meta/0042_snapshot.json +0 -3960
- package/drizzle/meta/_journal.json +0 -307
- package/src/data/seed.json +0 -253
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { createRequire as __lurqCreateRequire } from 'node:module'; const require = __lurqCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
PACKAGE_NAME,
|
|
4
|
+
VERSION
|
|
5
|
+
} from "./chunk-GPTKSNR6.js";
|
|
6
|
+
import {
|
|
7
|
+
init_esm_shims
|
|
8
|
+
} from "./chunk-I3M2KJXB.js";
|
|
9
|
+
|
|
10
|
+
// src/github/workflow.ts
|
|
11
|
+
init_esm_shims();
|
|
12
|
+
var WORKFLOW_PATH = ".github/workflows/lurq-upgrade.yml";
|
|
13
|
+
function cliSpec(version = VERSION) {
|
|
14
|
+
const [major = "0", minor = "0"] = version.split(".");
|
|
15
|
+
return major === "0" ? `${PACKAGE_NAME}@${major}.${minor}` : `${PACKAGE_NAME}@${major}`;
|
|
16
|
+
}
|
|
17
|
+
var DEFAULT_CRON = "0 6 * * 1";
|
|
18
|
+
function detectInstallCommand(lockfiles) {
|
|
19
|
+
if (lockfiles.includes("pnpm-lock.yaml")) return "pnpm install --frozen-lockfile";
|
|
20
|
+
if (lockfiles.includes("yarn.lock")) return "yarn install --frozen-lockfile";
|
|
21
|
+
if (lockfiles.includes("bun.lockb") || lockfiles.includes("bun.lock")) return "bun install";
|
|
22
|
+
if (lockfiles.includes("package-lock.json")) return "npm ci";
|
|
23
|
+
return "npm install";
|
|
24
|
+
}
|
|
25
|
+
function renderWorkflow(opts = {}) {
|
|
26
|
+
const cron = opts.cron ?? DEFAULT_CRON;
|
|
27
|
+
const install = opts.installCommand ?? "npm ci";
|
|
28
|
+
const max = opts.maxUpgrades ?? 3;
|
|
29
|
+
const mode = opts.armed ? "pr" : "comment";
|
|
30
|
+
const autoMerge = opts.autoMerge ?? false;
|
|
31
|
+
const cli = cliSpec();
|
|
32
|
+
return `# Managed by lurq, https://lurq.run
|
|
33
|
+
#
|
|
34
|
+
# Keeps this repository's dependencies current and rewrites the call sites an
|
|
35
|
+
# upgrade breaks. lurq itself has read-only access to your code; every write
|
|
36
|
+
# below is made by this workflow's own GITHUB_TOKEN, scoped by the permissions
|
|
37
|
+
# block. Delete this file to turn the autopilot off.
|
|
38
|
+
name: lurq upgrade
|
|
39
|
+
|
|
40
|
+
on:
|
|
41
|
+
schedule:
|
|
42
|
+
- cron: "${cron}"
|
|
43
|
+
workflow_dispatch:
|
|
44
|
+
inputs:
|
|
45
|
+
mode:
|
|
46
|
+
description: "comment = analyse only \xB7 pr = open pull requests"
|
|
47
|
+
type: choice
|
|
48
|
+
options: [comment, pr]
|
|
49
|
+
default: ${mode}
|
|
50
|
+
|
|
51
|
+
# The blast radius. \`contents: write\` permits pushing a BRANCH; branch
|
|
52
|
+
# protection on your default branch is what stops anything landing unreviewed.
|
|
53
|
+
permissions:
|
|
54
|
+
contents: write
|
|
55
|
+
pull-requests: write
|
|
56
|
+
|
|
57
|
+
concurrency:
|
|
58
|
+
group: lurq-upgrade-\${{ github.ref }}
|
|
59
|
+
cancel-in-progress: true
|
|
60
|
+
|
|
61
|
+
jobs:
|
|
62
|
+
upgrade:
|
|
63
|
+
runs-on: ubuntu-latest
|
|
64
|
+
env:
|
|
65
|
+
LURQ_MODE: \${{ inputs.mode || vars.LURQ_MODE || '${mode}' }}
|
|
66
|
+
MAX_UPGRADES: "${max}"
|
|
67
|
+
steps:
|
|
68
|
+
- uses: actions/checkout@v6
|
|
69
|
+
|
|
70
|
+
- uses: actions/setup-node@v4
|
|
71
|
+
with:
|
|
72
|
+
node-version: 22
|
|
73
|
+
|
|
74
|
+
# 1. What is behind, and what does each upgrade remove from its API?
|
|
75
|
+
# Sends only the dependency ranges already public in package.json.
|
|
76
|
+
- name: Plan
|
|
77
|
+
env:
|
|
78
|
+
LURQ_API_KEY: \${{ secrets.LURQ_API_KEY }}
|
|
79
|
+
run: npx -y ${cli} upgrade-plan . --json > lurq-plan.json
|
|
80
|
+
|
|
81
|
+
# 2. Narrow that to symbols THIS repo references. Runs entirely locally
|
|
82
|
+
# against both versions' npm tarballs, no API key, no test suite.
|
|
83
|
+
#
|
|
84
|
+
# \`--report\` is the only part that talks to us, and it is additive: it
|
|
85
|
+
# posts what this check concluded so your dashboard can show it. A
|
|
86
|
+
# missing key or an unreachable API prints a line and changes nothing
|
|
87
|
+
# else, so the gate keeps working exactly as it does without it.
|
|
88
|
+
- name: Check against this codebase
|
|
89
|
+
env:
|
|
90
|
+
LURQ_API_KEY: \${{ secrets.LURQ_API_KEY }}
|
|
91
|
+
run: npx -y ${cli} check-upgrade . --plan lurq-plan.json --report --json > lurq-brief.json
|
|
92
|
+
|
|
93
|
+
# The same report twice: once into the run summary, once as the body of
|
|
94
|
+
# the pull request. Fenced, because the report is aligned plain text and
|
|
95
|
+
# markdown would otherwise collapse its indentation into one paragraph.
|
|
96
|
+
- name: Summarise
|
|
97
|
+
run: |
|
|
98
|
+
npx -y ${cli} check-upgrade . --plan lurq-plan.json > lurq-report.txt
|
|
99
|
+
{ echo '\`\`\`'; cat lurq-report.txt; echo '\`\`\`'; } > lurq-report.md
|
|
100
|
+
cat lurq-report.md >> "\${GITHUB_STEP_SUMMARY}"
|
|
101
|
+
|
|
102
|
+
# 3. Editing is opt-in. Until LURQ_MODE is 'pr', the job stops here having
|
|
103
|
+
# changed nothing, the brief is in the run summary above, and no
|
|
104
|
+
# Anthropic credential is needed to get this far.
|
|
105
|
+
- name: Check agent credentials
|
|
106
|
+
if: env.LURQ_MODE == 'pr'
|
|
107
|
+
env:
|
|
108
|
+
API_KEY: \${{ secrets.ANTHROPIC_API_KEY }}
|
|
109
|
+
OAUTH_TOKEN: \${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
|
110
|
+
run: |
|
|
111
|
+
if [ -z "$API_KEY" ] && [ -z "$OAUTH_TOKEN" ]; then
|
|
112
|
+
echo "::error::pr mode needs one of ANTHROPIC_API_KEY or CLAUDE_CODE_OAUTH_TOKEN in this repository's secrets. A Claude Pro/Max subscription token works for the latter. Set LURQ_MODE=comment to run analysis only."
|
|
113
|
+
exit 1
|
|
114
|
+
fi
|
|
115
|
+
|
|
116
|
+
- name: Install dependencies
|
|
117
|
+
if: env.LURQ_MODE == 'pr'
|
|
118
|
+
run: ${install}
|
|
119
|
+
|
|
120
|
+
- name: Apply upgrades
|
|
121
|
+
if: env.LURQ_MODE == 'pr'
|
|
122
|
+
uses: anthropics/claude-code-action@v1
|
|
123
|
+
with:
|
|
124
|
+
# Either credential works; set whichever you have. An API key bills
|
|
125
|
+
# per token, an OAuth token uses an existing Claude Pro/Max plan.
|
|
126
|
+
# Unset secrets resolve to empty and are ignored by the action.
|
|
127
|
+
anthropic_api_key: \${{ secrets.ANTHROPIC_API_KEY }}
|
|
128
|
+
claude_code_oauth_token: \${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
|
129
|
+
prompt: |
|
|
130
|
+
REPO: \${{ github.repository }}
|
|
131
|
+
|
|
132
|
+
lurq-brief.json lists dependency upgrades this repository is behind
|
|
133
|
+
on. For each entry under "breaking", the "symbolsRemoved" array names
|
|
134
|
+
exports that DISAPPEAR at the target version, and each carries the
|
|
135
|
+
exact file and line where this repository uses it.
|
|
136
|
+
|
|
137
|
+
lurq-plan.json carries two more things per upgrade:
|
|
138
|
+
\xB7 "declaredIn", EVERY package.json declaring that dependency.
|
|
139
|
+
Bump all of them. Bumping only the root leaves a workspace
|
|
140
|
+
pinned to the old major, which typechecks and breaks on install.
|
|
141
|
+
\xB7 "hops", the migration sequence when the upgrade crosses two or
|
|
142
|
+
more majors, with what each step removes. Work the steps in
|
|
143
|
+
order; do not jump straight to the target version. When
|
|
144
|
+
"sequenceNote" is present, the sequence could not be planned,
|
|
145
|
+
treat that dependency as a migration and skip it.
|
|
146
|
+
|
|
147
|
+
Take at most \${{ env.MAX_UPGRADES }} entries, hardest first:
|
|
148
|
+
|
|
149
|
+
1. Bump the dependency's range in every manifest listed in
|
|
150
|
+
"declaredIn".
|
|
151
|
+
2. Run \`${install.split(" ")[0]} install\` so node_modules holds the
|
|
152
|
+
TARGET version. Until you do, the package on disk is the old one
|
|
153
|
+
and anything you read from it describes the API you are leaving.
|
|
154
|
+
3. Rewrite every listed call site. A removed symbol carrying
|
|
155
|
+
"renamedTo" has a replacement the package itself proves: at the
|
|
156
|
+
old version both names were exported from the same function, so
|
|
157
|
+
rename the call. Under "arityChanged", "callsBroken" names each
|
|
158
|
+
call whose argument count the new version no longer accepts, and
|
|
159
|
+
"unmeasured" names uses to read by hand. "typeErrors" lists the
|
|
160
|
+
compiler errors the new version introduces, at file and line;
|
|
161
|
+
after installing, \`tsc\` should report none of them.
|
|
162
|
+
"entriesRemoved" names deep imports the new version no longer
|
|
163
|
+
offers, and "moduleFormat" names require() uses that break
|
|
164
|
+
because the package is now an ES module. "requirements" names a
|
|
165
|
+
Node or peer version the new release needs and this repository
|
|
166
|
+
lacks: do not bump past it. For removed symbols
|
|
167
|
+
without "renamedTo", "newExports" on each entry names
|
|
168
|
+
the exports the target version ADDED, extracted from its shipped
|
|
169
|
+
JavaScript: that is where the replacement for a removed symbol
|
|
170
|
+
comes from. Confirm each one against the freshly installed package
|
|
171
|
+
under node_modules before you call it. You have NO network access
|
|
172
|
+
and no documentation: an API in neither the brief nor node_modules
|
|
173
|
+
is one you cannot verify, and writing it anyway is the failure
|
|
174
|
+
this whole job exists to prevent. Revert that dependency instead.
|
|
175
|
+
4. Run the repository's test script. If it fails and you cannot fix
|
|
176
|
+
it from the upgrade itself, revert that dependency and move on,
|
|
177
|
+
a reverted upgrade is a fine outcome, a broken build is not.
|
|
178
|
+
5. Leave the working tree with only the upgrades that pass.
|
|
179
|
+
|
|
180
|
+
Do not touch unrelated files. Do not change CI configuration. Do not
|
|
181
|
+
run git commands: the workflow handles version control.
|
|
182
|
+
claude_args: |
|
|
183
|
+
--allowedTools "Read,Edit,Write,Bash(${install.split(" ")[0]}:*)"
|
|
184
|
+
|
|
185
|
+
# 4. The workflow does version control, never the model.
|
|
186
|
+
- name: Open pull request
|
|
187
|
+
id: pr
|
|
188
|
+
if: env.LURQ_MODE == 'pr'
|
|
189
|
+
uses: peter-evans/create-pull-request@v7
|
|
190
|
+
with:
|
|
191
|
+
branch: lurq/upgrades
|
|
192
|
+
title: "chore(deps): lurq dependency upgrades"
|
|
193
|
+
commit-message: "chore(deps): upgrade dependencies and migrate call sites"
|
|
194
|
+
# The rendered report, not the raw JSON. A reviewer opening this PR
|
|
195
|
+
# reads what was removed and where it is used; the JSON is the agent's
|
|
196
|
+
# input, and pasting it here made the case for the change unreadable.
|
|
197
|
+
body-path: lurq-report.md
|
|
198
|
+
labels: dependencies
|
|
199
|
+
delete-branch: true
|
|
200
|
+
${autoMerge ? MERGE_STEP : ""}`;
|
|
201
|
+
}
|
|
202
|
+
var MERGE_STEP = `
|
|
203
|
+
# 5. Auto-merge, per this repository's lurq policy. GitHub merges only
|
|
204
|
+
# once the repo's OWN required checks pass; lurq never makes that call.
|
|
205
|
+
# Requires "Allow auto-merge" in repository settings.
|
|
206
|
+
- name: Enable auto-merge
|
|
207
|
+
if: env.LURQ_MODE == 'pr' && steps.pr.outputs.pull-request-number
|
|
208
|
+
env:
|
|
209
|
+
GH_TOKEN: \${{ secrets.GITHUB_TOKEN }}
|
|
210
|
+
run: gh pr merge --auto --squash "\${{ steps.pr.outputs.pull-request-number }}"
|
|
211
|
+
`;
|
|
212
|
+
function newFileUrl(fullName, branch, content) {
|
|
213
|
+
const params = new URLSearchParams({ filename: WORKFLOW_PATH, value: content });
|
|
214
|
+
return `https://github.com/${fullName}/new/${encodeURIComponent(branch)}?${params.toString()}`;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export {
|
|
218
|
+
WORKFLOW_PATH,
|
|
219
|
+
cliSpec,
|
|
220
|
+
detectInstallCommand,
|
|
221
|
+
renderWorkflow,
|
|
222
|
+
newFileUrl
|
|
223
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { createRequire as __lurqCreateRequire } from 'node:module'; const require = __lurqCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
init_esm_shims
|
|
4
|
+
} from "./chunk-I3M2KJXB.js";
|
|
5
|
+
|
|
6
|
+
// src/github/types.ts
|
|
7
|
+
init_esm_shims();
|
|
8
|
+
var DEFAULT_REPO_POLICY = {
|
|
9
|
+
enabled: false,
|
|
10
|
+
scope: "blocking",
|
|
11
|
+
autoMerge: false
|
|
12
|
+
};
|
|
13
|
+
var UPGRADE_SEVERITIES = ["blocking", "warning", "ok", "unverified"];
|
|
14
|
+
var UPGRADE_RUN_STATUSES = [
|
|
15
|
+
"checked",
|
|
16
|
+
"skipped",
|
|
17
|
+
"edited",
|
|
18
|
+
"pr_open",
|
|
19
|
+
"merged",
|
|
20
|
+
"failed"
|
|
21
|
+
];
|
|
22
|
+
var REPO_MANIFEST_CAP = 25;
|
|
23
|
+
var REPO_DRIFT_DETAIL_CAP = 200;
|
|
24
|
+
var TRANSITIVE_DETAIL_CAP = 100;
|
|
25
|
+
|
|
26
|
+
export {
|
|
27
|
+
DEFAULT_REPO_POLICY,
|
|
28
|
+
UPGRADE_SEVERITIES,
|
|
29
|
+
UPGRADE_RUN_STATUSES,
|
|
30
|
+
REPO_MANIFEST_CAP,
|
|
31
|
+
REPO_DRIFT_DETAIL_CAP,
|
|
32
|
+
TRANSITIVE_DETAIL_CAP
|
|
33
|
+
};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { createRequire as __lurqCreateRequire } from 'node:module'; const require = __lurqCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
require_semver
|
|
4
|
+
} from "./chunk-3GHJR7XR.js";
|
|
5
|
+
import {
|
|
6
|
+
__toESM,
|
|
7
|
+
init_esm_shims
|
|
8
|
+
} from "./chunk-I3M2KJXB.js";
|
|
9
|
+
|
|
10
|
+
// src/compat/peerCompat.ts
|
|
11
|
+
init_esm_shims();
|
|
12
|
+
var import_semver = __toESM(require_semver(), 1);
|
|
13
|
+
function satisfiesRange(version, range) {
|
|
14
|
+
if (!import_semver.default.validRange(range)) return null;
|
|
15
|
+
const v = import_semver.default.valid(version) ? version : import_semver.default.coerce(version)?.version;
|
|
16
|
+
if (!v) return null;
|
|
17
|
+
return import_semver.default.satisfies(v, range, { includePrerelease: true });
|
|
18
|
+
}
|
|
19
|
+
function rangesIntersect(a, b) {
|
|
20
|
+
if (!import_semver.default.validRange(a) || !import_semver.default.validRange(b)) return null;
|
|
21
|
+
try {
|
|
22
|
+
return import_semver.default.intersects(a, b, { includePrerelease: true });
|
|
23
|
+
} catch {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function resolveArchitectureCompat(members) {
|
|
28
|
+
const conflicts = [];
|
|
29
|
+
const pinned = /* @__PURE__ */ new Map();
|
|
30
|
+
for (const m of members) if (m.version) pinned.set(m.name, m.version);
|
|
31
|
+
const constraints = [];
|
|
32
|
+
for (const m of members) {
|
|
33
|
+
if (!m.peerDependencies) continue;
|
|
34
|
+
for (const [peer, range] of Object.entries(m.peerDependencies)) {
|
|
35
|
+
constraints.push({
|
|
36
|
+
requirer: m.name,
|
|
37
|
+
peer,
|
|
38
|
+
range,
|
|
39
|
+
optional: Boolean(m.peerDependenciesMeta?.[peer]?.optional)
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
for (const c of constraints) {
|
|
44
|
+
const pv = pinned.get(c.peer);
|
|
45
|
+
if (pv && satisfiesRange(pv, c.range) === false) {
|
|
46
|
+
conflicts.push({
|
|
47
|
+
source: "peer-deps",
|
|
48
|
+
packages: [c.requirer, c.peer],
|
|
49
|
+
detail: `${c.requirer} needs peer ${c.peer}@${c.range}, but the stack uses ${c.peer}@${pv}`,
|
|
50
|
+
requirement: { peer: c.peer, range: c.range, resolved: pv }
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
const byPeer = /* @__PURE__ */ new Map();
|
|
55
|
+
for (const c of constraints) {
|
|
56
|
+
if (pinned.has(c.peer) || c.optional) continue;
|
|
57
|
+
const arr = byPeer.get(c.peer);
|
|
58
|
+
if (arr) arr.push(c);
|
|
59
|
+
else byPeer.set(c.peer, [c]);
|
|
60
|
+
}
|
|
61
|
+
for (const [peer, cs] of byPeer) {
|
|
62
|
+
for (let i = 0; i < cs.length; i++) {
|
|
63
|
+
for (let j = i + 1; j < cs.length; j++) {
|
|
64
|
+
if (cs[i].range !== cs[j].range && rangesIntersect(cs[i].range, cs[j].range) === false) {
|
|
65
|
+
conflicts.push({
|
|
66
|
+
source: "peer-deps",
|
|
67
|
+
packages: [cs[i].requirer, cs[j].requirer],
|
|
68
|
+
detail: `${cs[i].requirer} needs ${peer}@${cs[i].range} but ${cs[j].requirer} needs ${peer}@${cs[j].range}, no overlapping version`,
|
|
69
|
+
// Two requirers disagreeing about a peer that isn't in the set: the
|
|
70
|
+
// peer has no resolved version to report.
|
|
71
|
+
requirement: { peer, range: cs[i].range, resolved: null }
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
const nodeReqs = members.map((m) => ({ name: m.name, range: m.engines?.node })).filter((r) => typeof r.range === "string");
|
|
78
|
+
for (let i = 0; i < nodeReqs.length; i++) {
|
|
79
|
+
for (let j = i + 1; j < nodeReqs.length; j++) {
|
|
80
|
+
if (rangesIntersect(nodeReqs[i].range, nodeReqs[j].range) === false) {
|
|
81
|
+
conflicts.push({
|
|
82
|
+
source: "engines",
|
|
83
|
+
packages: [nodeReqs[i].name, nodeReqs[j].name],
|
|
84
|
+
detail: `${nodeReqs[i].name} needs node ${nodeReqs[i].range} but ${nodeReqs[j].name} needs node ${nodeReqs[j].range}, no overlap`
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return conflicts;
|
|
90
|
+
}
|
|
91
|
+
function resolveRuntimeEngineConflicts(members, nodeVersion) {
|
|
92
|
+
const runtime = normalizeNodeVersion(nodeVersion);
|
|
93
|
+
if (!runtime) return [];
|
|
94
|
+
const conflicts = [];
|
|
95
|
+
for (const m of members) {
|
|
96
|
+
const range = m.engines?.node;
|
|
97
|
+
if (!range) continue;
|
|
98
|
+
const ok = runtime.exact ? satisfiesRange(runtime.value, range) : rangesIntersect(runtime.value, range);
|
|
99
|
+
if (ok === false) {
|
|
100
|
+
conflicts.push({
|
|
101
|
+
source: "engines",
|
|
102
|
+
packages: [m.name],
|
|
103
|
+
detail: `${m.name}@${m.version ?? "?"} needs node ${range}, but the runtime is node ${runtime.label}`
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return conflicts;
|
|
108
|
+
}
|
|
109
|
+
function normalizeNodeVersion(raw) {
|
|
110
|
+
const trimmed = raw.trim().replace(/^v/i, "");
|
|
111
|
+
if (!trimmed) return null;
|
|
112
|
+
if (import_semver.default.valid(trimmed)) return { value: trimmed, exact: true, label: trimmed };
|
|
113
|
+
if (/^\d+(\.\d+)?$/.test(trimmed)) {
|
|
114
|
+
return { value: `${trimmed}.x`, exact: false, label: trimmed };
|
|
115
|
+
}
|
|
116
|
+
const coerced = import_semver.default.coerce(trimmed);
|
|
117
|
+
return coerced ? { value: coerced.version, exact: true, label: coerced.version } : null;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export {
|
|
121
|
+
resolveArchitectureCompat,
|
|
122
|
+
resolveRuntimeEngineConflicts
|
|
123
|
+
};
|