Skip to content

Conversation

@MrMYHuang
Copy link
Contributor

With these changes, electron-builder can merge extraResources from parent config and current conifg. For example:
common.json:

{
  "extends": null,
  "extraResources": [
    "common/*.files",
    "common.file"
  ]
}

specific.json:

{
  "extends": "common.json",
  "extraResources": [
    {
      "from": "specific",
      "to": ".",
      "filter": ["file.txt"]
    },
  ]
}

The merged config - dist/builder-effective-config.yaml:

directories:
  output: dist
  buildResources: build
extends: common.json
extraResources:
  - filter:
      - common/*.files
      - common.file
  - from: specific
    filter:
      - file.txt
files: []
electronVersion: 16.2.3

Signed-off-by: Meng-Yuan Huang <myh@live.com>
@changeset-bot
Copy link

changeset-bot bot commented May 5, 2022

🦋 Changeset detected

Latest commit: ba61d78

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 10 packages
Name Type
builder-util Patch
app-builder-lib Patch
dmg-builder Patch
electron-builder-squirrel-windows Patch
electron-builder Patch
electron-publish Patch
electron-forge-maker-appimage Patch
electron-forge-maker-nsis-web Patch
electron-forge-maker-nsis Patch
electron-forge-maker-snap Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@netlify
Copy link

netlify bot commented May 5, 2022

Deploy Preview for car-park-attendant-cleat-11576 ready!

Name Link
🔨 Latest commit ba61d78
🔍 Latest deploy log https://app.netlify.com/sites/car-park-attendant-cleat-11576/deploys/627540eb54bfdc00087157ff
😎 Deploy Preview https://deploy-preview-6841--car-park-attendant-cleat-11576.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@mmaietta mmaietta merged commit 9dc13ba into electron-userland:master May 6, 2022
@github-actions github-actions bot mentioned this pull request May 6, 2022
@mmaietta
Copy link
Collaborator

@MrMYHuang this PR seems to have caused a bug in the latest version, can you please take a look?
A config of:

extraFiles:
  - from: node_modules/node-mac-permissions/build/Release
    to: MacOS
    filter:
      - '*.node'
  - from: node_modules/electron-deeplink/build/Release
    to: MacOS
    filter:
      - '*.node'

The effective electron-builder config shows it duplicated,

extraFiles:
  - from: node_modules/node-mac-permissions/build/Release
    to: MacOS
    filter:
      - '*.node'
  - from: node_modules/electron-deeplink/build/Release
    to: MacOS
    filter:
      - '*.node'
  - from: node_modules/node-mac-permissions/build/Release
    to: MacOS
    filter:
      - '*.node'
  - from: node_modules/electron-deeplink/build/Release
    to: MacOS
    filter:
      - '*.node'

This doesn't seem to cause an issue with files, but it does cause it to try and double-copy when in extraFiles which then throws an error on my linux build machine (can't repro on my mac locally, didn't check windows.)

@MrMYHuang
Copy link
Contributor Author

MrMYHuang commented May 12, 2022

The effective electron-builder config shows it duplicated,

I can't reproduce it on Linux and macOS with electron-builder 23.0.9. I tested with extraFiles in both parent config and current config, and each extraFiles has two elements as your example with different "from" values.

Please revert this PR as your decision.

@sohobloo
Copy link
Contributor

OMG, this BREAKING CHANGE messed up all my config inherits.

mmaietta added a commit that referenced this pull request Jul 21, 2022
Follow up from: #6841 (comment)

Filters out duplicate assign's when cascading configs (files, extraFiles, etc.) by converting to Set first
@semireg
Copy link

semireg commented Jul 26, 2022

I wonder if this could be related to #7021.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants