Skip to content

Commit

Permalink
Merge pull request #39 from brzpegasus/node-webkit-to-nwjs
Browse files Browse the repository at this point in the history
Rename `node-webkit` to `nwjs`.
  • Loading branch information
brzpegasus committed Jul 25, 2015
2 parents 880bae1 + 78d9dc3 commit bfe88b3
Show file tree
Hide file tree
Showing 16 changed files with 52 additions and 55 deletions.
42 changes: 21 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# ember-cli-node-webkit
# ember-cli-nwjs

[![npm version](https://badge.fury.io/js/ember-cli-node-webkit.svg)](http://badge.fury.io/js/ember-cli-node-webkit)
[![Dependency Status](https://david-dm.org/brzpegasus/ember-cli-node-webkit.svg)](https://david-dm.org/brzpegasus/ember-cli-node-webkit)
[![Build Status](https://travis-ci.org/brzpegasus/ember-cli-node-webkit.svg)](https://travis-ci.org/brzpegasus/ember-cli-node-webkit)
[![npm version](https://badge.fury.io/js/ember-cli-nwjs.svg)](http://badge.fury.io/js/ember-cli-nwjs)
[![Dependency Status](https://david-dm.org/brzpegasus/ember-cli-nwjs.svg)](https://david-dm.org/brzpegasus/ember-cli-nwjs)
[![Build Status](https://travis-ci.org/brzpegasus/ember-cli-nwjs.svg)](https://travis-ci.org/brzpegasus/ember-cli-nwjs)

An [ember-cli](http://www.ember-cli.com/) addon for developing Ember.js applications with [NW.js](http://nwjs.io/) (formerly node-webkit).

Expand All @@ -27,14 +27,14 @@ An [ember-cli](http://www.ember-cli.com/) addon for developing Ember.js applicat
From the root of your Ember CLI project:

```
ember install ember-cli-node-webkit
ember install ember-cli-nwjs
```

This will do the following:

* Install the addon NPM package (`npm install --save-dev ember-cli-node-webkit`)
* Run the addon blueprint (`ember generate node-webkit`)
* Add the blueprint [files](https://github.com/brzpegasus/ember-cli-node-webkit/tree/master/blueprints/node-webkit/files) to your project
* Install the addon NPM package (`npm install --save-dev ember-cli-nwjs`)
* Run the addon blueprint (`ember generate ember-cli-nwjs`)
* Add the blueprint [files](https://github.com/brzpegasus/ember-cli-nwjs/tree/master/blueprints/nwjs/files) to your project
* Install the [`nw`](https://www.npmjs.com/package/nw) NPM package locally

## Build, Watch, and Run NW.js
Expand Down Expand Up @@ -125,7 +125,7 @@ You can pass the following command line options:
ember nw:package
```

This command builds your Ember app, assembles all the assets necessary for NW.js, then generates the final executable using [`node-webkit-builder`](https://github.com/mllrsohn/node-webkit-builder).
This command builds your Ember app, assembles all the assets necessary for NW.js, then generates the final executable using [`nw-builder`](https://github.com/mllrsohn/nw-builder).

### Options

Expand All @@ -140,12 +140,12 @@ You can pass the following command line options:
* Aliases: `-o <value>`

**`--config-file`** _(String)_ (Default: 'config/nw-package.js')
* Configuration file for `node-webkit-builder`
* Configuration file for `nw-builder`
* Aliases: `-f <value>`

### Configuring node-webkit-builder
### Configuring nw-builder

`node-webkit-builder` itself comes with a lot of build [options](https://github.com/mllrsohn/node-webkit-builder#options). You can customize any of those settings by supplying a configuration file named `config/nw-package.js` in your project, or call `ember nw:package` with the `--config-file` option set to the desired file.
`nw-builder` itself comes with a lot of build [options](https://github.com/mllrsohn/nw-builder#options). You can customize any of those settings by supplying a configuration file named `config/nw-package.js` in your project, or call `ember nw:package` with the `--config-file` option set to the desired file.

#### Configuration File

Expand All @@ -165,7 +165,7 @@ module.exports = {

#### Default Settings

`ember-cli-node-webkit` sets the following options by default:
`ember-cli-nwjs` sets the following options by default:

* **files**
* Value: `['package.json', 'dist/**', 'node_modules/<name>/**']`
Expand All @@ -184,28 +184,28 @@ module.exports = {
To install the addon from `master`, run the following:

```
git clone [email protected]:brzpegasus/ember-cli-node-webkit.git
cd ember-cli-node-webkit
git clone [email protected]:brzpegasus/ember-cli-nwjs.git
cd ember-cli-nwjs
npm link
```

Then, in your Ember CLI project:

* Add `ember-cli-node-webkit` to your `package.json`'s dev dependencies so that Ember CLI can discover and register the addon:
* Add `ember-cli-nwjs` to your `package.json`'s dev dependencies so that Ember CLI can discover and register the addon:

```json
{
"devDependencies": {
"ember-cli-node-webkit": "*"
"ember-cli-nwjs": "*"
}
}
```

* Link to your local `ember-cli-node-webkit` and go through the addon install steps:
* Link to your local `ember-cli-nwjs` and go through the addon install steps:

```
npm link ember-cli-node-webkit
ember g node-webkit
npm link ember-cli-nwjs
ember g ember-cli-nwjs
```

### Development
Expand All @@ -217,7 +217,7 @@ To pass the addon code through the linters during development, run `ember build
To run the addon's test suite:

```
cd ember-cli-node-webkit
cd ember-cli-nwjs
npm install
npm test
```
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ function injectScript(scriptName) {
}

module.exports = {
name: 'ember-node-webkit',
name: 'ember-cli-nwjs',

included: function(app) {
this._super.included(app);

if (!process.env.EMBER_CLI_NW) { return; }

app.import({ development: 'vendor/node-webkit/reload.js' });
app.import({ development: 'vendor/nwjs/reload.js' });
if (process.env.NW_TESTS_DEV) {
app.import({ test: 'vendor/node-webkit/browser-qunit-adapter.js' });
app.import({ test: 'vendor/nwjs/browser-qunit-adapter.js' });
} else {
app.import({ test: 'vendor/node-webkit/tap-qunit-adapter.js' });
app.import({ test: 'vendor/nwjs/tap-qunit-adapter.js' });
}
},

Expand Down
2 changes: 1 addition & 1 deletion lib/commands/nw-package.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
var fs = require('fs');
var path = require('path');
var chalk = require('chalk');
var NwBuilder = require('node-webkit-builder');
var NwBuilder = require('nw-builder');

module.exports = {
name: 'nw:package',
Expand Down
4 changes: 0 additions & 4 deletions lib/commands/nw-test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,6 @@ module.exports = {
},

run: function(options) {
// Set environment variable to signal that this is the NW test command
// and not a regular test command
process.env.NW_TEST = true;

options.outputPath = this.tmp();

var promise;
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/nw.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ module.exports = {
ui.writeLine('');
ui.writeLine(chalk.red("Error running the following command: " + nwCommand));
ui.writeLine('');
ui.writeLine(chalk.yellow("Either re-run the blueprint with 'ember g node-webkit' to add NW.js as an NPM dependency in your project,"));
ui.writeLine(chalk.yellow("Either re-run the blueprint with 'ember g ember-cli-nwjs' to add NW.js as an NPM dependency in your project,"));
ui.writeLine(chalk.yellow("or set an environment variable named 'NW_PATH' pointing to your NW.js binary."));
reject();
} else {
Expand Down
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "ember-cli-node-webkit",
"name": "ember-cli-nwjs",
"version": "0.3.5",
"description": "An addon for building desktop apps with Ember and NW.js",
"scripts": {
"test": "node tests/runner.js"
},
"repository": "https://github.com/brzpegasus/ember-cli-node-webkit",
"repository": "https://github.com/brzpegasus/ember-cli-nwjs",
"engines": {
"node": ">= 0.10.0"
},
Expand All @@ -17,7 +17,7 @@
"broccoli-string-replace": "0.0.2",
"chalk": "^1.0.0",
"lodash": "^3.9.3",
"node-webkit-builder": "^1.0.12",
"nw-builder": "^2.0.1",
"optimist": "0.6.1",
"quick-temp": "0.1.2",
"rsvp": "^3.0.18",
Expand All @@ -41,9 +41,10 @@
"keywords": [
"ember-addon",
"node-webkit",
"nw"
"nw",
"nwjs"
],
"ember-addon": {
"defaultBlueprint": "node-webkit"
"defaultBlueprint": "ember-cli-nwjs"
}
}
}
16 changes: 0 additions & 16 deletions tests/helpers/mocks/node-webkit-builder.js

This file was deleted.

16 changes: 16 additions & 0 deletions tests/helpers/mocks/nw-builder.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
'use strict';

var RSVP = require('rsvp');

function MockNWBuilder(options) {
this.options = options;
}

module.exports = MockNWBuilder;

MockNWBuilder.prototype.on = function() {
};

MockNWBuilder.prototype.build = function() {
return RSVP.resolve(this.options);
};
4 changes: 2 additions & 2 deletions tests/unit/commands/nw-package-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var Command = require('ember-cli/lib/models/command');
var Task = require('ember-cli/lib/models/task');
var MockUI = require('ember-cli/tests/helpers/mock-ui');
var MockAnalytics = require('ember-cli/tests/helpers/mock-analytics');
var MockNWBuilder = require('../../helpers/mocks/node-webkit-builder');
var MockNWBuilder = require('../../helpers/mocks/nw-builder');
var MockProject = require('../../helpers/mocks/project');
var expect = require('../../helpers/expect');

Expand All @@ -21,7 +21,7 @@ describe("ember nw:package command", function() {
warnOnUnregistered: false
});

mockery.registerMock('node-webkit-builder', MockNWBuilder);
mockery.registerMock('nw-builder', MockNWBuilder);
mockery.registerMock('../helpers/detect-platform', function() {
return 'osx64';
});
Expand Down

0 comments on commit bfe88b3

Please sign in to comment.