Git Product home page Git Product logo

cornerstone's Introduction

Cornerstone

A webapack-based seed project that's a good foundation for modern JS/TS web applications. An attempt to make web development productivd without the lock-in of Big Frameworks!

If you are wondering 'Why one more seed project'? -> Why?

Guides

Foundation Features

  • Typescript - The tsconfig.json includes support for decorators, dynamic loading, and ESNext
  • webpack
    • Dynamic modules - Make chunking and dynamic loading part of your design
    • chunking
    • Maps - Maps work with minified production code so that we can develop all the time with code we will use in prod

Removable Features

Most of the features in this seed project are optional. You should also be able to easily add dependencies that are compatible with ES6 and TypeScript.

  • lit-html and lit-element - Polymer core libraries to build true web components
    • Workshop setup depends on these two libraries
  • Some custom code
    • to extend lit-element
    • to provide a simple router
  • Workshop Environment - Isolate features for the sake of documenting, testing, and showcasing. Includes an easy to bootstrap mechanism
  • Jest - for unit testing
  • TestCafe - for integration and end-to-end testing
  • Milligram - a tiny css library (<2k) that you can enhance or replace when/if you find you need something more.
  • Simple theming file to share css across components
  • Non-trivial example code showing all of the key features

That said I think this is a good stack that should allow to build simple or complex SPAs without any of the complexity and overhead of the big frameworks.

Usage

Setup

  • add ./node_modules/.bin to your path so you can avoid installing anything globally... because we all know it's evil! Do it just in the shell or add it to your ~/.bashrc

    export PATH=./node_modules/.bin:$PATH
    
  • ideally use yarn to install the dependencies

    yarn
    

build and test

  • unit tests - run tests that is isolatable and ideally not needing the DOM.

    yarn test
    
  • integration tests - You will need to run either the app or the workshop(see below). Then run the testcafe integration tests. These should be split into web-layer integration and end-to-end tests with a full back-end.

    # not yet implemented
    
  • lint - make sure your code is clean and following some reasonable standard.

    yarn lint
    
  • building and watching - There are variations here for different purposes... mostly obvious build the app and the workshop

    yarn build
    

    generates dist/app and dist/workshop

    build and watch the app:

    yarn serve.app
    

    build and watch the workshop:

    yarn serve.workshop
    
You then need to run `http-serve dist/workshop` or `http-serve dist/app` to serve any of the builds.

Why not use the webpack server? Because we should test releasable code and avoid the build-test-rebuild anti-pattern

Note: the plan is to eventually share a single build of common code between app and workshop.

Reference

Todo

  • find a decent routing library: complete, no overkill, reasonable size, ES6 I am providing a simple solution
  • find a decent XHR library... if it's really needed.
  • Make sure I can add angular, react, vue, polymer, web components without having to change the core
  • finish WPA support (pulled out for now)
  • add unit and e2e testing support
  • clean-up sample code (apply tslint fixes)
  • problem with uglify and stacktraces in dev mode.
  • setup webpack so that components get built only once so they can be shared between the app and the workshop.

cornerstone's People

Contributors

flo-noumena avatar zenwork avatar

Watchers

 avatar  avatar

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.