Skip to content

Commit

Permalink
Update to version 2.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanMetin committed Oct 12, 2016
1 parent 971249c commit 747abfe
Show file tree
Hide file tree
Showing 28 changed files with 230 additions and 332 deletions.
27 changes: 4 additions & 23 deletions README.md
Expand Up @@ -4,10 +4,8 @@
[![Build Status](https://travis-ci.org/RyanMetin/slush-angular2.svg?branch=master)](https://travis-ci.org/TheVelourFog/slush-angular2)
[![NPM version](https://badge-me.herokuapp.com/api/npm/slush-angular2.png)](http://badges.enytc.com/for/npm/slush-angular2)

## Start Using Angular2
>Generate a seed project that uses **[angular2](https://www.npmjs.com/package/angular2)**, **[systemjs](https://www.npmjs.com/package/systemjs)**, and **[typescript](https://typescriptlang.org)**.
>
>Then generate Angular2 features inside that project.
## Simple angular2 seed using systemjs
>Generate a project that uses **[angular2](https://www.npmjs.com/package/angular2)**, **[gulp](https://www.npmjs.com/package/gulp)**, **[systemjs](https://www.npmjs.com/package/systemjs)**, and **[typescript](https://typescriptlang.org)**.
## Installation
>Install package globally (requires **[slush](https://www.npmjs.com/package/slush)**):
Expand All @@ -20,20 +18,9 @@
>Compile TypeScript and open in browser:
>>`npm start`
>
> Now **[live-server](https://www.npmjs.com/package/live-server)** will watch for any changes and update accordingly...
> Now **[Connect](https://www.npmjs.com/package/gulp-connect)** will watch for any changes and update accordingly...
>>![](http://i.imgur.com/85O2cvX.gif)
>Use these tasks to build corresponding Angular2 features:
>* component
>* directive
>* pipe
>* service
>
>Run in root of project with task:
>>`slush angular2:<task> [<name>]`
>
>Import your new TypeScript files by their path, ie. `./path`, omitting the `.ts` extension.
>
>To manually start compiler and server use:
>>`npm start` or `gulp start:dev`
>
Expand All @@ -48,15 +35,9 @@
>>* boot.ts <-- Strapping boots.
>>* app/ <-- Main application with route configuration.
>>* shared/ <-- Common directs, pipes, and services.
>>* +examples/ <-- Example components.
>>* examples/ <-- Example components.
>* dist/ <-- JavaScript comes out here.
## To-do
>* Tests.
>* Stop forgetting tests.
>* For frak's sake, the tests.
>* Figure why Typescript is throwing so many errors...
## Contribute
>There are no guidelines for contributing. If you find a problem or have a suggestion go ahead and [submit an issue](https://github.com/ryanmetin/slush-angular2/issues).
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,7 +1,7 @@
{
"name": "slush-angular2",
"description": "Slush Generator For Angular2",
"version": "0.8.3",
"version": "1.0.0",
"author": {
"name": "Ryan Usumi",
"email": "rmusumi@hotmail.com",
Expand Down
210 changes: 105 additions & 105 deletions slushfile.js
Expand Up @@ -21,111 +21,111 @@ gulp.task('default', function (cb) {
.on('finish', function () { cb(); }).resume();
});
});
gulp.task('component', function (cb) {
Util.checkDir(cb);
inquirer.prompt([
Util.promptFn.nameIt('component', gulp.args),
Util.promptFn.selectIt(2),
Util.promptFn.intOrExt('styles'),
Util.promptFn.intOrExt('template'),
Util.promptFn.importIt('animation'),
Util.promptFn.importIt('common'),
Util.promptFn.importIt('core'),
Util.promptFn.importIt('http'),
Util.promptFn.importIt('router'),
Util.promptFn.confirmIt('component')
], function (answers) {
if (!answers.good) {
return cb();
}
answers.camel = Util.camelize(answers.component);
answers.mod = Util.classable(answers.camel);
answers.slug = Util.slugify(answers.component);
answers.select = Util.selectable(answers.selector, answers.slug);
var source = [path.join(__dirname, 'templates/options/component/component.ts')];
if (answers.styles == 'external') {
source.push(path.join(__dirname, 'templates/options/styles.css'));
}
if (answers.template == 'external') {
source.push(path.join(__dirname, 'templates/options/template.html'));
}
gulp.src(source)
.pipe(template(answers))
.pipe(rename(function (file) { file.basename = answers.camel; }))
.pipe(conflict(path.join(process.cwd(), 'src/component')))
.pipe(gulp.dest(path.join(process.cwd(), 'src/component')))
.on('finish', function () { cb(); }).resume();
});
});
gulp.task('directive', function (cb) {
Util.checkDir(cb);
inquirer.prompt([
Util.promptFn.nameIt('directive', gulp.args),
Util.promptFn.selectIt(0),
Util.promptFn.importIt('animation'),
Util.promptFn.importIt('common'),
Util.promptFn.importIt('core'),
Util.promptFn.confirmIt('directive')
], function (answers) {
if (!answers.good) {
return cb();
}
answers.camel = Util.camelize(answers.directive);
answers.mod = Util.classable(answers.camel);
answers.slug = Util.slugify(answers.directive);
answers.select = Util.selectable(answers.selector, answers.slug);
gulp.src(path.join(__dirname, 'templates/options/directive/directive.ts'))
.pipe(template(answers))
.pipe(rename(function (file) { file.basename = answers.camel; }))
.pipe(conflict(path.join(process.cwd(), 'src/directive')))
.pipe(gulp.dest(path.join(process.cwd(), 'src/directive')))
.on('finish', function () { cb(); }).resume();
});
});
gulp.task('pipe', function (cb) {
Util.checkDir(cb);
inquirer.prompt([
Util.promptFn.nameIt('pipe', gulp.args),
Util.promptFn.importIt('common'),
Util.promptFn.importIt('core'),
], function (answers) {
if (!answers.good) {
return cb();
}
answers.camel = Util.camelize(answers.pipe);
answers.mod = Util.classable(answers.camel);
answers.slug = Util.slugify(answers.pipe);
gulp.src(path.join(__dirname, 'templates/options/pipe/pipe.ts'))
.pipe(template(answers))
.pipe(rename(function (file) { file.basename = answers.camel; }))
.pipe(conflict(path.join(process.cwd(), 'src/shared')))
.pipe(gulp.dest(path.join(process.cwd(), 'src/shared')))
.on('finish', function () { cb(); }).resume();
});
});
gulp.task('service', function (cb) {
Util.checkDir(cb);
inquirer.prompt([
Util.promptFn.nameIt('service', gulp.args),
Util.promptFn.importIt('common'),
Util.promptFn.importIt('core'),
Util.promptFn.importIt('http'),
Util.promptFn.importIt('router'),
Util.promptFn.confirmIt('service')
], function (answers) {
if (!answers.good) {
return cb();
}
answers.camel = Util.camelize(answers.service);
answers.mod = Util.classable(answers.camel);
gulp.src(path.join(__dirname, 'templates/options/service/service.ts'))
.pipe(template(answers))
.pipe(rename(function (file) { file.basename = answers.camel; }))
.pipe(conflict(path.join(process.cwd(), 'src/shared')))
.pipe(gulp.dest(path.join(process.cwd(), 'src/shared')))
.on('finish', function () { cb(); }).resume();
});
});
// gulp.task('component', function (cb) {
// Util.checkDir(cb);
// inquirer.prompt([
// Util.promptFn.nameIt('component', gulp.args),
// Util.promptFn.selectIt(2),
// Util.promptFn.intOrExt('styles'),
// Util.promptFn.intOrExt('template'),
// Util.promptFn.importIt('animation'),
// Util.promptFn.importIt('common'),
// Util.promptFn.importIt('core'),
// Util.promptFn.importIt('http'),
// Util.promptFn.importIt('router'),
// Util.promptFn.confirmIt('component')
// ], function (answers) {
// if (!answers.good) {
// return cb();
// }
// answers.camel = Util.camelize(answers.component);
// answers.mod = Util.classable(answers.camel);
// answers.slug = Util.slugify(answers.component);
// answers.select = Util.selectable(answers.selector, answers.slug);
// var source = [path.join(__dirname, 'templates/options/component/component.ts')];
// if (answers.styles == 'external') {
// source.push(path.join(__dirname, 'templates/options/styles.css'));
// }
// if (answers.template == 'external') {
// source.push(path.join(__dirname, 'templates/options/template.html'));
// }
// gulp.src(source)
// .pipe(template(answers))
// .pipe(rename(function (file) { file.basename = answers.camel; }))
// .pipe(conflict(path.join(process.cwd(), 'src/component')))
// .pipe(gulp.dest(path.join(process.cwd(), 'src/component')))
// .on('finish', function () { cb(); }).resume();
// });
// });
// gulp.task('directive', function (cb) {
// Util.checkDir(cb);
// inquirer.prompt([
// Util.promptFn.nameIt('directive', gulp.args),
// Util.promptFn.selectIt(0),
// Util.promptFn.importIt('animation'),
// Util.promptFn.importIt('common'),
// Util.promptFn.importIt('core'),
// Util.promptFn.confirmIt('directive')
// ], function (answers) {
// if (!answers.good) {
// return cb();
// }
// answers.camel = Util.camelize(answers.directive);
// answers.mod = Util.classable(answers.camel);
// answers.slug = Util.slugify(answers.directive);
// answers.select = Util.selectable(answers.selector, answers.slug);
// gulp.src(path.join(__dirname, 'templates/options/directive/directive.ts'))
// .pipe(template(answers))
// .pipe(rename(function (file) { file.basename = answers.camel; }))
// .pipe(conflict(path.join(process.cwd(), 'src/directive')))
// .pipe(gulp.dest(path.join(process.cwd(), 'src/directive')))
// .on('finish', function () { cb(); }).resume();
// });
// });
// gulp.task('pipe', function (cb) {
// Util.checkDir(cb);
// inquirer.prompt([
// Util.promptFn.nameIt('pipe', gulp.args),
// Util.promptFn.importIt('common'),
// Util.promptFn.importIt('core'),
// ], function (answers) {
// if (!answers.good) {
// return cb();
// }
// answers.camel = Util.camelize(answers.pipe);
// answers.mod = Util.classable(answers.camel);
// answers.slug = Util.slugify(answers.pipe);
// gulp.src(path.join(__dirname, 'templates/options/pipe/pipe.ts'))
// .pipe(template(answers))
// .pipe(rename(function (file) { file.basename = answers.camel; }))
// .pipe(conflict(path.join(process.cwd(), 'src/shared')))
// .pipe(gulp.dest(path.join(process.cwd(), 'src/shared')))
// .on('finish', function () { cb(); }).resume();
// });
// });
// gulp.task('service', function (cb) {
// Util.checkDir(cb);
// inquirer.prompt([
// Util.promptFn.nameIt('service', gulp.args),
// Util.promptFn.importIt('common'),
// Util.promptFn.importIt('core'),
// Util.promptFn.importIt('http'),
// Util.promptFn.importIt('router'),
// Util.promptFn.confirmIt('service')
// ], function (answers) {
// if (!answers.good) {
// return cb();
// }
// answers.camel = Util.camelize(answers.service);
// answers.mod = Util.classable(answers.camel);
// gulp.src(path.join(__dirname, 'templates/options/service/service.ts'))
// .pipe(template(answers))
// .pipe(rename(function (file) { file.basename = answers.camel; }))
// .pipe(conflict(path.join(process.cwd(), 'src/shared')))
// .pipe(gulp.dest(path.join(process.cwd(), 'src/shared')))
// .on('finish', function () { cb(); }).resume();
// });
// });
var ng2API = {
animation: ['Animation', 'AnimationBuilder', 'BrowserDetails', 'CssAnimationBuilder', 'CssAnimationOptions'],
common: ['COMMON_DIRECTIVES', 'COMMON_PIPES', 'CORE_DIRECTIVES', 'FORM_DIRECTIVES', 'FORM_PROVIDERS', 'FormBuilder', 'Validators'],
Expand Down
3 changes: 0 additions & 3 deletions templates/app/README.md
@@ -1,9 +1,6 @@
<%= camel %>
============

For Angular2 things (*not guaranteeing this will work with rc1 right now*):
>`slush angular:<component|directive|pipe|service> [<optional name of thing>]`
To compile and serve:
>`npm start`
Expand Down
6 changes: 3 additions & 3 deletions templates/app/gulpfile.js
Expand Up @@ -31,7 +31,7 @@ gulp.task('build:prod', ['compile'], () => {

gulp.task('compile', () => {
gulp.src(['src/**/*.ts', 'typings/browser.d.ts'])
.pipe(tsc(cfg.tsProject))
.pipe(cfg.tsProject())
.pipe(gulp.dest('dist'))
.pipe(connect.reload());
});
Expand All @@ -41,7 +41,7 @@ gulp.task('inject:dev', () => {
.pipe(inject(gulp.src([cfg.config]), {
starttag: '<!-- inject:app -->',
transform: function (filePath, file) {
return '\n\t<script src="' + filePath + '"></script>\n\t<script>System.import(\'app\').catch(console.error.bind(console));</script>\n\t';
return '<script src=".' + filePath + '"></script><script>System.import(\'app\').catch(console.error.bind(console));</script>';
}}))
.pipe(gulp.dest('.'));
});
Expand All @@ -51,7 +51,7 @@ gulp.task('inject:prod', ['build:prod'], () => {
.pipe(inject(gulp.src(['dist/build.js']), {
starttag: '<!-- inject:app -->',
transform: function (filePath, file) {
return '<script src="' + filePath + '"></script>';
return '<script src=".' + filePath + '"></script>';
}}))
.pipe(gulp.dest('.'));
});
Expand Down
46 changes: 23 additions & 23 deletions templates/app/package.json
Expand Up @@ -3,36 +3,36 @@
"name": "<%= slug %>",
"description": "Angular2 Flavored Slushy",
"dependencies": {
"@angular/common": "2.0.0-rc.4",
"@angular/compiler": "2.0.0-rc.4",
"@angular/core": "2.0.0-rc.4",
"@angular/common": "2.0.2",
"@angular/compiler": "2.0.2",
"@angular/core": "2.0.2",
"@angular/forms": "0.2.0",
"@angular/http": "2.0.0-rc.4",
"@angular/platform-browser": "2.0.0-rc.4",
"@angular/platform-browser-dynamic": "2.0.0-rc.4",
"@angular/router": "3.0.0-beta.1",
"@angular/upgrade": "2.0.0-rc.4",
"angular2-in-memory-web-api": "0.0.14",
"@angular/http": "2.0.2",
"@angular/platform-browser": "2.0.2",
"@angular/platform-browser-dynamic": "2.0.2",
"@angular/router": "3.0.0",
"@angular/service-worker": "2.0.2",
"angular-in-memory-web-api": "0.1.6",
"core-js": "2.4.1",
"reflect-metadata": "0.1.3",
"rxjs": "5.0.0-beta.6",
"systemjs": "0.19.31",
"zone.js": "0.6.12"
"reflect-metadata": "0.1.8",
"rxjs": "5.0.0-beta.12",
"systemjs": "0.19.39",
"ts-helpers": "1.1.1",
"zone.js": "0.6.25"
},
"devDependencies": {
"angular2-service-worker": "0.1.13",
"gulp": "^3.9.1",
"gulp-concat": "^2.6.0",
"gulp-connect": "^4.2.0",
"gulp-connect": "^5.0.0",
"gulp-inject": "^4.1.0",
"gulp-sourcemaps": "^1.6.0",
"gulp-tslint": "^6.0.1",
"gulp-typescript": "^2.13.6",
"gulp-uglify": "^1.5.4",
"systemjs-builder": "^0.15.23",
"tslint": "^3.13.0",
"typescript": "^1.8.10",
"typings": "^1.3.1"
"gulp-sourcemaps": "^1.7.3",
"gulp-tslint": "^6.1.2",
"gulp-typescript": "^3.0.2",
"gulp-uglify": "^2.0.0",
"systemjs-builder": "^0.15.32",
"tslint": "^3.15.1",
"typescript": "^2.0.3",
"typings": "^1.4.0"
},
"scripts": {
"postinstall": "typings install && gulp",
Expand Down
1 change: 0 additions & 1 deletion templates/app/src/+examples/home.ts

This file was deleted.

1 change: 0 additions & 1 deletion templates/app/src/+examples/links.ts

This file was deleted.

0 comments on commit 747abfe

Please sign in to comment.