Skip to content

Commit f42073e

Browse files
committed
chore: initial commit from angular-cli
_ _ _ __ _ _ __ __ _ _ _| | __ _ _ __ ___| (_) / _ | _ \ / _ | | | | |/ _ | __|____ / __| | | | (_| | | | | (_| | |_| | | (_| | | |_____| (__| | | \____|_| |_|\__ |\____|_|\____|_| \___|_|_| |___/
0 parents  commit f42073e

33 files changed

+564
-0
lines changed

.clang-format

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Language: JavaScript
2+
BasedOnStyle: Google
3+
ColumnLimit: 100

.editorconfig

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# 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

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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+
14+
# misc
15+
/.sass-cache
16+
/connect.lock
17+
/coverage/*
18+
/libpeerconnection.log
19+
npm-debug.log
20+
testem.log
21+
/typings
22+
23+
# e2e
24+
/e2e/*.js
25+
/e2e/*.map
26+
27+
#System Files
28+
.DS_Store
29+
Thumbs.db

angular-cli-build.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/* global require, module */
2+
3+
var Angular2App = require('angular-cli/lib/broccoli/angular2-app');
4+
5+
module.exports = function(defaults) {
6+
return new Angular2App(defaults, {
7+
vendorNpmFiles: [
8+
'systemjs/dist/system-polyfills.js',
9+
'systemjs/dist/system.src.js',
10+
'zone.js/dist/*.js',
11+
'es6-shim/es6-shim.js',
12+
'reflect-metadata/*.js',
13+
'rxjs/**/*.js',
14+
'@angular/**/*.js'
15+
]
16+
});
17+
};

angular-cli.json

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"project": {
3+
"version": "1.0.0-beta.2-mobile.3",
4+
"name": "nativescript-angular-web-components"
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+
}
30+
}

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

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/* jshint node: true */
2+
3+
module.exports = function(environment) {
4+
return {
5+
environment: environment,
6+
baseURL: '/',
7+
locationType: 'auto'
8+
};
9+
};
10+

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

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

config/karma.conf.js

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

config/protractor.conf.js

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

e2e/app.e2e.ts

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

e2e/app.po.ts

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export class NativescriptAngularWebComponentsPage {
2+
navigateTo() {
3+
return browser.get('/');
4+
}
5+
6+
getParagraphText() {
7+
return element(by.css('nativescript-angular-web-components-app 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" />

package.json

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"name": "nativescript-angular-web-components",
3+
"version": "0.0.0",
4+
"license": "MIT",
5+
"angular-cli": {},
6+
"scripts": {
7+
"start": "ng server",
8+
"postinstall": "typings install",
9+
"lint": "tslint \"src/**/*.ts\"",
10+
"format": "clang-format -i -style=file --glob=src/**/*.ts",
11+
"test": "ng test",
12+
"pree2e": "webdriver-manager update",
13+
"e2e": "protractor"
14+
},
15+
"private": true,
16+
"dependencies": {
17+
"@angular/common": "2.0.0-rc.1",
18+
"@angular/compiler": "2.0.0-rc.1",
19+
"@angular/core": "2.0.0-rc.1",
20+
"@angular/http": "2.0.0-rc.1",
21+
"@angular/platform-browser": "2.0.0-rc.1",
22+
"@angular/platform-browser-dynamic": "2.0.0-rc.1",
23+
"@angular/router": "2.0.0-rc.1",
24+
"es6-shim": "^0.35.0",
25+
"reflect-metadata": "0.1.3",
26+
"rxjs": "5.0.0-beta.6",
27+
"systemjs": "0.19.26",
28+
"zone.js": "^0.6.12"
29+
},
30+
"devDependencies": {
31+
"angular-cli": "^1.0.0-beta.2-mobile.3",
32+
"clang-format": "^1.0.35",
33+
"codelyzer": "0.0.14",
34+
"ember-cli-inject-live-reload": "^1.4.0",
35+
"jasmine-core": "^2.4.1",
36+
"jasmine-spec-reporter": "^2.4.0",
37+
"karma": "^0.13.15",
38+
"karma-chrome-launcher": "^0.2.3",
39+
"karma-jasmine": "^0.3.8",
40+
"protractor": "^3.3.0",
41+
"ts-node": "^0.5.5",
42+
"tslint": "^3.6.0",
43+
"typescript": "^1.8.10",
44+
"typings": "^0.8.1"
45+
}
46+
}

public/.gitignore

Whitespace-only changes.

public/.npmignore

Whitespace-only changes.

src/app/environment.ts

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// The file for the current environment will overwrite this one during build
2+
// Different environments can be found in config/environment.{dev|prod}.ts
3+
// The build system defaults to the dev environment
4+
5+
export const environment = {
6+
production: false
7+
};

src/app/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export {environment} from './environment';
2+
export {NativescriptAngularWebComponentsAppComponent} from './nativescript-angular-web-components.component';

src/app/nativescript-angular-web-components.component.css

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<h1>
2+
{{title}}
3+
</h1>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import {
2+
beforeEachProviders,
3+
describe,
4+
expect,
5+
it,
6+
inject
7+
} from '@angular/core/testing';
8+
import { NativescriptAngularWebComponentsAppComponent } from '../app/nativescript-angular-web-components.component';
9+
10+
beforeEachProviders(() => [NativescriptAngularWebComponentsAppComponent]);
11+
12+
describe('App: NativescriptAngularWebComponents', () => {
13+
it('should create the app',
14+
inject([NativescriptAngularWebComponentsAppComponent], (app: NativescriptAngularWebComponentsAppComponent) => {
15+
expect(app).toBeTruthy();
16+
}));
17+
18+
it('should have as title \'nativescript-angular-web-components works!\'',
19+
inject([NativescriptAngularWebComponentsAppComponent], (app: NativescriptAngularWebComponentsAppComponent) => {
20+
expect(app.title).toEqual('nativescript-angular-web-components works!');
21+
}));
22+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { Component } from '@angular/core';
2+
3+
@Component({
4+
moduleId: module.id,
5+
selector: 'nativescript-angular-web-components-app',
6+
templateUrl: 'nativescript-angular-web-components.component.html',
7+
styleUrls: ['nativescript-angular-web-components.component.css']
8+
})
9+
export class NativescriptAngularWebComponentsAppComponent {
10+
title = 'nativescript-angular-web-components works!';
11+
}

src/app/shared/index.ts

Whitespace-only changes.

src/favicon.ico

5.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)