Skip to content

Remove tarball after use in quire new command#1106

Merged
cbutcosk merged 1 commit intomainfrom
fix/remove-package-tarzip
Jan 7, 2026
Merged

Remove tarball after use in quire new command#1106
cbutcosk merged 1 commit intomainfrom
fix/remove-package-tarzip

Conversation

@cbutcosk
Copy link
Collaborator

@cbutcosk cbutcosk commented Dec 18, 2025

This PR adds an integration test for #1068 , adjusts the quire new command to remove @thegetty/quire-11ty tarballs downloaded during publication install, and updates the underlying filesystem calls of installInProject() to use native node API calls for better testability.

@cbutcosk cbutcosk force-pushed the fix/remove-package-tarzip branch 2 times, most recently from 98651df to e3be90b Compare January 6, 2026 01:23
@cbutcosk cbutcosk force-pushed the fix/remove-package-tarzip branch from 4a9ba38 to c7b168b Compare January 6, 2026 14:13
@cbutcosk cbutcosk marked this pull request as ready for review January 6, 2026 14:31
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')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💭 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)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)?

@cbutcosk cbutcosk merged commit c69cd4d into main Jan 7, 2026
6 checks passed
@cbutcosk cbutcosk deleted the fix/remove-package-tarzip branch January 7, 2026 13:17
cbutcosk added a commit that referenced this pull request Mar 12, 2026
…zip"

This reverts commit c69cd4d, reversing
changes made to d38a88c.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants