GithubHelp home page GithubHelp logo

Comments (11)

sbruchmann avatar sbruchmann commented on June 5, 2024

There’s also productName, which is a bit more suitable for this task.

from electron-packager.

sindresorhus avatar sindresorhus commented on June 5, 2024

Yes, indeed.

from electron-packager.

klaemo avatar klaemo commented on June 5, 2024

app-version could be inferred from the package.json version field as well, I think. That way building a correctly version app would be as simple as npm version patch|minor|major && npm run build (assuming npm run build does the right thing).

from electron-packager.

rahatarmanahmed avatar rahatarmanahmed commented on June 5, 2024

+1, I might take a stab at this. Should it check for package.json in the cwd? Or search upwards?

Also most likely electron-packager will be in devDependencies, but should it also try and fallback to dependencies if it can't find that?

from electron-packager.

kfranqueiro avatar kfranqueiro commented on June 5, 2024

I think searching upwards seems like a good plan regardless, but here are a couple of off-the-cuff ideas in terms of where to start searching:

  • Start with opts.dir and look upwards, since there may be a package.json there (e.g. to specify main)
    • Possible disadvantage: if you have a more fully-populated package.json higher up your tree
  • Start from ../.. relative to __dirname of electron-packager's main modules (i.e. above the node_modules folder containing it) - this would likely coincide with process.cwd() in common cases, but wouldn't break if people ran it from elsewhere
    • Possible disadvantage: if you use electron-packager globally-installed?

My brain cells are limited at the moment so feel free to point out if I am overlooking something dumb :)

from electron-packager.

rahatarmanahmed avatar rahatarmanahmed commented on June 5, 2024

A good way to avoid the problem in the first way is to keep looking in higher in the tree if the first package.json you find doesn't have an electron-prebuilt dependency or name.

from electron-packager.

Mingling94 avatar Mingling94 commented on June 5, 2024

Request: This should infer to package the dependencies but not the devDependencies

from electron-packager.

rahatarmanahmed avatar rahatarmanahmed commented on June 5, 2024

Do you mean to include dependencies in the build or to use the electron-prebuilt version in dependencies?

from electron-packager.

Mingling94 avatar Mingling94 commented on June 5, 2024

^The former, not your pr.

dependencies mean the electron app needs the package to run, right? devDependencies are not needed. If one uses the package.json as per npm philosophy, ALL the dependencies should be in node_modules and included in the packaged product.

gets off soapbox

from electron-packager.

rahatarmanahmed avatar rahatarmanahmed commented on June 5, 2024

We already have --prune, so if node_modules is in your src path, you can use that to ignore devDependencies.

from electron-packager.

Mingling94 avatar Mingling94 commented on June 5, 2024

Ah, I see!

from electron-packager.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.