1.1.1 • Published 3 years ago

generator-beet v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

generator-beet

License NPM version semantic-release

Yeoman generator for Beet projects

Table of Contents

Getting started

Install generator

Install Yeoman and generator-beet using npm (assuming you have pre-installed node.js)

npm install -g yo generator-beet

Install Poetry

It's recommended to create a Python project:

  • Ensures you have beet correctly installed
  • Required for Github releases
  • Easier beet plugin development

Generating Python projects requires Poetry: OSX / Linux:

curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -

Windows (Powershell):

(Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py -UseBasicParsing).Content | python -

(More on how to install Poetry)

Generate a new beet project

yo beet

Features

Datapack boilerplate

datapack
└╴data
  ├╴minecraft
  │ └╴tags
  │   └╴functions
  │     ├╴load.json # Registers 'load' function
  │     └╴tick.json # Registers 'tick' function
  └╴<authorNamspace>
    └╴functions
      └╴<projectNamespace>
        ├╴tick.mcfunction # Called once every tick
        └╴load.mcfunction # Called after datapack is (re)loaded

To prevent naming conflicts between datapacks, all your functions, advancements, etc are located in the unique namespace <authorNamespace>:<projectNamespace>. E.g. if the author is Oran9eUtan and the project name is Teleporter, the load function can be called like this: function oran9eutan:teleporter/load

Resourcepack boilerplate

resourcepack
├╴assets
│ ├╴.mcassetsroot
│ └╴minecraft
│   ├╴models
│   └╴textures
└╴pack.png

Github Releases

npm.io

Automatically generates releases of your data-/resourcepacks on Github.

.github
└╴workflows
  └╴release.yml

How to create a new release: 1. Push/Pull-Request to the release branch on Github 2. The release action gets automatically triggered 3. semantic-release analyses commits to determin if a new version is required 4. semantic-release bumps version, updates CHANGELOG.md, runs beet -c beet-release.json build and creates a new Github release

(More on Github Actions)

Available commands

# Generate new beet project
yo beet [project-name]
    --datapack       # Generate datapack
    --resourcepack   # Generate resourcepack
    --license        # Include a license
    --git            # Initialize git repository
    --python         # Create a Python project

# Only generate datapack
yo beet:datapack

# Only generate resourcepack
yo beet:resourcepack

Contributing

Generator structure

A yeoman generator consists out of multiple sub-generators composed together. Each of them has their own directory in generators, the default beeing generators/app. Each sub-generator can be run like so: yo beet:<sub-generator>.

# Directory structure:
generators/
├─app
├─datapack
├─git
├─poetry
└─resourcepack

Test the generator

To try out the generator during development, run this command from the root of the project. It installs your local files as a symlinked global module.

npm link

To remove it run this command from the root directory of the project.

npm unlink generator-beet

License

MIT © Oran9eUtan