desktopJS provides a common API across multiple HTML5 containers. By programming to a common API, applications can target multiple HTML5 containers without change.
Branch: master
Clone or download
bingenito Update dependencies (#224)
- typedoc@0.14.2
- typedoc-plugin-external-module-name@2.0.0
- rollup@1.1.1
- remap-istanbul@0.13.0

build.js:
- Upgrade in rollup reduced unnecesary depth of bundle declaration so an update to the regex was required for our wrapping of the bundlne with an undefined check for desktopJS

Closes #211
Closes #212
Closes #222
Closes #223
Latest commit 1409c65 Feb 15, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gulp Update dependencies (#224) Feb 15, 2019
.vscode BREAKING CHANGE: Lerna/monorepo refactor package split (#199) Dec 3, 2018
dco Fixes issue #195. Covered by dco/daniel-jasnowski-pascual.md Feb 11, 2019
examples Add static grouping events to ContainerWindow (#213) Feb 1, 2019
packages
pitch
.editorconfig Initial commit May 15, 2017
.gitignore BREAKING CHANGE: Lerna/monorepo refactor package split (#199) Dec 3, 2018
.npmignore
.npmrc Add project .npmrc to specify npmjs registry (#193) Sep 28, 2018
.travis.yml
CODEOWNERS Add CODEOWNERS with default reviewer of @Morgan-Stanley/desktopjs-core ( Jul 7, 2017
CONTRIBUTING.md Change from CLA to DCO. Update guidelines and add template. (#216) Feb 11, 2019
DISCLAIMER
LICENSE
NOTICE
README.md Correct readme spelling errors (#144) Apr 9, 2018
codecov.yml
deploy.sh Update version to 3.0.0 (#206) Dec 11, 2018
gulpfile.js Fixes issue #195. Covered by dco/daniel-jasnowski-pascual.md Feb 11, 2019
lerna.json BREAKING CHANGE: Lerna/monorepo refactor package split (#199) Dec 3, 2018
package-lock.json Update dependencies (#224) Feb 15, 2019
package.json
tslint.json BREAKING CHANGE: Lerna/monorepo refactor package split (#199) Dec 3, 2018

README.md

desktopJS

npm version Build Status codecov Greenkeeper badge devDependencies Status dependencies Status GitPitch

desktopJS is a common API across multiple HTML5 containers. By programming to a common API, applications can target multiple HTML5 containers without change. Detecting what container in which you are hosted, desktopJS provides shims and polyfills to bridge the common API to the underlying container. The goal is to help applications be container agnostic and provide portability when multiple container deployments are desired.

Usage

The first step is to simply resolve the current container. This enumerates all registered containers (including your own custom container or derived custom implementations) and returns the container implementation that matches.

var container = desktopJS.resolveContainer();
console.log("Container: " + container.hostType);

Interact with the container via a single api instead of having conditional code or applications based on deployment.

container.addTrayIcon({ icon: 'assets/img/application.png', text: 'Example' }, () => {
	console.log("Icon clicked");
});

Building

The library uses gulp and rollup for building. All build dependencies are included as devDependencies and are installed during npm install.

$ npm install

Build the project. This runs static analysis, unit tests and bundles the output with rollup.

$ npm run build

For those using Visual Studio Code, tasks.json has a compile task configured and can be invoked via ctrl+shift+b by default.

Development

Local Hosting

To run the examples or to manually test scenarios in each container, there is a gulp task providing a local server with live reload. This can be run directly via gulp or through npm.

$ npm run server

This is configured to listen at http://localhost:8000 and will reload upon any change to the project build output under /dist or the web example under /examples/web. All of the included examples make use of this example application to showcase the portability of one codebase.

Unit tests

The tests can be run independent of the build.

$ npm run test

A task is provided for Visual Studio Code users that can be launched from the command palette via

>Tasks: Run Test Task

or it is recommended to define a custom keyboard binding.

{
    "key": "ctrl+shift+t",
    "command": "workbench.action.tasks.test"
}

Examples

Examples showcasing usage of desktopJS for various containers and scenarios can be found under the examples directory.