Development
Requires Node 20, Lando 3.21+, Bash and jq. The shell-script tests invoke Bash and use jq on the host.
git clone https://github.com/lando/upsun.git && cd upsun
npm install
npm test # lint + typecheck + unit tests
npm run test:leia # integration tests in examples/Point an app at your checkout with a .lando.local.yml:
plugins:
"@lando/upsun": /path/to/upsunLayout
See Architecture. The pure modules (lib/config, lib/env.js, lib/mapping, lib/routes.js) are unit tested against fixtures in test/fixtures; builders/upsun.js, app.js and index.js only glue.
dev/ holds host-only maintainer scripts and is excluded from the npm package. scripts/ holds namespaced container helpers mounted at /helpers/.
Run npm run typecheck for JavaScript type checks over jsconfig.json. It fails on repository and configuration errors, excluding diagnostics from dependency files under node_modules. npm run typecheck:full includes dependency diagnostics and preserves the compiler's exit status. Keep shared type definitions in co-located .types.js files and reference them with JSDoc import() types. Typecheck runs in npm test and in the cross-platform unit-test CI job.
Adding or updating a service mapping
- Bundled Lando plugins: edit
lib/mapping/services.jsand refresh the version tables withnode dev/update-versions.js. The generator reads installed plugins fromLANDO_PLUGINS_DIR, defaulting to~/.lando/plugins/@lando. - Other images: add an entry to the
COMPOSEtable in the same file. - Refresh Upsun lifecycle metadata and verified Docker Hub pins with
node dev/update-upsun-registry.js. This dev-only generator writeslib/mapping/upsun-registry.js; keep the generated data with your changes.UPSUN_META_REFselects the upsun/meta ref (defaultmaster).UPSUN_META_DIRreadsresources/image/registry.jsonfrom a local checkout;UPSUN_REGISTRY_OUTPUToverrides the output path. Docker Hub verification still uses the network. Output has no timestamps; unavailable pins are printed to stderr. - Add a case to
test/mapping-services.spec.jsand, if user-visible, an example underexamples/with a Leia README.
YAML dependency
js-yaml is on major version 4. The !archive and !include custom types in lib/config/yaml.js are built with yaml.Type and DEFAULT_SCHEMA.extend; keep new tags on that API.