From 236c284159f8dedacf5aa3cc1e6765cff583fb7d Mon Sep 17 00:00:00 2001 From: Timi Date: Thu, 26 Nov 2026 16:06:12 +0800 Subject: [PATCH 1/2] chore: migrate timi-web imports to @timi/web --- README.md | 6 +++--- src/editor/article.ts | 2 +- src/editor/index.ts | 2 +- src/store/userStore.ts | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f88eb10..6d6885e 100644 --- a/README.md +++ b/README.md @@ -2,15 +2,15 @@ Timi Web 的业务 API、领域类型、用户状态和权限相关能力。 -通用组件与工具位于 [timi-web](https://gitea.imyeyu.com/timi/timi-web),本项目使用自己的 Axios 网络层,并依赖它提供 Cookie、Storage 等通用工具。 +通用组件与工具位于 [@timi/web](https://gitea.imyeyu.com/timi/timi-web),本项目使用自己的 Axios 网络层,并依赖它提供 Cookie、Storage 等通用工具。 ## 依赖方向 本项目是独立的业务能力包。只有需要业务 API、领域类型、用户状态或权限能力的项目才安装 `timi-web-api`;只使用通用组件的项目不需要安装本项目。 ```text -只使用通用组件的业务项目 -> timi-tdesign-mobile / timi-tdesign-pc -> timi-web -需要业务能力的业务项目 -> timi-web-api -> timi-web +只使用通用组件的业务项目 -> timi-tdesign-mobile / timi-tdesign-pc -> @timi/web +需要业务能力的业务项目 -> timi-web-api -> @timi/web ``` `timi-tdesign-mobile` 和 `timi-tdesign-pc` 不依赖 `timi-web-api`。其中的文章、通知组件只约束 `Article`、`Attachment`、`NotifyDetail` 的最小字段,业务对象可以携带自定义字段,并通过上传和资源解析回调接入任意后端。 diff --git a/src/editor/article.ts b/src/editor/article.ts index a7d122f..5071048 100644 --- a/src/editor/article.ts +++ b/src/editor/article.ts @@ -3,7 +3,7 @@ * 负责统一内容类型、附件标识和存储前的富文本格式,平台层不参与这些规则。 */ import type { ArticleContentType, Attachment } from "../types"; -import { ATTACHMENT_ID_ATTR, isLocalMediaId, normalizeContent, TEMP_FILE_ID_ATTR } from "timi-web/editor"; +import { ATTACHMENT_ID_ATTR, isLocalMediaId, normalizeContent, TEMP_FILE_ID_ATTR } from "@timi/web/editor"; /** 文章内容中附件和临时文件的标识前缀。 */ export const ATTACHMENT_ID_PREFIX = "attachment-id:"; diff --git a/src/editor/index.ts b/src/editor/index.ts index 352518b..5c5f129 100644 --- a/src/editor/index.ts +++ b/src/editor/index.ts @@ -1,5 +1,5 @@ /** 业务编辑器数据适配和通用编辑器能力出口。 */ -export * from "timi-web/editor"; +export * from "@timi/web/editor"; export * from "./article"; export * from "./notify"; export type { Article, ArticleContentType } from "../types/Article"; diff --git a/src/store/userStore.ts b/src/store/userStore.ts index 966d6e1..f45e5d1 100644 --- a/src/store/userStore.ts +++ b/src/store/userStore.ts @@ -1,7 +1,7 @@ import {defineStore} from "pinia"; import {computed, reactive, readonly, ref} from "vue"; import type {CaptchaData, LoginRequest, LoginResponse, LoginUser} from "../types"; -import {Cooker, Storage} from "timi-web"; +import {Cooker, Storage} from "@timi/web"; import {UserAPI} from "../api"; /** 用户 Store 配置项 */ From c47d03e68df06adeea68e1da891f1c13cd601d57 Mon Sep 17 00:00:00 2001 From: Timi Date: Thu, 26 Nov 2026 16:07:07 +0800 Subject: [PATCH 2/2] chore: update package name references to @timi/web-api --- .gitea/workflows/release.yml | 4 ++-- README.md | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 6c6f1e7..4b8a4c2 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -75,8 +75,8 @@ jobs: - name: Ensure version not published if: ${{ steps.version.outputs.publish == 'true' }} run: | - if npm view "timi-web-api@${{ steps.version.outputs.version }}" version > /dev/null 2>&1; then - echo "FAIL: timi-web-api@${{ steps.version.outputs.version }} 已存在于 nexus,请提升 package.json 版本" + if npm view "@timi/web-api@${{ steps.version.outputs.version }}" version > /dev/null 2>&1; then + echo "FAIL: @timi/web-api@${{ steps.version.outputs.version }} 已存在于 nexus,请提升 package.json 版本" exit 1 fi echo "OK: 版本未占用" diff --git a/README.md b/README.md index 6d6885e..f60d157 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# timi-web-api +# @timi/web-api Timi Web 的业务 API、领域类型、用户状态和权限相关能力。 @@ -6,14 +6,14 @@ Timi Web 的业务 API、领域类型、用户状态和权限相关能力。 ## 依赖方向 -本项目是独立的业务能力包。只有需要业务 API、领域类型、用户状态或权限能力的项目才安装 `timi-web-api`;只使用通用组件的项目不需要安装本项目。 +本项目是独立的业务能力包。只有需要业务 API、领域类型、用户状态或权限能力的项目才安装 `@timi/web-api`;只使用通用组件的项目不需要安装本项目。 ```text 只使用通用组件的业务项目 -> timi-tdesign-mobile / timi-tdesign-pc -> @timi/web -需要业务能力的业务项目 -> timi-web-api -> @timi/web +需要业务能力的业务项目 -> @timi/web-api -> @timi/web ``` -`timi-tdesign-mobile` 和 `timi-tdesign-pc` 不依赖 `timi-web-api`。其中的文章、通知组件只约束 `Article`、`Attachment`、`NotifyDetail` 的最小字段,业务对象可以携带自定义字段,并通过上传和资源解析回调接入任意后端。 +`timi-tdesign-mobile` 和 `timi-tdesign-pc` 不依赖 `@timi/web-api`。其中的文章、通知组件只约束 `Article`、`Attachment`、`NotifyDetail` 的最小字段,业务对象可以携带自定义字段,并通过上传和资源解析回调接入任意后端。 ## 目录