Skip to content

Commit

Permalink
Upgrade all dependencies (#2273)
Browse files Browse the repository at this point in the history
This PR upgrades all of our dependencies to the latest versions,
including a few major dependency version bumps. Figured it was good
housekeeping to do once in a while

I pinned node and vscode, but otherwise everything is upgraded

## Checklist

- [-] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [-] I have updated the
[docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and
[cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet)
- [x] I have not broken the cheatsheet
  • Loading branch information
pokey authored Mar 28, 2024
1 parent de37ebf commit b9709f9
Show file tree
Hide file tree
Showing 34 changed files with 3,745 additions and 3,298 deletions.
34 changes: 17 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,25 @@
"license": "MIT",
"devDependencies": {
"@pnpm/meta-updater": "1.0.0",
"@types/node": "^18.18.2",
"@typescript-eslint/eslint-plugin": "^6.10.0",
"@typescript-eslint/parser": "^6.10.0",
"esbuild": "^0.17.11",
"eslint": "^8.53.0",
"eslint-config-prettier": "^8.8.0",
"eslint-import-resolver-typescript": "3.5.5",
"eslint-plugin-import": "2.28.1",
"eslint-plugin-mocha": "10.2.0",
"eslint-plugin-unicorn": "49.0.0",
"eslint-plugin-unused-imports": "^3.0.0",
"prettier": "3.0.3",
"prettier-plugin-tailwindcss": "0.5.11",
"syncpack": "9.8.4",
"typescript": "^5.2.2"
"@types/node": "18.18.2",
"@typescript-eslint/eslint-plugin": "^7.4.0",
"@typescript-eslint/parser": "^7.4.0",
"esbuild": "^0.20.2",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "3.6.1",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-mocha": "10.4.1",
"eslint-plugin-unicorn": "51.0.1",
"eslint-plugin-unused-imports": "^3.1.0",
"prettier": "3.2.5",
"prettier-plugin-tailwindcss": "0.5.12",
"syncpack": "12.3.0",
"typescript": "^5.4.3"
},
"pnpm": {
"patchedDependencies": {
"@docusaurus/[email protected].0": "patches/@[email protected]",
"@docusaurus/[email protected].1": "patches/@[email protected]",
"@types/[email protected]": "patches/@[email protected]",
"[email protected]": "patches/[email protected]"
},
Expand All @@ -63,6 +63,6 @@
"engines": {
"node": ">=18.18.2"
},
"packageManager": "[email protected].3",
"packageManager": "[email protected].5",
"type": "module"
}
36 changes: 18 additions & 18 deletions packages/cheatsheet-local/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,27 +30,27 @@
},
"devDependencies": {
"@effortlessmotion/html-webpack-inline-source-plugin": "1.0.3",
"@testing-library/react": "14.0.0",
"@types/jest": "29.4.0",
"@types/node": "^18.18.2",
"@types/react": "18.0.28",
"@types/react-dom": "18.0.11",
"@types/webpack": "5.28.0",
"@testing-library/react": "14.2.2",
"@types/jest": "29.5.12",
"@types/node": "18.18.2",
"@types/react": "18.2.71",
"@types/react-dom": "18.2.22",
"@types/webpack": "5.28.5",
"@webpack-cli/generators": "3.0.7",
"autoprefixer": "10.4.13",
"css-loader": "6.7.3",
"html-webpack-plugin": "5.5.0",
"autoprefixer": "10.4.19",
"css-loader": "6.10.0",
"html-webpack-plugin": "5.6.0",
"jest": "29.7.0",
"postcss": "8.4.31",
"postcss-loader": "7.0.2",
"style-loader": "3.3.1",
"tailwindcss": "3.3.5",
"ts-loader": "9.4.2",
"ts-node": "10.9.1",
"typescript": "^5.2.2",
"webpack": "5.89.0",
"postcss": "8.4.38",
"postcss-loader": "8.1.1",
"style-loader": "3.3.4",
"tailwindcss": "3.4.1",
"ts-loader": "9.5.1",
"ts-node": "10.9.2",
"typescript": "^5.4.3",
"webpack": "5.91.0",
"webpack-cli": "5.1.4",
"webpack-dev-server": "4.11.1"
"webpack-dev-server": "5.0.4"
},
"postcss": {
"plugins": {
Expand Down
24 changes: 12 additions & 12 deletions packages/cheatsheet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,24 @@
"*.css"
],
"dependencies": {
"@fortawesome/fontawesome-svg-core": "6.3.0",
"@fortawesome/free-solid-svg-icons": "6.3.0",
"@fortawesome/fontawesome-svg-core": "6.5.1",
"@fortawesome/free-solid-svg-icons": "6.5.1",
"@fortawesome/react-fontawesome": "0.2.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-string-replace": "1.1.0",
"react-use": "17.4.0"
"react-string-replace": "1.1.1",
"react-use": "17.5.0"
},
"devDependencies": {
"@testing-library/react": "14.0.0",
"@types/jest": "29.4.0",
"@types/react": "18.0.28",
"@types/react-dom": "18.0.11",
"@types/react-helmet": "6.1.6",
"@testing-library/react": "14.2.2",
"@types/jest": "29.5.12",
"@types/react": "18.2.71",
"@types/react-dom": "18.2.22",
"@types/react-helmet": "6.1.11",
"jest": "29.7.0",
"jest-environment-jsdom": "29.6.2",
"ts-jest": "29.1.1",
"typescript": "^5.2.2"
"jest-environment-jsdom": "29.7.0",
"ts-jest": "29.1.2",
"typescript": "^5.4.3"
},
"type": "module"
}
16 changes: 8 additions & 8 deletions packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@
"license": "MIT",
"dependencies": {
"lodash": "^4.17.21",
"vscode-uri": "^3.0.6"
"vscode-uri": "^3.0.8"
},
"devDependencies": {
"@types/js-yaml": "^4.0.2",
"@types/lodash": "4.14.181",
"@types/mocha": "^10.0.3",
"@types/sinon": "^10.0.2",
"@types/js-yaml": "^4.0.9",
"@types/lodash": "4.17.0",
"@types/mocha": "^10.0.6",
"@types/sinon": "^17.0.3",
"cross-spawn": "7.0.3",
"fast-check": "3.12.0",
"fast-check": "3.17.0",
"js-yaml": "^4.1.0",
"mocha": "^10.2.0",
"sinon": "^11.1.1"
"mocha": "^10.3.0",
"sinon": "^17.0.1"
},
"types": "./out/index.d.ts",
"exports": {
Expand Down
7 changes: 5 additions & 2 deletions packages/common/src/ide/fake/FakeConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,15 @@ export default class FakeConfiguration implements Configuration {
if (scope != null) {
for (const { scope: candidateScope, values } of this.scopes) {
if (scopeMatches(candidateScope, scope)) {
return get(values, path) ?? get(this.mocks, path);
return (get(values, path) ?? get(this.mocks, path)) as GetFieldType<
CursorlessConfiguration,
Path
>;
}
}
}

return get(this.mocks, path);
return get(this.mocks, path) as GetFieldType<CursorlessConfiguration, Path>;
}

onDidChangeConfiguration = this.notifier.registerListener;
Expand Down
16 changes: 8 additions & 8 deletions packages/common/src/ide/types/Paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ type Join<
? `${L}.${R}`
: L
: R extends string | number
? R
: undefined;
? R
: undefined;

type Union<
L extends unknown | undefined,
Expand All @@ -23,8 +23,8 @@ type Union<
? undefined
: R
: R extends undefined
? L
: L | R;
? L
: L | R;

/**
* Get all the possible paths of an object
Expand Down Expand Up @@ -55,8 +55,8 @@ export type GetFieldType<
[K in Path]: K extends keyof T
? T[K]
: K extends `${infer P}.${infer S}`
? T[P] extends GenericObject
? GetFieldType<T[P], S>
: never
: never;
? T[P] extends GenericObject
? GetFieldType<T[P], S>
: never
: never;
}[Path];
30 changes: 15 additions & 15 deletions packages/cursorless-engine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,27 @@
"license": "MIT",
"dependencies": {
"@cursorless/common": "workspace:*",
"glob": "^7.1.7",
"immer": "^9.0.15",
"glob": "^10.3.10",
"immer": "^10.0.4",
"immutability-helper": "^3.1.1",
"itertools": "^2.1.1",
"itertools": "^2.2.5",
"lodash": "^4.17.21",
"node-html-parser": "^6.1.11",
"node-html-parser": "^6.1.12",
"sbd": "^1.0.19",
"uuid": "^9.0.0",
"zod": "3.22.3"
"uuid": "^9.0.1",
"zod": "3.22.4"
},
"devDependencies": {
"@types/glob": "^7.1.3",
"@types/js-yaml": "^4.0.2",
"@types/lodash": "4.14.181",
"@types/mocha": "^10.0.3",
"@types/sbd": "^1.0.3",
"@types/sinon": "^10.0.2",
"@types/uuid": "^8.3.4",
"@types/glob": "^8.1.0",
"@types/js-yaml": "^4.0.9",
"@types/lodash": "4.17.0",
"@types/mocha": "^10.0.6",
"@types/sbd": "^1.0.5",
"@types/sinon": "^17.0.3",
"@types/uuid": "^9.0.8",
"js-yaml": "^4.1.0",
"mocha": "^10.2.0",
"sinon": "^11.1.1"
"mocha": "^10.3.0",
"sinon": "^17.0.1"
},
"types": "./out/index.d.ts",
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion packages/cursorless-engine/src/CommandHistory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type {
CommandRunner,
CommandRunnerDecorator,
} from "@cursorless/cursorless-engine";
import produce from "immer";
import { produce } from "immer";
import * as fs from "node:fs/promises";
import * as path from "node:path";
import { v4 as uuid } from "uuid";
Expand Down
9 changes: 3 additions & 6 deletions packages/cursorless-engine/src/core/Cheatsheet.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { readFile, writeFile } from "fs/promises";
import { parse } from "node-html-parser";
import produce from "immer";
import { sortBy } from "lodash";
import { ide } from "../singletons/ide.singleton";
import path from "path";
import { getCursorlessRepoRoot } from "@cursorless/common";
import { produce } from "immer";

/**
* The argument expected by the cheatsheet command.
Expand Down Expand Up @@ -42,11 +42,8 @@ export async function showCheatsheet({

const root = parse(cheatsheetContent);

root.getElementById(
"cheatsheet-data",
).textContent = `document.cheatsheetInfo = ${JSON.stringify(
spokenFormInfo,
)};`;
root.getElementById("cheatsheet-data")!.textContent =
`document.cheatsheetInfo = ${JSON.stringify(spokenFormInfo)};`;

await writeFile(outputPath, root.toString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import { upgradeV2ToV3 } from "./upgradeV2ToV3";
import { upgradeV3ToV4 } from "./upgradeV3ToV4";
import { upgradeV4ToV5 } from "./upgradeV4ToV5/upgradeV4ToV5";
import { upgradeV5ToV6 } from "./upgradeV5ToV6";
import produce from "immer";
import { upgradeV6ToV7 } from "./upgradeV6ToV7";
import { produce } from "immer";

/**
* Given a command argument which comes from the client, normalize it so that it
Expand Down Expand Up @@ -108,12 +108,11 @@ function usesScopeType(
scopeTypeType: SimpleScopeTypeType,
partialTargets: PartialTargetDescriptor[],
) {
return getPartialPrimitiveTargets(partialTargets).some(
(partialTarget) =>
partialTarget.modifiers?.find(
(mod: Modifier) =>
(mod.type === "containingScope" || mod.type === "everyScope") &&
mod.scopeType.type === scopeTypeType,
),
return getPartialPrimitiveTargets(partialTargets).some((partialTarget) =>
partialTarget.modifiers?.find(
(mod: Modifier) =>
(mod.type === "containingScope" || mod.type === "everyScope") &&
mod.scopeType.type === scopeTypeType,
),
);
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Modifier } from "@cursorless/common";
import produce from "immer";
import { findLastIndex } from "lodash";
import {
PrimitiveTargetDescriptor,
RangeTargetDescriptor,
} from "../typings/TargetDescriptor";
import { produce } from "immer";

/**
* This function exists to enable hoisted modifiers, eg for constructs like
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { CommandHistoryEntry } from "@cursorless/common";
import globRaw from "glob";
import { glob } from "glob";
import { readFile } from "node:fs/promises";
import path from "node:path";
import { promisify } from "node:util";

export async function* generateCommandHistoryEntries(dir: string) {
const files = await glob("*.jsonl", { cwd: dir });
Expand All @@ -21,5 +20,3 @@ export async function* generateCommandHistoryEntries(dir: string) {
}
}
}

const glob = promisify(globRaw);
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ type PredicateParameterType<T extends SchemaOutputType> = T extends {
}
? MutableQueryCapture
: T extends { value: infer V }
? V
: never;
? V
: never;

// These two types work together to convert a list of operands from the type
// output by our schema validator to the type that will be passed to the `accept`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,6 @@ function inferDelimiterSide(delimiterNode: SyntaxNode) {
return delimiterNode.parent?.firstChild?.equals(delimiterNode)
? "left"
: delimiterNode.parent?.lastChild?.equals(delimiterNode)
? "right"
: ("unknown" as const);
? "right"
: ("unknown" as const);
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ export function getIndividualDelimiters(
isLeft && !isRight
? "left"
: isRight && !isLeft
? "right"
: "unknown",
? "right"
: "unknown",
delimiter,
};
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ export class ScopeTypeTarget extends BaseTarget<ScopeTypeTargetParameters> {
return this.removalRange_ != null
? this.removalRange_
: this.hasDelimiterRange_
? getDelimitedSequenceRemovalRange(this)
: getTokenRemovalRange(this);
? getDelimitedSequenceRemovalRange(this)
: getTokenRemovalRange(this);
}

maybeCreateRichRangeTarget(
Expand Down
Loading

0 comments on commit b9709f9

Please sign in to comment.