NPM scripts
NPM scripts for building, serving, validating, and maintaining the OpenTelemetry website.
Script definitions live in the repository root
package.json.
Run any script with npm run <script-name>. Scripts whose names start with _
are internal helpers and are not intended to be run directly.
Default vs
:all script variantsThe check, fix, and test scripts run the most commonly
needed subscripts for each action. To run every subscript, use the *:all
variants:
check:allfix:alltest:all
Build and serve
| Script | Description |
|---|---|
build:full | Build the full site. For details, see Build kinds. |
build:lean | Do a lean build of the site. For details, see Build kinds. |
build:preview | Full build with minification (e.g. for Netlify preview). |
build:production | Production Hugo build with minification. |
build | Build the site. Defaults to lean; see Build kinds. |
clean | Run make clean. |
serve:hugo | Start Hugo server with in-memory render. |
serve:netlify | Start Netlify Dev using Hugo. |
serve | Start Hugo dev server (default; full render). |
Checking
| Script | Description |
|---|---|
check:all | Run all check scripts in sequence. |
check:code-excerpts | Check code excerpts, fail if updates needed. |
check:codeowners | Verify CODEOWNERS locale section matches the registry. |
check:collector-sync | Run collector-sync checks. |
check:expired | List expired content (by front matter). |
check:filenames | Validate file naming & detect obsolete files/folders. |
check:format | Prettier and prose-wrap checks. |
check:i18n | Validate localization front matter (default_lang_commit). |
check:l10n | Run localization checks. |
check:links:diff | Lychee link check of changed files only (pilot). |
check:links:htmltest | Link check the whole site with htmltest; lean build first. |
check:links:lychee | Lychee link check of the whole site; lean build first. |
check:links | Link check the whole site (htmltest, default); lean build 1st. |
check:markdown:specs | Markdown lint for spec fragments in tmp/. |
check:markdown | Markdown lint (content and projects). |
check:registry | Validate registry YAML under data/registry/. |
check:spelling | cspell over content, data, and layout Markdown. |
check:text | textlint over content and data. |
check | Run the most commonly needed check scripts in sequence. |
Fixing
| Script | Description |
|---|---|
fix | Run the most commonly needed fix scripts. |
fix:code-excerpts | Refresh code excerpts. |
fix:codeowners | Regenerate CODEOWNERS locale section from the registry. |
fix:all | Run all fix scripts. |
fix:format | Apply Prettier and trim trailing spaces. |
fix:format:staged | Format only staged files. |
fix:i18n | Add/fix i18n front matter (fix:i18n:new, fix:i18n:status). |
fix:l10n | Apply localization fixes. |
fix:markdown | Fix Markdown lint issues and trailing spaces. |
fix:refcache | Prune refcache and re-run link check (updates refcache). |
fix:refcache:refresh | Prune refcache by count. |
fix:submodule | Pin submodule revisions (same as pin:submodule). |
fix:filenames | Rename files & remove obsolete files/folders. |
fix:dict | Sort cspell word lists and normalize front matter. |
fix:expired | Delete files reported by check:expired. |
fix:text | Run textlint with –fix. |
fix:collector-sync:lint | Run ruff with –fix in collector-sync. |
format | Alias for Prettier write (content and nowrap paths). |
Submodules and content
| Script | Description |
|---|---|
code-excerpts | Refresh code excerpts. DEPRECATED: use fix:code-excerpts or check:code-excerpts. |
cp:spec | Copy spec content (content-modules). |
get:submodule | Init/update git submodules (set GET=no to skip). |
pin:submodule | Pin submodule revisions (optional PIN_SKIP). |
schemas:update | Update OpenTelemetry spec submodule and content. |
update:submodule | Update submodules to latest remote and fetch tags. |
Test and CI
| Script | Description |
|---|---|
diff:check | Warn if working tree has uncommitted changes. |
diff:fail | Fail if working tree has changes (e.g. after build). |
fix-and-test:all | All fixes (incl. i18n), then checks; links checked once.1 |
netlify-build:preview | build:preview then diff:check. |
netlify-build:production | build:production then diff:check. |
test-and-fix | Run fix scripts (excluding i18n/refcache/submodule), then checks. |
test:all | Runs test:base then test:compound-tests. |
test:base | Base tests (same as check). |
test:collector-sync | Collector-sync tests. |
test:compound-tests | Runs compound test:*-* scripts.2 |
test:edge-functions:live | Optional node:test live suite; supports --help. |
test:edge-functions | Node test runner over netlify/edge-functions/**/*.test.ts. |
test:local-tools | Node test runner for scripts/**/*.test.mjs.2 |
test:local-tools:lychee | Lychee-binary slice of test:local-tools (see Notes). |
test:public | Runs the tests/public/ checks over the built site.2 |
test | Run the most commonly needed tests. |
Utilities
| Script | Description |
|---|---|
seq | Run given script names in sequence; exit on first failure. |
all | Run all given scripts, then exit with failure if any failed. |
locale-auto-merge | Locale auto-merge helper CLI (--help). |
prepare | Install step: get:submodule, then Docsy theme npm install. |
prebuild:* | Pre-build* hooks; each runs _prebuild. |
update:hugo | Install latest hugo-extended. |
update:packages | Run npm-check-updates to bump deps. |
generate:config:links | Generate git-ignored .htmltest.yml from .htmltest.base.yml |
generate:config:links:lychee | Generate git-ignored lychee.toml from lychee.base.toml. |
lychee:reseed | Rebuild .lycheecache from the refcache. |
log:build, log:check:links | Run the corresponding script and tee output to tmp/. |
Notes
- Refcache maintenance is htmltest-specific. For details, see Refcache.
- Lychee link check (pilot). The
:lycheeand:diffscripts run Lychee as a faster alternative to htmltest, mirroring its coverage. They generatelychee.tomland seed.lycheecachefrom the refcache automatically;lychee:reseedrefreshes that cache. Lychee runs as a non-blocking CI pilot while it’s evaluated in #10449. test:local-tools:lycheeis the subset oftest:local-toolsthat needs thelycheebinary (behavioral fragment- and config-checking tests). Those tests skip when the binary is absent, sotest:local-toolsalready covers them in the general test job; the trailing:lycheekeeps this script out oftest:compound-tests(which matchestest:*-*) so the suite isn’t run twice. The link-check CI job installs lychee and runs this script to exercise them for real.allruns every listed script even when one fails, then exits with a non-zero status if any failed.
The housekeeping default: runs
fix:refcache(prune, then link check) after the content fixes; uses the keep-goingallrunner so every fix is captured. The check phase excludescheck:links(fix:refcachecovers it) andcheck:i18n(redundant afterfix:i18nrecords drift status). See Housekeeping. ↩︎These scripts follow the test-script naming conventions; see Test categories. ↩︎ ↩︎ ↩︎