Skip to content

Latest commit

 

History

History
99 lines (67 loc) · 2.28 KB

GETTING_STARTED.md

File metadata and controls

99 lines (67 loc) · 2.28 KB

Usage

Prerequisites

Getting started from a template

Setup

  1. install miojs, a command-line tool to help with the projects built with MIOJSLibs.

    npm install miojs -g
  2. run init, with the desired project name.

    miojs init my-new-project-name

    It will create a basic frame for the project, into a new folder that is named as the given project name.

  3. Congratulations, now you have a template project that uses MIOJSLibs.

Build the project

  1. Navigate to the project folder.

  2. Install the dependencies (including miojslibs).

    npm install
  3. Install && copy the miojslibs to app/libs/miojslibs

    npm run update-libs # since it uses cp currently it only works in mac||linux
  4. Build the scss files of the project

    npm run scss:watch
  5. Bundle the typescript files of the project.

    npm run tsc

Start the project

  1. Serve the files with a basic http-server.

    npm start
  2. Navigate to http://localhost:9090 in an ES5 compatible browser.

Getting started from scratch

  1. Initialize your project with npm (if you haven't already).

    cd my-project-directory
    npm init

    This will create a package.json file into the project root directory.

  2. Install miojslibs (this project) from npm.

    npm install miojslibs --save
  3. If you use typescript add miojslibs to types into tsconfig.json.

    {
        "compilerOptions": {
            "types": [
                "miojslibs"
            ]
        }
    }
  4. Copy/move/reference the node_modules/miojslibs/dist/js folder to your publicly served files under libs/miojslibs.

    This project uses webworkers, currently they are loaded from libs/miojslibs/webworkers, they need to be placed in that folder due to the fact that webworkers' scriptURL argument is relative to the entry script's base URL.

  5. Add the script to your index.html before any other MIOJSLibs related scripts.

    <script src="libs/miojslibs/miojslibs.js"></script>
  6. Use the framework.