586b0d5011
* Initial support for module: node12 * Add allowJs and declaration emit enabled tests * Fix typos * cts, mts, cjs, mjs, etc extension support * Fix watch of files whose intepretation changes due to a package.json update * Minor PR feedback * Adjust error message * Initial import/export/self-name support * Accept new error codes * TypesVersions support in export/import map conditions * Fix import suggestion and autoimport default extensions under new resolution modes * Add tests for import maps non-relative name lookup feature * Fix isDeclarationFileName for .d.mts and .d.cts * Preserve new extensions when generating module specifiers * Fix spurious implict any suggestion caused by file ordering bug and optimize import name format detection by relying on parents being set * Fix a bunch of incremental bugs that dont repro under fourslash for some reason * Accept updated baseline * Always include extensions on completions for cjs/mjs style imports * String completion relative import suggestions respect the mode of the import when choosing if they provide extensions * Style feedback * Change diagnostic case
121 lines
3.1 KiB
TypeScript
121 lines
3.1 KiB
TypeScript
//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackagePatternExports.ts] ////
|
|
|
|
//// [index.js]
|
|
// esm format file
|
|
import * as cjsi from "inner/cjs/index";
|
|
import * as mjsi from "inner/mjs/index";
|
|
import * as typei from "inner/js/index";
|
|
cjsi;
|
|
mjsi;
|
|
typei;
|
|
//// [index.mjs]
|
|
// esm format file
|
|
import * as cjsi from "inner/cjs/index";
|
|
import * as mjsi from "inner/mjs/index";
|
|
import * as typei from "inner/js/index";
|
|
cjsi;
|
|
mjsi;
|
|
typei;
|
|
//// [index.cjs]
|
|
// cjs format file
|
|
import * as cjsi from "inner/cjs/index";
|
|
import * as mjsi from "inner/mjs/index";
|
|
import * as typei from "inner/js/index";
|
|
cjsi;
|
|
mjsi;
|
|
typei;
|
|
//// [index.d.ts]
|
|
// cjs format file
|
|
import * as cjs from "inner/cjs/index";
|
|
import * as mjs from "inner/mjs/index";
|
|
import * as type from "inner/js/index";
|
|
export { cjs };
|
|
export { mjs };
|
|
export { type };
|
|
//// [index.d.mts]
|
|
// esm format file
|
|
import * as cjs from "inner/cjs/index";
|
|
import * as mjs from "inner/mjs/index";
|
|
import * as type from "inner/js/index";
|
|
export { cjs };
|
|
export { mjs };
|
|
export { type };
|
|
//// [index.d.cts]
|
|
// cjs format file
|
|
import * as cjs from "inner/cjs/index";
|
|
import * as mjs from "inner/mjs/index";
|
|
import * as type from "inner/js/index";
|
|
export { cjs };
|
|
export { mjs };
|
|
export { type };
|
|
//// [package.json]
|
|
{
|
|
"name": "package",
|
|
"private": true,
|
|
"type": "module",
|
|
}
|
|
//// [package.json]
|
|
{
|
|
"name": "inner",
|
|
"private": true,
|
|
"exports": {
|
|
"./cjs/*": "./*.cjs",
|
|
"./mjs/*": "./*.mjs",
|
|
"./js/*": "./*.js"
|
|
}
|
|
}
|
|
|
|
//// [index.js]
|
|
// esm format file
|
|
import * as cjsi from "inner/cjs/index";
|
|
import * as mjsi from "inner/mjs/index";
|
|
import * as typei from "inner/js/index";
|
|
cjsi;
|
|
mjsi;
|
|
typei;
|
|
//// [index.mjs]
|
|
// esm format file
|
|
import * as cjsi from "inner/cjs/index";
|
|
import * as mjsi from "inner/mjs/index";
|
|
import * as typei from "inner/js/index";
|
|
cjsi;
|
|
mjsi;
|
|
typei;
|
|
//// [index.cjs]
|
|
"use strict";
|
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
if (k2 === undefined) k2 = k;
|
|
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
}) : (function(o, m, k, k2) {
|
|
if (k2 === undefined) k2 = k;
|
|
o[k2] = m[k];
|
|
}));
|
|
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
}) : function(o, v) {
|
|
o["default"] = v;
|
|
});
|
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
if (mod && mod.__esModule) return mod;
|
|
var result = {};
|
|
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
__setModuleDefault(result, mod);
|
|
return result;
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
// cjs format file
|
|
const cjsi = __importStar(require("inner/cjs/index"));
|
|
const mjsi = __importStar(require("inner/mjs/index"));
|
|
const typei = __importStar(require("inner/js/index"));
|
|
cjsi;
|
|
mjsi;
|
|
typei;
|
|
|
|
|
|
//// [index.d.ts]
|
|
export {};
|
|
//// [index.d.mts]
|
|
export {};
|
|
//// [index.d.cts]
|
|
export {};
|