Giter VIP home page Giter VIP logo

generator-fountain-react's Introduction

โš ๏ธ Unmaintained

This project has been archived and is considered outdated and unmaintained.

With the massive rise of the CLI tools by each major JavaScript Web frameworks, it was become irrelevant to pursue the quest of being a competitive project scaffolder for modern Web project.

We officialy advise to use the coresponding CLI tools for the framework you use:

Of course, we have some regrets regarding our users, Yeoman users and some goals we had with Fountain (like giving important tool choices to users, harmonizing projects configurations between frameworks...) but still, you can use official CLI tools with confidence as they are great project which went further for development experience and Web optimization.

FountainJS

Build Status codecov Slack

Fountain React Generator

React

This Yeoman generator allows you to start a React web app with the best Developer Experience out of the box!

No matter what framework or module management you want to use, we got you covered with a cutting edge working configuration.

We use Gulp 4 as a task manager but we'll ask you questions about:

  • Modules management: Webpack, SystemJS, none
  • JS preprocessor: Babel, TypeScript, none
  • CSS preprocessor: Sass, Stylus, Less, none

This generator is a sub-generator of the the Yeoman Fountain generator for webapps generator-fountain-webapp.

Generator Fountain React structure

To take profit of the best of the Yeoman infrastructure, we heavily relies on the composability natures of the generators.

Thereby, each needs of your future application will be addressed by a dedicated Yeoman generator (each will be used depending of the options you selected or not).

More informations in DESIGN.md.

Web tooling layer

Gulp ESLint BrowserSync Karma

Module management layer

Webpack SystemJS Bower

Usage

Requirement Node 6+ && NPM 3+

This generator is targeted to be used with Node >= 6.0.0 and NPM => 3.0.0. You can check your version number with the command

node --version && npm --version

Install

Install required tools yo:
npm install -g yo
Install generator-fountain-react:
npm install -g generator-fountain-react

Run

Create a new directory, and go into:
mkdir my-new-project && cd my-new-project
Run yo fountain-react, and select desired technologies:
yo fountain-react

Use NPM scripts

  • npm run build to build an optimized version of your application in /dist
  • npm run serve to launch a browser sync server on your source files
  • npm run serve:dist to launch a server on your optimized application
  • npm run test to launch your unit tests with Karma
  • npm run test:auto to launch your unit tests with Karma in watch mode

Or Gulp tasks

If you have gulp-cli installed in global packages you can use equivalent:

  • gulp or gulp build
  • gulp serve
  • gulp serve:dist
  • gulp test
  • gulp test:auto

If you don't have gulp-cli installed in global, you should have this error:

/usr/local/lib/node_modules/gulp/bin/gulp.js:121 gulpInst.start.apply(gulpInst, toRun); TypeError: Cannot read property 'apply' of undefined

Sub-generators

Few sub-generators are available. You can see the full list by running yo --generators.
Each generator has 2 options:

  • You can set the name of the generated item with --name
  • You can set the path of the generated item with --dir

Example:

yo fountain-react:component --name myComponent --dir components/game

generator-fountain-react's People

Contributors

betweenbrain avatar delapouite avatar elderbas avatar micaelmbagira avatar slashgear avatar swiip avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

generator-fountain-react's Issues

Yeoman React Tutorial Fails

Description

The Yeoman tutorial is failing for react because it references the ^1.0.0 release in its package.json. If there were another release that incorporates the latest commits, up to b3f3e0b, it should fix the error.

Error Message & Stack Trace

error Unnecessarily quoted property 'edit' found

[Q] Using mocha, jsdom, and enzyme for test instead of karma

I prefer to use jsdom and enzyme for my test and mocha for running test instead of karma. Looking at the generated project it is not clear to me where among all the gulp configuration do I need to make changes to get it work. Can anyone can point me in the right direction?

Cannot find module '~react-redux~redux' error in the generated react-typescript todo app

Description

The generated default todo project doesn't compile. Using latest yo (1.8.5) and generator-fountain (1.0.0-rc2). It looks, the generated module string is wrong.

Error Message & Stack Trace

Error when trying to run the default gulp task:

ERROR in ./src/index.tsx
(3,22): error TS2307: Cannot find module '~react-redux~redux'.

ERROR in ./src/app/containers/App.tsx
(2,25): error TS2307: Cannot find module '~react-redux~redux'.

ERROR in ./src/app/containers/App.tsx
(60,3): error TS2345: Argument of type 'typeof App' is not assignable to parameter of type 'ComponentClass<{ todos: any; } & { actions: { addTodo: (text: string) => { type: string; text: st...'.
  Type 'typeof App' is not assignable to type 'StatelessComponent<{ todos: any; } & { actions: { addTodo: (text: string) => { type: string; text...'.
    Type 'typeof App' provides no match for the signature '(props: { todos: any; } & { actions: { addTodo: (text: string) => { type: string; text: string; }; deleteTodo: (id: number) => { type: string; id: number; }; editTodo: (id: number, text: string) => { type: string; id: number; text: string; }; completeTodo: (id: number) => { type: string; id: number; }; completeAll: () => { type: string; }; clearCompleted: () => { type: string; }; }; } & { children?: ReactNode; }, context?: any): ReactElement<any>'

Config

Copy the content from .yo-rc.json:

{
  "generator-fountain-react": {
    "version": "1.0.0-rc2",
    "props": {
      "framework": "react",
      "modules": "webpack",
      "js": "typescript",
      "ci": [
        "travis"
      ],
      "css": "scss",
      "resolved": "/Users/zoltan/.nvm/versions/node/v6.9.2/lib/node_modules/generator-fountain-webapp/node_modules/generator-fountain-react/generators/app/index.js",
      "namespace": "fountain-react",
      "argv": {
        "remain": [],
        "cooked": [],
        "original": []
      },
      "sample": "todoMVC",
      "router": "router"
    }
  }
}

Environment

Tell us which operating system you are using, as well as which versions of Node.js, npm, and yo. Run the following to get it quickly:

$ node -e "var os=require('os');console.log('Node.js ' + process.version + '\n' + os.platform() + ' ' + os.release())"

Node.js v6.9.2
darwin 16.3.0

$ yo --version
1.8.5

$ npm --version
4.0.3

Typescript HMR

I'm encountering a problem when I use it with typescript, the HMR works but still print warning in the console :

The following modules couldn't be hot updated: (Full reload needed) This is usually because the modules which have changed (and their parents) do not know how to hot reload themselves. See http://webpack.github.io/docs/hot-module-replacement-with-webpack.html for more details.

I can't find how to fix it, does someone got an idea ?

Lost control of fountainjs.io ?

As reported in FountainJS/fountainjs.github.io#31 , you appear to have lost control of the fountainjs.io domain (I can't tell from the whois info) or at the least the website has been hacked, as it redirects to what appears to be random websites!

You might want to change that, at least in the various GitHub projects that FountainJS maintains.

Error: Can't resolve 'react/lib/ReactTestUtils'

Description

An error message is displayed when trying to run the tests.
This problem occurs because ReactTestUtils is a part of ReactDOM and not React, according to this issue.

Error Message & Stack Trace

Module not found: Error: Can't resolve 'react/lib/ReactTestUtils' in '/Users/kohl/Documents/my-website/src/app'
 @ ./src/app/hello.spec.js 140:22-57
 @ ./src/app \.(js|ts|tsx)$
 @ ./src/index.spec.js

Config

{
  "generator-fountain-react": {
    "version": "1.0.0-rc1",
    "props": {
      "framework": "react",
      "modules": "webpack",
      "js": "babel",
      "ci": [
        "travis"
      ],
      "css": "scss",
      "resolved": "/Users/kohl/.nvm/versions/node/v6.9.1/lib/node_modules/generator-fountain-webapp/node_modules/generator-fountain-react/generators/app/index.js",
      "namespace": "fountain-react",
      "argv": {
        "remain": [],
        "cooked": [],
        "original": []
      },
      "sample": "hello",
      "router": "router"
    }
  }
}

Relevant Links

Environment

Node.js v6.9.1
darwin 16.1.0
1.8.5
3.10.8

Nested routes not working

Description

When generating a new project (using version 1.0.0-rc1), nested route don't work.

Error Message & Stack Trace

Not much relevant, but the browser's console prints 404 for http://localhost:3000/path/index.js when requesting http://localhost:3000/path/path2

Config

Copy the content from .yo-rc.json:

{
  "generator-fountain-react": {
    "version": "1.0.0-rc1",
    "props": {
      "resolved": "/home/remi/.nvm/versions/node/v6.8.1/lib/node_modules/generator-fountain-react/generators/app/index.js",
      "namespace": "fountain-react:app",
      "argv": {
        "remain": [],
        "cooked": [],
        "original": []
      },
      "framework": "react",
      "modules": "webpack",
      "css": "css",
      "js": "babel",
      "ci": [],
      "sample": "hello",
      "router": "router"
    }
  }
}

Environment

Tell us which operating system you are using, as well as which versions of Node.js, npm, and yo. Run the following to get it quickly:

Node.js v6.8.1
linux 4.7.7-200.fc24.x86_64
yo version 1.8.5
npm version 3.10.8

I fixed the bug locally by modifying the generated webpack config, replacing the output filename "'index.js'" by "'/index.js'".

Update eslint-plugin-react and eslint-config-xo-react

We should update these deps.

But a problem exist. 'eslint-config-xo-react' define indent for JSX with tab except we use 'eslint-config-xo-space' with '.editorconfig' who set indent with space. So we can't insert tab and space in the same component file.

Immutable and Ducks

Prerequisites

Install React with the ToDo MVC app selected.

Description

This is primarily about the ToDoMVC app.

Immutable.js would be good to use in the examples. It is a great tool to learn right-off-the-bat.
https://www.toptal.com/react/react-redux-and-immutablejs

Also, Ducks are a great design pattern for Redux and I highly suggest it be used in the generator here.
https://github.com/erikras/ducks-modular-redux

Error Message & Stack Trace

None

Config

Copy the content from .yo-rc.json:

{                                                                                                                               
  "generator-fountain-react": {
    "version": "1.0.0-rc2",    
    "props": {
      "framework": "react",    
      "modules": "webpack",    
      "js": "babel",
      "ci": [],
      "css": "scss",
      "skipInstall": true,     
      "resolved": "/Users/swiip/Workspace/FountainJS/fountain/generator-fountain-react/generators/app/index.js",
      "namespace": "fountain-react",  
      "argv": {
        "remain": [],
        "cooked": [],
        "original": []
      },
      "sample": "todoMVC",     
      "router": "router"
    }
  }
} 

Relevant Links

https://github.com/erikras/ducks-modular-redux
https://www.toptal.com/react/react-redux-and-immutablejs

Environment

lotus@InfiniteDesktop:~/code/draftlibrary$ node -e "var os=require('os');console.log('Node.js ' + process.version + '\n' + os.platform() + ' ' + os.release())"
Node.js v6.6.0
linux 3.16.0-4-amd64
lotus@InfiniteDesktop:~/code/draftlibrary$ yo --version
1.8.5
lotus@InfiniteDesktop:~/code/draftlibrary$ npm --version
3.9.5

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.