From f57d88e39d3d81093c93592abf4455b91c0cc07c Mon Sep 17 00:00:00 2001 From: cameron Date: Tue, 5 Jul 2016 12:41:10 +1200 Subject: [PATCH] angular2 generator and schema generators --- yeoman/generator-horizon-angular2/README.md | 4 + .../generator-horizon-angular2/app/index.js | 19 + .../app/templates/README.md | 10 + .../app/templates/dist/app/app.component.ts | 19 + .../app/components/chat/chat.component.ts | 91 +++++ .../dist/app/components/chat/chat.service.ts | 26 ++ .../app/templates/dist/app/horizon.d.ts | 1 + .../app/templates/dist/app/main.ts | 4 + .../app/templates/dist/index.html | 31 ++ .../app/templates/dist/package.json | 26 ++ .../app/templates/dist/systemjs.config.js | 38 ++ .../app/templates/dist/tsconfig.json | 17 + .../app/templates/dist/typings.json | 6 + .../app/templates/schema.toml | 5 + .../generator-horizon-angular2/package.json | 27 ++ yeoman/generator-horizon-schema/README.md | 26 ++ yeoman/generator-horizon-schema/app/index.js | 367 ++++++++++++++++++ yeoman/generator-horizon-schema/package.json | 22 ++ 18 files changed, 739 insertions(+) create mode 100644 yeoman/generator-horizon-angular2/README.md create mode 100644 yeoman/generator-horizon-angular2/app/index.js create mode 100755 yeoman/generator-horizon-angular2/app/templates/README.md create mode 100755 yeoman/generator-horizon-angular2/app/templates/dist/app/app.component.ts create mode 100644 yeoman/generator-horizon-angular2/app/templates/dist/app/components/chat/chat.component.ts create mode 100644 yeoman/generator-horizon-angular2/app/templates/dist/app/components/chat/chat.service.ts create mode 100644 yeoman/generator-horizon-angular2/app/templates/dist/app/horizon.d.ts create mode 100755 yeoman/generator-horizon-angular2/app/templates/dist/app/main.ts create mode 100755 yeoman/generator-horizon-angular2/app/templates/dist/index.html create mode 100755 yeoman/generator-horizon-angular2/app/templates/dist/package.json create mode 100644 yeoman/generator-horizon-angular2/app/templates/dist/systemjs.config.js create mode 100755 yeoman/generator-horizon-angular2/app/templates/dist/tsconfig.json create mode 100755 yeoman/generator-horizon-angular2/app/templates/dist/typings.json create mode 100644 yeoman/generator-horizon-angular2/app/templates/schema.toml create mode 100644 yeoman/generator-horizon-angular2/package.json create mode 100644 yeoman/generator-horizon-schema/README.md create mode 100644 yeoman/generator-horizon-schema/app/index.js create mode 100644 yeoman/generator-horizon-schema/package.json diff --git a/yeoman/generator-horizon-angular2/README.md b/yeoman/generator-horizon-angular2/README.md new file mode 100644 index 000000000..00a105a53 --- /dev/null +++ b/yeoman/generator-horizon-angular2/README.md @@ -0,0 +1,4 @@ +How to run: + +1. enter: npm install -g yo generator-horizon-angular2 +2. run: yo horizon-angular2 from desired directory \ No newline at end of file diff --git a/yeoman/generator-horizon-angular2/app/index.js b/yeoman/generator-horizon-angular2/app/index.js new file mode 100644 index 000000000..e219a4f0e --- /dev/null +++ b/yeoman/generator-horizon-angular2/app/index.js @@ -0,0 +1,19 @@ +'use strict'; + +const chalk = require('chalk'); +const yeoman = require('yeoman-generator'); +const yosay = require('yosay'); +module.exports = yeoman.generators.Base.extend({ + prompting: function() { + // yeoman greeting + this.log(yosay( + `Yo! I\'m here to help build your + ${chalk.bold.yellow('Horizon Angular2')} application.` + )); + }, + writing: { + app: function() { + this.directory('', ''); + }, + }, +}); \ No newline at end of file diff --git a/yeoman/generator-horizon-angular2/app/templates/README.md b/yeoman/generator-horizon-angular2/app/templates/README.md new file mode 100755 index 000000000..5db329253 --- /dev/null +++ b/yeoman/generator-horizon-angular2/app/templates/README.md @@ -0,0 +1,10 @@ +Horizon Chat example using Angular2 + +Running this example + +1. Install Horizon: "npm install -g horizon" +2. Install RethinkDB: https://rethinkdb.com/docs/install +3. Prep the project "cd dist && npm i && cd .." +4. Run "horizon init" in this directory +5. Run "horizon serve --dev" +6. Open http://127.0.0.1:8181 diff --git a/yeoman/generator-horizon-angular2/app/templates/dist/app/app.component.ts b/yeoman/generator-horizon-angular2/app/templates/dist/app/app.component.ts new file mode 100755 index 000000000..a7e9625e7 --- /dev/null +++ b/yeoman/generator-horizon-angular2/app/templates/dist/app/app.component.ts @@ -0,0 +1,19 @@ +/// + +import {Component} from '@angular/core'; +import {ChatComponent} from './components/chat/chat.component' + +@Component({ + selector: 'my-app', + template: '', + directives: [ChatComponent], + styles:[` chat{ + margin: auto; + max-width: 800px; + width:100%; + display:block; + + } + `] +}) +export class AppComponent { } diff --git a/yeoman/generator-horizon-angular2/app/templates/dist/app/components/chat/chat.component.ts b/yeoman/generator-horizon-angular2/app/templates/dist/app/components/chat/chat.component.ts new file mode 100644 index 000000000..e5406635f --- /dev/null +++ b/yeoman/generator-horizon-angular2/app/templates/dist/app/components/chat/chat.component.ts @@ -0,0 +1,91 @@ +import {Component, OnInit} from '@angular/core'; +import {ChatService} from './chat.service' + +@Component({ + selector: '', + styles: [` + ul { + list-style-type: none; + padding:0; + } + + .message { + height: 50px; + padding:5px; + } + + .message img { + vertical-align:middle; + } + .message .text { + vertical-align:middle; + margin-left:5px; + font-size:20px; + } + .message .datetime { + color:darkgrey; + float:right; + } + form{ + + } + input { + width: 90%; + height: 50px; + font-size: 20px; + float: left; + padding: 10px; + } + button{ + width:10%; + height: 50px; + } + `], + template: `

Messages

+
+ + +
+ `, + providers:[ChatService] +}) +export class ChatComponent implements OnInit { + newMessage = ''; + messages = []; + + constructor(private _chatService: ChatService) { + + } + ngOnInit() { + this.getChats() + } + + getChats = function () { + this._chatService + .getChats() + .subscribe((newMessages) => { + this.messages = [...newMessages]; + }); + } + + addMessage = function (text) { + if (text) { + this._chatService + .sendChat(text) + .subscribe(); + this.newMessage = ''; + } + } + + + + +} diff --git a/yeoman/generator-horizon-angular2/app/templates/dist/app/components/chat/chat.service.ts b/yeoman/generator-horizon-angular2/app/templates/dist/app/components/chat/chat.service.ts new file mode 100644 index 000000000..8e5922dd2 --- /dev/null +++ b/yeoman/generator-horizon-angular2/app/templates/dist/app/components/chat/chat.service.ts @@ -0,0 +1,26 @@ +import {Component, OnInit} from '@angular/core'; +import {Observable} from 'rxjs' + + +export class ChatService { + horizon = Horizon(); + chat = this.horizon('chat'); + avatar_url = `http://api.adorable.io/avatars/50/${new Date().getMilliseconds()}.png`; + + + constructor() { } + getChats = function (): Observable<[any]> { + return this.chat + .order('datetime', 'descending') + .limit(8) + .watch() + } + + sendChat = function (text: string): Observable<[any]> { + return this.chat.store({ + text: text, + datetime: new Date(), + url: this.avatar_url, + }) + } +} diff --git a/yeoman/generator-horizon-angular2/app/templates/dist/app/horizon.d.ts b/yeoman/generator-horizon-angular2/app/templates/dist/app/horizon.d.ts new file mode 100644 index 000000000..0e4e29680 --- /dev/null +++ b/yeoman/generator-horizon-angular2/app/templates/dist/app/horizon.d.ts @@ -0,0 +1 @@ +declare var Horizon: any \ No newline at end of file diff --git a/yeoman/generator-horizon-angular2/app/templates/dist/app/main.ts b/yeoman/generator-horizon-angular2/app/templates/dist/app/main.ts new file mode 100755 index 000000000..84302dd22 --- /dev/null +++ b/yeoman/generator-horizon-angular2/app/templates/dist/app/main.ts @@ -0,0 +1,4 @@ +import { bootstrap } from '@angular/platform-browser-dynamic'; +import { AppComponent } from './app.component'; + +bootstrap(AppComponent); diff --git a/yeoman/generator-horizon-angular2/app/templates/dist/index.html b/yeoman/generator-horizon-angular2/app/templates/dist/index.html new file mode 100755 index 000000000..4f398f437 --- /dev/null +++ b/yeoman/generator-horizon-angular2/app/templates/dist/index.html @@ -0,0 +1,31 @@ + + + + + Horizon Angular 2 chat example + + + + + + + + + + + + + + + + + + + + + Loading... + + + \ No newline at end of file diff --git a/yeoman/generator-horizon-angular2/app/templates/dist/package.json b/yeoman/generator-horizon-angular2/app/templates/dist/package.json new file mode 100755 index 000000000..792951c72 --- /dev/null +++ b/yeoman/generator-horizon-angular2/app/templates/dist/package.json @@ -0,0 +1,26 @@ +{ + "name": "angular2-chat-app", + "version": "1.0.0", + "scripts": { + "postinstall": "typings install", + "typings": "typings" + }, + "license": "ISC", + "dependencies": { + "@angular/common": "2.0.0-rc.1", + "@angular/compiler": "2.0.0-rc.1", + "@angular/core": "2.0.0-rc.1", + "@angular/http": "2.0.0-rc.1", + "@angular/platform-browser": "2.0.0-rc.1", + "@angular/platform-browser-dynamic": "2.0.0-rc.1", + "systemjs": "0.19.27", + "es6-shim": "^0.35.0", + "reflect-metadata": "^0.1.3", + "rxjs": "5.0.0-beta.6", + "zone.js": "^0.6.12", + "typescript": "^1.8.9" + }, + "devDependencies": { + "typings":"^0.8.1" + } +} \ No newline at end of file diff --git a/yeoman/generator-horizon-angular2/app/templates/dist/systemjs.config.js b/yeoman/generator-horizon-angular2/app/templates/dist/systemjs.config.js new file mode 100644 index 000000000..034f059e0 --- /dev/null +++ b/yeoman/generator-horizon-angular2/app/templates/dist/systemjs.config.js @@ -0,0 +1,38 @@ +(function(global) { + + // map tells the System loader where to look for things + var map = { + 'app': 'app', // 'dist', + 'rxjs': 'node_modules/rxjs', + 'angular2-in-memory-web-api': 'node_modules/angular2-in-memory-web-api', + '@angular': 'node_modules/@angular' + }; + // packages tells the System loader how to load when no filename and/or no extension + var packages = { + 'app': { main: 'main.ts', defaultExtension: 'ts' }, + 'rxjs': { defaultExtension: 'js' }, + 'angular2-in-memory-web-api': { defaultExtension: 'js' }, + }; + var packageNames = [ + '@angular/common', + '@angular/compiler', + '@angular/core', + '@angular/http', + '@angular/platform-browser', + '@angular/platform-browser-dynamic', + '@angular/testing', + ]; + // add package entries for angular packages in the form '@angular/common': { main: 'index.js', defaultExtension: 'js' } + packageNames.forEach(function(pkgName) { + packages[pkgName] = { main: 'index.js', defaultExtension: 'js' }; + }); + var config = { + transpiler: 'typescript', + typescriptOptions: { + emitDecoratorMetadata: true + }, + map: map, + packages: packages + } + System.config(config); +})(this); diff --git a/yeoman/generator-horizon-angular2/app/templates/dist/tsconfig.json b/yeoman/generator-horizon-angular2/app/templates/dist/tsconfig.json new file mode 100755 index 000000000..9be71e4c6 --- /dev/null +++ b/yeoman/generator-horizon-angular2/app/templates/dist/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "target": "es5", + "module": "system", + "moduleResolution": "node", + "sourceMap": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "removeComments": false, + "noImplicitAny": false + }, + "exclude": [ + "node_modules", + "typings/main", + "typings/main.d.ts" + ] +} diff --git a/yeoman/generator-horizon-angular2/app/templates/dist/typings.json b/yeoman/generator-horizon-angular2/app/templates/dist/typings.json new file mode 100755 index 000000000..c06bb4d72 --- /dev/null +++ b/yeoman/generator-horizon-angular2/app/templates/dist/typings.json @@ -0,0 +1,6 @@ +{ + "ambientDependencies": { + "es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#7de6c3dd94feaeb21f20054b9f30d5dabc5efabd", + "jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#7de6c3dd94feaeb21f20054b9f30d5dabc5efabd" + } +} diff --git a/yeoman/generator-horizon-angular2/app/templates/schema.toml b/yeoman/generator-horizon-angular2/app/templates/schema.toml new file mode 100644 index 000000000..782f9644c --- /dev/null +++ b/yeoman/generator-horizon-angular2/app/templates/schema.toml @@ -0,0 +1,5 @@ +[collections] + +# +[rules] + diff --git a/yeoman/generator-horizon-angular2/package.json b/yeoman/generator-horizon-angular2/package.json new file mode 100644 index 000000000..f3cd31297 --- /dev/null +++ b/yeoman/generator-horizon-angular2/package.json @@ -0,0 +1,27 @@ +{ + "name": "generator-horizon-angular2", + "version": "0.1.0", + "description": "Horizon angular2 chat app generator", + "main": "app/index.js", + "engines": { + "node": ">=0.10.0" + }, + "keywords": [ + "yeoman-generator", + "angular yeoman", + "angular2 yeoman", + "angularjs", + "angular", + "angularjs2", + "angular2", + "es6" + ], + "preferGlobal": true, + "dependencies": { + "lodash": "^3.7.0", + "chalk": "^1.0.0", + "npm-check": "^3.2.10", + "yeoman-generator": "^0.19.2", + "yosay": "^1.0.2" + } +} \ No newline at end of file diff --git a/yeoman/generator-horizon-schema/README.md b/yeoman/generator-horizon-schema/README.md new file mode 100644 index 000000000..d1274c22e --- /dev/null +++ b/yeoman/generator-horizon-schema/README.md @@ -0,0 +1,26 @@ +how to run: + +1. run npm install -g yo generator-horizon-rulecreator form any directory +2. in the desired directory run : yo horizon-rulecreator + +This generator helps users create schema files that the user can then implement. + +Horizon’s permission system is based on a query whitelist. Any operation on a Horizon collection is disallowed +by default, unless there is a rule that allows the operation. + +A whitelist rule has three properties that define which operations it covers: + + 1. A user group + 2. A query template describing the type of operation + 3. An optional validator function written in JavaScript that can be used to check the contents of the + accessed documents, or to implement more complex permission checks + +You can use the special "default" group to create rules that apply to all users, authenticated or not. Or use +the "authenticated" group to cover authenticated users only. + +``` +[groups.GROUP_NAME.rules.RULE_NAME] +template = "QUERY_TEMPLATE" +# Optional: +validator = "VALIDATOR_FUNCTION" +``` diff --git a/yeoman/generator-horizon-schema/app/index.js b/yeoman/generator-horizon-schema/app/index.js new file mode 100644 index 000000000..2cb311ba1 --- /dev/null +++ b/yeoman/generator-horizon-schema/app/index.js @@ -0,0 +1,367 @@ +'use strict'; +const chalk = require('chalk'); +const yeoman = require('yeoman-generator'); +const yosay = require('yosay'); +const prompt = require('prompt'); +const fs = require('fs'); + +let _group, + _name, + _query, + queryName, + mod1, + mod2, + _rules, + _collection, + collName, + collItem; + +let collItems = []; +let store = []; + +const schema = { + properties: { + name: { + pattern: /^[a-zA-Z]+$/, + message: 'Name must be only letters', + required: true, + description: '', + }, + }, +}; +const findAll = { + properties: { + find: { + pattern: /^(any|userId())$/, + message: 'only any or userId are acceptable', + required: true, + }, + }, +}; +const answerSchema = { + properties: { + answer: { + pattern: /^(?:yes|no|y|n)$/i, + message: 'yes or no only', + required: false, + }, + }, +}; +const querySchema = { + properties: { + items: { + pattern: /^\w+/, + message: 'Query is not valid', + required: true, + }, + }, +}; + +const queryQuestion = { + properties: { + answer: { + pattern: /(watch|fetch|anyWrite|findAll|store)?/, + message: 'not a valid option', + required: true, + }, + }, +}; + +module.exports = yeoman.generators.Base.extend({ + prompting: function() { + // yeoman greeting + this.log(yosay( + `Yo! I\'m here to help create your + ${chalk.bold.yellow('Horizon')} Schema.` + )); + console.log('Any operation on a Horizon collection is disallowed ' + + 'by default, unless there is a rule that allows the operation.\n\n' + + 'A whitelist rule has three properties that define which operations' + + ' it covers:\n\n* A user group\n' + + '* A query template describing the type of operation\n* An optional' + + ' validator function' + + ' written in JavaScript that can be used to check the contents of' + + ' the accessed\n documents, or to implement more' + + ' complex permission checks\n\nA rule has the layout of' + + ' :\n[groups.GROUP_NAME.rules.RULE_NAME]\ntemplate =' + + ' "QUERY_TEMPLATE"' + + '\n# Optional:\nvalidator = "VALIDATOR_FUNCTION"\n' + ); + }, + writing: { + app: function() { + prompt.message = ''; + testForSchemaFile(); + function testForSchemaFile() { + fs.readFile('schema.toml', 'utf8', function(err, data) { + if (err) { + fs.writeFile('schema.toml', '[collections]\n\n#\n[rules]\n\n', + function(err1) { + if (err1) { + console.log('failed to create a schema.toml file for you' + + ' and one doesn\'t exist already'); + process.exit(); + } else { + fs.readFile('schema.toml', 'utf8', function(err2, input1) { + if (err2) { + console.log('failed to read schema'); + } else { + readRules(input1); + } + }); + } + }); + } else { + readRules(data); + } + }); + } + function readRules(data) { + if (data) { + store = data.split('#'); + _collection = store[0]; + _rules = store[1]; + } + addColl(); + } + function addColl() { + console.log('Would you like to add a collection?'); + prompt.start(); + prompt.get(answerSchema, function(err, result) { + if (err) { return onErr(err); } + const ans = result.answer; + if (ans === 'no' || ans === 'No' || ans === 'NO' || ans === 'n' || + ans === 'N') { + addRule(); + } else { + collectionName(); + } + }); + } + function collectionName() { + console.log('Collection name?'); + prompt.start(); + prompt.get(schema, function(err, result) { + if (err) { return onErr(err); } + collName = result.name; + collectionItem(); + }); + } + function collectionItem() { + console.log('Name of your collection\'s item?'); + prompt.start(); + prompt.get(schema, function(err, result) { + if (err) { return onErr(err); } + collItem = result.name; + const lengthy = collItems.length; + collItems[lengthy] = collItem; + addCollItem(); + }); + } + function addCollItem() { + console.log('Would you like to add another item to the collection?'); + prompt.start(); + prompt.get(answerSchema, function(err, result) { + if (err) { return onErr(err); } + const ans = result.answer; + if (ans === 'no' || ans === 'No' || ans === 'NO' || ans === 'n' || + ans === 'N') { + collectionMaker(); + } else { + collectionItem(); + } + }); + } + function collectionMaker() { + collItem = `"${collItems[0]}"`; + for (let i = 1; i < collItems.length; i++) { + collItem = `${collItem} + ,\n\" + ${collItems[i]} + \"`; + } + _collection = `${_collection} [collections.${collName}]\nindexes = + [\n${collItem}\n]\n\n`; + collItem = ''; + collItems = []; + addAnotherColl(); + } + function addAnotherColl() { + console.log('Would you like to add another collection?'); + prompt.start(); + prompt.get(answerSchema, function(err, result) { + if (err) { return onErr(err); } + const ans = result.answer; + if (ans === 'no' || ans === 'No' || ans === 'NO' || ans === 'n' || + ans === 'N') { + addRule(); + } else { + collectionName(); + } + }); + } + function addRule() { + console.log('Would you like to add a rule?'); + prompt.start(); + prompt.get(answerSchema, function(err, result) { + if (err) { return onErr(err); } + const ans = result.answer; + if (ans === 'no' || ans === 'No' || ans === 'NO' || ans === 'n' || + ans === 'N') { + print(_collection, _rules); + } else { + nameGroup(); + } + }); + } + function nameGroup() { + console.log('What group do you want the rule to apply to?'); + prompt.start(); + prompt.get(schema, function(err, result) { + if (err) { return onErr(err); } + _group = result.name; + nameRule(); + }); + } + function nameRule() { + console.log('What do you want the name of your rule to be?'); + prompt.start(); + prompt.get(schema, function(err, result) { + if (err) { return onErr(err); } + _name = result.name; + queryInfo(); + }); + } + function queryInfo() { + console.log('What is the collection you wish to apply this rule to?'); + prompt.get(schema, function(err, result) { + if (err) { return onErr(err); } + queryName = result.name; + queryMod(); + }); + } + function queryMod() { + mod1 = ''; + mod2 = ''; + console.log('What method would you like to use?\n' + + 'options are: watch, fetch, anyWrite, findAll, store or none'); + prompt.start(); + prompt.get(queryQuestion, function(err, result) { + if (err) { return onErr(err); } + mod1 = result.answer; + switch (mod1) { + case 'watch': + builder1(); + break; + case 'fetch': + builder1(); + break; + case 'anyWrite': + builder1(); + break; + case 'findAll': + console.log('Do you want to use any or userId?'); + prompt.start(); + prompt.get(findAll, function(err1, result1) { + if (err) { return onErr(err1); } + mod2 = result1.find; + mod2 = `. ${mod1} + ({type: ${mod2}()}).fetch()\"`; + builder2(mod2); + }); + break; + case 'store': + console.log('Add each element you want to store ' + + 'from this collection separated by a comma'); + prompt.start(); + prompt.get(querySchema, function(err2, result2) { + if (err) { return onErr(err2); } + mod2 = result2.items; + const arr = mod2.split(','); + let out = `{${arr[0]}: any()`; + for (let i = 1; i < arr.length; i++) { + out += `, ${arr[i]}: any()`; + } + out += '}'; + const mods = `.${mod1}(${out})\"`; + builder2(mods); + }); + break; + case 'none': + case '': + builder1(); + break; + } + }); + } + // builder for query with one modifier + function builder1() { + if (mod1) { + _query = `\"collection(\'${queryName}\').${mod1}()\"`; + } else { + _query = `\"collection(\'${queryName}\')\"`; + } + addValidator(); + } + // builder for query with more than one modifier + function builder2(inputs) { + _query = `\"collection(\'${queryName}\')${inputs}`; + addValidator(); + } + function addValidator() { + console.log('Would you like to add a default validator?'); + prompt.start(); + prompt.get(answerSchema, function(err, result) { + if (err) { return onErr(err); } + const ans = result.answer; + if (ans === 'no' || ans === 'No' || ans === 'NO' || ans === 'n' || + ans === 'N') { + rule(); + } else { + ruleExtra(); + } + }); + } + function rule() { + const ru = `[groups.${_group}.rules.${_name}] \n + template = ${_query}\n\n`; + rules(ru); + } + function ruleExtra() { + const rul = `[groups.${_group}.rules.${_name}] \n + template = ${_query}\nvalidator = \"\"\" (context, oldValue, + newValue) => { return newValue.length > 1; } \"\"\"\n\n`; + rules(rul); + } + function rules(rulePro) { + if (_rules) { + _rules += rulePro; + } else { + _rules = rulePro; + } + console.log('Would you like to make another rule?(y/N)'); + prompt.start(); + prompt.get([ 'answer' ], function(err, result) { + if (err) { return onErr(err); } + + if (result.answer === 'y' || result.answer === 'Y') { + nameGroup(); + } else if (result.answer === 'n' || result.answer === 'N' || + result.answer === '') { + print(_collection, _rules); + } else { + rules(''); + } + }); + } + function print(collection, words) { + fs.writeFile('schema.toml', `${collection}#${words}`, function(err) { + if (err) { + return console.log(err); + } + console.log('Saved Rules'); + }); + } + function onErr(err) { + console.log(err); + process.exit(); + } + }, + }, +}); \ No newline at end of file diff --git a/yeoman/generator-horizon-schema/package.json b/yeoman/generator-horizon-schema/package.json new file mode 100644 index 000000000..4645d2b20 --- /dev/null +++ b/yeoman/generator-horizon-schema/package.json @@ -0,0 +1,22 @@ +{ + "name": "generator-horizon-schema", + "version": "0.1.0", + "description": "Horizon Rule Generator", + "main": "app/index.js", + "engines": { + "node": ">=0.10.0" + }, + "keywords": [ + "yeoman-generator", + "horizon" + ], + "preferGlobal": true, + "dependencies": { + "lodash": "^3.7.0", + "chalk": "^1.0.0", + "npm-check": "^3.2.10", + "yeoman-generator": "^0.19.2", + "yosay": "^1.0.2", + "prompt": "^1.0.0" + } +} \ No newline at end of file