add multi-document yaml read util function

Open
#82 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
typescript
Domain
tooling

Research direction

Start in src/utils/Path.ts at Path.readYAML, which currently fails when skaffold.yaml contains multiple documents. Trace the skaffold_yaml autodetection path shown in the error and determine the expected result for a multi-document file. Done means autodetection no longer raises the single-document SyntaxError for the reported skaffold case.

Written by the indexing model from the issue text.

Description

Currently pkgxdev is failing to autodetect skaffold when skaffold.yaml is having multiple documents with following error:

╰─ z skaf                                                                                                            ─╯
-deno.land -deno^2 -nodejs.org
error: Uncaught (in promise) SyntaxError: Found more than 1 document in the stream: expected a single document
    throw new SyntaxError(
          ^
    at parse (https://jsr.io/@std/yaml/1.0.5/parse.ts:87:11)
    at Path.readYAML (https://raw.githubusercontent.com/pkgxdev/libpkgx/refs/tags/v0.20.1/src/utils/Path.ts:405:14)
    at eventLoopTick (ext:core/01_core.js:177:7)
    at async skaffold_yaml (file:///Users/vkumbhar94/.pkgx/pkgx.sh/dev/v1.5.0/share/pkgx/dev/src/sniff.ts:263:18)
    at async default (file:///Users/vkumbhar94/.pkgx/pkgx.sh/dev/v1.5.0/share/pkgx/dev/src/sniff.ts:61:11)
    at async default (file:///Users/vkumbhar94/.pkgx/pkgx.sh/dev/v1.5.0/share/pkgx/dev/src/dump.ts:6:17)
    at async file:///Users/vkumbhar94/.pkgx/pkgx.sh/dev/v1.5.0/share/pkgx/dev/app.ts:48:7
Caused by: "skaffold-modules/skaffold.yaml"
Dominant language
TypeScript
Stars
64
Forks
12
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pkgxdev/libpkgx

All issues in pkgxdev/libpkgx

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.