All Projects โ†’ matthisk โ†’ Es6console

matthisk / Es6console

Licence: mit
๐Ÿ”ฎ Play with ECMAScript compilers

Programming Languages

javascript
184084 projects - #8 most used programming language
es6
455 projects
ecmascript
72 projects

Labels

Projects that are alternatives of or similar to Es6console

Libfsm
DFA regular expression library & friends
Stars: โœญ 512 (+300%)
Mutual labels:  compilers
Llvm Tutor
A collection of out-of-tree LLVM passes for teaching and learning
Stars: โœญ 941 (+635.16%)
Mutual labels:  compilers
Dataformsjs
๐ŸŒŸ DataFormsJS ๐ŸŒŸ A minimal JavaScript Framework and standalone React and Web Components for rapid development of high quality websites and single page applications.
Stars: โœญ 95 (-25.78%)
Mutual labels:  compilers
Compiladores
Stars: โœญ 535 (+317.97%)
Mutual labels:  compilers
Verilator
Verilator open-source SystemVerilog simulator and lint system
Stars: โœญ 645 (+403.91%)
Mutual labels:  compilers
Optviewer Demo
Demonstration of LLVM's opt-viewer tool
Stars: โœญ 63 (-50.78%)
Mutual labels:  compilers
Simd Visualiser
A tool to graphically visualize SIMD code
Stars: โœญ 459 (+258.59%)
Mutual labels:  compilers
One
OneLang: The One System Programming Language. (release as soon)
Stars: โœญ 120 (-6.25%)
Mutual labels:  compilers
Awesome Quantum Software
Curated list of open-source quantum software projects.
Stars: โœญ 647 (+405.47%)
Mutual labels:  compilers
Meta Clang
Clang C/C++ cross compiler and runtime for OpenEmbedded/Yocto Project
Stars: โœญ 76 (-40.62%)
Mutual labels:  compilers
Wgtcc
A small C11 compiler
Stars: โœญ 580 (+353.13%)
Mutual labels:  compilers
Sdc
Intelยฎ Scalable Dataframe Compiler for Pandas*
Stars: โœญ 623 (+386.72%)
Mutual labels:  compilers
Llvm Heat Printer
LLVM Profiling Visualization
Stars: โœญ 68 (-46.87%)
Mutual labels:  compilers
Binaryen
Compiler infrastructure and toolchain library for WebAssembly
Stars: โœญ 5,294 (+4035.94%)
Mutual labels:  compilers
Ocamlverse.github.io
Documentation of everything relevant in the OCaml world
Stars: โœญ 117 (-8.59%)
Mutual labels:  compilers
Micro Mitten
You might not need your garbage collector
Stars: โœญ 470 (+267.19%)
Mutual labels:  compilers
Envs
Component development environments for the Bit community
Stars: โœญ 58 (-54.69%)
Mutual labels:  compilers
Gllvm
Whole Program LLVM: wllvm ported to go
Stars: โœญ 126 (-1.56%)
Mutual labels:  compilers
Build Essential
Development repository for build-essential Chef Cookbook
Stars: โœญ 118 (-7.81%)
Mutual labels:  compilers
Scalaz Plugin
A compiler plugin that will improve on the scala compiler on the assumption that the user is using the Scalazzi-safe subset of Scala.
Stars: โœญ 76 (-40.62%)
Mutual labels:  compilers

ES6Console.com

This is the main repository of es6console.com. A tool for playing around with ECMAScript 6 to 5 transformers.

Table of Contents

  1. Features
  2. Requirements
  3. Application Structure
  4. Development
  5. Developer Tools
  6. Routing
  7. Testing
  8. Deployment
  9. Build System
  10. Configuration
  11. Globals
  12. Styles
  13. Server
  14. Production Optimization

Features

Requirements

  • node ^4.5.0
  • yarn ^0.17.0 or npm ^3.0.0

Install from source

First, clone the project:

$ git clone https://github.com/matthisk/es6console.git <my-project-name>
$ cd <my-project-name>

Then install dependencies and check to see it works. It is recommended that you use Yarn for deterministic installs, but npm install will work just as well.

$ npm install    # Install project dependencies
$ npm run dev      # Compile and launch (same as `npm start`)

While developing, you will probably rely mostly on npm dev; however, there are additional scripts at your disposal:

npm run <script> Description
start Serves your app at localhost:8000. HMR will be enabled in development.
compile Compiles the application to disk (~/dist by default).
dev Same as npm start, but enables nodemon for the server as well.
test Runs unit tests with Karma and generates a coverage report.
test:dev Runs Karma and watches for changes to re-run tests; does not generate coverage reports.
deploy Runs linter, tests, and then, on success, compiles your application to disk.
deploy:staging Same as deploy but overrides NODE_ENV to "development".
deploy:prod Same as deploy but overrides NODE_ENV to "production".
deploy_lambda Same as deploy_lambda but overrides NODE_ENV to "production".
deploy_lambda:staging Same as deploy_lambda but overrides NODE_ENV to "production".
deploy_lambda:prod Same as deploy_lambda but overrides NODE_ENV to "production".
lint Lint all .js files.
lint:fix Lint and fix all .js files. Read more on this.

Application Structure

.
โ”œโ”€โ”€ bin                      # Build/Start scripts
โ”œโ”€โ”€ config                   # Project and build configurations
โ”œโ”€โ”€ public                   # Static public assets (not imported anywhere in source code)
โ”œโ”€โ”€ server                   # Express application that provides webpack middleware
โ”‚   โ””โ”€โ”€ main.js              # Development Server application entry point
โ”œโ”€โ”€ src                      # Application source code
โ”‚   โ”œโ”€โ”€ index.html           # Main HTML page container for app
โ”‚   โ”œโ”€โ”€ main.js              # Application bootstrap and rendering
โ”‚   โ”œโ”€โ”€ components           # Global Reusable Presentational Components
โ”‚   โ”œโ”€โ”€ containers           # Global Reusable Container Components
โ”‚   โ”œโ”€โ”€ layouts              # Components that dictate major page structure
โ”‚   โ”‚   โ””โ”€โ”€ CoreLayout.js    # CoreLayout which receives children for each route
โ”‚   โ”‚   โ””โ”€โ”€ CoreLayout.scss  # Styles related to the CoreLayout
โ”‚   โ”‚   โ””โ”€โ”€ index.js         # Main file for layout
โ”‚   โ”œโ”€โ”€ routes               # Main route definitions and async split points
โ”‚   โ”‚   โ”œโ”€โ”€ index.js         # Bootstrap main application routes with store
โ”‚   โ”‚   โ”œโ”€โ”€ Home             # Fractal route
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ index.js     # Route definitions and async split points
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ assets       # Assets required to render components
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ components   # Presentational React Components
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ routes **    # Fractal sub-routes (** optional)
โ”‚   โ”œโ”€โ”€ store                # Redux-specific pieces
โ”‚   โ”‚   โ”œโ”€โ”€ createStore.js   # Create and instrument redux store
โ”‚   โ”‚   โ””โ”€โ”€ reducers.js      # Reducer registry and injection
โ”‚   โ””โ”€โ”€ styles               # Application-wide styles (generally settings)
โ”œโ”€โ”€ lambda                   # AWS Lambdas
โ””โ”€โ”€ tests                    # Unit tests

Development

Developer Tools

Testing

To add a unit test, simply create a .spec.js file anywhere in ~/tests. Karma will pick up on these files automatically, and Mocha and Chai will be available within your test without the need to import them. Coverage reports will be compiled to ~/coverage by default. If you wish to change what reporters are used and where reports are compiled, you can do so by modifying coverage_reporters in ~/config/project.config.js.

Deployment

ES6Console is hosted on Amazon S3. When running npm run deploy the ~/dist folder is synced up to the s3 bucket configured in config/environment.config.js. The website requires several backend scripts which are hosted on AWS Lambda using the serverless framework. When running npm run deploy_lambda these lambdas are automatically deployed.

Configuration

Default project configuration can be found in ~/config/project.config.js. Here you'll be able to redefine your src and dist directories, adjust compilation settings, tweak your vendor dependencies, and more. For the most part, you should be able to make changes in here without ever having to touch the actual webpack build configuration.

If you need environment-specific overrides (useful for dynamically setting API endpoints, for example), you can edit ~/config/environments.config.js and define overrides on a per-NODE_ENV basis. There are examples for both development and production, so use those as guidelines. Here are some common configuration options:

Key Description
dir_src application source code base path
dir_dist path to build compiled application to
server_host hostname for the Express server
server_port port for the Express server
compiler_devtool what type of source-maps to generate (set to false/null to disable)
compiler_vendor packages to separate into to the vendor bundle

Webpack is configured to make use of resolve.root, which lets you import local packages as if you were traversing from the root of your ~/src directory. Here's an example:

// current file: ~/src/views/some/nested/View.js
// What used to be this:
import SomeComponent from '../../../components/SomeComponent'

// Can now be this:
import SomeComponent from 'components/SomeComponent' // Hooray!

Globals

These are global variables available to you anywhere in your source code. If you wish to modify them, they can be found as the globals key in ~/config/project.config.js. When adding new globals, make sure you also add them to ~/.eslintrc.

Variable Description
process.env.NODE_ENV the active NODE_ENV when the build started
__DEV__ True when process.env.NODE_ENV is development
__PROD__ True when process.env.NODE_ENV is production
__TEST__ True when process.env.NODE_ENV is test

Styles

Both .scss and .css file extensions are supported out of the box. After being imported, styles will be processed with PostCSS for minification and autoprefixing, and will be extracted to a .css file during production builds.

Production Optimization

Babel is configured to use babel-plugin-transform-runtime so transforms aren't inlined. In production, webpack will extract styles to a .css file, minify your JavaScript, and perform additional optimizations such as module deduplication.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].