-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Component commits: 79957c1 Fix index fallback of CJS package from ESM-mode import when `main` is present but does not resolve Co-authored-by: Andrew Branch <andrew@wheream.io>
- Loading branch information
1 parent
6e0328a
commit b24b05b
Showing
6 changed files
with
203 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
44 changes: 44 additions & 0 deletions
44
tests/baselines/reference/nodeNextImportModeImplicitIndexResolution2.errors.txt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/index.cts(4,21): error TS2307: Cannot find module 'dedent4' or its corresponding type declarations. | ||
/index.mts(4,21): error TS2307: Cannot find module 'dedent4' or its corresponding type declarations. | ||
|
||
|
||
==== /node_modules/@types/dedent/package.json (0 errors) ==== | ||
{ "name": "@types/dedent", "version": "1.0.0", "main": "" } | ||
|
||
==== /node_modules/@types/dedent2/package.json (0 errors) ==== | ||
{ "name": "@types/dedent2", "version": "1.0.0", "main": "asdfasdfasdf" } | ||
|
||
==== /node_modules/@types/dedent3/package.json (0 errors) ==== | ||
{ "name": "@types/dedent3", "version": "1.0.0", "main": "asdfasdfasdf", "exports": null } | ||
|
||
==== /node_modules/@types/dedent4/package.json (0 errors) ==== | ||
{ "name": "@types/dedent4", "version": "1.0.0", "main": "asdfasdfasdf", "exports": "./asdfasdfasdf" } | ||
|
||
==== /node_modules/@types/dedent/index.d.ts (0 errors) ==== | ||
export {}; | ||
|
||
==== /node_modules/@types/dedent2/index.d.ts (0 errors) ==== | ||
export {}; | ||
|
||
==== /node_modules/@types/dedent3/index.d.ts (0 errors) ==== | ||
export {}; | ||
|
||
==== /node_modules/@types/dedent4/index.d.ts (0 errors) ==== | ||
export {}; | ||
|
||
==== /index.mts (1 errors) ==== | ||
import dedent from "dedent"; | ||
import dedent2 from "dedent2"; | ||
import dedent3 from "dedent3"; | ||
import dedent4 from "dedent4"; // Error | ||
~~~~~~~~~ | ||
!!! error TS2307: Cannot find module 'dedent4' or its corresponding type declarations. | ||
|
||
==== /index.cts (1 errors) ==== | ||
import dedent from "dedent"; | ||
import dedent2 from "dedent2"; | ||
import dedent3 from "dedent3"; | ||
import dedent4 from "dedent4"; // Error | ||
~~~~~~~~~ | ||
!!! error TS2307: Cannot find module 'dedent4' or its corresponding type declarations. | ||
|
44 changes: 44 additions & 0 deletions
44
tests/baselines/reference/nodeNextImportModeImplicitIndexResolution2.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
//// [tests/cases/compiler/nodeNextImportModeImplicitIndexResolution2.ts] //// | ||
|
||
//// [package.json] | ||
{ "name": "@types/dedent", "version": "1.0.0", "main": "" } | ||
|
||
//// [package.json] | ||
{ "name": "@types/dedent2", "version": "1.0.0", "main": "asdfasdfasdf" } | ||
|
||
//// [package.json] | ||
{ "name": "@types/dedent3", "version": "1.0.0", "main": "asdfasdfasdf", "exports": null } | ||
|
||
//// [package.json] | ||
{ "name": "@types/dedent4", "version": "1.0.0", "main": "asdfasdfasdf", "exports": "./asdfasdfasdf" } | ||
|
||
//// [index.d.ts] | ||
export {}; | ||
|
||
//// [index.d.ts] | ||
export {}; | ||
|
||
//// [index.d.ts] | ||
export {}; | ||
|
||
//// [index.d.ts] | ||
export {}; | ||
|
||
//// [index.mts] | ||
import dedent from "dedent"; | ||
import dedent2 from "dedent2"; | ||
import dedent3 from "dedent3"; | ||
import dedent4 from "dedent4"; // Error | ||
|
||
//// [index.cts] | ||
import dedent from "dedent"; | ||
import dedent2 from "dedent2"; | ||
import dedent3 from "dedent3"; | ||
import dedent4 from "dedent4"; // Error | ||
|
||
|
||
//// [index.mjs] | ||
export {}; | ||
//// [index.cjs] | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
38 changes: 38 additions & 0 deletions
38
tests/baselines/reference/nodeNextImportModeImplicitIndexResolution2.symbols
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
=== /node_modules/@types/dedent/index.d.ts === | ||
export {}; | ||
No type information for this code. | ||
No type information for this code.=== /node_modules/@types/dedent2/index.d.ts === | ||
export {}; | ||
No type information for this code. | ||
No type information for this code.=== /node_modules/@types/dedent3/index.d.ts === | ||
export {}; | ||
No type information for this code. | ||
No type information for this code.=== /node_modules/@types/dedent4/index.d.ts === | ||
export {}; | ||
No type information for this code. | ||
No type information for this code.=== /index.mts === | ||
import dedent from "dedent"; | ||
>dedent : Symbol(dedent, Decl(index.mts, 0, 6)) | ||
|
||
import dedent2 from "dedent2"; | ||
>dedent2 : Symbol(dedent2, Decl(index.mts, 1, 6)) | ||
|
||
import dedent3 from "dedent3"; | ||
>dedent3 : Symbol(dedent3, Decl(index.mts, 2, 6)) | ||
|
||
import dedent4 from "dedent4"; // Error | ||
>dedent4 : Symbol(dedent4, Decl(index.mts, 3, 6)) | ||
|
||
=== /index.cts === | ||
import dedent from "dedent"; | ||
>dedent : Symbol(dedent, Decl(index.cts, 0, 6)) | ||
|
||
import dedent2 from "dedent2"; | ||
>dedent2 : Symbol(dedent2, Decl(index.cts, 1, 6)) | ||
|
||
import dedent3 from "dedent3"; | ||
>dedent3 : Symbol(dedent3, Decl(index.cts, 2, 6)) | ||
|
||
import dedent4 from "dedent4"; // Error | ||
>dedent4 : Symbol(dedent4, Decl(index.cts, 3, 6)) | ||
|
38 changes: 38 additions & 0 deletions
38
tests/baselines/reference/nodeNextImportModeImplicitIndexResolution2.types
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
=== /node_modules/@types/dedent/index.d.ts === | ||
export {}; | ||
No type information for this code. | ||
No type information for this code.=== /node_modules/@types/dedent2/index.d.ts === | ||
export {}; | ||
No type information for this code. | ||
No type information for this code.=== /node_modules/@types/dedent3/index.d.ts === | ||
export {}; | ||
No type information for this code. | ||
No type information for this code.=== /node_modules/@types/dedent4/index.d.ts === | ||
export {}; | ||
No type information for this code. | ||
No type information for this code.=== /index.mts === | ||
import dedent from "dedent"; | ||
>dedent : typeof dedent | ||
|
||
import dedent2 from "dedent2"; | ||
>dedent2 : typeof dedent2 | ||
|
||
import dedent3 from "dedent3"; | ||
>dedent3 : typeof dedent3 | ||
|
||
import dedent4 from "dedent4"; // Error | ||
>dedent4 : any | ||
|
||
=== /index.cts === | ||
import dedent from "dedent"; | ||
>dedent : typeof dedent | ||
|
||
import dedent2 from "dedent2"; | ||
>dedent2 : typeof dedent2 | ||
|
||
import dedent3 from "dedent3"; | ||
>dedent3 : typeof dedent3 | ||
|
||
import dedent4 from "dedent4"; // Error | ||
>dedent4 : any | ||
|
37 changes: 37 additions & 0 deletions
37
tests/cases/compiler/nodeNextImportModeImplicitIndexResolution2.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// @module: nodenext | ||
|
||
// @Filename: /node_modules/@types/dedent/package.json | ||
{ "name": "@types/dedent", "version": "1.0.0", "main": "" } | ||
|
||
// @Filename: /node_modules/@types/dedent2/package.json | ||
{ "name": "@types/dedent2", "version": "1.0.0", "main": "asdfasdfasdf" } | ||
|
||
// @Filename: /node_modules/@types/dedent3/package.json | ||
{ "name": "@types/dedent3", "version": "1.0.0", "main": "asdfasdfasdf", "exports": null } | ||
|
||
// @Filename: /node_modules/@types/dedent4/package.json | ||
{ "name": "@types/dedent4", "version": "1.0.0", "main": "asdfasdfasdf", "exports": "./asdfasdfasdf" } | ||
|
||
// @Filename: /node_modules/@types/dedent/index.d.ts | ||
export {}; | ||
|
||
// @Filename: /node_modules/@types/dedent2/index.d.ts | ||
export {}; | ||
|
||
// @Filename: /node_modules/@types/dedent3/index.d.ts | ||
export {}; | ||
|
||
// @Filename: /node_modules/@types/dedent4/index.d.ts | ||
export {}; | ||
|
||
// @Filename: /index.mts | ||
import dedent from "dedent"; | ||
import dedent2 from "dedent2"; | ||
import dedent3 from "dedent3"; | ||
import dedent4 from "dedent4"; // Error | ||
|
||
// @Filename: /index.cts | ||
import dedent from "dedent"; | ||
import dedent2 from "dedent2"; | ||
import dedent3 from "dedent3"; | ||
import dedent4 from "dedent4"; // Error |