Socket
Book a DemoInstallSign in
Socket

@projectsophon/df-plugin-dev-server

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@projectsophon/df-plugin-dev-server

An ESBuild server for Dark Forest plugin development.

Source
npmnpm
Version
1.1.0
Version published
Weekly downloads
1
-50%
Maintainers
2
Weekly downloads
 
Created
Source

@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 where plugins exist     [string] [default: "plugins"]
  --ext      Extensions to process              [array] [default: [".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/MyAwesomePlugin.js or ./plugins/MyAwesomePlugin.ts by default
import Plugin from "http://127.0.0.1:2222/MyAwesomePlugin.js"

export default Plugin;

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
import Plugin from "http://127.0.0.1:2222/MyAwesomePlugin.js?dev"

export default Plugin;

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

License

MIT

FAQs

Package last updated on 29 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts