Skip to content

Commit

Permalink
chore(demo): add demo app skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
hotforfeature committed Apr 5, 2017
1 parent 7b823a3 commit a6c8f4b
Show file tree
Hide file tree
Showing 17 changed files with 3,307 additions and 47 deletions.
35 changes: 35 additions & 0 deletions .angular-cli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"version": "1.0.0-beta.32.3",
"name": "angular-polymer-sink"
},
"apps": [
{
"root": "demo",
"outDir": "dist",
"assets": [
"assets"
],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
"test": "test.ts",
"tsconfig": "tsconfig.json",
"prefix": "app",
"styles": [
"styles.css"
],
"scripts": [],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
}
],
"defaults": {
"styleExt": "css",
"component": {}
}
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

# dependencies
/node_modules
/demo/assets/bower_components

# IDEs and editors
/.idea
Expand Down
3 changes: 3 additions & 0 deletions demo/.bowerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"directory": "assets/bower_components"
}
Empty file added demo/app/app.component.css
Empty file.
1 change: 1 addition & 0 deletions demo/app/app.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>Origami</h1>
8 changes: 8 additions & 0 deletions demo/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { Component } from '@angular/core';

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent { }
17 changes: 17 additions & 0 deletions demo/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { BrowserModule } from '@angular/platform-browser';

import { AppComponent } from './app.component';

@NgModule({
imports: [
BrowserModule,
CommonModule
],
declarations: [
AppComponent
],
bootstrap: [AppComponent]
})
export class AppModule { }
6 changes: 6 additions & 0 deletions demo/bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "demo",
"dependencies": {
"polymer": "Polymer/polymer#2.0-preview"
}
}
3 changes: 3 additions & 0 deletions demo/environments/environment.prod.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const environment = {
production: true
};
8 changes: 8 additions & 0 deletions demo/environments/environment.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// The file contents for the current environment will overwrite these during build.
// The build system defaults to the dev environment which uses `environment.ts`, but if you do
// `ng build --env=prod` then `environment.prod.ts` will be used instead.
// The list of which env maps to which file can be found in `.angular-cli.json`.

export const environment = {
production: false
};
20 changes: 20 additions & 0 deletions demo/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Origami Demo</title>
<base href="/">

<script src="assets/bower_components/webcomponentsjs/webcomponents-loader.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<app-root>Loading...</app-root>
<script>
window.webComponentsReady = false;
window.addEventListener('WebComponentsReady', function() {
window.webComponentsReady = true;
});
</script>
</body>
</html>
21 changes: 21 additions & 0 deletions demo/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import { AppModule } from './app/app.module';
import { environment } from './environments/environment';

if (environment.production) {
enableProdMode();
}

function bootstrap() {
platformBrowserDynamic().bootstrapModule(AppModule);
}

if ((<any>window).webComponentsReady) {
// Polyfills not needed
bootstrap();
} else {
// Wait for polyfills before bootstrapping
window.addEventListener('WebComponentsReady', bootstrap);
}
68 changes: 68 additions & 0 deletions demo/polyfills.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/**
* This file includes polyfills needed by Angular and is loaded before the app.
* You can add your own extra polyfills to this file.
*
* This file is divided into 2 sections:
* 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
* 2. Application imports. Files imported after ZoneJS that should be loaded before your main
* file.
*
* The current setup is for so-called "evergreen" browsers; the last versions of browsers that
* automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
* Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
*
* Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html
*/

/***************************************************************************************************
* BROWSER POLYFILLS
*/

/** IE9, IE10 and IE11 requires all of the following polyfills. **/
// import 'core-js/es6/symbol';
// import 'core-js/es6/object';
// import 'core-js/es6/function';
// import 'core-js/es6/parse-int';
// import 'core-js/es6/parse-float';
// import 'core-js/es6/number';
// import 'core-js/es6/math';
// import 'core-js/es6/string';
// import 'core-js/es6/date';
// import 'core-js/es6/array';
// import 'core-js/es6/regexp';
// import 'core-js/es6/map';
// import 'core-js/es6/set';

/** IE10 and IE11 requires the following for NgClass support on SVG elements */
// import 'classlist.js'; // Run `npm install --save classlist.js`.

/** IE10 and IE11 requires the following to support `@angular/animation`. */
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.


/** Evergreen browsers require these. **/
import 'core-js/es6/reflect';
import 'core-js/es7/reflect';


/** ALL Firefox browsers require the following to support `@angular/animation`. **/
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.



/***************************************************************************************************
* Zone JS is required by Angular itself.
*/
import 'zone.js/dist/zone'; // Included with Angular CLI.



/***************************************************************************************************
* APPLICATION IMPORTS
*/

/**
* Date, currency, decimal and percent pipes.
* Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10
*/
// import 'intl'; // Run `npm install --save intl`.
1 change: 1 addition & 0 deletions demo/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* You can add global styles to this file, and also import other style files */
21 changes: 21 additions & 0 deletions demo/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"compilerOptions": {
"baseUrl": "",
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [
"es2016",
"dom"
],
"mapRoot": "./",
"module": "es2015",
"moduleResolution": "node",
"outDir": "../dist/out-tsc",
"sourceMap": true,
"target": "es5",
"typeRoots": [
"../node_modules/@types"
]
}
}
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,15 @@
"@angular/forms": "^4.0.0"
},
"devDependencies": {
"@angular/cli": "^1.0.0",
"@angular/common": "^4.0.0",
"@angular/compiler": "^4.0.0",
"@angular/compiler-cli": "^4.0.0",
"@angular/core": "^4.0.0",
"@angular/forms": "^4.0.0",
"@angular/platform-browser": "^4.0.0",
"@angular/platform-browser-dynamic": "^4.0.0",
"@angular/router": "^4.0.0",
"@types/node": "^7.0.12",
"codelyzer": "^3.0.0-beta.4",
"commitizen": "^2.9.6",
Expand Down
Loading

0 comments on commit a6c8f4b

Please sign in to comment.