Skip to content

Commit

Permalink
Update business-license-query-verification extension
Browse files Browse the repository at this point in the history
- fix: move @raycast/api to dependencies
- fix: 调整 package.json 字段顺序
- chore: 添加 @raycast/api 配置
- chore: 添加 .gitignore 并清理无关文件
- refactor: 优化插件结构,统一入口
- Initial commit
  • Loading branch information
bblmian committed Dec 26, 2024
1 parent 50edaf4 commit 8debbfc
Show file tree
Hide file tree
Showing 8 changed files with 251 additions and 4 deletions.
14 changes: 14 additions & 0 deletions extensions/business-license-query-verification/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": [
"@raycast",
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"rules": {
"@typescript-eslint/no-explicit-any": "off"
}
}
29 changes: 29 additions & 0 deletions extensions/business-license-query-verification/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# macOS
.DS_Store
.AppleDouble
.LSOverride

# Node.js
node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Build
dist/
build/

# IDE
.idea/
.vscode/
*.swp
*.swo

# Logs
logs
*.log

# Environment variables
.env
.env.local
.env.*.local
8 changes: 8 additions & 0 deletions extensions/business-license-query-verification/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"printWidth": 100,
"tabWidth": 2,
"singleQuote": false,
"trailingComma": "es5",
"bracketSpacing": true,
"semi": true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"$schema": "https://www.raycast.com/schemas/extension.json",
"name": "business-license-query-verification",
"title": "工商信息查询与核验",
"description": "批量查询工商注册信息并支持多种格式导出,支持企业名称与统一社会信用代码的核验",
"version": "1.0.0",
"author": "bblmian",
"owner": "bblmian",
"license": "MIT",
"icon": "assets/extension_icon.png",
"categories": [
"Productivity",
"Data",
"Developer Tools"
],
"commands": [
{
"name": "query",
"title": "工商信息查询",
"description": "批量查询企业的工商注册信息,支持多个企业名称",
"mode": "view",
"main": "src/query.tsx"
},
{
"name": "verify",
"title": "工商信息核验",
"description": "批量核验企业名称与统一社会信用代码的一致性",
"mode": "view",
"main": "src/verify.tsx"
}
],
"preferences": [
{
"name": "apiKey",
"type": "textfield",
"required": true,
"title": "API Key",
"description": "百度 API 的 API Key,在百度云控制台获取",
"placeholder": "请输入 API Key",
"link": "https://console.bce.baidu.com/"
},
{
"name": "secretKey",
"type": "textfield",
"required": true,
"title": "Secret Key",
"description": "百度 API 的 Secret Key,在百度云控制台获取",
"placeholder": "请输入 Secret Key",
"link": "https://console.bce.baidu.com/"
},
{
"name": "requestInterval",
"type": "textfield",
"required": false,
"title": "请求间隔",
"description": "两次请求之间的间隔时间(毫秒),建议不小于1000",
"placeholder": "1000"
},
{
"name": "maxConcurrent",
"type": "textfield",
"required": false,
"title": "最大并发数",
"description": "同时进行的最大请求数量,建议不超过5",
"placeholder": "5"
},
{
"name": "batchSize",
"type": "textfield",
"required": false,
"title": "批处理数量",
"description": "每批处理的企业数量,建议不超过10",
"placeholder": "10"
}
]
}
10 changes: 10 additions & 0 deletions extensions/business-license-query-verification/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Business License Query Changelog

## [Initial Version] - {PR_MERGE_DATE}

- Add business license query functionality
- Add business license verification functionality
- Support batch processing with configurable intervals
- Add export to Markdown and Excel formats
- Add progress tracking for batch operations
- Add API key configuration in preferences
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# Raycast Developer Handbook

# Raycast 插件开发的正确流程

## 项目初始化


```
# 创建项目目录
mkdir my-extension
cd my-extension
# 创建基本目录结构
mkdir -p src assets
```

## 配置文件设置

```
// package.json
{
"$schema": "https://www.raycast.com/schemas/extension.json",
"name": "extension-name",
"title": "Extension Title",
"description": "Extension Description",
"icon": "command-icon.png",
"author": "your-name",
"categories": ["Category"],
"license": "MIT",
"commands": [
{
"name": "index",
"title": "Command Title",
"description": "Command Description",
"mode": "view"
}
]
}
```

## 必要的依赖

```
{
"dependencies": {
"@raycast/api": "^1.65.1",
"react": "^18.2.0"
},
"devDependencies": {
"@types/node": "^20.10.0",
"@types/react": "^18.2.45",
"@types/react-dom": "^18.0.6",
"typescript": "^5.3.3"
}
}
```

## 正确的脚本配置

```
{
"scripts": {
"build": "ray build --env dist",
"dev": "ray develop",
"lint": "ray lint"
}
}
```

# 开发流程

- 编写代码在 src/index.tsx
- 使用 npm run dev 进行开发
- 在 Raycast 中启用开发者模式
- 导入并测试插件

# 测试和发布准备

- 使用 npm run build 构建
- 测试所有功能
- 准备发布到 Raycast Store

# 最佳实践

1. 配置文件
- 必须使用官方 schema
- 正确设置命令和权限
- 提供清晰的描述和图标

2. 依赖管理

- 核心依赖放在 dependencies
- 开发工具放在 devDependencies
- 使用兼容的版本号

3. 开发者模式

- 开发模式,始终使用 npm run dev 进行开发
- 实时查看变更效果
- 及时处理错误提示

4. 调试技巧

- 使用 Raycast 的开发者工具
- 查看控制台输出
- 测试各种边界情况

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion extensions/business-license-query-verification/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"$schema": "https://www.raycast.com/schemas/extension.json",
"@raycast/api": {
"apiVersion": "1.88.4"
},
"name": "business-license-query-verification",
"title": "工商信息查询与核验",
"description": "批量查询工商注册信息并支持多种格式导出,支持企业名称与统一社会信用代码的核验",
Expand Down Expand Up @@ -70,7 +73,7 @@
}
],
"dependencies": {
"@raycast/api": "^1.65.1",
"@raycast/api": "^1.88.4",
"axios": "^1.6.2",
"p-limit": "^3.1.0",
"react": "^18.2.0",
Expand Down

0 comments on commit 8debbfc

Please sign in to comment.