Skip to content
James Reynolds edited this page Nov 17, 2022 · 24 revisions

Welcome to the pantry.zero wiki!

Creating Packages

There are 2 ways of creating packages. You can create your own pantry, or you can contribute a package.

Create Your Own Pantry

The packages contained in your fork will be searchable when using tea/cli itself. Thus decentralizing the upkeep of the open source package graph.

Forks of specific pantries will also be able to inherit functionality from those pantries.

This is not built yet, but it’s a near term goal.

Contribute a Package

  • Fork pantry.extra.
  • Create a branch for your new package (git checkout -b example.com).
  • Complete step-by-step section.
  • Submit a pull request for your packages. Once they are stable and if otherwise deemed appropriate we will move them to pantry.core.

Step-by-step

Here is an example session starting from scratch. You should replace example.com with the domain of the package and replace "your.pantry" with the name of your pantry (assuming you renamed your fork). If you are in doubt about what domain to use, look at the existing names in pantry.core/projects and pantry.extra/projects.

sh <(curl https://tea.xyz)
mkdir pkgdev
cd pkgdev
git clone https://github.com/teaxyz/your.pantry.git
git clone https://github.com/teaxyz/cli.git
git clone https://github.com/teaxyz/pantry.core.git
mkdir your.pantry/projects/example.com
touch your.pantry/projects/example.com/package.yml

Edit your.pantry.git/projects/example.com/package.yml. More on that below.

export TEA_PANTRY_PATH="$PWD/your.pantry.git"
./pantry.core/scripts/build.ts example.com

Editing package.yml

The best way to get started is to find an existing package.yml that is as close to what you need and copying it. You've already downloaded pantry.core, download pantry.extra too.

git clone https://github.com/teaxyz/pantry.core.git

Also check out the Packaging Guide and package.yml documentation.

Test

Packages require a test YAML node. This script should thoroughly verify all the functionality of the package is working. You can run the test with:

pantry.core/scripts/test.ts pkg.com

tea requires all packages be relocatable and cross platform. Our CI will verify this for you. You can check locally by moving the installation from ~/.tea to another tea installation (eg. ~/scratch/tea§ and running the test again.

Now make a pull request! We’ll test on all platforms we support in the PR. If it passes both CI and review: we’ll merge!

§ TEA_PREFIX=~/scratch/tea sh <(curl tea.xyz)

After Your Contribution

We build “bottles” (tar’d binaries) and upload them to both our centralized bottle storage and decentralized IPFS.

tea automatically builds new releases of packages as soon as they are released (usually starting the builds within seconds). There is no need to submit PRs for updates.

Basics

Advanced

^^ Guides for specific build tools and scenarios

Appendix

Clone this wiki locally