Skip to content

Commit b2914fe

Browse files
authored
Upgrade dependencies (#1649)
* Upgrade dependencies * Update record.ts * Update mapper.ts
1 parent 3639b0d commit b2914fe

22 files changed

+1314
-666
lines changed

deploy/createTypesPackages.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ const go = async () => {
8686
pkg.files.forEach((fileRef) => {
8787
fs.copyFileSync(
8888
new URL(fileRef.from, import.meta.url),
89-
new URL(fileRef.to, packagePath)
89+
new URL(fileRef.to, packagePath),
9090
);
9191
});
9292

@@ -120,7 +120,7 @@ async function updatePackageJSON(pkg, packagePath) {
120120
let version = "0.0.1";
121121
try {
122122
const npmResponse = await fetch(
123-
`https://registry.npmjs.org/${packageJSON.name}`
123+
`https://registry.npmjs.org/${packageJSON.name}`,
124124
);
125125
/** @type {*} */
126126
const npmPackage = await npmResponse.json();
@@ -143,9 +143,9 @@ async function updatePackageJSON(pkg, packagePath) {
143143

144144
fs.writeFileSync(
145145
pkgJSONPath,
146-
format(JSON.stringify(packageJSON), {
146+
await format(JSON.stringify(packageJSON), {
147147
filepath: fileURLToPath(pkgJSONPath),
148-
})
148+
}),
149149
);
150150

151151
return packageJSON;
@@ -167,7 +167,7 @@ function copyREADME(pkg, pkgJSON, writePath) {
167167
.replace("{{version}}", pkgJSON.version)
168168
.replace(
169169
"{{release_href}}",
170-
`https://github.com/microsoft/TypeScript-DOM-lib-generator/releases/tag/${htmlEncodedTag}`
170+
`https://github.com/microsoft/TypeScript-DOM-lib-generator/releases/tag/${htmlEncodedTag}`,
171171
);
172172

173173
fs.writeFileSync(writePath, readme);
@@ -200,7 +200,7 @@ export function postProcessDTSFiles(pkg, packagePath) {
200200
iterateThroughFiles((content) => {
201201
return content.replace(
202202
"abort(reason?: any): AbortSignal;",
203-
"// abort(reason?: any): AbortSignal; - To be re-added in the future"
203+
"// abort(reason?: any): AbortSignal; - To be re-added in the future",
204204
);
205205
});
206206

deploy/deployChangedPackages.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ for (const dirName of fs.readdirSync(generatedDir)) {
6161

6262
try {
6363
const oldFile = await getFileFromUnpkg(
64-
`${pkgJSON.name}@${olderVersion}/${filemap.to}`
64+
`${pkgJSON.name}@${olderVersion}/${filemap.to}`,
6565
);
6666
console.log(` - ${file}`);
6767
if (oldFile !== generatedDTSContent)
@@ -100,13 +100,13 @@ Assuming that this means we need to upload this package.`);
100100

101101
await createRelease(
102102
`${pkgJSON.name}@${pkgJSON.version}`,
103-
releaseNotes.join("\n\n")
103+
releaseNotes.join("\n\n"),
104104
);
105105
}
106106
} else {
107107
console.log(
108108
"Wanting to run: 'npm publish --access public' in " +
109-
fileURLToPath(packageDir)
109+
fileURLToPath(packageDir),
110110
);
111111
}
112112

@@ -148,7 +148,7 @@ async function createRelease(tag, body) {
148148
});
149149
} catch (error) {
150150
console.error(
151-
"Creating the GitHub release failed, this is likely due to re-running the deploy."
151+
"Creating the GitHub release failed, this is likely due to re-running the deploy.",
152152
);
153153
}
154154
}
@@ -157,7 +157,7 @@ function verify() {
157157
const authToken = process.env.GITHUB_TOKEN || process.env.GITHUB_API_TOKEN;
158158
if (!authToken) {
159159
throw new Error(
160-
"There isn't an ENV var set up for creating a GitHub release, expected GITHUB_TOKEN."
160+
"There isn't an ENV var set up for creating a GitHub release, expected GITHUB_TOKEN.",
161161
);
162162
}
163163
}

deploy/migrate.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ const tscWD = maybeTSWorkingDir.find((wd) => existsSync(wd));
1414

1515
if (!tscWD)
1616
throw new Error(
17-
"Could not find a TypeScript clone to put the generated files in."
17+
"Could not find a TypeScript clone to put the generated files in.",
1818
);
1919

2020
const generatedFiles = readdirSync("generated");
2121
const filesToSend = generatedFiles.filter(
22-
(file) => file.includes("dom.") || file.includes("webworker.")
22+
(file) => file.includes("dom.") || file.includes("webworker."),
2323
);
2424

2525
const generatedDir = new URL("../generated/", import.meta.url);
2626
postProcessDTSFiles(
2727
/** @type {any} */
2828
({ files: filesToSend.map((f) => ({ to: f })) }),
29-
generatedDir
29+
generatedDir,
3030
);
3131

3232
filesToSend.forEach((file) => {
@@ -38,5 +38,5 @@ filesToSend.forEach((file) => {
3838
console.log(
3939
`Moved ${filesToSend
4040
.map((f) => f.replace(".generated", ""))
41-
.join(", ")} to '${tscWD}/src/lib'.`
41+
.join(", ")} to '${tscWD}/src/lib'.`,
4242
);

deploy/versionChangelog.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { basename } from "path";
99
const [name, before, to] = process.argv.slice(2);
1010
if (!name || !before || !to) {
1111
throw new Error(
12-
"Expected three arguments: package name, version before, version to"
12+
"Expected three arguments: package name, version before, version to",
1313
);
1414
}
1515

0 commit comments

Comments
 (0)