Dashboard › cli › Distillation
d5286a76-5d3a-4b9c-bbdc-c8daad82cbc7["lore_tm_v1_oVPnQocgVzSiJW-H8iJXYf_E0FviwWMsjT5kYb78nSY","lore_tm_v1_QR2CNMf0rWXHituAh-15QY7JB9FOQs4lYsM10Jf2wrc"]
packages/cli/test/lib/install-script.test.ts line 27 defines const installScript = join(repoRoot, "install");, line 64 references installScript, and line 112 reads it with readFileSync(installScript, "utf8"); packages/cli/script/generate-skill.ts line 291 calls lines.push(...generateInstallSection(installSection, rawContent));.packages/cli/script/check-patches.ts validates pnpm.patchedDependencies from workspace-root ../../package.json; version mismatches are warnings because pnpm 10 name-only keys support version-agnostic patching, while missing packages and failed content assertions are hard errors.packages/cli/script/check-patches.ts documents the @stricli/core patch as a permanent maintenance cost: it frees the -H alias from Stricliβs hardcoded --help-all alias in both dist/index.js and dist/index.cjs; on every Stricli bump, regenerate via pnpm patch @stricli/core, reapply four edits per file, run pnpm patch-commit, and rename the patch file to the new version.resolvePackageFile(subpath) in packages/cli/script/check-patches.ts uses createRequire(import.meta.url) and require_.resolve(pkgName) to locate the exact dependency copy used by the sentry package in a pnpm workspace, rather than a potentially unrelated transitive copy.resolvePackageFile(subpath) derives package roots by anchoring at the last /node_modules/ boundary and selecting the first /${pkgName}/ segment after it, preventing a self-vendored nested copy such as .../node_modules/@scope/pkg/vendor/@scope/pkg/index.js from shifting truncation to the wrong inner package.parsePatchKey(key) supports both name-only patched-dependency keys such as @sentry/core and exact-version keys such as @sentry/core@10.50.0; only an @ after index 0 is treated as a version delimiter so scoped package names remain intact.patchedDependencies keys scope a patch to one version, so pnpm never attempts to apply it to mismatched nested copies such as transitive @sentry/core@10.60.0, avoiding the "Could not apply patch" warning./@(\d+\.\d+\.\d+[^@]*)\.patch$/, including prereleases such as 1.2.3-beta.1; an unparseable path produces ? ${name}: could not extract version from patch path "${patchPath}".resolvePackageFile(\${name}/package.json`); a mismatch warns ${name}: patch targets ${patchVersion}, installed ${installed.version} β regenerate with: pnpm patch ${name}, while an unresolved or unreadable package errors ${name}: not installed (expected ${patchVersion})`.CONTENT_ASSERTIONS in packages/cli/script/check-patches.ts verifies actual patch effects using either a staleMarker that must be absent or a requiredMarker that must be present; this guards against pnpm silently installing an unpatched package after patch context drift.CONTENT_ASSERTIONS entries are ordered as: 1. @stricli/core/dist/index.js, stale 'checkForReservedAliases(aliases, ["h", "H"])', ensuring ESM frees -H for api -H/--header; 2. @stricli/core/dist/index.cjs, the same CJS check; 3. @stricli/core/dist/index.js, required matchTopLevelFlag, ensuring ESM accepts global flags before subcommands such as sentry --verbose issue list; 4. @stricli/core/dist/index.cjs, the same CJS top-level-flags check.@stricli/core CONTENT_ASSERTIONS are ordered as: 5. dist/index.js, stale 'inputs[0] === "--version" || inputs[0] === "-v"', ensuring ESM drops built-in -v=version so -v remains Sentry CLI verbose; 6. dist/index.cjs, the same CJS check; 7. dist/index.js, required versionRequested, ensuring ESM supports --version after a subcommand such as sentry cli --version; 8. dist/index.cjs, the same CJS check; 9. dist/index.js, required renderHelp, ensuring ESM supports structured JSON for sentry --help --json; 10. dist/index.cjs, the same CJS check.CONTENT_ASSERTIONS continue in order as: 11. @sentry/core/build/cjs/index.js, stale exports.instrumentOpenAiClient, preventing AI integrations from being re-bundled; 12. @sentry/core/build/esm/index.js, stale from './tracing/openai/index.js', preventing ESM AI integrations from being re-bundled; 13. @sentry/node-core/build/cjs/light/index.js, stale exports.dedupeIntegration, validating the CJS-light integration re-export strip; 14. @sentry/node-core/build/esm/light/index.js, stale dedupeIntegration, validating the ESM-light integration re-export strip.packages/cli/script/check-patches.ts usage is tsx script/check-patches.ts; exit code 0 means versions match or only non-critical warnings occurred and all content assertions passed, while exit code 1 means a patched package is missing or a content assertion failed.