@velo/editor (0.3.0)

Published 2026-10-15 12:27:24 +02:00 by r59q

Installation

@velo:registry=
npm install @velo/editor@0.3.0
"@velo/editor": "0.3.0"

About this package

@velo/editor

Crownfall's domain-level map authoring operations. The shared document contract and validator come from the runtime dependency @velo/crown-base.

paintTerrain(document, { x, z, width, depth, material }) paints a cell-aligned rectangle in the existing material layer. Coordinates and dimensions are whole metres; material indexes TERRAIN_MATERIALS. It returns the shared MapDocumentResult: a validated, independently owned document or a MapArtifactError with field paths. It never mutates the input, clips an out-of-bounds rectangle or wraps an invalid byte. Successful operations increment field.version once, including repainting an existing material. The shared validator checks catalogue values, reserved flags, document content and revision overflow. All other terrain, site, instruction and asset-reference data is preserved; artifact, schematic and generator versions remain unchanged.

The package owns no UI, file I/O or renderer. See the game's controlled authoring view for composition. Repository TypeScript/Vite aliases resolve the public base import to local source, while the standalone package uses its declared registry dependency.

Focused checks from the repository root:

npx tsx --test tests/editor-package.test.ts games/crownfall/tests/map-authoring.test.ts

Build

From this directory, install the package's development dependency and compile the TypeScript:

npm install
npm run build

The compiler writes JavaScript, source maps, and type declarations to dist/. The package tarball contains that output and this README.

Forgejo npm registry

The package is published to the Forgejo npm registry owned by velo:

https://git.amhk.dk/api/packages/velo/npm/

The package is public, so installing it does not require a Forgejo access token. Configure npm to use the Forgejo registry for the @velo scope, either in your project .npmrc:

@velo:registry=https://git.amhk.dk/api/packages/velo/npm/

Then install the library in that project:

npm install @velo/editor

Publishing requires a Forgejo access token with package write permission. To publish manually, first build and then publish against the Forgejo registry:

npm run build
npm publish --registry=https://git.amhk.dk/api/packages/velo/npm/

The Publish editor workflow publishes on pushes to main that change this directory, and can be run manually. It picks the next 0.x.0 version above those already in the registry, so Forgejo never sees a duplicate. The PACKAGE_REGISTRY_TOKEN Actions secret must belong to an account with package write access.

Dependencies

Dependencies

ID Version
@velo/crown-base ^0.3.0

Development dependencies

ID Version
typescript ^5.9.3
Details
npm
2026-10-15 12:27:24 +02:00
8
UNLICENSED
3.5 KiB
Assets (1)
Versions (8) View all
0.8.0 2026-10-18
0.7.0 2026-10-18
0.6.0 2026-10-18
0.5.0 2026-10-15
0.4.0 2026-10-15