diff --git a/packages/common/package.json b/packages/common/package.json index 396372731e..9f75b3b8d5 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -17,21 +17,16 @@ "license": "MIT", "dependencies": { "lodash-es": "^4.17.21", - "pathe": "^1.1.2", "vscode-uri": "^3.0.8" }, "devDependencies": { - "@types/chai": "^4.3.14", "@types/js-yaml": "^4.0.9", "@types/lodash-es": "4.17.0", "@types/mocha": "^10.0.6", - "@types/sinon": "^17.0.3", - "chai": "^5.1.0", "cross-spawn": "7.0.3", "fast-check": "3.17.0", "js-yaml": "^4.1.0", - "mocha": "^10.3.0", - "sinon": "^17.0.1" + "mocha": "^10.3.0" }, "types": "./out/index.d.ts", "exports": { diff --git a/packages/common/src/ide/normalized/NormalizedIDE.ts b/packages/common/src/ide/normalized/NormalizedIDE.ts index be5d552a50..96ef29193e 100644 --- a/packages/common/src/ide/normalized/NormalizedIDE.ts +++ b/packages/common/src/ide/normalized/NormalizedIDE.ts @@ -1,4 +1,3 @@ -import { getFixturePath } from "../../index"; import { GeneralizedRange } from "../../types/GeneralizedRange"; import { TextEditor } from "../../types/TextEditor"; import FakeConfiguration from "../fake/FakeConfiguration"; @@ -17,6 +16,7 @@ export class NormalizedIDE extends PassthroughIDEBase { original: IDE, public fakeIde: FakeIDE, private isSilent: boolean, + private cursorlessSnippetsDir: string, ) { super(original); @@ -46,7 +46,7 @@ export class NormalizedIDE extends PassthroughIDEBase { hatStability: this.configuration.getOwnConfiguration( "experimental.hatStability", ), - snippetsDir: getFixturePath("cursorless-snippets"), + snippetsDir: this.cursorlessSnippetsDir, keyboardTargetFollowsSelection: false, }); } diff --git a/packages/common/src/index.ts b/packages/common/src/index.ts index 9d184ced52..dc36e39b8b 100644 --- a/packages/common/src/index.ts +++ b/packages/common/src/index.ts @@ -10,8 +10,6 @@ export * from "./util"; export * from "./ide/util/messages"; export { getKey, splitKey } from "./util/splitKey"; export { hrtimeBigintToSeconds } from "./util/timeUtils"; -export * from "./util/walkSync"; -export * from "./util/walkAsync"; export * from "./util/disposableFrom"; export * from "./util/camelCaseToAllDown"; export { Notifier } from "./util/Notifier"; @@ -47,11 +45,16 @@ export * from "./types/TextEditorEdit"; export * from "./types/TextEditorOptions"; export * from "./types/TextLine"; export * from "./types/Token"; +export * from "./types/SpokenFormType"; export * from "./types/HatTokenMap"; export * from "./types/ScopeProvider"; export * from "./types/SpokenForm"; export * from "./types/commandHistory"; +export * from "./types/TalonSpokenForms"; +export * from "./types/TestHelpers"; +export * from "./types/TreeSitter"; export * from "./util/textFormatters"; +export * from "./util/regex"; export * from "./util/serializedMarksToTokenHats"; export * from "./types/snippet.types"; export * from "./testUtil/fromPlainObject"; @@ -61,18 +64,15 @@ export * from "./types/GeneralizedRange"; export * from "./types/RangeOffsets"; export * from "./util/omitByDeep"; export * from "./util/range"; +export * from "./util/object"; export * from "./util/uniqWithHash"; export * from "./testUtil/testConstants"; -export * from "./testUtil/getFixturePaths"; -export * from "./testUtil/getCursorlessRepoRoot"; -export * from "./testUtil/runRecordedTest"; export * from "./testUtil/serialize"; export * from "./testUtil/shouldUpdateFixtures"; export * from "./testUtil/TestCaseSnapshot"; export * from "./testUtil/serializeTestFixture"; export * from "./testUtil/getSnapshotForComparison"; export * from "./testUtil/asyncSafety"; -export * from "./testUtil/getScopeTestPathsRecursively"; export * from "./util/typeUtils"; export * from "./ide/types/hatStyles.types"; export * from "./errors"; diff --git a/packages/common/src/testUtil/getSnapshotForComparison.ts b/packages/common/src/testUtil/getSnapshotForComparison.ts index eae8c28695..db9d46f88e 100644 --- a/packages/common/src/testUtil/getSnapshotForComparison.ts +++ b/packages/common/src/testUtil/getSnapshotForComparison.ts @@ -1,10 +1,10 @@ import { storedTargetKeys } from "../StoredTargetKey"; import SpyIDE from "../ide/spy/SpyIDE"; import { ReadOnlyHatMap } from "../types/HatTokenMap"; +import type { TestHelpers } from "../types/TestHelpers"; import { marksToPlainObject } from "../util/toPlainObject"; import { ExcludableSnapshotField, TestCaseSnapshot } from "./TestCaseSnapshot"; import { extractTargetedMarks } from "./extractTargetedMarks"; -import { TestHelpers } from "./runRecordedTest"; /** * Get the state of the editor to compare with the expected state of a test case diff --git a/packages/cursorless-engine/src/spokenForms/SpokenFormType.ts b/packages/common/src/types/SpokenFormType.ts similarity index 100% rename from packages/cursorless-engine/src/spokenForms/SpokenFormType.ts rename to packages/common/src/types/SpokenFormType.ts diff --git a/packages/cursorless-engine/src/scopeProviders/TalonSpokenForms.ts b/packages/common/src/types/TalonSpokenForms.ts similarity index 92% rename from packages/cursorless-engine/src/scopeProviders/TalonSpokenForms.ts rename to packages/common/src/types/TalonSpokenForms.ts index 0f44437b69..b561f61574 100644 --- a/packages/cursorless-engine/src/scopeProviders/TalonSpokenForms.ts +++ b/packages/common/src/types/TalonSpokenForms.ts @@ -1,8 +1,5 @@ import { Notifier } from "@cursorless/common"; -import { - SpokenFormMapKeyTypes, - SpokenFormType, -} from "../spokenForms/SpokenFormType"; +import { SpokenFormMapKeyTypes, SpokenFormType } from "./SpokenFormType"; /** * Interface representing a communication mechanism whereby Talon can provide diff --git a/packages/common/src/types/TestHelpers.ts b/packages/common/src/types/TestHelpers.ts new file mode 100644 index 0000000000..97e3a38b1f --- /dev/null +++ b/packages/common/src/types/TestHelpers.ts @@ -0,0 +1,32 @@ +import type { FakeCommandServerApi } from "../FakeCommandServerApi"; +import type { IDE } from "../ide/types/ide.types"; +import type { + ExcludableSnapshotField, + ExtraSnapshotField, + TestCaseSnapshot, +} from "../testUtil/TestCaseSnapshot"; +import type { SerializedMarks, TargetPlainObject } from "../util/toPlainObject"; +import type { HatTokenMap } from "./HatTokenMap"; +import type { TextEditor } from "./TextEditor"; + +export interface TestHelpers { + hatTokenMap: HatTokenMap; + + // FIXME: Remove this once we have a better way to get this function + // accessible from our tests + takeSnapshot( + excludeFields: ExcludableSnapshotField[], + extraFields: ExtraSnapshotField[], + editor: TextEditor, + ide: IDE, + marks: SerializedMarks | undefined, + ): Promise; + + setStoredTarget( + editor: TextEditor, + key: string, + targets: TargetPlainObject[] | undefined, + ): void; + + commandServerApi: FakeCommandServerApi; +} diff --git a/packages/common/src/types/TextDocument.ts b/packages/common/src/types/TextDocument.ts index 94b0b11d88..f5eb26d0d8 100644 --- a/packages/common/src/types/TextDocument.ts +++ b/packages/common/src/types/TextDocument.ts @@ -10,6 +10,11 @@ export interface TextDocument { */ readonly uri: URI; + /** + * The last portion of the uri.path. + */ + readonly filename: string; + /** * The identifier of the language associated with this document. */ diff --git a/packages/cursorless-engine/src/typings/TreeSitter.ts b/packages/common/src/types/TreeSitter.ts similarity index 100% rename from packages/cursorless-engine/src/typings/TreeSitter.ts rename to packages/common/src/types/TreeSitter.ts diff --git a/packages/cursorless-engine/src/util/object.ts b/packages/common/src/util/object.ts similarity index 100% rename from packages/cursorless-engine/src/util/object.ts rename to packages/common/src/util/object.ts diff --git a/packages/cursorless-engine/src/util/regex.ts b/packages/common/src/util/regex.ts similarity index 100% rename from packages/cursorless-engine/src/util/regex.ts rename to packages/common/src/util/regex.ts diff --git a/packages/cursorless-cheatsheet/package.json b/packages/cursorless-cheatsheet/package.json index b77568aaec..d4fac4dda7 100644 --- a/packages/cursorless-cheatsheet/package.json +++ b/packages/cursorless-cheatsheet/package.json @@ -25,10 +25,10 @@ }, "dependencies": { "@cursorless/common": "workspace:*", + "@cursorless/node-common": "workspace:*", "immer": "^10.0.4", "lodash-es": "^4.17.21", - "node-html-parser": "^6.1.12", - "pathe": "^1.1.2" + "node-html-parser": "^6.1.12" }, "devDependencies": { "@types/lodash-es": "4.17.0" diff --git a/packages/cursorless-cheatsheet/src/Cheatsheet.ts b/packages/cursorless-cheatsheet/src/Cheatsheet.ts index fff8ec96f1..cc14e9c9c4 100644 --- a/packages/cursorless-cheatsheet/src/Cheatsheet.ts +++ b/packages/cursorless-cheatsheet/src/Cheatsheet.ts @@ -1,9 +1,10 @@ -import { getCursorlessRepoRoot, type IDE } from "@cursorless/common"; +import { type IDE } from "@cursorless/common"; +import { getCursorlessRepoRoot } from "@cursorless/node-common"; import { readFile, writeFile } from "node:fs/promises"; import { produce } from "immer"; import { sortBy } from "lodash-es"; import { parse } from "node-html-parser"; -import * as path from "pathe"; +import * as path from "path"; /** * The argument expected by the cheatsheet command. diff --git a/packages/cursorless-cheatsheet/tsconfig.json b/packages/cursorless-cheatsheet/tsconfig.json index 96107efcd7..f95ec8ae56 100644 --- a/packages/cursorless-cheatsheet/tsconfig.json +++ b/packages/cursorless-cheatsheet/tsconfig.json @@ -8,6 +8,9 @@ "references": [ { "path": "../common" + }, + { + "path": "../node-common" } ] } diff --git a/packages/cursorless-engine/package.json b/packages/cursorless-engine/package.json index 2549853ce8..211a8103a0 100644 --- a/packages/cursorless-engine/package.json +++ b/packages/cursorless-engine/package.json @@ -22,21 +22,18 @@ "license": "MIT", "dependencies": { "@cursorless/common": "workspace:*", - "glob": "^10.3.10", + "@cursorless/node-common": "workspace:*", "immer": "^10.0.4", "immutability-helper": "^3.1.1", "itertools": "^2.2.5", "lodash-es": "^4.17.21", "moo": "0.5.2", "nearley": "2.20.1", - "node-html-parser": "^6.1.12", - "pathe": "^1.1.2", "sbd": "^1.0.19", "uuid": "^9.0.1", "zod": "3.22.4" }, "devDependencies": { - "@types/glob": "^8.1.0", "@types/js-yaml": "^4.0.9", "@types/lodash-es": "4.17.0", "@types/mocha": "^10.0.6", diff --git a/packages/cursorless-engine/src/actions/Actions.ts b/packages/cursorless-engine/src/actions/Actions.ts index 6ec25e74b0..627509a4bb 100644 --- a/packages/cursorless-engine/src/actions/Actions.ts +++ b/packages/cursorless-engine/src/actions/Actions.ts @@ -1,7 +1,7 @@ +import type { TreeSitter } from "@cursorless/common"; import { Snippets } from "../core/Snippets"; import { RangeUpdater } from "../core/updateSelections/RangeUpdater"; import { ModifierStageFactory } from "../processTargets/ModifierStageFactory"; -import { TreeSitter } from "../typings/TreeSitter"; import { BreakLine } from "./BreakLine"; import { Bring, Move, Swap } from "./BringMoveSwap"; import Call from "./Call"; diff --git a/packages/cursorless-engine/src/actions/GenerateSnippet/GenerateSnippet.ts b/packages/cursorless-engine/src/actions/GenerateSnippet/GenerateSnippet.ts index 304af5a1c7..f8773d62e6 100644 --- a/packages/cursorless-engine/src/actions/GenerateSnippet/GenerateSnippet.ts +++ b/packages/cursorless-engine/src/actions/GenerateSnippet/GenerateSnippet.ts @@ -1,14 +1,13 @@ -import { FlashStyle, Range } from "@cursorless/common"; +import { FlashStyle, Range, matchAll } from "@cursorless/common"; import type { Snippets } from "../../core/Snippets"; import { Offsets } from "../../processTargets/modifiers/surroundingPair/types"; import { ide } from "../../singletons/ide.singleton"; import type { Target } from "../../typings/target.types"; -import { matchAll } from "../../util/regex"; import { ensureSingleTarget, flashTargets } from "../../util/targetUtils"; import type { ActionReturnValue } from "../actions.types"; +import Substituter from "./Substituter"; import { constructSnippetBody } from "./constructSnippetBody"; import { editText } from "./editText"; -import Substituter from "./Substituter"; /** * This action can be used to automatically create a snippet from a target. Any diff --git a/packages/cursorless-engine/src/actions/ShowParseTree.ts b/packages/cursorless-engine/src/actions/ShowParseTree.ts index 7ef056878a..52d759ffd5 100644 --- a/packages/cursorless-engine/src/actions/ShowParseTree.ts +++ b/packages/cursorless-engine/src/actions/ShowParseTree.ts @@ -1,7 +1,6 @@ +import type { TreeSitter } from "@cursorless/common"; import { FlashStyle, Range, TextDocument } from "@cursorless/common"; -import * as path from "pathe"; import type { Tree, TreeCursor } from "web-tree-sitter"; -import type { TreeSitter } from "../typings/TreeSitter"; import { ide } from "../singletons/ide.singleton"; import type { Target } from "../typings/target.types"; import { flashTargets } from "../util/targetUtils"; @@ -43,7 +42,7 @@ function parseTree( parseCursor(resultPlayground, resultQuery, contentRange, tree.walk(), 0); return [ - `## ${path.basename(document.uri.path)} [${contentRange}]\n`, + `## ${document.filename} [${contentRange}]\n`, `\`\`\`${document.languageId}`, document.getText(contentRange), "```", diff --git a/packages/cursorless-engine/src/actions/incrementDecrement.ts b/packages/cursorless-engine/src/actions/incrementDecrement.ts index cbf9a656bb..42606cd4d1 100644 --- a/packages/cursorless-engine/src/actions/incrementDecrement.ts +++ b/packages/cursorless-engine/src/actions/incrementDecrement.ts @@ -1,8 +1,7 @@ -import { Range, TextEditor } from "@cursorless/common"; +import { MatchedText, Range, TextEditor, matchText } from "@cursorless/common"; import { PlainTarget } from "../processTargets/targets"; import { SelectionWithEditor } from "../typings/Types"; import { Destination, Target } from "../typings/target.types"; -import { MatchedText, matchText } from "../util/regex"; import { runForEachEditor } from "../util/targetUtils"; import { Actions } from "./Actions"; import { ActionReturnValue } from "./actions.types"; diff --git a/packages/cursorless-engine/src/core/updateSelections/getOffsetsForEmptyRangeInsert.ts b/packages/cursorless-engine/src/core/updateSelections/getOffsetsForEmptyRangeInsert.ts index e652e02450..a74b12ad0b 100644 --- a/packages/cursorless-engine/src/core/updateSelections/getOffsetsForEmptyRangeInsert.ts +++ b/packages/cursorless-engine/src/core/updateSelections/getOffsetsForEmptyRangeInsert.ts @@ -1,7 +1,6 @@ +import { RangeOffsets, leftAnchored, rightAnchored } from "@cursorless/common"; import { invariant } from "immutability-helper"; -import { leftAnchored, rightAnchored } from "../../util/regex"; import { ChangeEventInfo, FullRangeInfo } from "../../typings/updateSelections"; -import { RangeOffsets } from "@cursorless/common"; /** * Gets updated offsets for the range `rangeInfo` after the change described by diff --git a/packages/cursorless-engine/src/core/updateSelections/getOffsetsForNonEmptyRangeInsert.ts b/packages/cursorless-engine/src/core/updateSelections/getOffsetsForNonEmptyRangeInsert.ts index 0aac5a5a3a..5e496930bc 100644 --- a/packages/cursorless-engine/src/core/updateSelections/getOffsetsForNonEmptyRangeInsert.ts +++ b/packages/cursorless-engine/src/core/updateSelections/getOffsetsForNonEmptyRangeInsert.ts @@ -1,7 +1,6 @@ +import { RangeOffsets, leftAnchored, rightAnchored } from "@cursorless/common"; import { invariant } from "immutability-helper"; -import { leftAnchored, rightAnchored } from "../../util/regex"; import { ChangeEventInfo, FullRangeInfo } from "../../typings/updateSelections"; -import { RangeOffsets } from "@cursorless/common"; /** * Gets updated offsets for the range `rangeInfo` after the change described by diff --git a/packages/cursorless-engine/src/cursorlessEngine.ts b/packages/cursorless-engine/src/cursorlessEngine.ts index 89d591d8ed..fa4fc541f2 100644 --- a/packages/cursorless-engine/src/cursorlessEngine.ts +++ b/packages/cursorless-engine/src/cursorlessEngine.ts @@ -6,6 +6,8 @@ import { ScopeProvider, ensureCommandShape, type RawTreeSitterQueryProvider, + type TalonSpokenForms, + type TreeSitter, } from "@cursorless/common"; import { KeyboardTargetUpdater } from "./KeyboardTargetUpdater"; import { @@ -37,9 +39,7 @@ import { ScopeRangeProvider } from "./scopeProviders/ScopeRangeProvider"; import { ScopeRangeWatcher } from "./scopeProviders/ScopeRangeWatcher"; import { ScopeSupportChecker } from "./scopeProviders/ScopeSupportChecker"; import { ScopeSupportWatcher } from "./scopeProviders/ScopeSupportWatcher"; -import { type TalonSpokenForms } from "./scopeProviders/TalonSpokenForms"; import { injectIde } from "./singletons/ide.singleton"; -import { TreeSitter } from "./typings/TreeSitter"; interface Props { ide: IDE; diff --git a/packages/cursorless-engine/src/disabledComponents/DisabledTalonSpokenForms.ts b/packages/cursorless-engine/src/disabledComponents/DisabledTalonSpokenForms.ts index 671e967f4c..bb47a9347f 100644 --- a/packages/cursorless-engine/src/disabledComponents/DisabledTalonSpokenForms.ts +++ b/packages/cursorless-engine/src/disabledComponents/DisabledTalonSpokenForms.ts @@ -1,7 +1,4 @@ -import type { - SpokenFormEntry, - TalonSpokenForms, -} from "../scopeProviders/TalonSpokenForms"; +import type { SpokenFormEntry, TalonSpokenForms } from "@cursorless/common"; export class DisabledTalonSpokenForms implements TalonSpokenForms { getSpokenFormEntries(): Promise { diff --git a/packages/cursorless-engine/src/disabledComponents/DisabledTreeSitter.ts b/packages/cursorless-engine/src/disabledComponents/DisabledTreeSitter.ts index 2db6900b00..a12975541e 100644 --- a/packages/cursorless-engine/src/disabledComponents/DisabledTreeSitter.ts +++ b/packages/cursorless-engine/src/disabledComponents/DisabledTreeSitter.ts @@ -1,6 +1,5 @@ -import type { TextDocument, Range } from "@cursorless/common"; -import type { SyntaxNode, Tree, Language } from "web-tree-sitter"; -import type { TreeSitter } from "../typings/TreeSitter"; +import type { Range, TextDocument, TreeSitter } from "@cursorless/common"; +import type { Language, SyntaxNode, Tree } from "web-tree-sitter"; export class DisabledTreeSitter implements TreeSitter { getTree(_document: TextDocument): Tree { diff --git a/packages/cursorless-engine/src/generateSpokenForm/CustomSpokenFormGeneratorImpl.ts b/packages/cursorless-engine/src/generateSpokenForm/CustomSpokenFormGeneratorImpl.ts index 04ac345f24..ed496e08cc 100644 --- a/packages/cursorless-engine/src/generateSpokenForm/CustomSpokenFormGeneratorImpl.ts +++ b/packages/cursorless-engine/src/generateSpokenForm/CustomSpokenFormGeneratorImpl.ts @@ -8,7 +8,7 @@ import { import { SpokenFormGenerator } from "./generateSpokenForm"; import { CustomSpokenFormGenerator } from "../api/CursorlessEngineApi"; import { CustomSpokenForms } from "../spokenForms/CustomSpokenForms"; -import { TalonSpokenForms } from "../scopeProviders/TalonSpokenForms"; +import { TalonSpokenForms } from "@cursorless/common"; /** * Simple facade that combines the {@link CustomSpokenForms} and diff --git a/packages/cursorless-engine/src/generateSpokenForm/SpokenFormComponent.ts b/packages/cursorless-engine/src/generateSpokenForm/SpokenFormComponent.ts index 526385a5fa..cea28e6f04 100644 --- a/packages/cursorless-engine/src/generateSpokenForm/SpokenFormComponent.ts +++ b/packages/cursorless-engine/src/generateSpokenForm/SpokenFormComponent.ts @@ -1,8 +1,5 @@ import { SpokenFormMapEntry } from "../spokenForms/SpokenFormMap"; -import { - SpokenFormMapKeyTypes, - SpokenFormType, -} from "../spokenForms/SpokenFormType"; +import { SpokenFormMapKeyTypes, SpokenFormType } from "@cursorless/common"; /** * A component of a spoken form used internally during spoken form generation. diff --git a/packages/cursorless-engine/src/generateSpokenForm/defaultSpokenForms/modifiers.ts b/packages/cursorless-engine/src/generateSpokenForm/defaultSpokenForms/modifiers.ts index d2ea3f9f31..655898ff4a 100644 --- a/packages/cursorless-engine/src/generateSpokenForm/defaultSpokenForms/modifiers.ts +++ b/packages/cursorless-engine/src/generateSpokenForm/defaultSpokenForms/modifiers.ts @@ -1,5 +1,5 @@ import { CompositeKeyMap } from "@cursorless/common"; -import { SpeakableSurroundingPairName } from "../../spokenForms/SpokenFormType"; +import { SpeakableSurroundingPairName } from "@cursorless/common"; import { SpokenFormComponentMap } from "../getSpokenFormComponentMap"; import { CustomizableSpokenFormComponentForType } from "../SpokenFormComponent"; import { surroundingPairsDelimiters } from "./surroundingPairsDelimiters"; diff --git a/packages/cursorless-engine/src/generateSpokenForm/defaultSpokenForms/surroundingPairsDelimiters.ts b/packages/cursorless-engine/src/generateSpokenForm/defaultSpokenForms/surroundingPairsDelimiters.ts index ff3a19bbe1..1b6fc57ce3 100644 --- a/packages/cursorless-engine/src/generateSpokenForm/defaultSpokenForms/surroundingPairsDelimiters.ts +++ b/packages/cursorless-engine/src/generateSpokenForm/defaultSpokenForms/surroundingPairsDelimiters.ts @@ -1,4 +1,4 @@ -import { SpeakableSurroundingPairName } from "../../spokenForms/SpokenFormType"; +import { SpeakableSurroundingPairName } from "@cursorless/common"; export const surroundingPairsDelimiters: Record< SpeakableSurroundingPairName, diff --git a/packages/cursorless-engine/src/generateSpokenForm/generateSpokenForm.test.ts b/packages/cursorless-engine/src/generateSpokenForm/generateSpokenForm.test.ts index 07ba62bc20..8d9ce1b4cf 100644 --- a/packages/cursorless-engine/src/generateSpokenForm/generateSpokenForm.test.ts +++ b/packages/cursorless-engine/src/generateSpokenForm/generateSpokenForm.test.ts @@ -1,17 +1,17 @@ import { TestCaseFixtureLegacy, - getRecordedTestPaths, serializeTestFixture, shouldUpdateFixtures, } from "@cursorless/common"; +import { getRecordedTestPaths } from "@cursorless/node-common"; import * as yaml from "js-yaml"; import assert from "node:assert"; import { promises as fsp } from "node:fs"; -import { canonicalizeAndValidateCommand } from "../core/commandVersionUpgrades/canonicalizeAndValidateCommand"; -import { getHatMapCommand } from "./getHatMapCommand"; import { SpokenFormGenerator } from "."; -import { defaultSpokenFormInfoMap } from "../spokenForms/defaultSpokenFormMap"; +import { canonicalizeAndValidateCommand } from "../core/commandVersionUpgrades/canonicalizeAndValidateCommand"; import { SpokenFormMap, mapSpokenForms } from "../spokenForms/SpokenFormMap"; +import { defaultSpokenFormInfoMap } from "../spokenForms/defaultSpokenFormMap"; +import { getHatMapCommand } from "./getHatMapCommand"; /** * A spoken form map to use for testing. Just uses default spoken forms, but diff --git a/packages/cursorless-engine/src/generateSpokenForm/getSpokenFormComponentMap.ts b/packages/cursorless-engine/src/generateSpokenForm/getSpokenFormComponentMap.ts index 7fd6e7b4f9..7c78b3ed8d 100644 --- a/packages/cursorless-engine/src/generateSpokenForm/getSpokenFormComponentMap.ts +++ b/packages/cursorless-engine/src/generateSpokenForm/getSpokenFormComponentMap.ts @@ -3,7 +3,7 @@ import { PartialSpokenFormTypes, SpokenFormMapKeyTypes, SpokenFormType, -} from "../spokenForms/SpokenFormType"; +} from "@cursorless/common"; import { CustomizableSpokenFormComponentForType } from "./SpokenFormComponent"; /** diff --git a/packages/cursorless-engine/src/index.ts b/packages/cursorless-engine/src/index.ts index 64cfba29d4..61387aa794 100644 --- a/packages/cursorless-engine/src/index.ts +++ b/packages/cursorless-engine/src/index.ts @@ -1,17 +1,18 @@ export * from "./testUtil/plainObjectToTarget"; export * from "./testUtil/takeSnapshot"; -export * from "./testCaseRecorder/TestCaseRecorder"; export * from "./core/StoredTargets"; -export * from "./typings/TreeSitter"; export * from "./cursorlessEngine"; export * from "./generateSpokenForm/defaultSpokenForms/surroundingPairsDelimiters"; +export * from "./generateSpokenForm/generateSpokenForm"; +export * from "./spokenForms/defaultSpokenFormMap"; export * from "./api/CursorlessEngineApi"; export * from "./CommandRunner"; export * from "./CommandHistory"; export * from "./CommandHistoryAnalyzer"; export * from "./util/grammarHelpers"; -export * from "./ScopeTestRecorder"; -export * from "./scopeProviders/TalonSpokenForms"; export * from "./core/Snippets"; export * from "./core/mergeSnippets"; -export * from "./util/object"; +export * from "./core/StoredTargets"; +export * from "./testUtil/extractTargetKeys"; +export * from "./util/getPartialTargetDescriptors"; +export * from "./singletons/ide.singleton"; diff --git a/packages/cursorless-engine/src/languages/LanguageDefinition.ts b/packages/cursorless-engine/src/languages/LanguageDefinition.ts index 8b1d320a09..09406e93a8 100644 --- a/packages/cursorless-engine/src/languages/LanguageDefinition.ts +++ b/packages/cursorless-engine/src/languages/LanguageDefinition.ts @@ -1,14 +1,13 @@ import { ScopeType, SimpleScopeType, + matchAll, showError, type IDE, type RawTreeSitterQueryProvider, + type TreeSitter, } from "@cursorless/common"; -import { dirname, join } from "pathe"; import { TreeSitterScopeHandler } from "../processTargets/modifiers/scopeHandlers"; -import { TreeSitter } from "../typings/TreeSitter"; -import { matchAll } from "../util/regex"; import { TreeSitterQuery } from "./TreeSitterQuery"; import { validateQueryCaptures } from "./TreeSitterQuery/validateQueryCaptures"; @@ -147,17 +146,15 @@ async function readQueryFileAndImports( // but is very lenient about whitespace and quotes, and also allows // include instead of import, so that we can throw a nice error message // if the developer uses the wrong syntax - /^[^\S\r\n]*;;?[^\S\r\n]*(?:import|include)[^\S\r\n]+['"]?([\w|/.]+)['"]?[^\S\r\n]*$/gm, + /^[^\S\r\n]*;;?[^\S\r\n]*(?:import|include)[^\S\r\n]+['"]?([\w|/\\.]+)['"]?[^\S\r\n]*$/gm, (match) => { - const relativeImportPath = match[1]; + const importName = match[1]; if (doValidation) { - validateImportSyntax(ide, queryName, relativeImportPath, match[0]); + validateImportSyntax(ide, queryName, importName, match[0]); } - const importQueryPath = join(dirname(queryName), relativeImportPath); - rawQueryStrings[importQueryPath] = - rawQueryStrings[importQueryPath] ?? null; + rawQueryStrings[importName] = rawQueryStrings[importName] ?? null; }, ); } @@ -169,11 +166,22 @@ async function readQueryFileAndImports( function validateImportSyntax( ide: IDE, file: string, - relativeImportPath: string, + importName: string, actual: string, ) { - const canonicalSyntax = `;; import ${relativeImportPath}`; + let isError = false; + if (/[/\\]/g.test(importName)) { + showError( + ide.messages, + "LanguageDefinition.readQueryFileAndImports.invalidImport", + `Invalid import statement in ${file}: "${actual}". Relative import paths not supported`, + ); + + isError = true; + } + + const canonicalSyntax = `;; import ${importName}`; if (actual !== canonicalSyntax) { showError( ide.messages, @@ -181,8 +189,10 @@ function validateImportSyntax( `Malformed import statement in ${file}: "${actual}". Import statements must be of the form "${canonicalSyntax}"`, ); - if (ide.runMode === "test") { - throw new Error("Invalid import statement"); - } + isError = true; + } + + if (isError && ide.runMode === "test") { + throw new Error("Invalid import statement"); } } diff --git a/packages/cursorless-engine/src/languages/LanguageDefinitions.ts b/packages/cursorless-engine/src/languages/LanguageDefinitions.ts index ef126a9cb9..506a2dcbba 100644 --- a/packages/cursorless-engine/src/languages/LanguageDefinitions.ts +++ b/packages/cursorless-engine/src/languages/LanguageDefinitions.ts @@ -5,12 +5,12 @@ import { TextDocument, showError, type IDE, - type RawTreeSitterQueryProvider, type Listener, + type RawTreeSitterQueryProvider, + type TreeSitter, } from "@cursorless/common"; import { toString } from "lodash-es"; -import { SyntaxNode } from "web-tree-sitter"; -import { TreeSitter } from "../typings/TreeSitter"; +import type { SyntaxNode } from "web-tree-sitter"; import { LanguageDefinition } from "./LanguageDefinition"; /** diff --git a/packages/cursorless-engine/src/languages/TreeSitterQuery/TreeSitterQuery.ts b/packages/cursorless-engine/src/languages/TreeSitterQuery/TreeSitterQuery.ts index b5706e47bc..f2fd931d27 100644 --- a/packages/cursorless-engine/src/languages/TreeSitterQuery/TreeSitterQuery.ts +++ b/packages/cursorless-engine/src/languages/TreeSitterQuery/TreeSitterQuery.ts @@ -1,13 +1,17 @@ -import { Position, TextDocument, showError } from "@cursorless/common"; +import { + Position, + TextDocument, + showError, + type TreeSitter, +} from "@cursorless/common"; import { Point, Query } from "web-tree-sitter"; import { ide } from "../../singletons/ide.singleton"; -import { TreeSitter } from "../../typings/TreeSitter"; +import { groupBy, uniq } from "lodash-es"; import { getNodeRange } from "../../util/nodeSelectors"; import { MutableQueryMatch, QueryCapture, QueryMatch } from "./QueryCapture"; +import { checkCaptureStartEnd } from "./checkCaptureStartEnd"; import { parsePredicates } from "./parsePredicates"; import { predicateToString } from "./predicateToString"; -import { groupBy, uniq } from "lodash-es"; -import { checkCaptureStartEnd } from "./checkCaptureStartEnd"; import { rewriteStartOfEndOf } from "./rewriteStartOfEndOf"; /** diff --git a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SentenceScopeHandler/SentenceScopeHandler.ts b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SentenceScopeHandler/SentenceScopeHandler.ts index e4ba5ae2b8..c97cbaa72e 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SentenceScopeHandler/SentenceScopeHandler.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SentenceScopeHandler/SentenceScopeHandler.ts @@ -1,10 +1,9 @@ -import { Direction, Range } from "@cursorless/common"; +import { Direction, MatchedText, Range } from "@cursorless/common"; import { imap } from "itertools"; -import { NestedScopeHandler } from "../NestedScopeHandler"; import { TokenTarget } from "../../../targets"; +import { NestedScopeHandler } from "../NestedScopeHandler"; import type { TargetScope } from "../scope.types"; import { SentenceSegmenter } from "./SentenceSegmenter"; -import { MatchedText } from "../../../../util/regex"; export class SentenceScopeHandler extends NestedScopeHandler { public readonly scopeType = { type: "sentence" } as const; diff --git a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SentenceScopeHandler/SentenceSegmenter.ts b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SentenceScopeHandler/SentenceSegmenter.ts index e7a5c94da9..e013b4b8ac 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SentenceScopeHandler/SentenceSegmenter.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SentenceScopeHandler/SentenceSegmenter.ts @@ -1,5 +1,5 @@ +import { MatchedText, matchRegex, testRegex } from "@cursorless/common"; import * as sbd from "sbd"; -import { MatchedText, matchRegex, testRegex } from "../../../../util/regex"; // A sentence starts with a letter with adjacent leading symbols. Whitespace excluded. const leadingOffsetRegex = /\S*\p{L}/u; diff --git a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/WordScopeHandler/WordTokenizer.ts b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/WordScopeHandler/WordTokenizer.ts index e2b886f552..a1106d6623 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/WordScopeHandler/WordTokenizer.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/WordScopeHandler/WordTokenizer.ts @@ -1,5 +1,5 @@ +import { matchText } from "@cursorless/common"; import { getMatcher } from "../../../../tokenizer"; -import { matchText } from "../../../../util/regex"; const CAMEL_REGEX = /\p{Lu}?\p{Ll}+|\p{Lu}+(?!\p{Ll})|\p{N}+/gu; diff --git a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/isPreferredOverHelper.ts b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/isPreferredOverHelper.ts index 3920e8e18d..47278d07e7 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/isPreferredOverHelper.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/isPreferredOverHelper.ts @@ -1,4 +1,4 @@ -import { testRegex } from "../../../util/regex"; +import { testRegex } from "@cursorless/common"; import type { TargetScope } from "./scope.types"; export function isPreferredOverHelper( diff --git a/packages/cursorless-engine/src/processTargets/modifiers/surroundingPair/delimiterMaps.ts b/packages/cursorless-engine/src/processTargets/modifiers/surroundingPair/delimiterMaps.ts index c9ca6f8a24..1412215d78 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/surroundingPair/delimiterMaps.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/surroundingPair/delimiterMaps.ts @@ -1,8 +1,8 @@ import { ComplexSurroundingPairName, SimpleSurroundingPairName, + unsafeKeys, } from "@cursorless/common"; -import { unsafeKeys } from "../../../util/object"; type IndividualDelimiterText = string | string[]; diff --git a/packages/cursorless-engine/src/processTargets/modifiers/surroundingPair/findSurroundingPairTextBased.ts b/packages/cursorless-engine/src/processTargets/modifiers/surroundingPair/findSurroundingPairTextBased.ts index d130fb2e6c..9d6566dd25 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/surroundingPair/findSurroundingPairTextBased.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/surroundingPair/findSurroundingPairTextBased.ts @@ -1,11 +1,13 @@ -import { Range, TextDocument, TextEditor } from "@cursorless/common"; -import { escapeRegExp, findLast, uniq } from "lodash-es"; -import { matchAll } from "../../../util/regex"; import { + Range, SimpleSurroundingPairName, SurroundingPairName, SurroundingPairScopeType, + TextDocument, + TextEditor, + matchAll, } from "@cursorless/common"; +import { escapeRegExp, findLast, uniq } from "lodash-es"; import { extractSelectionFromSurroundingPairOffsets } from "./extractSelectionFromSurroundingPairOffsets"; import { findSurroundingPairCore } from "./findSurroundingPairCore"; import { getIndividualDelimiters } from "./getIndividualDelimiters"; diff --git a/packages/cursorless-engine/src/runCommand.ts b/packages/cursorless-engine/src/runCommand.ts index c8a12b3888..50044cb7ed 100644 --- a/packages/cursorless-engine/src/runCommand.ts +++ b/packages/cursorless-engine/src/runCommand.ts @@ -5,6 +5,7 @@ import { HatTokenMap, ReadOnlyHatMap, clientSupportsFallback, + type TreeSitter, } from "@cursorless/common"; import { CommandRunner } from "./CommandRunner"; import { Actions } from "./actions/Actions"; @@ -13,7 +14,8 @@ import { Debug } from "./core/Debug"; import { CommandRunnerImpl } from "./core/commandRunner/CommandRunnerImpl"; import { canonicalizeAndValidateCommand } from "./core/commandVersionUpgrades/canonicalizeAndValidateCommand"; import { RangeUpdater } from "./core/updateSelections/RangeUpdater"; -import { StoredTargetMap, TreeSitter, type Snippets } from "./index"; +import type { Snippets } from "./core/Snippets"; +import type { StoredTargetMap } from "./core/StoredTargets"; import { LanguageDefinitions } from "./languages/LanguageDefinitions"; import { TargetPipelineRunner } from "./processTargets"; import { MarkStageFactoryImpl } from "./processTargets/MarkStageFactoryImpl"; diff --git a/packages/cursorless-engine/src/runIntegrationTests.ts b/packages/cursorless-engine/src/runIntegrationTests.ts index c8a8651023..b41bf9a59b 100644 --- a/packages/cursorless-engine/src/runIntegrationTests.ts +++ b/packages/cursorless-engine/src/runIntegrationTests.ts @@ -1,8 +1,7 @@ -import { languageMatchers } from "./languages/getNodeMatcher"; -import { TreeSitter } from "./typings/TreeSitter"; -import { legacyLanguageIds } from "./languages/LegacyLanguageId"; +import { unsafeKeys, type TreeSitter } from "@cursorless/common"; import { LanguageDefinitions } from "./languages/LanguageDefinitions"; -import { unsafeKeys } from "./util/object"; +import { legacyLanguageIds } from "./languages/LegacyLanguageId"; +import { languageMatchers } from "./languages/getNodeMatcher"; /** * Run tests that require multiple components to be instantiated, as well as a diff --git a/packages/cursorless-engine/src/scripts/transformRecordedTests/index.ts b/packages/cursorless-engine/src/scripts/transformRecordedTests/index.ts index da99f0f6ad..a60be19362 100644 --- a/packages/cursorless-engine/src/scripts/transformRecordedTests/index.ts +++ b/packages/cursorless-engine/src/scripts/transformRecordedTests/index.ts @@ -2,15 +2,15 @@ import { CommandVersion, LATEST_VERSION, TestCaseFixtureLegacy, - getRecordedTestPaths, } from "@cursorless/common"; +import { getRecordedTestPaths } from "@cursorless/node-common"; +import { checkMarks } from "./checkMarks"; +import { transformFile } from "./transformFile"; +import { canonicalize } from "./transformations/canonicalize"; import { identity } from "./transformations/identity"; import { upgrade } from "./transformations/upgrade"; -import { transformFile } from "./transformFile"; import { FixtureTransformation } from "./types"; import { upgradeDecorations } from "./upgradeDecorations"; -import { checkMarks } from "./checkMarks"; -import { canonicalize } from "./transformations/canonicalize"; const AVAILABLE_TRANSFORMATIONS: Record = { upgrade, diff --git a/packages/cursorless-engine/src/scripts/transformRecordedTests/moveFile.ts b/packages/cursorless-engine/src/scripts/transformRecordedTests/moveFile.ts index 405222ef99..edce4d0399 100644 --- a/packages/cursorless-engine/src/scripts/transformRecordedTests/moveFile.ts +++ b/packages/cursorless-engine/src/scripts/transformRecordedTests/moveFile.ts @@ -1,7 +1,7 @@ -import { promises as fsp } from "fs"; -import * as path from "pathe"; +import { promises as fsp } from "node:fs"; +import * as path from "node:path"; import * as yaml from "js-yaml"; -import { mkdir, rename } from "fs/promises"; +import { mkdir, rename } from "node:fs/promises"; import { TestCaseFixture } from "@cursorless/common"; /** diff --git a/packages/cursorless-engine/src/spokenForms/CustomSpokenForms.ts b/packages/cursorless-engine/src/spokenForms/CustomSpokenForms.ts index e94385249a..84a3197c04 100644 --- a/packages/cursorless-engine/src/spokenForms/CustomSpokenForms.ts +++ b/packages/cursorless-engine/src/spokenForms/CustomSpokenForms.ts @@ -1,19 +1,18 @@ import { CustomRegexScopeType, Disposable, - Notifier, - showError, -} from "@cursorless/common"; -import { isEqual } from "lodash-es"; -import { NeedsInitialTalonUpdateError, + Notifier, SUPPORTED_ENTRY_TYPES, SpokenFormEntry, + SpokenFormMapKeyTypes, + SpokenFormType, TalonSpokenForms, -} from "../scopeProviders/TalonSpokenForms"; + showError, +} from "@cursorless/common"; +import { isEqual } from "lodash-es"; import { ide } from "../singletons/ide.singleton"; import { SpokenFormMap, SpokenFormMapEntry } from "./SpokenFormMap"; -import { SpokenFormMapKeyTypes, SpokenFormType } from "./SpokenFormType"; import { defaultSpokenFormInfoMap, defaultSpokenFormMap, diff --git a/packages/cursorless-engine/src/spokenForms/SpokenFormMap.ts b/packages/cursorless-engine/src/spokenForms/SpokenFormMap.ts index 37002e14db..a7a81a93b7 100644 --- a/packages/cursorless-engine/src/spokenForms/SpokenFormMap.ts +++ b/packages/cursorless-engine/src/spokenForms/SpokenFormMap.ts @@ -2,7 +2,7 @@ import { SpokenFormType, PartialSpokenFormTypes, SpokenFormMapKeyTypes, -} from "./SpokenFormType"; +} from "@cursorless/common"; export interface SpokenFormMapEntry { /** diff --git a/packages/cursorless-engine/src/spokenForms/defaultSpokenFormMap.types.ts b/packages/cursorless-engine/src/spokenForms/defaultSpokenFormMap.types.ts index 5b7fa567c5..360c79fb73 100644 --- a/packages/cursorless-engine/src/spokenForms/defaultSpokenFormMap.types.ts +++ b/packages/cursorless-engine/src/spokenForms/defaultSpokenFormMap.types.ts @@ -1,5 +1,5 @@ import { SpokenFormMappingType } from "./SpokenFormMap"; -import { SpokenFormMapKeyTypes } from "./SpokenFormType"; +import { SpokenFormMapKeyTypes } from "@cursorless/common"; export type DefaultSpokenFormMapDefinition = { readonly [K in keyof SpokenFormMapKeyTypes]: Readonly< diff --git a/packages/cursorless-engine/src/test/spokenForms.talon.test.ts b/packages/cursorless-engine/src/test/spokenForms.talon.test.ts index 086300c068..3d44e3239b 100644 --- a/packages/cursorless-engine/src/test/spokenForms.talon.test.ts +++ b/packages/cursorless-engine/src/test/spokenForms.talon.test.ts @@ -3,19 +3,19 @@ import { CommandLatest, TestCaseFixtureLegacy, asyncSafety, - getRecordedTestPaths, } from "@cursorless/common"; +import { getRecordedTestPaths } from "@cursorless/node-common"; import assert from "assert"; import * as yaml from "js-yaml"; import { promises as fsp } from "node:fs"; import { canonicalizeAndValidateCommand } from "../core/commandVersionUpgrades/canonicalizeAndValidateCommand"; import { getHatMapCommand } from "../generateSpokenForm/getHatMapCommand"; import { TalonRepl } from "../testUtil/TalonRepl"; -import { synonymousSpokenFormsFixture } from "./fixtures/synonymousSpokenForms.fixture"; -import { talonApiFixture } from "./fixtures/talonApi.fixture"; -import { multiActionFixture } from "./fixtures/multiAction.fixture"; import { communitySnippetsSpokenFormsFixture } from "./fixtures/communitySnippets.fixture"; +import { multiActionFixture } from "./fixtures/multiAction.fixture"; import { SpokenFormTestOpts } from "./fixtures/spokenFormTest"; +import { synonymousSpokenFormsFixture } from "./fixtures/synonymousSpokenForms.fixture"; +import { talonApiFixture } from "./fixtures/talonApi.fixture"; suite("Talon spoken forms", async function () { const repl = new TalonRepl(); diff --git a/packages/cursorless-engine/src/tokenGraphemeSplitter/tokenGraphemeSplitter.ts b/packages/cursorless-engine/src/tokenGraphemeSplitter/tokenGraphemeSplitter.ts index 3803647e7e..ef816fdd8f 100644 --- a/packages/cursorless-engine/src/tokenGraphemeSplitter/tokenGraphemeSplitter.ts +++ b/packages/cursorless-engine/src/tokenGraphemeSplitter/tokenGraphemeSplitter.ts @@ -1,11 +1,11 @@ -import { deburr, escapeRegExp } from "lodash-es"; -import { ide } from "../singletons/ide.singleton"; import { - TokenHatSplittingMode, Disposable, Notifier, + TokenHatSplittingMode, + matchAll, } from "@cursorless/common"; -import { matchAll } from "../util/regex"; +import { deburr, escapeRegExp } from "lodash-es"; +import { ide } from "../singletons/ide.singleton"; /** * A list of all symbols that are speakable by default in community. diff --git a/packages/cursorless-engine/src/tokenizer/tokenizer.ts b/packages/cursorless-engine/src/tokenizer/tokenizer.ts index f94522ff0f..a712c6d4af 100644 --- a/packages/cursorless-engine/src/tokenizer/tokenizer.ts +++ b/packages/cursorless-engine/src/tokenizer/tokenizer.ts @@ -1,6 +1,6 @@ +import { matchAll } from "@cursorless/common"; import { escapeRegExp } from "lodash-es"; import { ide } from "../singletons/ide.singleton"; -import { matchAll } from "../util/regex"; import { LanguageTokenizerComponents } from "./tokenizer.types"; const REPEATABLE_SYMBOLS = [ diff --git a/packages/cursorless-engine/src/util/getMatchesInRange.ts b/packages/cursorless-engine/src/util/getMatchesInRange.ts index e7064e3e5d..db133953eb 100644 --- a/packages/cursorless-engine/src/util/getMatchesInRange.ts +++ b/packages/cursorless-engine/src/util/getMatchesInRange.ts @@ -1,7 +1,10 @@ -import { Range, TextEditor } from "@cursorless/common"; +import { + Range, + TextEditor, + matchAll, + type Direction, +} from "@cursorless/common"; import { imap } from "itertools"; -import { matchAll } from "./regex"; -import type { Direction } from "@cursorless/common"; export function getMatchesInRange( regex: RegExp, diff --git a/packages/cursorless-engine/src/util/nodeMatchers.ts b/packages/cursorless-engine/src/util/nodeMatchers.ts index 7c6e42be07..dfb8218ed0 100644 --- a/packages/cursorless-engine/src/util/nodeMatchers.ts +++ b/packages/cursorless-engine/src/util/nodeMatchers.ts @@ -1,5 +1,5 @@ +import { SimpleScopeTypeType, unsafeKeys } from "@cursorless/common"; import type { SyntaxNode } from "web-tree-sitter"; -import { SimpleScopeTypeType } from "@cursorless/common"; import { NodeFinder, NodeMatcher, @@ -21,7 +21,6 @@ import { simpleSelectionExtractor, unwrapSelectionExtractor, } from "./nodeSelectors"; -import { unsafeKeys } from "./object"; export function matcher( finder: NodeFinder, diff --git a/packages/cursorless-engine/tsconfig.json b/packages/cursorless-engine/tsconfig.json index 31f84660d6..eccd0ee54d 100644 --- a/packages/cursorless-engine/tsconfig.json +++ b/packages/cursorless-engine/tsconfig.json @@ -9,6 +9,9 @@ "references": [ { "path": "../common" + }, + { + "path": "../node-common" } ] } diff --git a/packages/cursorless-vscode-e2e/package.json b/packages/cursorless-vscode-e2e/package.json index 8ff4eeab83..a3dbc7a7ff 100644 --- a/packages/cursorless-vscode-e2e/package.json +++ b/packages/cursorless-vscode-e2e/package.json @@ -20,6 +20,7 @@ "license": "MIT", "dependencies": { "@cursorless/common": "workspace:*", + "@cursorless/node-common": "workspace:*", "@cursorless/vscode-common": "workspace:*", "immer": "^10.0.4", "lodash-es": "^4.17.21" @@ -34,7 +35,6 @@ "chai": "^5.1.0", "js-yaml": "^4.1.0", "mocha": "^10.3.0", - "pathe": "^1.1.2", "sinon": "^17.0.1" }, "types": "./out/index.d.ts", diff --git a/packages/cursorless-vscode-e2e/src/suite/commandHistory.vscode.test.ts b/packages/cursorless-vscode-e2e/src/suite/commandHistory.vscode.test.ts index a242cd6a68..3eba3f431c 100644 --- a/packages/cursorless-vscode-e2e/src/suite/commandHistory.vscode.test.ts +++ b/packages/cursorless-vscode-e2e/src/suite/commandHistory.vscode.test.ts @@ -12,7 +12,7 @@ import { import { assert } from "chai"; import { existsSync } from "node:fs"; import { readFile, readdir, rm } from "node:fs/promises"; -import * as path from "pathe"; +import * as path from "node:path"; import * as vscode from "vscode"; import { endToEndTestSetup } from "../endToEndTestSetup"; import { produce } from "immer"; diff --git a/packages/cursorless-vscode-e2e/src/suite/followLink.vscode.test.ts b/packages/cursorless-vscode-e2e/src/suite/followLink.vscode.test.ts index 52a80e60d0..27074091f4 100644 --- a/packages/cursorless-vscode-e2e/src/suite/followLink.vscode.test.ts +++ b/packages/cursorless-vscode-e2e/src/suite/followLink.vscode.test.ts @@ -4,7 +4,7 @@ import * as os from "os"; import * as vscode from "vscode"; import { endToEndTestSetup } from "../endToEndTestSetup"; import { runCursorlessCommand } from "@cursorless/vscode-common"; -import { getFixturePath } from "@cursorless/common"; +import { getFixturePath } from "@cursorless/node-common"; suite("followLink", async function () { endToEndTestSetup(this); diff --git a/packages/cursorless-vscode-e2e/src/suite/keyboard/basic.vscode.test.ts b/packages/cursorless-vscode-e2e/src/suite/keyboard/basic.vscode.test.ts index c72fdae13b..3dcbec3887 100644 --- a/packages/cursorless-vscode-e2e/src/suite/keyboard/basic.vscode.test.ts +++ b/packages/cursorless-vscode-e2e/src/suite/keyboard/basic.vscode.test.ts @@ -3,8 +3,8 @@ import { assert } from "chai"; import * as vscode from "vscode"; import { endToEndTestSetup, sleepWithBackoff } from "../../endToEndTestSetup"; import sinon from "sinon"; -import * as path from "pathe"; -import { getCursorlessRepoRoot } from "@cursorless/common"; +import * as path from "node:path"; +import { getCursorlessRepoRoot } from "@cursorless/node-common"; import { readFile } from "node:fs/promises"; interface TestCase { diff --git a/packages/cursorless-vscode-e2e/src/suite/recorded.vscode.test.ts b/packages/cursorless-vscode-e2e/src/suite/recorded.vscode.test.ts index d539e32aa9..f2524a9eb8 100644 --- a/packages/cursorless-vscode-e2e/src/suite/recorded.vscode.test.ts +++ b/packages/cursorless-vscode-e2e/src/suite/recorded.vscode.test.ts @@ -3,9 +3,8 @@ import { HatStability, TextEditor, asyncSafety, - getRecordedTestPaths, - runRecordedTest, } from "@cursorless/common"; +import { getRecordedTestPaths, runRecordedTest } from "@cursorless/node-common"; import { getCursorlessApi, openNewEditor, diff --git a/packages/cursorless-vscode-e2e/src/suite/scopes.vscode.test.ts b/packages/cursorless-vscode-e2e/src/suite/scopes.vscode.test.ts index aaa5bdc2c7..ebfc9de655 100644 --- a/packages/cursorless-vscode-e2e/src/suite/scopes.vscode.test.ts +++ b/packages/cursorless-vscode-e2e/src/suite/scopes.vscode.test.ts @@ -1,6 +1,5 @@ import { asyncSafety, - getScopeTestPathsRecursively, languageScopeSupport, ScopeSupportFacet, scopeSupportFacetInfos, @@ -10,6 +9,7 @@ import { TextualScopeSupportFacet, textualScopeSupportFacetInfos, } from "@cursorless/common"; +import { getScopeTestPathsRecursively } from "@cursorless/node-common"; import { getCursorlessApi, openNewEditor } from "@cursorless/vscode-common"; import { assert } from "chai"; import { groupBy, uniq } from "lodash-es"; diff --git a/packages/cursorless-vscode-e2e/src/suite/testCaseRecorder.vscode.test.ts b/packages/cursorless-vscode-e2e/src/suite/testCaseRecorder.vscode.test.ts index 302f8e755e..971aa9550d 100644 --- a/packages/cursorless-vscode-e2e/src/suite/testCaseRecorder.vscode.test.ts +++ b/packages/cursorless-vscode-e2e/src/suite/testCaseRecorder.vscode.test.ts @@ -1,10 +1,12 @@ import { - getFixturePath, - getRecordedTestsDirPath, HatTokenMap, LATEST_VERSION, SimpleActionName, } from "@cursorless/common"; +import { + getFixturePath, + getRecordedTestsDirPath, +} from "@cursorless/node-common"; import { getCursorlessApi, openNewEditor, @@ -12,9 +14,9 @@ import { } from "@cursorless/vscode-common"; import { assert } from "chai"; import * as crypto from "crypto"; -import { mkdir, readdir, readFile, rm } from "fs/promises"; -import * as os from "os"; -import * as path from "pathe"; +import { mkdir, readFile, readdir, rm } from "node:fs/promises"; +import * as os from "node:os"; +import * as path from "node:path"; import * as vscode from "vscode"; import { endToEndTestSetup } from "../endToEndTestSetup"; diff --git a/packages/cursorless-vscode-e2e/tsconfig.json b/packages/cursorless-vscode-e2e/tsconfig.json index b68b70bede..08759df0cd 100644 --- a/packages/cursorless-vscode-e2e/tsconfig.json +++ b/packages/cursorless-vscode-e2e/tsconfig.json @@ -8,6 +8,9 @@ { "path": "../common" }, + { + "path": "../node-common" + }, { "path": "../vscode-common" } diff --git a/packages/cursorless-vscode/package.json b/packages/cursorless-vscode/package.json index 23db8079f8..79a406eb69 100644 --- a/packages/cursorless-vscode/package.json +++ b/packages/cursorless-vscode/package.json @@ -1217,12 +1217,9 @@ "clean": "rm -rf ./out tsconfig.tsbuildinfo ./dist ./build" }, "devDependencies": { - "@types/chai": "^4.3.14", "@types/fs-extra": "11.0.4", - "@types/glob": "^8.1.0", "@types/js-yaml": "^4.0.9", "@types/lodash-es": "4.17.0", - "@types/mocha": "^10.0.6", "@types/nearley": "2.11.5", "@types/node": "18.18.2", "@types/semver": "^7.5.8", @@ -1230,12 +1227,9 @@ "@types/tinycolor2": "1.4.6", "@types/uuid": "^9.0.8", "@types/vscode": "1.75.1", - "chai": "^5.1.0", "esbuild": "^0.20.2", "fast-xml-parser": "^4.3.6", "fs-extra": "11.2.0", - "glob": "^10.3.10", - "mocha": "^10.3.0", "sinon": "^17.0.1" }, "dependencies": { @@ -1243,12 +1237,11 @@ "@cursorless/cursorless-cheatsheet": "workspace:*", "@cursorless/cursorless-engine": "workspace:*", "@cursorless/node-common": "workspace:*", + "@cursorless/test-case-recorder": "workspace:*", "@cursorless/vscode-common": "workspace:*", - "immer": "^10.0.4", "itertools": "^2.2.5", "lodash-es": "^4.17.21", "nearley": "2.20.1", - "pathe": "^1.1.2", "semver": "^7.6.0", "tinycolor2": "1.6.0", "trie-search": "2.0.0", diff --git a/packages/cursorless-vscode/src/VscodeSnippets.ts b/packages/cursorless-vscode/src/VscodeSnippets.ts index fad08e21f1..fe8d45552e 100644 --- a/packages/cursorless-vscode/src/VscodeSnippets.ts +++ b/packages/cursorless-vscode/src/VscodeSnippets.ts @@ -1,18 +1,15 @@ import { + mergeStrict, showError, Snippet, SnippetMap, - walkFiles, type IDE, } from "@cursorless/common"; -import { - mergeSnippets, - mergeStrict, - type Snippets, -} from "@cursorless/cursorless-engine"; -import { readFile, stat, open } from "fs/promises"; +import { mergeSnippets, type Snippets } from "@cursorless/cursorless-engine"; +import { walkFiles } from "@cursorless/node-common"; import { max } from "lodash-es"; -import { join } from "pathe"; +import { open, readFile, stat } from "node:fs/promises"; +import { join } from "node:path"; const CURSORLESS_SNIPPETS_SUFFIX = ".cursorless-snippets"; const SNIPPET_DIR_REFRESH_INTERVAL_MS = 1000; diff --git a/packages/cursorless-vscode/src/extension.ts b/packages/cursorless-vscode/src/extension.ts index d1b2566df1..27f5d666c3 100644 --- a/packages/cursorless-vscode/src/extension.ts +++ b/packages/cursorless-vscode/src/extension.ts @@ -8,44 +8,34 @@ import { ScopeProvider, ScopeType, TextDocument, + type TreeSitter, } from "@cursorless/common"; import { CommandHistory, createCursorlessEngine, - ScopeTestRecorder, - TestCaseRecorder, - TreeSitter, } from "@cursorless/cursorless-engine"; import { FileSystemCommandHistoryStorage, FileSystemRawTreeSitterQueryProvider, FileSystemTalonSpokenForms, + getFixturePath, } from "@cursorless/node-common"; +import { + ScopeTestRecorder, + TestCaseRecorder, +} from "@cursorless/test-case-recorder"; import { CursorlessApi, + ParseTreeApi, getCommandServerApi, getParseTreeApi, - ParseTreeApi, toVscodeRange, } from "@cursorless/vscode-common"; import * as crypto from "crypto"; -import * as os from "os"; -import * as path from "pathe"; +import * as os from "node:os"; +import * as path from "node:path"; import * as vscode from "vscode"; -import { constructTestHelpers } from "./constructTestHelpers"; -import { FakeFontMeasurements } from "./ide/vscode/hats/FakeFontMeasurements"; -import { FontMeasurementsImpl } from "./ide/vscode/hats/FontMeasurementsImpl"; -import { VscodeHats } from "./ide/vscode/hats/VscodeHats"; -import { VscodeFileSystem } from "./ide/vscode/VscodeFileSystem"; -import { VscodeIDE } from "./ide/vscode/VscodeIDE"; -import { - createVscodeScopeVisualizer, - VscodeScopeVisualizer, -} from "./ide/vscode/VSCodeScopeVisualizer"; -import { KeyboardCommands } from "./keyboard/KeyboardCommands"; -import { registerCommands } from "./registerCommands"; import { ReleaseNotes } from "./ReleaseNotes"; -import { revisualizeOnCustomRegexChange } from "./revisualizeOnCustomRegexChange"; import { ScopeTreeProvider } from "./ScopeTreeProvider"; import { ScopeVisualizer, @@ -53,9 +43,22 @@ import { VisualizationType, } from "./ScopeVisualizerCommandApi"; import { StatusBarItem } from "./StatusBarItem"; +import { VscodeSnippets } from "./VscodeSnippets"; +import { constructTestHelpers } from "./constructTestHelpers"; +import { + VscodeScopeVisualizer, + createVscodeScopeVisualizer, +} from "./ide/vscode/VSCodeScopeVisualizer"; +import { VscodeFileSystem } from "./ide/vscode/VscodeFileSystem"; +import { VscodeIDE } from "./ide/vscode/VscodeIDE"; +import { FakeFontMeasurements } from "./ide/vscode/hats/FakeFontMeasurements"; +import { FontMeasurementsImpl } from "./ide/vscode/hats/FontMeasurementsImpl"; +import { VscodeHats } from "./ide/vscode/hats/VscodeHats"; +import { KeyboardCommands } from "./keyboard/KeyboardCommands"; +import { registerCommands } from "./registerCommands"; +import { revisualizeOnCustomRegexChange } from "./revisualizeOnCustomRegexChange"; import { storedTargetHighlighter } from "./storedTargetHighlighter"; import { vscodeApi } from "./vscodeApi"; -import { VscodeSnippets } from "./VscodeSnippets"; /** * Extension entrypoint called by VSCode on Cursorless startup. @@ -79,6 +82,7 @@ export async function activate( vscodeIDE, new FakeIDE(), vscodeIDE.runMode === "test", + getFixturePath("cursorless-snippets"), ); const fakeCommandServerApi = new FakeCommandServerApi(); diff --git a/packages/cursorless-vscode/src/ide/vscode/VscodeFileSystem.ts b/packages/cursorless-vscode/src/ide/vscode/VscodeFileSystem.ts index ccd4d6eff0..2f06085cc7 100644 --- a/packages/cursorless-vscode/src/ide/vscode/VscodeFileSystem.ts +++ b/packages/cursorless-vscode/src/ide/vscode/VscodeFileSystem.ts @@ -4,7 +4,7 @@ import { PathChangeListener, RunMode, } from "@cursorless/common"; -import { isAbsolute, join } from "pathe"; +import { isAbsolute, join } from "node:path"; import * as vscode from "vscode"; export class VscodeFileSystem implements FileSystem { diff --git a/packages/cursorless-vscode/src/ide/vscode/VscodeTextDocumentImpl.ts b/packages/cursorless-vscode/src/ide/vscode/VscodeTextDocumentImpl.ts index 382e5100dd..b01ca1a896 100644 --- a/packages/cursorless-vscode/src/ide/vscode/VscodeTextDocumentImpl.ts +++ b/packages/cursorless-vscode/src/ide/vscode/VscodeTextDocumentImpl.ts @@ -11,6 +11,7 @@ import { toVscodePosition, toVscodeRange, } from "@cursorless/vscode-common"; +import * as path from "node:path"; import * as vscode from "vscode"; import type { URI } from "vscode-uri"; import VscodeTextLineImpl from "./VscodeTextLineImpl"; @@ -20,6 +21,10 @@ export class VscodeTextDocumentImpl implements TextDocument { return this.document.uri; } + get filename(): string { + return path.basename(this.document.uri.path); + } + get languageId(): string { return this.document.languageId; } diff --git a/packages/cursorless-vscode/src/ide/vscode/hats/VscodeHatRenderer.ts b/packages/cursorless-vscode/src/ide/vscode/hats/VscodeHatRenderer.ts index 0b3b84b990..88ac8b7387 100644 --- a/packages/cursorless-vscode/src/ide/vscode/hats/VscodeHatRenderer.ts +++ b/packages/cursorless-vscode/src/ide/vscode/hats/VscodeHatRenderer.ts @@ -3,12 +3,12 @@ import { Messages, Notifier, PathChangeListener, - walkFiles, } from "@cursorless/common"; +import { walkFiles } from "@cursorless/node-common"; import { VscodeApi } from "@cursorless/vscode-common"; +import * as fs from "node:fs/promises"; import { cloneDeep, isEqual } from "lodash-es"; -import * as fs from "fs/promises"; -import * as path from "pathe"; +import * as path from "node:path"; import * as vscode from "vscode"; import { vscodeGetConfigurationString } from "../VscodeConfiguration"; import VscodeEnabledHatStyleManager, { @@ -17,13 +17,13 @@ import VscodeEnabledHatStyleManager, { import { HAT_SHAPES, HatShape, VscodeHatStyleName } from "../hatStyles.types"; import { FontMeasurements } from "./FontMeasurements"; import getHatThemeColors from "./getHatThemeColors"; +import { performPr1868ShapeUpdateInit } from "./performPr1868ShapeUpdateInit"; import { DEFAULT_HAT_HEIGHT_EM, DEFAULT_VERTICAL_OFFSET_EM, IndividualHatAdjustmentMap, defaultShapeAdjustments, } from "./shapeAdjustments"; -import { performPr1868ShapeUpdateInit } from "./performPr1868ShapeUpdateInit"; const CURSORLESS_HAT_SHAPES_SUFFIX = ".svg"; diff --git a/packages/cursorless-vscode/src/registerCommands.ts b/packages/cursorless-vscode/src/registerCommands.ts index 36fba49267..37b2b9a398 100644 --- a/packages/cursorless-vscode/src/registerCommands.ts +++ b/packages/cursorless-vscode/src/registerCommands.ts @@ -10,10 +10,12 @@ import { import { CommandApi, StoredTargetMap, - TestCaseRecorder, analyzeCommandHistory, - type ScopeTestRecorder, } from "@cursorless/cursorless-engine"; +import type { + ScopeTestRecorder, + TestCaseRecorder, +} from "@cursorless/test-case-recorder"; import * as vscode from "vscode"; import { ScopeVisualizer } from "./ScopeVisualizerCommandApi"; import { showDocumentation, showQuickPick } from "./commands"; diff --git a/packages/cursorless-vscode/src/scripts/populateDist/populateDist.ts b/packages/cursorless-vscode/src/scripts/populateDist/populateDist.ts index d1db99cedd..00569c0886 100644 --- a/packages/cursorless-vscode/src/scripts/populateDist/populateDist.ts +++ b/packages/cursorless-vscode/src/scripts/populateDist/populateDist.ts @@ -1,7 +1,7 @@ // Copies files into `dist` directory for packaging import { copy, exists } from "fs-extra"; -import { lstat, mkdir, readFile, rm, writeFile } from "fs/promises"; -import * as path from "pathe"; +import { lstat, mkdir, readFile, rm, writeFile } from "node:fs/promises"; +import * as path from "node:path"; import { assets } from "./assets"; import { Context } from "./context"; diff --git a/packages/cursorless-vscode/src/scripts/preprocessSvgHats.ts b/packages/cursorless-vscode/src/scripts/preprocessSvgHats.ts index 4b45862332..46350b2ca3 100644 --- a/packages/cursorless-vscode/src/scripts/preprocessSvgHats.ts +++ b/packages/cursorless-vscode/src/scripts/preprocessSvgHats.ts @@ -1,7 +1,7 @@ -import { getCursorlessRepoRoot } from "@cursorless/common"; +import { getCursorlessRepoRoot } from "@cursorless/node-common"; import * as parser from "fast-xml-parser"; -import { promises as fsp, readdirSync } from "fs"; -import * as path from "pathe"; +import { promises as fsp, readdirSync } from "node:fs"; +import * as path from "node:path"; async function main() { const directory = path.join(getCursorlessRepoRoot(), "images/hats"); diff --git a/packages/cursorless-vscode/tsconfig.json b/packages/cursorless-vscode/tsconfig.json index f0cba05030..71228f1ab6 100644 --- a/packages/cursorless-vscode/tsconfig.json +++ b/packages/cursorless-vscode/tsconfig.json @@ -19,6 +19,9 @@ { "path": "../node-common" }, + { + "path": "../test-case-recorder" + }, { "path": "../vscode-common" } diff --git a/packages/node-common/package.json b/packages/node-common/package.json index e7fc3056ce..6644d45702 100644 --- a/packages/node-common/package.json +++ b/packages/node-common/package.json @@ -25,9 +25,14 @@ }, "dependencies": { "@cursorless/common": "workspace:*", - "@cursorless/cursorless-engine": "workspace:*", "glob": "^10.3.10", - "pathe": "^1.1.2" + "lodash-es": "^4.17.21" }, - "devDependencies": {} + "devDependencies": { + "@types/chai": "^4.3.14", + "@types/js-yaml": "^4.0.9", + "@types/lodash-es": "4.17.0", + "chai": "^5.1.0", + "js-yaml": "^4.1.0" + } } diff --git a/packages/node-common/src/FileSystemCommandHistoryStorage.ts b/packages/node-common/src/FileSystemCommandHistoryStorage.ts index a1fe0b114f..4fde5b171b 100644 --- a/packages/node-common/src/FileSystemCommandHistoryStorage.ts +++ b/packages/node-common/src/FileSystemCommandHistoryStorage.ts @@ -4,7 +4,7 @@ import type { } from "@cursorless/common"; import { glob } from "glob"; import * as fs from "node:fs/promises"; -import * as path from "pathe"; +import * as path from "node:path"; export class FileSystemCommandHistoryStorage implements CommandHistoryStorage { constructor(private dir: string) {} diff --git a/packages/node-common/src/FileSystemLanguageDefinitionsProvider.ts b/packages/node-common/src/FileSystemRawTreeSitterQueryProvider.ts similarity index 92% rename from packages/node-common/src/FileSystemLanguageDefinitionsProvider.ts rename to packages/node-common/src/FileSystemRawTreeSitterQueryProvider.ts index 34a146448c..50586795a6 100644 --- a/packages/node-common/src/FileSystemLanguageDefinitionsProvider.ts +++ b/packages/node-common/src/FileSystemRawTreeSitterQueryProvider.ts @@ -1,12 +1,12 @@ import { - getCursorlessRepoRoot, + Notifier, type Disposable, type FileSystem, type IDE, type RawTreeSitterQueryProvider, - Notifier, } from "@cursorless/common"; -import * as path from "pathe"; +import * as path from "node:path"; +import { getCursorlessRepoRoot } from "./getCursorlessRepoRoot"; export class FileSystemRawTreeSitterQueryProvider implements RawTreeSitterQueryProvider diff --git a/packages/node-common/src/FileSystemTalonSpokenForms.ts b/packages/node-common/src/FileSystemTalonSpokenForms.ts index 6215dbab03..5bc8a303d9 100644 --- a/packages/node-common/src/FileSystemTalonSpokenForms.ts +++ b/packages/node-common/src/FileSystemTalonSpokenForms.ts @@ -1,16 +1,14 @@ import { Disposable, FileSystem, - Notifier, - type Listener, -} from "@cursorless/common"; -import { readFile } from "fs/promises"; -import { NeedsInitialTalonUpdateError, + Notifier, SpokenFormEntry, TalonSpokenForms, -} from "@cursorless/cursorless-engine"; -import * as path from "pathe"; + type Listener, +} from "@cursorless/common"; +import { readFile } from "node:fs/promises"; +import * as path from "node:path"; interface TalonSpokenFormsPayload { version: number; diff --git a/packages/common/src/testUtil/getCursorlessRepoRoot.ts b/packages/node-common/src/getCursorlessRepoRoot.ts similarity index 100% rename from packages/common/src/testUtil/getCursorlessRepoRoot.ts rename to packages/node-common/src/getCursorlessRepoRoot.ts diff --git a/packages/common/src/testUtil/getFixturePaths.ts b/packages/node-common/src/getFixturePaths.ts similarity index 78% rename from packages/common/src/testUtil/getFixturePaths.ts rename to packages/node-common/src/getFixturePaths.ts index e5575a4154..88e4e1ca98 100644 --- a/packages/common/src/testUtil/getFixturePaths.ts +++ b/packages/node-common/src/getFixturePaths.ts @@ -1,9 +1,6 @@ -import * as yaml from "js-yaml"; -import * as path from "pathe"; -import { walkFilesSync } from "../util/walkSync"; -import { getCursorlessRepoRoot } from "./getCursorlessRepoRoot"; -import { TestCaseFixtureLegacy } from "../types/TestCaseFixture"; -import { readFile } from "node:fs/promises"; +import * as path from "path"; +import { walkFilesSync } from "./walkSync"; +import { getCursorlessRepoRoot } from "@cursorless/node-common"; export function getFixturesPath() { return path.join(getCursorlessRepoRoot(), "data", "fixtures"); @@ -70,10 +67,3 @@ function pathToName(relativeDir: string, filePath: string) { .relative(relativeDir, filePath.substring(0, filePath.lastIndexOf("."))) .replaceAll("\\", "/"); } - -export async function loadFixture( - path: string, -): Promise { - const buffer = await readFile(path); - return yaml.load(buffer.toString()) as TestCaseFixtureLegacy; -} diff --git a/packages/common/src/testUtil/getScopeTestPathsRecursively.ts b/packages/node-common/src/getScopeTestPathsRecursively.ts similarity index 100% rename from packages/common/src/testUtil/getScopeTestPathsRecursively.ts rename to packages/node-common/src/getScopeTestPathsRecursively.ts diff --git a/packages/node-common/src/index.ts b/packages/node-common/src/index.ts index 6b38d9f42d..59aa0a5621 100644 --- a/packages/node-common/src/index.ts +++ b/packages/node-common/src/index.ts @@ -1,4 +1,10 @@ export * from "./FileSystemCommandHistoryStorage"; -export * from "./FileSystemLanguageDefinitionsProvider"; +export * from "./FileSystemRawTreeSitterQueryProvider"; export * from "./FileSystemTalonSpokenForms"; +export * from "./getCursorlessRepoRoot"; +export * from "./getFixturePaths"; +export * from "./getScopeTestPathsRecursively"; export * from "./nodeGetRunMode"; +export * from "./runRecordedTest"; +export * from "./walkAsync"; +export * from "./walkSync"; diff --git a/packages/node-common/src/loadFixture.ts b/packages/node-common/src/loadFixture.ts new file mode 100644 index 0000000000..877050a1bd --- /dev/null +++ b/packages/node-common/src/loadFixture.ts @@ -0,0 +1,10 @@ +import * as yaml from "js-yaml"; +import { readFile } from "node:fs/promises"; +import { TestCaseFixtureLegacy } from "@cursorless/common"; + +export async function loadFixture( + path: string, +): Promise { + const buffer = await readFile(path); + return yaml.load(buffer.toString()) as TestCaseFixtureLegacy; +} diff --git a/packages/common/src/testUtil/runRecordedTest.ts b/packages/node-common/src/runRecordedTest.ts similarity index 89% rename from packages/common/src/testUtil/runRecordedTest.ts rename to packages/node-common/src/runRecordedTest.ts index 363deca727..01801aae02 100644 --- a/packages/common/src/testUtil/runRecordedTest.ts +++ b/packages/node-common/src/runRecordedTest.ts @@ -1,12 +1,7 @@ import { Command, CommandResponse, - ExcludableSnapshotField, - ExtraSnapshotField, - FakeCommandServerApi, Fallback, - HatTokenMap, - IDE, Position, PositionPlainObject, ReadOnlyHatMap, @@ -14,12 +9,10 @@ import { SelectionPlainObject, SerializedMarks, SpyIDE, - TargetPlainObject, TestCaseFixtureLegacy, - TestCaseSnapshot, TextEditor, clientSupportsFallback, - loadFixture, + getSnapshotForComparison, omitByDeep, rangeToPlainObject, serializeTestFixture, @@ -28,11 +21,12 @@ import { splitKey, spyIDERecordedValuesToPlainObject, storedTargetKeys, + type TestHelpers, } from "@cursorless/common"; import { assert } from "chai"; import { isUndefined } from "lodash-es"; import { promises as fsp } from "node:fs"; -import { getSnapshotForComparison } from "./getSnapshotForComparison"; +import { loadFixture } from "./loadFixture"; function createPosition(position: PositionPlainObject) { return new Position(position.line, position.character); @@ -44,28 +38,6 @@ function createSelection(selection: SelectionPlainObject): Selection { return new Selection(anchor, active); } -export interface TestHelpers { - hatTokenMap: HatTokenMap; - - // FIXME: Remove this once we have a better way to get this function - // accessible from our tests - takeSnapshot( - excludeFields: ExcludableSnapshotField[], - extraFields: ExtraSnapshotField[], - editor: TextEditor, - ide: IDE, - marks: SerializedMarks | undefined, - ): Promise; - - setStoredTarget( - editor: TextEditor, - key: string, - targets: TargetPlainObject[] | undefined, - ): void; - - commandServerApi: FakeCommandServerApi; -} - interface RunRecordedTestOpts { /** * The path to the test fixture diff --git a/packages/common/src/util/walkAsync.ts b/packages/node-common/src/walkAsync.ts similarity index 96% rename from packages/common/src/util/walkAsync.ts rename to packages/node-common/src/walkAsync.ts index a16162ce38..bd7abff7bf 100644 --- a/packages/common/src/util/walkAsync.ts +++ b/packages/node-common/src/walkAsync.ts @@ -1,4 +1,4 @@ -import * as path from "pathe"; +import * as path from "path"; import { readdir } from "fs/promises"; import { flatten } from "lodash-es"; diff --git a/packages/common/src/util/walkSync.ts b/packages/node-common/src/walkSync.ts similarity index 97% rename from packages/common/src/util/walkSync.ts rename to packages/node-common/src/walkSync.ts index 1d1f7e469a..c5058e8869 100644 --- a/packages/common/src/util/walkSync.ts +++ b/packages/node-common/src/walkSync.ts @@ -1,4 +1,4 @@ -import * as path from "pathe"; +import * as path from "path"; import { readdirSync } from "fs"; /** diff --git a/packages/node-common/tsconfig.json b/packages/node-common/tsconfig.json index 0adbe7e0dd..f29b56f5fa 100644 --- a/packages/node-common/tsconfig.json +++ b/packages/node-common/tsconfig.json @@ -8,9 +8,6 @@ "references": [ { "path": "../common" - }, - { - "path": "../cursorless-engine" } ] } diff --git a/packages/test-case-recorder/package.json b/packages/test-case-recorder/package.json new file mode 100644 index 0000000000..ce564830d5 --- /dev/null +++ b/packages/test-case-recorder/package.json @@ -0,0 +1,37 @@ +{ + "name": "@cursorless/test-case-recorder", + "version": "1.0.0", + "description": "Package containing the test case recorder", + "main": "./out/index.js", + "scripts": { + "compile:tsc": "tsc --build", + "compile:esbuild": "esbuild ./src/index.ts --sourcemap --format=esm --bundle --packages=external --outfile=./out/index.js", + "compile": "pnpm compile:tsc && pnpm compile:esbuild", + "watch:tsc": "pnpm compile:tsc --watch", + "watch:esbuild": "pnpm compile:esbuild --watch", + "watch": "pnpm run --filter @cursorless/test-case-recorder --parallel '/^watch:.*/'", + "clean": "rm -rf ./out tsconfig.tsbuildinfo ./dist ./build" + }, + "keywords": [], + "author": "", + "license": "MIT", + "type": "module", + "types": "./out/index.d.ts", + "exports": { + ".": { + "cursorless:bundler": "./src/index.ts", + "default": "./out/index.js" + } + }, + "dependencies": { + "@cursorless/common": "workspace:*", + "@cursorless/cursorless-engine": "workspace:*", + "@cursorless/node-common": "workspace:*", + "glob": "^10.3.10", + "immutability-helper": "^3.1.1", + "lodash-es": "^4.17.21" + }, + "devDependencies": { + "@types/lodash-es": "4.17.0" + } +} diff --git a/packages/cursorless-engine/src/testCaseRecorder/RecordTestCaseCommandOptions.ts b/packages/test-case-recorder/src/RecordTestCaseCommandOptions.ts similarity index 100% rename from packages/cursorless-engine/src/testCaseRecorder/RecordTestCaseCommandOptions.ts rename to packages/test-case-recorder/src/RecordTestCaseCommandOptions.ts diff --git a/packages/cursorless-engine/src/ScopeTestRecorder.ts b/packages/test-case-recorder/src/ScopeTestRecorder.ts similarity index 98% rename from packages/cursorless-engine/src/ScopeTestRecorder.ts rename to packages/test-case-recorder/src/ScopeTestRecorder.ts index 04c5591614..23af8615d8 100644 --- a/packages/cursorless-engine/src/ScopeTestRecorder.ts +++ b/packages/test-case-recorder/src/ScopeTestRecorder.ts @@ -1,7 +1,5 @@ import { ScopeSupportFacetLevel, - getScopeTestPathsRecursively, - getScopeTestsDirPath, groupBy, languageScopeSupport, scopeSupportFacetInfos, @@ -9,9 +7,13 @@ import { type IDE, type ScopeSupportFacet, } from "@cursorless/common"; +import { + getScopeTestPathsRecursively, + getScopeTestsDirPath, +} from "@cursorless/node-common"; import * as fs from "node:fs"; import * as fsPromises from "node:fs/promises"; -import * as path from "pathe"; +import * as path from "node:path"; export class ScopeTestRecorder { constructor(private ide: IDE) { diff --git a/packages/cursorless-engine/src/testCaseRecorder/TestCase.ts b/packages/test-case-recorder/src/TestCase.ts similarity index 93% rename from packages/cursorless-engine/src/testCaseRecorder/TestCase.ts rename to packages/test-case-recorder/src/TestCase.ts index 05e0e00c59..c6c3253ad0 100644 --- a/packages/cursorless-engine/src/testCaseRecorder/TestCase.ts +++ b/packages/test-case-recorder/src/TestCase.ts @@ -19,14 +19,15 @@ import { TestCaseSnapshot, ThrownError, Token, + unsafeKeys, } from "@cursorless/common"; +import { + extractTargetKeys, + getPartialTargetDescriptors, + takeSnapshot, + type StoredTargetMap, +} from "@cursorless/cursorless-engine"; import { pick } from "lodash-es"; -import { StoredTargetMap } from ".."; -import { ide } from "../singletons/ide.singleton"; -import { extractTargetKeys } from "../testUtil/extractTargetKeys"; -import { takeSnapshot } from "../testUtil/takeSnapshot"; -import { getPartialTargetDescriptors } from "../util/getPartialTargetDescriptors"; -import { unsafeKeys } from "../util/object"; export class TestCase { private languageId: string; @@ -55,7 +56,7 @@ export class TestCase { private extraSnapshotFields?: ExtraSnapshotField[], public readonly spokenFormError?: string, ) { - const activeEditor = ide().activeTextEditor!; + const activeEditor = this.spyIde.activeTextEditor!; this.command = command; this.partialTargetDescriptors = getPartialTargetDescriptors(command.action); this.targetKeys = this.partialTargetDescriptors @@ -165,8 +166,8 @@ export class TestCase { this.storedTargets, excludeFields, this.extraSnapshotFields, - ide().activeTextEditor!, - ide(), + this.spyIde.activeTextEditor!, + this.spyIde, this.getMarks(), { startTimestamp: this.startTimestamp }, ); @@ -186,8 +187,8 @@ export class TestCase { this.storedTargets, excludeFields, this.extraSnapshotFields, - ide().activeTextEditor!, - ide(), + this.spyIde.activeTextEditor!, + this.spyIde, this.isHatTokenMapTest ? this.getMarks() : undefined, { startTimestamp: this.startTimestamp }, ); diff --git a/packages/cursorless-engine/src/testCaseRecorder/TestCaseRecorder.ts b/packages/test-case-recorder/src/TestCaseRecorder.ts similarity index 96% rename from packages/cursorless-engine/src/testCaseRecorder/TestCaseRecorder.ts rename to packages/test-case-recorder/src/TestCaseRecorder.ts index 08a7cea5c3..e7fa3fd27e 100644 --- a/packages/cursorless-engine/src/testCaseRecorder/TestCaseRecorder.ts +++ b/packages/test-case-recorder/src/TestCaseRecorder.ts @@ -8,7 +8,6 @@ import { extractTargetedMarks, ExtraSnapshotField, getKey, - getRecordedTestsDirPath, HatTokenMap, IDE, marksToPlainObject, @@ -21,19 +20,22 @@ import { SpyIDE, TextEditorOptions, toLineRange, - walkDirsSync, } from "@cursorless/common"; -import * as fs from "fs"; -import { access, readFile } from "fs/promises"; +import { + CommandRunner, + defaultSpokenFormMap, + ide, + injectIde, + SpokenFormGenerator, + StoredTargetMap, + takeSnapshot, +} from "@cursorless/cursorless-engine"; +import { getRecordedTestsDirPath, walkDirsSync } from "@cursorless/node-common"; import { invariant } from "immutability-helper"; import { merge } from "lodash-es"; -import * as path from "pathe"; -import { CommandRunner } from "../CommandRunner"; -import { StoredTargetMap } from "../core/StoredTargets"; -import { SpokenFormGenerator } from "../generateSpokenForm"; -import { ide, injectIde } from "../singletons/ide.singleton"; -import { defaultSpokenFormMap } from "../spokenForms/defaultSpokenFormMap"; -import { takeSnapshot } from "../testUtil/takeSnapshot"; +import * as fs from "node:fs"; +import { access, readFile } from "node:fs/promises"; +import * as path from "node:path"; import { RecordTestCaseCommandOptions } from "./RecordTestCaseCommandOptions"; import { TestCase } from "./TestCase"; diff --git a/packages/test-case-recorder/src/index.ts b/packages/test-case-recorder/src/index.ts new file mode 100644 index 0000000000..f2210678cc --- /dev/null +++ b/packages/test-case-recorder/src/index.ts @@ -0,0 +1,2 @@ +export * from "./TestCaseRecorder"; +export * from "./ScopeTestRecorder"; diff --git a/packages/test-case-recorder/tsconfig.json b/packages/test-case-recorder/tsconfig.json new file mode 100644 index 0000000000..00219117a8 --- /dev/null +++ b/packages/test-case-recorder/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "rootDir": "src", + "outDir": "out" + }, + "include": ["src/**/*.ts", "src/**/*.json", "../../typings/**/*.d.ts"], + "references": [ + { + "path": "../common" + }, + { + "path": "../cursorless-engine" + }, + { + "path": "../node-common" + } + ] +} diff --git a/packages/test-harness/package.json b/packages/test-harness/package.json index 337417e46c..5e43ee3f3a 100644 --- a/packages/test-harness/package.json +++ b/packages/test-harness/package.json @@ -23,8 +23,8 @@ "license": "MIT", "dependencies": { "@cursorless/common": "workspace:*", - "glob": "^10.3.10", - "pathe": "^1.1.2" + "@cursorless/node-common": "workspace:*", + "glob": "^10.3.10" }, "devDependencies": { "@types/glob": "^8.1.0", diff --git a/packages/test-harness/src/launchVscodeAndRunTests.ts b/packages/test-harness/src/launchVscodeAndRunTests.ts index 32b65bdcbc..4202f90ce5 100644 --- a/packages/test-harness/src/launchVscodeAndRunTests.ts +++ b/packages/test-harness/src/launchVscodeAndRunTests.ts @@ -1,16 +1,16 @@ -import * as cp from "child_process"; -import * as path from "pathe"; -import * as os from "os"; +import { + extensionDependencies, + getEnvironmentVariableStrict, +} from "@cursorless/common"; +import { getCursorlessRepoRoot } from "@cursorless/node-common"; import { downloadAndUnzipVSCode, resolveCliArgsFromVSCodeExecutablePath, runTests, } from "@vscode/test-electron"; -import { - extensionDependencies, - getCursorlessRepoRoot, -} from "@cursorless/common"; -import { getEnvironmentVariableStrict } from "@cursorless/common"; +import * as cp from "node:child_process"; +import * as os from "node:os"; +import * as path from "node:path"; /** * Downloads and launches VSCode, instructing it to run the test runner diff --git a/packages/test-harness/src/runAllTests.ts b/packages/test-harness/src/runAllTests.ts index 86ffb69e7e..7a13494156 100644 --- a/packages/test-harness/src/runAllTests.ts +++ b/packages/test-harness/src/runAllTests.ts @@ -1,6 +1,6 @@ import Mocha from "mocha"; -import * as path from "pathe"; -import { getCursorlessRepoRoot } from "@cursorless/common"; +import * as path from "node:path"; +import { getCursorlessRepoRoot } from "@cursorless/node-common"; import { runTestSubset, testSubsetGrepString } from "./testSubset"; import { glob } from "glob"; diff --git a/packages/test-harness/src/scripts/runTestsCI.ts b/packages/test-harness/src/scripts/runTestsCI.ts index 53430abd13..020d090d8b 100644 --- a/packages/test-harness/src/scripts/runTestsCI.ts +++ b/packages/test-harness/src/scripts/runTestsCI.ts @@ -2,8 +2,8 @@ * This file can be run from node to run tests in CI */ -import { getCursorlessRepoRoot } from "@cursorless/common"; -import * as path from "pathe"; +import { getCursorlessRepoRoot } from "@cursorless/node-common"; +import * as path from "node:path"; import { launchVscodeAndRunTests } from "../launchVscodeAndRunTests"; (async () => { diff --git a/packages/test-harness/src/testSubset.ts b/packages/test-harness/src/testSubset.ts index 0b296086a9..7782e2ad58 100644 --- a/packages/test-harness/src/testSubset.ts +++ b/packages/test-harness/src/testSubset.ts @@ -1,6 +1,6 @@ -import * as fs from "fs"; -import * as path from "pathe"; -import { getCursorlessRepoRoot } from "@cursorless/common"; +import * as fs from "node:fs"; +import * as path from "node:path"; +import { getCursorlessRepoRoot } from "@cursorless/node-common"; /** * Returns the grep string to pass to Mocha when running a subset of tests. diff --git a/packages/test-harness/tsconfig.json b/packages/test-harness/tsconfig.json index 96107efcd7..f95ec8ae56 100644 --- a/packages/test-harness/tsconfig.json +++ b/packages/test-harness/tsconfig.json @@ -8,6 +8,9 @@ "references": [ { "path": "../common" + }, + { + "path": "../node-common" } ] } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 427307152b..b7c0fd5d2d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -204,16 +204,10 @@ importers: lodash-es: specifier: ^4.17.21 version: 4.17.21 - pathe: - specifier: ^1.1.2 - version: 1.1.2 vscode-uri: specifier: ^3.0.8 version: 3.0.8 devDependencies: - '@types/chai': - specifier: ^4.3.14 - version: 4.3.14 '@types/js-yaml': specifier: ^4.0.9 version: 4.0.9 @@ -223,12 +217,6 @@ importers: '@types/mocha': specifier: ^10.0.6 version: 10.0.6 - '@types/sinon': - specifier: ^17.0.3 - version: 17.0.3 - chai: - specifier: ^5.1.0 - version: 5.1.0 cross-spawn: specifier: 7.0.3 version: 7.0.3 @@ -241,15 +229,15 @@ importers: mocha: specifier: ^10.3.0 version: 10.3.0 - sinon: - specifier: ^17.0.1 - version: 17.0.1 packages/cursorless-cheatsheet: dependencies: '@cursorless/common': specifier: workspace:* version: link:../common + '@cursorless/node-common': + specifier: workspace:* + version: link:../node-common immer: specifier: ^10.0.4 version: 10.0.4 @@ -259,9 +247,6 @@ importers: node-html-parser: specifier: ^6.1.12 version: 6.1.12 - pathe: - specifier: ^1.1.2 - version: 1.1.2 devDependencies: '@types/lodash-es': specifier: 4.17.0 @@ -272,9 +257,9 @@ importers: '@cursorless/common': specifier: workspace:* version: link:../common - glob: - specifier: ^10.3.10 - version: 10.3.10 + '@cursorless/node-common': + specifier: workspace:* + version: link:../node-common immer: specifier: ^10.0.4 version: 10.0.4 @@ -293,12 +278,6 @@ importers: nearley: specifier: 2.20.1 version: 2.20.1(patch_hash=mg2fc7wgvzub3myuz6m74hllma) - node-html-parser: - specifier: ^6.1.12 - version: 6.1.12 - pathe: - specifier: ^1.1.2 - version: 1.1.2 sbd: specifier: ^1.0.19 version: 1.0.19 @@ -309,9 +288,6 @@ importers: specifier: 3.22.4 version: 3.22.4 devDependencies: - '@types/glob': - specifier: ^8.1.0 - version: 8.1.0 '@types/js-yaml': specifier: ^4.0.9 version: 4.0.9 @@ -491,12 +467,12 @@ importers: '@cursorless/node-common': specifier: workspace:* version: link:../node-common + '@cursorless/test-case-recorder': + specifier: workspace:* + version: link:../test-case-recorder '@cursorless/vscode-common': specifier: workspace:* version: link:../vscode-common - immer: - specifier: ^10.0.4 - version: 10.0.4 itertools: specifier: ^2.2.5 version: 2.2.5 @@ -506,9 +482,6 @@ importers: nearley: specifier: 2.20.1 version: 2.20.1(patch_hash=mg2fc7wgvzub3myuz6m74hllma) - pathe: - specifier: ^1.1.2 - version: 1.1.2 semver: specifier: ^7.6.0 version: 7.6.0 @@ -525,24 +498,15 @@ importers: specifier: ^3.0.8 version: 3.0.8 devDependencies: - '@types/chai': - specifier: ^4.3.14 - version: 4.3.14 '@types/fs-extra': specifier: 11.0.4 version: 11.0.4 - '@types/glob': - specifier: ^8.1.0 - version: 8.1.0 '@types/js-yaml': specifier: ^4.0.9 version: 4.0.9 '@types/lodash-es': specifier: 4.17.0 version: 4.17.0 - '@types/mocha': - specifier: ^10.0.6 - version: 10.0.6 '@types/nearley': specifier: 2.11.5 version: 2.11.5(patch_hash=5bomp3nnmdzdyzcgrxyr5kymae) @@ -564,9 +528,6 @@ importers: '@types/vscode': specifier: 1.75.1 version: 1.75.1 - chai: - specifier: ^5.1.0 - version: 5.1.0 esbuild: specifier: ^0.20.2 version: 0.20.2 @@ -576,12 +537,6 @@ importers: fs-extra: specifier: 11.2.0 version: 11.2.0 - glob: - specifier: ^10.3.10 - version: 10.3.10 - mocha: - specifier: ^10.3.0 - version: 10.3.0 sinon: specifier: ^17.0.1 version: 17.0.1 @@ -591,6 +546,9 @@ importers: '@cursorless/common': specifier: workspace:* version: link:../common + '@cursorless/node-common': + specifier: workspace:* + version: link:../node-common '@cursorless/vscode-common': specifier: workspace:* version: link:../vscode-common @@ -628,9 +586,6 @@ importers: mocha: specifier: ^10.3.0 version: 10.3.0 - pathe: - specifier: ^1.1.2 - version: 1.1.2 sinon: specifier: ^17.0.1 version: 17.0.1 @@ -679,6 +634,34 @@ importers: version: 0.20.2 packages/node-common: + dependencies: + '@cursorless/common': + specifier: workspace:* + version: link:../common + glob: + specifier: ^10.3.10 + version: 10.3.10 + lodash-es: + specifier: ^4.17.21 + version: 4.17.21 + devDependencies: + '@types/chai': + specifier: ^4.3.14 + version: 4.3.14 + '@types/js-yaml': + specifier: ^4.0.9 + version: 4.0.9 + '@types/lodash-es': + specifier: 4.17.0 + version: 4.17.0 + chai: + specifier: ^5.1.0 + version: 5.1.0 + js-yaml: + specifier: ^4.1.0 + version: 4.1.0 + + packages/test-case-recorder: dependencies: '@cursorless/common': specifier: workspace:* @@ -686,24 +669,34 @@ importers: '@cursorless/cursorless-engine': specifier: workspace:* version: link:../cursorless-engine + '@cursorless/node-common': + specifier: workspace:* + version: link:../node-common glob: specifier: ^10.3.10 version: 10.3.10 - pathe: - specifier: ^1.1.2 - version: 1.1.2 + immutability-helper: + specifier: ^3.1.1 + version: 3.1.1 + lodash-es: + specifier: ^4.17.21 + version: 4.17.21 + devDependencies: + '@types/lodash-es': + specifier: 4.17.0 + version: 4.17.0 packages/test-harness: dependencies: '@cursorless/common': specifier: workspace:* version: link:../common + '@cursorless/node-common': + specifier: workspace:* + version: link:../node-common glob: specifier: ^10.3.10 version: 10.3.10 - pathe: - specifier: ^1.1.2 - version: 1.1.2 devDependencies: '@types/glob': specifier: ^8.1.0 @@ -7297,9 +7290,6 @@ packages: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} engines: {node: '>=8'} - pathe@1.1.2: - resolution: {integrity: sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==} - pathval@2.0.0: resolution: {integrity: sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==} engines: {node: '>= 14.16'} @@ -18419,8 +18409,6 @@ snapshots: path-type@4.0.0: {} - pathe@1.1.2: {} - pathval@2.0.0: {} periscopic@3.1.0: diff --git a/tsconfig.json b/tsconfig.json index 4156eaee54..4c59680a16 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -35,6 +35,9 @@ { "path": "./packages/node-common" }, + { + "path": "./packages/test-case-recorder" + }, { "path": "./packages/test-harness" },