Create a package

A package is a Wax project whose source and public names are ready for other projects to use.

Start with a library

Wax has no separate package scaffold. Create a directory with these files:

MyEasing/
  wax.json
  LICENSE
  Src/
    Easing.wax
{
  "name": "my-easing",
  "version": "1.0.0",
  "license": "MIT",
  "dependencies": {}
}

my-easing is a placeholder. Replace it with an available registry identity you want this package to keep.

Once published, a package name and version cannot be reused for different contents. Use namespaces to organize the declarations callers will import.

namespace Curves;

public fn Smooth(float progress) : float {
    return progress * progress * (3.0f - 2.0f * progress);
}

A consumer can install the package under a local alias and import the public function from its namespace:

wax add SmoothCurves my-easing "^1.0.0"
import Smooth from SmoothCurves::Curves;

Add license material when appropriate

The license manifest field, LICENSE, and NOTICE files are optional. Wax includes them when present but does not interpret or validate the manifest value.

Pack locally

wax pack

pack checks the manifest and source tree and writes a reproducible archive named from the package name and version. To choose where it goes:

wax pack --output artifacts/easing-1.0.0.tgz

An existing output is never overwritten.

Packages may contain regular Src/**/*.wax, optional debugger sources under Queries/**/*.wax, wax.json, LICENSE, and NOTICE. Symbolic links, files that are not Wax source, unsafe paths, case collisions, and special filesystem entries are rejected. The combined source trees are bounded to 4,096 files, 8,192 total entries, and 16 MiB; metadata files are bounded to 256 KiB.

Check before publishing

Before publishing a new library, check its local source through a small application. From MyEasing, create a sibling smoke-test project and copy the library source into it:

wax new ../MyEasingCheck --yes
cp Src/Easing.wax ../MyEasingCheck/Src/Easing.wax

Replace MyEasingCheck/Src/App.wax with:

import Smooth from MyEasingCheck::Curves;

api fn Main() : int32 {
    return Smooth(0.5) == 0.5 ? 0 : 1;
}

Run that application, then return to the package:

cd ../MyEasingCheck
wax check
wax run
cd ../MyEasing
wax install
wax doctor --online

The smoke test exits zero when Smooth(0.5) is 0.5. Copy the current library source again after edits. This checks the local implementation before its first publication; it does not test a registry download or dependency alias.

wax check requires an application API entry point, so it rejects this public-function-only library when run directly in MyEasing. pack validates package structure and archive contents; it does not replace semantic checking through the smoke application. Inspect the archive created in Pack locally above. If the source changed since packing, choose a new output path; the old archive is never overwritten.

After signing in as described in the publishing guide, add --auth to wax doctor --online to verify the account too. Check the version and archive before publishing. Fixes require a new version; the registry will not replace an existing package version.

Continue with Publish a package when the archive is ready.