diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 83f8ac1e6..000000000 --- a/.eslintrc +++ /dev/null @@ -1,82 +0,0 @@ -{ - "root": true, - "env": { - "browser": true, - "node": true, - "jasmine": true, - "jest": true, - "es6": true - }, - "parser": "@typescript-eslint/parser", - "parserOptions": { - "parser": "babel-eslint" - }, - "extends": ["plugin:vue/vue3-recommended", "prettier"], - "plugins": ["markdown", "jest", "@typescript-eslint", "eslint-plugin-no-explicit-type-exports"], - "overrides": [ - { - "files": ["**/demo/*.md"], - "processor": "markdown/markdown", - "rules": { - "no-console": "off" - } - }, - { - "files": ["*.ts", "*.tsx"], - "extends": [ - "@vue/typescript/recommended", - "@vue/prettier", - "@vue/prettier/@typescript-eslint" - ], - "parserOptions": { - "project": "./tsconfig.json" - }, - "rules": { - "no-explicit-type-exports/no-explicit-type-exports": 2, - "@typescript-eslint/no-explicit-any": 0, - "@typescript-eslint/ban-types": 0, - "@typescript-eslint/consistent-type-imports": 1, - "@typescript-eslint/explicit-module-boundary-types": 0, - "@typescript-eslint/no-empty-function": 0, - "@typescript-eslint/no-non-null-assertion": 0, - "@typescript-eslint/no-unused-vars": [ - "error", - { "vars": "all", "args": "after-used", "ignoreRestSiblings": true } - ], - "@typescript-eslint/ban-ts-comment": 0 - } - } - ], - "rules": { - "comma-dangle": [2, "always-multiline"], - "no-var": "error", - "no-console": [2, { "allow": ["warn", "error"] }], - "object-shorthand": 2, - "no-unused-vars": [2, { "ignoreRestSiblings": true, "argsIgnorePattern": "^h$" }], - "no-undef": 2, - "camelcase": "off", - "no-extra-boolean-cast": "off", - "semi": ["error", "always"], - "vue/require-explicit-emits": "off", - "vue/require-prop-types": "off", - "vue/require-default-prop": "off", - "vue/no-reserved-keys": "off", - "vue/comment-directive": "off", - "vue/prop-name-casing": "off", - "vue/one-component-per-file": "off", - "vue/custom-event-name-casing": "off", - "vue/max-attributes-per-line": [ - 2, - { - "singleline": 20, - "multiline": { - "max": 1, - "allowFirstLine": false - } - } - ] - }, - "globals": { - "h": true - } -} diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 000000000..3c7e1c9d8 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,78 @@ +module.exports = { + root: true, + env: { + browser: true, + node: true, + jasmine: true, + jest: true, + es6: true, + }, + parser: '@typescript-eslint/parser', + parserOptions: { + parser: 'babel-eslint', + }, + extends: ['plugin:vue/vue3-recommended', 'prettier'], + plugins: ['markdown', 'jest', '@typescript-eslint', 'eslint-plugin-no-explicit-type-exports'], + overrides: [ + { + files: ['**/demo/*.md'], + processor: 'markdown/markdown', + rules: { + 'no-console': 'off', + }, + }, + { + files: ['*.ts', '*.tsx'], + extends: ['@vue/typescript/recommended', '@vue/prettier', '@vue/prettier/@typescript-eslint'], + parserOptions: { + project: './tsconfig.json', + }, + rules: { + 'no-explicit-type-exports/no-explicit-type-exports': 2, + '@typescript-eslint/no-explicit-any': 0, + '@typescript-eslint/ban-types': 0, + '@typescript-eslint/consistent-type-imports': 1, + '@typescript-eslint/explicit-module-boundary-types': 0, + '@typescript-eslint/no-empty-function': 0, + '@typescript-eslint/no-non-null-assertion': 0, + '@typescript-eslint/no-unused-vars': [ + 'error', + { vars: 'all', args: 'after-used', ignoreRestSiblings: true }, + ], + '@typescript-eslint/ban-ts-comment': 0, + }, + }, + ], + rules: { + 'comma-dangle': [2, 'always-multiline'], + 'no-var': 'error', + 'no-console': [2, { allow: ['warn', 'error'] }], + 'object-shorthand': 2, + 'no-unused-vars': [2, { ignoreRestSiblings: true, argsIgnorePattern: '^h$' }], + 'no-undef': 2, + camelcase: 'off', + 'no-extra-boolean-cast': 'off', + semi: ['error', 'always'], + 'vue/require-explicit-emits': 'off', + 'vue/require-prop-types': 'off', + 'vue/require-default-prop': 'off', + 'vue/no-reserved-keys': 'off', + 'vue/comment-directive': 'off', + 'vue/prop-name-casing': 'off', + 'vue/one-component-per-file': 'off', + 'vue/custom-event-name-casing': 'off', + 'vue/max-attributes-per-line': [ + 2, + { + singleline: 20, + multiline: { + max: 1, + allowFirstLine: false, + }, + }, + ], + }, + globals: { + h: true, + }, +}; diff --git a/package.json b/package.json index e057dc5e8..d85f27273 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,8 @@ "vetur" ], "scripts": { - "dev": "vite", + "debugger": "vite", + "dev": "vite serve site", "test": "cross-env NODE_ENV=test WORKFLOW=true jest --config .jest.js", "test:dev": "cross-env NODE_ENV=test jest --config .jest.js", "compile": "node antd-tools/cli/run.js compile", diff --git a/plugin/md/utils/tsToJs.ts b/plugin/md/utils/tsToJs.ts index b901939ed..b0ee312a3 100644 --- a/plugin/md/utils/tsToJs.ts +++ b/plugin/md/utils/tsToJs.ts @@ -1,8 +1,10 @@ import { transformSync } from '@babel/core'; import { CLIEngine } from 'eslint'; +import path from 'path'; const engine = new CLIEngine({ fix: true, useEslintrc: false, + baseConfig: require(path.join(process.cwd(), '.eslintrc.js')), }); const tsToJs = (content: string): string => { if (!content) { diff --git a/site/404.html b/site/404.html new file mode 100644 index 000000000..2687f6e43 --- /dev/null +++ b/site/404.html @@ -0,0 +1,97 @@ + + + + + + + + + + + Ant Design Vue + + + + + + +
+
+
+

404

+

你要找的页面不存在返回首页

+
+ +
+
+ + + + + diff --git a/site/index.html b/site/index.html new file mode 100644 index 000000000..58265e687 --- /dev/null +++ b/site/index.html @@ -0,0 +1,83 @@ + + + + + + + + + + + Ant Design Vue + + + + + + + +
+ + + + + + + + + diff --git a/site/public/docsearch.min.js b/site/public/docsearch.min.js new file mode 100644 index 000000000..efb45b8f6 --- /dev/null +++ b/site/public/docsearch.min.js @@ -0,0 +1,2 @@ +/*! docsearch 2.6.3 | © Algolia | github.com/algolia/docsearch */ +(function webpackUniversalModuleDefinition(root,factory){if(typeof exports==="object"&&typeof module==="object")module.exports=factory();else if(typeof define==="function"&&define.amd)define([],factory);else if(typeof exports==="object")exports["docsearch"]=factory();else root["docsearch"]=factory()})(typeof self!=="undefined"?self:this,function(){return function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId]){return installedModules[moduleId].exports}var module=installedModules[moduleId]={i:moduleId,l:false,exports:{}};modules[moduleId].call(module.exports,module,module.exports,__webpack_require__);module.l=true;return module.exports}__webpack_require__.m=modules;__webpack_require__.c=installedModules;__webpack_require__.d=function(exports,name,getter){if(!__webpack_require__.o(exports,name)){Object.defineProperty(exports,name,{configurable:false,enumerable:true,get:getter})}};__webpack_require__.n=function(module){var getter=module&&module.__esModule?function getDefault(){return module["default"]}:function getModuleExports(){return module};__webpack_require__.d(getter,"a",getter);return getter};__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)};__webpack_require__.p="";return __webpack_require__(__webpack_require__.s=22)}([function(module,exports,__webpack_require__){"use strict";var DOM=__webpack_require__(1);function escapeRegExp(str){return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}module.exports={isArray:null,isFunction:null,isObject:null,bind:null,each:null,map:null,mixin:null,isMsie:function(agentString){if(agentString===undefined){agentString=navigator.userAgent}if(/(msie|trident)/i.test(agentString)){var match=agentString.match(/(msie |rv:)(\d+(.\d+)?)/i);if(match){return match[2]}}return false},escapeRegExChars:function(str){return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isNumber:function(obj){return typeof obj==="number"},toStr:function toStr(s){return s===undefined||s===null?"":s+""},cloneDeep:function cloneDeep(obj){var clone=this.mixin({},obj);var self=this;this.each(clone,function(value,key){if(value){if(self.isArray(value)){clone[key]=[].concat(value)}else if(self.isObject(value)){clone[key]=self.cloneDeep(value)}}});return clone},error:function(msg){throw new Error(msg)},every:function(obj,test){var result=true;if(!obj){return result}this.each(obj,function(val,key){if(result){result=test.call(null,val,key,obj)&&result}});return!!result},any:function(obj,test){var found=false;if(!obj){return found}this.each(obj,function(val,key){if(test.call(null,val,key,obj)){found=true;return false}});return found},getUniqueId:function(){var counter=0;return function(){return counter++}}(),templatify:function templatify(obj){if(this.isFunction(obj)){return obj}var $template=DOM.element(obj);if($template.prop("tagName")==="SCRIPT"){return function template(){return $template.text()}}return function template(){return String(obj)}},defer:function(fn){setTimeout(fn,0)},noop:function(){},formatPrefix:function(prefix,noPrefix){return noPrefix?"":prefix+"-"},className:function(prefix,clazz,skipDot){return(skipDot?"":".")+prefix+clazz},escapeHighlightedString:function(str,highlightPreTag,highlightPostTag){highlightPreTag=highlightPreTag||"";var pre=document.createElement("div");pre.appendChild(document.createTextNode(highlightPreTag));highlightPostTag=highlightPostTag||"";var post=document.createElement("div");post.appendChild(document.createTextNode(highlightPostTag));var div=document.createElement("div");div.appendChild(document.createTextNode(str));return div.innerHTML.replace(RegExp(escapeRegExp(pre.innerHTML),"g"),highlightPreTag).replace(RegExp(escapeRegExp(post.innerHTML),"g"),highlightPostTag)}}},function(module,exports,__webpack_require__){"use strict";module.exports={element:null}},function(module,exports){var hasOwn=Object.prototype.hasOwnProperty;var toString=Object.prototype.toString;module.exports=function forEach(obj,fn,ctx){if(toString.call(fn)!=="[object Function]"){throw new TypeError("iterator must be a function")}var l=obj.length;if(l===+l){for(var i=0;i was loaded but did not call our provided callback"),JSONPScriptError:createCustomError("JSONPScriptError"," diff --git a/site/src/SymbolKey.ts b/site/src/SymbolKey.ts new file mode 100644 index 000000000..9d14bbefa --- /dev/null +++ b/site/src/SymbolKey.ts @@ -0,0 +1 @@ +export const GLOBAL_CONFIG = Symbol('globalConfig'); diff --git a/site/src/assets/ant-design-vue.svg b/site/src/assets/ant-design-vue.svg new file mode 100644 index 000000000..4fe899edc --- /dev/null +++ b/site/src/assets/ant-design-vue.svg @@ -0,0 +1,11 @@ + + + + Ant Design Vue Copy 5 + Created with Sketch. + + + + + + \ No newline at end of file diff --git a/site/src/assets/logo.png b/site/src/assets/logo.png new file mode 100644 index 000000000..f6305e2f8 Binary files /dev/null and b/site/src/assets/logo.png differ diff --git a/site/src/assets/logo.svg b/site/src/assets/logo.svg new file mode 100644 index 000000000..dbfcee7e5 --- /dev/null +++ b/site/src/assets/logo.svg @@ -0,0 +1,29 @@ + + + + Vue + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/site/src/components/DemoBox.vue b/site/src/components/DemoBox.vue new file mode 100644 index 000000000..ed77a8b52 --- /dev/null +++ b/site/src/components/DemoBox.vue @@ -0,0 +1,214 @@ +