Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable #57896 (Respect package.json "type" and module-format-specific file extensions in more module modes) #58831

Merged
merged 6 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add compiler test baselines
  • Loading branch information
andrewbranch committed Jun 11, 2024
commit aeccaf524a7cb3355933150d940a563e5e9f9061
6 changes: 2 additions & 4 deletions tests/baselines/reference/bundlerImportESM(module=esnext).js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ import { esm } from "./esm.mjs";
//// [esm.mjs]
export var esm = 0;
//// [not-actually-cjs.cjs]
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export {};
//// [still-not-cjs.js]
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export {};
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error TS6504: File '/node_modules/dual/index.cjs' is a JavaScript file. Did you
error TS6504: File '/node_modules/dual/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option?
The file is in the program because:
Root file specified for compilation
/main.cts(1,10): error TS2305: Module '"dual"' has no exported member 'esm'.
/main.cts(1,15): error TS2305: Module '"dual"' has no exported member 'cjs'.
/main.mts(1,15): error TS2305: Module '"dual"' has no exported member 'cjs'.
/main.ts(1,15): error TS2305: Module '"dual"' has no exported member 'cjs'.

Expand Down Expand Up @@ -54,6 +54,6 @@ error TS6504: File '/node_modules/dual/index.js' is a JavaScript file. Did you m

==== /main.cts (1 errors) ====
import { esm, cjs } from "dual";
~~~
!!! error TS2305: Module '"dual"' has no exported member 'esm'.
~~~
!!! error TS2305: Module '"dual"' has no exported member 'cjs'.

Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,4 @@ export {};
//// [main.mjs]
export {};
//// [main.cjs]
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export {};
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import { esm, cjs } from "dual";

=== /main.cts ===
import { esm, cjs } from "dual";
>esm : any
> : ^^^
>cjs : number
>esm : number
> : ^^^^^^
>cjs : any
> : ^^^

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error TS6504: File '/node_modules/dual/index.cjs' is a JavaScript file. Did you
error TS6504: File '/node_modules/dual/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option?
The file is in the program because:
Root file specified for compilation
/main.cts(1,10): error TS2305: Module '"dual"' has no exported member 'esm'.
/main.cts(1,15): error TS2305: Module '"dual"' has no exported member 'cjs'.
/main.mts(1,15): error TS2305: Module '"dual"' has no exported member 'cjs'.
/main.ts(1,15): error TS2305: Module '"dual"' has no exported member 'cjs'.

Expand Down Expand Up @@ -54,6 +54,6 @@ error TS6504: File '/node_modules/dual/index.js' is a JavaScript file. Did you m

==== /main.cts (1 errors) ====
import { esm, cjs } from "dual";
~~~
!!! error TS2305: Module '"dual"' has no exported member 'esm'.
~~~
!!! error TS2305: Module '"dual"' has no exported member 'cjs'.

Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import { esm, cjs } from "dual";

=== /main.cts ===
import { esm, cjs } from "dual";
>esm : any
> : ^^^
>cjs : number
>esm : number
> : ^^^^^^
>cjs : any
> : ^^^

Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,17 @@ const y = { ...o };


//// [a.js]
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.A = void 0;
let A = class A {
};
exports.A = A;
exports.A = A = __decorate([
A = __decorate([
dec
], A);
export { A };
const o = { a: 1 };
const y = Object.assign({}, o);
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,17 @@ const y = { ...o };


//// [a.js]
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.A = void 0;
let A = class A {
};
exports.A = A;
exports.A = A = __decorate([
A = __decorate([
dec
], A);
export { A };
const o = { a: 1 };
const y = Object.assign({}, o);

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,21 @@ mdast;
>mdast : Symbol(mdast, Decl(index.ts, 0, 6))

mdast.toString();
>mdast.toString : Symbol(mdast.toString, Decl(index.d.ts, 0, 0))
>mdast : Symbol(mdast, Decl(index.ts, 0, 6))
>toString : Symbol(mdast.toString, Decl(index.d.ts, 0, 0))

const mdast2 = await import('mdast-util-to-string');
>mdast2 : Symbol(mdast2, Decl(index.ts, 4, 5))
>'mdast-util-to-string' : Symbol("/node_modules/mdast-util-to-string/index", Decl(index.d.ts, 0, 0))
>'mdast-util-to-string' : Symbol(mdast, Decl(index.d.ts, 0, 0))

mdast2.toString();
>mdast2.toString : Symbol(toString, Decl(index.d.ts, 0, 0))
>mdast2.toString : Symbol(mdast.toString, Decl(index.d.ts, 0, 0))
>mdast2 : Symbol(mdast2, Decl(index.ts, 4, 5))
>toString : Symbol(toString, Decl(index.d.ts, 0, 0))
>toString : Symbol(mdast.toString, Decl(index.d.ts, 0, 0))

mdast2.default;
>mdast2.default : Symbol(mdast.default)
>mdast2 : Symbol(mdast2, Decl(index.ts, 4, 5))
>default : Symbol(mdast.default)

Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,32 @@ export function toString(): string;

=== /index.ts ===
import mdast, { toString } from 'mdast-util-to-string';
>mdast : any
> : ^^^
>mdast : typeof mdast
> : ^^^^^^^^^^^^
>toString : () => string
> : ^^^^^^

mdast;
>mdast : any
> : ^^^
>mdast : typeof mdast
> : ^^^^^^^^^^^^

mdast.toString();
>mdast.toString() : any
> : ^^^
>mdast.toString : any
> : ^^^
>mdast : any
> : ^^^
>toString : any
> : ^^^
>mdast.toString() : string
> : ^^^^^^
>mdast.toString : () => string
> : ^^^^^^
>mdast : typeof mdast
> : ^^^^^^^^^^^^
>toString : () => string
> : ^^^^^^

const mdast2 = await import('mdast-util-to-string');
>mdast2 : typeof import("/node_modules/mdast-util-to-string/index")
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>await import('mdast-util-to-string') : typeof import("/node_modules/mdast-util-to-string/index")
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>import('mdast-util-to-string') : Promise<typeof import("/node_modules/mdast-util-to-string/index")>
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>mdast2 : { default: typeof mdast; toString(): string; }
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^
>await import('mdast-util-to-string') : { default: typeof mdast; toString(): string; }
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^
>import('mdast-util-to-string') : Promise<{ default: typeof mdast; toString(): string; }>
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^
>'mdast-util-to-string' : "mdast-util-to-string"
> : ^^^^^^^^^^^^^^^^^^^^^^

Expand All @@ -41,16 +41,16 @@ mdast2.toString();
> : ^^^^^^
>mdast2.toString : () => string
> : ^^^^^^
>mdast2 : typeof import("/node_modules/mdast-util-to-string/index")
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>mdast2 : { default: typeof mdast; toString(): string; }
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^
>toString : () => string
> : ^^^^^^

mdast2.default;
>mdast2.default : any
> : ^^^
>mdast2 : typeof import("/node_modules/mdast-util-to-string/index")
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>default : any
> : ^^^
>mdast2.default : typeof mdast
> : ^^^^^^^^^^^^
>mdast2 : { default: typeof mdast; toString(): string; }
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^
>default : typeof mdast
> : ^^^^^^^^^^^^

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,21 @@ mdast;
>mdast : Symbol(mdast, Decl(index.ts, 0, 6))

mdast.toString();
>mdast.toString : Symbol(mdast.toString, Decl(index.d.ts, 0, 0))
>mdast : Symbol(mdast, Decl(index.ts, 0, 6))
>toString : Symbol(mdast.toString, Decl(index.d.ts, 0, 0))

const mdast2 = await import('mdast-util-to-string');
>mdast2 : Symbol(mdast2, Decl(index.ts, 4, 5))
>'mdast-util-to-string' : Symbol("/node_modules/mdast-util-to-string/index", Decl(index.d.ts, 0, 0))
>'mdast-util-to-string' : Symbol(mdast, Decl(index.d.ts, 0, 0))

mdast2.toString();
>mdast2.toString : Symbol(toString, Decl(index.d.ts, 0, 0))
>mdast2.toString : Symbol(mdast.toString, Decl(index.d.ts, 0, 0))
>mdast2 : Symbol(mdast2, Decl(index.ts, 4, 5))
>toString : Symbol(toString, Decl(index.d.ts, 0, 0))
>toString : Symbol(mdast.toString, Decl(index.d.ts, 0, 0))

mdast2.default;
>mdast2.default : Symbol(mdast.default)
>mdast2 : Symbol(mdast2, Decl(index.ts, 4, 5))
>default : Symbol(mdast.default)

Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,32 @@ export function toString(): string;

=== /index.ts ===
import mdast, { toString } from 'mdast-util-to-string';
>mdast : any
> : ^^^
>mdast : typeof mdast
> : ^^^^^^^^^^^^
>toString : () => string
> : ^^^^^^

mdast;
>mdast : any
> : ^^^
>mdast : typeof mdast
> : ^^^^^^^^^^^^

mdast.toString();
>mdast.toString() : any
> : ^^^
>mdast.toString : any
> : ^^^
>mdast : any
> : ^^^
>toString : any
> : ^^^
>mdast.toString() : string
> : ^^^^^^
>mdast.toString : () => string
> : ^^^^^^
>mdast : typeof mdast
> : ^^^^^^^^^^^^
>toString : () => string
> : ^^^^^^

const mdast2 = await import('mdast-util-to-string');
>mdast2 : typeof import("/node_modules/mdast-util-to-string/index")
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>await import('mdast-util-to-string') : typeof import("/node_modules/mdast-util-to-string/index")
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>import('mdast-util-to-string') : Promise<typeof import("/node_modules/mdast-util-to-string/index")>
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>mdast2 : { default: typeof mdast; toString(): string; }
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^
>await import('mdast-util-to-string') : { default: typeof mdast; toString(): string; }
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^
>import('mdast-util-to-string') : Promise<{ default: typeof mdast; toString(): string; }>
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^
>'mdast-util-to-string' : "mdast-util-to-string"
> : ^^^^^^^^^^^^^^^^^^^^^^

Expand All @@ -41,16 +41,16 @@ mdast2.toString();
> : ^^^^^^
>mdast2.toString : () => string
> : ^^^^^^
>mdast2 : typeof import("/node_modules/mdast-util-to-string/index")
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>mdast2 : { default: typeof mdast; toString(): string; }
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^
>toString : () => string
> : ^^^^^^

mdast2.default;
>mdast2.default : any
> : ^^^
>mdast2 : typeof import("/node_modules/mdast-util-to-string/index")
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>default : any
> : ^^^
>mdast2.default : typeof mdast
> : ^^^^^^^^^^^^
>mdast2 : { default: typeof mdast; toString(): string; }
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^
>default : typeof mdast
> : ^^^^^^^^^^^^

Loading