From 3f0dafe74a5d89a51b834f2a0b28f6913e8842a4 Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Mon, 28 Aug 2023 19:58:00 -0700 Subject: [PATCH 1/7] Start type-checking work for incorrect export default --- .../checks/entrypointResolutionProblems.ts | 36 +++++++++++++------ packages/core/src/multiCompilerHost.ts | 4 +-- 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/packages/core/src/checks/entrypointResolutionProblems.ts b/packages/core/src/checks/entrypointResolutionProblems.ts index 7e2a25c..93058f3 100644 --- a/packages/core/src/checks/entrypointResolutionProblems.ts +++ b/packages/core/src/checks/entrypointResolutionProblems.ts @@ -1,7 +1,7 @@ import ts from "typescript"; import type { EntrypointInfo, EntrypointResolutionProblem } from "../types.js"; import type { CompilerHosts } from "../multiCompilerHost.js"; -import { resolvedThroughFallback, visitResolutions } from "../utils.js"; +import { getResolutionOption, resolvedThroughFallback, visitResolutions } from "../utils.js"; export function getEntrypointResolutionProblems( entrypointResolutions: Record, @@ -11,6 +11,7 @@ export function getEntrypointResolutionProblems( visitResolutions(entrypointResolutions, (result, entrypoint) => { const { subpath } = entrypoint; const { resolutionKind } = result; + const resolutionOption = getResolutionOption(resolutionKind); if (result.isWildcard) { problems.push({ kind: "Wildcard", @@ -70,13 +71,14 @@ export function getEntrypointResolutionProblems( }); } - if (resolutionKind === "node16-esm" && resolution && implementationResolution) { - const typesSourceFile = hosts.node16.getSourceFile(resolution.fileName); + if (resolution && implementationResolution) { + const host = hosts[resolutionOption]; + const typesSourceFile = host.getSourceFile(resolution.fileName); if (typesSourceFile) { ts.bindSourceFile(typesSourceFile, { target: ts.ScriptTarget.Latest, allowJs: true, checkJs: true }); } const typesExports = typesSourceFile?.symbol?.exports; - const jsSourceFile = typesExports && hosts.node16.getSourceFile(implementationResolution.fileName); + const jsSourceFile = typesExports && host.getSourceFile(implementationResolution.fileName); if (jsSourceFile) { ts.bindSourceFile(jsSourceFile, { target: ts.ScriptTarget.Latest, allowJs: true, checkJs: true }); } @@ -88,12 +90,26 @@ export function getEntrypointResolutionProblems( jsExports.has(ts.InternalSymbolName.ExportEquals) && !jsExports.has(ts.InternalSymbolName.Default) ) { - // Also need to check for `default` property on `jsModule["export="]`? - problems.push({ - kind: "FalseExportDefault", - entrypoint: subpath, - resolutionKind, - }); + const jsChecker = host + .createProgram([implementationResolution.fileName], { + allowJs: true, + checkJs: true, + noResolve: true, + target: ts.ScriptTarget.Latest, + }) + .getTypeChecker(); + // Check for `default` property on `jsModule["export="]` + if ( + !jsChecker + .getExportsAndPropertiesOfModule(jsChecker.resolveExternalModuleSymbol(jsSourceFile.symbol)) + .some((s) => s.name === "default") + ) { + problems.push({ + kind: "FalseExportDefault", + entrypoint: subpath, + resolutionKind, + }); + } } } } diff --git a/packages/core/src/multiCompilerHost.ts b/packages/core/src/multiCompilerHost.ts index 6e1a0b2..253aa74 100644 --- a/packages/core/src/multiCompilerHost.ts +++ b/packages/core/src/multiCompilerHost.ts @@ -117,10 +117,10 @@ export class CompilerHostWrapper { return this.traceCache[fromFileName]?.[`${resolutionMode ?? 1}:${moduleSpecifier}`]; } - createProgram(rootNames: string[]): ts.Program { + createProgram(rootNames: string[], options = this.compilerOptions): ts.Program { return ts.createProgram({ rootNames, - options: this.compilerOptions, + options, host: this.compilerHost, }); } From ad2d97f2f5476edb23633eca5c56a481b8cd778c Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Mon, 4 Sep 2023 16:53:15 -0700 Subject: [PATCH 2/7] Better caching --- .../cli/test/snapshots/hexoid@1.0.0.tgz.md | 10 +- .../cli/test/snapshots/postcss@8.4.21.tgz.md | 126 +++++++++--------- .../checks/entrypointResolutionProblems.ts | 2 - packages/core/src/multiCompilerHost.ts | 56 ++++++-- .../core/test/snapshots/hexoid@1.0.0.tgz.json | 15 +++ .../test/snapshots/postcss@8.4.21.tgz.json | 105 --------------- 6 files changed, 129 insertions(+), 185 deletions(-) diff --git a/packages/cli/test/snapshots/hexoid@1.0.0.tgz.md b/packages/cli/test/snapshots/hexoid@1.0.0.tgz.md index 0a9545f..1c17f73 100644 --- a/packages/cli/test/snapshots/hexoid@1.0.0.tgz.md +++ b/packages/cli/test/snapshots/hexoid@1.0.0.tgz.md @@ -9,11 +9,11 @@ hexoid v1.0.0 ❗️ The resolved types use export default where the JavaScript file appears to use module.exports =. This will cause TypeScript under the node16 module mode to think an extra .default property access is required, but that will likely fail at runtime. These types should use export = instead of export default. https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/FalseExportDefault.md -┌──────────┬────────┬───────────────────┬──────────────────────────────┬─────────┐ -│ │ node10 │ node16 (from CJS) │ node16 (from ESM) │ bundler │ -├──────────┼────────┼───────────────────┼──────────────────────────────┼─────────┤ -│ "hexoid" │ 🟢 │ 🟢 (CJS) │ ❗️ Incorrect default export │ 🟢 │ -└──────────┴────────┴───────────────────┴──────────────────────────────┴─────────┘ +┌──────────┬──────────────────────────────┬──────────────────────────────┬──────────────────────────────┬──────────────────────────────┐ +│ │ node10 │ node16 (from CJS) │ node16 (from ESM) │ bundler │ +├──────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤ +│ "hexoid" │ ❗️ Incorrect default export │ ❗️ Incorrect default export │ ❗️ Incorrect default export │ ❗️ Incorrect default export │ +└──────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘ ``` diff --git a/packages/cli/test/snapshots/postcss@8.4.21.tgz.md b/packages/cli/test/snapshots/postcss@8.4.21.tgz.md index de320ed..e7380c2 100644 --- a/packages/cli/test/snapshots/postcss@8.4.21.tgz.md +++ b/packages/cli/test/snapshots/postcss@8.4.21.tgz.md @@ -10,73 +10,71 @@ postcss v8.4.21 🐛 Import resolved to types through a conditional package.json export, but only after failing to resolve through an earlier condition. This behavior is a TypeScript bug (https://github.com/microsoft/TypeScript/issues/50762). It may misrepresent the runtime behavior of this import and should not be relied upon. https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/FallbackCondition.md -❗️ The resolved types use export default where the JavaScript file appears to use module.exports =. This will cause TypeScript under the node16 module mode to think an extra .default property access is required, but that will likely fail at runtime. These types should use export = instead of export default. https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/FalseExportDefault.md - ❌ Import resolved to JavaScript files, but no type declarations were found. https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/UntypedResolution.md -┌──────────────────────────────────┬─────────────┬───────────────────┬──────────────────────────────┬────────────────────────────┐ -│ │ node10 │ node16 (from CJS) │ node16 (from ESM) │ bundler │ -├──────────────────────────────────┼─────────────┼───────────────────┼──────────────────────────────┼────────────────────────────┤ -│ "postcss" │ 🟢 │ 🟢 (CJS) │ 🎭 Masquerading as CJS │ 🐛 Used fallback condition │ -│ │ │ │ 🐛 Used fallback condition │ │ -├──────────────────────────────────┼─────────────┼───────────────────┼──────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/at-rule" │ 🟢 │ 🟢 (CJS) │ ❗️ Incorrect default export │ 🟢 │ -├──────────────────────────────────┼─────────────┼───────────────────┼──────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/comment" │ 🟢 │ 🟢 (CJS) │ ❗️ Incorrect default export │ 🟢 │ -├──────────────────────────────────┼─────────────┼───────────────────┼──────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/container" │ 🟢 │ 🟢 (CJS) │ ❗️ Incorrect default export │ 🟢 │ -├──────────────────────────────────┼─────────────┼───────────────────┼──────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/css-syntax-error" │ 🟢 │ 🟢 (CJS) │ ❗️ Incorrect default export │ 🟢 │ -├──────────────────────────────────┼─────────────┼───────────────────┼──────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/declaration" │ 🟢 │ 🟢 (CJS) │ ❗️ Incorrect default export │ 🟢 │ -├──────────────────────────────────┼─────────────┼───────────────────┼──────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/fromJSON" │ 🟢 │ 🟢 (CJS) │ ❗️ Incorrect default export │ 🟢 │ -├──────────────────────────────────┼─────────────┼───────────────────┼──────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/input" │ 🟢 │ 🟢 (CJS) │ ❗️ Incorrect default export │ 🟢 │ -├──────────────────────────────────┼─────────────┼───────────────────┼──────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/lazy-result" │ 🟢 │ 🟢 (CJS) │ ❗️ Incorrect default export │ 🟢 │ -├──────────────────────────────────┼─────────────┼───────────────────┼──────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/no-work-result" │ 🟢 │ 🟢 (CJS) │ ❗️ Incorrect default export │ 🟢 │ -├──────────────────────────────────┼─────────────┼───────────────────┼──────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/list" │ 🟢 │ 🟢 (CJS) │ ❗️ Incorrect default export │ 🟢 │ -├──────────────────────────────────┼─────────────┼───────────────────┼──────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/map-generator" │ ❌ No types │ ❌ No types │ ❌ No types │ ❌ No types │ -├──────────────────────────────────┼─────────────┼───────────────────┼──────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/node" │ 🟢 │ 🟢 (CJS) │ ❗️ Incorrect default export │ 🟢 │ -├──────────────────────────────────┼─────────────┼───────────────────┼──────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/parse" │ 🟢 │ 🟢 (CJS) │ ❗️ Incorrect default export │ 🟢 │ -├──────────────────────────────────┼─────────────┼───────────────────┼──────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/parser" │ ❌ No types │ ❌ No types │ ❌ No types │ ❌ No types │ -├──────────────────────────────────┼─────────────┼───────────────────┼──────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/postcss" │ 🟢 │ 🟢 (CJS) │ ❗️ Incorrect default export │ 🟢 │ -├──────────────────────────────────┼─────────────┼───────────────────┼──────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/previous-map" │ 🟢 │ 🟢 (CJS) │ ❗️ Incorrect default export │ 🟢 │ -├──────────────────────────────────┼─────────────┼───────────────────┼──────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/processor" │ 🟢 │ 🟢 (CJS) │ ❗️ Incorrect default export │ 🟢 │ -├──────────────────────────────────┼─────────────┼───────────────────┼──────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/result" │ 🟢 │ 🟢 (CJS) │ ❗️ Incorrect default export │ 🟢 │ -├──────────────────────────────────┼─────────────┼───────────────────┼──────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/root" │ 🟢 │ 🟢 (CJS) │ ❗️ Incorrect default export │ 🟢 │ -├──────────────────────────────────┼─────────────┼───────────────────┼──────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/rule" │ 🟢 │ 🟢 (CJS) │ ❗️ Incorrect default export │ 🟢 │ -├──────────────────────────────────┼─────────────┼───────────────────┼──────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/stringifier" │ 🟢 │ 🟢 (CJS) │ ❗️ Incorrect default export │ 🟢 │ -├──────────────────────────────────┼─────────────┼───────────────────┼──────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/stringify" │ 🟢 │ 🟢 (CJS) │ ❗️ Incorrect default export │ 🟢 │ -├──────────────────────────────────┼─────────────┼───────────────────┼──────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/symbols" │ ❌ No types │ ❌ No types │ ❌ No types │ ❌ No types │ -├──────────────────────────────────┼─────────────┼───────────────────┼──────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/terminal-highlight" │ ❌ No types │ ❌ No types │ ❌ No types │ ❌ No types │ -├──────────────────────────────────┼─────────────┼───────────────────┼──────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/tokenize" │ ❌ No types │ ❌ No types │ ❌ No types │ ❌ No types │ -├──────────────────────────────────┼─────────────┼───────────────────┼──────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/warn-once" │ ❌ No types │ ❌ No types │ ❌ No types │ ❌ No types │ -├──────────────────────────────────┼─────────────┼───────────────────┼──────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/warning" │ 🟢 │ 🟢 (CJS) │ ❗️ Incorrect default export │ 🟢 │ -├──────────────────────────────────┼─────────────┼───────────────────┼──────────────────────────────┼────────────────────────────┤ -│ "postcss/package.json" │ 🟢 (JSON) │ 🟢 (JSON) │ 🟢 (JSON) │ 🟢 (JSON) │ -└──────────────────────────────────┴─────────────┴───────────────────┴──────────────────────────────┴────────────────────────────┘ +┌──────────────────────────────────┬─────────────┬───────────────────┬────────────────────────────┬────────────────────────────┐ +│ │ node10 │ node16 (from CJS) │ node16 (from ESM) │ bundler │ +├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss" │ 🟢 │ 🟢 (CJS) │ 🎭 Masquerading as CJS │ 🐛 Used fallback condition │ +│ │ │ │ 🐛 Used fallback condition │ │ +├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/at-rule" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ +├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/comment" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ +├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/container" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ +├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/css-syntax-error" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ +├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/declaration" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ +├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/fromJSON" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ +├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/input" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ +├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/lazy-result" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ +├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/no-work-result" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ +├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/list" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ +├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/map-generator" │ ❌ No types │ ❌ No types │ ❌ No types │ ❌ No types │ +├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/node" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ +├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/parse" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ +├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/parser" │ ❌ No types │ ❌ No types │ ❌ No types │ ❌ No types │ +├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/postcss" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ +├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/previous-map" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ +├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/processor" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ +├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/result" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ +├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/root" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ +├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/rule" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ +├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/stringifier" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ +├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/stringify" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ +├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/symbols" │ ❌ No types │ ❌ No types │ ❌ No types │ ❌ No types │ +├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/terminal-highlight" │ ❌ No types │ ❌ No types │ ❌ No types │ ❌ No types │ +├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/tokenize" │ ❌ No types │ ❌ No types │ ❌ No types │ ❌ No types │ +├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/warn-once" │ ❌ No types │ ❌ No types │ ❌ No types │ ❌ No types │ +├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/warning" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ +├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/package.json" │ 🟢 (JSON) │ 🟢 (JSON) │ 🟢 (JSON) │ 🟢 (JSON) │ +└──────────────────────────────────┴─────────────┴───────────────────┴────────────────────────────┴────────────────────────────┘ ``` diff --git a/packages/core/src/checks/entrypointResolutionProblems.ts b/packages/core/src/checks/entrypointResolutionProblems.ts index 93058f3..aff5e9c 100644 --- a/packages/core/src/checks/entrypointResolutionProblems.ts +++ b/packages/core/src/checks/entrypointResolutionProblems.ts @@ -94,8 +94,6 @@ export function getEntrypointResolutionProblems( .createProgram([implementationResolution.fileName], { allowJs: true, checkJs: true, - noResolve: true, - target: ts.ScriptTarget.Latest, }) .getTypeChecker(); // Check for `default` property on `jsModule["export="]` diff --git a/packages/core/src/multiCompilerHost.ts b/packages/core/src/multiCompilerHost.ts index 253aa74..8947b32 100644 --- a/packages/core/src/multiCompilerHost.ts +++ b/packages/core/src/multiCompilerHost.ts @@ -30,7 +30,10 @@ export class CompilerHostWrapper { private normalModuleResolutionCache: ts.ModuleResolutionCache; private noDtsResolutionModuleResolutionCache: ts.ModuleResolutionCache; - private traceCache: Record> = {}; + private moduleResolutionCache: Record< + /*FromFileName*/ string, + Record + > = {}; private traceCollector: TraceCollector = new TraceCollector(); private languageVersion = ts.ScriptTarget.Latest; @@ -86,22 +89,30 @@ export class CompilerHostWrapper { moduleName: string, containingFile: string, resolutionMode?: ts.ModuleKind.ESNext | ts.ModuleKind.CommonJS, - noDtsResolution?: boolean + noDtsResolution?: boolean, + allowJs?: boolean ): ResolveModuleNameResult { + const moduleKey = this.getModuleKey(moduleName, resolutionMode, noDtsResolution, allowJs); + if (this.moduleResolutionCache[containingFile]?.[moduleKey]) { + const { resolution, trace } = this.moduleResolutionCache[containingFile][moduleKey]; + return { + resolution, + trace, + }; + } this.traceCollector.clear(); const resolution = ts.resolveModuleName( moduleName, containingFile, - noDtsResolution ? { ...this.compilerOptions, noDtsResolution } : this.compilerOptions, + noDtsResolution ? { ...this.compilerOptions, noDtsResolution, allowJs } : this.compilerOptions, this.compilerHost, noDtsResolution ? this.noDtsResolutionModuleResolutionCache : this.normalModuleResolutionCache, /*redirectedReference*/ undefined, resolutionMode ); const trace = this.traceCollector.read(); - const moduleKey = `${resolutionMode ?? 1}:${moduleName}`; - if (!this.traceCache[containingFile]?.[moduleKey]) { - (this.traceCache[containingFile] ??= {})[moduleKey] = trace; + if (!this.moduleResolutionCache[containingFile]?.[moduleKey]) { + (this.moduleResolutionCache[containingFile] ??= {})[moduleKey] = { resolution, trace }; } return { resolution, @@ -114,13 +125,40 @@ export class CompilerHostWrapper { moduleSpecifier: string, resolutionMode: ts.ModuleKind.ESNext | ts.ModuleKind.CommonJS | undefined ): string[] | undefined { - return this.traceCache[fromFileName]?.[`${resolutionMode ?? 1}:${moduleSpecifier}`]; + return this.moduleResolutionCache[fromFileName]?.[ + this.getModuleKey(moduleSpecifier, resolutionMode, /*noDtsResolution*/ undefined, /*allowJs*/ undefined) + ]?.trace; + } + + private getModuleKey( + moduleSpecifier: string, + resolutionMode: ts.ModuleKind.ESNext | ts.ModuleKind.CommonJS | undefined, + noDtsResolution: boolean | undefined, + allowJs: boolean | undefined + ) { + return `${resolutionMode ?? 1}:${+!!noDtsResolution}:${+!!allowJs}:${moduleSpecifier}`; } - createProgram(rootNames: string[], options = this.compilerOptions): ts.Program { + createProgram(rootNames: string[], extraOptions?: ts.CompilerOptions): ts.Program { + if ( + extraOptions && + ts.changesAffectModuleResolution( + // allowJs and noDtsResolution are part of the cache key, but any other resolution-affecting options + // are assumed to be constant for the host. + { + ...this.compilerOptions, + allowJs: extraOptions.allowJs, + checkJs: extraOptions.checkJs, + noDtsResolution: extraOptions.noDtsResolution, + }, + { ...this.compilerOptions, ...extraOptions } + ) + ) { + throw new Error("Cannot override resolution-affecting options for host due to potential cache polution"); + } return ts.createProgram({ rootNames, - options, + options: extraOptions ? { ...this.compilerOptions, ...extraOptions } : this.compilerOptions, host: this.compilerHost, }); } diff --git a/packages/core/test/snapshots/hexoid@1.0.0.tgz.json b/packages/core/test/snapshots/hexoid@1.0.0.tgz.json index 83c05fc..3d29bb9 100644 --- a/packages/core/test/snapshots/hexoid@1.0.0.tgz.json +++ b/packages/core/test/snapshots/hexoid@1.0.0.tgz.json @@ -325,10 +325,25 @@ } }, "problems": [ + { + "kind": "FalseExportDefault", + "entrypoint": ".", + "resolutionKind": "node10" + }, + { + "kind": "FalseExportDefault", + "entrypoint": ".", + "resolutionKind": "node16-cjs" + }, { "kind": "FalseExportDefault", "entrypoint": ".", "resolutionKind": "node16-esm" + }, + { + "kind": "FalseExportDefault", + "entrypoint": ".", + "resolutionKind": "bundler" } ] } diff --git a/packages/core/test/snapshots/postcss@8.4.21.tgz.json b/packages/core/test/snapshots/postcss@8.4.21.tgz.json index b21843b..7188b4d 100644 --- a/packages/core/test/snapshots/postcss@8.4.21.tgz.json +++ b/packages/core/test/snapshots/postcss@8.4.21.tgz.json @@ -8270,56 +8270,6 @@ "entrypoint": ".", "resolutionKind": "bundler" }, - { - "kind": "FalseExportDefault", - "entrypoint": "./lib/at-rule", - "resolutionKind": "node16-esm" - }, - { - "kind": "FalseExportDefault", - "entrypoint": "./lib/comment", - "resolutionKind": "node16-esm" - }, - { - "kind": "FalseExportDefault", - "entrypoint": "./lib/container", - "resolutionKind": "node16-esm" - }, - { - "kind": "FalseExportDefault", - "entrypoint": "./lib/css-syntax-error", - "resolutionKind": "node16-esm" - }, - { - "kind": "FalseExportDefault", - "entrypoint": "./lib/declaration", - "resolutionKind": "node16-esm" - }, - { - "kind": "FalseExportDefault", - "entrypoint": "./lib/fromJSON", - "resolutionKind": "node16-esm" - }, - { - "kind": "FalseExportDefault", - "entrypoint": "./lib/input", - "resolutionKind": "node16-esm" - }, - { - "kind": "FalseExportDefault", - "entrypoint": "./lib/lazy-result", - "resolutionKind": "node16-esm" - }, - { - "kind": "FalseExportDefault", - "entrypoint": "./lib/no-work-result", - "resolutionKind": "node16-esm" - }, - { - "kind": "FalseExportDefault", - "entrypoint": "./lib/list", - "resolutionKind": "node16-esm" - }, { "kind": "UntypedResolution", "entrypoint": "./lib/map-generator", @@ -8340,16 +8290,6 @@ "entrypoint": "./lib/map-generator", "resolutionKind": "bundler" }, - { - "kind": "FalseExportDefault", - "entrypoint": "./lib/node", - "resolutionKind": "node16-esm" - }, - { - "kind": "FalseExportDefault", - "entrypoint": "./lib/parse", - "resolutionKind": "node16-esm" - }, { "kind": "UntypedResolution", "entrypoint": "./lib/parser", @@ -8370,46 +8310,6 @@ "entrypoint": "./lib/parser", "resolutionKind": "bundler" }, - { - "kind": "FalseExportDefault", - "entrypoint": "./lib/postcss", - "resolutionKind": "node16-esm" - }, - { - "kind": "FalseExportDefault", - "entrypoint": "./lib/previous-map", - "resolutionKind": "node16-esm" - }, - { - "kind": "FalseExportDefault", - "entrypoint": "./lib/processor", - "resolutionKind": "node16-esm" - }, - { - "kind": "FalseExportDefault", - "entrypoint": "./lib/result", - "resolutionKind": "node16-esm" - }, - { - "kind": "FalseExportDefault", - "entrypoint": "./lib/root", - "resolutionKind": "node16-esm" - }, - { - "kind": "FalseExportDefault", - "entrypoint": "./lib/rule", - "resolutionKind": "node16-esm" - }, - { - "kind": "FalseExportDefault", - "entrypoint": "./lib/stringifier", - "resolutionKind": "node16-esm" - }, - { - "kind": "FalseExportDefault", - "entrypoint": "./lib/stringify", - "resolutionKind": "node16-esm" - }, { "kind": "UntypedResolution", "entrypoint": "./lib/symbols", @@ -8489,11 +8389,6 @@ "kind": "UntypedResolution", "entrypoint": "./lib/warn-once", "resolutionKind": "bundler" - }, - { - "kind": "FalseExportDefault", - "entrypoint": "./lib/warning", - "resolutionKind": "node16-esm" } ] } From 9cc7b5ca9716d39b38a57384533ec4072cca4a04 Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Mon, 4 Sep 2023 18:27:16 -0700 Subject: [PATCH 3/7] Add MissingExportEquals problem --- docs/problems/MissingExportEquals.md | 77 ++++ .../checks/entrypointResolutionProblems.ts | 46 +- packages/core/src/problems.ts | 11 +- packages/core/src/types.ts | 3 +- packages/core/src/utils.ts | 1 + .../core/test/fixtures/anymatch@3.1.3.tgz | Bin 0 -> 3652 bytes packages/core/test/fixtures/ignore@5.2.4.tgz | Bin 0 -> 14379 bytes .../@vitejs__plugin-react@3.1.0.tgz.json | 10 + .../core/test/snapshots/ajv@8.12.0.tgz.json | 23 +- .../test/snapshots/anymatch@3.1.3.tgz.json | 309 +++++++++++++ .../core/test/snapshots/ignore@5.2.4.tgz.json | 311 +++++++++++++ .../test/snapshots/postcss@8.4.21.tgz.json | 430 ++++++++++++++++++ 12 files changed, 1199 insertions(+), 22 deletions(-) create mode 100644 docs/problems/MissingExportEquals.md create mode 100644 packages/core/test/fixtures/anymatch@3.1.3.tgz create mode 100644 packages/core/test/fixtures/ignore@5.2.4.tgz create mode 100644 packages/core/test/snapshots/anymatch@3.1.3.tgz.json create mode 100644 packages/core/test/snapshots/ignore@5.2.4.tgz.json diff --git a/docs/problems/MissingExportEquals.md b/docs/problems/MissingExportEquals.md new file mode 100644 index 0000000..86c7fa4 --- /dev/null +++ b/docs/problems/MissingExportEquals.md @@ -0,0 +1,77 @@ +# ❓ Missing `export =` + +The JavaScript appears to set both `module.exports` and `module.exports.default` for improved compatibility, but the types only reflect the latter (by using `export default`). This will cause TypeScript under the `node16` module mode to think an extra `.default` property access is required, which will work at runtime but is not necessary. These types `export =` an object with a `default` property instead of using `export default`. + +## Explanation + +This problem occurs when a CommonJS JavaScript file appears to use a compatibility pattern like: + +```js +class Whatever { + /* ... */ +} +Whatever.default = Whatever; +module.exports = Whatever; +``` + +but the corresponding type definitions only reflect the existence of the `module.exports.default` property: + +```ts +declare class Whatever { + /* ... */ +} +export default Whatever; +``` + +The types should declare the existence of the `Whatever` class on both `module.exports` and `module.exports.default`. The method of doing this can vary depending on the kinds of things already being exported from the types. When the `export default` exports a class, and that class is the only export in the file, the `default` can be declared as a static property on the class, and the `export default` swapped for `export =`: + +```ts +declare class Whatever { + static default: typeof Whatever; + /* ... */ +} +export = Whatever; +``` + +When the file exports additional types, it will be necessary to declare a `namespace` that merges with the class and contains the exported types: + +```ts +declare class Whatever { + static default: typeof Whatever; + /* ... */ +} +declare namespace Whatever { + export interface WhateverProps { + /* ... */ + } +} +export = Whatever; +``` + +This merging namespace can also be used to declare the `default` property when the main export is a function: + +```ts +declare function Whatever(props: Whatever.WhateverProps): void; +declare namespace Whatever { + declare const _default: typeof Whatever; + export { _default as default }; + + export interface WhateverProps { + /* ... */ + } +} +export = Whatever; +``` + +## Consequences + +This problem is similar to the [“Incorrect default export”](./FalseExportDefault.md) problem, but in this case, the types are _incomplete_ rather than wholly incorrect. This incompleteness may lead TypeScript users importing from Node.js ESM code to add an extra `.default` property onto default imports to access the module’s `module.exports.default` property, even though accessing the `module.exports` would have been sufficient. + +```ts +import Whatever from "pkg"; +Whatever.default(); // Ok, but `Whatever()` would have worked! +``` + +## Common causes + +This problem is usually caused by library authors incorrectly hand-authoring declaration files to match existing JavaScript rather than generating JavaScript and type declarations from TypeScript with `tsc`, or by using a third-party TypeScript emitter that adds an extra compatibility layer to TypeScript written with `export default`. Libraries compiling to CommonJS should generally avoid writing `export default` as input syntax. diff --git a/packages/core/src/checks/entrypointResolutionProblems.ts b/packages/core/src/checks/entrypointResolutionProblems.ts index aff5e9c..374ec58 100644 --- a/packages/core/src/checks/entrypointResolutionProblems.ts +++ b/packages/core/src/checks/entrypointResolutionProblems.ts @@ -87,27 +87,35 @@ export function getEntrypointResolutionProblems( if ( typesExports.has(ts.InternalSymbolName.Default) && !typesExports.has(ts.InternalSymbolName.ExportEquals) && - jsExports.has(ts.InternalSymbolName.ExportEquals) && - !jsExports.has(ts.InternalSymbolName.Default) + jsExports.has(ts.InternalSymbolName.ExportEquals) ) { - const jsChecker = host - .createProgram([implementationResolution.fileName], { - allowJs: true, - checkJs: true, - }) - .getTypeChecker(); - // Check for `default` property on `jsModule["export="]` - if ( - !jsChecker - .getExportsAndPropertiesOfModule(jsChecker.resolveExternalModuleSymbol(jsSourceFile.symbol)) - .some((s) => s.name === "default") - ) { - problems.push({ - kind: "FalseExportDefault", - entrypoint: subpath, - resolutionKind, - }); + if (!jsExports.has(ts.InternalSymbolName.Default)) { + const jsChecker = host + .createProgram([implementationResolution.fileName], { + allowJs: true, + checkJs: true, + }) + .getTypeChecker(); + // Check for `default` property on `jsModule["export="]` + if ( + !jsChecker + .getExportsAndPropertiesOfModule(jsChecker.resolveExternalModuleSymbol(jsSourceFile.symbol)) + .some((s) => s.name === "default") + ) { + problems.push({ + kind: "FalseExportDefault", + entrypoint: subpath, + resolutionKind, + }); + return; + } } + // types have a default, JS has a default and a module.exports = + problems.push({ + kind: "MissingExportEquals", + entrypoint: subpath, + resolutionKind, + }); } } } diff --git a/packages/core/src/problems.ts b/packages/core/src/problems.ts index e096273..6082051 100644 --- a/packages/core/src/problems.ts +++ b/packages/core/src/problems.ts @@ -18,7 +18,7 @@ export interface ProblemKindInfo { export const problemKindInfo: Record = { Wildcard: { - emoji: "❓", + emoji: "🃏", title: "Wildcards", shortDescription: "Unable to check", description: "Wildcard subpaths cannot yet be analyzed by this tool.", @@ -89,6 +89,15 @@ export const problemKindInfo: Record = { docsUrl: "https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/FalseExportDefault.md", }, + MissingExportEquals: { + emoji: "❓", + title: "Types are missing an `export =`", + shortDescription: "Missing `export =`", + description: + "The JavaScript appears to set both `module.exports` and `module.exports.default` for improved compatibility, but the types only reflect the latter (by using `export default`). This will cause TypeScript under the `node16` module mode to think an extra `.default` property access is required, which will work at runtime but is not necessary. These types `export =` an object with a `default` property instead of using `export default`.", + docsUrl: + "https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/MissingExportEquals.md", + }, UnexpectedModuleSyntax: { emoji: "🚭", title: "Syntax is incompatible with detected module kind", diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index 8b21ee1..9191b0b 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -84,7 +84,8 @@ export type EntrypointResolutionProblemKind = | "CJSResolvesToESM" | "Wildcard" | "FallbackCondition" - | "FalseExportDefault"; + | "FalseExportDefault" + | "MissingExportEquals"; export interface EntrypointResolutionProblem { kind: EntrypointResolutionProblemKind; diff --git a/packages/core/src/utils.ts b/packages/core/src/utils.ts index 36a446b..1b5fe57 100644 --- a/packages/core/src/utils.ts +++ b/packages/core/src/utils.ts @@ -102,6 +102,7 @@ export function isEntrypointResolutionProblemKind(kind: ProblemKind): kind is En case "Wildcard": case "FallbackCondition": case "FalseExportDefault": + case "MissingExportEquals": return true; default: return false as AssertNever; diff --git a/packages/core/test/fixtures/anymatch@3.1.3.tgz b/packages/core/test/fixtures/anymatch@3.1.3.tgz new file mode 100644 index 0000000000000000000000000000000000000000..05145cd59dc67d2a666cd748108f185a769bbfaf GIT binary patch literal 3652 zcmV-K4!iLmiwFP!00002|Lq#>a@t5Tzx5Oy=V}2j7RFATJ$s!!V&j-A8+?E_wdL|+ z0Rt!zl5R$_!^S+yJ;S}zJ;`;?Xhss?kL*Y8uFm=a(x|(qyQjaVN1-$L=!{wAq;XJh zcIwamh--6mbLZttST&AU_2t$kJllS?vsta~>}(?3W_5FGXAA$IeT6F)k;9Rd-$6*c z!2JJ@T-^zSM&|%d+yV0iv#f(4oN;$NiJ&+r!PaK=&rtUqA377q|Hyb5&YakTQ`hqt zhvFoPLa|$^gg7|GF>VinY00wA7@xXAxPcE*0I^_Y7$D&?OoO32!hgpfRss$~S47(5}!9Y12jGK4(1 zc86?;)SL)^7&!glnpp!Ql^;YXD$TEE3{y_^t1x5^2iFJ3^N4Mi3EQ%|$93qmj=Jw_ z?K-Lq&f2XX8;A8nSgUpLc@1jKLm;5qdH1;0hC@{ANv(0(f!fIlAXdB9>^ABh>wTkp z4DI^6S{vb8h=RmY!p(z|^TS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E4TUa9K5(r&W1 z+`A7Ep^SucOHF;I_d+f63B%`M5E)213>~t8M_q~h9z*qdO#0=ivYV>z6OE8I*@NxzWxn-d-u2iH~;{Wfho%X literal 0 HcmV?d00001 diff --git a/packages/core/test/fixtures/ignore@5.2.4.tgz b/packages/core/test/fixtures/ignore@5.2.4.tgz new file mode 100644 index 0000000000000000000000000000000000000000..6e5818d3b086b94b3bca6a7d0a67d25539c0a2e2 GIT binary patch literal 14379 zcmV+`IMl}LQDUA6<%Rkfcx`?qz-$h0$5bhgznWm@^vznKT||7k&~z=7I3jH13B!&=Z5W zKbr(m=4V*nFdPS|sAi*}R6dj?$~CHF5cp#eMnEkP>Xo<%vr#v1>QID-B)>c-`@_4f1F`?%V1Mth4b{IY?e6XF?7lvLTH5d1yGI_>3RQ{rKj1+ezTJBF zj;h-F0NfuCf7^Te|2)`v^Y%!*-Fx?{4T&$?rFT19FWYaFr3IFKr0Wd4X^|PQ4Vp<@6Ev6I*VekO`_m)Rz?e@H#KJ_D^a45MIB z;W0Q@0cZAxaZ+{as=<)s7CYJ9@=7RN2fVJvG+yiCJOG>TlRusXHL>{|D&C_P9_QRo zVz8UCOE>!$%70ZW<%S0QcmEV@k~cJ9tH*1rf1K1-<-gG5I{VRwgWc2DTkj4rV-+hF zLm%Wr9d+nOVA%Z;u&D~RJDJ-)%*wOb*iWop!`x{4_5BpgHMAo8F--ih?~|pT2H4e5 zA-@O7LHofxAE%O$RMvDrm2Aq&fEoJXCBby;_k$`3Wxj=VNUcu%tUp4RAfBL&&JBSF z51oT;=%lTzx>gge}rQ&KBtzP z0p~ohk{S98V4y2H0)&}?!HU`b%m3sb_LFd$703@n6vMa#=O6-!i7@k|IwRdxs&RLK z6o=tw(1=jW!yo=GW!E1Eenf(M3G43R*iT0w!4&_6d>{uL#GLiZIEc=&(Uo~`bgWG9 zQuHgTYjweS#j5)8zr+TPaOC8<*kQ|i>Ss8GMGy^Aa)DrU5TQC}178CKl>`&;2nHku zDm6={aT+M|-MA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OJPV&%vrrut$?MJh zaS?MGM4k|_!p8cgcB>3X2_c^rpB|ZGZ-d!;g6#2zl$yp}v;^=qj)Peg1$bi8UCF=*^LQwzQQxRwixX*pU+OMHi9xa?zVB@wkP;S!vs80c@h+TP&`jbJAJ8# zcQ9%)a0l#h>N2LN{#@w0*0sKCDnFM?C*+)LFm(`|hMv)(^LC7aA9Ay{1!eaOWo0|nwjFq(qXTB_Q?x*+#NjzVZEI9IHG60ER z=uzy@Gm}Vtij)+~OTC1myFQ(1I~;-19AB;;@|%_av`eht|Niv-UvpjZ8{hv}+xTf? z{{Aog`hNf8Tl_898oX5qsW9+UVlW6{2+7OBjDLXN{}L-41I>NJZTT4oDkkyW#204w z_(Y>FrZR(yOLL_!!40GrXg0a0LvrUr;0JEh(m9`M{)ox(i9R)Awc&ntP>Iy;-qFr> zn|HlvtB4VfZnQ~68+S1ssh|&($qSmU#Mr>h?A=(Il-q}OrFb;Qur8^^I`3d;L8|dZ z@-q*P6mJuU Date: Mon, 4 Sep 2023 18:36:31 -0700 Subject: [PATCH 4/7] Add changeset --- .changeset/sweet-mangos-marry.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/sweet-mangos-marry.md diff --git a/.changeset/sweet-mangos-marry.md b/.changeset/sweet-mangos-marry.md new file mode 100644 index 0000000..303914d --- /dev/null +++ b/.changeset/sweet-mangos-marry.md @@ -0,0 +1,5 @@ +--- +"@arethetypeswrong/core": minor +--- + +New problem kind: **Missing `export =`** From f5cda9a81eab8912e29698a5f058deaf0020d5eb Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Mon, 4 Sep 2023 18:46:57 -0700 Subject: [PATCH 5/7] Update changeset description --- .changeset/sweet-mangos-marry.md | 4 ++++ docs/problems/MissingExportEquals.md | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.changeset/sweet-mangos-marry.md b/.changeset/sweet-mangos-marry.md index 303914d..9093e05 100644 --- a/.changeset/sweet-mangos-marry.md +++ b/.changeset/sweet-mangos-marry.md @@ -3,3 +3,7 @@ --- New problem kind: **Missing `export =`** + +Previously, `FalseExportDefault` had many cases of false positives where the JavaScript assigned an object to `module.exports`, and that object had a `default` property pointing back to itself. This pattern is not a true `FalseExportDefault`, but it is still problematic if the types only declare an `export default`. These kinds of false positives of `FalseExportDefault` are now instead reported as `MissingExportEquals`. + +Additionally, `FalseExportDefault` was only ever reported as being visible in `node16-esm`, but this was incorrect. The consequences are most likely to be visible in `node16-esm`, but the problem is fundamentally independent of the module resolution mode, and inaccuracies can be observed in other modes as well, especially when `esModuleInterop` is not enabled. diff --git a/docs/problems/MissingExportEquals.md b/docs/problems/MissingExportEquals.md index 86c7fa4..6deb103 100644 --- a/docs/problems/MissingExportEquals.md +++ b/docs/problems/MissingExportEquals.md @@ -65,7 +65,7 @@ export = Whatever; ## Consequences -This problem is similar to the [“Incorrect default export”](./FalseExportDefault.md) problem, but in this case, the types are _incomplete_ rather than wholly incorrect. This incompleteness may lead TypeScript users importing from Node.js ESM code to add an extra `.default` property onto default imports to access the module’s `module.exports.default` property, even though accessing the `module.exports` would have been sufficient. +This problem is similar to the [“Incorrect default export”](./FalseExportDefault.md) problem, but in this case, the types are _incomplete_ rather than wholly incorrect. This incompleteness may lead TypeScript users importing from Node.js ESM code, or CommonJS code without `esModuleInterop` enabled, to add an extra `.default` property onto default imports to access the module’s `module.exports.default` property, even though accessing the `module.exports` would have been sufficient. ```ts import Whatever from "pkg"; From f508fd032ab8e97f2b8ef8e33f7c0f05b8e28e99 Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Mon, 4 Sep 2023 18:49:37 -0700 Subject: [PATCH 6/7] Add missing CLI flag mapping --- packages/cli/src/problemUtils.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/cli/src/problemUtils.ts b/packages/cli/src/problemUtils.ts index a8b7624..69277b5 100644 --- a/packages/cli/src/problemUtils.ts +++ b/packages/cli/src/problemUtils.ts @@ -11,6 +11,7 @@ export const problemFlags: Record = { FallbackCondition: "fallback-condition", CJSOnlyExportsDefault: "cjs-only-exports-default", FalseExportDefault: "false-export-default", + MissingExportEquals: "missing-export-equals", UnexpectedModuleSyntax: "unexpected-module-syntax", InternalResolutionError: "internal-resolution-error", }; From 959229e556ce38ad52c22e3fb55f41fd3316cc29 Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Mon, 4 Sep 2023 18:51:24 -0700 Subject: [PATCH 7/7] Update CLI snapshots --- .../@vitejs__plugin-react@3.1.0.tgz.md | 12 +- packages/cli/test/snapshots/ajv@8.12.0.tgz.md | 14 +- .../cli/test/snapshots/axios@1.4.0.tgz.md | 4 +- .../cli/test/snapshots/postcss@8.4.21.tgz.md | 126 +++++++++--------- ...z --exclude-entrypoints macros -f ascii.md | 10 +- ...tgz --include-entrypoints .foo -f ascii.md | 10 +- packages/cli/test/snapshots/vue@3.3.4.tgz.md | 4 +- 7 files changed, 92 insertions(+), 88 deletions(-) diff --git a/packages/cli/test/snapshots/@vitejs__plugin-react@3.1.0.tgz.md b/packages/cli/test/snapshots/@vitejs__plugin-react@3.1.0.tgz.md index 839db41..24d30c3 100644 --- a/packages/cli/test/snapshots/@vitejs__plugin-react@3.1.0.tgz.md +++ b/packages/cli/test/snapshots/@vitejs__plugin-react@3.1.0.tgz.md @@ -6,14 +6,16 @@ $ attw @vitejs__plugin-react@3.1.0.tgz -f table-flipped @vitejs/plugin-react v3.1.0 +❓ The JavaScript appears to set both module.exports and module.exports.default for improved compatibility, but the types only reflect the latter (by using export default). This will cause TypeScript under the node16 module mode to think an extra .default property access is required, which will work at runtime but is not necessary. These types export = an object with a default property instead of using export default. https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/MissingExportEquals.md + 🎭 Import resolved to a CommonJS type declaration file, but an ESM JavaScript file. https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/FalseCJS.md -┌────────────────────────┬────────┬───────────────────┬────────────────────────┬─────────┐ -│ │ node10 │ node16 (from CJS) │ node16 (from ESM) │ bundler │ -├────────────────────────┼────────┼───────────────────┼────────────────────────┼─────────┤ -│ "@vitejs/plugin-react" │ 🟢 │ 🟢 (CJS) │ 🎭 Masquerading as CJS │ 🟢 │ -└────────────────────────┴────────┴───────────────────┴────────────────────────┴─────────┘ +┌────────────────────────┬───────────────────────┬───────────────────────┬────────────────────────┬─────────┐ +│ │ node10 │ node16 (from CJS) │ node16 (from ESM) │ bundler │ +├────────────────────────┼───────────────────────┼───────────────────────┼────────────────────────┼─────────┤ +│ "@vitejs/plugin-react" │ ❓ Missing `export =` │ ❓ Missing `export =` │ 🎭 Masquerading as CJS │ 🟢 │ +└────────────────────────┴───────────────────────┴───────────────────────┴────────────────────────┴─────────┘ ``` diff --git a/packages/cli/test/snapshots/ajv@8.12.0.tgz.md b/packages/cli/test/snapshots/ajv@8.12.0.tgz.md index 1129684..fb2e0bd 100644 --- a/packages/cli/test/snapshots/ajv@8.12.0.tgz.md +++ b/packages/cli/test/snapshots/ajv@8.12.0.tgz.md @@ -11,16 +11,16 @@ Build tools: - rollup@^2.44.0 - @rollup/plugin-typescript@^10.0.1 - No problems found 🌟 +❓ The JavaScript appears to set both module.exports and module.exports.default for improved compatibility, but the types only reflect the latter (by using export default). This will cause TypeScript under the node16 module mode to think an extra .default property access is required, which will work at runtime but is not necessary. These types export = an object with a default property instead of using export default. https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/MissingExportEquals.md -┌───────┬────────┬───────────────────┬───────────────────┬─────────┐ -│ │ node10 │ node16 (from CJS) │ node16 (from ESM) │ bundler │ -├───────┼────────┼───────────────────┼───────────────────┼─────────┤ -│ "ajv" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ -└───────┴────────┴───────────────────┴───────────────────┴─────────┘ +┌───────┬───────────────────────┬───────────────────────┬───────────────────────┬───────────────────────┐ +│ │ node10 │ node16 (from CJS) │ node16 (from ESM) │ bundler │ +├───────┼───────────────────────┼───────────────────────┼───────────────────────┼───────────────────────┤ +│ "ajv" │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ +└───────┴───────────────────────┴───────────────────────┴───────────────────────┴───────────────────────┘ ``` -Exit code: 0 \ No newline at end of file +Exit code: 1 \ No newline at end of file diff --git a/packages/cli/test/snapshots/axios@1.4.0.tgz.md b/packages/cli/test/snapshots/axios@1.4.0.tgz.md index 8813aaa..c962678 100644 --- a/packages/cli/test/snapshots/axios@1.4.0.tgz.md +++ b/packages/cli/test/snapshots/axios@1.4.0.tgz.md @@ -10,7 +10,7 @@ Build tools: - typescript@^4.8.4 - rollup@^2.67.0 -❓ Wildcard subpaths cannot yet be analyzed by this tool. https://github.com/arethetypeswrong/arethetypeswrong.github.io/issues/40 +🃏 Wildcard subpaths cannot yet be analyzed by this tool. https://github.com/arethetypeswrong/arethetypeswrong.github.io/issues/40 💀 Import failed to resolve to type declarations or JavaScript files. https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/NoResolution.md @@ -24,7 +24,7 @@ Build tools: ├─────────────────────────────────────────┼──────────────────────┼──────────────────────────────┼────────────────────┼────────────────────┤ │ "axios" │ 🟢 │ 🟢 (CJS) │ 🟢 (ESM) │ 🟢 │ ├─────────────────────────────────────────┼──────────────────────┼──────────────────────────────┼────────────────────┼────────────────────┤ -│ "axios/unsafe/*" │ ❓ Unable to check │ ❓ Unable to check │ ❓ Unable to check │ ❓ Unable to check │ +│ "axios/unsafe/*" │ 🃏 Unable to check │ 🃏 Unable to check │ 🃏 Unable to check │ 🃏 Unable to check │ ├─────────────────────────────────────────┼──────────────────────┼──────────────────────────────┼────────────────────┼────────────────────┤ │ "axios/unsafe/core/settle.js" │ 💀 Resolution failed │ ❌ No types │ ❌ No types │ ❌ No types │ │ │ │ ⚠️ ESM (dynamic import only) │ │ │ diff --git a/packages/cli/test/snapshots/postcss@8.4.21.tgz.md b/packages/cli/test/snapshots/postcss@8.4.21.tgz.md index e7380c2..62ba6b3 100644 --- a/packages/cli/test/snapshots/postcss@8.4.21.tgz.md +++ b/packages/cli/test/snapshots/postcss@8.4.21.tgz.md @@ -6,6 +6,8 @@ $ attw postcss@8.4.21.tgz -f table-flipped postcss v8.4.21 +❓ The JavaScript appears to set both module.exports and module.exports.default for improved compatibility, but the types only reflect the latter (by using export default). This will cause TypeScript under the node16 module mode to think an extra .default property access is required, which will work at runtime but is not necessary. These types export = an object with a default property instead of using export default. https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/MissingExportEquals.md + 🎭 Import resolved to a CommonJS type declaration file, but an ESM JavaScript file. https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/FalseCJS.md 🐛 Import resolved to types through a conditional package.json export, but only after failing to resolve through an earlier condition. This behavior is a TypeScript bug (https://github.com/microsoft/TypeScript/issues/50762). It may misrepresent the runtime behavior of this import and should not be relied upon. https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/FallbackCondition.md @@ -13,68 +15,68 @@ postcss v8.4.21 ❌ Import resolved to JavaScript files, but no type declarations were found. https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/UntypedResolution.md -┌──────────────────────────────────┬─────────────┬───────────────────┬────────────────────────────┬────────────────────────────┐ -│ │ node10 │ node16 (from CJS) │ node16 (from ESM) │ bundler │ -├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ -│ "postcss" │ 🟢 │ 🟢 (CJS) │ 🎭 Masquerading as CJS │ 🐛 Used fallback condition │ -│ │ │ │ 🐛 Used fallback condition │ │ -├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/at-rule" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ -├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/comment" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ -├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/container" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ -├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/css-syntax-error" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ -├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/declaration" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ -├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/fromJSON" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ -├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/input" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ -├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/lazy-result" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ -├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/no-work-result" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ -├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/list" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ -├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/map-generator" │ ❌ No types │ ❌ No types │ ❌ No types │ ❌ No types │ -├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/node" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ -├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/parse" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ -├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/parser" │ ❌ No types │ ❌ No types │ ❌ No types │ ❌ No types │ -├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/postcss" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ -├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/previous-map" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ -├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/processor" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ -├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/result" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ -├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/root" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ -├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/rule" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ -├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/stringifier" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ -├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/stringify" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ -├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/symbols" │ ❌ No types │ ❌ No types │ ❌ No types │ ❌ No types │ -├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/terminal-highlight" │ ❌ No types │ ❌ No types │ ❌ No types │ ❌ No types │ -├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/tokenize" │ ❌ No types │ ❌ No types │ ❌ No types │ ❌ No types │ -├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/warn-once" │ ❌ No types │ ❌ No types │ ❌ No types │ ❌ No types │ -├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ -│ "postcss/lib/warning" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ -├──────────────────────────────────┼─────────────┼───────────────────┼────────────────────────────┼────────────────────────────┤ -│ "postcss/package.json" │ 🟢 (JSON) │ 🟢 (JSON) │ 🟢 (JSON) │ 🟢 (JSON) │ -└──────────────────────────────────┴─────────────┴───────────────────┴────────────────────────────┴────────────────────────────┘ +┌──────────────────────────────────┬───────────────────────┬───────────────────────┬────────────────────────────┬────────────────────────────┐ +│ │ node10 │ node16 (from CJS) │ node16 (from ESM) │ bundler │ +├──────────────────────────────────┼───────────────────────┼───────────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss" │ ❓ Missing `export =` │ ❓ Missing `export =` │ 🎭 Masquerading as CJS │ 🐛 Used fallback condition │ +│ │ │ │ 🐛 Used fallback condition │ │ +├──────────────────────────────────┼───────────────────────┼───────────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/at-rule" │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ +├──────────────────────────────────┼───────────────────────┼───────────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/comment" │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ +├──────────────────────────────────┼───────────────────────┼───────────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/container" │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ +├──────────────────────────────────┼───────────────────────┼───────────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/css-syntax-error" │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ +├──────────────────────────────────┼───────────────────────┼───────────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/declaration" │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ +├──────────────────────────────────┼───────────────────────┼───────────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/fromJSON" │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ +├──────────────────────────────────┼───────────────────────┼───────────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/input" │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ +├──────────────────────────────────┼───────────────────────┼───────────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/lazy-result" │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ +├──────────────────────────────────┼───────────────────────┼───────────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/no-work-result" │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ +├──────────────────────────────────┼───────────────────────┼───────────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/list" │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ +├──────────────────────────────────┼───────────────────────┼───────────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/map-generator" │ ❌ No types │ ❌ No types │ ❌ No types │ ❌ No types │ +├──────────────────────────────────┼───────────────────────┼───────────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/node" │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ +├──────────────────────────────────┼───────────────────────┼───────────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/parse" │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ +├──────────────────────────────────┼───────────────────────┼───────────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/parser" │ ❌ No types │ ❌ No types │ ❌ No types │ ❌ No types │ +├──────────────────────────────────┼───────────────────────┼───────────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/postcss" │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ +├──────────────────────────────────┼───────────────────────┼───────────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/previous-map" │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ +├──────────────────────────────────┼───────────────────────┼───────────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/processor" │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ +├──────────────────────────────────┼───────────────────────┼───────────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/result" │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ +├──────────────────────────────────┼───────────────────────┼───────────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/root" │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ +├──────────────────────────────────┼───────────────────────┼───────────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/rule" │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ +├──────────────────────────────────┼───────────────────────┼───────────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/stringifier" │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ +├──────────────────────────────────┼───────────────────────┼───────────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/stringify" │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ +├──────────────────────────────────┼───────────────────────┼───────────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/symbols" │ ❌ No types │ ❌ No types │ ❌ No types │ ❌ No types │ +├──────────────────────────────────┼───────────────────────┼───────────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/terminal-highlight" │ ❌ No types │ ❌ No types │ ❌ No types │ ❌ No types │ +├──────────────────────────────────┼───────────────────────┼───────────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/tokenize" │ ❌ No types │ ❌ No types │ ❌ No types │ ❌ No types │ +├──────────────────────────────────┼───────────────────────┼───────────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/warn-once" │ ❌ No types │ ❌ No types │ ❌ No types │ ❌ No types │ +├──────────────────────────────────┼───────────────────────┼───────────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/lib/warning" │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ ❓ Missing `export =` │ +├──────────────────────────────────┼───────────────────────┼───────────────────────┼────────────────────────────┼────────────────────────────┤ +│ "postcss/package.json" │ 🟢 (JSON) │ 🟢 (JSON) │ 🟢 (JSON) │ 🟢 (JSON) │ +└──────────────────────────────────┴───────────────────────┴───────────────────────┴────────────────────────────┴────────────────────────────┘ ``` diff --git a/packages/cli/test/snapshots/vue@3.3.4.tgz --exclude-entrypoints macros -f ascii.md b/packages/cli/test/snapshots/vue@3.3.4.tgz --exclude-entrypoints macros -f ascii.md index 65f8b6e..8f50f42 100644 --- a/packages/cli/test/snapshots/vue@3.3.4.tgz --exclude-entrypoints macros -f ascii.md +++ b/packages/cli/test/snapshots/vue@3.3.4.tgz --exclude-entrypoints macros -f ascii.md @@ -10,7 +10,7 @@ vue v3.3.4 💀 Import failed to resolve to type declarations or JavaScript files. https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/NoResolution.md -❓ Wildcard subpaths cannot yet be analyzed by this tool. https://github.com/arethetypeswrong/arethetypeswrong.github.io/issues/40 +🃏 Wildcard subpaths cannot yet be analyzed by this tool. https://github.com/arethetypeswrong/arethetypeswrong.github.io/issues/40 🥴 Import found in a type declaration file failed to resolve. Either this indicates that runtime resolution errors will occur, or (more likely) the types misrepresent the contents of the JavaScript files. https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/InternalResolutionError.md @@ -71,10 +71,10 @@ bundler: 🟢 "vue/dist/*" -node10: ❓ Unable to check -node16 (from CJS): ❓ Unable to check -node16 (from ESM): ❓ Unable to check -bundler: ❓ Unable to check +node10: 🃏 Unable to check +node16 (from CJS): 🃏 Unable to check +node16 (from ESM): 🃏 Unable to check +bundler: 🃏 Unable to check *********************************** diff --git a/packages/cli/test/snapshots/vue@3.3.4.tgz --include-entrypoints .foo -f ascii.md b/packages/cli/test/snapshots/vue@3.3.4.tgz --include-entrypoints .foo -f ascii.md index 926827b..2a1f90d 100644 --- a/packages/cli/test/snapshots/vue@3.3.4.tgz --include-entrypoints .foo -f ascii.md +++ b/packages/cli/test/snapshots/vue@3.3.4.tgz --include-entrypoints .foo -f ascii.md @@ -10,7 +10,7 @@ vue v3.3.4 💀 Import failed to resolve to type declarations or JavaScript files. https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/NoResolution.md -❓ Wildcard subpaths cannot yet be analyzed by this tool. https://github.com/arethetypeswrong/arethetypeswrong.github.io/issues/40 +🃏 Wildcard subpaths cannot yet be analyzed by this tool. https://github.com/arethetypeswrong/arethetypeswrong.github.io/issues/40 🥴 Import found in a type declaration file failed to resolve. Either this indicates that runtime resolution errors will occur, or (more likely) the types misrepresent the contents of the JavaScript files. https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/InternalResolutionError.md @@ -71,10 +71,10 @@ bundler: 🟢 "vue/dist/*" -node10: ❓ Unable to check -node16 (from CJS): ❓ Unable to check -node16 (from ESM): ❓ Unable to check -bundler: ❓ Unable to check +node10: 🃏 Unable to check +node16 (from CJS): 🃏 Unable to check +node16 (from ESM): 🃏 Unable to check +bundler: 🃏 Unable to check *********************************** diff --git a/packages/cli/test/snapshots/vue@3.3.4.tgz.md b/packages/cli/test/snapshots/vue@3.3.4.tgz.md index 9974d36..71e1729 100644 --- a/packages/cli/test/snapshots/vue@3.3.4.tgz.md +++ b/packages/cli/test/snapshots/vue@3.3.4.tgz.md @@ -10,7 +10,7 @@ vue v3.3.4 💀 Import failed to resolve to type declarations or JavaScript files. https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/NoResolution.md -❓ Wildcard subpaths cannot yet be analyzed by this tool. https://github.com/arethetypeswrong/arethetypeswrong.github.io/issues/40 +🃏 Wildcard subpaths cannot yet be analyzed by this tool. https://github.com/arethetypeswrong/arethetypeswrong.github.io/issues/40 🥴 Import found in a type declaration file failed to resolve. Either this indicates that runtime resolution errors will occur, or (more likely) the types misrepresent the contents of the JavaScript files. https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/InternalResolutionError.md @@ -30,7 +30,7 @@ vue v3.3.4 ├───────────────────────┼──────────────────────┼────────────────────┼──────────────────────────────┼────────────────────┤ │ "vue/jsx" │ 🟢 │ 🟢 (CJS) │ 🟢 (CJS) │ 🟢 │ ├───────────────────────┼──────────────────────┼────────────────────┼──────────────────────────────┼────────────────────┤ -│ "vue/dist/*" │ ❓ Unable to check │ ❓ Unable to check │ ❓ Unable to check │ ❓ Unable to check │ +│ "vue/dist/*" │ 🃏 Unable to check │ 🃏 Unable to check │ 🃏 Unable to check │ 🃏 Unable to check │ ├───────────────────────┼──────────────────────┼────────────────────┼──────────────────────────────┼────────────────────┤ │ "vue/package.json" │ 🟢 (JSON) │ 🟢 (JSON) │ 🟢 (JSON) │ 🟢 (JSON) │ ├───────────────────────┼──────────────────────┼────────────────────┼──────────────────────────────┼────────────────────┤