KubePackages
KubeJS 的包管理器。
KubePackages 为 KubeJS 引入了“包(package)”的概念,重新定义了脚本的分发方式。它允许脚本像模块一样封装、像资源包一样加载、像模组一样分发。
本页简要介绍 KubePackages 的核心功能:KubePackage。如需更详细的说明和教程,请参阅:
KubePackage(是的,没有复数 's')
为了支持包管理、分发和依赖管理,KubePackages 引入了 “KubePackage” 作为“包”概念的载体。它提供了完整的加载框架,使开发者能够以模块化方式构建、集成和发布 KubeJS 功能。这解决了脚本加载扁平化、命名空间污染以及脚本间耦合紧密的问题。
你知道吗:Rhino 对变量作用域的处理一直颇为特殊。结合 KubeJS 的扁平化脚本加载机制,声明同名变量很容易导致难以排查的 bug。
KubePackage 不仅是脚本文件的容器,还可以提供 assets 和 data 资源。结合带有依赖信息的元数据,KubePackage 的功能超越了传统的资源包和数据包。
借助 KubePackage,开发者不再只是编写脚本并无意中重复造轮子,而是可以利用可复用的模块来提升开发体验(QoL)。你可以:
- 像开发模组一样编写脚本: KubePackage 提供独立的依赖管理和脚本作用域。
- 像安装模组一样加载功能: 使用名为
KubePackages 的 JS 绑定,你可以轻松检查特定包是否存在、集成他人开发的包、在包之间交换数据,并快速构建复杂项目。
- 像发布模组一样分享作品: 将包轻松导出为
.jar 文件、.zip 文件或目录,并直接作为模组发布到 CurseForge 或 Modrinth。
KubePackages 旨在成为 KubeJS 生态系统的标准包管理系统,并为整个社区提供统一的标准。
KubePackages
Package manager for KubeJS.
KubePackages introduces the concept of "package" for KubeJS, redefining how scripts are distributed. It allows scripts
to
be encapsulated like modules, loaded like resource packs, and distributed like mods.
This page provides a brief introduction to the core feature of KubePackages: the KubePackage. For more detailed
explanations and tutorials, please refer to:
KubePackage (Yes, without the 's')
To support package management, distribution, and dependency management, KubePackages introduces "KubePackage" as the
carrier for the "package" concept. It provides a complete loading framework, enabling developers to build, integrate,
and publish KubeJS functionalities in a modular way. This resolves the issue of flattened script
loading, namespace pollution, and tight coupling between scripts.
Did you know that: Rhino's handling of variable scopes has always been quite peculiar. Combined with KubeJS's
flattened script loading, declaring variables with same name can easily lead to hard-to-find bugs.
KubePackage is not just a container for script files, but can also provide assets and data resources. Combined with
metadata with dependency info, KubePackage goes a step further than resource packs and data packs.
With KubePackage, developers can do more than just writing scripts and inadvertently reinventing the wheel. Instead,
they
can leverage reusable modules to improve development QoL. You can:
- Write scripts like developing mods: KubePackage provides independent dependency management and script scope.
- Load functionalities like installing mods: Using the JS binding named
KubePackages, you can easily check if
specific packages exist, integrate packages developed by others, communicate data between packages, and
quickly build complex projects.
- Share your work like publishing mods: Export packages effortlessly as
.jar files, .zip files, or directories,
and
publish them directly as mods on CurseForge or Modrinth.
KubePackages aims to become the standard package management system for the KubeJS ecosystem and provide a unified standard for the entire community.
评论 0
登录后参与评分
还没有评论,来抢沙发吧