Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ovos-media/builder-ope-archetype

Package Overview
Dependencies
Maintainers
4
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ovos-media/builder-ope-archetype

Builder archetype for ovos play ecosystem

  • 1.7.7
  • latest
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

builder archetype for the ovos play ecosystem

CircleCI

This archetype for builder initializes a new project with an

  • express server
  • /graphql endpoint
  • /graphiql interface in development mode
  • barebones react + react-dom for views in client side

Installation

# first install builder-init globally
npm i -g builder-init


# then tell builder-init to init the builder-ope-archetype
# for this to work, you have to be a member of the ovos-media org on npm
# contact pn@ovos.at or kg@ovos.at
builder-init @ovos-media/builder-ope-archetype


# answer all the questions and then cd into the project directory
cd projectDirectory


# install dependencies
npm i


# run the application in dev mode (HMR, source maps, debugging...)
builder run start:dev

# in order for testing to work, you'll have to install jest and karma-cli globally
npm i -g jest karma-cli

# you can then run tests just with
builder run test-all

About

It assumes the following directory structure for it's scripts to work:

- projectName
  - src
    - client
      - __tests__
        - entry.js
      - entry.js
    - server
      - entry.js

Feel free to exchange packages where you see fit.

It supports client-side HMR out of the box so there's no need to configure any additional stuff.

Testing

Client

For client side testing the karma test runner is used and includes the chai testing framework with a mocha style reporter.

If you want to use jest + jasmine however, you can create a new jest config for your project and use this configuration then with a custom npm command.

Server

For server side testing jest is used which includes jasmine by default.

The reason we're not using karma/chai here is that karma does run tests in a browser (which doesn't include nodejs stuff) and jest includes jasmine.

You may however use chai asserts/expects/shoulds in your server side test by importing the chai framework and using it like this:

import chai from 'chai';

describe('calc', () => {
  it('works', () => {
    chai.expect(1 + 1).to.equal(2);
  }
});

Code Coverage

Code coverage will automatically be generated via istanbul for both client and server scripts.

It will only be generated for single-runs and not in watch mode.

Code coverage reports are structured like this:

- projectName
  - coverage
    - client
      - [browserName]
        - index.html
    - server
      - lcov-report
        - index.html

If additional reports are needed for CI we can easily add them to this archetype.

Commands

$ builder run start:dev # starts the dev version of the application (HMR, sourcemaps, ...)

$ builder run test-client # runs client tests using karma & runs tests in chrome
$ builder run test-server # runs server tests using jest
$ builder run test-all # runs client & server tests concurrently

$ builder run test-client:watch # watch mode for client tests
$ builder run test-server:watch # watch mode for server tests
$ builder run test-all:watch # watch mode for client & server tests

FAQs

Package last updated on 13 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc