Giter VIP home page Giter VIP logo

neo's Introduction

DEPRECATED!

Please see Neutrino for an alternative!

https://neutrino.js.org


Create and build React web applications with zero initial configuration and minimal fuss.


Neo bakes in the best-of-the-bunch configurations and setup to make developing React-based sites quicker and easier. It is not just another React boilerplate, rather Neo gives you a single development dependency enabling you to develop, test, and build which let's you hit the ground running.

Neo: Introduction on Medium


Features

  • React, Redux, React Router
  • Webpack
  • ESLint, Babel, ES2015 + modules, Stage 0 preset
  • Tests and coverage with Karma, Mocha, Chai, and Enzyme
  • Immutable
  • Bootstrap 4 and Sass
  • Travis CI

Requirements

  • Node.js v4+ and npm

Sample App

To view a sample application which contains the initial output of Neo after running init, check out eliperelman/neo-example.

Initialize empty project

Global

npm install -g mozilla-neo
mkdir <project-name> && cd <project-name>
neo init # and follow the prompts

Local

mkdir -p <project-name>/node_modules && cd <project-name>
npm install mozilla-neo
node_modules/.bin/neo init # and follow the prompts
Sample output
→ create package.json
→ create src/
→ create tests/
→ create .gitignore
→ create .travis.yml
→ create LICENSE
→ create README.md

Install in existing project

npm install --save-dev mozilla-neo

Make changes to configuration by following the scaffold init guide.

Workflow

  • Add code to src/ and tests to tests/.
  • Build and watch changes in src/ with npm start.
  • Lint and build the project with npm run build.
  • Run tests with npm test.

Changes

v2.7.0

  • Support deeply-nested test files in tests/

v2.6.0

  • Support importing modules relative to src/
  • Use svg-url-loader for SVGs

v2.3.0

  • Added support for building projects using Node.js v4+

v2.2.0

  • Added support for JSON loading

v2.1.0

  • Removed Elm from being "baked in"
  • Added support for web workers via worker-loader
  • Updated a few dependencies

v2.0.0

  • Removed config/eslint.js in favor of config/eslint.core.js and config/eslint.dev.js
  • Moved src/app.js into project for easy customization and removal

Contribute

Note: There is currently a bug in npm from being able to run the npm test command in this repo in development. As a workaround, make sure you are using a npm 3.8.9 or less.

Support

If you are having issues, please let us know.

Join our Slack community at https://neo-slack.herokuapp.com/.

We also have an IRC channel #neo on Mozilla IRC.

License

This project is licensed under the Mozilla Public License v2.0

neo's People

Contributors

andersonvom avatar eliperelman avatar garbas avatar pierre-b avatar sww13 avatar teosz 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

neo's Issues

neo test results in build errors (JSON files)

After creating a new project using neo v2.2.0, running "neo test" results in build errors related to loading JSON files. Running dev mode works fine.

ERROR in .//cheerio/package.json
Module build failed: SyntaxError: Unexpected token m in JSON at position 0
at Object.parse (native)
at Object.module.exports (/home/derekho/LikeMindNetworks/prototypes/react-proto/node_modules/json-loader/index.js:7:48)
@ ./
/cheerio/index.js 11:18-38

ERROR in .//css-select/lib/procedure.json
Module build failed: SyntaxError: Unexpected token m in JSON at position 0
at Object.parse (native)
at Object.module.exports (/home/derekho/LikeMindNetworks/prototypes/react-proto/node_modules/json-loader/index.js:7:48)
@ ./
/css-select/lib/compile.js 17:18-45

ERROR in .//entities/maps/xml.json
Module build failed: SyntaxError: Unexpected token m in JSON at position 0
at Object.parse (native)
at Object.module.exports (/home/derekho/LikeMindNetworks/prototypes/react-proto/node_modules/json-loader/index.js:7:48)
@ ./
/htmlparser2/lib/Tokenizer.js 6:16-49

ERROR in .//entities/maps/entities.json
Module build failed: SyntaxError: Unexpected token m in JSON at position 0
at Object.parse (native)
at Object.module.exports (/home/derekho/LikeMindNetworks/prototypes/react-proto/node_modules/json-loader/index.js:7:48)
@ ./
/htmlparser2/lib/Tokenizer.js 4:16-54

ERROR in .//entities/maps/legacy.json
Module build failed: SyntaxError: Unexpected token m in JSON at position 0
at Object.parse (native)
at Object.module.exports (/home/derekho/LikeMindNetworks/prototypes/react-proto/node_modules/json-loader/index.js:7:48)
@ ./
/htmlparser2/lib/Tokenizer.js 5:16-52

ERROR in .//entities/maps/decode.json
Module build failed: SyntaxError: Unexpected token m in JSON at position 0
at Object.parse (native)
at Object.module.exports (/home/derekho/LikeMindNetworks/prototypes/react-proto/node_modules/json-loader/index.js:7:48)
@ ./
/entities/lib/decode_codepoint.js 1:16-46

neo init causes a bug

const { commands } = require('../package.json');
      ^

SyntaxError: Unexpected token {
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:414:25)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Function.Module.runMain (module.js:467:10)
    at startup (node.js:134:18)
    at node.js:961:3

unable to npm install

here's a logtalk though I think this is the important part

126406 warn enzyme@2.4.1 requires a peer of react@0.13.x || 0.14.x || ^15.0.0-0 but none was installed.
126407 verbose If you need help, you may report this error at:
126407 verbose     <https://github.com/npm/npm/issues>
126408 warn react-element-to-jsx-string@3.2.0 requires a peer of react@^0.14.8 || ^15.0.1 but none was installed.
126409 verbose If you need help, you may report this error at:
126409 verbose     <https://github.com/npm/npm/issues>
126410 warn react-addons-test-utils@15.4.1 requires a peer of react-dom@^15.4.1 but none was installed.
126411 verbose If you need help, you may report this error at:
126411 verbose     <https://github.com/npm/npm/issues>
126412 warn react-hot-api@0.4.7 requires a peer of react@>=0.11.0 || ^0.14.0-rc but none was installed.
126413 verbose If you need help, you may report this error at:
126413 verbose     <https://github.com/npm/npm/issues>
126414 verbose stack Error: node-sass@3.10.0 postinstall: `node scripts/build.js`
126414 verbose stack Exit status 1
126414 verbose stack     at EventEmitter.<anonymous> (C:\Users\MOSHMA~1\AppData\Roaming\nvm\v7.2.0\node_modules\npm\lib\utils\lifecycle.js:255:16)
126414 verbose stack     at emitTwo (events.js:106:13)
126414 verbose stack     at EventEmitter.emit (events.js:191:7)
126414 verbose stack     at ChildProcess.<anonymous> (C:\Users\MOSHMA~1\AppData\Roaming\nvm\v7.2.0\node_modules\npm\lib\utils\spawn.js:40:14)
126414 verbose stack     at emitTwo (events.js:106:13)
126414 verbose stack     at ChildProcess.emit (events.js:191:7)
126414 verbose stack     at maybeClose (internal/child_process.js:885:16)
126414 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
126415 verbose pkgid node-sass@3.10.0

NEO does not require on react? (as in, do I have to install react by hand and then install neo?)

Switch Neo to be a neutrino preset, or deprecate in favor of neutrino-preset-react

When I created Neo, it was meant highly React-Redux-boilerplate specific. I have since been working on development of neutrino, which splits Neo out into two pieces: a wrapped Webpack build system, and a way to have pre-configured presets.

Right now Neo is all-in-one; installing it comes with the build system and all the configuration needed to build. Neutrino is slightly different; you use 2 development dependencies: neutrino and a build preset. For example, if I wanted to build a baseline React project, I could install neutrino and neutrino-preset-react.

Neo does more than just a baseline React project by including Sass building, but anything more than that either comes from scaffolding, or project-specific includes.

Both tools support project-based configuration overrides, but neutrino makes management of these simpler by easily installing from npm a pre-configured preset.

Leaving this open to discuss possibilities.

Add `src/` directory to webpack resolve root config

Currently, all imports in the code need to be relative to the current path, making it harder to refactor the code base as it's a pain to have to change all import paths, figuring out how many ../.. are needed.

Adding the src/ directory to webpack's resolve.root config allows developers to go from something like this:

import Header from '../../components/Header';
import TransactionForm from '../TransactionForm';
import * as AppActions from '../../actions';

to something like this:

import Header from 'components/Header';
import TransactionForm from 'containers/TransactionForm';
import * as AppActions from 'actions';

This change is also backwards compatible, so relative imports still work.

CODE_OF_CONDUCT.md file missing

As of January 1 2019, Mozilla requires that all GitHub projects include this CODE_OF_CONDUCT.md file in the project root. The file has two parts:

  1. Required Text - All text under the headings Community Participation Guidelines and How to Report, are required, and should not be altered.
  2. Optional Text - The Project Specific Etiquette heading provides a space to speak more specifically about ways people can work effectively and inclusively together. Some examples of those can be found on the Firefox Debugger project, and Common Voice. (The optional part is commented out in the raw template file, and will not be visible until you modify and uncomment that part.)

If you have any questions about this file, or Code of Conduct policies and procedures, please see Mozilla-GitHub-Standards or email [email protected].

(Message COC001)

json-loader error

Hi @eliperelman , when importing moment-timezone into my project I get the following error:

ERROR in ./~/moment-timezone/data/packed/latest.json
Module parse failed: /my-project/node_modules/moment-timezone/data/packed/latest.json Unexpected token (2:10)
You may need an appropriate loader to handle this file type.

After playing around with the json loader in the webpack I still can't get rid of it, do you know how to solve this please?

Thanks!

Disable devtools

Hi!

I'd like to use the Redux Devtools by using the browser plugin. Is it possible to turn the bundled devtools off?

Also, the browser plugin version gives me the error: No store found. Make sure to follow the instructions.

Server side rendering?

Any plans to add support for server side rendering? After all, it seems like SSR is one of the best reasons to use Redux.

Save 1.1Mo in the production build

Hi @eliperelman , sorry to bother you again, I found out the dev tools embeded in the production build bring 1.1Mo so here is a webpack config line I think you should include in the default production config:

new webpack.NormalModuleReplacementPlugin(/^(redux-slider-monitor|redux-devtools-log-monitor|redux-devtools-dock-monitor|redux-devtools-chart-monitor|react-hot-loader|redux-devtools|redux-logger|react-hot-loader)$/, join(process.cwd(), './shim.js'))

with shim.js as en empty file

for example: redux-devtools-chart-monitor brings he whole D3 as a dependency

hide right side state panel

hi, is there a way to hide the right side state panel so that playing with css would result the way it should without dragging to hide?

Serving assets with the dev server

Hi guys, @eliperelman,

The dev server can't serve static assets (images...), I tried to put them at the root level and /src but it's not working.

That would be nice to have a /public or /assets folder in the default config configured to serve a root URL like /my-logo.png

Thanks ;)

FlowStatusPlugin doesn't print flow status checks

I was following the flow setup described in the Create and build React web applications with zero initial configuration and minimal fuss post:

  • installing flow-status-webpack-plugin
  • running node_modules/.bin/flow init
  • updating .flowconfig file
  • updating package.json to add --config dev.config.js argument to neo start
  • creating dev.config.js:
const dev = require('mozilla-neo/config/webpack.dev');
const FlowStatusPlugin = require('flow-status-webpack-plugin/index');

dev.plugins.push(new FlowStatusPlugin({binaryPath: 'node_modules/.bin/flow'}));

module.exports = dev

I've added a sample function which breaks type, to one of the sources:

function display(x: string): string {
    return x.length;
}

When running npm start I don't see flow status after modifying any file, though my editor displays nice notification that return type is incompatybile.

Is there something wrong with my setup or FlowStatusPlugin doesn't display status?

Simplify app.js

Currently src/app.js provides a skeleton that can't be extended is almost always not what someone will be completely happy with. Someone most certainly always wants to change it. We should do one of the following:

  • Make the file super simple for those just wanting a simple React/Redux app
  • Make the file pretty opinionated, but extensible
  • Remove app.js and include something simple in the scaffolding

index.html built with npm run build does not show html elements

Hi, awesome project. Congrats!
After building the example project and placing the folder (index + 2 js files) in webserver (apache) does not open any html element. However console in chrome tools does show the show output as when the project is run in dev mode (npm start). What is I'm missing?
Thanks in advance

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.