npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

oe-skeleton

v2.3.0

Published

oe-cloud modularization project

Downloads

19

Readme

oe-skeleton project

This is oeCloud working module which can be used for example reference to build your module. You can then plug your module in app-list.json file of application. oeCloud module will load oe-skeleton (or your module). This document file shows what all things you can typically do when you want to develop oecloud module.

dependency

  • oe-cloud
  • oe-logger

Installation, test cases and code coverage

Pre-requisite

Before you start developing oeCloud module, you should ensure network access and other softwares like MongoDB installed on your machine.

  • You should able to connecto to npmjs and github when you use npm on command line
  • For that use .npmrc and .gitconfig as shown below

.npmrc

http-proxy=http://proxy/
https-proxy=https://proxy/
registry="http://registry.npmjs.org"
no_proxy=
strict-ssl=false
python=E:\Python27\python.exe

.gitconfig

[http]
proxy = http://proxy/
[https]
proxy = https://proxy/
  • You should have nodejs 8+ version installed
  • You should have MongoDB 3.2+ version installed

Installation of oe-skeleton

$ git clone https://github.com/EdgeVerve/oe-skeleton.git
$ cd oe-skeleton
$ npm install --no-optional

Run Test cases

mocha test/test.js

Run test with coverage

Run test cases along with code coverage - code coverage report will be available in coverage folder

$ npm run grunt-cover

Run as independent Server

$ node test/server.js

browse http://localhost:3000/explorer

Enabling CI

CI is available and enabled by default in this project. You may have to do minor changes as below.

.gitlab-ci.yml

This file is responsible for running CI in gitlabs. you don't have to chagne anything in file. It will run npm run grunt-cover job which will internally run mocha test/test.js along with coverage. You may have to change this file to point to different database of Oracle, PostgreSQL or MongoDB. you will have to go to such sections and change the connection string. But mostly this is not needed.

Gruntfile.js

This file is used when CI run test and coverage. you may want to modify following acceptance parameters.

 check: {
            lines: 90,
            statements: 90,
            branches: 50,
            functions: 100
          },

README.md

you should change this file as per your module.

ESLint

.eslintrc and .eslintignore files you need not to modify. However it is good practice to run following command before you push into git. Or else CI pipeline will fail.

$ eslint . --fix

Developing oe-cloud module

You can do following things in this oe-cloud module.

  • Add models specific to your module (see common/modles folder)
  • Add mixins which will get attached to BaseEntity (see common/mixins folder)
  • Add middleware (see server/middleware folder and server/middleware.json)
  • Add Boot script (see server/boot folder)

Developing test script

There is test folder created. you need to modify following files for your project

datasources*.json

There are several total 3 datasource.x.json files each for Mongo, PostgreSQL and Oracle. you should change database name at least for Mongo and PostgreSQL

server.js

you may want to run this module as independent server during your development. Mostly you don't have to chagne this file unless you are having mixin. For that have line similar to below for your mixin.

oecloud.attachMixinsToBaseEntity("SkeletonMixin");

test.js

This is typical mocha unit test case file. you can keep adding test cases to it.

Adding models to your test scripts

you can add models that you want to use only for your test scripts in test/common/models folder and then modify test/model-config.json file to have entry for the model.

Adding boot script to your test scripts

you can add boot script in test/boot folder. This will be executed as part of boot in application.

Similarly you can also have middleware/mixins for testing - which is mostly not required.