Skip to content

Commit

Permalink
[Tests] add fixture with remapped folder
Browse files Browse the repository at this point in the history
[Tests] modify expected.json to match the expected content

[Tests] add fixture with conditions in directory export
  • Loading branch information
bgotink authored and ljharb committed Feb 22, 2024
1 parent 0f7478b commit 2af2b4b
Show file tree
Hide file tree
Showing 32 changed files with 2,008 additions and 12 deletions.
26 changes: 14 additions & 12 deletions packages/list-exports/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -536,18 +536,20 @@ function traverseExportsSubdir({
problems.add(`\`${lhs}\`: \`${rhs}\` is not a directory!`);
} else {
const subtree = rhs === './' ? legacy.tree : legacy.tree.get(rhs);
traverseExportsSubtree({
tree,
subtree,
problems,
packageDir,
packageExports,
mains,
dir: '.',
lhs,
rhs,
category,
});
if (subtree) {
traverseExportsSubtree({
tree,
subtree,
problems,
packageDir,
packageExports,
mains,
dir: '.',
lhs,
rhs,
category,
});
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{
"name": "ex-conditions-in-folder",
"version": "0.0.0",
"engines": {
"node": "*"
},
"problems": [],
"exports": {
"binaries": {},
"latest": "broken-dir-slash-conditions",
"broken-dir-slash-conditions": {
"import": {
".": "./mjs/index.mjs"
},
"require": {
".": "./cjs/index.js",
"./package.json": "./package.json"
},
"files": [
"./package.json",
"./cjs/index.js",
"./mjs/index.mjs"
],
"tree": {
"cjs": {
"index.js": [
"."
]
},
"package.json": [
"./package.json"
],
"mjs": {
"index.mjs": [
"."
]
}
}
},
"pre-exports": {
"import": {},
"require": {
".": "./cjs/index.js",
"./": "./cjs/index.js",
"./cjs": "./cjs/index.js",
"./index": "./index.js",
"./index.js": "./index.js",
"./package": "./package.json",
"./package.json": "./package.json",
"./cjs/": "./cjs/index.js",
"./cjs/index": "./cjs/index.js",
"./cjs/index.js": "./cjs/index.js",
"./cjs/utils": "./cjs/utils.js",
"./cjs/utils.js": "./cjs/utils.js",
"./mjs/index.mjs": "./mjs/index.mjs",
"./mjs/utils.mjs": "./mjs/utils.mjs"
},
"files": [
"./index.js",
"./package.json",
"./cjs/index.js",
"./cjs/utils.js",
"./mjs/index.mjs",
"./mjs/utils.mjs"
],
"tree": {
"index.js": [
"./index.js",
"./index"
],
"package.json": [
"./package.json",
"./package"
],
"cjs": {
"index.js": [
".",
"./",
"./cjs",
"./cjs/",
"./cjs/index.js",
"./cjs/index"
],
"utils.js": [
"./cjs/utils.js",
"./cjs/utils"
]
},
"mjs": {
"index.mjs": [
"./mjs/index.mjs"
],
"utils.mjs": [
"./mjs/utils.mjs"
]
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"name": "ex-conditions-in-folder",
"version": "0.0.0",
"engines": {
"node": "*"
},
"problems": [],
"exports": {
"binaries": {},
"latest": "broken",
"broken": {
"import": {},
"require": {
"./package.json": "./package.json"
},
"files": [
"./package.json"
],
"tree": {
"package.json": [
"./package.json"
]
}
},
"pre-exports": {
"import": {},
"require": {
".": "./cjs/index.js",
"./": "./cjs/index.js",
"./cjs": "./cjs/index.js",
"./index": "./index.js",
"./index.js": "./index.js",
"./package": "./package.json",
"./package.json": "./package.json",
"./cjs/": "./cjs/index.js",
"./cjs/index": "./cjs/index.js",
"./cjs/index.js": "./cjs/index.js",
"./cjs/utils": "./cjs/utils.js",
"./cjs/utils.js": "./cjs/utils.js",
"./mjs/index.mjs": "./mjs/index.mjs",
"./mjs/utils.mjs": "./mjs/utils.mjs"
},
"files": [
"./index.js",
"./package.json",
"./cjs/index.js",
"./cjs/utils.js",
"./mjs/index.mjs",
"./mjs/utils.mjs"
],
"tree": {
"index.js": [
"./index.js",
"./index"
],
"package.json": [
"./package.json",
"./package"
],
"cjs": {
"index.js": [
".",
"./",
"./cjs",
"./cjs/",
"./cjs/index.js",
"./cjs/index"
],
"utils.js": [
"./cjs/utils.js",
"./cjs/utils"
]
},
"mjs": {
"index.mjs": [
"./mjs/index.mjs"
],
"utils.mjs": [
"./mjs/utils.mjs"
]
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{
"name": "ex-conditions-in-folder",
"version": "0.0.0",
"engines": {
"node": "*"
},
"problems": [],
"exports": {
"binaries": {},
"latest": "conditions",
"conditions": {
"import": {
".": "./mjs/index.mjs"
},
"require": {
".": "./cjs/index.js",
"./package.json": "./package.json"
},
"files": [
"./package.json",
"./cjs/index.js",
"./mjs/index.mjs"
],
"tree": {
"cjs": {
"index.js": [
"."
]
},
"package.json": [
"./package.json"
],
"mjs": {
"index.mjs": [
"."
]
}
}
},
"pre-exports": {
"import": {},
"require": {
".": "./cjs/index.js",
"./": "./cjs/index.js",
"./cjs": "./cjs/index.js",
"./index": "./index.js",
"./index.js": "./index.js",
"./package": "./package.json",
"./package.json": "./package.json",
"./cjs/": "./cjs/index.js",
"./cjs/index": "./cjs/index.js",
"./cjs/index.js": "./cjs/index.js",
"./cjs/utils": "./cjs/utils.js",
"./cjs/utils.js": "./cjs/utils.js",
"./mjs/index.mjs": "./mjs/index.mjs",
"./mjs/utils.mjs": "./mjs/utils.mjs"
},
"files": [
"./index.js",
"./package.json",
"./cjs/index.js",
"./cjs/utils.js",
"./mjs/index.mjs",
"./mjs/utils.mjs"
],
"tree": {
"index.js": [
"./index.js",
"./index"
],
"package.json": [
"./package.json",
"./package"
],
"cjs": {
"index.js": [
".",
"./",
"./cjs",
"./cjs/",
"./cjs/index.js",
"./cjs/index"
],
"utils.js": [
"./cjs/utils.js",
"./cjs/utils"
]
},
"mjs": {
"index.mjs": [
"./mjs/index.mjs"
],
"utils.mjs": [
"./mjs/utils.mjs"
]
}
}
}
}
}
Loading

0 comments on commit 2af2b4b

Please sign in to comment.