fix(npm): create node_modules/.deno/node_modules folder (#19242)

This is what pnpm does and we were missing it. It makes modules work
which have a dependency on something, but don't say they have that
dependency, but that dep is still in the tree somewhere.
This commit is contained in:
David Sherret 2023-05-24 15:04:21 -04:00 committed by GitHub
parent 0fbfdaf901
commit ba6f573b4e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 114 additions and 22 deletions

View file

@ -0,0 +1,2 @@
esm
esm

View file

@ -0,0 +1,7 @@
import { getKind as getKind1 } from "npm:@denotest/dual-cjs-esm-dep";
// this should still be able to be resolved even though it's missing the
// "@denotest/dual-cjs-esm" package because the above import will resolve it
import { getKind as getKind2 } from "npm:@denotest/dual-cjs-esm-dep-missing";
console.log(getKind1());
console.log(getKind2());

View file

@ -0,0 +1,3 @@
import { getKind } from "@denotest/dual-cjs-esm";
export { getKind };

View file

@ -0,0 +1 @@
export function getKind(): "esm" | "cjs";

View file

@ -0,0 +1,3 @@
import { getKind } from "@denotest/dual-cjs-esm";
export { getKind };

View file

@ -0,0 +1,7 @@
{
"name": "@denotest/dual-cjs-esm-dep-missing",
"version": "1.0.0",
"type": "module",
"main": "./index.cjs",
"module": "./index.mjs"
}

View file

@ -0,0 +1,3 @@
import { getKind } from "@denotest/dual-cjs-esm";
export { getKind };

View file

@ -0,0 +1 @@
export function getKind(): "esm" | "cjs";

View file

@ -0,0 +1,3 @@
import { getKind } from "@denotest/dual-cjs-esm";
export { getKind };

View file

@ -0,0 +1,10 @@
{
"name": "@denotest/dual-cjs-esm-dep",
"version": "1.0.0",
"type": "module",
"main": "./index.cjs",
"module": "./index.mjs",
"dependencies": {
"@denotest/dual-cjs-esm": "*"
}
}