feat(targets): add pkg-chocolatey target (Chocolatey Community Repository)#475
Conversation
…tory) Adds the Chocolatey distribution target for Windows. - build() generates a real .nuspec + tools/chocolateyinstall.ps1 (exe/msi/zip), with XML escaping and checksum-verified install scripts. - ship() is dry-run-safe and surfaces the exact choco pack/apikey/push commands; live path requires CHOCOLATEY_API_KEY + the choco CLI on Windows. - Register pkg-chocolatey in cli adapter-registry; TARGETS.md row added. - manualSetup notes the community moderation/VirusTotal review gate.
Greptile SummaryThis PR adds a
Confidence Score: 5/5Safe to merge — the adapter is a well-scoped addition with no side effects outside its own package directory; the live publish path is intentionally unimplemented and guarded by an explicit throw. The three issues flagged in the prior review round have all been resolved: the false-success live-ship path now throws, the unused parameter has been removed, and PowerShell single-quote escaping is implemented and tested. XML escaping for the nuspec is correct. No pre-existing code paths are modified beyond the single-line adapter registry update. No files require special attention. The status() stub always returning 'in-review' is a known limitation consistent with the unimplemented live-publish path. Important Files Changed
Sequence DiagramsequenceDiagram
participant CLI
participant Adapter as pkg-chocolatey adapter
participant FS as Filesystem
participant Choco as choco CLI (Windows)
CLI->>Adapter: build(ctx, config)
Adapter->>FS: "mkdir outDir/chocolatey/{packageId}/tools"
Adapter->>FS: "writeFile {packageId}.nuspec (xmlEscape)"
Adapter->>FS: writeFile tools/chocolateyinstall.ps1 (psEscape)
Adapter-->>CLI: "{ artifact, meta: { nuspec, installScript, commands[] } }"
CLI->>Adapter: "ship(ctx, config) [dryRun=true]"
Adapter-->>CLI: "{ id: 'dry-run', meta: { commands[] } }"
CLI->>Adapter: "ship(ctx, config) [dryRun=false]"
Adapter-->>CLI: throws Error('not implemented yet')
Note over Choco: Future live path
Note over Choco: choco pack + choco push
Note over Choco: requires CHOCOLATEY_API_KEY
Reviews (2): Last reviewed commit: "fix(pkg-chocolatey): address Greptile re..." | Re-trigger Greptile |
- Live ship() now throws 'not implemented' instead of returning a false success after the secret check (P1). - Escape single quotes in interpolated PowerShell fields via psEscape() so a quote in installerUrl/silentArgs/packageId can't break the .ps1 (P2). - Drop the unused 'version' param from renderInstallScript (P2). - Add tests for quote-escaping and the live not-implemented throw.
|
Thanks — all three addressed in the latest commit:
|
Add
pkg-chocolateytarget — Chocolatey Community RepositoryImplements the
pkg-chocolateydistribution target (Windows), filling the README "Package managers → Chocolatey" entry. Mirrors the existingpkg-wingetadapter convention.What's included
packages/targets/pkg-chocolatey/— adapter, tests, package.json, tsconfig, README.build()generates a real.nuspec+tools/chocolateyinstall.ps1(exe/msi/zip installer types), with XML escaping and checksum-verified install scripts.ship()is dry-run-safe (no network/secrets indryRun) and surfaces the exactchoco pack/choco apikey/choco pushcommands; live path requiresCHOCOLATEY_API_KEY+ thechocoCLI on Windows.pkg-chocolateyinpackages/cli/src/adapter-registry.ts;TARGETS.mdrow added (✅).manualSetupnotes the community moderation + VirusTotal review gate.Tests
smokeTest+ nuspec/install-script generation (exe + zip), XML escaping, and dry-run command surfacing.pnpm --filter @profullstack/sh1pt-target-pkg-chocolatey typecheckand the package tests pass;pnpm install --frozen-lockfileis green.No external CLI or secrets needed for build/test (dry-run only).