Skip to content

Possibly provide more of the built-in npm "dry run" output #184

Closed
@forevermatt

Description

@forevermatt

Have you considered including more of the standard output of npm's "dry run" mode? I find that quite helpful sometimes, such as to see what all files would be included in the published package (so that I can adjust things to remove unneeded files).

Here's a slightly-redacted example of what npm shows:

npm notice 📦  @some-org/some-package@1.2.3
npm notice === Tarball Contents === 
npm notice 1.1kB  LICENSE                            
npm notice 2.6kB  README.md                          
npm notice 20.3kB dist/index.js                      
npm notice 17.8kB dist/index.mjs                     
npm notice 1.4kB  package.json                       
npm notice 3.1kB  src/SomeFile.svelte
npm notice 72B    src/index.js                       
npm notice 1.8kB  src/loader.js
...

However, the npm-publish GitHub action seems to only show something like this:

Run JS-DevTools/npm-publish@v3
  with:
    token: ***
    dry-run: true
🙅‍♀️ @some-org/some-package@1.2.3 publish skipped.

Thank for making helpful open source packages, nonetheless! 😁

Activity

mcous

mcous commented on Mar 20, 2024

@mcous
Member

I like this idea! I think what might be happening here is that dry-run doesn't affect the version check logic, so if you're in dry-run mode but the version in question is already released, npm publish --dry-run will never be called.

What we could do is have dry-run proceed past the version check (with appropriate logging) and run npm publish --dry-run no matter what. I think if we do that, we'll get the nice little pack log

forevermatt

forevermatt commented on Mar 20, 2024

@forevermatt
Author

Sounds promising, thanks! Unfortunately, I'm not familiar enough with this codebase to submit a PR myself. Sorry. 😞

mcous

mcous commented on Mar 20, 2024

@mcous
Member

All good! It’ll be a pretty small lift if my assumptions hold 🤞, will take a crack at it by Friday

forevermatt

forevermatt commented on Mar 25, 2024

@forevermatt
Author

Awesome, thanks! We're already seeing those changes in our builds, and it looks great! 😁 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @mcous@forevermatt

      Issue actions

        Possibly provide more of the built-in npm "dry run" output · Issue #184 · JS-DevTools/npm-publish