Advanced: split-package build target

Native application path: gRPC for live data and edits; PMTiles, GeoParquet and COG through the CDN. Start there for browser gRPC-Web setup, signed private URLs and regeneration after changes. OGC API and GeoServices REST examples below are compatibility workflows.

For nearly all consumers the canonical install is the single @honua/sdk-js package described in INSTALL.md. The repository also carries an opt-in build target that produces five focused npm packages from the same source tree, for downstream packagers and organizations that only want a subset of the surface.

The experimental @honua/sdk-js/geoparquet/node factory ships only in the canonical SDK. Its node export condition excludes browser resolution; the optional @duckdb/node-api peer is absent from all five split packages.

Runtime tarball ownership and limits

The main SDK tarball ships compiled runtime modules and declarations, the two browser bundles, licenses, package metadata, the raster registry, supported-surface metadata, public contract schemas, and migration compatibility guidance. Migration implementation ships in @honua/honua-migrate; the legacy SDK subpath and command forward to that package. The web components ship only in @honua/app-platform (@honua/app-platform/web-components); no @honua/sdk-js entry point reaches them, so the runtime tarball leaves dist/src/web-components out. Sample catalogs and consumer evidence stay in the repository and independently published sample bundles. Gallery consumers resolve their handoff projections from commit-pinned source URLs; sample archives carry their own content hashes and publication attestations. Browser source maps remain build artifacts and are excluded from the runtime package.

Run npm run build, npm run build:browser, then npm run verify:runtime-tarball to audit the real packed artifact. CI and publishing run the same gate. test-results/runtime-tarball-budget.json records packed and unpacked bytes, file ownership, tarball integrity, package version and Node/npm versions. CI retains this receipt as the runtime-tarball-budget artifact. The gate rejects unexpected content and missing runtime, license or metadata files as well as size regressions.

The audited npm @honua/sdk-js@0.1.14 baseline is 12,581,417 packed bytes, 39,118,106 unpacked bytes and 2,189 files. Its sample material alone occupies 11,272,832 unpacked bytes. The reduced ceilings are 4,500,000 packed and 22,000,000 unpacked bytes, declared with the immutable baseline identity in config/runtime-tarball-budget.v1.json. Bundle execution costs are measured separately by the First Map installed-consumer gate; tarball reduction does not imply a faster endpoint-to-map journey.

The clean packed-development measurement at source 5aac8654325f20845dc37a386f0f8999d683bb83 was 4,039,866 packed bytes and 19,606,974 unpacked bytes across 2,074 files: a 67.9% packed and 49.9% unpacked reduction from the audited registry baseline. The receipt recorded owner inventory, integrity and toolchain identity. Ceilings leave approximately 11–12% headroom over this measured result.

Packages produced by the split build

Package Subpath equivalent What it contains
@honua/sdk @honua/sdk-js/honua + most stable subpaths HonuaClient, not createHonua. Also the shared contract, query planner, offline-region contract, and plan-bound MapLibre adapter
@honua/sdk-client-compat @honua/sdk-js/client-compat Web mapping compatibility layer, including the geometry engine shim
@honua/react @honua/sdk-js/react React provider, hooks, and map components (optional react / react-dom peers)
@honua/geometry @honua/sdk-js/geometry Curated turf/proj4 client-side geometry ops + reprojection
@honua/app-platform (evicted from @honua/sdk-js) Application-platform surfaces — app-shell/workspace/scene state, studio + generated-app builder contracts, operator controllers, native controls / web components, and hosted-product clients (control-plane, collaboration, share, operate, replica-sync). See decisions/scope-split-and-1.0.md.

Companion packages that carry a copy of the contract declare the exact @honua/sdk version as a required peer. Their local contract forwards capability-profile recognition and HonuaClient to that peer, so an immutable profile or HonuaClient instance created by the core SDK remains valid across React, app-platform, geometry, and client-compat boundaries without exposing the profile-registration authority or duplicating the client class declaration.

Compatibility package import update

The standalone compatibility package now uses @honua/sdk-client-compat. Update the package dependency and keep using the neutral SDK subpath:

npm install @honua/sdk-client-compat
import { FeatureLayerCompat } from "@honua/sdk-js/client-compat";

The former standalone package name is not shipped as an alias. The former compatibility subpath is removed. Import @honua/sdk-js/client-compat.

A new 2D map imports createHonua from @honua/sdk-js and maplibreRenderer from @honua/sdk-js/runtime. Server attach uses HonuaClient from @honua/sdk-js/honua. An ArcGIS app uses @honua/sdk-client-compat and @honua/honua-migrate. Widget paint registers @honua/app-platform/web-components. @honua/sdk is HonuaClient, not createHonua.

The migration package is no longer a generated SDK split. It is built from the honua-migrate repository, while @honua/sdk-js/migration remains a temporary forwarder. src/migration/codemod.ts in this repository is the in-repo suite, not the npm program. See the transition policy.

Renamed exports in 0.3.0

These exports were renamed in 0.3.0. Third-party module names and GeoServices REST wire values are unchanged. @honua/honua-migrate 0.3.0-beta.0 still imports esriConfig, esriRequest, resetEsriConfig and getEsriConfigHonuaInterceptors, so those four stay on @honua/sdk-js/client-compat as deprecated aliases in 0.4.0. Migrate to the new names below; no removal version is committed here. Every other former name has no alias.

Entry point Former name New name
@honua/sdk-js/client-compat esriConfig clientConfig
@honua/sdk-js/client-compat esriRequest clientRequest
@honua/sdk-js/client-compat resetEsriConfig resetClientConfig
@honua/sdk-js/client-compat getEsriConfigHonuaInterceptors getClientConfigHonuaInterceptors
@honua/sdk-js/client-compat createEsriRequestInterceptors createClientRequestInterceptors
@honua/sdk-js/client-compat createArcGisTokenInterceptor createClientTokenInterceptor
@honua/sdk-js/client-compat ArcGisTokenInterceptorOptions ClientTokenInterceptorOptions
@honua/sdk-js/client-compat EsriBeforeRequestParams ClientBeforeRequestParams
@honua/sdk-js/client-compat EsriConfigCompat ClientConfigCompat
@honua/sdk-js/client-compat EsriConfigRequestCompat ClientConfigRequestCompat
@honua/sdk-js/client-compat EsriRequestCompatOptions ClientRequestCompatOptions
@honua/sdk-js/client-compat EsriRequestCompatResponse ClientRequestCompatResponse
@honua/sdk-js/client-compat EsriRequestInterceptorCompat ClientRequestInterceptorCompat
@honua/sdk-js/client-compat EsriRequestInterceptorHandle ClientRequestInterceptorHandle
@honua/sdk-js/client-compat EsriRequestInterceptorRegistry ClientRequestInterceptorRegistry
@honua/sdk-js/client-compat EsriRequestOptionsLike ClientRequestOptionsLike
@honua/sdk-js/client-compat EsriRequestResponseTypeCompat ClientRequestResponseTypeCompat
@honua/sdk-js/client-compat EsriUrlPattern RequestUrlPattern
@honua/sdk-js/client-compat FeatureFilterEsriProperties FeatureFilterProperties
@honua/sdk-js/client-compat EsriAreaUnit GeoServicesAreaUnit
@honua/sdk-js/client-compat EsriLinearUnit GeoServicesLinearUnit
@honua/sdk-js/honua EsriColor GeoServicesColor
@honua/sdk-js/honua EsriEnvelope GeoServicesEnvelope
@honua/sdk-js/honua EsriFieldType GeoServicesFieldType
@honua/sdk-js/honua EsriGeometry GeoServicesGeometry
@honua/sdk-js/honua EsriGeometryType GeoServicesGeometryType
@honua/sdk-js/honua EsriMultipoint GeoServicesMultipoint
@honua/sdk-js/honua EsriPoint GeoServicesPoint
@honua/sdk-js/honua EsriPolygon GeoServicesPolygon
@honua/sdk-js/honua EsriPolyline GeoServicesPolyline
@honua/sdk-js/honua EsriSpatialRel GeoServicesSpatialRel
@honua/sdk-js/honua esriColorToCss geoServicesColorToCss
@honua/sdk-js/honua esriFeatureToGeoJSON geoServicesFeatureToGeoJSON
@honua/sdk-js/honua esriGeometryToGeoJSON geoServicesGeometryToGeoJSON
@honua/sdk-js/geometry esriFeatureToGeoJson geoServicesFeatureToGeoJson
@honua/sdk-js/geometry esriToGeoJson geoServicesToGeoJson
@honua/sdk-js/geometry geoJsonToEsri geoJsonToGeoServices
@honua/sdk-js/map esriFeaturesToGeoJson featuresToGeoJson
@honua/sdk-js/map esriGeometryToGeoJson featureServiceGeometryToGeoJson
@honua/sdk-js/webmap EsriColor GeoServicesColor
@honua/sdk-js/webmap esriColorToCss geoServicesColorToCss
@honua/sdk-js/webmap esriLineStyleToDashArray geoServicesLineStyleToDashArray
@honua/sdk-js/kepler keplerTypeForEsriFieldType keplerTypeForGeoServicesFieldType

Optional gRPC-Web runtime

REST and open-protocol consumers do not install the Buf/Connect runtime, and a production bundle of createHonua or HonuaClient does not resolve it. The gRPC adapter is loaded only after transport: "grpc-web" is selected, through a non-literal dynamic import, so Vite can build a REST client when the peers are absent. Node resolves those peers when they are installed and transport: "grpc-web" is selected. A browser bundler does not add the same specifiers to the bundle, because they are not static literals. Native browser applications instead import HonuaClient from @honua/sdk/grpc-web (or @honua/sdk-js/grpc-web). That opt-in entrypoint statically binds the runtime and adapters and always selects gRPC-Web. Pass that client to connect or createDataset to keep discovery, queries and editing on the native path. When using the default entrypoint in Node, a missing peer throws HonuaOptionalGrpcPeerError from the gRPC call; Connect and RPC failures are not relabeled as a missing install. The browser entrypoint requires those peers at build time. The connect facade's PMTiles reader uses the same non-literal import, so a REST production build does not resolve the optional pmtiles package either. Node still loads it when an archive is described. @honua/sdk-client-compat declares maplibre-gl as an optional peer because compat map views load it by name. A REST Vite build can omit that renderer; installing it still includes it in the bundle.

config/installed-package-certification.v1.json still lists @bufbuild/protobuf, @connectrpc/connect, and @connectrpc/connect-web in consumerDependencies. That pin is a temporary sample workaround for the published 0.1.9-beta.0 tarball, not the packaging contract.

A consumer that selects transport: "grpc-web" must install the optional peers alongside the split SDK:

npm install @honua/sdk @bufbuild/protobuf @connectrpc/connect @connectrpc/connect-web

How to build the split tarballs

# from the repo root
npm install
npm run build
npm run build:split-packages
# tarballs land in dist/packages/* — npm pack each as needed
npm run pack:split-packages

Why the split exists

When not to use it

If you are writing an application that consumes the Honua server directly, install @honua/sdk-js instead. The split packages are not the recommended consumer install — they exist for packaging workflows, not for end users.

The monolithic package root is a reviewed common workflow, not an alias for all split-package surfaces. Advanced imports use the focused subpaths in INSTALL.md; every transition-era root symbol has an exact replacement in the generated root import migration table.

npm run samples:contract:pack independently packs samples/dist, the versioned sample-consumer schemas, and self-contained consumer fixtures and archived receipts. Its private staging manifest derives its version from the SDK; there is no second release version to maintain. The output under .artifacts/sample-contract/ uses the tarball SHA-256 in its filename and records the source commit, dirty state, SHA-512 integrity and file inventory. The runtime SDK does not depend on this artifact. The existing sample app bundles still carry the runnable applications separately.

PR CI retains the contract archive as a downloadable artifact for 90 days. The content-addressed sample-bundle publication workflow also builds it from two independent checkouts of the same immutable source, requires identical archive bytes and receipts, and retains that separate artifact for 90 days. A source checkout can regenerate it after that retention window. This is a sample-content artifact, not a new npm registry package.

Focused validation graph reduction

The PROJJSON validator shares referenced schemas instead of repeatedly inlining them. Differential validation against the pinned official schema preserves both acceptance and useful failure diagnostics across 972 valid and mutated CRS cases. Exact-head compiled artifact measurements with esbuild 0.28.1 reduced /source-schema from 901,833 to 833,853 minified bytes and from 201,663 to 196,387 gzip bytes. The 880,000 / 200,000 byte ceilings deliberately preserve that improvement: the previous graph fails both ceilings.

The recorded comparisons included producer fingerprints, toolchain and external-peer options. The generic First Map does not retain this validator, so this change makes no hero-path reduction claim. Its byte and CPU budgets are recorded in the installed First Map report. The bundle gate separately checks the actual generated validator path is absent from focused HonuaClient, connect, createHonua and FeatureLayerCompat consumers; existing optional renderer and RPC exclusion guards remain enforced.

@honua/app-platform installs its statically imported Terra Draw, MapLibre draw adapter, and PMTiles runtime dependencies automatically. Browser component consumers do not need to add those packages manually. Applications still supply maplibre-gl when using the MapLibre integration. The package verification gate bundles the web-components entrypoint from a clean external consumer to check this dependency closure.

Conditional exports in the sample matrix

samples/dist/capability-sample-matrix.v2.json records the full package export inventory, including the node condition on ./geoparquet/node. It never substitutes a browser default target for a Node-only module. Its coverage states continue to require the same qualification evidence as other entrypoints.

Existing site handoffs consume the v1 compatibility matrix. That projection contains only exports with a default target; its entrypoint dimensions and gap inventory use the same subset. It retains the digest of the complete package export input. Use v2 for the complete conditional export inventory. The published v1 schema and archived handoff integrity bindings remain unchanged.