Skip to content

Commit

Permalink
Merge branch 'master' into update-perf-guide
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanpenner committed Apr 25, 2017
2 parents 517edbe + c0028fe commit be503a9
Show file tree
Hide file tree
Showing 208 changed files with 8,707 additions and 7,825 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2

[*.hbs]
insert_final_newline = false
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module.exports = {
env: {
browser: false,
node: true,
es6: true,
},
globals: {
},
Expand Down
12 changes: 6 additions & 6 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ module.exports = Command.extend({
...
],

run: function(options) { // Required
run(options) { // Required
// options === { packageName, ... }

// Run tasks and return a promise
},

printDetailedHelp: function() { // Optional
printDetailedHelp() { // Optional
this.ui.write('Detailed help...');
}
});
Expand Down Expand Up @@ -166,7 +166,7 @@ The file format of a task looks like this:
var Task = require('../task');

module.exports = Task.extend({
run: function(options) {
run(options) {
// return promise
}
});
Expand Down Expand Up @@ -272,7 +272,7 @@ when that task is invoked, not for `ember help` `ember version` or even
var npm = require('npm');

module.exports = Task.extend({
run: function() {
run() {
npm.install() // or something
}
});
Expand All @@ -287,10 +287,10 @@ example:

```js
module.exports = Task.extend({
init: function() {
init() {
this.npm = this.npm || require('npm');
},
run: function() {
run() {
this.npm.install() // or something
}
});
Expand Down
380 changes: 373 additions & 7 deletions CHANGELOG.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions PERF_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ To generate visualization:
+ `broccoli-viz instrumentation.build.0.json > instrumentation.build.0.dot`
+ `dot -Tpng instrumentation.build.0.dot > instrumentation.build.0.png`


Each build will generate an additional graph, `instrumentation.build.<build-number>.json`

#### in-depth look
Expand Down
18 changes: 1 addition & 17 deletions bin/ember
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,6 @@
// Provide a title to the process in `ps`
process.title = 'ember';

var instrumentation = require('../lib/utilities/instrumentation');

var instrumentationEnabled = instrumentation.instrumentationEnabled;

var initInstrumentation;

if (instrumentationEnabled()) {
var heimdall = require('heimdalljs');
var initInstrumentationToken = heimdall.start('init');
initInstrumentation = {
token: initInstrumentationToken,
node: heimdall.current,
};
}

// require('time-require');
var resolve = require('resolve');
var exit = require('exit');
Expand All @@ -43,8 +28,7 @@ resolve('ember-cli', {
cliArgs: process.argv.slice(2),
inputStream: process.stdin,
outputStream: process.stdout,
errorStream: process.stderr,
initInstrumentation: initInstrumentation,
errorStream: process.stderr
}).then(function(result) {
var exitCode = typeof result === 'object' ? result.exitCode : result;
exit(exitCode);
Expand Down
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
24 changes: 16 additions & 8 deletions blueprints/addon/files/.travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
---
language: node_js
node_js:
- "6"
- "4"

sudo: false

cache:
<% if (yarn) { %>cache:
yarn: true
<% } else { %>cache:
directories:
- $HOME/.npm
- $HOME/.cache # includes bowers cache

<% } %>
env:
# we recommend testing LTS's and latest stable release (bonus points to beta/canary)
- EMBER_TRY_SCENARIO=ember-lts-2.4
Expand All @@ -24,15 +25,22 @@ matrix:
allow_failures:
- env: EMBER_TRY_SCENARIO=ember-canary

before_install:
<% if (yarn) { %>before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH=$HOME/.yarn/bin:$PATH
- yarn global add phantomjs-prebuilt
- phantomjs --version

install:
- yarn install --no-lockfile
<% } else { %>before_install:
- npm config set spin false
- npm install -g bower phantomjs-prebuilt
- bower --version
- npm install -g phantomjs-prebuilt
- phantomjs --version

install:
- npm install
- bower install
<% } %>

script:
# Usually, it's ok to finish the test scenario without reverting
Expand Down
15 changes: 5 additions & 10 deletions blueprints/addon/files/addon-config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ module.exports = {
name: 'ember-lts-2.4',
bower: {
dependencies: {
'ember': 'components/ember#lts-2-4',
'ember-cli-shims': '0.1.3'
'ember': 'components/ember#lts-2-4'
},
resolutions: {
'ember': 'lts-2-4'
Expand All @@ -22,8 +21,7 @@ module.exports = {
name: 'ember-lts-2.8',
bower: {
dependencies: {
'ember': 'components/ember#lts-2-8',
'ember-cli-shims': '0.1.3'
'ember': 'components/ember#lts-2-8'
},
resolutions: {
'ember': 'lts-2-8'
Expand All @@ -39,8 +37,7 @@ module.exports = {
name: 'ember-release',
bower: {
dependencies: {
'ember': 'components/ember#release',
'ember-cli-shims': '0.1.3'
'ember': 'components/ember#release'
},
resolutions: {
'ember': 'release'
Expand All @@ -56,8 +53,7 @@ module.exports = {
name: 'ember-beta',
bower: {
dependencies: {
'ember': 'components/ember#beta',
'ember-cli-shims': '0.1.3'
'ember': 'components/ember#beta'
},
resolutions: {
'ember': 'beta'
Expand All @@ -73,8 +69,7 @@ module.exports = {
name: 'ember-canary',
bower: {
dependencies: {
'ember': 'components/ember#canary',
'ember-cli-shims': '0.1.3'
'ember': 'components/ember#canary'
},
resolutions: {
'ember': 'canary'
Expand Down
4 changes: 3 additions & 1 deletion blueprints/addon/files/ember-cli-build.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
/* eslint-env node */
'use strict';

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

module.exports = function(defaults) {
var app = new EmberAddon(defaults, {
let app = new EmberAddon(defaults, {
// Add options here
});

Expand Down
34 changes: 22 additions & 12 deletions blueprints/addon/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ const stringifyAndNormalize = require('../../lib/utilities/stringify-and-normali
module.exports = {
description: 'The default blueprint for ember-cli addons.',

filesToRemove: [
'tests/dummy/app/styles/.gitkeep',
'tests/dummy/app/templates/.gitkeep',
'tests/dummy/app/views/.gitkeep',
'tests/dummy/public/.gitkeep',
'Brocfile.js',
'testem.json',
],

generatePackageJson() {
let contents = this._readContentsFromFile('package.json');

Expand Down Expand Up @@ -54,20 +63,12 @@ module.exports = {
this._writeContentsToFile(sortPackageJson(contents), 'package.json');
},

generateBowerJson() {
let contents = this._readContentsFromFile('bower.json');

contents.name = '<%= addonName %>';

this._writeContentsToFile(contents, 'bower.json');
},

afterInstall() {
let packagePath = path.join(this.path, 'files', 'package.json');
let bowerPath = path.join(this.path, 'files', 'bower.json');

[packagePath, bowerPath].forEach(filePath => {
fs.remove(filePath);
fs.removeSync(filePath);
});
},

Expand All @@ -91,6 +92,8 @@ module.exports = {
addonNamespace,
emberCLIVersion: require('../../package').version,
year: date.getFullYear(),
yarn: options.yarn,
welcome: options.welcome,
};
},

Expand All @@ -101,7 +104,6 @@ module.exports = {
let appFiles = this._appBlueprint.files();

this.generatePackageJson();
this.generateBowerJson();

let addonFiles = walkSync(path.join(this.path, 'files'));

Expand Down Expand Up @@ -156,11 +158,19 @@ module.exports = {

_readContentsFromFile(fileName) {
let packagePath = path.join(this._appBlueprint.path, 'files', fileName);
return fs.readJsonSync(packagePath);
return this._readJsonSync(packagePath);
},

_writeContentsToFile(contents, fileName) {
let packagePath = path.join(this.path, 'files', fileName);
fs.writeFileSync(packagePath, stringifyAndNormalize(contents));
this._writeFileSync(packagePath, stringifyAndNormalize(contents));
},

_readJsonSync(path) {
return fs.readJsonSync(path);
},

_writeFileSync(path, content) {
fs.writeFileSync(path, content);
},
};
4 changes: 0 additions & 4 deletions blueprints/app/files/.bowerrc

This file was deleted.

13 changes: 13 additions & 0 deletions blueprints/app/files/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
root: true,
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module'
},
extends: 'eslint:recommended',
env: {
browser: true
},
rules: {
}
};
21 changes: 16 additions & 5 deletions blueprints/app/files/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,32 @@ node_js:
- "6"

sudo: false
<% if (yarn) { %>
cache:
yarn: true

before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH=$HOME/.yarn/bin:$PATH
- yarn global add phantomjs-prebuilt
- phantomjs --version

install:
- yarn install

script:
- yarn test<% } else { %>
cache:
directories:
- $HOME/.npm
- $HOME/.cache # includes bowers cache

before_install:
- npm config set spin false
- npm install -g bower phantomjs-prebuilt
- bower --version
- npm install -g phantomjs-prebuilt
- phantomjs --version

install:
- npm install
- bower install

script:
- npm test
- npm test<% } %>
2 changes: 0 additions & 2 deletions blueprints/app/files/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ You will need the following things properly installed on your computer.

* [Git](https://git-scm.com/)
* [Node.js](https://nodejs.org/) (with NPM)
* [Bower](https://bower.io/)
* [Ember CLI](https://ember-cli.com/)
* [PhantomJS](http://phantomjs.org/)

Expand All @@ -18,7 +17,6 @@ You will need the following things properly installed on your computer.
* `git clone <repository-url>` this repository
* `cd <%= name %>`
* `npm install`
* `bower install`

## Running / Development

Expand Down
5 changes: 3 additions & 2 deletions blueprints/app/files/app/templates/application.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{{!-- The following component displays Ember's default welcome message. --}}
<% if (welcome) { %>{{!-- The following component displays Ember's default welcome message. --}}
{{welcome-page}}
{{!-- Feel free to remove this! --}}

<% } else { %><h2 id="title">Welcome to Ember</h2>
<% } %>
{{outlet}}
5 changes: 0 additions & 5 deletions blueprints/app/files/bower.json

This file was deleted.

0 comments on commit be503a9

Please sign in to comment.