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

@particle/device-constants

v3.6.0

Published

static device identifiers and meta-data for Particle hardware

Downloads

3,904

Readme

Particle Device Constants

The static device identifiers and meta-data for Particle hardware.

This project contains the constants as well as very lightweight wrappers around the constants and enables publishing them as NPM modules and Ruby Gems. All languages' libraries follow the same versioning scheme.

CI

Installation | Development | Releasing

Installation

  1. Install Node.js [[email protected] and [email protected] are required]
  2. Clone this repository $ git clone [email protected]:particle-iot-inc/device-constants.git && cd ./device-constants
  3. Install dependencies $ npm install
    • make sure you are signed into npm and a member of the @particle org (docs)
  4. View available commands $ npm run
  5. Run the tests $ npm test
  6. Start Hacking!

Development

The Device Constants repo contains static specs for official Particle platform devices and the tooling to support publishing a series of language-specific packages with that data. All essential commands are available via npm run <script name> - e.g. npm run lint. To view the available commands, run: npm run

To add a new Particle platform device, simply:

  1. Open the src/constants.json file in your favorite code editor
  2. Add a new entry like:
"example": {
	"id": <integer - the unique identifier>,
	"name": <string - the unique name used by Device OS' build system>,
	"displayName": <string - human-facing platform name>,
	"generation": <integer - e.g. `2` for photon, `3` for boron, `4` for p2>,
	"features": <array of strings - the features supported e.g. `wifi`, `ble`>,
	"billingConnectivity": <string for where data ops for this device type should be counted e.g. `wifi`, or `cellular``>,
	"public": <boolean - whether or not the platform is available to end-users>
},

NOTE: See src/constants.schema.json for latest field definitions

  1. Validate your additions adhere to the current schema: npm run validate
  2. Stage and commit: git add -p && git commit

Constants data must adhere to the JSON Schema (https://json-schema.org) specs in src/constants.schema.json. In some cases, you may need to extend the current schema to support addition properies, etc. To do that:

  1. Read through the "Getting Started" docs
  2. Open the src/constants.schema.json file in your favorite code editor
  3. Update the schema with your additions or changes - in some cases, you can jumpstart the process using the online generator at: https://www.jsonschema.net but be sure to scrutinize what it provides as it's not always super-accurate :)
  4. Validate your changes have not rendered existing data invalid: npm run validate
  5. Stage and commit: git add -p && git commit

Making changes to the ruby wrapper

See the src/ruby/README.md file for more info on the Ruby Gem wrapper.

Releasing

Packages are only released from the main branch after peer review.

  1. make sure you have the latest:
    • $ git checkout main
    • $ git pull
  2. make sure tests pass
    • $ npm test
  3. run the release command
    • $ npm run release
  4. follow the on-screen instructions, wait for confirmation of success
  5. push your tags:
    • $ git push origin main --follow-tags