Skip to content

feat(core): allow packagerConfig to override the "dir" setting - #2175

Closed
defunctzombie wants to merge 1 commit into
electron:masterfrom
foxglove:packagerConfig-dir
Closed

defunctzombie wants to merge 1 commit into
electron:masterfrom
foxglove:packagerConfig-dir

Conversation

@defunctzombie

Copy link
Copy Markdown

By moving the "dir" property above packageConfig spread, the user can
override the detected "dir" in their configuration. This allows a user
to point forge at a "source dir" much like you can with electron-packager.

This makes forge flexible to using alternative webpack versions or build
scripts to create the "source dir" while benefiting from the package and make
features of forge.


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

By moving the "dir" property above packageConfig spread, the user can
override the detected "dir" in their configuration. This allows a user
to point forge at a "source dir" much like you can with electron-packager.

This makes forge flexible to using alternative webpack versions or build
scripts to create the "source dir" while benefiting from the package and make
features of forge.
@codecov

codecov Bot commented Feb 24, 2021 •

Copy link
Copy Markdown

Codecov Report

Merging #2175 (6267c3b) into master (f15b5c7) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2175   +/-   ##
=======================================
  Coverage   72.71%   72.71%           
=======================================
  Files          74       74           
  Lines        2221     2221           
  Branches      420      420           
=======================================
  Hits         1615     1615           
  Misses        446      446           
  Partials      160      160           
Impacted Files Coverage Δ
packages/api/core/src/api/package.ts 74.73% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f15b5c7...85c0bef. Read the comment docs.

@malept malept left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So I'm not sure what this accomplishes that you couldn't already do with changing the cwd:

> electron-forge package --help
✔ Checking your system
Usage: electron-forge-package [options] [cwd]

Options:
  -V, --version              output the version number
  -a, --arch [arch]          Target architecture
  -p, --platform [platform]  Target build platform
  -h, --help                 output usage information

@defunctzombie

Copy link
Copy Markdown
Author

@malept I too tried the [cwd] approach first thinking it would do the trick but it did not work.

Lets say I've built my bundle elements into a .webpack folder in the root of my repo (much like forge does itself - but I've done using my own bundling tooling). When I run electron-forge package .webpack and inspect the app content copied to the packaged directory I see that forge has instead package my repo root as the "app" rather than the .webpack folder.

I tried investigating why "cwd" was being "ignored" in my case and concluded that it was likely due to some of the automatic resolution of package.json files with forge but didn't understand the flows enough to go further. If the [cwd] approach can be fixed then I would gladly use that instead. I agree this is a workaround to [cwd] not doing what I expect.

@malept

malept commented Feb 24, 2021

Copy link
Copy Markdown
Member

I'd also like to know why you're running webpack in a process outside of the webpack plugin.

@defunctzombie

Copy link
Copy Markdown
Author

@malept I've got a webpack v5 build setup that produces the electron artifacts rather than using forge webpack integration.

I'm looking for a way to sidestep the forge bundling but still leverage the package and make functionality. Using package directly and specifying [cwd] seemed like an approach that would work until I ran into auto-detection issues with trying to find the "source" that I wanted packaged.

@akash07k

akash07k commented Dec 9, 2023

Copy link
Copy Markdown

I hope this feature gets implemented soon so that we can change the dir directory for some requirements

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.

3 participants