Skip to content

Commit f509cef

Browse files
authored
Merge pull request #19 from andurils/dev
release(v0.5.0): typescript rewrite
2 parents cf1950e + dd66603 commit f509cef

File tree

240 files changed

+545517
-6361
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

240 files changed

+545517
-6361
lines changed

.eslintrc.js

+9-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,16 @@ module.exports = {
33
env: {
44
node: true,
55
},
6-
extends: ["plugin:vue/essential", "eslint:recommended", "@vue/prettier"],
6+
extends: [
7+
"eslint:recommended",
8+
"plugin:vue/essential",
9+
"@vue/eslint-config-typescript",
10+
"@vue/eslint-config-prettier",
11+
],
712
parserOptions: {
8-
parser: "babel-eslint",
13+
ecmaVersion: 2020,
14+
parser: "@typescript-eslint/parser",
15+
warnOnUnsupportedTypeScriptVersion: false, // Version of TypeScript not officially supported
916
},
1017
rules: {
1118
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",

.gitignore

+1-5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ node_modules
1313
npm-debug.log*
1414
yarn-debug.log*
1515
yarn-error.log*
16-
pnpm-debug.log*
16+
*pnpm-debug.log*
1717

1818
# Editor directories and files
1919
.idea
@@ -23,7 +23,3 @@ pnpm-debug.log*
2323
*.njsproj
2424
*.sln
2525
*.sw?
26-
27-
28-
yarn.lock
29-
package-lock.json

INSPIRED.zh-CN.md

+22-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Inspired By
1+
# 💡 灵感
2+
3+
> 感谢以下以下开源项目、技术分享!
24
35
## playground
46

@@ -8,6 +10,12 @@
810
<https://github.com/vuejs/repl>
911
<https://github.com/wheatjs/vue-hako>
1012

13+
## vue2.7
14+
15+
<https://blog.vuejs.org/posts/vue-2-7-naruto.html>
16+
17+
<https://juejin.cn/post/7075874786110341133>
18+
1119
## react-code-view
1220

1321
[simonguo/react-code-view](https://github.com/simonguo/react-code-view)
@@ -38,7 +46,7 @@
3846

3947
[vue-cli3开发组件库](https://blog.csdn.net/u010622874/article/details/103312051)
4048

41-
[vue-cli4 全面配置](https://github.com/andurils/vue-cli4-config)
49+
[vue-cli4 全面配置](https://github.com/staven630/vue-cli4-config)
4250

4351
[vue-cli css 预处理器](https://cli.vuejs.org/zh/guide/css.html#预处理器)
4452

@@ -68,19 +76,22 @@ cnpm i --save-dev markdown-it markdown-it-anchor markdown-it-chain markdown-it-c
6876

6977
## css 预处理器
7078

71-
[sassmeister](https://www.sassmeister.com/)
72-
73-
[tiny-sass-compiler](https://github.com/wizardpisces/tiny-sass-compiler)
79+
[sass-loader](https://github.com/webpack-contrib/sass-loader/blob/master/src/index.js)
7480

75-
[tiny-sass-compiler demo](https://wizardpisces.github.io/sass)
81+
[less-loader](https://github.com/webpack-contrib/less-loader/blob/master/src/index.js)
7682

77-
[webpack-contrib/less-loader](https://github.com/webpack-contrib/less-loader/blob/master/src/index.js)
83+
[stylus-loader](https://github.com/webpack-contrib/stylus-loader/blob/master/src/index.js)
7884

7985
[stylus-lang](https://stylus-lang.com/)
8086

81-
---
87+
[sassmeister](https://www.sassmeister.com/)
88+
89+
## commit lint
90+
91+
<https://commitlint.js.org/>
92+
[Commitizen](https://zj-git-guide.readthedocs.io/zh_CN/latest/message/%5BCommitizen%5D%E4%BF%A1%E6%81%AF%E4%BA%A4%E4%BA%92%E5%B7%A5%E5%85%B7/)
93+
8294

83-
# Tools
8495

8596
## badge
8697

@@ -92,3 +103,5 @@ cnpm i --save-dev markdown-it markdown-it-anchor markdown-it-chain markdown-it-c
92103

93104
<https://svgporn.com/>
94105
<https://simpleicons.org/>
106+
107+

README.md

+14-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<p align="center">
22
<a href="https://andurils.github.io/vue-code-view/">
3-
<img width="200" src="https://iconfont.alicdn.com/t/5602941b-e109-4b22-99c5-21b0b041f234.png">
3+
<img width="200" src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/adee625fddf74e8db0225890aee88059~tplv-k3u1fbpfcp-watermark.image">
44
</a>
55
</p>
66

@@ -22,7 +22,7 @@ So can there be such a component that can support editing code in the page, edit
2222

2323
Special thanks to the component [react-code-view](https://github.com/simonguo/react-code-view), based on which the vue version of the component was written! Using this component, you can edit the running code and preview the effect in real time by using the multi-sample code in the `vue` page or the `markdown` document.
2424

25-
## Online Demo
25+
## Online Demo
2626

2727
![示例][preview-ol-v03]
2828

@@ -78,28 +78,30 @@ new Vue({
7878
}).$mount("#app");
7979
```
8080

81-
## API
81+
## 📚 API
8282

83-
### Attributes
83+
### Props
8484

85-
| 参数 | 说明 | 类型 | 默认值 | 版本 |
86-
| ------------- | ---------------------------- | ----------------- | ------ | ---- |
87-
| themeMode | code editor theme mode,default `light` | `` \| `dark` | `` | |
85+
| Property | Description | Type | Default | Version |
86+
| --- | ----- | ---- | ----- | ---- |
87+
| themeMode | code editor theme mode,default `light` | `` \| `dark` | `` | |
8888
| showCode | show the code editor , only `layout` value is `top` takes effect | boolean | false | |
8989
| source | source code | string | - | |
90-
| layout | render view layout | `top` \| `right` \| `left` | `top` | `0.4.0` |
90+
| layout | render view layout | `top` \| `right` \| `left` | `top` | `0.4.0+` |
9191

92-
## Changelog
92+
<!-- ### Events -->
93+
94+
## 📋 Changelog
9395

9496
Detailed changes for each release are documented in the [release notes](./CHANGELOG.zh-CN.md).
9597

9698
## 💡 Inspired
9799

98-
[links](./INSPIRED.zh-CN.md).
100+
Inspired by [shared links](./INSPIRED.zh-CN.md).
99101

100-
## License
102+
## 💳 License
101103

102-
VCV is licensed under the terms of the [MIT License](./LICENSE)
104+
VCV is licensed under the terms of the [MIT License](./LICENSE).
103105

104106
Copyright (c) 2021-present Anduril
105107

README.zh-CN.md

+14-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<p align="center">
22
<a href="https://andurils.github.io/vue-code-view/">
3-
<img width="200" src="https://iconfont.alicdn.com/t/5602941b-e109-4b22-99c5-21b0b041f234.png">
3+
<img width="200" src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/adee625fddf74e8db0225890aee88059~tplv-k3u1fbpfcp-watermark.image">
44
</a>
55
</p>
66

@@ -22,7 +22,7 @@
2222

2323
特别感谢组件 [react-code-view](https://github.com/simonguo/react-code-view),基于此编写了vue 版本的组件!使用此组件在 `vue` 页面还是 `markdown` 文档中的多示例代码,都可以实时编辑运行代码、预览效果。
2424

25-
## 在线预览
25+
## 在线预览
2626

2727
![示例][preview-ol-v03]
2828

@@ -78,28 +78,30 @@ new Vue({
7878
}).$mount("#app");
7979
```
8080

81-
## API
81+
## 📚 API
8282

83-
### Attributes
83+
### Props
8484

85-
| 参数 | 说明 | 类型 | 默认值 | 版本 |
86-
| ------------- | ---------------------------- | ----------------- | ------ | ---- |
85+
| 参数 | 说明 | 类型 | 默认值 | 版本 |
86+
| --- | ----- | ---- | ----- | ---- |
8787
| themeMode | 主题theme mode,默认`light`,支持 `dark` | `` \| `dark` | `` | |
8888
| showCode | 是否显示代码编辑器,只有在`layout`值为`top`生效 | boolean | false | |
8989
| source | 运行示例源码 | string | - | |
9090
| layout | render 视图布局 | `top` \| `right` \| `left` | `top` | `0.4.0`|
9191

92-
## 更新日志
92+
<!-- ### Events -->
9393

94-
Detailed changes for each release are documented in the [release notes](./CHANGELOG.zh-CN.md).
94+
## 📋 更新日志
9595

96-
## 💡 Inspired
96+
每个版本的详细更改记录在[发行说明](./CHANGELOG.zh-CN.md)
9797

98-
[links](./INSPIRED.zh-CN.md).
98+
## 💡 灵感
9999

100-
## License
100+
灵感来自源于以下[分享](./INSPIRED.zh-CN.md)
101101

102-
VCV is licensed under the terms of the [MIT License](./LICENSE)
102+
## 💳 License
103+
104+
`VCV` is licensed under the terms of the [MIT License](./LICENSE) .
103105

104106
Copyright (c) 2021-present Anduril
105107

build/md-loader/index.js renamed to build/markdown-loader/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
const { escapeBackticks } = require("./util");
2-
const md = require("./config");
2+
const md = require("../markdown");
33

44
module.exports = function (source) {
5-
const content = md.render(source);
5+
const content = md().render(source);
66
const startTag = "<!--vcv-demo:";
77
const startTagLen = startTag.length;
88
const endTag = ":vcv-demo-->";
@@ -60,7 +60,7 @@ module.exports = function (source) {
6060

6161
return `
6262
<template>
63-
<section class="markdown api-container">
63+
<section class="markdown-body">
6464
${output.join("")}
6565
</section>
6666
</template>
File renamed without changes.

0 commit comments

Comments
 (0)