Skip to content

Commit b0262ef

Browse files
committed
- Moving cheatsheet spoken form type definition to common package
- Cleaning up some of my notes - Using real default spoken form info for debugging purposes instead of dummy data that doesn't help debugging the usage stats in cheat sheet feature
1 parent 32e1f65 commit b0262ef

File tree

18 files changed

+1757
-1709
lines changed

18 files changed

+1757
-1709
lines changed

cursorless-talon/src/cheatsheet/cheat_sheet.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,12 @@ def private_cursorless_cheat_sheet_show_html():
5656
cheatsheet_out_dir.mkdir(parents=True, exist_ok=True)
5757
cheatsheet_out_path = cheatsheet_out_dir / cheatsheet_filename
5858

59-
# This will update the cheatsheet.html file
59+
# Despite the showCheatsheet name, will only update the cheatsheet.html file,
6060
actions.user.private_cursorless_run_rpc_command_and_wait(
6161
"cursorless.showCheatsheet",
6262
{
6363
"version": 0,
64-
# Add usage statistics as part of the spokenFormInfo option #3 (don't like this one)
6564
"spokenFormInfo": cursorless_cheat_sheet_get_json(),
66-
# Add usage statistics to the cheatsheet option #1
6765
"outputPath": str(cheatsheet_out_path),
6866
},
6967
)

cursorless-talon/src/cheatsheet/get_list.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ def get_raw_list(name: str) -> Mapping[str, str]:
4040
return registry.lists[cursorless_list_name][0].copy()
4141

4242

43-
# Is this code used when generating .html cheatsheet?
4443
def make_dict_readable(
4544
type: str, dict: Mapping[str, str], descriptions: Mapping[str, str]
4645
) -> list[ListItemDescriptor]:

packages/cheatsheet-local/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
},
2626
"dependencies": {
2727
"@cursorless/cheatsheet": "workspace:*",
28+
"@cursorless/common": "workspace:*",
2829
"react": "^18.2.0",
2930
"react-dom": "^18.2.0"
3031
},
@@ -59,4 +60,4 @@
5960
}
6061
},
6162
"type": "module"
62-
}
63+
}

packages/cheatsheet-local/src/app/app.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { CheatsheetPage, CheatsheetInfo } from "@cursorless/cheatsheet";
1+
import { CheatsheetInfo } from "@cursorless/common";
2+
import { CheatsheetPage } from "@cursorless/cheatsheet";
23
import "../styles.css";
34

45
declare global {

packages/cheatsheet-local/src/webpack.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import {
55
cheatsheetBodyClasses,
6-
fakeCheatsheetInfo,
6+
defaultCheatsheetInfo,
77
} from "@cursorless/cheatsheet";
88
import HtmlWebpackInlineSourcePlugin from "@effortlessmotion/html-webpack-inline-source-plugin";
99
import HtmlWebpackPlugin from "html-webpack-plugin";
@@ -23,7 +23,7 @@ const config: Configuration = {
2323
template: "src/index.html",
2424
templateParameters: {
2525
bodyClasses: cheatsheetBodyClasses,
26-
fakeCheatsheetInfo: JSON.stringify(fakeCheatsheetInfo),
26+
fakeCheatsheetInfo: JSON.stringify(defaultCheatsheetInfo),
2727
},
2828
inlineSource: ".(js|css)$", // embed all javascript and css inline
2929
}),

packages/cheatsheet-local/tsconfig.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
"rootDir": "src",
55
"outDir": "out",
66
"jsx": "react-jsx",
7-
"lib": ["es5", "es6", "dom"],
7+
"lib": [
8+
"es5",
9+
"es6",
10+
"dom"
11+
],
812
"allowSyntheticDefaultImports": true,
913
"skipLibCheck": true,
1014
"esModuleInterop": true,
@@ -17,6 +21,9 @@
1721
"references": [
1822
{
1923
"path": "../cheatsheet"
24+
},
25+
{
26+
"path": "../common"
2027
}
2128
],
2229
"include": [
@@ -25,4 +32,4 @@
2532
"src/**/*.tsx",
2633
"../../typings/**/*.d.ts"
2734
]
28-
}
35+
}

packages/cheatsheet/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"*.css"
2828
],
2929
"dependencies": {
30+
"@cursorless/common": "workspace:*",
3031
"@fortawesome/fontawesome-svg-core": "6.3.0",
3132
"@fortawesome/free-solid-svg-icons": "6.3.0",
3233
"@fortawesome/react-fontawesome": "0.2.0",
@@ -47,4 +48,4 @@
4748
"typescript": "^5.2.2"
4849
},
4950
"type": "module"
50-
}
51+
}

packages/cheatsheet/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
export * from "./lib/cheatsheet";
2-
export * from "./lib/CheatsheetInfo";
32
export * from "./lib/cheatsheetBodyClasses";
43
export * from "./lib/fakeCheatsheetInfo";
54
import defaultCheatsheetInfo from "./lib/sampleSpokenFormInfos/defaults.json";

packages/cheatsheet/src/lib/cheatsheet.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
66
import { faCircleQuestion } from "@fortawesome/free-solid-svg-icons/faCircleQuestion";
77
import CheatsheetNotesComponent from "./components/CheatsheetNotesComponent";
88
import SmartLink from "./components/SmartLink";
9-
import { CheatsheetInfo } from "./CheatsheetInfo";
9+
import { CheatsheetInfo } from "@cursorless/common";
1010

1111
type CheatsheetPageProps = {
1212
cheatsheetInfo: CheatsheetInfo;

packages/cheatsheet/src/lib/components/CheatsheetListComponent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CheatsheetSection, Variation } from "../CheatsheetInfo";
1+
import { CheatsheetSection, Variation } from "@cursorless/common";
22
import useIsHighlighted from "../hooks/useIsHighlighted";
33
import { formatCaptures } from "./formatCaptures";
44

0 commit comments

Comments
 (0)