Skip to content

Commit 7566ad3

Browse files
chore: update NMRium dependencies.
2 parents 06e02ec + 1cd3d60 commit 7566ad3

File tree

11 files changed

+3190
-3104
lines changed

11 files changed

+3190
-3104
lines changed

package-lock.json

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

package.json

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,31 @@
11
{
22
"name": "NMRiumWrapper",
3-
"version": "0.10.0",
3+
"version": "1.0.0",
44
"private": false,
55
"license": "MIT",
66
"type": "module",
77
"exports": "./lib/NMRiumWrapper.js",
88
"files": [
9-
"lib"
9+
"lib",
10+
"src"
1011
],
1112
"volta": {
12-
"node": "22.14.0"
13+
"node": "24.4.0"
1314
},
1415
"dependencies": {
15-
"@blueprintjs/core": "^5.19.0",
16-
"@blueprintjs/icons": "^5.22.0",
16+
"@blueprintjs/core": "^6.2.1",
17+
"@blueprintjs/icons": "^6.1.0",
18+
"@blueprintjs/select": "^6.0.3",
1719
"@emotion/styled": "^11.14.1",
18-
"@vitejs/plugin-react": "^4.6.0",
19-
"fifo-logger": "^1.0.0",
20+
"@vitejs/plugin-react": "^5.0.2",
21+
"@zakodium/nmrium-core": "^0.1.7",
22+
"@zakodium/nmrium-core-plugins": "^0.1.10",
23+
"fifo-logger": "^2.0.1",
2024
"filelist-utils": "^1.11.3",
21-
"nmr-load-save": "^3.6.0",
22-
"nmr-processing": "^19.0.1",
23-
"nmrium": "^0.65.0",
24-
"react-science": "^18.1.0"
25+
"nmr-processing": "^19.1.0",
26+
"nmrium": "^1.3.0",
27+
"openchemlib": "^9.7.0",
28+
"react-science": "^19.1.0"
2529
},
2630
"scripts": {
2731
"start": "vite --host localhost --port 3000 --open",
@@ -42,25 +46,25 @@
4246
"@babel/plugin-transform-modules-commonjs": "^7.27.1",
4347
"@babel/preset-react": "^7.27.1",
4448
"@babel/preset-typescript": "^7.27.1",
45-
"@playwright/test": "^1.53.2",
49+
"@playwright/test": "^1.55.0",
4650
"@simbathesailor/use-what-changed": "^2.0.0",
4751
"@types/jest": "^30.0.0",
48-
"@types/node": "^24.0.10",
52+
"@types/node": "^24.3.0",
4953
"@types/react": "^18.3.3",
5054
"@types/react-dom": "^18.3.0",
5155
"@types/react-router-dom": "^5.3.3",
52-
"cross-env": "^7.0.3",
53-
"eslint": "^9.30.1",
54-
"eslint-config-cheminfo-react": "^16.1.0",
55-
"eslint-config-cheminfo-typescript": "^18.0.1",
56-
"jest": "^30.0.4",
56+
"cross-env": "^10.0.0",
57+
"eslint": "^9.34.0",
58+
"eslint-config-cheminfo-react": "^17.0.1",
59+
"eslint-config-cheminfo-typescript": "^19.0.0",
60+
"jest": "^30.1.3",
5761
"prettier": "3.6.2",
5862
"react": "^18.3.1",
5963
"react-dom": "^18.3.1",
60-
"react-router-dom": "^7.6.3",
64+
"react-router-dom": "^7.8.2",
6165
"serve": "^14.2.4",
62-
"typescript": "^5.8.3",
63-
"vite": "^7.0.0",
64-
"vite-plugin-pwa": "^1.0.1"
66+
"typescript": "^5.9.2",
67+
"vite": "^7.1.4",
68+
"vite-plugin-pwa": "^1.0.3"
6569
}
66-
}
70+
}

playwright.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import type { PlaywrightTestConfig, ViewportSize } from '@playwright/test';
12
import { devices } from '@playwright/test';
2-
import type { ViewportSize , PlaywrightTestConfig} from '@playwright/test';
33

44
const viewportOverride: ViewportSize = {
55
width: 1400,

src/NMRiumWrapper.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import type { NMRiumData, NMRiumRefAPI, NMRiumChangeCb } from 'nmrium';
1+
import type { NMRiumChangeCb, NMRiumData, NMRiumRefAPI } from 'nmrium';
22
import { NMRium } from 'nmrium';
33
import type { CSSProperties } from 'react';
4-
import { useEffect, useState, useCallback, useRef } from 'react';
4+
import { useCallback, useEffect, useRef, useState } from 'react';
55
import { RootLayout } from 'react-science/ui';
66

77
import events from './events/event.js';

src/events/event.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { EventType, EventData } from './types.js';
1+
import type { EventData, EventType } from './types.js';
22

33
const namespace = 'nmr-wrapper';
44

src/events/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ type EventData<T extends EventType> = T extends 'data-change'
5454
: T extends 'error'
5555
? Error
5656
: never;
57-
export type { EventType, EventData };
57+
export type { EventData, EventType };

src/hooks/useLoadSpectra.ts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1+
import type {
2+
NmriumState,
3+
ParsingOptions,
4+
ViewState,
5+
} from '@zakodium/nmrium-core';
6+
import { CURRENT_EXPORT_VERSION } from '@zakodium/nmrium-core';
7+
import init from '@zakodium/nmrium-core-plugins';
18
import { FifoLogger } from 'fifo-logger';
2-
import { fileCollectionFromFiles } from 'filelist-utils';
3-
import type { NmriumState, ParsingOptions, ViewState } from 'nmr-load-save';
4-
import { read, readFromWebSource, CURRENT_EXPORT_VERSION } from 'nmr-load-save';
9+
import { FileCollection } from 'file-collection';
510
import { useCallback, useMemo, useState } from 'react';
611

712
import events from '../events/event.js';
@@ -12,6 +17,8 @@ type DeepPartial<T> = {
1217
[K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K];
1318
};
1419

20+
const core = init();
21+
1522
const logger = new FifoLogger();
1623

1724
function handleLogger({ detail: { logs } }) {
@@ -34,11 +41,10 @@ const PARSING_OPTIONS: Partial<ParsingOptions> = {
3441
};
3542

3643
async function loadSpectraFromFiles(files: File[]) {
37-
const fileCollection = await fileCollectionFromFiles(files);
38-
44+
const fileCollection = await new FileCollection().appendFileList(files);
3945
const {
4046
nmriumState: { data },
41-
} = await read(fileCollection, PARSING_OPTIONS);
47+
} = await core.read(fileCollection, PARSING_OPTIONS);
4248
return data;
4349
}
4450

@@ -54,7 +60,7 @@ async function loadSpectraFromURLs(urls: string[]) {
5460
return { relativePath: path, baseURL: refURL.origin };
5561
}, []);
5662

57-
const { data } = await readFromWebSource({ entries }, PARSING_OPTIONS);
63+
const { data } = await core.readFromWebSource({ entries }, PARSING_OPTIONS);
5864
return data;
5965
}
6066

src/hooks/usePreferences.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import type { CustomWorkspaces, WorkspacePreferences } from 'nmr-load-save';
1+
import type {
2+
CustomWorkspaces,
3+
WorkspacePreferences,
4+
} from '@zakodium/nmrium-core';
25
import type { NMRiumWorkspace } from 'nmrium';
36
import { useLayoutEffect, useState } from 'react';
47

src/workspaces/nmrxiv.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { InnerWorkspace } from 'nmr-load-save';
1+
import type { InnerWorkspace } from '@zakodium/nmrium-core';
22

33
export function getNmrXivWorkspace(hidePanelOnLoad = false): InnerWorkspace {
44
return {

test-e2e/core.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { test, expect } from '@playwright/test';
1+
import { expect, test } from '@playwright/test';
22

33
import NmriumWrapperPage from './NmriumWrapperPage.js';
44

0 commit comments

Comments
 (0)