Skip to content

Commit

Permalink
chore: initial commit from angular-cli
Browse files Browse the repository at this point in the history
                          _                      _ _
   __ _ _ __   __ _ _   _| | __ _ _ __       ___| (_)
  / _  |  _ \ / _  | | | | |/ _  |  __|____ / __| | |
 | (_| | | | | (_| | |_| | | (_| | | |_____| (__| | |
  \____|_| |_|\__  |\____|_|\____|_|        \___|_|_|
              |___/
  • Loading branch information
angular-cli authored and mhevery committed May 17, 2016
1 parent b71bd88 commit 908d9d9
Show file tree
Hide file tree
Showing 32 changed files with 563 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Language: JavaScript
BasedOnStyle: Google
ColumnLimit: 100
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# http://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
max_line_length = 0
trim_trailing_whitespace = false
28 changes: 28 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
/tmp

# dependencies
/node_modules
/bower_components

# IDEs and editors
/.idea

# misc
/.sass-cache
/connect.lock
/coverage/*
/libpeerconnection.log
npm-debug.log
testem.log
/typings

# e2e
/e2e/*.js
/e2e/*.map

#System Files
.DS_Store
17 changes: 17 additions & 0 deletions angular-cli-build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* global require, module */

var Angular2App = require('angular-cli/lib/broccoli/angular2-app');

module.exports = function(defaults) {
return new Angular2App(defaults, {
vendorNpmFiles: [
'systemjs/dist/system-polyfills.js',
'systemjs/dist/system.src.js',
'zone.js/dist/*.js',
'es6-shim/es6-shim.js',
'reflect-metadata/*.js',
'rxjs/**/*.js',
'@angular/**/*.js'
]
});
};
25 changes: 25 additions & 0 deletions angular-cli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"project": {
"version": "1.0.0-beta.1",
"name": "periscope"
},
"apps": [
{"main": "src/main.ts", "tsconfig": "src/tsconfig.json"}
],
"addons": [],
"packages": [],
"e2e": {
"protractor": {
"config": "config/protractor.conf.js"
}
},
"test": {
"karma": {
"config": "config/karma.conf.js"
}
},
"defaults": {
"prefix": "app",
"sourceDir": "src"
}
}
3 changes: 3 additions & 0 deletions config/environment.dev.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const environment = {
production: false
};
10 changes: 10 additions & 0 deletions config/environment.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* jshint node: true */

module.exports = function(environment) {
return {
environment: environment,
baseURL: '/',
locationType: 'auto'
};
};

3 changes: 3 additions & 0 deletions config/environment.prod.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const environment = {
production: true
};
51 changes: 51 additions & 0 deletions config/karma-test-shim.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*global jasmine, __karma__, window*/
Error.stackTraceLimit = Infinity;
jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000;

__karma__.loaded = function () {
};

var distPath = '/base/dist/';
var appPath = distPath + 'app/';

function isJsFile(path) {
return path.slice(-3) == '.js';
}

function isSpecFile(path) {
return path.slice(-8) == '.spec.js';
}

function isAppFile(path) {
return isJsFile(path) && (path.substr(0, appPath.length) == appPath);
}

var allSpecFiles = Object.keys(window.__karma__.files)
.filter(isSpecFile)
.filter(isAppFile);

// Load our SystemJS configuration.
System.config({
baseURL: distPath
});

System.import('system-config.js').then(function() {
// Load and configure the TestComponentBuilder.
return Promise.all([
System.import('@angular/core/testing'),
System.import('@angular/platform-browser-dynamic/testing')
]).then(function (providers) {
var testing = providers[0];
var testingBrowser = providers[1];

testing.setBaseTestProviders(testingBrowser.TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS,
testingBrowser.TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS);
});
}).then(function() {
// Finally, load all spec files.
// This will run the tests directly.
return Promise.all(
allSpecFiles.map(function (moduleName) {
return System.import(moduleName);
}));
}).then(__karma__.start, __karma__.error);
42 changes: 42 additions & 0 deletions config/karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
module.exports = function (config) {
config.set({
basePath: '..',
frameworks: ['jasmine'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher')
],
customLaunchers: {
// chrome setup for travis CI using chromium
Chrome_travis_ci: {
base: 'Chrome',
flags: ['--no-sandbox']
}
},
files: [
{ pattern: 'dist/vendor/es6-shim/es6-shim.js', included: true, watched: false },
{ pattern: 'dist/vendor/zone.js/dist/zone.js', included: true, watched: false },
{ pattern: 'dist/vendor/reflect-metadata/Reflect.js', included: true, watched: false },
{ pattern: 'dist/vendor/systemjs/dist/system-polyfills.js', included: true, watched: false },
{ pattern: 'dist/vendor/systemjs/dist/system.src.js', included: true, watched: false },
{ pattern: 'dist/vendor/zone.js/dist/async-test.js', included: true, watched: false },

{ pattern: 'config/karma-test-shim.js', included: true, watched: true },

// Distribution folder.
{ pattern: 'dist/**/*', included: false, watched: true }
],
exclude: [
// Vendor packages might include spec files. We don't want to use those.
'dist/vendor/**/*.spec.js'
],
preprocessors: {},
reporters: ['progress'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false
});
};
29 changes: 29 additions & 0 deletions config/protractor.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*global jasmine */
var SpecReporter = require('jasmine-spec-reporter');

exports.config = {
allScriptsTimeout: 11000,
specs: [
'../e2e/**/*.e2e.ts'
],
capabilities: {
'browserName': 'chrome'
},
directConnect: true,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
useAllAngular2AppRoots: true,
beforeLaunch: function() {
require('ts-node').register({
project: 'e2e'
});
},
onPrepare: function() {
jasmine.getEnv().addReporter(new SpecReporter());
}
};
14 changes: 14 additions & 0 deletions e2e/app.e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { PeriscopePage } from './app.po';

describe('periscope App', function() {
let page: PeriscopePage;

beforeEach(() => {
page = new PeriscopePage();
})

it('should display message saying app works', () => {
page.navigateTo();
expect(page.getParagraphText()).toEqual('periscope works!');
});
});
9 changes: 9 additions & 0 deletions e2e/app.po.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export class PeriscopePage {
navigateTo() {
return browser.get('/');
}

getParagraphText() {
return element(by.css('periscope-app h1')).getText();
}
}
17 changes: 17 additions & 0 deletions e2e/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"compileOnSave": false,
"compilerOptions": {
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"mapRoot": "",
"module": "commonjs",
"moduleResolution": "node",
"noEmitOnError": true,
"noImplicitAny": false,
"rootDir": ".",
"sourceMap": true,
"sourceRoot": "/",
"target": "es5"
}
}
1 change: 1 addition & 0 deletions e2e/typings.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference path="../typings/main.d.ts" />
44 changes: 44 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"name": "periscope",
"version": "0.0.0",
"license": "MIT",
"angular-cli": {},
"scripts": {
"start": "ng server",
"postinstall": "typings install",
"lint": "tslint \"src/**/*.ts\"",
"format": "clang-format -i -style=file --glob=src/**/*.ts",
"pree2e": "webdriver-manager update",
"e2e": "protractor"
},
"private": true,
"dependencies": {
"@angular/common": "2.0.0-rc.1",
"@angular/compiler": "2.0.0-rc.1",
"@angular/core": "2.0.0-rc.1",
"@angular/platform-browser": "2.0.0-rc.1",
"@angular/platform-browser-dynamic": "2.0.0-rc.1",
"@angular/router": "2.0.0-rc.1",
"es6-shim": "^0.35.0",
"reflect-metadata": "0.1.3",
"rxjs": "5.0.0-beta.6",
"systemjs": "0.19.26",
"zone.js": "^0.6.12"
},
"devDependencies": {
"angular-cli": "^1.0.0-beta.0",
"clang-format": "^1.0.35",
"codelyzer": "0.0.14",
"ember-cli-inject-live-reload": "^1.4.0",
"jasmine-core": "^2.4.1",
"jasmine-spec-reporter": "^2.4.0",
"karma": "^0.13.15",
"karma-chrome-launcher": "^0.2.3",
"karma-jasmine": "^0.3.8",
"protractor": "^3.3.0",
"ts-node": "^0.5.5",
"tslint": "^3.6.0",
"typescript": "^1.8.10",
"typings": "^0.8.1"
}
}
Empty file added public/.npmignore
Empty file.
7 changes: 7 additions & 0 deletions src/app/environment.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// The file for the current environment will overwrite this one during build
// Different environments can be found in config/environment.{dev|prod}.ts
// The build system defaults to the dev environment

export const environment = {
production: false
};
2 changes: 2 additions & 0 deletions src/app/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export {environment} from './environment';
export {PeriscopeAppComponent} from './periscope.component';
Empty file added src/app/periscope.component.css
Empty file.
3 changes: 3 additions & 0 deletions src/app/periscope.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<h1>
{{title}}
</h1>
22 changes: 22 additions & 0 deletions src/app/periscope.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import {
beforeEachProviders,
describe,
expect,
it,
inject
} from '@angular/core/testing';
import { PeriscopeAppComponent } from '../app/periscope.component';

beforeEachProviders(() => [PeriscopeAppComponent]);

describe('App: Periscope', () => {
it('should create the app',
inject([PeriscopeAppComponent], (app: PeriscopeAppComponent) => {
expect(app).toBeTruthy();
}));

it('should have as title \'periscope works!\'',
inject([PeriscopeAppComponent], (app: PeriscopeAppComponent) => {
expect(app.title).toEqual('periscope works!');
}));
});
11 changes: 11 additions & 0 deletions src/app/periscope.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Component } from '@angular/core';

@Component({
moduleId: module.id,
selector: 'periscope-app',
templateUrl: 'periscope.component.html',
styleUrls: ['periscope.component.css']
})
export class PeriscopeAppComponent {
title = 'periscope works!';
}
Empty file added src/app/shared/index.ts
Empty file.
Binary file added src/favicon.ico
Binary file not shown.
Loading

0 comments on commit 908d9d9

Please sign in to comment.