Skip to content

Commit

Permalink
feat: vs code
Browse files Browse the repository at this point in the history
  • Loading branch information
xsf0105 committed Mar 17, 2023
1 parent d32769f commit ad65da8
Show file tree
Hide file tree
Showing 6 changed files with 364 additions and 259 deletions.
24 changes: 24 additions & 0 deletions packages/vscode-extension/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"@typescript-eslint/naming-convention": "warn",
"@typescript-eslint/semi": "warn",
"curly": "warn",
"eqeqeq": "warn",
"no-throw-literal": "warn",
"semi": "off"
},
"ignorePatterns": [
"out",
"dist",
"**/*.d.ts"
]
}
74 changes: 13 additions & 61 deletions packages/vscode-extension/README.md
Original file line number Diff line number Diff line change
@@ -1,71 +1,23 @@
# quarkd-vscode-extension README
# Quark design 组件库 vscode 插件

This is the README for your extension "quarkd-vscode-extension". After writing up a brief description, we recommend including the following sections.
开发本插件旨在帮助开发者更加有效率的使用 Quarkd 来开发项目

## Features
## 特征

Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file.
- 快速查看文档
- 代码自动补全

For example if there is an image subfolder under your extension project workspace:
## 文档

\!\[feature X\]\(images/feature-x.png\)
### 用法

> Tip: Many popular extensions utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow.
- 移动鼠标到 Quarkd 的标签上
- 能够看到除了提示的 TS 类型之外,还有一行查看当前组件文档的提示,点击可以跳转到对应组件的文档,方便开发者查阅

## Requirements
## 自动补全

If you have any requirements or dependencies, add a section describing those and how to install and configure them.
在输入 `quark-` 时,会出现组件列表提示,这时,可选择任意需要的组件,然后点击回车自动补全,省时又省力~

## Extension Settings
## 许可

Include if your extension adds any VS Code settings through the `contributes.configuration` extension point.

For example:

This extension contributes the following settings:

- `myExtension.enable`: enable/disable this extension
- `myExtension.thing`: set to `blah` to do something

## Known Issues

Calling out known issues can help limit users opening duplicate issues against your extension.

## Release Notes

Users appreciate release notes as you update your extension.

### 1.0.0

Initial release of ...

### 1.0.1

Fixed issue #.

### 1.1.0

Added features X, Y, and Z.

---

## Following extension guidelines

Ensure that you've read through the extensions guidelines and follow the best practices for creating your extension.

- [Extension Guidelines](https://code.visualstudio.com/api/references/extension-guidelines)

## Working with Markdown

**Note:** You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts:

- Split the editor (`Cmd+\` on macOS or `Ctrl+\` on Windows and Linux)
- Toggle preview (`Shift+CMD+V` on macOS or `Shift+Ctrl+V` on Windows and Linux)
- Press `Ctrl+Space` (Windows, Linux) or `Cmd+Space` (macOS) to see a list of Markdown snippets

### For more information

- [Visual Studio Code's Markdown Support](http://code.visualstudio.com/docs/languages/markdown)
- [Markdown Syntax Reference](https://help.github.com/articles/markdown-basics/)

**Enjoy!**
MIT
32 changes: 17 additions & 15 deletions packages/vscode-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,37 @@
"displayName": "quarkd-vscode-extension",
"description": "quark design extension for vscode",
"private": true,
"version": "1.0.0",
"version": "0.0.1",
"icon": "src/quarkd.png",
"engines": {
"vscode": "^1.67.0"
},
"repository": {
"type": "git",
"url": "git+https://github.com/hellof2e/quark-design",
"directory": "packages/vscode-extension"
},
"categories": [
"Other"
],
"publisher": "quarkd",
"activationEvents": [
"onLanguage:vue",
"onLanguage:javascript",
"onLanguage:typescript"
"onLanguage:typescript",
"onLanguage:javascriptreact",
"onLanguage:typescriptreact"
],
"main": "./dist/extension.js",
"contributes": {
"commands": []
},
"scripts": {
"TODObuild": "webpack --mode production --devtool hidden-source-map",
"package": "yarn gen && yarn build && vsce package",
"publish": "vsce publish",
"unpublish": "vsce unpublish quarkd.quarkd-vscode-extension",
"vscode:prepublish": "yarn run package",
"watch": "webpack --watch",
"gen": "node ./scripts/createComponentMap.js",
"compile": "webpack"
"build": "webpack --mode production --devtool hidden-source-map",
"package": "yarn gen && yarn build && vsce package",
"publish": "vsce publish",
"unpublish": "vsce unpublish quarkd.quarkd-vscode-extension",
"gen": "node ./scripts/createComponentMap.js"
},
"devDependencies": {
"@types/glob": "^7.2.0",
Expand All @@ -41,9 +47,5 @@
"typescript": "^4.6.4",
"webpack": "^5.70.0",
"webpack-cli": "^4.9.2"
},
"dependencies": {
"vsce": "^2.8.0"
},
"gitHead": "ed682a8b23cf9831613dc6a4b30b0b076d2a54ac"
}
}
2 changes: 1 addition & 1 deletion packages/vscode-extension/scripts/createComponentMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const fs = require("fs");
// eslint-disable-next-line @typescript-eslint/naming-convention
const MarkdownIt = require("markdown-it")();

const basePath = path.resolve(__dirname, "./../../AppQuarkd/src/packages");
const basePath = path.resolve(__dirname, "./../../quark/src");
const componentDirs = fs.readdirSync(basePath, "utf8");
const TYPE_IDENTIFY_OPEN = "tbody_open";
const TYPE_IDENTIFY_CLOSE = "tbody_close";
Expand Down
Loading

0 comments on commit ad65da8

Please sign in to comment.