Skip to content

Commit 55dacdc

Browse files
committed
Check all d.ts files
1 parent c917dc5 commit 55dacdc

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

deploy/deployChangedPackages.js

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// ones which have changed.
77

88
import * as fs from "fs";
9+
import * as path from "path";
910
import { spawnSync } from "child_process";
1011
import { Octokit } from "@octokit/rest";
1112
import { printUnifiedDiff } from "print-diff";
@@ -41,8 +42,7 @@ for (const dirName of fs.readdirSync(generatedDir)) {
4142
throw new Error(`Couldn't find ${pkgJSON.name}`);
4243
}
4344

44-
const dtsFiles = fs
45-
.readdirSync(packageDir)
45+
const dtsFiles = readdirRecursive(fileURLToPath(packageDir))
4646
.filter((f) => f.endsWith(".d.ts"));
4747

4848
const releaseNotes = [];
@@ -167,3 +167,22 @@ function verify() {
167167
function getFileFromUnpkg(filepath) {
168168
return fetch(`https://unpkg.com/${filepath}`).then((r) => r.text());
169169
}
170+
171+
/** @param {string} dir */
172+
function readdirRecursive(dir) {
173+
/** @type {string[]} */
174+
let results = [];
175+
/** @param {string} currentDir */
176+
function readDir(currentDir) {
177+
const entries = fs.readdirSync(currentDir, { withFileTypes: true });
178+
for (const entry of entries) {
179+
const fullPath = path.join(currentDir, entry.name);
180+
results.push(path.relative(dir, fullPath));
181+
if (entry.isDirectory()) {
182+
readDir(fullPath);
183+
}
184+
}
185+
}
186+
readDir(dir);
187+
return results;
188+
}

0 commit comments

Comments
 (0)