Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions deploy/createTypesPackages.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const go = async () => {
pkg.files.forEach((fileRef) => {
fs.copyFileSync(
new URL(fileRef.from, import.meta.url),
new URL(fileRef.to, packagePath)
new URL(fileRef.to, packagePath),
);
});

Expand Down Expand Up @@ -120,7 +120,7 @@ async function updatePackageJSON(pkg, packagePath) {
let version = "0.0.1";
try {
const npmResponse = await fetch(
`https://registry.npmjs.org/${packageJSON.name}`
`https://registry.npmjs.org/${packageJSON.name}`,
);
/** @type {*} */
const npmPackage = await npmResponse.json();
Expand All @@ -143,9 +143,9 @@ async function updatePackageJSON(pkg, packagePath) {

fs.writeFileSync(
pkgJSONPath,
format(JSON.stringify(packageJSON), {
await format(JSON.stringify(packageJSON), {
filepath: fileURLToPath(pkgJSONPath),
})
}),
);

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

fs.writeFileSync(writePath, readme);
Expand Down Expand Up @@ -200,7 +200,7 @@ export function postProcessDTSFiles(pkg, packagePath) {
iterateThroughFiles((content) => {
return content.replace(
"abort(reason?: any): AbortSignal;",
"// abort(reason?: any): AbortSignal; - To be re-added in the future"
"// abort(reason?: any): AbortSignal; - To be re-added in the future",
);
});

Expand Down
10 changes: 5 additions & 5 deletions deploy/deployChangedPackages.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ for (const dirName of fs.readdirSync(generatedDir)) {

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

await createRelease(
`${pkgJSON.name}@${pkgJSON.version}`,
releaseNotes.join("\n\n")
releaseNotes.join("\n\n"),
);
}
} else {
console.log(
"Wanting to run: 'npm publish --access public' in " +
fileURLToPath(packageDir)
fileURLToPath(packageDir),
);
}

Expand Down Expand Up @@ -148,7 +148,7 @@ async function createRelease(tag, body) {
});
} catch (error) {
console.error(
"Creating the GitHub release failed, this is likely due to re-running the deploy."
"Creating the GitHub release failed, this is likely due to re-running the deploy.",
);
}
}
Expand All @@ -157,7 +157,7 @@ function verify() {
const authToken = process.env.GITHUB_TOKEN || process.env.GITHUB_API_TOKEN;
if (!authToken) {
throw new Error(
"There isn't an ENV var set up for creating a GitHub release, expected GITHUB_TOKEN."
"There isn't an ENV var set up for creating a GitHub release, expected GITHUB_TOKEN.",
);
}
}
Expand Down
8 changes: 4 additions & 4 deletions deploy/migrate.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ const tscWD = maybeTSWorkingDir.find((wd) => existsSync(wd));

if (!tscWD)
throw new Error(
"Could not find a TypeScript clone to put the generated files in."
"Could not find a TypeScript clone to put the generated files in.",
);

const generatedFiles = readdirSync("generated");
const filesToSend = generatedFiles.filter(
(file) => file.includes("dom.") || file.includes("webworker.")
(file) => file.includes("dom.") || file.includes("webworker."),
);

const generatedDir = new URL("../generated/", import.meta.url);
postProcessDTSFiles(
/** @type {any} */
({ files: filesToSend.map((f) => ({ to: f })) }),
generatedDir
generatedDir,
);

filesToSend.forEach((file) => {
Expand All @@ -38,5 +38,5 @@ filesToSend.forEach((file) => {
console.log(
`Moved ${filesToSend
.map((f) => f.replace(".generated", ""))
.join(", ")} to '${tscWD}/src/lib'.`
.join(", ")} to '${tscWD}/src/lib'.`,
);
2 changes: 1 addition & 1 deletion deploy/versionChangelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { basename } from "path";
const [name, before, to] = process.argv.slice(2);
if (!name || !before || !to) {
throw new Error(
"Expected three arguments: package name, version before, version to"
"Expected three arguments: package name, version before, version to",
);
}

Expand Down
Loading