From 815640bf47c83e372dc155fdad1b0f7f755328b7 Mon Sep 17 00:00:00 2001 From: Andreas Savvides Date: Fri, 8 May 2015 21:36:13 +0100 Subject: [PATCH 1/6] Better syntax highlighting in README --- README.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 67d3b59..c787a18 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ yo react-webpack:component foo //or just: yo react-webpack:c foo ``` Produces `src/components/Foo.js` (*javascript - JSX*): -``` +```js 'use strict'; var React = require('react/addons'); @@ -79,7 +79,7 @@ module.exports = Foo; ``` And `test/spec/components/Foo.js` (*javascript - jasmine*): -``` +```js 'use strict'; describe('Foo', function () { @@ -97,7 +97,7 @@ describe('Foo', function () { ``` And `src/styles/Foo.css` (or .sass, .less etc...) : -``` +```css .Foo{ border: 1px dashed #f00; } @@ -110,7 +110,7 @@ For all you lazy programmers out there, we've added another shortcut - `rich` fl yo react-webpack:c foofoo --rich ``` This will give you all of react component's most common stuff : - ```` + ```js var React = require('react/addons'); require('styles/Foofoo.sass'); @@ -135,7 +135,7 @@ This will give you all of react component's most common stuff : }); module.exports = Foofoo; - ```` + ``` Just remove those you don't need, then fill and space out the rest. @@ -153,7 +153,7 @@ yo react-webpack:action bar //or just: yo react-webpack:a bar Will create a file - `src/actions/BarActionCreators.js` if 'architecture' is **Flux**, it Produces : -``` +```js 'use strict'; var BarActionCreators = { @@ -163,7 +163,7 @@ var BarActionCreators = { module.exports = BarActionCreators; ``` And if it's **Reflux**: -``` +```js 'use strict'; var Reflux = require('reflux'); @@ -177,7 +177,7 @@ module.exports = BarActionCreators; ``` and same test for both architectures: -``` +```js 'use strict'; describe('BarActionCreators', function() { @@ -204,7 +204,7 @@ yo react-webpack:store baz //or just: yo react-webpack:s baz Will create a file - `src/stores/BazStore.js` if 'architecture' is **Flux**, it Produces : -``` +```js 'use strict'; var EventEmitter = require('events').EventEmitter; @@ -226,7 +226,7 @@ BazStore.dispatchToken = MainAppDispatcher.register(function(action) { module.exports = BazStore; ``` And if it's **Reflux**: -``` +```js 'use strict'; var Reflux = require('reflux'); @@ -243,7 +243,7 @@ module.exports = BazStore; ``` and same test for both architectures: -``` +```js 'use strict'; describe('BazStore', function() { From 094d0c8905c3185828ac1b96c622f0f175ce2bb3 Mon Sep 17 00:00:00 2001 From: Pavlo Blazhchuk Date: Sat, 9 May 2015 22:16:24 +0300 Subject: [PATCH 2/6] Support io.js Add iojs to engines --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 0f3db9a..df4e61d 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,8 @@ "yo": ">=1.2.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=0.10.0", + "iojs": ">=1.1.0" }, "licenses": [ { From e94f494fa25a3baa8d268b3b3614ff53fe89f5ce Mon Sep 17 00:00:00 2001 From: Manu Phatak Date: Thu, 14 May 2015 13:47:54 -0500 Subject: [PATCH 3/6] typo: srore vs store --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 67d3b59..1b2f5db 100644 --- a/README.md +++ b/README.md @@ -279,7 +279,7 @@ Sets the style file's template and extension ### es6 -If you are using `es6`, and want to use its export functionality (and not webpack's), just add `--es6` flag when you create a component, action or srore. +If you are using `es6`, and want to use its export functionality (and not webpack's), just add `--es6` flag when you create a component, action or store. ## Testing From fc229506f4041cdbfa74585c96f2146e54a96295 Mon Sep 17 00:00:00 2001 From: Daan Nijkamp Date: Sat, 16 May 2015 15:21:22 +0200 Subject: [PATCH 4/6] Fix spelling mistake --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 67d3b59..1b2f5db 100644 --- a/README.md +++ b/README.md @@ -279,7 +279,7 @@ Sets the style file's template and extension ### es6 -If you are using `es6`, and want to use its export functionality (and not webpack's), just add `--es6` flag when you create a component, action or srore. +If you are using `es6`, and want to use its export functionality (and not webpack's), just add `--es6` flag when you create a component, action or store. ## Testing From 0b732e1a7cde8cc6d554045f6562643c80a78843 Mon Sep 17 00:00:00 2001 From: TLO Date: Wed, 20 May 2015 12:33:38 +0200 Subject: [PATCH 5/6] Added architecture option for Alt (http://alt.js.org), actions and stores --- action/index.js | 3 +++ app/index.js | 5 +++-- main/index.js | 6 ++++++ store/index.js | 3 +++ templates/common/_package.json | 3 ++- templates/javascript/AltAction.js | 11 +++++++++++ templates/javascript/AltStore.js | 21 +++++++++++++++++++++ templates/javascript/alt.js | 4 ++++ 8 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 templates/javascript/AltAction.js create mode 100644 templates/javascript/AltStore.js create mode 100644 templates/javascript/alt.js diff --git a/action/index.js b/action/index.js index be324a3..228642b 100644 --- a/action/index.js +++ b/action/index.js @@ -24,6 +24,9 @@ ActionGenerator.prototype.createActionFile = function createActionFile() { case 'reflux': actionTemplate = 'RefluxAction'; break; + case 'alt': + actionTemplate = 'AltAction'; + break; } console.log('Creating ' + this.architecture + ' action'); diff --git a/app/index.js b/app/index.js index c434b3f..888f39d 100644 --- a/app/index.js +++ b/app/index.js @@ -72,11 +72,12 @@ ReactWebpackGenerator.prototype.askForArchitecture = function() { this.prompt({ type : 'list', name : 'architecture', - message : 'Would you like to use one of those architectures?', + message : 'Would you like to use one of these architectures?', choices: [ {name:'No need for that, thanks',value:false}, {name:'Flux',value:'flux'}, - {name:'ReFlux',value:'reflux'} + {name:'ReFlux',value:'reflux'}, + {name:'Alt',value:'alt'} ], default : false }, function(props) { diff --git a/main/index.js b/main/index.js index d28ad0d..0317a5e 100644 --- a/main/index.js +++ b/main/index.js @@ -27,3 +27,9 @@ MainGenerator.prototype.createDispatcher = function createDispatcher() { this.appTemplate('Dispatcher', 'dispatcher/' + this.scriptAppName + 'Dispatcher'); } }; + +MainGenerator.prototype.createAltjsFile = function createAltjsFile() { + if(this.env.options.architecture=='alt') { + this.appTemplate('alt', 'alt'); + } +}; diff --git a/store/index.js b/store/index.js index b338678..98db828 100644 --- a/store/index.js +++ b/store/index.js @@ -26,6 +26,9 @@ StoreGenerator .prototype.createStoreFile = function createStoreFile() { case 'reflux': storeTemplate = 'RefluxStore'; break; + case 'alt': + storeTemplate = 'AltStore'; + break; } console.log('Creating ' + this.architecture + ' store'); diff --git a/templates/common/_package.json b/templates/common/_package.json index 5ae80ad..026efab 100644 --- a/templates/common/_package.json +++ b/templates/common/_package.json @@ -14,7 +14,8 @@ "flux": "^2.0.1", "events": "^1.0.2", "object-assign": "^2.0.0", <% } if (architecture === 'reflux') {%> - "reflux": "^0.2.7", <% } %> + "reflux": "^0.2.7", <% } if (architecture === 'alt') { %> + "alt": "^0.16.5", <% } %> "react": "~0.12.2", "normalize.css": "~3.0.3" }, diff --git a/templates/javascript/AltAction.js b/templates/javascript/AltAction.js new file mode 100644 index 0000000..98629df --- /dev/null +++ b/templates/javascript/AltAction.js @@ -0,0 +1,11 @@ +var alt = require('../alt'); + +<% if (es6) { %>class <%= classedName %> { + +}; <% } +else { %>var <%= classedName %> = alt.createActions(function () { + +}); <% } %> + +<% if (es6) { %>export default alt.createActions(<%= classedName %>); <% } +else { %>module.exports = <%= classedName %>; <% } %> diff --git a/templates/javascript/AltStore.js b/templates/javascript/AltStore.js new file mode 100644 index 0000000..a59a350 --- /dev/null +++ b/templates/javascript/AltStore.js @@ -0,0 +1,21 @@ +var alt = require('../alt'); + +<% if (es6) { %>class <%= classedName %> { + constructor() { + + this.bindListeners({ + + }); + + } +} <% } +else { %>var <%= classedName %> = alt.createStore({ + + bindListeners: { + + } + +}); <% } %> + +<% if (es6) { %>export default alt.createStore(<%= classedName %>, '<%= classedName %>'); <% } +else { %>module.exports = <%= classedName %>; <% } %> diff --git a/templates/javascript/alt.js b/templates/javascript/alt.js new file mode 100644 index 0000000..baa5fef --- /dev/null +++ b/templates/javascript/alt.js @@ -0,0 +1,4 @@ +var Alt = require('alt'); +var alt = new Alt(); + +module.exports = alt; From e0058bea05c71dfa651352b4692193e27f14911c Mon Sep 17 00:00:00 2001 From: Simon Bailey Date: Mon, 25 May 2015 17:22:50 +0100 Subject: [PATCH 6/6] chore: version bump 1.2.7 Signed-off-by: Simon Bailey --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index df4e61d..055a67e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "generator-react-webpack", - "version": "1.2.6", + "version": "1.2.7", "description": "Yeoman generator for ReactJS and Webpack", "keywords": [ "yeoman-generator",