forge icon indicating copy to clipboard operation
forge copied to clipboard

chore: update listr2 version

Open yangannyx opened this issue 1 year ago • 0 comments

  • [x] I have read the contribution documentation for this project.
  • [x] I agree to follow the code of conduct that this project follows, as appropriate.
  • [x] The changes are appropriately documented (if applicable).
  • [x] The changes have sufficient test coverage (if applicable).
  • [x] The testsuite passes successfully on my local machine (if applicable).

Summarize your changes: This PR updates the listr2 dependency such that the default renderer used in TTY environments will dump any output written to stdout and stderror at the end of a forge run. This was added as default behavior in listr2 after the current version we're using, so I figured I'd migrate us to the most recent stable release.

Some callouts here are:

  • Listr2 changed the default fallback renderer from verbose to simple. This means that when using the DEBUG environment variable, the output looks a little different Previous Screenshot 2024-03-19 at 10 53 24 AM New Screenshot 2024-03-19 at 10 48 43 AM
  • Logged content is not colocated with the Listr tasks that logged it, so it can be unclear where logged content is coming from. I think this is ok because authors can always add more details to the logged message itself to make this more clear (ie if console.logging from the generateAssets hook, prepend logged messages with [generateAssets] string).

Documentation PR: https://github.com/electron-forge/electron-forge-docs/pull/168

Testing example: forge.config

hooks: {
    async generateAssets(_config, _platform, arch) {
      console.log('hello world');
      console.log(arch);
    }
  }

Output

yarn make                                                                                                                               ─╯
yarn run v1.22.21
$ electron-forge make
✔ Checking your system
✔ Loading configuration
✔ Resolving make targets
› Making for the following targets:
✔ Running package command
✔ Preparing to package application
✔ Running packaging hooks
  ✔ Running generateAssets hook
    ✔ Running generateAssets hook from forgeConfig
  ✔ Running prePackage hook
✔ Packaging application
  ✔ Packaging for arm64 on darwin [2s]
✔ Running postPackage hook
✔ Running preMake hook
✔ Making distributables
✔ Making a zip distributable for darwin/arm64 [6s]
✔ Running postMake hook
› Artifacts available at: /Users/anny/code/opensource/my-app/out/make

hello world
arm64
✨  Done in 10.50s.

Test 2: forge.config (built w webpack template)

packagerConfig: {
    asar: true,
    ignore: []
  },

Output

yarn make                                                                                                                               ─╯
yarn run v1.22.21
$ electron-forge make
✔ Checking your system
✔ Loading configuration
✔ Resolving make targets
  › Making for the following targets:
✔ Running package command
  ✔ Preparing to package application
  ✔ Running packaging hooks
    ✔ Running generateAssets hook
    ✔ Running prePackage hook
      ✔ [plugin-webpack] Preparing webpack bundles
        ✔ Preparing native dependencies [0.2s]
        ✔ Building webpack bundles [0.7s]
  ✔ Packaging application
    ✔ Packaging for arm64 on darwin [1s]
  ✔ Running postPackage hook
✔ Running preMake hook
✔ Making distributables
  ✔ Making a zip distributable for darwin/arm64 [6s]
✔ Running postMake hook
  › Artifacts available at: /Users/anny/code/opensource/my-app/out/make

You have set packagerConfig.ignore, the Electron Forge webpack plugin normally sets this automatically.

Your packaged app may be larger than expected if you dont ignore everything other than the '.webpack' folder
You have set packagerConfig.ignore, the Electron Forge webpack plugin normally sets this automatically.

Your packaged app may be larger than expected if you dont ignore everything other than the '.webpack' folder
✨  Done in 10.55s.

yangannyx avatar Mar 18 '24 16:03 yangannyx