Compare commits

..
12 Commits
Author SHA1 Message Date
Chris 432d5d00de 2.2.4 2015-10-15 16:09:41 +02:00
Chris 685f6a75ce Added automatic generation of components displayName property. 2015-10-15 16:09:23 +02:00
Chris 82a080f586 2.2.3 2015-10-14 07:20:38 +02:00
Chris 6c41164d4a Updated changeling for 2.2.3 2015-10-14 07:20:23 +02:00
Chris 9eedc6fd2f Merge pull request #152 from VovanR/feature/gitignore
Add .gitignore file to generated application
2015-10-14 07:13:59 +02:00
Vladimir Rodkin 83d47bddd8 Add gitignore 2015-10-13 20:40:06 +03:00
Vladimir Rodkin 31e478f28d Add gitignore 2015-10-13 17:54:47 +03:00
Chris b95fc4344a 2.2.2 2015-10-12 16:35:14 +02:00
Chris 66b85f48d8 Fixed missing packages when using sass/less 2015-10-12 16:34:54 +02:00
Chris bf2df82159 2.2.1 2015-10-12 08:42:28 +02:00
Chris d729c3caa8 Added changelog to ignored files. 2015-10-12 08:41:47 +02:00
Chris 4f99a5a9db Added (mis-)spelling fix... again :( 2015-10-12 08:31:40 +02:00
10 changed files with 39 additions and 5 deletions
+10
View File
@@ -1,5 +1,15 @@
# generator-react-webpack - Changelog
## 2.2.4
___Upgrades:___
1. Added automatic generation of components displayName property. This makes it easier to keep track of components that reside in deep subfolders (like src/components/my/example/components/indexComponent) would become "index" as a displayName, but should instead be MyExampleComponentsIndexComponent instead.
## 2.2.3
___Fixes:___
1. Fixed .gitignore renaming (Patch provided by [VovanR](https://github.com/VovanR))
## 2.2.0:
___Upgrades:___
+1 -1
View File
@@ -12,7 +12,7 @@ Out of the box it comes with support for:
- Ability to unit test components via Karma and Mocha/Chai
## Changes in Version 2.0
Tthis generator is written in ES2015. This means it is ___not compatible with node.js versions before 4.0___.
This generator is written in ES2015. This means it is ___not compatible with node.js versions before 4.0___.
It also does __NOT__ include support for Flux-Frameworks anymore. Instead, we will use it as a base for other generators to build upon. This will make the base generator easier to use and update.
+4
View File
@@ -91,6 +91,7 @@ module.exports = generator.Base.extend({
let excludeList = [
'LICENCE',
'README.md',
'CHANGELOG.md',
'node_modules',
'package.json'
];
@@ -110,6 +111,9 @@ module.exports = generator.Base.extend({
if(fs.lstatSync(fullPath).isDirectory()) {
this.bulkDirectory(item, item);
} else {
if (item === '.npmignore') {
this.copy(item, '.gitignore');
}
this.copy(item, item);
}
}
@@ -14,8 +14,11 @@ class <%= component.className %> extends React.Component {
}
}
<%= component.className %>.displayName = '<%= component.displayName %>';
// Uncomment properties you need
// <%= component.className %>.propTypes = {};
// <%= component.className %>.defaultProps = {};
export default <%= component.className %>;
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "generator-react-webpack",
"version": "2.2.0",
"version": "2.2.4",
"description": "Yeoman generator for using React with Webpack via Babel",
"keywords": [
"yeoman-generator",
+1
View File
@@ -44,6 +44,7 @@ describe('react-webpack:app', () => {
assert.file([
'.editorconfig',
'.eslintrc',
'.gitignore',
'.npmignore',
'.yo-rc.json'
]);
+8
View File
@@ -47,6 +47,14 @@ describe('react-webpack:component', () => {
done();
});
});
it('should have its displayName set per default', (done) => {
createGeneratedComponent('mycomponent', 'css', () => {
assert.fileContent('src/components/MycomponentComponent.js', `displayName = 'MycomponentComponent';`);
done();
});
});
});
describe('Style', () => {
+1
View File
@@ -82,6 +82,7 @@ describe('Utilities:Yeoman', () => {
path: 'src/components/my/component/',
fileName: 'TestComponent.js',
className: 'TestComponent',
displayName: 'MyComponentTestComponent',
suffix: '.js'
},
test: {
+6 -3
View File
@@ -51,7 +51,8 @@
"value": "sass",
"suffix": ".sass",
"packages": [
{ "name": "sass-loader", "version": "^1.0.1" }
{ "name": "sass-loader", "version": "^1.0.1" },
{ "name": "node-sass", "version": "^3.3.3" }
]
},
{
@@ -59,7 +60,8 @@
"value": "scss",
"suffix": ".scss",
"packages": [
{ "name": "sass-loader", "version": "^1.0.1" }
{ "name": "sass-loader", "version": "^1.0.1" },
{ "name": "node-sass", "version": "^3.3.3" }
]
},
{
@@ -67,7 +69,8 @@
"value": "less",
"suffix": ".less",
"packages": [
{ "name": "less-loader", "version": "^2.0.0" }
{ "name": "less-loader", "version": "^2.0.0" },
{ "name": "less", "version": "^2.5.3" }
]
},
{
+4
View File
@@ -33,6 +33,9 @@ let getAllSettingsFromComponentName = (componentName, style) => {
let componentBaseName = _.capitalize(componentParts.pop());
let componentPartPath = componentParts.join('/');
// Get the components displayName property
let componentFullName = _.classify(_.replaceAll(componentName, '/', '_'));
// Configure Styles
let stylePaths = configUtils.getChoiceByKey('path', 'style');
let styleSettings = configUtils.getChoiceByKey('style', style);
@@ -56,6 +59,7 @@ let getAllSettingsFromComponentName = (componentName, style) => {
path: `${componentPath.path}/${componentPartPath}/`,
fileName: `${componentBaseName}Component.js`,
className: `${componentBaseName}Component`,
displayName: `${componentFullName}Component`,
suffix: '.js'
},
test: {