Skip to content

Commit

Permalink
Update deps, fix pacote and test (#1099)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebailey authored Nov 7, 2024
1 parent 492bc3f commit 3a00e49
Show file tree
Hide file tree
Showing 18 changed files with 1,732 additions and 3,123 deletions.
8 changes: 8 additions & 0 deletions .changeset/chatty-eggs-turn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@definitelytyped/dtslint-runner": patch
"@definitelytyped/eslint-plugin": patch
"@definitelytyped/header-parser": patch
"@definitelytyped/dtslint": patch
---

Update deps
5 changes: 5 additions & 0 deletions .changeset/fair-weeks-move.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@definitelytyped/definitions-parser": patch
---

Update pacote
7 changes: 5 additions & 2 deletions .knip.jsonc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://unpkg.com/knip@2/schema.json",
"$schema": "https://unpkg.com/knip@5/schema.json",
"workspaces": {
".": {
"ignoreBinaries": ["only-allow"]
Expand Down Expand Up @@ -30,7 +30,10 @@
},
"packages/dtslint-runner": {
"entry": ["src/index.ts", "src/post-results.ts"],
"project": "**/*.ts"
"project": "**/*.ts",
"ignoreDependencies": [
"@definitelytyped/dtslint"
]
},
"packages/eslint-plugin": {
"entry": "src/index.ts",
Expand Down
25 changes: 11 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@
"ci:publish": "pnpm changeset tag && pnpm publish -r"
},
"devDependencies": {
"@changesets/cli": "^2.27.5",
"@types/jest": "^29.5.11",
"@types/node": "^18.19.58",
"@types/yargs": "^17.0.32",
"@typescript-eslint/eslint-plugin": "^8.11.0",
"@typescript-eslint/parser": "^8.11.0",
"@changesets/cli": "^2.27.9",
"@types/jest": "^29.5.14",
"@types/node": "^18.19.64",
"@types/yargs": "^17.0.33",
"@typescript-eslint/eslint-plugin": "^8.13.0",
"@typescript-eslint/parser": "^8.13.0",
"eslint": "^8.57.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsdoc": "^48.0.2",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jsdoc": "^48.11.0",
"jest": "^29.7.0",
"knip": "^4.6.0",
"prettier": "^3.2.2",
"ts-jest": "^29.1.1",
"knip": "^5.36.3",
"prettier": "^3.3.3",
"ts-jest": "^29.2.5",
"typescript": "^5.6.3"
},
"pnpm": {
Expand All @@ -41,9 +41,6 @@
"strip-json-comments",
"typescript-*.*"
]
},
"patchedDependencies": {
"[email protected]": "patches/[email protected]"
}
},
"packageManager": "[email protected]"
Expand Down
8 changes: 4 additions & 4 deletions packages/definitions-parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
"@definitelytyped/header-parser": "workspace:*",
"@definitelytyped/typescript-versions": "workspace:*",
"@definitelytyped/utils": "workspace:*",
"@types/node": "^18.19.58",
"@types/semver": "^7.5.6",
"pacote": "^17.0.5",
"semver": "^7.5.4"
"@types/node": "^18.19.64",
"@types/semver": "^7.5.8",
"pacote": "^20.0.0",
"semver": "^7.6.3"
},
"devDependencies": {
"@types/pacote": "^11.1.8",
Expand Down
4 changes: 2 additions & 2 deletions packages/dts-gen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
"yargs": "^17.7.2"
},
"devDependencies": {
"@types/node": "^18.19.58",
"@types/node": "^18.19.64",
"@types/parse-git-config": "^3.0.4",
"@types/yargs": "^17.0.32",
"@types/yargs": "^17.0.33",
"ecurve": "1.0.6",
"jquery": "3.7.1",
"lodash": "4.17.21"
Expand Down
4 changes: 2 additions & 2 deletions packages/dtslint-runner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
"@definitelytyped/definitions-parser": "workspace:*",
"@definitelytyped/dtslint": "workspace:*",
"@definitelytyped/utils": "workspace:*",
"@octokit/rest": "^20.0.2",
"@octokit/rest": "^20.1.1",
"yargs": "^17.7.2"
},
"devDependencies": {
"glob": "^10.3.10"
"glob": "^10.4.5"
},
"engines": {
"node": ">=18.18.0"
Expand Down
18 changes: 9 additions & 9 deletions packages/dtslint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,22 @@
"@definitelytyped/typescript-packages": "workspace:*",
"@definitelytyped/typescript-versions": "workspace:*",
"@definitelytyped/utils": "workspace:*",
"@typescript-eslint/eslint-plugin": "^8.11.0",
"@typescript-eslint/parser": "^8.11.0",
"@typescript-eslint/types": "^8.11.0",
"@typescript-eslint/typescript-estree": "^8.11.0",
"@typescript-eslint/utils": "^8.11.0",
"@typescript-eslint/eslint-plugin": "^8.13.0",
"@typescript-eslint/parser": "^8.13.0",
"@typescript-eslint/types": "^8.13.0",
"@typescript-eslint/typescript-estree": "^8.13.0",
"@typescript-eslint/utils": "^8.13.0",
"eslint": "^8.57.1",
"eslint-plugin-import": "^2.29.1",
"semver": "^7.5.4",
"eslint-plugin-import": "^2.31.0",
"semver": "^7.6.3",
"strip-json-comments": "^3.1.1"
},
"peerDependencies": {
"typescript": ">= 3.0.0-dev || >= 3.1.0-dev || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.7.0-dev || >= 3.8.0-dev || >= 3.9.0-dev || >= 4.0.0-dev || >=5.0.0-dev"
},
"devDependencies": {
"@types/eslint": "^8.56.2",
"@types/semver": "^7.5.5",
"@types/eslint": "^8.56.12",
"@types/semver": "^7.5.8",
"@types/strip-json-comments": "^3.0.0",
"typescript": "^5.6.3"
},
Expand Down
18 changes: 9 additions & 9 deletions packages/eslint-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,23 @@
},
"dependencies": {
"@definitelytyped/utils": "workspace:*",
"@typescript-eslint/types": "^8.11.0",
"@typescript-eslint/utils": "^8.11.0",
"semver": "^7.5.4"
"@typescript-eslint/types": "^8.13.0",
"@typescript-eslint/utils": "^8.13.0",
"semver": "^7.6.3"
},
"peerDependencies": {
"@typescript-eslint/eslint-plugin": "^8.10.0",
"@typescript-eslint/parser": "^8.10.0",
"@typescript-eslint/eslint-plugin": "^8.13.0",
"@typescript-eslint/parser": "^8.13.0",
"eslint": "^8.57.0",
"eslint-plugin-jsdoc": "^44.0.0",
"typescript": ">= 3.0.0-dev || >= 3.1.0-dev || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.7.0-dev || >= 3.8.0-dev || >= 3.9.0-dev || >= 4.0.0-dev || >=5.0.0-dev"
},
"devDependencies": {
"@definitelytyped/eslint-plugin": "link:",
"@types/eslint": "^8.56.2",
"@types/semver": "^7.5.6",
"glob": "^10.3.10",
"jest-file-snapshot": "^0.5.0",
"@types/eslint": "^8.56.12",
"@types/semver": "^7.5.8",
"glob": "^10.4.5",
"jest-file-snapshot": "^0.7.0",
"strip-ansi": "^6.0.1",
"typescript": "^5.6.3",
"typescript-5.4": "npm:typescript@~5.4.0-0",
Expand Down
4 changes: 2 additions & 2 deletions packages/header-parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
"dependencies": {
"@definitelytyped/typescript-versions": "workspace:*",
"@definitelytyped/utils": "workspace:*",
"semver": "^7.5.4"
"semver": "^7.6.3"
},
"devDependencies": {
"@types/semver": "^7.5.6"
"@types/semver": "^7.5.8"
},
"publishConfig": {
"access": "public"
Expand Down
35 changes: 12 additions & 23 deletions packages/mergebot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,41 +19,30 @@
"node": ">=18"
},
"dependencies": {
"@apollo/client": "^3.10.3",
"@azure/functions": "^4.4.0",
"@apollo/client": "^3.11.9",
"@azure/functions": "^4.6.0",
"@definitelytyped/old-header-parser": "npm:@definitelytyped/[email protected]",
"@definitelytyped/utils": "workspace:*",
"@octokit/webhooks-methods": "^4.1.0",
"dayjs": "^1.11.11",
"dayjs": "^1.11.13",
"fast-json-patch": "^3.1.1",
"graphql": "15.8.0",
"prettyjson": "^1.2.5",
"yargs": "^17.7.2"
},
"devDependencies": {
"@octokit/graphql-schema": "^14.58.0",
"@octokit/webhooks-types": "^7.5.1",
"@types/node": "^18.19.58",
"@octokit/webhooks-types": "^7.6.1",
"@types/node": "^18.19.64",
"@types/prettyjson": "^0.0.33",
"@types/yargs": "^17.0.32",
"@types/yargs": "^17.0.33",
"apollo": "^2.34.0",
"azure-functions-core-tools": "^4.0.5700",
"esbuild": "^0.21.5",
"jest": "^29.7.0",
"jest-file-snapshot": "^0.5.0",
"knip": "^5.33.3",
"rimraf": "^5.0.7",
"seroval": "^1.0.7",
"ts-jest": "^29.1.2",
"typescript": "^5.4.5"
},
"overrides": {
"apollo": {
"graphql": "15.8.0"
},
"apollo-language-server": {
"graphql": "15.8.0"
}
"azure-functions-core-tools": "^4.0.6543",
"esbuild": "^0.24.0",
"jest-file-snapshot": "^0.7.0",
"rimraf": "^5.0.10",
"seroval": "^1.1.1",
"typescript": "^5.6.3"
},
"scripts": {
"prestart": "pnpm run build",
Expand Down
8 changes: 4 additions & 4 deletions packages/publisher/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
"@definitelytyped/retag": "workspace:*",
"@definitelytyped/utils": "workspace:*",
"longjohn": "^0.2.12",
"pacote": "^17.0.5",
"semver": "^7.5.4",
"pacote": "^20.0.0",
"semver": "^7.6.3",
"typescript": "^5.6.3",
"yargs": "^17.7.2"
},
"devDependencies": {
"@types/pacote": "^11.1.8",
"@types/semver": "^7.5.6",
"@types/yargs": "^17.0.32"
"@types/semver": "^7.5.8",
"@types/yargs": "^17.0.33"
},
"scripts": {
"build": "tsc -b",
Expand Down
10 changes: 7 additions & 3 deletions packages/publisher/src/calculate-versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,17 @@ async function computeChangedPackages(allPackages: AllPackages, log: LoggerWithE
return { changedTypings: compact(changedTypings), changedNotNeededPackages: compact(changedNotNeededPackages) };
}

async function isAlreadyDeprecated(pkg: NotNeededPackage, log: LoggerWithErrors): Promise<unknown> {
const offline = await pacote.manifest(pkg.name, { cache: cacheDir, offline: true }).catch((reason) => {
export async function isAlreadyDeprecated(pkg: NotNeededPackage, log: LoggerWithErrors): Promise<unknown> {
// As of npm-pick-manifest 9.1.0, asking for the package without @latest returns the newest non-deprecated
// version, so we'll never see that we're deprecated. But, we always publish deprecated versions as @latest,.
// so asking for that explicitly works around the behavior change.
const spec = `${pkg.name}@latest`;
const offline = await pacote.manifest(spec, { cache: cacheDir, offline: true }).catch((reason) => {
if (reason.code !== "ENOTCACHED") throw reason;
return undefined;
});
if (offline?.deprecated) return offline.deprecated;
log.info(`Version info not cached for deprecated package ${pkg.desc}`);
const online = await pacote.manifest(pkg.name, { cache: cacheDir, preferOnline: true });
const online = await pacote.manifest(spec, { cache: cacheDir, preferOnline: true });
return online.deprecated;
}
12 changes: 12 additions & 0 deletions packages/publisher/test/isAlreadyDeprecated.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { NotNeededPackage } from "@definitelytyped/definitions-parser";
import { isAlreadyDeprecated } from "../src/calculate-versions";

describe("isAlreadyDeprecated", () => {
const shouldSkip = !process.env.CI;

(shouldSkip ? it.skip : it)("should report @types/commander as deprecated", async () => {
const pkg = new NotNeededPackage("@types/commander", "commander", "2.12.2");
const result = await isAlreadyDeprecated(pkg, { info: () => {}, error: () => {} });
expect(!!result).toBe(true);
});
})
10 changes: 5 additions & 5 deletions packages/retag/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
"@definitelytyped/definitions-parser": "workspace:*",
"@definitelytyped/typescript-versions": "workspace:*",
"@definitelytyped/utils": "workspace:*",
"pacote": "^17.0.5",
"semver": "^7.5.4",
"pacote": "^20.0.0",
"semver": "^7.6.3",
"yargs": "^17.7.2"
},
"devDependencies": {
"@types/node": "^18.19.58",
"@types/node": "^18.19.64",
"@types/pacote": "^11.1.8",
"@types/semver": "^7.5.6",
"@types/yargs": "^17.0.32"
"@types/semver": "^7.5.8",
"@types/yargs": "^17.0.33"
},
"main": "dist/index.js",
"bin": {
Expand Down
12 changes: 6 additions & 6 deletions packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@
},
"dependencies": {
"@qiwi/npm-registry-client": "^8.9.1",
"@types/node": "^18.19.58",
"cachedir": "^2.0.0",
"@types/node": "^18.19.64",
"cachedir": "^2.4.0",
"charm": "^1.0.2",
"minimatch": "^9.0.3",
"minimatch": "^9.0.5",
"tar": "^6.2.1",
"tar-stream": "^3.1.6",
"tar-stream": "^3.1.7",
"which": "^4.0.0"
},
"devDependencies": {
"@qiwi/npm-types": "^1.0.3",
"@types/charm": "^1.0.6",
"@types/tar": "^6.1.10",
"@types/tar": "^6.1.13",
"@types/tar-stream": "^3.1.3",
"@types/which": "^3.0.3"
"@types/which": "^3.0.4"
},
"publishConfig": {
"access": "public"
Expand Down
13 changes: 0 additions & 13 deletions patches/[email protected]

This file was deleted.

Loading

0 comments on commit 3a00e49

Please sign in to comment.