Repository navigation
fix: bugs found while adding test coverage - #107
Merged
Merged
Conversation
A release in index.json with no files key made core throw, since files.available fell back to undefined and the links loop called Object.keys on it. It now falls back to an empty array.
The src case assigned files[0] twice, so the .tar.gz name was overwritten and only the .tar.xz was returned. It now lists both, like headers.
updateStaticNow stringified the DateTime and write() stringified it again, so every reader had to JSON.parse it a second time. The script now hands write() the DateTime, the snapshot is re-encoded, and the extra JSON.parse calls are gone.
The build scripts require @nodevu/core but static never listed it, so it only resolved when every workspace was installed. npm install -w static now links it.
Co-authored-by: botandbang <337765928+botandbang@users.noreply.github.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Draft
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes four bugs the new coverage tests turned up.
core: releases without files. A release in index.json with no
fileskey crashed core withCannot convert undefined or null to object, becausefiles.availablefell back toundefinedand the links loop calledObject.keyson it. It now falls back to[], so the release getsavailable: []and emptylinks. Addscore/test/files.js.parsefiles: source tarballs. The
srccase assignedfiles[0]twice, so the.tar.gzname was overwritten and only.tar.xzcame back. It now lists both, the same way headers does. Updatestest/data/expected.json. Core still depends on@nodevu/parsefiles@^0.0.3, so core's output won't change until that range is bumped.core: now.json.
updateStaticNow.jsstringified the DateTime and thenwrite()stringified it again, so the file held a quoted string inside a string. Every reader undid that withJSON.parse. The script now passes the DateTime straight towrite(). The snapshot is re-encoded, andcombos.js,dynamic-values.jsand ranges'emptyFields.test.jsread it directly.static: undeclared dependency. The build scripts require
@nodevu/core, but static's package.json never listed it, so they only worked after installing every workspace (as the nightly build does). It's now a devDependency, andnpm install -w staticlinks it.