From 78d9dc374db982ca3a6f1cc0f21a7bcc85fe6113 Mon Sep 17 00:00:00 2001 From: Estelle DeBlois Date: Fri, 24 Jul 2015 18:57:00 -0400 Subject: [PATCH] Rename `node-webkit` to `nwjs`. This renames all occurrences of `node-webkit` to `nwjs`. * Rename the project to `ember-cli-nwjs`. * Replace the `node-webkit-builder` package with `nw-builder`. * Rename the blueprint to `ember-cli-nwjs`. --- README.md | 42 +++++++++---------- .../files/.travis.yml | 0 .../files/config/environment.js | 0 .../files/tests/package.json | 0 .../{node-webkit => ember-cli-nwjs}/index.js | 0 .../browser-qunit-adapter.js | 0 client/{node-webkit => nwjs}/reload.js | 0 .../tap-qunit-adapter.js | 0 index.js | 8 ++-- lib/commands/nw-package.js | 2 +- lib/commands/nw-test/index.js | 4 -- lib/commands/nw.js | 2 +- package.json | 13 +++--- tests/helpers/mocks/node-webkit-builder.js | 16 ------- tests/helpers/mocks/nw-builder.js | 16 +++++++ tests/unit/commands/nw-package-test.js | 4 +- 16 files changed, 52 insertions(+), 55 deletions(-) rename blueprints/{node-webkit => ember-cli-nwjs}/files/.travis.yml (100%) rename blueprints/{node-webkit => ember-cli-nwjs}/files/config/environment.js (100%) rename blueprints/{node-webkit => ember-cli-nwjs}/files/tests/package.json (100%) rename blueprints/{node-webkit => ember-cli-nwjs}/index.js (100%) rename client/{node-webkit => nwjs}/browser-qunit-adapter.js (100%) rename client/{node-webkit => nwjs}/reload.js (100%) rename client/{node-webkit => nwjs}/tap-qunit-adapter.js (100%) delete mode 100644 tests/helpers/mocks/node-webkit-builder.js create mode 100644 tests/helpers/mocks/nw-builder.js diff --git a/README.md b/README.md index f1a93bf..97d8757 100644 --- a/README.md +++ b/README.md @@ -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). @@ -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 @@ -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 @@ -140,12 +140,12 @@ You can pass the following command line options: * Aliases: `-o ` **`--config-file`** _(String)_ (Default: 'config/nw-package.js') - * Configuration file for `node-webkit-builder` + * Configuration file for `nw-builder` * Aliases: `-f ` -### 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 @@ -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//**']` @@ -184,28 +184,28 @@ module.exports = { To install the addon from `master`, run the following: ``` -git clone git@github.com:brzpegasus/ember-cli-node-webkit.git -cd ember-cli-node-webkit +git clone git@github.com: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 @@ -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 ``` diff --git a/blueprints/node-webkit/files/.travis.yml b/blueprints/ember-cli-nwjs/files/.travis.yml similarity index 100% rename from blueprints/node-webkit/files/.travis.yml rename to blueprints/ember-cli-nwjs/files/.travis.yml diff --git a/blueprints/node-webkit/files/config/environment.js b/blueprints/ember-cli-nwjs/files/config/environment.js similarity index 100% rename from blueprints/node-webkit/files/config/environment.js rename to blueprints/ember-cli-nwjs/files/config/environment.js diff --git a/blueprints/node-webkit/files/tests/package.json b/blueprints/ember-cli-nwjs/files/tests/package.json similarity index 100% rename from blueprints/node-webkit/files/tests/package.json rename to blueprints/ember-cli-nwjs/files/tests/package.json diff --git a/blueprints/node-webkit/index.js b/blueprints/ember-cli-nwjs/index.js similarity index 100% rename from blueprints/node-webkit/index.js rename to blueprints/ember-cli-nwjs/index.js diff --git a/client/node-webkit/browser-qunit-adapter.js b/client/nwjs/browser-qunit-adapter.js similarity index 100% rename from client/node-webkit/browser-qunit-adapter.js rename to client/nwjs/browser-qunit-adapter.js diff --git a/client/node-webkit/reload.js b/client/nwjs/reload.js similarity index 100% rename from client/node-webkit/reload.js rename to client/nwjs/reload.js diff --git a/client/node-webkit/tap-qunit-adapter.js b/client/nwjs/tap-qunit-adapter.js similarity index 100% rename from client/node-webkit/tap-qunit-adapter.js rename to client/nwjs/tap-qunit-adapter.js diff --git a/index.js b/index.js index 7ad2f97..9621b8e 100644 --- a/index.js +++ b/index.js @@ -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' }); } }, diff --git a/lib/commands/nw-package.js b/lib/commands/nw-package.js index 3725188..23c68e9 100644 --- a/lib/commands/nw-package.js +++ b/lib/commands/nw-package.js @@ -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', diff --git a/lib/commands/nw-test/index.js b/lib/commands/nw-test/index.js index 25442ea..32d5dd6 100644 --- a/lib/commands/nw-test/index.js +++ b/lib/commands/nw-test/index.js @@ -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; diff --git a/lib/commands/nw.js b/lib/commands/nw.js index f134e3e..dc93164 100644 --- a/lib/commands/nw.js +++ b/lib/commands/nw.js @@ -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 { diff --git a/package.json b/package.json index fdbadac..f1accaf 100644 --- a/package.json +++ b/package.json @@ -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" }, @@ -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", @@ -41,9 +41,10 @@ "keywords": [ "ember-addon", "node-webkit", - "nw" + "nw", + "nwjs" ], "ember-addon": { - "defaultBlueprint": "node-webkit" + "defaultBlueprint": "ember-cli-nwjs" } -} \ No newline at end of file +} diff --git a/tests/helpers/mocks/node-webkit-builder.js b/tests/helpers/mocks/node-webkit-builder.js deleted file mode 100644 index f0f6ae2..0000000 --- a/tests/helpers/mocks/node-webkit-builder.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; - -var RSVP = require('rsvp'); - -function MockNodeWebkitBuilder(options) { - this.options = options; -} - -module.exports = MockNodeWebkitBuilder; - -MockNodeWebkitBuilder.prototype.on = function() { -}; - -MockNodeWebkitBuilder.prototype.build = function() { - return RSVP.resolve(this.options); -}; diff --git a/tests/helpers/mocks/nw-builder.js b/tests/helpers/mocks/nw-builder.js new file mode 100644 index 0000000..d082c09 --- /dev/null +++ b/tests/helpers/mocks/nw-builder.js @@ -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); +}; diff --git a/tests/unit/commands/nw-package-test.js b/tests/unit/commands/nw-package-test.js index 9147b25..c5c3f98 100644 --- a/tests/unit/commands/nw-package-test.js +++ b/tests/unit/commands/nw-package-test.js @@ -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'); @@ -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'; });