Skip to content

Commit abc515d

Browse files
authored
Stop publishing API docs (#1750)
- Fixes #1749 - Will do a `pnpm remove` on all our typedoc dependencies once #1745 is merged so we don't get massive merge conflicts on our `pnpm.lock` 😅 - Our website deploy has gone from more than 12 minutes to 1 min 20 sec 🙌 ## 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) - [ ] I have not broken the cheatsheet
1 parent 93918bd commit abc515d

File tree

7 files changed

+66
-108
lines changed

7 files changed

+66
-108
lines changed

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ node_modules
66
/package-lock.json
77
*.DS_Store
88

9-
# TypeDoc output
10-
docs/contributing/api/
11-
129
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
1310

1411
# dependencies

docs/contributing/CONTRIBUTING.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
# Contributing
22

3-
Welcome! So glad you've decided to help make Cursorless better. Once you've
4-
learned how to [set up](#initial-setup) and [run / test a local copy of the
5-
extension](#running--testing-extension-locally), you may want to check out the
6-
[Cursorless API docs](api) to learn more about how Cursorless works. You may also find the [VSCode API docs](https://code.visualstudio.com/api) helpful to learn about VSCode extension development.
3+
Welcome! So glad you've decided to help make Cursorless better. You'll want to start by getting [set up](#initial-setup) and learning how to [run / test a local copy of the
4+
extension](#running--testing-extension-locally). You may also find the [VSCode API docs](https://code.visualstudio.com/api) helpful to learn about VSCode extension development.
75

86
## Initial setup
97

docs/contributing/test-case-recorder.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ command run, and the final state, all in the form of a yaml document. See
3535

3636
## Test case recorder options
3737

38-
The test case recorder has several additional configuration options. The default configuration works for most tests, but you may find the following useful. For a full list of supported configuration options, see [the api docs](../api/interfaces/cursorless_engine_src_testCaseRecorder_TestCaseRecorder.internal.RecordTestCaseCommandArg/).
38+
The test case recorder has several additional configuration options. The default configuration works for most tests, but you may find the following useful. For a full list of supported configuration options, see [`RecordTestCaseCommandOptions`](../../packages/cursorless-engine/src/testCaseRecorder/RecordTestCaseCommandOptions.ts).
3939

4040
### The options
4141

@@ -55,15 +55,15 @@ By default, we don't capture the `that` mark returned by a command, unless the t
5555

5656
#### Testing the hat map
5757

58-
We have a way to test that the hats in the hat map update correctly during the course of a single phrase. These tests are also how we usually test our [range updating code](../api/modules/cursorless_engine_src_core_updateSelections_updateSelections).
58+
We have a way to test that the hats in the hat map update correctly during the course of a single phrase. These tests are also how we usually test our [range updating code](../../packages/cursorless-engine/src/core/updateSelections/updateSelections.ts).
5959

6060
Any tests recorded in the `hatTokenMap` directory will automatically be treated as hat token map tests. To initiate a series of hat token map tests in another directory, say `"cursorless record navigation"`.
6161

6262
Then each time you record a test, you need to issue two commands. The second command should be of the form `"take air"` (or another decorated mark), and will tell the test case recorder which decorated mark you're checking.
6363

6464
### Default config per test case directory
6565

66-
Any test case directory that contains a `config.json` will set default configuration for all tests recorded in any descendant directory. For example, the file [`actions/config.json`](../../packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/actions/config.json) makes it so that all our action tests will capture the final `that` mark. For a full list of keys supported in this json, see [the api docs](../api/interfaces/cursorless_engine_src_testCaseRecorder_TestCaseRecorder.internal.RecordTestCaseCommandArg/).
66+
Any test case directory that contains a `config.json` will set default configuration for all tests recorded in any descendant directory. For example, the file [`actions/config.json`](../../packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/actions/config.json) makes it so that all our action tests will capture the final `that` mark. For a full list of keys supported in this json, see [`RecordTestCaseCommandOptions`](../../packages/cursorless-engine/src/testCaseRecorder/RecordTestCaseCommandOptions.ts).
6767

6868
### Navigation map tests
6969

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import { ExtraSnapshotField } from "@cursorless/common";
2+
3+
/**
4+
* This is the type of the `recordTestCase` command's argument. It is used to
5+
* specify the options for recording a test case.
6+
*/
7+
export interface RecordTestCaseCommandOptions {
8+
/**
9+
* If this is set to `true`, then for each test case that we record, we expect
10+
* that the user will issue a second command in each phrase, which refers to a
11+
* decorated mark whose range we'd like to check that it got updated properly
12+
* during the previous command. We use this functionality in order to check
13+
* that the token range update works properly. For example, you might say
14+
* `"chuck second car ox air take air"` to check that removing a character
15+
* from a token properly updates the token.
16+
*/
17+
isHatTokenMapTest?: boolean;
18+
19+
/** If true decorations will be added to the test fixture */
20+
isDecorationsTest?: boolean;
21+
22+
/**
23+
* The directory in which to store the test cases that we record. If left out
24+
* the user will be prompted to select a directory within the default recorded
25+
* test case directory.
26+
*/
27+
directory?: string;
28+
29+
/**
30+
* If `true`, don't show a little pop up each time to indicate we've recorded a
31+
* test case
32+
*/
33+
isSilent?: boolean;
34+
35+
extraSnapshotFields?: ExtraSnapshotField[];
36+
37+
/**
38+
* Whether to flash a background for calibrating a video recording
39+
*/
40+
showCalibrationDisplay?: boolean;
41+
42+
/**
43+
* Whether we should record a tests which yield errors in addition to tests
44+
* which do not error.
45+
*/
46+
recordErrors?: boolean;
47+
48+
/**
49+
* Whether to capture the `that` mark returned by the action.
50+
*/
51+
captureFinalThatMark?: boolean;
52+
}

packages/cursorless-engine/src/testCaseRecorder/TestCaseRecorder.ts

Lines changed: 9 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -32,56 +32,10 @@ import { TestCase } from "./TestCase";
3232
import { StoredTargetMap } from "../core/StoredTargets";
3333
import { CommandRunner } from "../CommandRunner";
3434
import { generateSpokenForm } from "../generateSpokenForm";
35+
import { RecordTestCaseCommandOptions } from "./RecordTestCaseCommandOptions";
3536

3637
const CALIBRATION_DISPLAY_DURATION_MS = 50;
3738

38-
interface RecordTestCaseCommandArg {
39-
/**
40-
* If this is set to `true`, then for each test case that we record, we expect
41-
* that the user will issue a second command in each phrase, which refers to a
42-
* decorated mark whose range we'd like to check that it got updated properly
43-
* during the previous command. We use this functionality in order to check
44-
* that the token range update works properly. For example, you might say
45-
* `"chuck second car ox air take air"` to check that removing a character
46-
* from a token properly updates the token.
47-
*/
48-
isHatTokenMapTest?: boolean;
49-
50-
/** If true decorations will be added to the test fixture */
51-
isDecorationsTest?: boolean;
52-
53-
/**
54-
* The directory in which to store the test cases that we record. If left out
55-
* the user will be prompted to select a directory within the default recorded
56-
* test case directory.
57-
*/
58-
directory?: string;
59-
60-
/**
61-
* If `true`, don't show a little pop up each time to indicate we've recorded a
62-
* test case
63-
*/
64-
isSilent?: boolean;
65-
66-
extraSnapshotFields?: ExtraSnapshotField[];
67-
68-
/**
69-
* Whether to flash a background for calibrating a video recording
70-
*/
71-
showCalibrationDisplay?: boolean;
72-
73-
/**
74-
* Whether we should record a tests which yield errors in addition to tests
75-
* which do not error.
76-
*/
77-
recordErrors?: boolean;
78-
79-
/**
80-
* Whether to capture the `that` mark returned by the action.
81-
*/
82-
captureFinalThatMark?: boolean;
83-
}
84-
8539
const TIMING_CALIBRATION_HIGHLIGHT_ID = "timingCalibration";
8640

8741
/**
@@ -124,20 +78,20 @@ export class TestCaseRecorder {
12478
this.takeSnapshot = this.takeSnapshot.bind(this);
12579
}
12680

127-
async toggle(arg?: RecordTestCaseCommandArg) {
81+
async toggle(options?: RecordTestCaseCommandOptions) {
12882
if (this.active) {
12983
showInfo(ide().messages, "recordStop", "Stopped recording test cases");
13084
this.stop();
13185
} else {
132-
return await this.start(arg);
86+
return await this.start(options);
13387
}
13488
}
13589

136-
async recordOneThenPause(arg?: RecordTestCaseCommandArg) {
90+
async recordOneThenPause(options?: RecordTestCaseCommandOptions) {
13791
this.pauseAfterNextCommand = true;
13892
this.paused = false;
13993
if (!this.active) {
140-
return await this.start(arg);
94+
return await this.start(options);
14195
}
14296
}
14397

@@ -194,8 +148,8 @@ export class TestCaseRecorder {
194148
return this.active && !this.paused;
195149
}
196150

197-
async start(arg?: RecordTestCaseCommandArg) {
198-
const { directory, ...explicitConfig } = arg ?? {};
151+
async start(options?: RecordTestCaseCommandOptions) {
152+
const { directory, ...explicitConfig } = options ?? {};
199153

200154
/**
201155
* A list of paths of every parent directory between the root fixture
@@ -227,7 +181,7 @@ export class TestCaseRecorder {
227181

228182
// Look for a `config.json` file in ancestors of the recording directory,
229183
// and merge it with the config provided when calling the command.
230-
const config: RecordTestCaseCommandArg = merge(
184+
const config: RecordTestCaseCommandOptions = merge(
231185
{},
232186
...(await Promise.all(
233187
parentDirectories.map((parent) =>
@@ -532,7 +486,7 @@ function capitalize(str: string) {
532486

533487
async function readJsonIfExists(
534488
path: string,
535-
): Promise<RecordTestCaseCommandArg> {
489+
): Promise<RecordTestCaseCommandOptions> {
536490
let rawText: string;
537491

538492
try {

packages/cursorless-org-docs/docusaurus.config.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -70,19 +70,6 @@ const config = {
7070
onBrokenMarkdownLinks: "throw",
7171
trailingSlash: true,
7272

73-
plugins: [
74-
[
75-
"docusaurus-plugin-typedoc",
76-
// TypeDoc options merged with docusaurus specific options
77-
{
78-
...require("./typedoc.js"),
79-
docsRoot: "../../docs",
80-
// Out path is relative to docsRoot
81-
out: "contributing/api",
82-
},
83-
],
84-
],
85-
8673
presets: [
8774
[
8875
"classic",

packages/cursorless-org-docs/typedoc.js

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)