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

various blueprint cleanup and consistency #6937

Merged
merged 1 commit into from
Apr 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions blueprints/addon-import/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const SilentError = require('silent-error');

module.exports = {
description: 'Generates an import wrapper.',

beforeInstall(options) {
if (options.originBlueprintName === 'addon-import') {
throw new SilentError('You cannot call the addon-import blueprint directly.');
Expand Down Expand Up @@ -35,6 +36,7 @@ module.exports = {
},
};
},

locals(options) {
let addonRawName = options.inRepoAddon ? options.inRepoAddon : options.project.name();
let addonName = stringUtil.dasherize(addonRawName);
Expand Down
3 changes: 2 additions & 1 deletion blueprints/addon/files/ember-cli-build.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';
/* eslint-env node */
'use strict';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't the strict directive be the top-most thing in the file?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes


const EmberAddon = require('ember-cli/lib/broccoli/ember-addon');

module.exports = function(defaults) {
Expand Down
2 changes: 1 addition & 1 deletion blueprints/app/files/config/environment.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
/* eslint-env node */
'use strict';

module.exports = function(environment) {
let ENV = {
Expand Down
1 change: 0 additions & 1 deletion blueprints/app/files/config/targets.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-env node */

module.exports = {
browsers: [
'ie 9',
Expand Down
3 changes: 2 additions & 1 deletion blueprints/app/files/ember-cli-build.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';
/* eslint-env node */
'use strict';

const EmberApp = require('ember-cli/lib/broccoli/ember-app');

module.exports = function(defaults) {
Expand Down
3 changes: 2 additions & 1 deletion blueprints/http-mock/files/server/mocks/__name__.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';
/* eslint-env node */
'use strict';

module.exports = function(app) {
const express = require('express');
let <%= camelizedModuleName %>Router = express.Router();
Expand Down
1 change: 0 additions & 1 deletion blueprints/http-mock/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ module.exports = {
},

afterInstall(options) {

if (!options.dryRun && isPackageMissing(this, 'express')) {
return this.addPackagesToProject([
{ name: 'express', target: '^4.8.5' },
Expand Down
3 changes: 2 additions & 1 deletion blueprints/http-proxy/files/server/proxies/__name__.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';
/* eslint-env node */
'use strict';

const proxyPath = '/<%=camelizedModuleName %>';

module.exports = function(app) {
Expand Down
5 changes: 2 additions & 3 deletions blueprints/server/files/server/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
/* eslint-env node */
'use strict';

// To use it create some files under `mocks/`
// e.g. `server/mocks/ember-hamsters.js`
Expand All @@ -16,10 +16,9 @@ module.exports = function(app) {
const proxies = globSync('./proxies/**/*.js', { cwd: __dirname }).map(require);

// Log proxy requests
const morgan = require('morgan');
const morgan = require('morgan');
app.use(morgan('dev'));

mocks.forEach(function(route) { route(app); });
proxies.forEach(function(route) { route(app); });

};
1 change: 1 addition & 0 deletions blueprints/vendor-shim/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const stringUtil = require('ember-cli-string-utils');

module.exports = {
description: 'Generates an ES6 module shim for global libraries.',

locals(options) {
let entity = options.entity;
let rawName = entity.name;
Expand Down