This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
# Run tests
npm test
# Run a single test file
npx mocha --require test/fixtures/index.js test/boot.spec.js
# Lint (auto-fixes)
npm run lint
# Coverage
npm run coverage
# Build browser bundles
npm run buildThis is an ES module ("type": "module") npm package (@alt-javascript/boot) that provides application bootstrap utilities for the alt-javascript ecosystem.
Boot.js— Static utility class. Detects environment (Node/browser), resolves config from global scope or arguments, sets upglobal.boot.contexts.rootwith{config, loggerFactory, loggerCategoryCache, fetch}.Boot.test()uses aCachingLoggerFactoryto suppress log output during tests.Application.js— Thin async wrapper overBoot. CallsBoot.boot()then dynamically imports@alt-javascript/cdi/ApplicationContextto create a full DI container viaapplicationContext.lifeCycle().index.js— Named exports:Application,Boot,boot,root,test(static methods bound fromBoot), plus re-exportsconfigfrom@alt-javascript/config.index-browser.js/Boot-browser.js/Application-browser.js— Browser variants bundled by rollup intodist/.
@alt-javascript/config— providesValueResolvingConfig,EphemeralConfig,ConfigFactory@alt-javascript/logger— providesLoggerFactory,CachingLoggerFactory,LoggerCategoryCache@alt-javascript/cdi— providesApplicationContext(lazy-imported inApplication.run())
Boot.boot() writes to global.boot.contexts.root (or window.boot.contexts.root in browser). Boot.detectConfig() auto-detects config from: explicit argument → global config variable → window.config. Tests reset this via global.boot = undefined after each case.
test/fixtures/index.js is the mocha --require file. It calls Boot.test({config}) using the node-config package (from config/ directory), which boots with CachingLoggerFactory to suppress noisy log output during test runs.
Rollup produces two browser bundles from dist/:
alt-javascript-boot-esm.js— ES module bundle (input:index-browser.js)alt-javascript-application-iife.js— IIFE bundle exposingApplicationglobally (input:Application-browser.js)