Skip to content

Commit 3f13742

Browse files
committed
upgrade to nextjs 14.2 -- fix #7872
1 parent a8bf272 commit 3f13742

File tree

27 files changed

+3440
-4512
lines changed

27 files changed

+3440
-4512
lines changed

src/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,8 @@
3838
"bugs": {
3939
"url": "https://github.com/sagemathinc/cocalc/issues"
4040
},
41-
"homepage": "https://github.com/sagemathinc/cocalc"
41+
"homepage": "https://github.com/sagemathinc/cocalc",
42+
"dependencies": {
43+
"lru-cache": "^7.18.3"
44+
}
4245
}

src/packages/backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"debug": "^4.3.2",
4040
"fs-extra": "^11.2.0",
4141
"lodash": "^4.17.21",
42-
"lru-cache": "^7.14.1",
42+
"lru-cache": "^7.18.3",
4343
"password-hash": "^1.2.2",
4444
"prom-client": "^13.0.0",
4545
"rimraf": "^5.0.5",

src/packages/database/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"immutable": "^4.3.0",
3333
"json-stable-stringify": "^1.0.1",
3434
"lodash": "^4.17.21",
35-
"lru-cache": "^7.14.1",
35+
"lru-cache": "^7.18.3",
3636
"node-fetch": "2.6.7",
3737
"pg": "^8.7.1",
3838
"random-key": "^0.3.2",

src/packages/database/qdrant/jsonl.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export async function save({
5757
"vectors to save in",
5858
collection,
5959
"to",
60-
file
60+
file,
6161
);
6262

6363
// Create a write stream for the output file
@@ -66,7 +66,7 @@ export async function save({
6666
// Fetch all points in the collection in blocks, compressing and
6767
// writing them to the output file
6868
let offset: string | undefined = undefined;
69-
for (let n = 0; n < vectors_count; n += batchSize) {
69+
for (let n = 0; n < (vectors_count ?? 0); n += batchSize) {
7070
log("save: from ", n, " to ", n + batchSize);
7171
const { points } = await client.scroll(collection, {
7272
limit: batchSize + (offset ? 1 : 0),
@@ -79,7 +79,7 @@ export async function save({
7979
// delete first point since it was the offset.
8080
points.shift();
8181
}
82-
offset = points[points.length-1].id as string;
82+
offset = points[points.length - 1].id as string;
8383
for (const point of points) {
8484
const compressedLine = JSON.stringify(point) + "\n";
8585
compressedStream.write(compressedLine);

src/packages/database/qdrant/sqlite.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export async function save({
6868
// Fetch all points in the collection in blocks, inserting them
6969
// into our database.
7070
let offset: string | undefined = undefined;
71-
for (let n = 0; n < vectors_count; n += batchSize) {
71+
for (let n = 0; n < (vectors_count ?? 0); n += batchSize) {
7272
log("save: from ", n, " to ", n + batchSize);
7373
const { points } = await client.scroll(collection, {
7474
limit: batchSize + (offset ? 1 : 0),
@@ -84,7 +84,7 @@ export async function save({
8484
offset = points[points.length - 1].id as string;
8585
// insert points into the sqlite3 table collection efficiently:
8686
const insertStmt = db.prepare(
87-
`INSERT INTO ${collection} (id, payload, vector) VALUES (?, ?, ?)`
87+
`INSERT INTO ${collection} (id, payload, vector) VALUES (?, ?, ?)`,
8888
);
8989

9090
db.transaction(() => {

src/packages/frontend/components/sortable-tabs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export function SortableTabs(props: Props) {
9898
80,
9999
Math.min(
100100
250 + 65,
101-
((resize?.width ?? 500) - 46 ?? 0) / Math.max(1, items.length),
101+
((resize?.width ?? 500) - 46) / Math.max(1, items.length),
102102
),
103103
) - 55; // the constant accounts for the margin and x for an antd tab.
104104
lastRef.current = {

src/packages/frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
"langs": "^2.0.0",
116116
"linkify-it": "3.0.3",
117117
"lodash": "^4.17.21",
118-
"lru-cache": "^7.14.1",
118+
"lru-cache": "^7.18.3",
119119
"markdown-it": "^13.0.1",
120120
"markdown-it-emoji": "^2.0.2",
121121
"markdown-it-front-matter": "^0.2.3",

src/packages/frontend/project/settings/compute-image-selector.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,14 @@ export const ComputeImageSelector: React.FC<ComputeImageSelectorProps> = (
105105
const tag = img.get("tag");
106106
const labelStr = img.get("short") ?? img.get("title") ?? key;
107107
const label =
108-
key === defaultComputeImg ? <Text strong>{labelStr}</Text> : labelStr;
108+
key === defaultComputeImg ? (
109+
<Text strong>{labelStr}</Text>
110+
) : (
111+
<>{labelStr}</>
112+
);
109113
const extra = registry && tag ? ` (${registry}:${tag})` : "";
110114
const title = `${img.get("descr")}${extra}`;
111-
return { key, title, label };
115+
return { key, title, label: label as any };
112116
})
113117
.valueSeq()
114118
.toJS();

src/packages/frontend/project_configuration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export function is_available(configuration?: ProjectConfiguration): Available {
140140
html2pdf: capabilities.html2pdf ?? true,
141141
pandoc: capabilities.pandoc ?? true,
142142
vscode: capabilities.vscode ?? true,
143-
julia: !!capabilities.julia ?? true,
143+
julia: capabilities.julia ?? true,
144144
formatting,
145145
homeDirectory: capabilities.homeDirectory,
146146
};

src/packages/frontend/projects/util.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ function get_search_info(project_id, project, user_map): string {
3939
s += " " + desc;
4040
}
4141
s +=
42-
" " + COMPUTE_STATES[project.getIn(["state", "state"], "")]?.display ?? "";
42+
" " +
43+
(COMPUTE_STATES[project.getIn(["state", "state"], "")]?.display ?? "");
4344
s = s.toLowerCase();
4445
s = s + " " + hashtags_to_string(parse_tags(s));
4546
if (user_map != null) {
@@ -67,7 +68,7 @@ export function get_visible_projects(
6768
search: string,
6869
deleted: boolean,
6970
hidden: boolean,
70-
sort_by: "user_last_active" | "last_edited" | "title" | "state"
71+
sort_by: "user_last_active" | "last_edited" | "title" | "state",
7172
): string[] {
7273
const visible_projects: string[] = [];
7374
if (project_map == null) return visible_projects;
@@ -77,7 +78,7 @@ export function get_visible_projects(
7778
last_project_map = project_map;
7879
last_user_map = user_map;
7980
const words = search_split(
80-
search + " " + hashtags_to_string(hashtags?.toJS())
81+
search + " " + hashtags_to_string(hashtags?.toJS()),
8182
);
8283
project_map.forEach((project, project_id) => {
8384
if (
@@ -111,7 +112,7 @@ function sort_projects(project_ids: string[], project_map, sort_by): void {
111112
}
112113
return -cmp_Date(
113114
project_map.getIn([p1, "last_edited"]),
114-
project_map.getIn([p2, "last_edited"])
115+
project_map.getIn([p2, "last_edited"]),
115116
);
116117
};
117118
break;
@@ -120,7 +121,7 @@ function sort_projects(project_ids: string[], project_map, sort_by): void {
120121
f = (p1, p2) => {
121122
return -cmp_Date(
122123
project_map.getIn([p1, "last_edited"]),
123-
project_map.getIn([p2, "last_edited"])
124+
project_map.getIn([p2, "last_edited"]),
124125
);
125126
};
126127
break;
@@ -129,7 +130,7 @@ function sort_projects(project_ids: string[], project_map, sort_by): void {
129130
f = (p1, p2) => {
130131
return cmp(
131132
project_map.getIn([p1, "title"])?.toLowerCase(),
132-
project_map.getIn([p2, "title"])?.toLowerCase()
133+
project_map.getIn([p2, "title"])?.toLowerCase(),
133134
);
134135
};
135136
break;
@@ -138,7 +139,7 @@ function sort_projects(project_ids: string[], project_map, sort_by): void {
138139
f = (p1, p2) => {
139140
return cmp(
140141
project_map.getIn([p1, "state", "state"], "z"),
141-
project_map.getIn([p2, "state", "state"], "z")
142+
project_map.getIn([p2, "state", "state"], "z"),
142143
);
143144
};
144145
break;
@@ -160,7 +161,7 @@ export function get_visible_hashtags(project_map, visible_projects): string[] {
160161
project.get("title", "") +
161162
" " +
162163
project.get("description", "")
163-
).toLowerCase()
164+
).toLowerCase(),
164165
)) {
165166
tags.add(tag);
166167
}
@@ -172,7 +173,7 @@ export function get_visible_hashtags(project_map, visible_projects): string[] {
172173
function project_is_in_filter(
173174
project: immutableMap<string, any>,
174175
deleted: boolean,
175-
hidden: boolean
176+
hidden: boolean,
176177
): boolean {
177178
const { account_id } = webapp_client;
178179
if (account_id == null) return true;

0 commit comments

Comments
 (0)