Skip to content

Commit

Permalink
Check for .d.mts and .d.cts files everywhere we check for .d.ts files (
Browse files Browse the repository at this point in the history
  • Loading branch information
weswigham authored Oct 13, 2021
1 parent f3c88a4 commit bba41f7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/definitions-parser/src/lib/definition-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ function getTypingDataForSingleTypesVersion(
}
}
checkAllFilesUsed(ls, usedFiles, otherFiles, packageName, fs);
for (const untestedTypeFile of filter(otherFiles, name => name.endsWith(".d.ts"))) {
for (const untestedTypeFile of filter(otherFiles, name => name.endsWith(".d.ts") || name.endsWith(".d.mts") || name.endsWith(".d.cts"))) {
// add d.ts files from OTHER_FILES.txt in order get their dependencies
// tslint:disable-next-line:non-literal-fs-path -- Not a reference to the fs package
types.set(untestedTypeFile, createSourceFile(untestedTypeFile, fs.readFile(untestedTypeFile)));
Expand Down
2 changes: 1 addition & 1 deletion packages/definitions-parser/src/lib/module-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export function allReferencedFiles(
// tslint:disable-next-line:non-literal-fs-path -- Not a reference to the fs package
if (fs.exists(resolvedFilename)) {
const src = createSourceFile(resolvedFilename, readFileAndThrowOnBOM(resolvedFilename, fs));
if (resolvedFilename.endsWith(".d.ts")) {
if (resolvedFilename.endsWith(".d.ts") || resolvedFilename.endsWith(".d.mts") || resolvedFilename.endsWith(".d.cts")) {
types.set(resolvedFilename, src);
} else {
tests.set(resolvedFilename, src);
Expand Down
2 changes: 1 addition & 1 deletion packages/definitions-parser/src/packages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ export class TypingsData extends PackageBase {
return this.data.files;
}
get dtsFiles(): readonly string[] {
return this.data.files.filter(f => f.endsWith(".d.ts"));
return this.data.files.filter(f => f.endsWith(".d.ts") || f.endsWith(".d.mts") || f.endsWith(".d.cts"));
}
get license(): License {
return this.data.license;
Expand Down

0 comments on commit bba41f7

Please sign in to comment.