Repository: kolorobot/angular2-typescript-gulp Branch: master Commit: 1507c30e8778 Files: 25 Total size: 15.1 KB Directory structure: gitextract_3__cv0ia/ ├── .gitignore ├── LICENCE ├── README.md ├── bs-config.json ├── gulpfile.ts ├── package.json ├── src/ │ ├── app/ │ │ ├── about/ │ │ │ └── components/ │ │ │ ├── about.component.ts │ │ │ └── about.html │ │ ├── app.component.ts │ │ ├── app.html │ │ ├── app.module.ts │ │ ├── app.routing.ts │ │ ├── main.ts │ │ └── todo/ │ │ ├── components/ │ │ │ ├── task-list.component.ts │ │ │ ├── task-list.css │ │ │ ├── task-list.html │ │ │ ├── task.component.ts │ │ │ └── task.html │ │ ├── models/ │ │ │ └── task.ts │ │ └── services/ │ │ └── task-service.ts │ ├── index.html │ └── systemjs.config.js ├── tsconfig.json ├── tslint.json └── typings.json ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ .idea build node_modules typings ================================================ FILE: LICENCE ================================================ MIT License Copyright (c) 2016 Rafal Borowiec Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README.md ================================================ Angular2 with TypeScript and Gulp ================================= A basic Angular2 application with Gulp as build system. #### 1. Prerequisites *nodejs* must be installed on your system and the below global node packages must be installed: - gulp > npm i -g gulp - gulp-cli > npm i -g gulp-cli - typings > npm i -g typings@1.3.3 - typescript > npm i -g typescript@2.0.2 - ts-node > npm i -g ts-node@1.3.0 #### 2. Cloning the repository Clone the repository: > git clone https://github.com/kolorobot/angular2-typescript-gulp.git Navigate to `angular2-typescript-gulp` directory: > cd angular2-typescript-gulp #### 3. Installing dependencies Install dependencies by running the following command: > npm install `node_modules` and `typings` directories will be created during the install. #### 4. Building the project Build the project by running the following command: > npm run clean & npm run build `build` directory will be created during the build #### 5. Starting the application Start the application by running the following command: > npm start The application will be displayed in the browser. Resources --------- - [A step-by-step tutorial](http://blog.codeleak.pl/2016/03/quickstart-angular2-with-typescript-and.html) ================================================ FILE: bs-config.json ================================================ { "port": 8000, "files": [ "build/**/*.{html,htm,css,js}" ], "server": { "baseDir": "build" } } ================================================ FILE: gulpfile.ts ================================================ "use strict"; const gulp = require("gulp"); const del = require("del"); const tsc = require("gulp-typescript"); const sourcemaps = require('gulp-sourcemaps'); const tsProject = tsc.createProject("tsconfig.json"); const tslint = require('gulp-tslint'); /** * Remove build directory. */ gulp.task('clean', (cb) => { return del(["build"], cb); }); /** * Lint all custom TypeScript files. */ gulp.task('tslint', () => { return gulp.src("src/**/*.ts") .pipe(tslint({ formatter: 'prose' })) .pipe(tslint.report()); }); /** * Compile TypeScript sources and create sourcemaps in build directory. */ gulp.task("compile", ["tslint"], () => { let tsResult = gulp.src("src/**/*.ts") .pipe(sourcemaps.init()) .pipe(tsProject()); return tsResult.js .pipe(sourcemaps.write(".", {sourceRoot: '/src'})) .pipe(gulp.dest("build")); }); /** * Copy all resources that are not TypeScript files into build directory. */ gulp.task("resources", () => { return gulp.src(["src/**/*", "!**/*.ts"]) .pipe(gulp.dest("build")); }); /** * Copy all required libraries into build directory. */ gulp.task("libs", () => { return gulp.src([ 'core-js/client/shim.min.js', 'systemjs/dist/system-polyfills.js', 'systemjs/dist/system.src.js', 'reflect-metadata/Reflect.js', 'rxjs/**/*.js', 'zone.js/dist/**', '@angular/**/bundles/**' ], {cwd: "node_modules/**"}) /* Glob required here. */ .pipe(gulp.dest("build/lib")); }); /** * Watch for changes in TypeScript, HTML and CSS files. */ gulp.task('watch', function () { gulp.watch(["src/**/*.ts"], ['compile']).on('change', function (e) { console.log('TypeScript file ' + e.path + ' has been changed. Compiling.'); }); gulp.watch(["src/**/*.html", "src/**/*.css"], ['resources']).on('change', function (e) { console.log('Resource file ' + e.path + ' has been changed. Updating.'); }); }); /** * Build the project. */ gulp.task("build", ['compile', 'resources', 'libs'], () => { console.log("Building the project ..."); }); ================================================ FILE: package.json ================================================ { "name": "angular2-typescript-gulp", "version": "1.0.0", "description": "Angular2 with TypeScript and Gulp QuickStart", "scripts": { "clean": "gulp clean", "compile": "gulp compile", "build": "gulp build", "start": "concurrent --kill-others \"gulp watch\" \"lite-server\"", "postinstall": "typings install" }, "repository": { "type": "git", "url": "https://github.com/kolorobot/angular2-typescript-gulp.git" }, "author": "Rafał Borowiec", "license": "MIT", "bugs": { "url": "https://github.com/kolorobot/angular2-typescript-gulp/issues" }, "dependencies": { "@angular/common": "~2.2.4", "@angular/compiler": "~2.2.4", "@angular/core": "~2.2.4", "@angular/forms": "~2.2.4", "@angular/http": "~2.2.4", "@angular/platform-browser": "~2.2.4", "@angular/platform-browser-dynamic": "~2.2.4", "@angular/router": "~3.2.4", "@angular/upgrade": "~2.2.4", "core-js": "^2.4.1", "reflect-metadata": "^0.1.3", "rxjs": "5.0.0-beta.12", "systemjs": "0.19.27", "zone.js": "^0.6.23" }, "devDependencies": { "concurrently": "^3.1.0", "del": "^2.2.0", "gulp": "^3.9.1", "gulp-sourcemaps": "^1.9.1", "gulp-tslint": "^7.0.1", "gulp-typescript": "^3.1.3", "lite-server": "^2.2.2", "tslint": "^4.0.2", "typescript": "^2.1.4", "typings": "^2.0.0", "ts-node": "^1.7.2" } } ================================================ FILE: src/app/about/components/about.component.ts ================================================ import {Component} from "@angular/core"; import {OnInit} from "@angular/core"; @Component({ templateUrl: './app/about/components/about.html' }) export class AboutComponent implements OnInit { ngOnInit() { } } ================================================ FILE: src/app/about/components/about.html ================================================
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
================================================ FILE: src/app/app.component.ts ================================================ import {Component, OnInit} from "@angular/core"; @Component({ selector: "app", templateUrl: "./app/app.html" }) export class AppComponent implements OnInit { ngOnInit() { console.log("Application component initialized ..."); } } ================================================ FILE: src/app/app.html ================================================