Replies: 1 comment
-
📦 This RFC has movedThe Project Builder ecosystem has been reorganized into a dedicated GitHub organization: This RFC now lives at: Project-Builder-Schematics/project-builder-cli#1 Please continue the conversation there. This original discussion remains as a historical reference — a record of the thinking that led to the Go rewrite after several years of building The new home:
Thanks for reading, and see you on the other side. 🚀 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Overview
This is the full plan for rewriting
@pbuilder/clifrom TypeScript/Node.js to Go, using the Charmbracelet ecosystem for TUI and distributing via npm.Why Rewrite?
Current CLI Audit
Commands (5 active, 1 dead)
new <library-name> [author]execute <collection> <schematic>exec,g,generateadd <collection-name>ng-addinfo <collection-name> [schematic]schema.jsonconfig <action> [key] [value]get,set,delete,list)createCore Architecture: Subprocess Delegation
The CLI does NOT use Angular schematics engine in-process. It:
@angular-devkit/schematics-cli/bin/schematics.jsviarequire.resolvenode [binaryPath] collection:schematic --flagswithstdio: inherit--keep-installed)Current Dependencies & Their Roles
commander@angular-devkit/schematics-cli@angular-devkit/schematicsconfaxioscreatecommand)npm-package-arg+npm-registry-fetchchalk+ora+node-emojipino+pino-prettyKey Observations
cli.showBanner)createcommand is dead code — don't port unless revivingNew Stack
commanderconfora(spinner only)chalkpinochild_process.spawnaxios/npm-registry-fetchnpm Distribution Pattern
Same pattern used by esbuild, turbo, Biome, SWC, Lightning CSS:
npm auto-installs ONLY the matching platform package. Users run
npm i -g my-cliornpx my-cli— transparent.Implementation Phases
Phase 0: Learn Go (Targeted)
Not "learn all of Go" — only what's needed:
tea.Modelis an interface — Go's entire polymorphism(result, error)pattern everywhereResources:
Mini-project: CLI that queries
https://registry.npmjs.org/<package>, parses JSON, prints name/version/description.Phase 1: Cobra Skeleton
infocommand queries npm registry for realResources:
Phase 2: Bubble Tea TUI
Init()→Update()→View()Resources (in this exact order):
Charmbracelet Ecosystem:
Phase 3: Core Logic (Subprocess Management)
Resources:
Phase 4: npm Distribution
GOOS+GOARCHPhase 5: NEW Features
TypeScript → Go Mental Model
interfaceinterface(implicit — noimplements)classstruct+ methodstry/catchif err != nilasync/awaittea.Cmd)npm installgo getpackage.jsongo.modBeta Was this translation helpful? Give feedback.
All reactions