Skip to content

fix(scripts): use namespace import for js-yaml - #1723

Merged
jth-nw merged 1 commit into
devfrom
fix/js-yaml-namespace-import
Oct 16, 2026
Merged

jth-nw merged 1 commit into
devfrom
fix/js-yaml-namespace-import

Conversation

@jth-nw

@jth-nw jth-nw commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

js-yaml 5.x has no default export, so `import yaml from 'js-yaml'` throws `SyntaxError: The requested module 'js-yaml' does not provide an export named 'default'`. This fails the `test-scripts` job on the Dependabot bumps (#1717, #1720), which also skips `vale-autofix`.

Changes the import to `import * as yaml from 'js-yaml'` in:

  • `scripts/quality/gen-lint-digest.mjs`
  • `scripts/quality/lib/dale.mjs`
  • `scripts/doc-draft/slop.mjs`

The namespace import works on 4.x and 5.x. `load` and `dump` are still exported in 5.4.3, and `npm run test:scripts` passes on both 4.3.2 and 5.4.3. This PR does not bump the dependency. The Dependabot PRs can rebase onto it.

🤖 Generated with Claude Code

js-yaml 5.x has no default export. The namespace import works on 4.x and 5.x.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@jth-nw
jth-nw deployed to development October 16, 2026 20:26 — with GitHub Actions Active
@github-actions

Copy link
Copy Markdown
Contributor

Code Review

No issues found.

  • The three changed files only call yaml.load. js-yaml exports load as a named export in 4.x (dist/js-yaml.mjs) and in 5.x, so import * as yaml works on both versions.
  • No other file in the repo outside node_modules imports or requires js-yaml, so no default import is left that would break on 5.x.
  • The change doesn't touch the build, the KB copy pipeline, Docusaurus config, or workflows.

@jth-nw
jth-nw merged commit 4e190f5 into dev Oct 16, 2026
11 checks passed
@jth-nw
jth-nw deleted the fix/js-yaml-namespace-import branch October 16, 2026 21:59

This branch was successfully deployed

1 active deployment
development — 426137f2 Deployed Oct 16, 2026 by jth-nw via build-and-deploy #4588
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant