workspace: upgrade to cordis@4.0.0-beta.1, fix #975

This commit is contained in:
undefined committed 2025-04-11 21:21:47 +08:00
1 parent 5d5f6c69d7
commit bf51bd30c7
34 files changed
+87 -88

No files matched your search

@@ -66,7 +66,7 @@ export default function ScratchpadContainer() {
const store = useStore();
if (!scratchpad) {
scratchpad = new ScratchpadService(store);
ctx.set('scratchpad', scratchpad);
ctx.provide('scratchpad', scratchpad);
}
const [, updateState] = React.useState<any>();
const forceUpdate = React.useCallback(() => updateState({}), []);
+3 -3
View File
@@ -1,9 +1,9 @@
import * as cordis from '@cordisjs/core';
import * as cordis from 'cordis';
import type { EventMap } from './api';
export interface Events<C extends Context = Context> extends cordis.Events<C>, EventMap { }
export type { Disposable, ScopeStatus, Plugin } from '@cordisjs/core';
export type { Disposable, FiberState, Plugin } from 'cordis';
export interface Context {
[Context.events]: Events<this>;
@@ -11,7 +11,7 @@ export interface Context {
}
export class Context extends cordis.Context { }
export type EffectScope = cordis.EffectScope<Context>;
export type Fiber = cordis.Fiber<Context>;
export class Service<C extends Context = Context> extends cordis.Service<C> {
}
+12 -12
View File
@@ -11,8 +11,7 @@
"cli": false
},
"devDependencies": {
"@blueprintjs/core": "^5.17.6",
"@cordisjs/core": "4.0.0-alpha.8",
"@blueprintjs/core": "^5.18.0",
"@fontsource/dm-mono": "^5.2.5",
"@fontsource/fira-code": "^5.2.5",
"@fontsource/inconsolata": "^5.2.5",
@@ -22,8 +21,8 @@
"@fontsource/source-code-pro": "^5.2.5",
"@fontsource/ubuntu-mono": "^5.2.5",
"@hydrooj/utils": "workspace:^",
"@sentry/browser": "^9.10.1",
"@sentry/webpack-plugin": "^3.2.4",
"@sentry/browser": "^9.12.0",
"@sentry/webpack-plugin": "^3.3.1",
"@simplewebauthn/browser": "13.1.0",
"@svgr/webpack": "^8.1.0",
"@types/html-to-text": "^9.0.4",
@@ -36,7 +35,7 @@
"@types/pickadate": "^3.5.35",
"@types/qrcode": "^1.5.5",
"@types/react": "^18.3.20",
"@types/react-dom": "^18.3.5",
"@types/react-dom": "^18.3.6",
"@types/redux-logger": "^3.0.13",
"@types/uuid": "^10.0.0",
"@types/webpack-env": "^1.18.8",
@@ -50,6 +49,7 @@
"clean-webpack-plugin": "^4.0.0",
"clipboard": "^2.0.11",
"copy-webpack-plugin": "^13.0.0",
"cordis": "4.0.0-beta.1",
"core-js": "^3.41.0",
"core-js-compat": "^3.41.0",
"css-loader": "^7.1.2",
@@ -99,7 +99,7 @@
"redux-promise-middleware": "^6.2.0",
"redux-thunk": "^3.1.0",
"rupture": "^0.7.1",
"sass": "^1.86.1",
"sass": "^1.86.3",
"sass-loader": "^16.0.5",
"schemastery": "^3.16.1",
"schemastery-react": "^0.1.2",
@@ -108,15 +108,15 @@
"sticky-kit": "^1.1.3",
"style-loader": "^4.0.0",
"stylus": "^0.64.0",
"stylus-loader": "7.1.2",
"svgtofont": "^6.3.1",
"stylus-loader": "7.1.3",
"svgtofont": "^6.3.2",
"tether": "1.4.7",
"tether-drop": "^1.4.2",
"timeago-react": "^3.0.7",
"timeago.js": "^4.0.2",
"ts-loader": "^9.5.2",
"web-streams-polyfill": "^4.1.0",
"webpack": "^5.98.0",
"webpack": "^5.99.5",
"webpack-bundle-analyzer": "^4.10.2",
"webpack-dev-server": "^5.2.1",
"webpack-manifest-plugin": "^5.0.1",
@@ -124,14 +124,14 @@
},
"dependencies": {
"@hydrooj/common": "workspace:^",
"ansi_up": "^6.0.2",
"ansi_up": "^6.0.5",
"cssfilter": "^0.0.11",
"esbuild": "0.25.0",
"esbuild": "0.25.2",
"fs-extra": "^11.3.0",
"html-to-text": "^9.0.5",
"js-yaml": "^4.1.0",
"jsesc": "^3.1.0",
"katex": "^0.16.21",
"katex": "^0.16.22",
"lodash": "^4.17.21",
"markdown-it": "^14.1.0",
"markdown-it-anchor": "^9.2.0",
+1 -1
View File
@@ -21,7 +21,7 @@ export default new NamedPage('api', async () => {
} as any;
createRoot(document.getElementById('main')!).render(
<GraphiQL
fetcher={(body, opts = {}) => request.post('/api', body, pick(opts, 'headers'))}
fetcher={(body, opts = {}) => request.post(`/d/${UiContext.domain._id}/api`, body, pick(opts, 'headers'))}
defaultQuery={defaultQuery}
variables='{"name": "Hydro"}'
/>,
@@ -43,7 +43,7 @@ const page = new NamedPage('home_messages', () => {
reduxStore = store;
(window as any).store = reduxStore;
ctx.set('messagepad', new MessagePadService(store, WebSocket));
ctx.provide('messagepad', new MessagePadService(store, WebSocket));
const sock = new WebSocket(`${UiContext.ws_prefix}home/messages-conn`);
sock.onmessage = (message) => {
@@ -1,6 +1,5 @@
import { browserSupportsWebAuthn, platformAuthenticatorIsAvailable, startRegistration } from '@simplewebauthn/browser';
import $ from 'jquery';
import { escape } from 'lodash';
import QRCode from 'qrcode';
import { ActionDialog } from 'vj/components/dialog';
import Notification from 'vj/components/notification';
@@ -28,7 +27,7 @@ async function changeMail() {
<input className="textbox" type="text" name="mail" required></input>
</div>
</label>
</div>
</div>,
),
onDispatch(action) {
if (action === 'ok') {
@@ -199,7 +198,7 @@ export default new NamedPage('home_security', () => {
</MenuLink>
</>)}
</ol>
</div>
</div>,
);
const action = await new ActionDialog({ $body, $action: [] }).open();
if (!action || action === 'cancel') return;