Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update antdv v4 #27

Merged
merged 3 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ build.ts
esm
doc-site
public
package
package
22 changes: 19 additions & 3 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,38 @@
"prettyFormat": true
},
"parserOptions": {
"parser": "@typescript-eslint/parser",
"ecmaVersion": 10,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "markdown"],
"parser": "vue-eslint-parser",
"plugins": ["@typescript-eslint", "markdown", "import"],
"rules": {
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/consistent-type-imports": "warn",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/ban-ts-comment": "off",
"no-console": "error"
"@typescript-eslint/ban-types": "off",
"vue/multi-word-component-names": "off",
"no-console": "error",
"import/order": [
"error",
{
"pathGroups": [
{
"pattern": "@/**",
"group": "external"
}
],
"groups": ["external", "internal", "builtin", "parent", "sibling", "index", "object"]
}
]
},
"overrides": [
{
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
if: contains(github.event.head_commit.message, 'chore(versions)') == false
strategy:
matrix:
node_version: [10.x, 11.x]
node_version: [18.x]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v1
Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ lib/
esm/
temp_esm/
dist/
build/
coverage/
node_modules/
examples/test
Expand All @@ -26,4 +25,6 @@ package.zip
doc-site
.lerna-changelog
.history
.lint-report.log
.lint-report.log
.temp
.cache
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
registry="https://registry.npmmirror.com/"
sass_binary_site="https://registry.npmmirror.com/mirrors/node-sass/"
14 changes: 14 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
node_modules
lib
dist
build
coverage
expected
website
gh-pages
weex
build.ts
esm
doc-site
public
package
5 changes: 0 additions & 5 deletions .prettierrc.js

This file was deleted.

8 changes: 8 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://json.schemastore.org/prettierrc",
"semi": false,
"tabWidth": 2,
"singleQuote": true,
"printWidth": 100,
"trailingComma": "none"
}
1 change: 0 additions & 1 deletion .yarnrc

This file was deleted.

16 changes: 16 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = (api) => {
return {
presets: [
[
'@babel/preset-env',
{
useBuiltIns: false,
modules: api.env(['es']) ? false : api.env(['cjs']) ? 'commonjs' : 'auto'
}
],

'@babel/preset-typescript'
],
plugins: ['@babel/transform-runtime', '@vue/babel-plugin-jsx']
}
}
10 changes: 10 additions & 0 deletions docs/.vuepress/clientAppEnhance.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineClientAppEnhance } from '@vuepress/client'
import AntDesign from 'ant-design-vue'
import 'prismjs/themes/prism-tomorrow.css'
import DumiPreviewer from './components/dumi-previewer.vue'
import './styles/index.styl'

export default defineClientAppEnhance(({ app }) => {
app.use(AntDesign)
app.component('dumi-previewer', DumiPreviewer)
})
126 changes: 89 additions & 37 deletions docs/.vuepress/components/createCodeSandBox.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,60 @@
import { getParameters } from 'codesandbox/lib/api/define'

const CodeSandBoxHTML = '<div id="app"></div>'
const CodeSandBoxJS = `
import Vue from 'vue'
const CodeSandBoxJS = `import { createApp } from 'vue'
import App from './App.vue'
import "@formily/antdv/dist/antdv.css";
import "ant-design-vue/dist/antd.css";

Vue.config.productionTip = false
createApp(App).mount('#app')
`

new Vue({
render: h => h(App),
}).$mount('#app')`
const TsconfigContent = `{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"strict": true,
"jsx": "preserve",
"moduleResolution": "node",
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"useDefineForClassFields": true,
"sourceMap": true,
"noImplicitAny": false,
"baseUrl": ".",
"types": [
"webpack-env"
],
"paths": {
"@/*": [
"src/*"
]
},
"lib": [
"esnext",
"dom",
"dom.iterable",
"scripthost"
]
},
"include": [
"src/**/*.ts",
"src/**/*.tsx",
"src/**/*.vue",
"tests/**/*.ts",
"tests/**/*.tsx"
],
"exclude": [
"node_modules"
]
}
`
const ShimsVueContent = `declare module '*.vue' {
import type { DefineComponent } from 'vue'
const component: DefineComponent<{}, {}, any>
export default component
}
`

const createForm = ({ method, action, data }) => {
const form = document.createElement('form') // 构造 form
Expand Down Expand Up @@ -50,71 +93,80 @@ export function createCodeSandBox(codeStr) {
view: 'browser',
container: {
port: 8080,
node: '14',
},
},
node: '14'
}
}
},
'package.json': {
content: {
scripts: {
serve: 'vue-cli-service serve',
build: 'vue-cli-service build',
lint: 'vue-cli-service lint',
lint: 'vue-cli-service lint'
},
dependencies: {
'@formily/core': 'latest',
'@formily/vue': 'latest',
'@formily/antdv': 'latest',
axios: '^0.21.1',
'core-js': '^3.6.5',
'ant-design-vue': '^1.7.8',
'vue-demi': 'latest',
vue: '^2.6.11',
'core-js': '^3.8.3',
'ant-design-vue': '^3.2.6',
vue: '^3.2.37'
},
devDependencies: {
'@vue/cli-plugin-babel': '~4.5.0',
'@vue/cli-service': '~4.5.0',
'@vue/composition-api': 'latest',
'vue-template-compiler': '^2.6.11',
'@vue/cli-plugin-babel': '~5.0.0',
'@vue/cli-service': '~5.0.0',
'@vue/cli-plugin-typescript': '~5.0.0',
less: 'latest',
'less-loader': '^5.0.0',
'less-loader': 'latest',
typescript: '~4.5.5'
},
babel: {
presets: ['@vue/cli-plugin-babel/preset'],
presets: ['@vue/cli-plugin-babel/preset']
},
vue: {
devServer: {
headers: {
'Access-Control-Allow-Origin': '*'
},
host: '0.0.0.0',
disableHostCheck: true, // 必须
allowedHosts: 'all'
},
css: {
loaderOptions: {
less: {
javascriptEnabled: true,
},
},
},
},
},
lessOptions: {
javascriptEnabled: true
}
}
}
}
}
}
},
'src/App.vue': {
content: codeStr,
content: codeStr
},
'src/main.ts': {
content: CodeSandBoxJS
},
'src/main.js': {
content: CodeSandBoxJS,
'src/shims-vue.d.ts': {
content: ShimsVueContent
},
'public/index.html': {
content: CodeSandBoxHTML,
content: CodeSandBoxHTML
},
},
'tsconfig.json': {
content: TsconfigContent
}
}
})

createForm({
method: 'post',
action: 'https://codesandbox.io/api/v1/sandboxes/define',
data: {
parameters,
query: 'file=/src/App.vue',
},
query: 'file=/src/App.vue'
}
})
}
Loading
Loading