Skip to content

Commit

Permalink
[Fix] work around npm-packlist bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Dec 9, 2023
1 parent a03f3e8 commit 207e4e9
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 14 deletions.
5 changes: 5 additions & 0 deletions packages/list-exports/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,11 @@ async function getExports(packageDir, pkgData, nodeRange, problems) {
flatMap(
packedFiles,
(x) => {
// hack to work around npm-packlist bug
if (x.split('/').indexOf('node_modules') > -1) {
return [];
}

const resolved = resolveFrom(dirname(x), packageDir, rootAllExtensions);
return [
x,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"node": "*"
},
"problems": [
"`./node_modules/@types/parse5` has a `package.json`, but both its `main` and `index.js` do not exist!",
"`./package.json`: inside a conditions object, a files object (keys starting with `.`) is invalid"
],
"exports": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
"engines": {
"node": "*"
},
"problems": [
"`./node_modules/@types/parse5` has a `package.json`, but both its `main` and `index.js` do not exist!"
],
"problems": [],
"exports": {
"binaries": {},
"latest": "broken",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"node": "*"
},
"problems": [
"`./node_modules/@types/parse5` has a `package.json`, but both its `main` and `index.js` do not exist!",
"`./package.json`: inside a conditions object, a files object (keys starting with `.`) is invalid"
],
"exports": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
"engines": {
"node": "*"
},
"problems": [
"`./node_modules/@types/parse5` has a `package.json`, but both its `main` and `index.js` do not exist!"
],
"problems": [],
"exports": {
"binaries": {},
"latest": "experimental",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"node": "*"
},
"problems": [
"`./node_modules/@types/parse5` has a `package.json`, but both its `main` and `index.js` do not exist!",
"`./package.json`: inside a conditions object, a files object (keys starting with `.`) is invalid"
],
"exports": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"node": "*"
},
"problems": [
"`./node_modules/@types/parse5` has a `package.json`, but both its `main` and `index.js` do not exist!",
"`./package.json`: inside a conditions object, a files object (keys starting with `.`) is invalid"
],
"exports": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"node": "*"
},
"problems": [
"`./node_modules/@types/parse5` has a `package.json`, but both its `main` and `index.js` do not exist!",
"`./package.json`: inside a conditions object, a files object (keys starting with `.`) is invalid"
],
"exports": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
"engines": {
"node": "*"
},
"problems": [
"`./node_modules/@types/parse5` has a `package.json`, but both its `main` and `index.js` do not exist!"
],
"problems": [],
"exports": {
"binaries": {},
"latest": "pre-exports",
Expand Down

0 comments on commit 207e4e9

Please sign in to comment.