forked fromrspack-contrib/rsbuild-plugin-template
- Notifications
You must be signed in to change notification settings - Fork0
Use this template to create your own WinJS plugin 🌟
License
NotificationsYou must be signed in to change notification settings
winjs-dev/winjs-plugin-template
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Example plugin for WinJS.
Install:
npm add winjs-plugin-example -D
Add plugin to your.winrc.ts:
// .winrc.tsexportdefault{plugins:['winjs-plugin-example'],// 开启配置example:{}};
Some description.
- Type:
string - Default:
undefined - Example:
exportdefault{plugins:['winjs-plugin-example'],// 开启配置example:{foo:'bar'}};
- 使用此模板创建新的 WinJS 插件项目
- 修改包名为你的插件名称
使用模板后,如果你修改了 npm 包名,需要更新以下文件中的包名引用:
修改以下字段:
name: 将winjs-plugin-template改为你的新包名repository.url: 更新为你的仓库地址
{"name":"your-plugin-name","repository": {"type":"git","url":"git+https://github.com/your-org/your-plugin-name.git" }}需要更新以下位置的包名引用:
- 文档标题(第一行)
- npm 版本徽章链接中的包名
- npm 下载量徽章链接中的包名
- 安装命令中的包名
- 使用示例中的插件名称
将所有的winjs-plugin-example 替换为你的新包名。
如果你的项目中有其他配置文件引用了包名(如renovate.json、CHANGELOG.md 等),也需要相应更新。
- 修改
src/index.ts中的key值(当前为example)为你的插件配置键名 - 根据插件功能完善
Options配置说明 - 更新
README.md中的插件描述和功能说明
安装依赖:
pnpm install
开发模式(监听文件变化自动构建):
pnpm run dev
构建项目:
pnpm run build
代码格式检查:
pnpm run lint
自动修复代码格式:
pnpm run lint:write
运行测试:
pnpm runtest本地测试插件:
在playground 目录中测试插件功能:
cd playgroundpnpm installpnpm run dev版本号管理:
pnpm run bump
- 在
src/index.ts中实现插件逻辑 - 运行
pnpm run dev监听文件变化 - 在
playground目录中运行pnpm run dev测试插件 - 运行
pnpm run lint:write确保代码格式正确 - 运行
pnpm run test确保测试通过 - 提交代码前运行
pnpm run build确保构建成功
MIT.
About
Use this template to create your own WinJS plugin 🌟
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
Languages
- TypeScript92.0%
- Vue7.6%
- JavaScript0.4%