2.9.1 • Published 6 years ago

neutron v2.9.1

Weekly downloads
10
License
MIT
Repository
github
Last release
6 years ago

npm.io

Build Status Join the community on Spectrum

This package provides you with a belt full of all the tools you need for building a Electron application.

Aside from making the creation of a new application as easy as baking 🥞, it even ensures you won't get any trouble when the codebase gets huge.

While the main process is kept free from any form of transpilation setup (since Electron ships with a up-to-date version of Node.js), the renderer process is backed by Next.js, a framework for building React applications which has already seen tremendous growth and acceptance among the community.

Features

  • Create a New App with a Single Command: The only thing you need to do in order to create a new boilerplate with everything necessary already installed is running neutron init. That's all.

  • Compiler Included: Once you've finished developing your application, the neutron build command is the only thing needed for generating application bundles (.app for macOS, .exe for Windows, etc).

  • No Need to Set up Any Tooling: Things like hot code reloading, transpiling and bundling are all taken care of. No further tools required, just run neutron.

  • Releases Handled Properly: After you ran release to create a new GitHub Release, Neutron will automatically upload the application bundles to it (works with Circle CI, AppVeyor and Travis CI).

Isn't that magical? 💫

No matter if you're already familiar with the concept of building Electron applications backed by Next.js or not, I highly recommend at least giving it a shot. Just read on, it's very easy!

Get Started

To create a fresh app, you only need to have Node.js installed. Then run this command:

npx neutron init

That's it – now follow the instructions shown! 🚀

To be clear: If your friend (who hasn't developed any mac applications at all yet) wants to get started with building such applications, these are litterally the only steps to follow:

  1. Buy computer
  2. Install Node.js
  3. Run npx neutron init
  4. 🎉

Commands & Options

To get a list of all available sub commands and options, run this command:

neutron --help

This also works for sub commands. Here's an example for build:

neutron build --help

Configuration

By default, neutron will work just fine without any addition configuration. However, you can add a property named neutron to the package.json file of your application for changing the behaviour:

"neutron": {
  "name": "Test"
}

IMPORTANT: All of these configuration properties are optional.

It can hold the following properties (the dot in property names indicates a sub property):

All Operating Systems

PropertyDescription
nameHolds the name of your application on all platforms.
asarBy default, this is set to true, which bundles the application into an ASAR archive. Set it to false to disable it (can be useful for debugging, but should always be true in production).

macOS

PropertyDescription
macOS.idThe string that identifies your application to the system. As an example: If your company is called "ZEIT" (zeit.co) and your application is called "Now", the id should be "co.zeit.now".
macOS.categoryThe type of application you're building (possible values).
macOS.infoThis property lets you extend the information contained within the Info.plist files in your bundle. It holds an object made of key value pairs to include in those files. As an example, adding LSUIElement with a value of 1 would hide the dock icon forever.
macOS.iconThe path to a .icns file, which acts as the icon of your macOS application (relative to working directory).
macOS.signature.identityName of certificate to use when signing. Default to be selected with respect to provisioning-profile and platform from keychain or keychain by system default.
macOS.signature.entitlementsPath to entitlements file for signing the app. Default to built-in entitlements file, Sandbox enabled for Mac App Store platform.
macOS.signature.entitlements-inheritPath to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. This option only applies when signing with entitlements.
macOS.signature.flatSet to true to create installer package for shipping on Mac App Store

Windows

PropertyDescription
windows.msiBy default, a .exe installer without any wizard steps will be generated. If you want to also receive a MS installer in addition, you can set this option to true.
windows.loadingGIFA custom path to a GIF that shows while your Windows application is being installed using the .exe installer (relative to working directory).
windows.iconThe path to a .ico file, which acts as the icon of your Windows application (relative to working directory).
windows.setupIconBy default, the installer for your Windows application will have the same icon as the application itself. If you want a separate one for it, this property can be set to the path to a .ico file (relative to working directory).

Lifecycle Hooks

If you need to perform custom operations during specific actions neutron is taking, you can specify lifecycle scripts in your project's package.json file (just like you would do for npm lifecycle scripts).

Here's an example of how this could look:

{
  "name": "my-app",
  "version": "1.0.0",
  "scripts": {
    "dev": "neutron",
    "build": "neutron build",
    "neutron-after-bundle": "echo 'This hook is run after neutron has bundled your app'"
  }
}
Script NameWhen It Runs
neutron-before-bundleWill be run before your app was bundled.
neutron-after-bundleWill be run after your app was bundled.

Badge

Do you want to help us spread the word? Feel free to add this badge to your repository:

badge

Simply embed this markdown code in your readme.md file:

<!-- Below or next to the top heading -->
[![badge][neutron-badge]][neutron-link]

<!-- At the bottom of the file -->
[neutron-badge]: https://img.shields.io/badge/built%20with-neutron-ff69b4.svg?style=flat
[neutron-link]: https://github.com/zeit/neutron

Contributing

  1. Fork this repository to your own GitHub account and then clone it to your local device
  2. Uninstall neutron if it's already installed: yarn global remove neutron
  3. Link it to the global module directory by running this command in the repo directory: yarn link

After that, you can use the neutron command everywhere!

Authors

2.9.1

6 years ago

2.9.0

6 years ago

2.8.0

6 years ago

2.7.1

6 years ago

2.7.0

6 years ago

2.6.4

6 years ago

2.6.3

6 years ago

2.6.2

6 years ago

2.6.1

6 years ago

2.6.0

6 years ago

2.5.1

6 years ago

2.5.0

6 years ago

2.4.0

6 years ago

2.3.1

6 years ago

2.3.0

6 years ago

2.2.0

6 years ago

2.1.7

6 years ago

2.1.6

6 years ago

2.1.5

6 years ago

2.1.4

6 years ago

2.1.3

6 years ago

2.1.2

6 years ago

2.1.1

6 years ago

2.1.0

6 years ago

2.0.1

6 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago