Skip to content

Commit 948ac05

Browse files
committed
ng init (project start)
1 parent 7b22353 commit 948ac05

32 files changed

+665
-39
lines changed

.editorconfig

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Editor configuration, see http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
end_of_line = lf
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+
12+
[*.md]
13+
max_line_length = 0
14+
trim_trailing_whitespace = false

.gitignore

+33-37
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,33 @@
1-
# Logs
2-
logs
3-
*.log
4-
npm-debug.log*
5-
6-
# Runtime data
7-
pids
8-
*.pid
9-
*.seed
10-
11-
# Directory for instrumented libs generated by jscoverage/JSCover
12-
lib-cov
13-
14-
# Coverage directory used by tools like istanbul
15-
coverage
16-
17-
# nyc test coverage
18-
.nyc_output
19-
20-
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
21-
.grunt
22-
23-
# node-waf configuration
24-
.lock-wscript
25-
26-
# Compiled binary addons (http://nodejs.org/api/addons.html)
27-
build/Release
28-
29-
# Dependency directories
30-
node_modules
31-
jspm_packages
32-
33-
# Optional npm cache directory
34-
.npm
35-
36-
# Optional REPL history
37-
.node_repl_history
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
/dist
5+
/tmp
6+
7+
# dependencies
8+
/node_modules
9+
/bower_components
10+
11+
# IDEs and editors
12+
/.idea
13+
.project
14+
.classpath
15+
*.launch
16+
.settings/
17+
18+
# misc
19+
/.sass-cache
20+
/connect.lock
21+
/coverage/*
22+
/libpeerconnection.log
23+
npm-debug.log
24+
testem.log
25+
/typings
26+
27+
# e2e
28+
/e2e/*.js
29+
/e2e/*.map
30+
31+
#System Files
32+
.DS_Store
33+
Thumbs.db

README.md

+31-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,31 @@
1-
# angular2-rc4
2-
Repo for angular2 RC4 tests with angular-cli
1+
# TestAngular2Rc4
2+
3+
This project was generated with [angular-cli](https://github.com/angular/angular-cli) version 1.0.0-beta.9.
4+
5+
## Development server
6+
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
7+
8+
## Code scaffolding
9+
10+
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive/pipe/service/route/class`.
11+
12+
## Build
13+
14+
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.
15+
16+
## Running unit tests
17+
18+
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
19+
20+
## Running end-to-end tests
21+
22+
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
23+
Before running the tests make sure you are serving the app via `ng serve`.
24+
25+
## Deploying to Github Pages
26+
27+
Run `ng github-pages:deploy` to deploy to Github Pages.
28+
29+
## Further help
30+
31+
To get more help on the `angular-cli` use `ng --help` or go check out the [Angular-CLI README](https://github.com/angular/angular-cli/blob/master/README.md).

angular-cli-build.js

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Angular-CLI build configuration
2+
// This file lists all the node_modules files that will be used in a build
3+
// Also see https://github.com/angular/angular-cli/wiki/3rd-party-libs
4+
5+
/* global require, module */
6+
7+
var Angular2App = require('angular-cli/lib/broccoli/angular2-app');
8+
9+
module.exports = function(defaults) {
10+
return new Angular2App(defaults, {
11+
vendorNpmFiles: [
12+
'systemjs/dist/system-polyfills.js',
13+
'systemjs/dist/system.src.js',
14+
'zone.js/dist/**/*.+(js|js.map)',
15+
'es6-shim/es6-shim.js',
16+
'reflect-metadata/**/*.+(ts|js|js.map)',
17+
'rxjs/**/*.+(js|js.map)',
18+
'@angular/**/*.+(js|js.map)'
19+
]
20+
});
21+
};

angular-cli.json

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"project": {
3+
"version": "1.0.0-beta.9",
4+
"name": "test-angular2-rc4"
5+
},
6+
"apps": [
7+
{
8+
"main": "src/main.ts",
9+
"tsconfig": "src/tsconfig.json",
10+
"mobile": false
11+
}
12+
],
13+
"addons": [],
14+
"packages": [],
15+
"e2e": {
16+
"protractor": {
17+
"config": "config/protractor.conf.js"
18+
}
19+
},
20+
"test": {
21+
"karma": {
22+
"config": "config/karma.conf.js"
23+
}
24+
},
25+
"defaults": {
26+
"prefix": "app",
27+
"sourceDir": "src",
28+
"styleExt": "css",
29+
"prefixInterfaces": false,
30+
"lazyRoutePrefix": "+"
31+
}
32+
}

config/environment.dev.ts

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export const environment = {
2+
production: false
3+
};

config/environment.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Angular-CLI server configuration
2+
// Unrelated to environment.dev|prod.ts
3+
4+
/* jshint node: true */
5+
6+
module.exports = function(environment) {
7+
return {
8+
environment: environment,
9+
baseURL: '/',
10+
locationType: 'auto'
11+
};
12+
};
13+

config/environment.prod.ts

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export const environment = {
2+
production: true
3+
};

config/karma-test-shim.js

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
// Test shim for Karma, needed to load files via SystemJS
2+
3+
/*global jasmine, __karma__, window*/
4+
Error.stackTraceLimit = Infinity;
5+
jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000;
6+
7+
__karma__.loaded = function () {
8+
};
9+
10+
var distPath = '/base/dist/';
11+
var appPaths = ['app']; //Add all valid source code folders here
12+
13+
function isJsFile(path) {
14+
return path.slice(-3) == '.js';
15+
}
16+
17+
function isSpecFile(path) {
18+
return path.slice(-8) == '.spec.js';
19+
}
20+
21+
function isAppFile(path) {
22+
return isJsFile(path) && appPaths.some(function(appPath) {
23+
var fullAppPath = distPath + appPath + '/';
24+
return path.substr(0, fullAppPath.length) == fullAppPath;
25+
});
26+
}
27+
28+
var allSpecFiles = Object.keys(window.__karma__.files)
29+
.filter(isSpecFile)
30+
.filter(isAppFile);
31+
32+
// Load our SystemJS configuration.
33+
System.config({
34+
baseURL: distPath
35+
});
36+
37+
System.import('system-config.js').then(function() {
38+
// Load and configure the TestComponentBuilder.
39+
return Promise.all([
40+
System.import('@angular/core/testing'),
41+
System.import('@angular/platform-browser-dynamic/testing')
42+
]).then(function (providers) {
43+
var testing = providers[0];
44+
var testingBrowser = providers[1];
45+
46+
testing.setBaseTestProviders(testingBrowser.TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS,
47+
testingBrowser.TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS);
48+
});
49+
}).then(function() {
50+
// Finally, load all spec files.
51+
// This will run the tests directly.
52+
return Promise.all(
53+
allSpecFiles.map(function (moduleName) {
54+
return System.import(moduleName);
55+
}));
56+
}).then(__karma__.start, __karma__.error);

config/karma.conf.js

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Karma configuration file, see link for more information
2+
// https://karma-runner.github.io/0.13/config/configuration-file.html
3+
4+
module.exports = function (config) {
5+
config.set({
6+
basePath: '..',
7+
frameworks: ['jasmine'],
8+
plugins: [
9+
require('karma-jasmine'),
10+
require('karma-chrome-launcher')
11+
],
12+
customLaunchers: {
13+
// chrome setup for travis CI using chromium
14+
Chrome_travis_ci: {
15+
base: 'Chrome',
16+
flags: ['--no-sandbox']
17+
}
18+
},
19+
files: [
20+
{ pattern: 'dist/vendor/es6-shim/es6-shim.js', included: true, watched: false },
21+
{ pattern: 'dist/vendor/zone.js/dist/zone.js', included: true, watched: false },
22+
{ pattern: 'dist/vendor/reflect-metadata/Reflect.js', included: true, watched: false },
23+
{ pattern: 'dist/vendor/systemjs/dist/system-polyfills.js', included: true, watched: false },
24+
{ pattern: 'dist/vendor/systemjs/dist/system.src.js', included: true, watched: false },
25+
{ pattern: 'dist/vendor/zone.js/dist/async-test.js', included: true, watched: false },
26+
{ pattern: 'dist/vendor/zone.js/dist/fake-async-test.js', included: true, watched: false },
27+
28+
{ pattern: 'config/karma-test-shim.js', included: true, watched: true },
29+
30+
// Distribution folder.
31+
{ pattern: 'dist/**/*', included: false, watched: true }
32+
],
33+
exclude: [
34+
// Vendor packages might include spec files. We don't want to use those.
35+
'dist/vendor/**/*.spec.js'
36+
],
37+
preprocessors: {},
38+
reporters: ['progress'],
39+
port: 9876,
40+
colors: true,
41+
logLevel: config.LOG_INFO,
42+
autoWatch: true,
43+
browsers: ['Chrome'],
44+
singleRun: false
45+
});
46+
};

config/protractor.conf.js

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Protractor configuration file, see link for more information
2+
// https://github.com/angular/protractor/blob/master/docs/referenceConf.js
3+
4+
/*global jasmine */
5+
var SpecReporter = require('jasmine-spec-reporter');
6+
7+
exports.config = {
8+
allScriptsTimeout: 11000,
9+
specs: [
10+
'../e2e/**/*.e2e-spec.ts'
11+
],
12+
capabilities: {
13+
'browserName': 'chrome'
14+
},
15+
directConnect: true,
16+
baseUrl: 'http://localhost:4200/',
17+
framework: 'jasmine',
18+
jasmineNodeOpts: {
19+
showColors: true,
20+
defaultTimeoutInterval: 30000,
21+
print: function() {}
22+
},
23+
useAllAngular2AppRoots: true,
24+
beforeLaunch: function() {
25+
require('ts-node').register({
26+
project: 'e2e'
27+
});
28+
},
29+
onPrepare: function() {
30+
jasmine.getEnv().addReporter(new SpecReporter());
31+
}
32+
};

e2e/app.e2e-spec.ts

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { TestAngular2Rc4Page } from './app.po';
2+
3+
describe('test-angular2-rc4 App', function() {
4+
let page: TestAngular2Rc4Page;
5+
6+
beforeEach(() => {
7+
page = new TestAngular2Rc4Page();
8+
});
9+
10+
it('should display message saying app works', () => {
11+
page.navigateTo();
12+
expect(page.getParagraphText()).toEqual('app works!');
13+
});
14+
});

e2e/app.po.ts

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export class TestAngular2Rc4Page {
2+
navigateTo() {
3+
return browser.get('/');
4+
}
5+
6+
getParagraphText() {
7+
return element(by.css('app-root h1')).getText();
8+
}
9+
}

e2e/tsconfig.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"compileOnSave": false,
3+
"compilerOptions": {
4+
"declaration": false,
5+
"emitDecoratorMetadata": true,
6+
"experimentalDecorators": true,
7+
"mapRoot": "",
8+
"module": "commonjs",
9+
"moduleResolution": "node",
10+
"noEmitOnError": true,
11+
"noImplicitAny": false,
12+
"rootDir": ".",
13+
"sourceMap": true,
14+
"sourceRoot": "/",
15+
"target": "es5"
16+
}
17+
}

e2e/typings.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference path="../typings/main.d.ts" />

0 commit comments

Comments
 (0)