jac-packaging

Builds Jac projects into PyPI wheels and npm tarballs from jac.toml metadata.

Updated Jul 26, 2026
One-click install
npx skills add https://github.com/PMN123/trapdoor --skill jac-packaging-pmn123
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: jac-packaging
Source: https://github.com/PMN123/trapdoor/tree/main/.agents/skills/jac-packaging
Command: npx skills add https://github.com/PMN123/trapdoor --skill jac-packaging-pmn123

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Turning a Jac project into a distributable package is error-prone: the default scaffold layout produces empty wheels, jac.toml keys have hyphen-vs-underscore traps, and jaclang must not be listed as a dependency. This Skill encodes the exact packaging rules so builds succeed on the first attempt. ## Core Features & Use Cases - Wheel and sdist builds: Runs jac build --as wheel from jac.toml alone, with correct package-directory layout, entry points, extras, and precompiled .jir bytecode collection. - npm publishing: Uses jac build --as npm to compile client modules to ES modules with package.json and .d.ts files, enforcing the pure-client sv-boundary rule. - Pitfall prevention: Catches common failures such as missing package directories, requires_python being silently dropped, string classifiers, and type-check gate rejections. - Use Case: You finished a Jac CLI tool and want it on PyPI. This Skill restructures the project into a package directory, writes a valid jac.toml with console-script entry points, builds the wheel, and uploads it with twine. ## Quick Start Package my Jac project as a wheel with a CLI entry point and publish it to TestPyPI using twine.

Frequently Asked Questions about jac-packaging

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I publish a Jac project to PyPI?

Run `jac build --as wheel` to produce a wheel and sdist from jac.toml, then upload with `twine upload dist/*`. There is no `jac publish` command; test on TestPyPI first with `twine upload --repository testpypi dist/*`.

How do I build an npm package from Jac code?

Run `jac build --as npm` to compile client modules to ES-module JavaScript with a generated package.json and .d.ts files, producing a tarball in dist/. Upload it with `npm publish dist/<name>-<version>.tgz --access public`.

Why is my Jac wheel empty or not importable?

The wheel build only collects a package directory whose name matches project.name in jac.toml; single top-level .jac files are never collected. The default `jac create` template puts main.jac at the root, so you must create a matching package directory yourself.

Should I add jaclang as a dependency in jac.toml?

No. jaclang is not a PyPI package; it is the host runtime supplied by the jac binary that runs your wheel. Consumers install your package with `jac install <pkg>` inside a jac-managed project, not a bare pip install.

Why does jac build fail with a type-check error?

jac build runs the whole-program type-check gate first and refuses to emit an artifact on failure. Fix the reported diagnostics, or pass `--no_typecheck` to skip the gate as a last resort.

Can npm packages built from Jac include server code?

No. A module with an sv import or call crosses a server boundary and the npm build fails, since npm packages must be pure client code. Keep server-coupled code in your application rather than the published library.