Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git submodule package.json dependencies #1539

Closed
Johnz86 opened this issue May 11, 2017 · 9 comments · May be fixed by qcif/data-curator#563
Closed

Git submodule package.json dependencies #1539

Johnz86 opened this issue May 11, 2017 · 9 comments · May be fixed by qcif/data-curator#563
Labels

Comments

@Johnz86
Copy link

Johnz86 commented May 11, 2017

In our project we have multiple git submodules, which have their own package.json definition.
The main package.json has definition like this:

  "dependencies": {
    "react": "15.4.2",
    "submodule_1": "client/submodule_1",
    "submodule_2": "client/submodule_2",
  },

The file structure of the project is something like this:

   root_project
   |-client
   |    |-submodule_1
   |    |   '--package.json
   |    '-submodule_2
   |        '--package.json
   '-package.json

So on npm install we have a all necessary modules downloaded.
The problem is that electron does not package the submodule dependencies to the final installer.
Is there a way to build the electron app with the dependencies from nested git submodules?

@develar
Copy link
Member

develar commented May 11, 2017

How do you install sub node modules? Using Lerna or manually?

@develar
Copy link
Member

develar commented May 11, 2017

Am I right — you somehow compile your project, and expect, that electron-builder will copy all node_modules directories plus your packages files?

@develar
Copy link
Member

develar commented May 11, 2017

As workaround, please try to specify node_modules explicitly in the files (see https://github.com/electron-userland/electron-builder/wiki/Options#Config-files) (but I am not sure, also, dev deps will be not filtered).

@Johnz86
Copy link
Author

Johnz86 commented May 11, 2017

The installation of dependencies is done with postinstall step:

"scripts": {
      "postinstall": "npm install submodule_1 && npm install submodule_2",
},

The workaround is not very good, because it would be easier just to copy all dependencies from submodules to main package.json.
In that way I lose the flexibility of git submodules and shared code.

@develar
Copy link
Member

develar commented May 11, 2017

Will be implemented.

@DutchKevv
Copy link

+1 same here

My situation:
1 root package.json that is being used when the packaged is being distributed through npm publish.
1 package.json in client folder for Client modules (Angular 4)
1 package.json in server folder for Server modules (Typescript etc)
1 package.json in electron folder (electron-builder etc)

My problem:
Only the server/node_modules needs to be copied (and does that), but now electron copies ALL server/node_modules and it doesn't prune the server/node_modules folder

electron/packager#657 (comment)

@develar develar changed the title Git submodule package.json dependencies. Git submodule package.json dependencies May 30, 2017
@develar
Copy link
Member

develar commented Jun 12, 2017

Fixed, but only if you use default and recommended enabled ASAR packaging. By default asar is enabled, no need to configure anything explicitly. Will be released as electron-builder 19.0.0

@bradydowling
Copy link

bradydowling commented Jul 28, 2018

I'm having this issue with and without asar packaging. I'll dig into it more with asar enabled but @develar what do you mean by "use default"?

Here's the repo I've spun up.

@develar
Copy link
Member

develar commented Jul 28, 2018

@bradydowling My comment is not relevant anymore. Please file a new issue (thanks for project) to be not forgotten

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants