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

opent2t-translator-com-insteon-binaryswitch

v1.4.1

Published

Insteon Binary Switch

Downloads

6

Readme

Introduction

Repository for Open Translators to Things. Grouped by translators written for specific schemas. The schema names are uniquely namespaced. The translator name is a unique string identifying a Thing.

This README will help get you started developing in this repo.

Install Tools

Get your dev environment set up (PC or Mac):

Get the Source

Next, clone this repo to your local machine to get started. Navigate to the directory where you want to clone the repo to locally, then run:

git clone https://github.com/openT2T/translators.git

Create a New Translator

Follow our getting started guide at http://www.opentranslatorstothings.org. Note that we have some required naming rules for translator node packages:

  1. The npm package names must always have "opent2t-translator-" prefix. We are not currently using npm namespacing.
  2. After the prefix, we will kebab-case the reverse-URI that is translator name, so e.g. "com.wink.lightbulb" becomes "opent2t-translator-com-wink-lightbulb".

Here is some background reading for those who are curious:

  1. Node package name requirements/rules: https://docs.npmjs.com/files/package.json.
  2. Issue #50 includes a discussion and some context behind this naming guidance.

Run Integration Tests

  1. Install gulp globally.
npm install -g gulp
  1. Install dependencies.
npm install verifiers
  1. Run integration tests.
gulp ci-checks

Notes:

  1. Other gulp tasks can be run as well, see gulpfile.js for available tasks.
  2. By default all files under the translators repo will be tested.
  3. Use the --cwd option to only test files under a specified directory:
gulp --cwd .\org.opent2t.sample.windowshade.superpopular\ ci-checks

Create a Pull Request

Made any changes we should consider? Send us a pull request! Check out this article on how to get started.

Publish a Translator Package to NPM

A translator package includes one thing translator along with all the schemas it references. Because those are not organized in the way npm publish expects, the process of publishing a translator package uses a script from the CLI repo.

  1. Update the version property in the package.json file in the translator directory. (Of cource any other metadata may be updated also, but a version bump is required when publishing to npm, since you may not re-publish over an existing version.)

  2. Clone the CLI repo (or sync it as needed), and install its dependencies:

cd ..
git clone https://github.com/opent2t-cli
npm install
cd ../translators
  1. Use the script to generate a package.json for the translator to be published. Note the last parameter is a simple name of a translator, not a directory path, which would include a schema name.
node ../opent2t-cli/pack-translator.js com.wink.thermostat
  1. Edit the package.json to include directories for referenced schemas in the files collection at the end. Lines will include at least "oic.core" and "oic.baseresource"; possibly others if the OCF schema .json file has $ref references to others. (Eventually the pack-translator.js script should add these lines automatically.)

  2. Ensure you're logged in to NPM under the opent2t account:

npm login
Username: opent2t
Password: *********
  1. Publish the package to NPM:
npm publish

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.