Skip to content

fix: add loader for gif #1888

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ environment:
- nodejs_version: "5.0"
- nodejs_version: "6.0"

matrix:
fast_finish: true

install:
- ps: Install-Product node $env:nodejs_version
- npm install
Expand All @@ -11,5 +14,6 @@ test_script:
- node --version
- npm --version
- npm test
- npm run test:e2e

build: off
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
dist/
node_modules/
npm-debug.log
npm-debug.log*

# IDEs
.idea/
jsconfig.json
.vscode/

# Typings file.
typings/
Expand Down
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,22 @@ env:
matrix:
- SCRIPT=lint
# - SCRIPT=build
- SCRIPT=e2e
- SCRIPT=e2e:nightly
- SCRIPT=test
# - TARGET=mobile SCRIPT=mobile_test
matrix:
fast_finish: true
allow_failures:
- os: osx
- env: SCRIPT=e2e:nightly
exclude:
- node_js: "6"
env: SCRIPT=lint
- os: osx
env: SCRIPT=e2e:nightly
- node_js: "6"
env: SCRIPT=e2e:nightly
- os: osx
node_js: "5"
env: SCRIPT=lint
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Navigate to `http://localhost:4200/`. The app will automatically reload if you c
You can configure the default HTTP port and the one used by the LiveReload server with two command-line options :

```bash
ng serve --port 4201 --live-reload-port 49153
ng serve --host 0.0.0.0 --port 4201 --live-reload-port 49153
```

### Generating Components, Directives, Pipes and Services
Expand Down
3 changes: 0 additions & 3 deletions WEBPACK_UPDATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ rm -rf node_modules dist tmp typings
npm install --save-dev angular-cli@webpack
```

IMPORTANT NOTE:
Currently project generated with `ng new` will use a wrong local CLI version (see https://github.com/angular/angular-cli/issues/1528). After initializing your project, run `npm install --save-dev angular-cli@webpack` to set the correct version.

## Project files

You will need to run `ng init` to check for changes in all the auto-generated files created by `ng new` and allow you to update yours. You are offered four choices for each changed file: `y` (overwrite), `n` (don't overwrite), `d` (show diff between your file and the updated file) and `h` (help).
Expand Down
28 changes: 11 additions & 17 deletions addon/ng2/blueprints/component/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ var path = require('path');
var chalk = require('chalk');
var Blueprint = require('ember-cli/lib/models/blueprint');
var dynamicPathParser = require('../../utilities/dynamic-path-parser');
const findParentModule = require('../../utilities/find-parent-module').default;
var getFiles = Blueprint.prototype.files;
const stringUtils = require('ember-cli-string-utils');
const astUtils = require('../../utilities/ast-utils');
Expand All @@ -11,13 +12,20 @@ module.exports = {

availableOptions: [
{ name: 'flat', type: Boolean, default: false },
{ name: 'route', type: Boolean, default: false },
{ name: 'inline-template', type: Boolean, default: false, aliases: ['it'] },
{ name: 'inline-style', type: Boolean, default: false, aliases: ['is'] },
{ name: 'prefix', type: Boolean, default: true },
{ name: 'spec', type: Boolean, default: true }
],

beforeInstall: function() {
try {
this.pathToModule = findParentModule(this.project, this.dynamicPath.dir);
} catch(e) {
throw `Error locating module for declaration\n\t${e}`;
}
},

normalizeEntityName: function (entityName) {
var parsedPath = dynamicPathParser(this.project, entityName);

Expand Down Expand Up @@ -54,7 +62,6 @@ module.exports = {
inlineTemplate: options.inlineTemplate,
inlineStyle: options.inlineStyle,
route: options.route,
isLazyRoute: !!options.isLazyRoute,
isAppComponent: !!options.isAppComponent,
selector: this.selector,
styleExt: this.styleExt
Expand Down Expand Up @@ -84,18 +91,6 @@ module.exports = {
var dir = this.dynamicPath.dir;
if (!options.locals.flat) {
dir += path.sep + options.dasherizedModuleName;

if (options.locals.isLazyRoute) {
var lazyRoutePrefix = '+';
if (this.project.ngConfig &&
this.project.ngConfig.defaults &&
this.project.ngConfig.defaults.lazyRoutePrefix !== undefined) {
lazyRoutePrefix = this.project.ngConfig.defaults.lazyRoutePrefix;
}
var dirParts = dir.split(path.sep);
dirParts[dirParts.length - 1] = `${lazyRoutePrefix}${dirParts[dirParts.length - 1]}`;
dir = dirParts.join(path.sep);
}
}
var srcDir = this.project.ngConfig.apps[0].root;
this.appDir = dir.substr(dir.indexOf(srcDir) + srcDir.length);
Expand All @@ -114,15 +109,14 @@ module.exports = {
}

const returns = [];
const modulePath = path.join(this.project.root, this.dynamicPath.appRoot, 'app.module.ts');
const className = stringUtils.classify(`${options.entity.name}Component`);
const fileName = stringUtils.dasherize(`${options.entity.name}.component`);
const componentDir = path.relative(this.dynamicPath.appRoot, this.generatePath);
const componentDir = path.relative(path.dirname(this.pathToModule), this.generatePath);
const importPath = componentDir ? `./${componentDir}/${fileName}` : `./${fileName}`;

if (!options['skip-import']) {
returns.push(
astUtils.addComponentToModule(modulePath, className, importPath)
astUtils.addDeclarationToModule(this.pathToModule, className, importPath)
.then(change => change.apply()));
}

Expand Down
14 changes: 11 additions & 3 deletions addon/ng2/blueprints/directive/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ var path = require('path');
var dynamicPathParser = require('../../utilities/dynamic-path-parser');
const stringUtils = require('ember-cli-string-utils');
const astUtils = require('../../utilities/ast-utils');
const findParentModule = require('../../utilities/find-parent-module').default;

module.exports = {
description: '',
Expand All @@ -11,11 +12,19 @@ module.exports = {
{ name: 'prefix', type: Boolean, default: true }
],

beforeInstall: function() {
try {
this.pathToModule = findParentModule(this.project, this.dynamicPath.dir);
} catch(e) {
throw `Error locating module for declaration\n\t${e}`;
}
},

normalizeEntityName: function (entityName) {
var parsedPath = dynamicPathParser(this.project, entityName);

this.dynamicPath = parsedPath;

var defaultPrefix = '';
if (this.project.ngConfig &&
this.project.ngConfig.apps[0] &&
Expand Down Expand Up @@ -56,15 +65,14 @@ module.exports = {
}

const returns = [];
const modulePath = path.join(this.project.root, this.dynamicPath.appRoot, 'app.module.ts');
const className = stringUtils.classify(`${options.entity.name}Directive`);
const fileName = stringUtils.dasherize(`${options.entity.name}.directive`);
const componentDir = path.relative(this.dynamicPath.appRoot, this.generatePath);
const importPath = componentDir ? `./${componentDir}/${fileName}` : `./${fileName}`;

if (!options['skip-import']) {
returns.push(
astUtils.addComponentToModule(modulePath, className, importPath)
astUtils.addDeclarationToModule(this.pathToModule, className, importPath)
.then(change => change.apply()));
}

Expand Down
13 changes: 5 additions & 8 deletions addon/ng2/blueprints/module/files/__path__/__name__.module.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { routing } from './<%= dasherizedModuleName %>.routes';
import { <%= classifiedModuleName %>Component } from './<%= dasherizedModuleName %>.component';
import { CommonModule } from '@angular/common';<% if (routing) { %>
import { <%= camelizedModuleName %>Routing } from './<%= dasherizedModuleName %>.routing';<% } %>

@NgModule({
imports: [
CommonModule,
routing
CommonModule<% if (routing) { %>,
<%= camelizedModuleName %>Routing<% } %>
],
declarations: [
<%= classifiedModuleName %>Component
]
declarations: []
})
export class <%= classifiedModuleName %>Module { }
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { Routes, RouterModule } from '@angular/router';

export const <%= camelizedModuleName %>Routes: Routes = [];

export const <%= camelizedModuleName %>Routing = RouterModule.forChild(<%= camelizedModuleName %>˝Routes);

21 changes: 13 additions & 8 deletions addon/ng2/blueprints/module/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ module.exports = {
description: '',

availableOptions: [
{ name: 'spec', type: Boolean, default: false }
{ name: 'spec', type: Boolean, default: false },
{ name: 'routing', type: Boolean, default: false }
],

normalizeEntityName: function (entityName) {
this.entityName = entityName;
var parsedPath = dynamicPathParser(this.project, entityName);
Expand All @@ -19,9 +20,10 @@ module.exports = {
},

locals: function (options) {
return {
return {
dynamicPath: this.dynamicPath.dir,
spec: options.spec
spec: options.spec,
routing: options.routing
};
},

Expand All @@ -31,6 +33,9 @@ module.exports = {
if (!this.options || !this.options.spec) {
fileList = fileList.filter(p => p.indexOf('__name__.module.spec.ts') < 0);
}
if (this.options && !this.options.routing) {
fileList = fileList.filter(p => p.indexOf('__name__.routing.ts') < 0);
}

return fileList;
},
Expand All @@ -40,17 +45,17 @@ module.exports = {
this.dasherizedModuleName = options.dasherizedModuleName;
return {
__path__: () => {
this.generatePath = this.dynamicPath.dir
+ path.sep
this.generatePath = this.dynamicPath.dir
+ path.sep
+ options.dasherizedModuleName;
return this.generatePath;
}
};
},

afterInstall: function (options) {
options.entity.name = this.entityName;
options.flat = false;
options.entity.name = path.join(this.entityName, this.dasherizedModuleName);
options.flat = true;
options.route = false;
options.inlineTemplate = false;
options.inlineStyle = false;
Expand Down
2 changes: 1 addition & 1 deletion addon/ng2/blueprints/ng2/files/__path__/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import "./polyfills.ts";
import './polyfills.ts';

import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { enableProdMode } from '@angular/core';
Expand Down
4 changes: 3 additions & 1 deletion addon/ng2/blueprints/ng2/files/__path__/test.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import './polyfills.ts';

import 'zone.js/dist/long-stack-trace-zone';
import 'zone.js/dist/proxy.js';
import 'zone.js/dist/sync-test';
import 'zone.js/dist/jasmine-patch';
import 'zone.js/dist/async-test';
import 'zone.js/dist/fake-async-test';
import 'zone.js/dist/sync-test';

// Unfortunately there's no typing for the `__karma__` variable. Just declare it as any.
declare var __karma__: any;
declare var require: any;

// Prevent Karma from running prematurely.
__karma__.loaded = function () {};
Expand Down
3 changes: 0 additions & 3 deletions addon/ng2/blueprints/ng2/files/__path__/typings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,3 @@
// https://www.typescriptlang.org/docs/handbook/writing-declaration-files.html

declare var System: any;
declare var module: { id: string };
declare var require: any;

3 changes: 1 addition & 2 deletions addon/ng2/blueprints/ng2/files/angular-cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
},
"defaults": {
"styleExt": "<%= styleExt %>",
"prefixInterfaces": false,
"lazyRoutePrefix": "+"
"prefixInterfaces": false
}
}
33 changes: 17 additions & 16 deletions addon/ng2/blueprints/ng2/files/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@
},
"private": true,
"dependencies": {
"@angular/common": "2.0.0-rc.5",
"@angular/compiler": "2.0.0-rc.5",
"@angular/core": "2.0.0-rc.5",
"@angular/forms": "0.3.0",
"@angular/http": "2.0.0-rc.5",
"@angular/platform-browser": "2.0.0-rc.5",
"@angular/platform-browser-dynamic": "2.0.0-rc.5",
"@angular/router": "3.0.0-rc.1",
"core-js": "^2.4.0",
"@angular/common": "2.0.0-rc.6",
"@angular/compiler": "2.0.0-rc.6",
"@angular/core": "2.0.0-rc.6",
"@angular/forms": "2.0.0-rc.6",
"@angular/http": "2.0.0-rc.6",
"@angular/platform-browser": "2.0.0-rc.6",
"@angular/platform-browser-dynamic": "2.0.0-rc.6",
"@angular/router": "3.0.0-rc.2",
"core-js": "^2.4.1",
"rxjs": "5.0.0-beta.11",
"ts-helpers": "^1.1.1",
"zone.js": "0.6.12"
"zone.js": "^0.6.17"
},
"devDependencies": {<% if(isMobile) { %>
"@angular/platform-server": "2.0.0-rc.4",
"@angular/platform-server": "2.0.0-rc.6",
"@angular/service-worker": "0.2.0",
"@angular/app-shell": "0.0.0",
"angular2-universal":"0.104.5",
Expand All @@ -38,13 +38,14 @@
"codelyzer": "~0.0.26",
"jasmine-core": "2.4.1",
"jasmine-spec-reporter": "2.5.0",
"karma": "0.13.22",
"karma-chrome-launcher": "0.2.3",
"karma-jasmine": "0.3.8",
"karma": "1.2.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-remap-istanbul": "^0.2.1",
"protractor": "4.0.3",
"protractor": "4.0.5",
"ts-node": "1.2.1",
"tslint": "3.13.0",
"typescript": "^2.0.0"
"typescript": "2.0.2"
}
}
5 changes: 2 additions & 3 deletions addon/ng2/blueprints/ng2/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = {

locals: function(options) {
this.styleExt = options.style;
this.version = require(path.resolve(__dirname, '..', '..', '..', '..', 'package.json')).version;
this.version = require(path.resolve(__dirname, '../../../../package.json')).version;

// Join with / not path.sep as reference to typings require forward slashes.
const relativeRootPath = options.sourceDir.split(path.sep).map(() => '..').join('/');
Expand All @@ -44,12 +44,11 @@ module.exports = {

files: function() {
var fileList = getFiles.call(this);

if (this.options && this.options.mobile) {
fileList = fileList.filter(p => p.indexOf('__name__.component.html') < 0);
fileList = fileList.filter(p => p.indexOf('__name__.component.__styleext__') < 0);
}

return fileList;
},

Expand Down
Loading