Code Monkey home page Code Monkey logo

generator-lionbyte's Introduction

generator-lionbyte

NPM version Build Status

Generate a JavaScript project

Installation

First, install Yeoman and generator-lionbyte using npm (we assume you have pre-installed node.js).

npm install -g yo generator-lionbyte

Usage

mkdir my-new-project
cd my-new-project
yo lionbyte

Features

This generator scaffolds the following JavaScript project types:

  • Node (default)
  • Frontend

In addition, the following utility packages are added for all project types:

  • typescript type checking with *.js files
  • jest for testing and code coverage
  • prettier and standard code style and linter
  • Travis-CI script to run the tests
  • Optional pre-commit hook to run these linters via husky and lint-staged

Project Type: Node (Default)

  • Meant to serve as a base for any Node.js projects

Project Type: Frontend

  • webpack configurations for development and production
  • Styles
    • Autoprefixer
    • CSSNano - Minification
    • LESS CSS Preprocessor
  • Option to include React

Contributing

See CONTRIBUTING

License

MIT © Mark Hernandez

generator-lionbyte's People

Contributors

dependabot-support avatar dependabot[bot] avatar markh817 avatar semantic-release-bot avatar

Watchers

 avatar  avatar

Forkers

imgbotapp

generator-lionbyte's Issues

Add Express server template

Before you submit an issue:

  • Check for similar issues
  • Provide error messages, if applicable
  • Feature requests/suggestions are always welcome for discussion
  • Title the issue appropriately

Description

  • Maybe split this into a couple subgenerators
  • Create a REST structure
  • HTTPS support
  • Work with static-site stuff
  • Option for REST only server

Add Redux

Before you submit an issue:

  • Check for similar issues
  • Provide error messages, if applicable
  • Feature requests/suggestions are always welcome for discussion
  • Title the issue appropriately

Description

Add Redux to subgenerators

  • Static-site (both with and without React)
  • Maybe even in the generic projects since Redux is fairly easy to debug and test

Amazing documentation for the package: https://redux.js.org/

Create static site subgenerator

  • Support es6+ syntax
  • Use webpack transpiler
    • Separate configurations for production and development
  • gulp, gulp-sourcemaps, browser-sync
  • ejs, htmlmin
  • less, autoprefixer, cssnano, postcss
  • testcafe UI testing

Switch to DocumentationJS

Before you submit an issue:

  • Check for similar issues
  • Provide error messages, if applicable
  • Feature requests/suggestions are always welcome for discussion
  • Title the issue appropriately

Description

JSDoc-to-Markdown has a security vulnerability in it's handlebar version used. Although it's not exactly used in the build, I don't want to constantly tell GitHub to not worry about it in new projects.

https://github.com/documentationjs

Add react-mini.css to static-site subgenerator

Before you submit an issue:

  • Check for similar issues
  • Provide error messages, if applicable
  • Feature requests/suggestions are always welcome for discussion
  • Title the issue appropriately

Description

Add react-mini.css component library to the dependencies for static site projects using React. Since the generator uses Mini.css as the default css framework.

Also add a little snippet of code to the starter index.js file using one of the components.

TypeScript --checkJs configuration

Before you submit an issue:

  • Check for similar issues
  • Provide error messages, if applicable
  • Feature requests/suggestions are always welcome for discussion
  • Title the issue appropriately

Description

Add TypeScript to do type checking for JavaScript files. I'd like to add more static checking. It would also allow editors, such as VS Code, to automatically perform the checks.

Create default subgenerator

Technically this is being done with the generic subgenerator, but this should be actually redefined as the default subgenerator.

  • Add start script
    • "babel-node index.js" since babel-cli is a dependency
  • Create .npmignore file
    • src directory is included
  • Option to include a cli portion
    • Include starter cli.js file
    • Add commander and chalk packages to dependencies
  • Add command name to bin section of package.json
    • Defaults to project name

Fix Babel and Jest compatibility

Before you submit an issue:

  • Check for similar issues
  • Provide error messages, if applicable
  • Feature requests/suggestions are always welcome for discussion
  • Title the issue appropriately

Description

Jest requires a different version of babel-core to work with the latest babel version (v7).

Babel v7 update

Before you submit an issue:

  • Check for similar issues
  • Provide error messages, if applicable
  • Feature requests/suggestions are always welcome for discussion
  • Title the issue appropriately

Description

Update configurations to use Babel v7.
No more stage presets as well.

Add babel-polyfill

Before you submit an issue:

  • Check for similar issues
  • Provide error messages, if applicable
  • Feature requests/suggestions are always welcome for discussion
  • Title the issue appropriately

Description

  • This should add the babel-polyfill code snippets so that web apps can generally work on any non-dead browser.

  • Also, use "defaults" for the browser target. It's much better than the current configuration.

Create new directory name as input

Before you submit an issue:

  • Check for similar issues
  • Provide error messages, if applicable
  • Feature requests/suggestions are always welcome for discussion
  • Title the issue appropriately

Description

Instead of placing all of the files into the current directory, offer the option to place them all into a new directory.

Achieve 10/10 BetterCodeHub Score

Before you submit an issue:

  • Check for similar issues
  • Provide error messages, if applicable
  • Feature requests/suggestions are always welcome for discussion
  • Title the issue appropriately

Description

I want to keep this generator updated for as long as possible. This score may seem a bit superficial, but it does point to possible maintainability issues.
This may just involve creating utility functions to shorten some files.

Add Travis-CI script template

  • Use nodejs versions "node", 7, 6 for environment
  • Run `npm test'
    • Run 'npm run buildandnpm run test:ui` for static-site subgenerator
  • Option to send code coverage report to Coveralls
  • In static-site generator, option to deploy to GitHub pages from master branch on test success

Add template document files to common subgenerator

These files could probably be based off of the ones found in this project

  • CODE_OF_CONDUCT.md
    • The template should receive the user's email
  • Add CONTRIBUTING.md
  • Add docs/ISSUE_TEMPLATE.md
  • Add docs/PULL_REQUEST_TEMPLATE.md

Remove testcafe

Before you submit an issue:

  • Check for similar issues
  • Provide error messages, if applicable
  • Feature requests/suggestions are always welcome for discussion
  • Title the issue appropriately

Description

Due to the security issues and a weird bug that doesn't end the UI tests, I'm deciding to remove TestCafe for now. It also seems to be a bit of an overkill to include full UI testing on a brand new project.

Referencing:

Fully adopt TypeScript

Before you submit an issue:

  • Check for similar issues
  • Provide error messages, if applicable
  • Feature requests/suggestions are always welcome for discussion
  • Title the issue appropriately

Description

With Babel v7 being able to transpile TypeScript, it should be easier to integrate with the rest of the build configurations.

This will only be meant for the front-end portion. This is because I don't want to add a build step on the server code -- for now. I might feel different about this later.

After using TypeScript for as long as I did, I'm pretty satisfied that it helped so much. It encouraged me to document my functions more often than I did in the past.


Luckily, most tools also support TS, albeit with a little more configuration. But I only really need to do that once for here.

Standard: https://standardjs.com/#can-i-use-a-javascript-language-variant-like-flow-or-typescript

Progressive Web App

Before you submit an issue:

  • Check for similar issues
  • Provide error messages, if applicable
  • Feature requests/suggestions are always welcome for discussion
  • Title the issue appropriately

Description

The service worker should support a cache-first strategy and offline access. The cache should be updated in the background.
Add other PWA related files.
Possibly related to #14

Resources:

Add JSHint

Before you submit an issue:

  • Check for similar issues
  • Provide error messages, if applicable
  • Feature requests/suggestions are always welcome for discussion
  • Title the issue appropriately

Description

JSHint offers a bit more power than just the Standard linter.

Strengthen unit tests

Currently, the tests just check for the presence of generated files.

  • Test for content of generated files affected by user input.

Use gulp-hub

Before you submit an issue:

  • Check for similar issues
  • Provide error messages, if applicable
  • Feature requests/suggestions are always welcome for discussion
  • Title the issue appropriately

Description

Better Code Hub keeps marking concerns about the long gulpfiles.
Gulp-hub should be a pretty good solution to break them down.
Other gulp solutions don't work for the updated version.

https://github.com/frankwallis/gulp-hub/tree/4.0

Remove babel-node and server transpile step

Before you submit an issue:

  • Check for similar issues
  • Provide error messages, if applicable
  • Feature requests/suggestions are always welcome for discussion
  • Title the issue appropriately

Description

Node version 8+ already has all the language features I use. It only adds import/export capabilities; even then, it converts it to just module.exports = {...}. I can give that part up.

Also, by removing the babel step, I can start using Node's debugger with VS Code.

Netlify Integration

Before you submit an issue:

  • Check for similar issues
  • Provide error messages, if applicable
  • Feature requests/suggestions are always welcome for discussion
  • Title the issue appropriately

Description

Add Netlify-specific features in the static-site subgenerator.

  • Functions (AWS Wrapper)
  • Identity

Presentation Slideshow Template

Before you submit an issue:

  • Check for similar issues
  • Provide error messages, if applicable
  • Feature requests/suggestions are always welcome for discussion
  • Title the issue appropriately

Description

Okay, so this has a specific use case. This would make a static site that uses packages to make a slideshow. This might be easier to build with React as well.

  • frappe-charts
  • reveal.js

Rewrite Templates to Use Gulp-Hub

Before you submit an issue:

  • Check for similar issues
  • Provide error messages, if applicable
  • Feature requests/suggestions are always welcome for discussion
  • Title the issue appropriately

Description

This is a separate issue given that each subgenerator has a distinct set of tasks.
Refers to the solution for #19

Add babel-register for static-site

Before you submit an issue:

  • Check for similar issues
  • Provide error messages, if applicable
  • Feature requests/suggestions are always welcome for discussion
  • Title the issue appropriately

Description

  • The only reason babel-register should be added is for testing.

Update Readme

Before you submit an issue:

  • Check for similar issues
  • Provide error messages, if applicable
  • Feature requests/suggestions are always welcome for discussion
  • Title the issue appropriately

Description

Reorganize feature section to be easier to read.
Add server project type to list

MERN Stack

Before you submit an issue:

  • Check for similar issues
  • Provide error messages, if applicable
  • Feature requests/suggestions are always welcome for discussion
  • Title the issue appropriately

Description

This would have both the server and client components in one project.

Replace gulp-webpack with webpack-stream

Before you submit an issue:

  • Check for similar issues
  • Provide error messages, if applicable
  • Feature requests/suggestions are always welcome for discussion
  • Title the issue appropriately

Description

gulp-webpack was renamed webpack-stream a while ago. The usage is still the same, but getting the updated version of the package is probably important.

README improvements

Before you submit an issue:

  • Check for similar issues
  • Provide error messages, if applicable
  • Feature requests/suggestions are always welcome for discussion
  • Title the issue appropriately

Description

Add the achieved features in the README file. Just make it more detailed for anyone else who uses the tool.

Have pre-commit hook packages be optional

Before you submit an issue:

  • Check for similar issues
  • Provide error messages, if applicable
  • Feature requests/suggestions are always welcome for discussion
  • Title the issue appropriately

Description

While it's nice to have husky and lint-staged set up for any later projects, they aren't necessary for one-off coding sessions. Not every project will be published.

Provide this as an option. Default to no.

static-site project errors

Before you submit an issue:

  • Check for similar issues
  • Provide error messages, if applicable
  • Feature requests/suggestions are always welcome for discussion
  • Title the issue appropriately

Description

  • Missing extract-text-webpack-plugin@next
  • Use html-webpack-plugin@latest
  • Use webpack-dev-server@latest
  • Change dev script to webpack-dev-server --config webpack.dev.js --open
  • Change .babelrc to use babel-preset-env and babel-preset-react instead of the scoped @babel versions

Add JSDoc

Before you submit an issue:

  • Check for similar issues
  • Provide error messages, if applicable
  • Feature requests/suggestions are always welcome for discussion
  • Title the issue appropriately

Description

JSDoc generates API documentation based on block comments. It's an efficient way to record changes.
The provided link points to a package that outputs the documents in markdown files.
Usage with gulp is preferred.

https://github.com/jsdoc2md/jsdoc-to-markdown
https://github.com/jsdoc2md/jsdoc-to-markdown/wiki/How-to-use-with-gulp

Switch to mini-css-extract-plugin

Before you submit an issue:

  • Check for similar issues
  • Provide error messages, if applicable
  • Feature requests/suggestions are always welcome for discussion
  • Title the issue appropriately

Description

Switch to mini-css-extract-plugin from extract-text-webpack-plugin.
mini-css-extract-plugin already supports webpack 4, while the other is still in beta.

Option to have Rust module

Before you submit an issue:

  • Check for similar issues
  • Provide error messages, if applicable
  • Feature requests/suggestions are always welcome for discussion
  • Title the issue appropriately

Description

Sometimes speed is key. Add some template files and additional dependencies to enable Rust bindings.

Commit hooks not working

Before you submit an issue:

  • Check for similar issues
  • Provide error messages, if applicable
  • Feature requests/suggestions are always welcome for discussion
  • Title the issue appropriately

Description

The commit hooks information is placed inside another object in the generated package.json

BrowserSync not serving dist directory

Before you submit an issue:

  • Check for similar issues
  • Provide error messages, if applicable
  • Feature requests/suggestions are always welcome for discussion
  • Title the issue appropriately

Description

The module does not take in relative paths that go up one directory apparently. Must make the following change:

server: path.resolve(__dirname, '../dist')

Caching

Before you submit an issue:

  • Check for similar issues
  • Provide error messages, if applicable
  • Feature requests/suggestions are always welcome for discussion
  • Title the issue appropriately

Description

Add caching into gulp and webpack to speed up task/build times.

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.