diff --git a/package-lock.json b/package-lock.json index fb9352a559..3f1bf7aaf7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -80,7 +80,7 @@ "i18next-resources-to-backend": "1.2.1", "iframe-resizer-react": "1.1.0", "immer": "9.0.6", - "immutable": "4.0.0-rc.12", + "immutable": "^4.3.8", "is-ci": "2.0.0", "jquery": "3.7.1", "jquery-typeahead": "2.11.1", @@ -7102,7 +7102,6 @@ "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", - "license": "MIT", "peer": true, "dependencies": { "loose-envify": "^1.1.0", @@ -7116,7 +7115,6 @@ "version": "0.23.2", "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", - "license": "MIT", "peer": true, "dependencies": { "loose-envify": "^1.1.0" @@ -7657,14 +7655,12 @@ "version": "17.0.2", "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", - "license": "MIT", "peer": true }, "node_modules/@nteract/mythic-configuration/node_modules/react-redux": { "version": "7.2.9", "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-7.2.9.tgz", "integrity": "sha512-Gx4L3uM182jEEayZfRbI/G11ZpYdNAnBs70lFVMNdHJI76XYtR+7m0MN+eAs7UHBPhWXcnFPaS+9owSCJQHNpQ==", - "license": "MIT", "peer": true, "dependencies": { "@babel/runtime": "^7.15.4", @@ -7719,14 +7715,12 @@ "version": "17.0.2", "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", - "license": "MIT", "peer": true }, "node_modules/@nteract/mythic-notifications/node_modules/react-redux": { "version": "7.2.9", "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-7.2.9.tgz", "integrity": "sha512-Gx4L3uM182jEEayZfRbI/G11ZpYdNAnBs70lFVMNdHJI76XYtR+7m0MN+eAs7UHBPhWXcnFPaS+9owSCJQHNpQ==", - "license": "MIT", "peer": true, "dependencies": { "@babel/runtime": "^7.15.4", @@ -7979,7 +7973,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-4.0.0.tgz", "integrity": "sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==", - "license": "MIT", "peer": true, "engines": { "node": ">= 18" @@ -7989,7 +7982,6 @@ "version": "5.2.2", "resolved": "https://registry.npmjs.org/@octokit/core/-/core-5.2.2.tgz", "integrity": "sha512-/g2d4sW9nUDJOMz3mabVQvOGhVa4e/BN/Um7yca9Bb2XTzPPnfTWHWQg+IsEYO7M3Vx+EXvaM/I2pJWIMun1bg==", - "license": "MIT", "peer": true, "dependencies": { "@octokit/auth-token": "^4.0.0", @@ -8008,14 +8000,12 @@ "version": "24.2.0", "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-24.2.0.tgz", "integrity": "sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg==", - "license": "MIT", "peer": true }, "node_modules/@octokit/core/node_modules/@octokit/types": { "version": "13.10.0", "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.10.0.tgz", "integrity": "sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA==", - "license": "MIT", "peer": true, "dependencies": { "@octokit/openapi-types": "^24.2.0" @@ -8050,7 +8040,6 @@ "version": "7.1.1", "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-7.1.1.tgz", "integrity": "sha512-3mkDltSfcDUoa176nlGoA32RGjeWjl3K7F/BwHwRMJUW/IteSa4bnSV8p2ThNkcIcZU2umkZWxwETSSCJf2Q7g==", - "license": "MIT", "peer": true, "dependencies": { "@octokit/request": "^8.4.1", @@ -8065,14 +8054,12 @@ "version": "24.2.0", "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-24.2.0.tgz", "integrity": "sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg==", - "license": "MIT", "peer": true }, "node_modules/@octokit/graphql/node_modules/@octokit/types": { "version": "13.10.0", "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.10.0.tgz", "integrity": "sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA==", - "license": "MIT", "peer": true, "dependencies": { "@octokit/openapi-types": "^24.2.0" @@ -12773,7 +12760,6 @@ "resolved": "https://registry.npmjs.org/crypto/-/crypto-1.0.1.tgz", "integrity": "sha512-VxBKmeNcqQdiUQUW2Tzq0t377b54N2bMtXO/qiLa+6eRRmmC4qT3D4OnTGoT/U6O9aklQ/jTwbOtRMTTY8G0Ig==", "deprecated": "This package is no longer supported. It's now a built-in Node module. If you've depended on crypto, you should switch to the one that's built-in.", - "license": "ISC", "peer": true }, "node_modules/css-color-keywords": { @@ -17068,8 +17054,9 @@ } }, "node_modules/immutable": { - "version": "4.0.0-rc.12", - "license": "MIT" + "version": "4.3.8", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.8.tgz", + "integrity": "sha512-d/Ld9aLbKpNwyl0KiM2CT1WYvkitQ1TSvmRtkcV8FKStiDoA7Slzgjmb/1G2yhKM1p0XeNOieaTbFZmU1d3Xuw==" }, "node_modules/import-fresh": { "version": "3.3.0", diff --git a/package.json b/package.json index 2ae4972af2..a8c663f9b2 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,7 @@ "i18next-resources-to-backend": "1.2.1", "iframe-resizer-react": "1.1.0", "immer": "9.0.6", - "immutable": "4.0.0-rc.12", + "immutable": "^4.3.8", "is-ci": "2.0.0", "jquery": "3.7.1", "jquery-typeahead": "2.11.1", diff --git a/patches/@nteract+commutable+7.5.1.patch b/patches/@nteract+commutable+7.5.1.patch new file mode 100644 index 0000000000..30791cdb04 --- /dev/null +++ b/patches/@nteract+commutable+7.5.1.patch @@ -0,0 +1,73 @@ +diff --git a/node_modules/@nteract/commutable/src/structures.ts b/node_modules/@nteract/commutable/src/structures.ts +index c0ff6cb..b0117b7 100644 +--- a/node_modules/@nteract/commutable/src/structures.ts ++++ b/node_modules/@nteract/commutable/src/structures.ts +@@ -193,6 +193,7 @@ export function markCellDeleting( + ["cellMap", cellId], + nb + .getIn(["cellMap", cellId]) ++ // @ts-ignore - immutable v4 getIn returns unknown + .setIn(["metadata", "nteract", "transient", "deleting"], true) + ) + ); +@@ -215,6 +216,7 @@ export function markCellNotDeleting( + ["cellMap", cellId], + nb + .getIn(["cellMap", cellId]) ++ // @ts-ignore - immutable v4 getIn returns unknown + .setIn(["metadata", "nteract", "transient", "deleting"], false) + ) + ); +diff --git a/node_modules/@nteract/commutable/src/v3.ts b/node_modules/@nteract/commutable/src/v3.ts +index 1ffa956..4e9078d 100644 +--- a/node_modules/@nteract/commutable/src/v3.ts ++++ b/node_modules/@nteract/commutable/src/v3.ts +@@ -114,7 +114,7 @@ function createImmutableMarkdownCell( + return makeMarkdownCell({ + cell_type: cell.cell_type, + source: demultiline(cell.source), +- metadata: immutableFromJS(cell.metadata) ++ metadata: immutableFromJS(cell.metadata) as any + }); + } + +@@ -172,7 +172,7 @@ function createImmutableCodeCell(cell: CodeCell): ImmutableCodeCell { + source: demultiline(cell.input), + outputs: ImmutableList(cell.outputs.map(createImmutableOutput)), + execution_count: cell.prompt_number, +- metadata: immutableFromJS(cell.metadata) ++ metadata: immutableFromJS(cell.metadata) as any + }); + } + +@@ -180,7 +180,7 @@ function createImmutableRawCell(cell: RawCell): ImmutableRawCell { + return makeRawCell({ + cell_type: cell.cell_type, + source: demultiline(cell.source), +- metadata: immutableFromJS(cell.metadata) ++ metadata: immutableFromJS(cell.metadata) as any + }); + } + +@@ -198,7 +198,7 @@ function createImmutableHeadingCell(cell: HeadingCell): ImmutableMarkdownCell { + ) + ) + : cell.source, +- metadata: immutableFromJS(cell.metadata) ++ metadata: immutableFromJS(cell.metadata) as any + }); + } + +diff --git a/node_modules/@nteract/commutable/src/v4.ts b/node_modules/@nteract/commutable/src/v4.ts +index a6dd478..dd9a741 100644 +--- a/node_modules/@nteract/commutable/src/v4.ts ++++ b/node_modules/@nteract/commutable/src/v4.ts +@@ -227,7 +227,7 @@ export function fromJS( + cellMap: cellStructure.cellMap.asImmutable(), + nbformat_minor: notebook.nbformat_minor, + nbformat: 4, +- metadata: immutableFromJS(notebook.metadata) ++ metadata: immutableFromJS(notebook.metadata) as any + }); + } + diff --git a/src/Explorer/Notebook/NotebookRenderer/Prompt.tsx b/src/Explorer/Notebook/NotebookRenderer/Prompt.tsx index bfd16676a3..c0e33da1f1 100644 --- a/src/Explorer/Notebook/NotebookRenderer/Prompt.tsx +++ b/src/Explorer/Notebook/NotebookRenderer/Prompt.tsx @@ -66,7 +66,7 @@ const makeMapStateToProps = (_state: CdbAppState, ownProps: ComponentProps): ((s let executionCount; if (model && model.type === "notebook") { - status = model.transient.getIn(["cellMap", id, "status"]); + status = model.transient.getIn(["cellMap", id, "status"]) as string | undefined; const cell = selectors.notebook.cellById(model, { id }); if (cell) { executionCount = cell.get("execution_count", undefined); diff --git a/src/Explorer/Notebook/NotebookRenderer/outputs/SandboxOutputs.tsx b/src/Explorer/Notebook/NotebookRenderer/outputs/SandboxOutputs.tsx index fb6555ba9d..eceb363f34 100644 --- a/src/Explorer/Notebook/NotebookRenderer/outputs/SandboxOutputs.tsx +++ b/src/Explorer/Notebook/NotebookRenderer/outputs/SandboxOutputs.tsx @@ -159,7 +159,7 @@ export const makeMapStateToProps = ( const cell = selectors.notebook.cellById(model, { id }); if (cell) { outputs = cell.get("outputs", Immutable.List()); - hidden = cell.cell_type === "code" && cell.getIn(["metadata", "jupyter", "outputs_hidden"]); + hidden = cell.cell_type === "code" && (cell.getIn(["metadata", "jupyter", "outputs_hidden"]) as boolean); expanded = cell.cell_type === "code" && cell.getIn(["metadata", "collapsed"]) === false; } } diff --git a/src/Explorer/Notebook/NotebookUtil.ts b/src/Explorer/Notebook/NotebookUtil.ts index 64e84c5eb7..1fbfbb41bd 100644 --- a/src/Explorer/Notebook/NotebookUtil.ts +++ b/src/Explorer/Notebook/NotebookUtil.ts @@ -74,7 +74,8 @@ export class NotebookUtil { const cwd = (filepath && path.dirname(filepath)) || "/"; const kernelSpecName = - notebook.getIn(["metadata", "kernelspec", "name"]) || notebook.getIn(["metadata", "language_info", "name"]); + (notebook.getIn(["metadata", "kernelspec", "name"]) as string | undefined) || + (notebook.getIn(["metadata", "language_info", "name"]) as string | undefined); return { cwd, diff --git a/tsconfig.json b/tsconfig.json index 156b4abc41..2fe007c04f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -23,6 +23,7 @@ "jsx": "react", "moduleResolution": "node", "resolveJsonModule": true, + "skipLibCheck": true, "noEmit": true, "types": [ "jest"