Build with Zy

Zy projects and tests

zy init my-app
cd my-app
zy check
zy run
zy test

init creates zy.json, main.zy, and tests/main_test.zy, and refuses to overwrite those paths. run and check use the nearest project’s entry when no filename is supplied. zy by itself continues to print help.

Manifest

{
  "schema": 1,
  "name": "my-app",
  "version": "0.1.0",
  "entry": "main.zy",
  "tests": "tests",
  "dependencies": {}
}

Names use lowercase letters, numbers, hyphens or underscores and start with a letter. Versions use major.minor.patch with an optional prerelease suffix. Entry/test paths stay inside the project and use forward slashes. Metadata is limited to 1 MiB. Unknown metadata fields are rejected.

Test command

Discovery recursively selects *_test.zy below the manifest’s test directory. Without a manifest it searches the supplied directory; a supplied .zy file can be run directly. Hidden directories, dependencies, and node_modules are skipped. Discovery does not follow symlinks and accepts at most 1,024 files.

fn test_network_membership() {
    assert(net.ip("2001:db8::1") in net.subnet("2001:db8::/64"))
}

File-scope test_ functions must have unique names and no parameters. Each runs with fresh interpreter and imported-module state; file initialization runs before each test. Files with only top-level assertions count as one script test. Tests can perform side effects; keep fixtures separate from live application resources. State isolation does not reset files, external services, or process environment.

zy test --timeout=5s [path] sets a positive deadline per file, including its initialization and named tests. The default is five seconds. Failing files do not prevent subsequent files from running. No discovered tests is a failure. Exit codes follow normal CLI conventions: 0 success, 1 failure, 2 invalid invocation.

Local dependencies

From a project, zy add ../my-package installs a self-contained local package that has its own zy.json. It snapshots .zy sources into .zy/deps/<package-name>/ and records their version and per-file SHA-256 hashes in zy.lock. Changes to the original directory do not change the installed copy.

import "./.zy/deps/my-package/main.zy" as package

Run, check, test, and serve verify installed source hashes before executing. Commit zy.json, zy.lock, and .zy/deps/ together. Imports remain explicit relative paths; this release has no registry, network download, dependency solver, transitive installation, upgrade/remove commands, or compiled app build. Packages with dependencies must be made self-contained before installation. Package imports may not escape their source snapshot. Symlinks are rejected. Source count/size follow the existing 128-file/8-MiB module bounds per snapshot.

The lockfile detects changes against the committed snapshot; it does not authenticate a package publisher. Installing a package never executes its code.

Found something to improve?Edit this page on GitHub ↗
Search guides, language features, and APIs ↵ to open first result