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

create-foxglove-extension

v0.8.6

Published

Create and package Foxglove Studio extensions

Downloads

3,111

Readme

create-foxglove-extension

npm version

Introduction

Foxglove Studio allows developers to create extensions, or custom code that is loaded and executed inside the Foxglove Studio application. This can be used to add custom panels. Extensions are authored in TypeScript using the @foxglove/studio SDK.

Creating Your First Extension

Make sure you have Node.js 14 or newer installed. In a terminal, go into the directory where you keep source code (ex: cd ~/Code) and run the following command:

npm init foxglove-extension@latest helloworld

Feel free to choose an extension name other than helloworld. Otherwise, this will create a folder named helloworld containing your extension. Run a one-time initialization step:

cd helloworld
npm install

This installs all of the dependencies needed to edit and build the extension. You can use any editor to work on this project, although VSCode is the best supported IDE for authoring Foxglove Studio extensions. Look at the files src/index.ts and src/ExamplePanel.tsx for a simple example of creating a React element and registering it as a custom panel. To build and install this extension into your local Foxglove Studio extensions folder, run:

npm run local-install

This should create a folder under your home directory such as ~/.foxglove-studio/extensions/unknown.helloworld-0.0.0 containing your compiled extension. Start Foxglove Studio. If everything succeeded, you should be able to add a new panel in Foxglove Studio named "ExamplePanel". Each time you make a change to your extension, you will need to run npm run local-install again to build it and copy the build output to the Foxglove Studio extensions folder in your home directory. You can either reload Foxglove Studio or close and reopen it to load your latest extension code.

If you just want to confirm your code compiles without installing it locally, run npm run build.

You can customize the build and install process by editing your ./config.ts file. The config file should look something like this:

module.exports = {
  webpack: (config) => {
    config.module.rules.push({
      test: /\.css$/i,
      use: ["style-loader", "css-loader"],
    });
    return config;
  },
};

Publishing Your Extension

All of the metadata for your extension is contained in the package.json file. Before publishing, make sure you have set name, publisher, version, and description. When you are ready to distribute your extension, run:

npm run package

This will produce a .foxe file such as helloworld-0.0.0.foxe. This is essentially a ZIP archive containing your extension manifest and compiled code that can be opened by the Foxglove Studio application, which will unpack it and install it to the ~/.foxglove-studio/extensions folder. Stay tuned for future instructions on how to publish Foxglove Studio extensions to a registry so other users can easily search for and install your extension.

Examples

You can find examples of different kinds of extensions in the ./examples directory.

Stay in touch

Join our Slack channel to ask questions, share feedback, and stay up to date on what our team is working on.