39 Commits

Author SHA1 Message Date
sthzg
cece8d0401 Updated functionality related to PostCSS - #307
- bumped postcss and postcss-loader versions
- removed deprecated custom logic related to setting up PostCSS
- updated tests

As communicated in #307 and on the related PR from @stylesuxx on the
template repo we can use PostCSS` more recent config file feature
instead of modifying our config.

If users prompt the PostCSS question with yes, deps for postcss and
postcss-loader are added to their package.json.

The updated tests check that
- postcss and postcss-loader deps are added on PostCSS yes
- postcss and postcss-loader deps are not added on PostCSS no
- postcss.config.js is copied to the project root
2016-12-17 01:02:40 +01:00
Stephan Herzog
3c55a13971 Added support for configuring a className prefix (#310)
This feature allows users to put a `cssClsPrefix` property into their
.yo-rc.json. If configured, the component generator will add this string
as a prefix to className attributes.

Example:

	// .yo-rc.json
	{
	  "generator-react-webpack": {
	    "appName": "v4-latest-install",
	    "style": "css",
	    "cssmodules": false,
	    "cssClsPrefix": "myapp",
	    "postcss": false,
	    "generatedWithVersion": 4
	  }
	}

Components generated will now prepend the `myapp` prefix on their class
names, e.g.

	$ yo react-webpack:component hello
	<div className="myapp-hello-component" />
2016-11-23 12:14:21 +01:00
Stephan Herzog
01855bd2ed Added sub-generator setup-env #278 (#308)
This subgen creates a new Webpack config environment by

- creating conf/webpack/<EnvName>.js
- creating src/config/<env_name>.js
- requiring and exporting the new env in conf/webpack/index.js

The commit introduces a basic config template that is supposed to be populated by the generator's users. Various more fine grained subgen options can be added at a later time (e.g. prompting the user if new run scripts should be added to package.json).

The subgen's basic functionality is backed up by unit tests that check

- if files are created
- if conf/webpack/index.js contains correct import/export
2016-11-22 19:38:13 +01:00
Chris
a2bd75a83b V4 -- Updates to support PostCSS installation
* Updated tessts to successfully run against current master of the template
* Updated postcss attachement to new webpack config. Adjusted tests.
* Updated dependencies
* Use newest template
* Updated Esprima
2016-11-22 12:35:31 +01:00
Chris
b581e5bd02 Added support for cssmodules when setting up projects. closes #265 2016-08-24 01:13:48 +02:00
Chris
efcf3cdebf Added back postcss 2016-08-23 22:54:34 +02:00
Stephan Herzog
2a2f4cf4df Refactored test templates to use inline functions (#276)
Closes #275
2016-08-15 12:37:54 +02:00
Chris
4f9488cb99 FEAT: Added ability to use pure components as a react base class 2016-08-10 23:33:33 +02:00
sthzg
e2add4af4d Refactored component subgen to support styles and/or cssmodules #255
This commit refactors the template structure for components to multiple
different base templates based on the required styling options:

- nostyle
- with styles
- with styles and css modules
2016-08-05 14:36:10 +02:00
Chris
14e8eb4aec Added ability to create components without styles. Fixes https://github.com/newtriks/generator-react-webpack/issues/243 2016-07-01 21:38:44 +02:00
sthzg
d9ddf3cf10 Fixes no-trailing-spaces error in components Base.js #244 2016-06-24 18:22:40 +02:00
Chris
892f771899 Added new directory options for generated components (styles are now also generated in the components folder)
Added directory options fallbacks for version 3 and below
Prepared for inclusion of css modules
2016-06-15 15:34:26 +02:00
Chris
ed4686edd0 Added support for files generated with version 4 2016-06-15 12:59:16 +02:00
Chris
9867271cbb Refactored component subgenerator to use es2015 classes 2016-06-14 10:28:09 +02:00
Chris
663a49369b Added basic changes for v4.0 (base generator class refactoring) 2016-05-27 12:01:50 +02:00
Chris
832907f2fd Added minor es2015 tweaks 2016-03-29 23:01:42 +02:00
Chris
6344984d65 Added ability to save generator version for future updates 2016-03-29 23:00:55 +02:00
Chris
561e072a9c Adjusted generated unit tests 2016-03-02 11:56:12 +01:00
Chris
43f3bce786 Added changelog for 3.2.3 (adjusted postcss config to work with new react-webpack-template). 2016-02-23 22:14:02 +01:00
Matt McCormick
bd5748bb89 Grammar improvement to the style prompt. 2016-01-24 10:14:47 -05:00
Chris
946775a22f Fix: Set correct indention for generated unit tests 2016-01-13 07:56:49 +01:00
Chris
60bf2aae3a Adjusted generator for updated yeoman-generator to 0.22.x 2015-12-18 08:44:42 +01:00
Chris
20cbcee3fe Added missing dependencies for stylus (fixes https://github.com/newtriks/generator-react-webpack/issues/170), moved additional deps to devDependencies when installing 2015-11-24 08:42:21 +01:00
Chris
492d2c6947 Merge pull request #168 from stylesuxx/feature/postcss
Add basic support for PostCSS (provided by @stylesuxx)
2015-11-23 08:33:32 +01:00
stylesuxx
0e3b554855 PostCSS loader has to be the third item in the pipe 2015-11-22 03:31:05 +01:00
stylesuxx
3a10311c47 css is a dilakt itself - got rid of one condition 2015-11-21 16:06:14 +01:00
stylesuxx
255d7b94d8 Refactored postcss functionality in it's own file - #163 2015-11-21 15:59:39 +01:00
stylesuxx
9f427d9332 Refactored regex in favor of traversing via AST 2015-11-18 18:46:39 +01:00
Chris
e7501dccbd Removed licence from copied files
Removed unneeded .npmignore copy
Adjusted unittests to include .babelrc
2015-11-18 08:19:12 +01:00
stylesuxx
f70a1eed8f Parse base config and add postcss related stuff 2015-11-18 04:33:58 +01:00
stylesuxx
312c88b0bc Added dependencies for postcss 2015-11-18 03:11:04 +01:00
Chris
63f1b74fe7 Added ability to create stateless components
Cleaned up unittests
2015-10-19 08:11:22 +02:00
Chris
685f6a75ce Added automatic generation of components displayName property. 2015-10-15 16:09:23 +02:00
Vladimir Rodkin
83d47bddd8 Add gitignore 2015-10-13 20:40:06 +03:00
Chris
d729c3caa8 Added changelog to ignored files. 2015-10-12 08:41:47 +02:00
Chris
ca3f923bf0 Added new version of react-webpack-template as dependency. Now using React 0.14 as base. 2015-10-12 08:28:43 +02:00
Chris
6a3da576fa Added changes to make pr compatible with coding guidelines. 2015-09-25 11:38:24 +02:00
Gavin Mogan
8a2fc142ba update baseRootPath to be happier with npm@3
npm@3 now flattens node_modules directory
This should be happy no matter where the module ends up
2015-09-24 23:45:12 -07:00
Chris
023d937877 Added changes for version 2.0 2015-09-21 20:45:57 +02:00