3.0.0 ā€¢ Published 2 years ago

babel-preset-webpack-nexus v3.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
2 years ago

webpack-nexus šŸØ npm npm lerna

Scaffold your project in a couple of seconds. Webpack, Babel, Typescript, React, Apollo, syled-components, Eslint, Prettier and VSCode config out of the box.

The most successful dev work smart, not hard.


Webpack nexus is a simple CLI to scaffold your javascript/react projects.

Features

  • Webpack: Dev and Prod configurations inspired by the awesome work of React boilerplate šŸ”Ø
  • Babel: ES6/ES7, Jsx and plugins configured for dev and production mode. āš›ļø
  • Styling with styled-components šŸ’…
  • Typing with typescript and eslint āœ”ļø
  • Auto formatter with prettier šŸ”„
  • vscode configured to work with eslint + typescript + prettier šŸ’™
  • React-apollo: coming soon...
  • Jest: coming soon..
  • Husky + lint-stagged: coming soon...
  • webpack-nexus.js: file to configure/overrite the actual webpack/babel configuration, coming soon...
  • Setup/configurations for atom and sublime, coming soon...

Quick links

Usage

Install

npm:

npm install -g webpack-nexus

yarn

yarn global add webpack-nexus

Create an app

Right now, this package has only one command to start your project. More is coming soon...

webpack-nexus the-name-of-your-project

It will create a folder with your project name, navigate to it.

cd the-name-of-your-project

the-name-of-your-project
ā”œā”€ā”€ .vscode
ā”œā”€ā”€ node_modules
ā”œā”€ā”€ package.json
ā”œā”€ā”€ .yarn.lock
ā”œā”€ā”€ .tsconfig
ā”œā”€ā”€ .gitignore
ā”œā”€ā”€ .eslintrc
ā”œā”€ā”€ .eslintignore
ā”œā”€ā”€ dist
ā””ā”€ā”€ src
    ā”œā”€ā”€ index.tsx
    ā””ā”€ā”€ index.html

Start coding with:

yarn start # or npm start

To compile in production mode:

yarn build # or npm run build

That's it, happy coding! šŸŽ‰

More commands are coming... ā³

Stack used:

  • Webpack
  • Babel
  • Typescript
  • Eslint (typescript-parser)
  • React
  • vscode configuration
  • Jest: coming soon
  • Apollo client: coming soon
  • Lint staged + husky: coming soon

Project structure

This project is a mono-repo built with lerna.

webpack-nexus
ā”œā”€ā”€ packages
ā”œā”€ā”€ā”€ā”€ babel-preset-webpack-nexus
ā”œā”€ā”€ā”€ā”€ eslint-config-webpack-nexus
ā”œā”€ā”€ā”€ā”€ nexus-scripts
ā”œā”€ā”€ā”€ā”€ webpack-nexus

Roadmap

  • Finish to implement the main core packages (eslint-config, babel-preset and nexus-scripts, webpack-nexus cli).
  • Finish to implement the rest of comands (withApollo, withTypescript, withTailwind, etc).
  • Finish to implement the interactive cli. Displays questions about the configuration/stack to use.
  • Create the end-to-end tests for the CLI.
  • Create a webpack-nexus.js config file to customize the webpack and babel configurations.
  • Create a documentation of each core package.

Browser support

>1%', 'last 4 versions', 'Firefox ESR', 'not ie < 9

Some questions:

I don't want to use typescript, javascript is good for me.

By default it will create a .tsx file in the src folder but you can change it for a .js or .ts file.

Why I created this project?

Well, actually I have two reasons for this:

  1. I hate the boilerplate I have to do to start a new project. So I created a cli to start a project in a rapid way.
  2. I want to learn how to build something like create-react-app/next.js.

What is the difference with other projects like create-react-app/react-boilerplate/next.js?

I want to learn how to build something like create-react-app/next.js. I'm not trying to compete with the big current cli's/boilerplates

It has a lot of specific configurations used in all of my side-projects, so maybe you are good using the other ones.

Ok, so, I tested create-react-app and I think it is awesome but I don't like the way it works.

  • You need to eject to add your own webpack or babel plugins.
  • You need to eject to configure/add prettier/eslint rules.
  • If you have lint errors it will throw a error. Some times I just want to test some egde cases. webpack-nexus doesn't throw a error because it is not configured inside webpack, it is just used to lint the files in vscode.
  • It doesn't have support for multi-entries. It can be configured for that, but again, you need to eject.
  • It has no styled-components installed.
  • It has no apollo graphql configured. Graphql is what I always use in my projects.
  • It has no react-hot-loader configured.

react-boilerplate? I really like that, but I just wanted a simple cli to scaffold my projects and not to clone a repository every time.

And... It is not comparable with next.js because it is not a react framework šŸ‘ŗ... but maybe in the future it can be? šŸ¤”

Inspirations:

Issues

This project is still in development. So, if you find some improvements or errors go ahead and create an issue. šŸ˜ƒ