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

Add public API #54

Closed
malept opened this issue Dec 31, 2016 · 2 comments
Closed

Add public API #54

malept opened this issue Dec 31, 2016 · 2 comments
Assignees

Comments

@malept
Copy link
Member

malept commented Dec 31, 2016

As it currently stands, Electron Forge is CLI driven. If you want to interact with it in another Node module, you need to shell out. In order to better integrate with solutions such as ember-electron, we should refactor the logic so that it's accessible via a public (documented) API.

@MarshallOfSound
Copy link
Member

MarshallOfSound commented Dec 31, 2016

As briefly mentioned in slack I think the easiest way to make this work is

  • Extract all actual logic in all the "main" async functions to their own files in a new folder "api"
  • Make these functions take in a single options parameter with the same property names as the "program" object.
  • Add another property to all options objects interactive which defaults to false and would disable ora and inquirer (so that when you use the API we don't flood their console)
  • Set the main file of electron-forge to export all the commands as named constants so that users can simply
import { lint, make, publish } from 'electron-forge';

/cc @felixrieseberg

@MarshallOfSound
Copy link
Member

The one thing I really want to avoid is maintaining two separate interfaces for electron-forge, we just be first party consumers of the "API" ourselves to avoid this happening.

MarshallOfSound added a commit that referenced this issue Jan 1, 2017
@malept malept removed the help wanted label Jan 1, 2017
MarshallOfSound added a commit that referenced this issue Jan 3, 2017
@malept malept closed this as completed in #56 Jan 4, 2017
malept pushed a commit that referenced this issue Jan 4, 2017
dsanders11 pushed a commit that referenced this issue Jan 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants