Code Monkey home page Code Monkey logo

dpbuild's Introduction

dpbuild

A datapack bundling tool for combining multiple namespaces into a single datapack for easy distribution

Usage

Clone or download this repository and execute the script by running either ./dpbuild <args> or python dpbuild <args>. All datapacks must implement Lantern Load in order to bundle. See help text below for argument details.

usage: dpbuild [-h] [--zip] [--dest DEST] [--release] [--discover [DISCOVER ...]]
                   [--no-dep-tests]
                   datapack [dependencies ...]

A tool to bundle packs with different namespaces.

positional arguments:
  datapack              Datapack to bundle
  dependencies          Dependency datapacks or .zips to bundle into the main one

options:
  -h, --help            show this help message and exit
  --zip                 Compress the bundled datapack into a .zip file
  --dest DEST           Destination directory to copy bundled datapacks
  --release             Removes function/test paths and zips output
  --discover [DISCOVER ...]
                        Directories to discover Lantern Load datapack dependencies
  --no-dep-tests        Only applicable when not in release mode. Removes test functions from
                        bundled dependency packs.

Example

Suppose you have a datapacks directory containing your_dp which is a datapack that relies on dep1 and dep2.

datapacks
├── dep1
│   ├── data
│   │   └── dep1_ns
│   └── pack.mcmeta
├── dep2
│   ├── data
│   │   └── dep2_ns
│   └── pack.mcmeta
└── your_dp
    ├── data
    │   └── your_dp_ns
    │       └── functions
    └── pack.mcmeta

With dpbuild you can create a single directory or zip file with everything your datapack needs. The following command will bundle everything together and output in the test world datapacks folder.

./dpbuild your_dp --dest ~/.minecraft/saves/test-world/datapacks

The resulting bundled datapack at ~/.minecraft/saves/test-world/datapacks will be structured as follows,

test-world/datapacks
└── your_dp
    ├── data
    │   └── dep1_ns
    │   └── dep2_ns
    │   └── your_dp_ns
    │       └── functions
    └── pack.mcmeta

dpbuild's People

Contributors

dthigpen avatar

Watchers

 avatar

dpbuild's Issues

Fix dependency load order when bundling

For example:
Top level datapack's lantern load file:

// top_level
{
    "values": [
        "dt.inventory:load",
        "dt.array:load"
    ]
}
// dt.inventory
{
    "values": [
        "dt.array:load",
        "dep2:load"
    ]
}
// dt.array
{
    "values":[]
}

These dependencies should result in a final bundled load file of:

// top_level
{
    "values": [
        "dt.array:load",
        "dep2:load",
        "dt.inventory:load",
    ]
}

But instead we get a load file where dt.array:load comes after dt.inventory:load since it was specified after in the top level file

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.