Git Product home page Git Product logo

dev-environment-template's Introduction

Dev-Environment-Template

Basic starter template to start any new project.

Starter Kit

1. Editor and Configuration

Editor config | http://editorconfig.org/
Make sure your editor is compatible with your editor

2. Package Management

Node Security Platform | https://nodesecurity.io/
"nsp": "2.6.2"
This checks any subsequent NPM installs for security vulnerabilities

3. Development Web Server

/buildScripts/srcServer.js is currently set to port: 3000

4. Automation

Built into the package.json "Scripts" : {}
Utliizes the node_modules/.bin executables
Allows for running scripts in parallel

5. Transpiling

"babel-cli": "^6.26.0",
"babel-preset-env": "^1.6.1",

6. Bundling

"babel-loader": "6.2.5",
"css-loader": "0.25.0",
"style-loader": "0.13.1", |
"webpack": "1.13.2",
"webpack-dev-middleware": "1.8.4",
"webpack-hot-middleware": "2.13.0"

https://stackoverflow.com/questions/34039826/webpack-style-loader-vs-css-loader
-Sourcemaps

7. Linting

"eslint": "3.8.1",
"eslint-plugin-import": "2.0.1",
"eslint-watch": "2.1.14",

We are using eslint-watch instead of esline-loader (webpack) because it displays better warning/error formatting, cleaner messaging, and can lint test and build scripts instead of only the bundled code.

Config format?
Which built-in rules?
Warnings of errors?
Which plugins?
Use preset instead?

8. Testing and Continuous Integration

"babel-register": "6.16.3",
"chai": "3.5.0",
"jsdom": "9.8.0",
"mocha": "3.1.2",

1. Framework - Mocha
2. Assertion Library - Chai
3. Helper Library - JSDOM, Cheerio
4. Where to run tests - Node (JSDOM in memory) - https://nodejs.org/api/fs.html
5. Where to place tests - Alongside
6. When to run unit tests - Upon save
Mocha
Chai
JSDOM

9. HTTP Calls

10. Project Structure

11. Production Build

12. Production Deploy

13. Helpful Tools

"chalk": "1.1.3",
"numeral": "1.5.3",

dev-environment-template's People

dev-environment-template's Issues

Add a .editorconfig file

Add .editorconfig file that:

  1. Enforces a 2 space indentation style.
  2. End of line using a line feed.
  3. Trimming space
  4. Inserting a final new line automatically.

*Make sure the editor has plugin if necessary, see here:
http://editorconfig.org/

Setup Express

Setup Express and have it point to src/index.html

Also setup Localtunnel

Localtunnel has vulnerabilities

Part of #7

npm start

> [email protected] prestart /Users/aldon/Code/Dev-Environment-Template
> node buildScripts/startMessage.js

Starting app in dev mode...

> [email protected] start /Users/aldon/Code/Dev-Environment-Template
> npm-run-all --parallel security-check open:src


> [email protected] security-check /Users/aldon/Code/Dev-Environment-Template
> nsp check


> [email protected] open:src /Users/aldon/Code/Dev-Environment-Template
> node buildScripts/srcServer.js

(+) 1 vulnerabilities found
┌───────────────┬───────────────────────────────────────────────────────┐
│               │ Regular Expression Denial of Service                  │
├───────────────┼───────────────────────────────────────────────────────┤
│ Name          │ debug                                                 │
├───────────────┼───────────────────────────────────────────────────────┤
│ Installed     │ 2.6.8                                                 │
├───────────────┼───────────────────────────────────────────────────────┤
│ Vulnerable    │ <= 2.6.8 || >= 3.0.0 <= 3.0.1                         │
├───────────────┼───────────────────────────────────────────────────────┤
│ Patched       │ >= 2.6.9 < 3.0.0 || >= 3.1.0                          │
├───────────────┼───────────────────────────────────────────────────────┤
│ Path          │ [email protected] > [email protected] > [email protected]      │
├───────────────┼───────────────────────────────────────────────────────┤
│ More Info     │ https://nodesecurity.io/advisories/534                │
└───────────────┴───────────────────────────────────────────────────────┘

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] security-check: `nsp check`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] security-check script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/aldon/.npm/_logs/2018-01-25T05_03_21_346Z-debug.log
ERROR: "security-check" exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `npm-run-all --parallel security-check open:src`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/aldon/.npm/_logs/2018-01-25T05_03_21_418Z-debug.log

Update Babel packages

Installed the presets:

"babel-cli": "6.16.0",
"babel-core": "6.17.0",
"babel-loader": "6.2.5",
"babel-preset-latest": "6.16.0",
"babel-register": "6.16.3",

But got this error:

Dev-Environment-Template git:(10-transpiling-setup) npm install
npm WARN deprecated [email protected]: We're super 😸  excited that you're trying to use ES2017+ syntax, but instead of making more yearly presets 😭 , Babel now has a better preset that we recommend you use instead: npm install babel-preset-env --save-dev. preset-env without options will compile ES2015+ down to ES5 just like using all the presets together and thus is more future proof. It also allows you to target specific browsers so that Babel can do less work and you can ship native ES2015+ to user 😎 ! We are also in the process of releasing v7, so please give http://babeljs.io/blog/2017/09/12/planning-for-7.0 a read and help test it out in beta! Thanks so much for using Babel 🙏, please give us a follow on Twitter @babeljs for news on Babel, join slack.babeljs.io for discussion/development and help support the project at opencollective.com/babel
npm WARN deprecated [email protected]: We're super 😸  excited that you're trying to use ES2017 syntax, but instead of making more yearly presets 😭 , Babel now has a better preset that we recommend you use instead: npm install babel-preset-env --save-dev. preset-env without options will compile ES2015+ down to ES5 just like using all the presets together and thus is more future proof. It also allows you to target specific browsers so that Babel can do less work and you can ship native ES2015+ to user 😎 ! We are also in the process of releasing v7, so please give http://babeljs.io/blog/2017/09/12/planning-for-7.0 a read and help test it out in beta! Thanks so much for using Babel 🙏, please give us a follow on Twitter @babeljs for news on Babel, join slack.babeljs.io for discussion/development and help support the project at opencollective.com/babel
npm WARN deprecated [email protected]: We're super 😸  excited that you're trying to use ES2016 syntax, but instead of making more yearly presets 😭 , Babel now has a better preset that we recommend you use instead: npm install babel-preset-env --save-dev. preset-env without options will compile ES2015+ down to ES5 just like using all the presets together and thus is more future proof. It also allows you to target specific browsers so that Babel can do less work and you can ship native ES2015+ to user 😎 ! We are also in the process of releasing v7, so please give http://babeljs.io/blog/2017/09/12/planning-for-7.0 a read and help test it out in beta! Thanks so much for using Babel 🙏, please give us a follow on Twitter @babeljs for news on Babel, join slack.babeljs.io for discussion/development and help support the project at opencollective.com/babel
npm WARN deprecated [email protected]: We're super 😸  excited that you're trying to use ES2015 syntax, but instead of making more yearly presets 😭 , Babel now has a better preset that we recommend you use instead: npm install babel-preset-env --save-dev. preset-env without options will compile ES2015+ down to ES5 just like using all the presets together and thus is more future proof. It also allows you to target specific browsers so that Babel can do less work and you can ship native ES2015+ to user 😎 ! We are also in the process of releasing v7, so please give http://babeljs.io/blog/2017/09/12/planning-for-7.0 a read and help test it out in beta! Thanks so much for using Babel 🙏, please give us a follow on Twitter @babeljs for news on Babel, join slack.babeljs.io for discussion/development and help support the project at opencollective.com/babel

> [email protected] install /Users/aldon/Code/Dev-Environment-Template/node_modules/fsevents
> node install

[fsevents] Success: "/Users/aldon/Code/Dev-Environment-Template/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN [email protected] requires a peer of webpack@1 || ^2.1.0-beta but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] No repository field.

Debugger

I had to comment out debugger in the index.js file.

Need to investigate why linter did not like it:


> [email protected] lint /Users/aldon/Code/Dev-Environment-Template
> esw webpack.config.* src buildScripts --color

/Users/aldon/Code/Dev-Environment-Template/src/index.js (1/1)
  ✖  5:1  Unexpected 'debugger' statement  no-debugger
  !  6:1  Unexpected console statement     no-console

/Users/aldon/Code/Dev-Environment-Template/buildScripts/srcServer.js (0/1)
  !  22:5  Unexpected console statement  no-console

/Users/aldon/Code/Dev-Environment-Template/buildScripts/startMessage.js (0/1)
  !  3:1  Unexpected console statement  no-console

✖ 1 error ! 3 warnings (13:45:25)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] lint: `esw webpack.config.* src buildScripts --color`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] lint script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/aldon/.npm/_logs/2018-02-14T19_45_25_441Z-debug.log

Setup ES Lint

Config format?
Which built-in rules?
Warnings of errors?
Which plugins?
Use preset instead?

Add automation

  • Add NPM Scripts
  • use Pre and Post Hooks
  • Create Security Check and Share Scripts
  • Handle concurrent tasks

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.