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

@projectsophon/df-plugin-dev-server

v1.5.0

Published

An ESBuild server for Dark Forest plugin development.

Downloads

25

Readme

@projectsophon/df-plugin-dev-server

An ESBuild server for Dark Forest plugin development.

Installation

You can install the command globally using:

npm i -g @projectsophon/df-plugin-dev-server

Usage

Once installed, you should have access to the command:

df-plugin-dev-server

You can see the supported flags by running:

df-plugin-dev-server

Start a Dark Forest plugin development server.

Options:
  --help     Show help                                                 [boolean]
  --version  Show version number                                       [boolean]
  --dir      The directory to load     [deprecated: use --glob instead] [string]
  --ext      Extensions to process      [deprecated: use --glob instead] [array]
  --glob     Glob for finding plugins   [array] [default: ["plugins/*.(js|ts)"]]

And then run the server:

df-plugin-dev-server
ESBuild for /Users/user/sophon-plugins/plugins on port 2221
Development server started on http://127.0.0.1:2222/

Adblock & Security

I noticed that Brave Browser's built-in Adblock stops any requests to 127.0.0.1, so you'll need to disable that if you are building plugins against https://zkga.me directly.

You'll also need to "Allow Insecure Content" since this development server doesn't provide an HTTPS certificate.

Plugins

The easiest way to load plugins while developing would be to use something like this in the Dark Forest UI:

// This maps to ./plugins/PluginTemplate.js or ./plugins/PluginTemplate.ts by default
export { default } from "http://127.0.0.1:2222/PluginTemplate.js";

However, Dark Forest plugins are cached, so you'd need to do some sort of cache busting each time you make a change. Luckily, we've taken care of that for you! To get free cache busting, you can add ?dev to the end of your plugin URL.

// Notice the ?dev
export { default } from "http://127.0.0.1:2222/PluginTemplate.js?dev";

Doing the above will proxy your plugin through a cache busting plugin!

Docker image installation and running

From main directory you can execute commands to build and start docker image:

To build & run without getting prompted for docker output simply run (with -d):

docker-compose -f docker-compose.yml up -d --build --remove-orphans

To run an existing image without building, remove --build --remove-orphans:

docker-compose -f docker-compose.yml up -d

To stop you should use stop. To stop and delete use down:

docker-compose -f docker-compose.yml stop
docker-compose -f docker-compose.yml down

To only build the docker image:

docker-compose -f docker-compose.yml build

If your image is already built, you can use the docker command directly:

docker start plugin_server
docker stop plugin_server

Security notes for docker containers

Docker is working on another layer meaning your internet connection from docker containers is bridged through your network interface by default. Starting this container with default configuration using commands from above opens port to this docker container to any incoming IP subnet existing (bind 0.0.0.0). Default system firewall configuration will not prevent access from outside world if your router does not block ports by default. KEEP THIS IN MIND. Storing vulnerable data inside container is not recommended with this configuration. You should edit docker network of plugin_server to make it harden. The easiest way is to set flag --internal for specific docker network, to prevent access from other computers.

License

MIT