feat(pkgmgr,cli): support scriptgo add, direct file execution, and scg alias - #28
Merged
Merged
Conversation
…g alias - implement 'scriptgo add' with support for dependencies, devDependencies (-D), optionalDependencies (-O), peerDependencies (--peer), exact pinning (-E), and --offline - support transactional rollback of package.json and scriptgo.lock on add failure - support direct CLI execution without typing run: 'scriptgo <file.ts>' and 'scriptgo -e <code>' - provide 'scg' alias for 'scriptgo' via cmd/scg delegator, Makefile symlink, and dynamic program name in usage/help - refactor long files in cmd/scriptgo and internal/pkgmgr into focused units to maintain architectural guidelines (< 500-650 lines) - update tests, documentation, changelog, roadmap, and parity report
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements three major features and usability enhancements for ScriptGo:
scriptgo addPackage Manager Command:-D,--dev), optionalDependencies (-O,--optional), and peerDependencies (--peer).-E/--exact.--offline) against cached packages.pkg,pkg@version,pkg@tag,@scope/pkg) via npm registry or workspace packages.package.jsonwith formatting and key order preservation, followed by updatingscriptgo.lockand installing packages intonode_modules.package.jsonandscriptgo.lockif any installation step fails.Direct CLI Execution:
run:scriptgo file.tsscriptgo -e "console.log('hello')"scriptgo --eval "code"scgAlias:scgis interchangeable withscriptgo.os.Args[0]).cmd/scgdelegator binary and updatedMakefileto symlinkscg -> scriptgo.Architecture & Refactoring:
AGENTS.mdline length guidelines (< 500-650 lines per file):internal/pkgmgr/bins.gofrominstall.go.handleEmitintocmd/scriptgo/emit_cmd.goandhandleCoverageintocmd/scriptgo/coverage_cmd.gofrommain.go.internal/pkgmgr/add_test.go,cmd/scriptgo/add_test.go, andcmd/scriptgo/main_test.go.CHANGELOG.md,docs/package-manager-architecture.md,docs/roadmap.md, anddocs/typescript-parity-report.md.Verification
go test -count=1 ./...(All packages pass 100%)go test -count=1 ./internal/typescriptgo/...go build ./cmd/scriptgo&go build ./cmd/scg