Update immutable from 4.0.0-rc.12 to ^4.3.8

- Update immutable dependency to stable v4.3.8
- Add type assertions for getIn calls that now return unknown in v4 stable
- Add skipLibCheck to tsconfig.json for @nteract and @octokit .d.ts compat
- Add patch-package patch for @nteract/commutable .ts source files

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Jade Welton
2026-05-01 11:17:23 -07:00
parent 4e8410cd66
commit bae31897f6
7 changed files with 809 additions and 783 deletions
+730 -779
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -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",
+73
View File
@@ -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
});
}
@@ -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);
@@ -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;
}
}
+2 -1
View File
@@ -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,
+1
View File
@@ -23,6 +23,7 @@
"jsx": "react",
"moduleResolution": "node",
"resolveJsonModule": true,
"skipLibCheck": true,
"noEmit": true,
"types": [
"jest"