mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-18 12:34:25 +08:00
chore: try to rollup project, not finished
This commit is contained in:
parent
ece6a4ea44
commit
222060df98
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,6 +3,7 @@ dist
|
||||
docDist
|
||||
doc/dist
|
||||
test-size
|
||||
test-bundle
|
||||
test/unit/coverage
|
||||
package-lock.json
|
||||
yarn.lock
|
||||
|
@ -1,6 +1,6 @@
|
||||
module.exports = {
|
||||
'plugins': ['transform-vue-jsx'],
|
||||
'presets': ['@babel/preset-env'],
|
||||
plugins: ['transform-vue-jsx'],
|
||||
presets: ['@babel/preset-env'],
|
||||
env: {
|
||||
test: {
|
||||
plugins: ['istanbul']
|
||||
|
2
build/buildjs.js
Normal file
2
build/buildjs.js
Normal file
@ -0,0 +1,2 @@
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
@ -25,11 +25,11 @@
|
||||
"registry": "***REMOVED***"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/cli": "^7.7.7",
|
||||
"@babel/cli": "^7.8.0",
|
||||
"@babel/core": "^7.7.7",
|
||||
"@babel/preset-env": "^7.7.7",
|
||||
"@kazupon/vue-i18n-loader": "^0.4.1",
|
||||
"@rollup/plugin-node-resolve": "^6.0.0",
|
||||
"@rollup/plugin-node-resolve": "^6.1.0",
|
||||
"@rollup/plugin-strip": "^1.3.1",
|
||||
"@vue/babel-helper-vue-jsx-merge-props": "^1.0.0",
|
||||
"@vue/babel-preset-app": "^3.12.1",
|
||||
@ -84,6 +84,7 @@
|
||||
"progress-bar-webpack-plugin": "^1.12.1",
|
||||
"regenerator-runtime": "^0.13.3",
|
||||
"rollup": "^1.27.14",
|
||||
"rollup-plugin-scss": "^2.1.0",
|
||||
"rollup-plugin-terser": "^5.1.3",
|
||||
"rollup-plugin-vue": "^5.1.4",
|
||||
"schema-utils": "^1.0.0",
|
||||
|
@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#EF9645" d="M15.5 2.965c1.381 0 2.5 1.119 2.5 2.5v.005L20.5.465c1.381 0 2.5 1.119 2.5 2.5V4.25l2.5-1.535c1.381 0 2.5 1.119 2.5 2.5V8.75L29 18H15.458L15.5 2.965z"/><path fill="#FFDC5D" d="M4.625 16.219c1.381-.611 3.354.208 4.75 2.188.917 1.3 1.187 3.151 2.391 3.344.46.073 1.234-.313 1.234-1.397V4.5s0-2 2-2 2 2 2 2v11.633c0-.029 1-.064 1-.082V2s0-2 2-2 2 2 2 2v14.053c0 .017 1 .041 1 .069V4.25s0-2 2-2 2 2 2 2v12.638c0 .118 1 .251 1 .398V8.75s0-2 2-2 2 2 2 2V24c0 6.627-5.373 12-12 12-4.775 0-8.06-2.598-9.896-5.292C8.547 28.423 8.096 26.051 8 25.334c0 0-.123-1.479-1.156-2.865-1.469-1.969-2.5-3.156-3.125-3.866-.317-.359-.625-1.707.906-2.384z"/></svg>
|
Before Width: | Height: | Size: 724 B |
3
packages/common/Result/src/403.vue
Normal file
3
packages/common/Result/src/403.vue
Normal file
@ -0,0 +1,3 @@
|
||||
<template>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#EF9645" d="M15.5 2.965c1.381 0 2.5 1.119 2.5 2.5v.005L20.5.465c1.381 0 2.5 1.119 2.5 2.5V4.25l2.5-1.535c1.381 0 2.5 1.119 2.5 2.5V8.75L29 18H15.458L15.5 2.965z" /><path fill="#FFDC5D" d="M4.625 16.219c1.381-.611 3.354.208 4.75 2.188.917 1.3 1.187 3.151 2.391 3.344.46.073 1.234-.313 1.234-1.397V4.5s0-2 2-2 2 2 2 2v11.633c0-.029 1-.064 1-.082V2s0-2 2-2 2 2 2 2v14.053c0 .017 1 .041 1 .069V4.25s0-2 2-2 2 2 2 2v12.638c0 .118 1 .251 1 .398V8.75s0-2 2-2 2 2 2 2V24c0 6.627-5.373 12-12 12-4.775 0-8.06-2.598-9.896-5.292C8.547 28.423 8.096 26.051 8 25.334c0 0-.123-1.479-1.156-2.865-1.469-1.969-2.5-3.156-3.125-3.866-.317-.359-.625-1.707.906-2.384z" /></svg>
|
||||
</template>
|
@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><circle fill="#FFCB4C" cx="18" cy="17.018" r="17"/><path fill="#65471B" d="M14.524 21.036c-.145-.116-.258-.274-.312-.464-.134-.46.13-.918.59-1.021 4.528-1.021 7.577 1.363 7.706 1.465.384.306.459.845.173 1.205-.286.358-.828.401-1.211.097-.11-.084-2.523-1.923-6.182-1.098-.274.061-.554-.016-.764-.184z"/><ellipse fill="#65471B" cx="13.119" cy="11.174" rx="2.125" ry="2.656"/><ellipse fill="#65471B" cx="24.375" cy="12.236" rx="2.125" ry="2.656"/><path fill="#F19020" d="M17.276 35.149s1.265-.411 1.429-1.352c.173-.972-.624-1.167-.624-1.167s1.041-.208 1.172-1.376c.123-1.101-.861-1.363-.861-1.363s.97-.4 1.016-1.539c.038-.959-.995-1.428-.995-1.428s5.038-1.221 5.556-1.341c.516-.12 1.32-.615 1.069-1.694-.249-1.08-1.204-1.118-1.697-1.003-.494.115-6.744 1.566-8.9 2.068l-1.439.334c-.54.127-.785-.11-.404-.512.508-.536.833-1.129.946-2.113.119-1.035-.232-2.313-.433-2.809-.374-.921-1.005-1.649-1.734-1.899-1.137-.39-1.945.321-1.542 1.561.604 1.854.208 3.375-.833 4.293-2.449 2.157-3.588 3.695-2.83 6.973.828 3.575 4.377 5.876 7.952 5.048l3.152-.681z"/><path fill="#65471B" d="M9.296 6.351c-.164-.088-.303-.224-.391-.399-.216-.428-.04-.927.393-1.112 4.266-1.831 7.699-.043 7.843.034.433.231.608.747.391 1.154-.216.405-.74.546-1.173.318-.123-.063-2.832-1.432-6.278.047-.257.109-.547.085-.785-.042zm12.135 3.75c-.156-.098-.286-.243-.362-.424-.187-.442.023-.927.468-1.084 4.381-1.536 7.685.48 7.823.567.415.26.555.787.312 1.178-.242.39-.776.495-1.191.238-.12-.072-2.727-1.621-6.267-.379-.266.091-.553.046-.783-.096z"/></svg>
|
Before Width: | Height: | Size: 1.5 KiB |
1
packages/common/Result/src/404.vue
Normal file
1
packages/common/Result/src/404.vue
Normal file
@ -0,0 +1 @@
|
||||
<template><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><circle fill="#FFCB4C" cx="18" cy="17.018" r="17" /><path fill="#65471B" d="M14.524 21.036c-.145-.116-.258-.274-.312-.464-.134-.46.13-.918.59-1.021 4.528-1.021 7.577 1.363 7.706 1.465.384.306.459.845.173 1.205-.286.358-.828.401-1.211.097-.11-.084-2.523-1.923-6.182-1.098-.274.061-.554-.016-.764-.184z" /><ellipse fill="#65471B" cx="13.119" cy="11.174" rx="2.125" ry="2.656" /><ellipse fill="#65471B" cx="24.375" cy="12.236" rx="2.125" ry="2.656" /><path fill="#F19020" d="M17.276 35.149s1.265-.411 1.429-1.352c.173-.972-.624-1.167-.624-1.167s1.041-.208 1.172-1.376c.123-1.101-.861-1.363-.861-1.363s.97-.4 1.016-1.539c.038-.959-.995-1.428-.995-1.428s5.038-1.221 5.556-1.341c.516-.12 1.32-.615 1.069-1.694-.249-1.08-1.204-1.118-1.697-1.003-.494.115-6.744 1.566-8.9 2.068l-1.439.334c-.54.127-.785-.11-.404-.512.508-.536.833-1.129.946-2.113.119-1.035-.232-2.313-.433-2.809-.374-.921-1.005-1.649-1.734-1.899-1.137-.39-1.945.321-1.542 1.561.604 1.854.208 3.375-.833 4.293-2.449 2.157-3.588 3.695-2.83 6.973.828 3.575 4.377 5.876 7.952 5.048l3.152-.681z" /><path fill="#65471B" d="M9.296 6.351c-.164-.088-.303-.224-.391-.399-.216-.428-.04-.927.393-1.112 4.266-1.831 7.699-.043 7.843.034.433.231.608.747.391 1.154-.216.405-.74.546-1.173.318-.123-.063-2.832-1.432-6.278.047-.257.109-.547.085-.785-.042zm12.135 3.75c-.156-.098-.286-.243-.362-.424-.187-.442.023-.927.468-1.084 4.381-1.536 7.685.48 7.823.567.415.26.555.787.312 1.178-.242.39-.776.495-1.191.238-.12-.072-2.727-1.621-6.267-.379-.266.091-.553.046-.783-.096z" /></svg></template>
|
@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><ellipse fill="#292F33" cx="18" cy="26" rx="18" ry="10"/><ellipse fill="#66757F" cx="18" cy="24" rx="18" ry="10"/><path fill="#E1E8ED" d="M18 31C3.042 31 1 16 1 12h34c0 2-1.958 19-17 19z"/><path fill="#77B255" d="M35 12.056c0 5.216-7.611 9.444-17 9.444S1 17.271 1 12.056C1 6.84 8.611 3.611 18 3.611s17 3.229 17 8.445z"/><ellipse fill="#A6D388" cx="18" cy="13" rx="15" ry="7"/><path d="M21 17c-.256 0-.512-.098-.707-.293-2.337-2.337-2.376-4.885-.125-8.262.739-1.109.9-2.246.478-3.377-.461-1.236-1.438-1.996-1.731-2.077-.553 0-.958-.443-.958-.996 0-.552.491-.995 1.043-.995.997 0 2.395 1.153 3.183 2.625 1.034 1.933.91 4.039-.351 5.929-1.961 2.942-1.531 4.332-.125 5.738.391.391.391 1.023 0 1.414-.195.196-.451.294-.707.294zm-6-2c-.256 0-.512-.098-.707-.293-2.337-2.337-2.376-4.885-.125-8.262.727-1.091.893-2.083.494-2.947-.444-.961-1.431-1.469-1.684-1.499-.552 0-.989-.447-.989-1 0-.552.458-1 1.011-1 .997 0 2.585.974 3.36 2.423.481.899 1.052 2.761-.528 5.131-1.961 2.942-1.531 4.332-.125 5.738.391.391.391 1.023 0 1.414-.195.197-.451.295-.707.295z" fill="#5C913B"/></svg>
|
Before Width: | Height: | Size: 1.1 KiB |
3
packages/common/Result/src/418.vue
Normal file
3
packages/common/Result/src/418.vue
Normal file
@ -0,0 +1,3 @@
|
||||
<template>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><ellipse fill="#292F33" cx="18" cy="26" rx="18" ry="10" /><ellipse fill="#66757F" cx="18" cy="24" rx="18" ry="10" /><path fill="#E1E8ED" d="M18 31C3.042 31 1 16 1 12h34c0 2-1.958 19-17 19z" /><path fill="#77B255" d="M35 12.056c0 5.216-7.611 9.444-17 9.444S1 17.271 1 12.056C1 6.84 8.611 3.611 18 3.611s17 3.229 17 8.445z" /><ellipse fill="#A6D388" cx="18" cy="13" rx="15" ry="7" /><path d="M21 17c-.256 0-.512-.098-.707-.293-2.337-2.337-2.376-4.885-.125-8.262.739-1.109.9-2.246.478-3.377-.461-1.236-1.438-1.996-1.731-2.077-.553 0-.958-.443-.958-.996 0-.552.491-.995 1.043-.995.997 0 2.395 1.153 3.183 2.625 1.034 1.933.91 4.039-.351 5.929-1.961 2.942-1.531 4.332-.125 5.738.391.391.391 1.023 0 1.414-.195.196-.451.294-.707.294zm-6-2c-.256 0-.512-.098-.707-.293-2.337-2.337-2.376-4.885-.125-8.262.727-1.091.893-2.083.494-2.947-.444-.961-1.431-1.469-1.684-1.499-.552 0-.989-.447-.989-1 0-.552.458-1 1.011-1 .997 0 2.585.974 3.36 2.423.481.899 1.052 2.761-.528 5.131-1.961 2.942-1.531 4.332-.125 5.738.391.391.391 1.023 0 1.414-.195.197-.451.295-.707.295z" fill="#5C913B" /></svg>
|
||||
</template>
|
@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#FFCC4D" d="M36 18c0 9.941-8.059 18-18 18-9.94 0-18-8.059-18-18C0 8.06 8.06 0 18 0c9.941 0 18 8.06 18 18"/><ellipse fill="#664500" cx="18" cy="27" rx="5" ry="6"/><path fill="#664500" d="M5.999 11c-.208 0-.419-.065-.599-.2-.442-.331-.531-.958-.2-1.4C8.462 5.05 12.816 5 13 5c.552 0 1 .448 1 1 0 .551-.445.998-.996 1-.155.002-3.568.086-6.204 3.6-.196.262-.497.4-.801.4zm24.002 0c-.305 0-.604-.138-.801-.4-2.64-3.521-6.061-3.598-6.206-3.6-.55-.006-.994-.456-.991-1.005C22.006 5.444 22.45 5 23 5c.184 0 4.537.05 7.8 4.4.332.442.242 1.069-.2 1.4-.18.135-.39.2-.599.2zm-16.087 4.5l1.793-1.793c.391-.391.391-1.023 0-1.414s-1.023-.391-1.414 0L12.5 14.086l-1.793-1.793c-.391-.391-1.023-.391-1.414 0s-.391 1.023 0 1.414l1.793 1.793-1.793 1.793c-.391.391-.391 1.023 0 1.414.195.195.451.293.707.293s.512-.098.707-.293l1.793-1.793 1.793 1.793c.195.195.451.293.707.293s.512-.098.707-.293c.391-.391.391-1.023 0-1.414L13.914 15.5zm11 0l1.793-1.793c.391-.391.391-1.023 0-1.414s-1.023-.391-1.414 0L23.5 14.086l-1.793-1.793c-.391-.391-1.023-.391-1.414 0s-.391 1.023 0 1.414l1.793 1.793-1.793 1.793c-.391.391-.391 1.023 0 1.414.195.195.451.293.707.293s.512-.098.707-.293l1.793-1.793 1.793 1.793c.195.195.451.293.707.293s.512-.098.707-.293c.391-.391.391-1.023 0-1.414L24.914 15.5z"/></svg>
|
Before Width: | Height: | Size: 1.3 KiB |
3
packages/common/Result/src/500.vue
Normal file
3
packages/common/Result/src/500.vue
Normal file
@ -0,0 +1,3 @@
|
||||
<template>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#FFCC4D" d="M36 18c0 9.941-8.059 18-18 18-9.94 0-18-8.059-18-18C0 8.06 8.06 0 18 0c9.941 0 18 8.06 18 18" /><ellipse fill="#664500" cx="18" cy="27" rx="5" ry="6" /><path fill="#664500" d="M5.999 11c-.208 0-.419-.065-.599-.2-.442-.331-.531-.958-.2-1.4C8.462 5.05 12.816 5 13 5c.552 0 1 .448 1 1 0 .551-.445.998-.996 1-.155.002-3.568.086-6.204 3.6-.196.262-.497.4-.801.4zm24.002 0c-.305 0-.604-.138-.801-.4-2.64-3.521-6.061-3.598-6.206-3.6-.55-.006-.994-.456-.991-1.005C22.006 5.444 22.45 5 23 5c.184 0 4.537.05 7.8 4.4.332.442.242 1.069-.2 1.4-.18.135-.39.2-.599.2zm-16.087 4.5l1.793-1.793c.391-.391.391-1.023 0-1.414s-1.023-.391-1.414 0L12.5 14.086l-1.793-1.793c-.391-.391-1.023-.391-1.414 0s-.391 1.023 0 1.414l1.793 1.793-1.793 1.793c-.391.391-.391 1.023 0 1.414.195.195.451.293.707.293s.512-.098.707-.293l1.793-1.793 1.793 1.793c.195.195.451.293.707.293s.512-.098.707-.293c.391-.391.391-1.023 0-1.414L13.914 15.5zm11 0l1.793-1.793c.391-.391.391-1.023 0-1.414s-1.023-.391-1.414 0L23.5 14.086l-1.793-1.793c-.391-.391-1.023-.391-1.414 0s-.391 1.023 0 1.414l1.793 1.793-1.793 1.793c-.391.391-.391 1.023 0 1.414.195.195.451.293.707.293s.512-.098.707-.293l1.793-1.793 1.793 1.793c.195.195.451.293.707.293s.512-.098.707-.293c.391-.391.391-1.023 0-1.414L24.914 15.5z" /></svg>
|
||||
</template>
|
@ -7,10 +7,10 @@
|
||||
}"
|
||||
>
|
||||
<div class="n-result-icon">
|
||||
<img v-if="status === 404 || status === '404'" class="n-result-icon__status-image" src="./404.svg">
|
||||
<img v-else-if="status === 403 || status === '403'" class="n-result-icon__status-image" src="./403.svg">
|
||||
<img v-else-if="status === 500 || status === '500'" class="n-result-icon__status-image" src="./500.svg">
|
||||
<img v-else-if="status === 481 || status === '418'" class="n-result-icon__status-image" src="./418.svg">
|
||||
<image-404 v-if="status === 404 || status === '404'" class="n-result-icon__status-image" />
|
||||
<image-403 v-else-if="status === 403 || status === '403'" class="n-result-icon__status-image" />
|
||||
<image-500 v-else-if="status === 500 || status === '500'" class="n-result-icon__status-image" />
|
||||
<image-418 v-else-if="status === 481 || status === '418'" class="n-result-icon__status-image" />
|
||||
<n-icon v-else-if="status === 'success'" size="80">
|
||||
<ios-checkmark-circle />
|
||||
</n-icon>
|
||||
@ -49,6 +49,10 @@ import iosAlert from '../../../icons/ios-alert'
|
||||
import iosInformationCircle from '../../../icons/ios-information-circle'
|
||||
import iosCloseCircle from '../../../icons/ios-close-circle'
|
||||
import NIcon from '../../Icon'
|
||||
import image404 from './404.vue'
|
||||
import image500 from './500.vue'
|
||||
import image418 from './418.vue'
|
||||
import image403 from './403.vue'
|
||||
|
||||
export default {
|
||||
name: 'NResult',
|
||||
@ -57,7 +61,11 @@ export default {
|
||||
iosAlert,
|
||||
iosInformationCircle,
|
||||
iosCloseCircle,
|
||||
NIcon
|
||||
NIcon,
|
||||
image404,
|
||||
image403,
|
||||
image418,
|
||||
image500
|
||||
},
|
||||
mixins: [ withapp, themeable ],
|
||||
props: {
|
||||
|
17
playground/naiveScssVarPlugin.js
Normal file
17
playground/naiveScssVarPlugin.js
Normal file
@ -0,0 +1,17 @@
|
||||
module.exports = function naiveSCSSExportVariable () {
|
||||
return {
|
||||
name: 'naive-scss-export-variable',
|
||||
resolveId (source) {
|
||||
if (source.endsWith('jsIndex.scss')) {
|
||||
return 'naive-scss-js-index'
|
||||
}
|
||||
return null
|
||||
},
|
||||
load (id) {
|
||||
if (id === 'naive-scss-js-index') {
|
||||
return `export default 'naive-scss-js-index'`
|
||||
}
|
||||
return null
|
||||
}
|
||||
}
|
||||
}
|
@ -3,17 +3,21 @@ const resolve = require('@rollup/plugin-node-resolve')
|
||||
const strip = require('@rollup/plugin-strip')
|
||||
const path = require('path')
|
||||
const { terser } = require('rollup-plugin-terser')
|
||||
const naiveSCSSVariable = require('./playground/naiveScssVarPlugin')
|
||||
|
||||
module.exports = {
|
||||
input: 'packages/common/Select/index.js',
|
||||
preserveModules: true,
|
||||
input: 'index.js',
|
||||
output: {
|
||||
format: 'esm',
|
||||
file: 'lib/select/index.js'
|
||||
dir: 'test-bundle'
|
||||
},
|
||||
plugins: [
|
||||
vue(),
|
||||
naiveSCSSVariable(),
|
||||
strip(),
|
||||
resolve({
|
||||
extensions: ['.js', '.json', '.vue'],
|
||||
jail: path.resolve(__dirname, 'packages')
|
||||
}),
|
||||
terser({
|
||||
|
Loading…
Reference in New Issue
Block a user