Remove tarball after use in quire new command#1106
Merged
Conversation
98651df to
e3be90b
Compare
4a9ba38 to
c7b168b
Compare
mphstudios
approved these changes
Jan 6, 2026
mphstudios
approved these changes
Jan 6, 2026
Comment on lines
+303
to
+331
| // Mock fs (adding copySync) and git (with mocked chainable stubs) | ||
| // NB: Passing `vol` here as fs because memfs only provides the cpSync there | ||
| const { quire } = await esmock('../lib/quire/index.js', { | ||
| 'fs-extra': vol, | ||
| '#lib/git/index.js': { | ||
| add: () => { | ||
| return { | ||
| commit: sandbox.stub() | ||
| } | ||
| }, | ||
| cwd: () => { | ||
| return { | ||
| rm: () => { | ||
| return { | ||
| catch: sandbox.stub() | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| 'execa': { | ||
| // Mock `npm pack` behvaior of creating a file in .temp | ||
| execaCommand: sandbox.stub().withArgs(/npm pack/).callsFake(() => { | ||
| fs.writeFileSync(path.join(projectRoot, '.temp', 'thegetty-quire-11ty-1.0.0.tgz'), '') | ||
| }) | ||
| } | ||
| }) | ||
|
|
||
| await quire.installInProject(projectRoot, '1.0.0') |
Contributor
There was a problem hiding this comment.
💭 the lib/quire module might provide its own simple mock that abstracts the internal concerns of calling installInProject
💭 implementing a lib/npm module that wraps the npm commands (init, install, uninstall, pack, clean) would provide a consistent way for the other modules to interact with npm and abstract internal concern for how it is called (execa vs node child_process)
Collaborator
Author
There was a problem hiding this comment.
Totally -- perhaps in a repo storage abstraction that would ease dependency injection and give future work a foundation for refactoring repo structure (eg, for future work separating publication content and site framework code)?
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.
This PR adds an integration test for #1068 , adjusts the
quire newcommand to remove@thegetty/quire-11tytarballs downloaded during publication install, and updates the underlying filesystem calls ofinstallInProject()to use native node API calls for better testability.