From 74be4698eefe140ac3bf990777b2f9aaa1b76378 Mon Sep 17 00:00:00 2001 From: sunshinesmilelk <1176136681@qq.com> Date: Fri, 7 Feb 2025 19:13:11 +0800 Subject: [PATCH] refactor: use libro common instead of mana in dumo demos --- apps/docs/.dumi/theme/layouts/DocLayout.tsx | 2 +- apps/docs/.dumi/theme/modules/github.ts | 2 +- apps/docs/.dumi/theme/modules/module.ts | 2 +- apps/docs/.dumi/theme/slots/Header/index.tsx | 2 +- apps/docs/package.json | 6 +----- apps/docs/src/lab/app.ts | 6 +++++- apps/docs/src/lab/index.tsx | 6 +++++- apps/docs/src/output/app.ts | 9 ++++++--- apps/docs/src/output/content.ts | 2 +- apps/docs/src/output/index.tsx | 6 +++++- apps/docs/src/terminal/app.ts | 8 ++++---- apps/docs/src/terminal/demo-module/app.tsx | 8 ++++---- apps/docs/src/terminal/demo-module/index.ts | 8 ++++++-- apps/docs/src/terminal/index.tsx | 6 +++++- apps/docs/src/workbench/app.ts | 12 ++++++------ apps/docs/src/workbench/index.tsx | 2 +- .../src/workbench/layout/workbench-layout.view.tsx | 4 ++-- 17 files changed, 55 insertions(+), 36 deletions(-) diff --git a/apps/docs/.dumi/theme/layouts/DocLayout.tsx b/apps/docs/.dumi/theme/layouts/DocLayout.tsx index 574b6ddc..bd1a0b80 100644 --- a/apps/docs/.dumi/theme/layouts/DocLayout.tsx +++ b/apps/docs/.dumi/theme/layouts/DocLayout.tsx @@ -1,4 +1,4 @@ -import { ManaComponents } from '@difizen/mana-app'; +import { ManaComponents } from '@difizen/libro-common/mana-app'; import { Helmet, useLocation, useSiteData } from 'dumi'; import DefaultLayout from 'dumi/theme-default/layouts/DocLayout'; import React, { useEffect } from 'react'; diff --git a/apps/docs/.dumi/theme/modules/github.ts b/apps/docs/.dumi/theme/modules/github.ts index 0efc1c23..3613ce6a 100644 --- a/apps/docs/.dumi/theme/modules/github.ts +++ b/apps/docs/.dumi/theme/modules/github.ts @@ -1,4 +1,4 @@ -import { prop, singleton } from '@difizen/mana-app'; +import { prop, singleton } from '@difizen/libro-common/mana-app'; import { Octokit } from 'octokit'; @singleton() diff --git a/apps/docs/.dumi/theme/modules/module.ts b/apps/docs/.dumi/theme/modules/module.ts index 23b1bdd4..20313559 100644 --- a/apps/docs/.dumi/theme/modules/module.ts +++ b/apps/docs/.dumi/theme/modules/module.ts @@ -1,4 +1,4 @@ -import { ManaAppPreset, ManaModule } from '@difizen/mana-app'; +import { ManaAppPreset, ManaModule } from '@difizen/libro-common/mana-app'; import { l10n } from '@difizen/libro-common/mana-l10n'; import { langBundles } from '../lang/index'; diff --git a/apps/docs/.dumi/theme/slots/Header/index.tsx b/apps/docs/.dumi/theme/slots/Header/index.tsx index 722c878f..6c19f390 100644 --- a/apps/docs/.dumi/theme/slots/Header/index.tsx +++ b/apps/docs/.dumi/theme/slots/Header/index.tsx @@ -1,6 +1,6 @@ import { GithubOutlined } from '@ant-design/icons'; import { CloseOutlined, MenuOutlined } from '@ant-design/icons'; -import { ThemeService, useInject } from '@difizen/mana-app'; +import { ThemeService, useInject } from '@difizen/libro-common/mana-app'; import { l10n, L10nLang } from '@difizen/libro-common/mana-l10n'; import { Button } from 'antd'; import { useRouteMeta, Link, usePrefersColor, useSiteData, history} from 'dumi'; diff --git a/apps/docs/package.json b/apps/docs/package.json index 9a40f4ef..948e5352 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -24,11 +24,7 @@ "dependencies": { "@ant-design/icons": "^5.4.0", "@difizen/libro": "latest", - "@difizen/libro-core": "latest", - "@difizen/libro-jupyter": "latest", - "@difizen/libro-lab": "latest", - "@difizen/libro-terminal": "latest", - "@difizen/mana-app": "latest", + "@difizen/libro-common": "latest", "@radix-ui/react-slot": "^1.1.0", "antd": "^5.10.0", "axios": "^1.7.7", diff --git a/apps/docs/src/lab/app.ts b/apps/docs/src/lab/app.ts index ba5a1e07..a4f4f070 100644 --- a/apps/docs/src/lab/app.ts +++ b/apps/docs/src/lab/app.ts @@ -1,5 +1,9 @@ import { ServerConnection, ServerManager } from '@difizen/libro'; -import { ApplicationContribution, inject, singleton } from '@difizen/mana-app'; +import { + ApplicationContribution, + inject, + singleton, +} from '@difizen/libro-common/mana-app'; @singleton({ contrib: ApplicationContribution }) export class LibroApp implements ApplicationContribution { diff --git a/apps/docs/src/lab/index.tsx b/apps/docs/src/lab/index.tsx index 892ce629..1b1dcb7a 100644 --- a/apps/docs/src/lab/index.tsx +++ b/apps/docs/src/lab/index.tsx @@ -1,5 +1,9 @@ import { LibroLabModule } from '@difizen/libro'; -import { ManaAppPreset, ManaComponents, ManaModule } from '@difizen/mana-app'; +import { + ManaAppPreset, + ManaComponents, + ManaModule, +} from '@difizen/libro-common/mana-app'; import { LibroApp } from './app.js'; import './index.less'; diff --git a/apps/docs/src/output/app.ts b/apps/docs/src/output/app.ts index 99b19f4c..a27c01ee 100644 --- a/apps/docs/src/output/app.ts +++ b/apps/docs/src/output/app.ts @@ -1,7 +1,10 @@ import { LibroService } from '@difizen/libro'; -import { RootSlotId } from '@difizen/mana-app'; -import { ApplicationContribution, SlotViewManager } from '@difizen/mana-app'; -import { inject, singleton } from '@difizen/mana-app'; +import { RootSlotId } from '@difizen/libro-common/mana-app'; +import { + ApplicationContribution, + SlotViewManager, +} from '@difizen/libro-common/mana-app'; +import { inject, singleton } from '@difizen/libro-common/mana-app'; @singleton({ contrib: ApplicationContribution }) export class LibroApp implements ApplicationContribution { diff --git a/apps/docs/src/output/content.ts b/apps/docs/src/output/content.ts index a72662a2..4ab079b6 100644 --- a/apps/docs/src/output/content.ts +++ b/apps/docs/src/output/content.ts @@ -1,6 +1,6 @@ import type { INotebookContent } from '@difizen/libro'; import { ContentContribution } from '@difizen/libro'; -import { singleton } from '@difizen/mana-app'; +import { singleton } from '@difizen/libro-common/mana-app'; import content from './OutputExamples.ipynb.json'; diff --git a/apps/docs/src/output/index.tsx b/apps/docs/src/output/index.tsx index 8403e5f4..dba38e9a 100644 --- a/apps/docs/src/output/index.tsx +++ b/apps/docs/src/output/index.tsx @@ -1,5 +1,9 @@ import { LibroJupyterModule } from '@difizen/libro'; -import { ManaAppPreset, ManaComponents, ManaModule } from '@difizen/mana-app'; +import { + ManaAppPreset, + ManaComponents, + ManaModule, +} from '@difizen/libro-common/mana-app'; import { LibroApp } from './app.js'; import { ExampleContentContribution } from './content.js'; diff --git a/apps/docs/src/terminal/app.ts b/apps/docs/src/terminal/app.ts index a7f834de..2972ec9f 100644 --- a/apps/docs/src/terminal/app.ts +++ b/apps/docs/src/terminal/app.ts @@ -1,8 +1,8 @@ import { ServerConnection, ServerManager } from '@difizen/libro'; -import { ConfigurationService } from '@difizen/mana-app'; -import { SlotViewManager } from '@difizen/mana-app'; -import { ApplicationContribution, ViewManager } from '@difizen/mana-app'; -import { inject, singleton } from '@difizen/mana-app'; +import { ConfigurationService } from '@difizen/libro-common/mana-app'; +import { SlotViewManager } from '@difizen/libro-common/mana-app'; +import { ApplicationContribution, ViewManager } from '@difizen/libro-common/mana-app'; +import { inject, singleton } from '@difizen/libro-common/mana-app'; @singleton({ contrib: ApplicationContribution }) export class LibroApp implements ApplicationContribution { diff --git a/apps/docs/src/terminal/demo-module/app.tsx b/apps/docs/src/terminal/demo-module/app.tsx index bf8e3a52..5d42a743 100644 --- a/apps/docs/src/terminal/demo-module/app.tsx +++ b/apps/docs/src/terminal/demo-module/app.tsx @@ -1,6 +1,6 @@ -import type { TerminalViewOption } from '@difizen/libro-terminal'; -import { TerminalManager, LibroTerminalView } from '@difizen/libro-terminal'; -import type { Disposable } from '@difizen/mana-app'; +import type { TerminalViewOption } from '@difizen/libro'; +import { TerminalManager, LibroTerminalView } from '@difizen/libro'; +import type { Disposable } from '@difizen/libro-common/mana-app'; import { BaseView, ViewInstance, @@ -10,7 +10,7 @@ import { singleton, useInject, view, -} from '@difizen/mana-app'; +} from '@difizen/libro-common/mana-app'; import { Button, Card, Checkbox, Flex, Form, Input, Space, Tabs } from 'antd'; import type { FC } from 'react'; import { forwardRef, useCallback, useEffect, useState } from 'react'; diff --git a/apps/docs/src/terminal/demo-module/index.ts b/apps/docs/src/terminal/demo-module/index.ts index b454f584..d2c89c49 100644 --- a/apps/docs/src/terminal/demo-module/index.ts +++ b/apps/docs/src/terminal/demo-module/index.ts @@ -1,5 +1,9 @@ -import { TerminalModule } from '@difizen/libro-terminal'; -import { ManaModule, RootSlotId, createSlotPreference } from '@difizen/mana-app'; +import { TerminalModule } from '@difizen/libro'; +import { + ManaModule, + RootSlotId, + createSlotPreference, +} from '@difizen/libro-common/mana-app'; import { AppView } from './app.js'; // 用于文档测试页面 diff --git a/apps/docs/src/terminal/index.tsx b/apps/docs/src/terminal/index.tsx index 49d42e4f..380952fb 100644 --- a/apps/docs/src/terminal/index.tsx +++ b/apps/docs/src/terminal/index.tsx @@ -1,4 +1,8 @@ -import { ManaAppPreset, ManaComponents, ManaModule } from '@difizen/mana-app'; +import { + ManaAppPreset, + ManaComponents, + ManaModule, +} from '@difizen/libro-common/mana-app'; import { LibroApp } from './app.js'; import { TerminalDemoModule } from './demo-module/index.js'; diff --git a/apps/docs/src/workbench/app.ts b/apps/docs/src/workbench/app.ts index 694ad47c..94cf994c 100644 --- a/apps/docs/src/workbench/app.ts +++ b/apps/docs/src/workbench/app.ts @@ -3,12 +3,12 @@ import { LibroJupyterConfiguration, ServerManager, } from '@difizen/libro'; -import type { FileTreeView } from '@difizen/mana-app'; -import { ConfigurationService } from '@difizen/mana-app'; -import { FileTreeViewFactory, SlotViewManager } from '@difizen/mana-app'; -import { URI } from '@difizen/mana-app'; -import { ApplicationContribution, ViewManager } from '@difizen/mana-app'; -import { inject, singleton } from '@difizen/mana-app'; +import type { FileTreeView } from '@difizen/libro-common/mana-app'; +import { ConfigurationService } from '@difizen/libro-common/mana-app'; +import { FileTreeViewFactory, SlotViewManager } from '@difizen/libro-common/mana-app'; +import { URI } from '@difizen/libro-common/mana-app'; +import { ApplicationContribution, ViewManager } from '@difizen/libro-common/mana-app'; +import { inject, singleton } from '@difizen/libro-common/mana-app'; import { LibroWorkbenchSlots } from './layout/workbench-layout.view.js'; diff --git a/apps/docs/src/workbench/index.tsx b/apps/docs/src/workbench/index.tsx index 8551510d..37875c96 100644 --- a/apps/docs/src/workbench/index.tsx +++ b/apps/docs/src/workbench/index.tsx @@ -7,7 +7,7 @@ import { RootSlotId, CardTabView, FileTreeView, -} from '@difizen/mana-app'; +} from '@difizen/libro-common/mana-app'; import { LibroApp } from './app.js'; import { LibroWorkbenchLayoutView, LibroWorkbenchSlots } from './layout/index.js'; diff --git a/apps/docs/src/workbench/layout/workbench-layout.view.tsx b/apps/docs/src/workbench/layout/workbench-layout.view.tsx index 437504a0..fbd25585 100644 --- a/apps/docs/src/workbench/layout/workbench-layout.view.tsx +++ b/apps/docs/src/workbench/layout/workbench-layout.view.tsx @@ -1,5 +1,5 @@ -import { singleton, Slot, view } from '@difizen/mana-app'; -import { BaseView } from '@difizen/mana-app'; +import { singleton, Slot, view } from '@difizen/libro-common/mana-app'; +import { BaseView } from '@difizen/libro-common/mana-app'; import { BoxPanel } from '@difizen/libro-common/mana-react'; import { forwardRef } from 'react';