Skip to content

Commit 3feccd1

Browse files
committed
Don't deprecate @types/web, etc.
1 parent 124fd2a commit 3feccd1

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

packages/deprecate/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@
1212
"@definitelytyped/utils": "^0.0.121",
1313
"@octokit/graphql": "^4.8.0",
1414
"libnpmsearch": "^5.0.3",
15+
"typescript-dom-lib-generator": "https://github.com/microsoft/TypeScript-DOM-lib-generator.git",
1516
"yargs": "^17.5.1"
1617
},
1718
"devDependencies": {
1819
"@types/libnpmsearch": "^2.0.3",
1920
"@types/yargs": "^17.0.10"
2021
},
21-
"private": true
22+
"private": true,
23+
"type": "module"
2224
}

packages/deprecate/src/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@ import { AllPackages, getDefinitelyTyped } from "@definitelytyped/definitions-pa
66
import { NpmPublishClient } from "@definitelytyped/utils";
77
import { graphql } from "@octokit/graphql";
88
import search from "libnpmsearch";
9+
// @ts-expect-error
10+
import { packages } from "typescript-dom-lib-generator/deploy/createTypesPackages.js";
911
import yargs from "yargs";
1012

1113
(async () => {
12-
const { dryRun } = yargs.argv as never;
14+
const { dryRun } = yargs(process.argv).argv as never;
1315
const options = { definitelyTypedPath: undefined, progress: false, parseInParallel: false };
16+
// @ts-expect-error
17+
const domLibs = new Set(packages.map((pkg) => pkg.name));
1418
const dt = await getDefinitelyTyped(options, console);
1519
const allPackages = await AllPackages.read(dt);
1620
const client = await NpmPublishClient.create(process.env.NPM_TOKEN!);
@@ -22,6 +26,8 @@ import yargs from "yargs";
2226
// Won't return already-deprecated packages.
2327
results = await search("@types", opts);
2428
for (const result of results) {
29+
// Skip @types/web, etc.
30+
if (domLibs.has(result.name)) continue;
2531
const types = result.name.slice("@types/".length);
2632
// Skip ones that exist, either in the types/ directory or in notNeededPackages.json.
2733
if (allPackages.tryGetLatestVersion(types) || allPackages.getNotNeededPackage(types)) continue;

packages/deprecate/tsconfig.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"extends": "../../tsconfig.base.json",
33
"compilerOptions": {
4+
"module": "es6",
5+
"moduleResolution": "node",
46
"rootDir": "src/",
57
"outDir": "dist/"
68
},

yarn.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9126,6 +9126,10 @@ typedarray@^0.0.6:
91269126
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
91279127
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
91289128

9129+
"typescript-dom-lib-generator@https://github.com/microsoft/TypeScript-DOM-lib-generator.git":
9130+
version "0.0.1"
9131+
resolved "https://github.com/microsoft/TypeScript-DOM-lib-generator.git#bb1b98941082ed7585b4bab8215774d4833ddc49"
9132+
91299133
typescript@^4.1.0:
91309134
version "4.5.5"
91319135
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.5.tgz#d8c953832d28924a9e3d37c73d729c846c5896f3"

0 commit comments

Comments
 (0)