Skip to content

Commit

Permalink
Update to create-react-app 4
Browse files Browse the repository at this point in the history
- had to update eslint deps
- ran into palantir/blueprint#4112
- had to move beta.svg out of static/
- had to fix prettier formatting changes
- ran into jestjs/jest#7780
  • Loading branch information
dlech committed Nov 21, 2020
1 parent b917554 commit 88d4fe5
Show file tree
Hide file tree
Showing 8 changed files with 2,968 additions and 2,513 deletions.
17 changes: 8 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"react-dom": "^16.13.1",
"react-dropzone": "^11.0.1",
"react-redux": "^7.2.1",
"react-scripts": "3.4.1",
"react-scripts": "4.0.0",
"react-splitter-layout": "^4.0.0",
"redux": "^4.0.5",
"redux-logger": "^3.0.6",
Expand Down Expand Up @@ -59,19 +59,18 @@
"not op_mini all"
],
"development": [
"last 1 chrome version",
"chrome 79",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^2.34.0",
"@typescript-eslint/parser": "^2.34.0",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.10.1",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-prettier": "^3.1.2",
"eslint-plugin-react": "^7.20.5",
"@typescript-eslint/eslint-plugin": "^4.8.1",
"@typescript-eslint/parser": "^4.8.1",
"eslint-config-prettier": "^6.15.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-react": "^7.21.5",
"jest-mock-extended": "^1.0.9",
"mkdirp": "^1.0.4",
"ncp": "^2.0.0",
Expand Down
24 changes: 6 additions & 18 deletions src/actions/ble.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,25 +61,15 @@ type Reason<T extends BleDeviceFailToConnectReasonType> = {
reason: T;
};

export type BleDeviceFailToConnectNoWebBluetoothReason = Reason<
BleDeviceFailToConnectReasonType.NoWebBluetooth
>;
export type BleDeviceFailToConnectNoWebBluetoothReason = Reason<BleDeviceFailToConnectReasonType.NoWebBluetooth>;

export type BleDeviceFailToConnectCanceledReason = Reason<
BleDeviceFailToConnectReasonType.Canceled
>;
export type BleDeviceFailToConnectCanceledReason = Reason<BleDeviceFailToConnectReasonType.Canceled>;

export type BleDeviceFailToConnectNoGattReason = Reason<
BleDeviceFailToConnectReasonType.NoGatt
>;
export type BleDeviceFailToConnectNoGattReason = Reason<BleDeviceFailToConnectReasonType.NoGatt>;

export type BleDeviceFailToConnectNoServiceReason = Reason<
BleDeviceFailToConnectReasonType.NoService
>;
export type BleDeviceFailToConnectNoServiceReason = Reason<BleDeviceFailToConnectReasonType.NoService>;

export type BleDeviceFailToConnectUnknownReason = Reason<
BleDeviceFailToConnectReasonType.Unknown
> & {
export type BleDeviceFailToConnectUnknownReason = Reason<BleDeviceFailToConnectReasonType.Unknown> & {
err: Error;
};

Expand All @@ -90,9 +80,7 @@ export type BleDeviceDidFailToConnectReason =
| BleDeviceFailToConnectNoServiceReason
| BleDeviceFailToConnectUnknownReason;

export type BleDeviceDidFailToConnectAction = Action<
BleDeviceActionType.DidFailToConnect
> &
export type BleDeviceDidFailToConnectAction = Action<BleDeviceActionType.DidFailToConnect> &
BleDeviceDidFailToConnectReason;

/**
Expand Down
File renamed without changes
20 changes: 10 additions & 10 deletions src/components/editor-snippets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ declare module 'ace-builds' {
export function require(name: string[], callback: (module: any) => void): any;
}

ace.define('ace/snippets/python', ['require', 'exports', 'module'], function (
_require,
exports,
_module,
) {
// IMPORTANT!!!!!
// Snippets must be indented with tab character, not spaces!
exports.snippetText = `snippet technichub
ace.define(
'ace/snippets/python',
['require', 'exports', 'module'],
function (_require, exports, _module) {
// IMPORTANT!!!!!
// Snippets must be indented with tab character, not spaces!
exports.snippetText = `snippet technichub
from pybricks.hubs import TechnicHub
from pybricks.pupdevices import Motor
from pybricks.parameters import Port, Stop
Expand Down Expand Up @@ -144,8 +143,9 @@ snippet "
\${1:doc}
"""
`;
exports.scope = 'python';
});
exports.scope = 'python';
},
);

(function (): void {
ace.require(['ace/snippets/python'], function (m: any) {
Expand Down
2 changes: 1 addition & 1 deletion src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ body {

.watermark::after {
content: "";
background: url("/static/beta.svg");
background: url("./beta.svg");
opacity: 1;
top: 0;
left: 0;
Expand Down
4 changes: 4 additions & 0 deletions test/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,9 @@ module.exports = class CustomTestEnvironment extends Environment {
if (this.global.TextDecoder === undefined) {
this.global.TextDecoder = TextDecoder;
}

// work around https://github.com/facebook/jest/issues/7780
this.global.Uint8Array = Uint8Array;
this.global.ArrayBuffer = ArrayBuffer;
}
};
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"noEmit": true,
"jsx": "react",
"downlevelIteration": true,
"experimentalDecorators": true
"experimentalDecorators": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src", "test"]
}
Loading

0 comments on commit 88d4fe5

Please sign in to comment.