Skip to content

Commit 25d14ee

Browse files
committed
Merge remote-tracking branch 'upstream/main' into pr_multiple_ports
2 parents 86e148f + b4ecdf0 commit 25d14ee

30 files changed

+514
-322
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@ jobs:
1515
node-version: 20
1616
- name: Install Dependencies
1717
run: npm ci
18+
- name: Check TypeScript Errors
19+
run: npm run tscheck
1820
- name: Install Playwright Browsers
1921
run: npx playwright install --with-deps
20-
2122
- name: Build Project
2223
run: npm run build
2324
- name: Run tests
24-
run: npm test
25+
run: npm test

package-lock.json

Lines changed: 49 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,17 @@
2424
"react-dom": "^19.1.0",
2525
"react-i18next": "^15.6.0",
2626
"react-syntax-highlighter": "^15.6.1",
27+
"semver": "^7.7.2",
28+
"typescript": "^5.9.2",
2729
"web-vitals": "^5.0.3"
2830
},
2931
"scripts": {
3032
"start": "vite",
3133
"build": "vite build",
3234
"test": "vitest",
3335
"gen": "node src/Blockly/gen.js",
34-
"dev": "vite"
36+
"dev": "vite",
37+
"tscheck": "npx tsc -b --noEmit"
3538
},
3639
"eslintConfig": {
3740
"extends": [
@@ -56,6 +59,7 @@
5659
"@shadcn/ui": "^0.0.4",
5760
"@types/node": "^24.0.15",
5861
"@types/react-syntax-highlighter": "^15.5.13",
62+
"@types/semver": "^7.7.0",
5963
"@vitejs/plugin-react": "^4.7.0",
6064
"autoprefixer": "^10.4.21",
6165
"playwright": "^1.54.1",

src/blocks/mrc_call_python_function.ts

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,6 @@ type CallPythonFunctionExtraState = {
150150
* The mechanism class name. Specified only if the function kind is INSTANCE_MECHANISM.
151151
*/
152152
mechanismClassName?: string,
153-
154-
// The following fields allow Alan and Liz to load older projects.
155-
// TODO(lizlooney): Remove these fields.
156-
otherBlockId?: string,
157-
mechanismBlockId?: string,
158153
}
159154

160155
const CALL_PYTHON_FUNCTION = {
@@ -303,7 +298,6 @@ const CALL_PYTHON_FUNCTION = {
303298
this: CallPythonFunctionBlock,
304299
extraState: CallPythonFunctionExtraState
305300
): void {
306-
fixOldExtraState(extraState);
307301
this.mrcFunctionKind = extraState.functionKind as FunctionKind;
308302
this.mrcReturnType = extraState.returnType;
309303
this.mrcArgs = [];
@@ -1276,26 +1270,3 @@ function createFireEventBlock(event: storageModuleContent.Event): toolboxItems.B
12761270
processArgs(args, extraState, inputs);
12771271
return createBlock(extraState, fields, inputs);
12781272
}
1279-
1280-
// The following function allows Alan and Liz to load older projects.
1281-
// TODO(lizlooney): Remove this function.
1282-
function fixOldExtraState(extraState: CallPythonFunctionExtraState): void {
1283-
if (extraState.otherBlockId) {
1284-
switch (extraState.functionKind as FunctionKind) {
1285-
case FunctionKind.INSTANCE_WITHIN:
1286-
case FunctionKind.INSTANCE_ROBOT:
1287-
case FunctionKind.INSTANCE_MECHANISM:
1288-
extraState.methodId = extraState.otherBlockId;
1289-
break;
1290-
case FunctionKind.INSTANCE_COMPONENT:
1291-
extraState.componentId = extraState.otherBlockId;
1292-
break;
1293-
case FunctionKind.EVENT:
1294-
extraState.eventId = extraState.otherBlockId;
1295-
break;
1296-
}
1297-
}
1298-
if (extraState.mechanismBlockId) {
1299-
extraState.mechanismId = extraState.mechanismBlockId;
1300-
}
1301-
}

src/blocks/mrc_event_handler.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,6 @@ export interface EventHandlerExtraState {
7373
* Specified only if the sender type is MECHANISM.
7474
*/
7575
mechanismId?: string,
76-
77-
// The following fields allow Alan and Liz to load older projects.
78-
// TODO(lizlooney): Remove these fields.
79-
otherBlockId?: string,
80-
mechanismBlockId?: string,
8176
}
8277

8378
const EVENT_HANDLER = {
@@ -126,7 +121,6 @@ const EVENT_HANDLER = {
126121
* Applies the given state to this block.
127122
*/
128123
loadExtraState(this: EventHandlerBlock, extraState: EventHandlerExtraState): void {
129-
fixOldExtraState(extraState);
130124
this.mrcSenderType = extraState.senderType;
131125
this.mrcParameters = [];
132126
this.mrcEventId = extraState.eventId;
@@ -508,14 +502,3 @@ export function renameMechanismName(workspace: Blockly.Workspace, mechanismId: s
508502
(block as EventHandlerBlock).renameMechanismName(mechanismId, newName);
509503
});
510504
}
511-
512-
// The following function allows Alan and Liz to load older projects.
513-
// TODO(lizlooney): Remove this function.
514-
function fixOldExtraState(extraState: EventHandlerExtraState): void {
515-
if (extraState.otherBlockId) {
516-
extraState.eventId = extraState.otherBlockId;
517-
}
518-
if (extraState.mechanismBlockId) {
519-
extraState.mechanismId = extraState.mechanismBlockId;
520-
}
521-
}

src/blocks/mrc_get_python_variable.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import * as toolboxItems from '../toolbox/items';
4040

4141
export const BLOCK_NAME = 'mrc_get_python_variable';
4242

43-
enum VariableKind {
43+
export enum VariableKind {
4444
MODULE = 'module',
4545
CLASS = 'class',
4646
INSTANCE = 'instance',

src/blocks/mrc_list_add_item.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717

1818
/**
19-
* @fileoverview Miscellaneous blocks.
19+
* @fileoverview Block to add an item to the end of a list.
2020
* @author [email protected] (Liz Looney)
2121
*/
2222

src/blocks/mrc_math_min_max.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717

1818
/**
19-
* @fileoverview Miscellaneous blocks.
19+
* @fileoverview Blocks for math min and max.
2020
* @author [email protected] (Liz Looney)
2121
*/
2222

src/blocks/mrc_misc_comment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717

1818
/**
19-
* @fileoverview Miscellaneous blocks.
19+
* @fileoverview Block for a comment.
2020
* @author [email protected] (Liz Looney)
2121
*/
2222

src/blocks/mrc_misc_evaluate_but_ignore_result.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717

1818
/**
19-
* @fileoverview Miscellaneous blocks.
19+
* @fileoverview Blocks for evaluating something, but ignoring the result.
2020
* @author [email protected] (Liz Looney)
2121
*/
2222

0 commit comments

Comments
 (0)