Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

lvqq
Copy link
Member

@lvqq lvqq commented Oct 27, 2024

close #8676

It's useful to display packed files since pnpm pack only shows tarball filename now

Before

image

After

image

@lvqq lvqq requested a review from zkochan as a code owner October 27, 2024 02:37
@zkochan zkochan merged commit b3333fb into main Nov 5, 2024
15 checks passed
@zkochan zkochan deleted the feat-packed-files branch November 5, 2024 01:03
zkochan pushed a commit that referenced this pull request Nov 5, 2024
julienp added a commit to pulumi/pulumi that referenced this pull request Nov 13, 2024
For pnpm versions <9.13, pnpm pack outputs a single line with the name
of the tarball. On pnpm versions >=9.13, pnpm pack lists all the packed
files, and the last line is the tarball.

pnpm/pnpm#8707
github-merge-queue bot pushed a commit to pulumi/pulumi that referenced this pull request Nov 13, 2024
For pnpm versions <9.13, pnpm pack outputs a single line with the name
of the tarball. On pnpm versions >=9.13, pnpm pack lists all the packed
files, and the last line is the tarball.

pnpm/pnpm#8707
@karlhorky
Copy link

karlhorky commented Nov 15, 2024

This ended up breaking CI for us, since we were relying on the stdout from pnpm pack only containing the single line with the path.

Resolution

In case anyone else is getting failures because they were relying on the pnpm pack output, here's how we fixed it:

 import { execa } from 'execa';

 // ...

     // Pack and install Preflight globally
-    const { stdout: pnpmPackTarballPath } = await execa`pnpm pack`;
+    const pnpmPackTarballPath = (await execa`pnpm pack`).stdout
+      .split('\n')
+      .find((line) => line.match(/^upleveled-preflight-.*\.tgz$/));
+
+    if (!pnpmPackTarballPath) {
+      throw new Error('Failed to find the tarball path in `pnpm pack` output');
+    }

@zkochan
Copy link
Member

zkochan commented Nov 15, 2024

Sorry for that. It actually broke some of my integrations as well. We should add a JSON output option.

@karlhorky karlhorky mentioned this pull request Nov 15, 2024
1 task
@karlhorky
Copy link

@zkochan ok thanks, created an issue to track pnpm pack --format json

@lvqq
Copy link
Member Author

lvqq commented Nov 15, 2024

Refer PR: #8765

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.

Display packed files list info in pnpm pack
3 participants