Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert Console to typescript #646

Merged
merged 26 commits into from
Jul 21, 2022
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
2a54fed
convert to ts
Zhou-Ziheng May 17, 2022
2ee20e2
convert js to ts in styleguide
Zhou-Ziheng May 18, 2022
dfaeb91
added requested changes
Zhou-Ziheng May 26, 2022
e1fc237
finished fixing requested changes
Zhou-Ziheng May 27, 2022
6c29525
fixed merge conflicts
Zhou-Ziheng Jun 8, 2022
832f145
fixed meerge errors
Zhou-Ziheng Jun 29, 2022
e719ba9
WIP console tsx conversion
Zhou-Ziheng Jul 11, 2022
b9a7e8d
fixed errors
Zhou-Ziheng Jul 11, 2022
9c4c323
added unsaved file
Zhou-Ziheng Jul 11, 2022
8b9a772
removed extraneous comments
Zhou-Ziheng Jul 11, 2022
84d8a3f
added declaration file for module.scss
Zhou-Ziheng Jul 11, 2022
f4ec862
refractored types
Zhou-Ziheng Jul 11, 2022
abf6f33
added type to start script
Zhou-Ziheng Jul 11, 2022
bb6b5e5
converted test cases
Zhou-Ziheng Jul 12, 2022
bd16e71
first batch code review changes
Zhou-Ziheng Jul 13, 2022
5055335
WIP console
Zhou-Ziheng Jul 15, 2022
14d9efc
language
Zhou-Ziheng Jul 15, 2022
a5dbdfc
fixed changes
Zhou-Ziheng Jul 18, 2022
71f0186
WIP
Zhou-Ziheng Jul 19, 2022
8d0c648
added new changes
Zhou-Ziheng Jul 19, 2022
fcf795b
Update packages/console/src/monaco/lang/log.ts
Zhou-Ziheng Jul 20, 2022
7bca9db
Update packages/console/src/monaco/lang/groovy.ts
Zhou-Ziheng Jul 20, 2022
7b6e5df
Update packages/console/src/monaco/lang/scala.ts
Zhou-Ziheng Jul 20, 2022
2a076fa
Update packages/console/src/monaco/lang/python.ts
Zhou-Ziheng Jul 20, 2022
320c8eb
Update packages/console/src/monaco/lang/db.ts
Zhou-Ziheng Jul 20, 2022
15be02e
added space
Zhou-Ziheng Jul 20, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"@types/lodash.throttle": "^4.1.1",
"@types/memoizee": "^0.4.5",
"@types/node": "^16.11.7",
"@types/papaparse": "^5.3.2",
Zhou-Ziheng marked this conversation as resolved.
Show resolved Hide resolved
"@types/pouchdb-browser": "^6.1.3",
"@types/prop-types": "^15.7.3",
"@types/react": "^17.0.2",
Expand All @@ -86,6 +87,7 @@
"@types/react-transition-group": "^4.4.0",
"@types/react-virtualized-auto-sizer": "^1.0.1",
"@types/react-window": "^1.8.5",
"@types/shell-quote": "^1.7.1",
"@types/shortid": "0.0.29",
"@vscode/codicons": "0.0.25",
"babel-eslint": "^10.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/shortcuts/Shortcut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export default class Shortcut extends EventTarget<EventMap, 'strict'> {

private readonly defaultKeyState: ValidKeyState;

private keyState: ValidKeyState;
keyState: ValidKeyState;

static NULL_KEY_STATE: ValidKeyState = {
metaKey: false,
Expand Down
1 change: 1 addition & 0 deletions packages/console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"memoizee": "^0.4.15",
"monaco-editor": "^0.27.0",
"papaparse": "^5.2.0",
"popper.js": "^1.16.1",
"prop-types": "^15.7.2",
"shell-quote": "^1.7.2"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,33 @@ import React from 'react';
import dh from '@deephaven/jsapi-shim';
import { render } from '@testing-library/react';
import { Console } from './Console';
import { CommandHistoryStorage } from './command-history';

function makeMockCommandHistoryStorage() {
function makeMockCommandHistoryStorage(): CommandHistoryStorage {
return {
addItem: jest.fn(),
getTable: jest.fn(),
updateItem: jest.fn(),
listenItem: jest.fn(),
};
}

jest.mock('./ConsoleInput', () => () => null);
jest.mock('./Console', () => ({
...jest.requireActual('./Console'),
...(jest.requireActual('./Console') as Record<string, unknown>),
commandHistory: jest.fn(),
}));

function makeConsoleWrapper() {
const session = new dh.IdeSession('test');
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const session = new (dh as any).IdeSession('test');
const commandHistoryStorage = makeMockCommandHistoryStorage();
return render(
<Console
commandHistoryStorage={commandHistoryStorage}
focusCommandHistory={() => {}}
openObject={() => {}}
closeObject={() => {}}
focusCommandHistory={() => undefined}
openObject={() => undefined}
closeObject={() => undefined}
session={session}
language="test"
/>
Expand Down
Loading