Skip to content

Commit

Permalink
Fix missing files check for extensions
Browse files Browse the repository at this point in the history
closes #79
  • Loading branch information
bluwy committed Oct 20, 2023
1 parent a7e82db commit ca0ecfe
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ export async function publint({ pkgDir, vfs, level, strict, _packedFiles }) {
}
try {
const content = await vfs.readFile(path + ext)
if (pkgPath && _packedFiles && !_packedFiles.includes(path)) {
if (pkgPath && _packedFiles && !_packedFiles.includes(path + ext)) {
fileNotPublished(pkgPath)
}
return content
Expand Down
Empty file.
6 changes: 6 additions & 0 deletions pkg/tests/fixtures/not-missing-files/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "publint-not-missing-files",
"version": "0.0.1",
"private": true,
"main": "index"
}
2 changes: 2 additions & 0 deletions pkg/tests/playground.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ testFixture('missing-files', [

testFixture('no-exports-module', [])

testFixture('not-missing-files', [])

testFixture('exports-module', ['EXPORTS_MODULE_SHOULD_PRECEDE_REQUIRE'])

testFixture('publish-config', ['FILE_DOES_NOT_EXIST', 'USE_EXPORTS_BROWSER'])
Expand Down

0 comments on commit ca0ecfe

Please sign in to comment.