Validate app name in templates & add support for validating pear init -y#718
Closed
lejeunerenard wants to merge 125 commits intoholepunchto:pear-nextfrom
Closed
Validate app name in templates & add support for validating pear init -y#718lejeunerenard wants to merge 125 commits intoholepunchto:pear-nextfrom
pear init -y#718lejeunerenard wants to merge 125 commits intoholepunchto:pear-nextfrom
Conversation
fb0adf5 to
d8ad61f
Compare
4877834 to
c60ff08
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR refactors CLI commands to use the shared pear-api terminal interface, adds new flags/commands (e.g. --purge, --only, drop, data manifest, gc interfaces), and streamlines outputters to return arrays rather than async generators.
- Migrate all local
iface,errors,parse-link, and constants imports topear-api - Introduce new commands/flags:
drop,manifest(data),interfaces(gc),--purge&--only(stage & dump) - Refactor outputters to return arrays and add byte-diff support
Reviewed Changes
Copilot reviewed 198 out of 198 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| cmd/versions.js | Switched import to pear-api/terminal and rewrote outputter to return array of tags |
| cmd/stage.js | Updated imports, added --purge & --only flags, and appended byteDiff tagger |
| cmd/dump.js | Updated imports, added --only & --prune flags, stats tag, and byteDiff tagger |
| cmd/index.js | Extensive command definitions update: new commands, flags, hidden reset, and help text |
| cmd/gc.js | Abstracted common GC logic into #op, added interfaces command |
| cmd/data.js | Added manifest output and command, refactored outputter calls |
Comments suppressed due to low confidence (5)
cmd/stage.js:36
- Tests should be added to cover the new
--purgeand--onlyflags to verify that ignored files are removed and path filtering works as expected.
const { dryRun, bare, json, ignore, purge, name, truncate, only } = cmd.flags
cmd/gc.js:32
- Add unit tests for the new
gc interfacescommand path (e.g.--age) to confirm it passes the correct data to the IPC layer and formats output properly.
async interfaces (cmd) {
cmd/data.js:42
- Introduce tests for the
data manifestoutput function to ensure it handles both present and missing manifest data as intended.
const manifestOutput = (manifest) => {
cmd/stage.js:4
- The
byteDifftagger is added without a matching tag key; you should map it under the 'byte-diff' tag (e.g.{ 'byte-diff': byteDiff }) so byte‐diff events are handled correctly.
const { outputter, ansi } = require('pear-api/terminal')
cmd/dump.js:4
- Similarly,
byteDiffmust be keyed to the 'byte-diff' tag in the outputter's taggers object; otherwise byte-diff output won't be invoked.
const { outputter, permit, ansi, isTTY, byteSize, byteDiff } = require('pear-api/terminal')
bf79cd0 to
caf63d5
Compare
d203c6e to
5ab4548
Compare
78fc737 to
3257823
Compare
a133af3 to
8abb23f
Compare
de8fc9e to
f88a739
Compare
8e2e85c to
d77f928
Compare
83fa8d9 to
594d418
Compare
a48eb34 to
fb91ce2
Compare
c4415b2 to
cf21c89
Compare
8ace579 to
64f8dfa
Compare
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.
Prevents default
nameproperty from being invalid fordesktopandterminaltype applications. With out the validation there are scenarios where default values can error once a user tries to run a Pear app which throws:This revealed an issue with
pear-api's processing of params when the--yesflag was set as well. So a full fix depends on holepunchto/pear-api#31