Skip to content

Commit f06eb8c

Browse files
committed
update: package: any-menu@1.0.0
1 parent 80b32f2 commit f06eb8c

5 files changed

Lines changed: 24 additions & 119 deletions

File tree

README.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,15 @@ $ npm run build
2020

2121
## 从零生成此项目 (可选)
2222

23-
可选阅读,仅推荐有需要自定义插件模板的查看 (如需要开发有 Vue/React 等依赖的插件模板)
23+
> [!note]
24+
> 可选阅读
25+
>
26+
> 如果你使用 js 来编写则不需要这些,直接仿照官方的 js 示例插件来编写就可以了
27+
>
28+
> 若使用模板,一般来说你只要根据模板创建你的项目即可 (即在 github repo 页面直接按右上角的根据模板创建),
29+
> 也不需要阅读此章
30+
>
31+
> 仅推荐想要了解模板细节、有需要自定义插件模板的开发者查看此节 (如需要开发其他框架依赖的插件模板)
2432
2533
(1) git 环境 (可选)
2634

@@ -82,6 +90,10 @@ Is this OK? (yes)
8290

8391
$ npm install -D typescript vite
8492

93+
# 为 any-menu 插件提供类型,对应 any-menu/any-menu 项目的 src/Type/
94+
# 当然,
95+
$ npm install -D any-menu
96+
8597
# 替换 package.json 的 scripts (使用 vite 和 typescript)
8698
# 添加 tsconfig.json
8799
# 添加 vite.config.js
@@ -91,14 +103,6 @@ $ npm install -D typescript vite
91103

92104
```bash
93105
# 然后是文件准备
94-
95-
# (1) typescript 类型
96-
# 复制 any-menu/any-menu 项目的 src/Core/PluginInterface.ts 接口到 /types/any-menu.d.ts
97-
# 或复制该项目的 /types/any-menu.d.ts
98-
# 或等待后期这一步会转而使用 npm 类型依赖包来实现
99-
#
100-
# 当然,如果你使用 js 来编写则不需要这一步,直接仿照官方的 js 示例插件来编写就可以了
101-
102-
# (2) 创建和编写 src/ 文件夹内的内容 (主要程序代码和样式文件)
106+
# 创建和编写 `src/` 文件夹内的内容 (主要程序代码和样式文件)
103107
# 特殊:这里使用的特殊的方式将 css 文件转为字符串附加到 js 上,这样能方便你更好地利用代码着色功能编辑 js 文件
104108
```

package-lock.json

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

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"typecheck": "tsc --noEmit"
1818
},
1919
"devDependencies": {
20+
"any-menu": "^1.0.0",
2021
"typescript": "^5.9.3",
2122
"vite": "^8.0.1"
2223
}

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// 功能: 可以将 CSS 内联到 JS 中,插件只需分发单个 .js 文件
1414
import cssText from './style.css?inline';
1515

16-
import type { PluginInterface, PluginInterfaceCtx } from '../types/any-menu';
16+
import type { PluginInterface, PluginInterfaceCtx } from 'any-menu';
1717

1818
let cache_ctx: PluginInterfaceCtx | undefined
1919

types/any-menu.d.ts

Lines changed: 0 additions & 108 deletions
This file was deleted.

0 commit comments

Comments
 (0)