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

@kubejs/plugin

v1.1.6

Published

A KubeJS plugin

Downloads

65

Readme

Introduce

A long time ago when first time I met KubeJS mod I was so excited about it. I first looked to mod but couldn't use it cause time and knowledge. But now when I improved my self as JavaScript developer I decided to make a modpack with KubeJS mod. But regular usage of KubeJS mod is not enough for me. For that I decided to use vite as bundler for KubeJS scripts. It's small and scratch project. Please give a feedback if you have any idea.

Pre-requirements

  • NodeJS - I recommend to use LTS version.
  • Yarn - I recommend to use yarn 2.
  • KubeJS - I recommend to use latest version.
  • ProbeJS - required for full typescript support.

Usage

Create new minecraft project in one of these platforms such as curseforge, modrinth, etc...
Then setup new node project on instance directory.

cd /path/to/instance
npm init -y
# or
yarn init -y # for yarn 1
yarn init -y -2 # for yarn 2

Add @kubejs/plugin to your project.

npm install @kubejs/plugin
# or
yarn add @kubejs/plugin

Add these scripts to your package.json file.

{
  "scripts": {
    "build": "kubejs build",
    "watch": "kubejs build --watch"
  }
}

Add that typing to vite environment file (vite-env.d.ts).

/// <reference types="@kubejs/plugin/probe.d.ts" />

Now you can run npm run build or yarn build to build your scripts for production.
Or you can run npm run watch or yarn watch to start development statement.

You can add additional buildable config in vite.config.ts. But in my opinion I made everything which I can. After that you can start writing your scripts in src directory, and it will automatically will be built into kubejs/*_scripts directories depends on entry file. You can find more information about KubeJS mod in here.

File Structure

Here have 3 entry points for vite build.

  • src/client.ts - This file will be built into kubejs/client_scripts directory, and it will be loaded on client side.
  • src/server.ts - This file will be built into kubejs/server_scripts directory, and it will be loaded on server side.
  • src/startup.ts - This file will be built into kubejs/startup_scripts directory, and it will be loaded on startup.

License

This project is licensed under the MIT License - see the LICENSE file for details

Contributing

If you have any idea, or you want to contribute to this project please open an issue or pull request. I will be happy to see your ideas and contributions.

Contact

You can contact with me via Discord or LinkedIn

TODO

  • [ ] Add framework support (React, Vue, etc...)
  • [ ] Add more examples
  • [ ] Add more documentation
  • [ ] Add more tests