Skip to content

Commit

Permalink
Merge branch 'website' of https://github.com/mpx-ecology/vuese into w…
Browse files Browse the repository at this point in the history
…ebsite
  • Loading branch information
1Telescope1 committed Jun 21, 2024
2 parents 77f6789 + b4173cb commit 79b092a
Show file tree
Hide file tree
Showing 7 changed files with 108 additions and 41 deletions.
Binary file removed .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ test-website
yarn.lock
packages/parser/lib/example.ts
.vscode/launch.json
.DS_Store
packages/demo
demo/docs/.vitepress/cache
7 changes: 1 addition & 6 deletions demo/docs/.vitepress/theme/components/Preview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
<script setup>
import { throttle } from 'lodash'
import { EXAMPLE_DOC_PORT } from '../../../../../config/index'
import iphoneXImage from '../../public/images/iphoneX.png'
import { useData } from 'vitepress'
import { ref, onMounted, computed, watch, onUnmounted } from 'vue'
import { useRouter, useRoute } from 'vitepress'
Expand Down Expand Up @@ -248,10 +247,6 @@ const syncChildPath = to => {
)
}
onMounted(() => {
containerRef.value.style.setProperty(
'--iphoneX-image',
`url(${iphoneXImage})`
)
componentName = getComponentName(top.location.href)
handleResize()
calcPreviewerPosition()
Expand Down Expand Up @@ -292,7 +287,7 @@ onUnmounted(() => {
background-color #fff
border-radius 20px 20px 100px 100px
// box-shadow 0 8px 12px #ebedf0
background var(--iphoneX-image) no-repeat center 0
background url(https://dpubstatic.udache.com/static/dpubimg/mTIQh7C_y7ah3bMFu0guA_iphoneX.png) no-repeat center 0
background-size 100%
padding 25px
padding-top 54px
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"markdown-toc": "^1.2.0",
"prettier": "^1.14.3",
"rollup": "2",
"rollup-plugin-copy": "^3.5.0",
"rollup-plugin-typescript2": "^0.36.0",
"ts-jest": "^23.10.1",
"typescript": "^5.2.2"
Expand Down
27 changes: 19 additions & 8 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const path = require('path')
const typescript = require('rollup-plugin-typescript2')
const isBuiltinModule = require('is-builtin-module')
const copy = require('rollup-plugin-copy')
function resolveInput(projectDir) {
return path.resolve('packages', `${projectDir}/lib/index.ts`)
}
Expand All @@ -12,6 +13,23 @@ function resolveOutput(projectDir) {
const PKG_DIR = process.env.PKG_DIR
const pkgMeta = require(path.resolve(`packages`, `${PKG_DIR}/package.json`))

const plugins = [
// resolve(),
// commonjs(),
// pluginJson(),
typescript({
tsconfig: `packages/${PKG_DIR}/tsconfig.json`
})
]
if (PKG_DIR === 'website') {
plugins.push(
copy({
targets: [
{ src: 'packages/website/theme', dest: 'packages/website/dist' }
],
})
)
}
module.exports = {
input: resolveInput(PKG_DIR),
external(id) {
Expand All @@ -22,14 +40,7 @@ module.exports = {
id === 'typedoc'
)
},
plugins: [
// resolve(),
// commonjs(),
// pluginJson(),
typescript({
tsconfig: `packages/${PKG_DIR}/tsconfig.json`
})
],
plugins,
output: {
file: resolveOutput(PKG_DIR),
format: 'cjs',
Expand Down
27 changes: 10 additions & 17 deletions scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,11 @@ function logger(msg) {
return console.log(chalk.blue(chalk.bold(msg)))
}

async function makeBuild() {
// let files = await fs.readdir(packagesDir)
// let files = ['parser', 'markdown-render']
let files = ['website']
files = files.filter(pkgDirName => {
const pkgDir = resolve(packagesDir, pkgDirName)
const stat = fs.statSync(pkgDir)
const isPkg = stat.isDirectory()
if (!isPkg) return false
return isBuildAll ? true : buildTargets.includes(pkgDirName)
})
if (!files.length) {
logger(`No matching build targets: ${buildTargets.join(',')}`)
return
}
logger(`Start building, Targets: ${files.join(',')}`)
function makeBuild() {
const files = ['parser', 'markdown-render']

files.forEach(async pkgDirName => {
const build = async pkgDirName => {
logger(`Start building, Targets: ${pkgDirName}`)
const pkgDir = resolve(packagesDir, pkgDirName)
const pkgMeta = require(`${pkgDir}/package.json`)
if (pkgMeta.private) return
Expand All @@ -50,6 +37,12 @@ async function makeBuild() {
if (pkgDirName === 'cli') {
await fs.copy(`${pkgDir}/lib/templates`, `${pkgDir}/dist/templates`)
}
}

Promise.all(
files.map(item => build(item))
).then(() => {
build('website')
})
}

Expand Down
86 changes: 76 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1674,6 +1674,13 @@
resolved "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4"
integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==

"@types/fs-extra@^8.0.1":
version "8.1.5"
resolved "http://artifactory.intra.xiaojukeji.com/artifactory/api/npm/npm/@types/fs-extra/-/fs-extra-8.1.5.tgz?dl=https%3A%2F%2Fregistry.npmmirror.com%2F%40types%2Ffs-extra%2F-%2Ffs-extra-8.1.5.tgz#33aae2962d3b3ec9219b5aca2555ee00274f5927"
integrity sha512-0dzKcwO+S8s2kuF5Z9oUWatQJj5Uq/iqphEtE3GQJVRRYm/tD1LglU2UnXi2A8jLq5umkGouOXOR9y0n613ZwQ==
dependencies:
"@types/node" "*"

"@types/fs-extra@^8.1.0":
version "8.1.0"
resolved "https://registry.npm.taobao.org/@types/fs-extra/download/@types/fs-extra-8.1.0.tgz#1114834b53c3914806cd03b3304b37b3bd221a4d"
Expand All @@ -1689,6 +1696,14 @@
"@types/minimatch" "*"
"@types/node" "*"

"@types/glob@^7.1.1":
version "7.2.0"
resolved "http://artifactory.intra.xiaojukeji.com/artifactory/api/npm/npm/@types/glob/-/glob-7.2.0.tgz?dl=https%3A%2F%2Fregistry.npmmirror.com%2F%40types%2Fglob%2F-%2Fglob-7.2.0.tgz#bc1b5bf3aa92f25bd5dd39f35c57361bdce5b2eb"
integrity sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==
dependencies:
"@types/minimatch" "*"
"@types/node" "*"

"@types/istanbul-lib-coverage@*":
version "2.0.3"
resolved "https://registry.npm.taobao.org/@types/istanbul-lib-coverage/download/@types/istanbul-lib-coverage-2.0.3.tgz#4ba8ddb720221f432e443bd5f9117fd22cfd4762"
Expand Down Expand Up @@ -2954,6 +2969,11 @@ color-name@~1.1.4:
resolved "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
integrity sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=

colorette@^1.1.0:
version "1.4.0"
resolved "http://artifactory.intra.xiaojukeji.com/artifactory/api/npm/npm/colorette/-/colorette-1.4.0.tgz?dl=https%3A%2F%2Fregistry.npmmirror.com%2Fcolorette%2F-%2Fcolorette-1.4.0.tgz#5190fbb87276259a86ad700bff2c6d6faa3fca40"
integrity sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==

columnify@^1.5.4:
version "1.5.4"
resolved "https://registry.npmjs.org/columnify/-/columnify-1.5.4.tgz#4737ddf1c7b69a8a7c340570782e947eec8e78bb"
Expand Down Expand Up @@ -4025,6 +4045,17 @@ fast-glob@^2.0.2:
merge2 "^1.2.3"
micromatch "^3.1.10"

fast-glob@^3.0.3:
version "3.3.2"
resolved "http://artifactory.intra.xiaojukeji.com/artifactory/api/npm/npm/fast-glob/-/fast-glob-3.3.2.tgz?dl=https%3A%2F%2Fregistry.npmmirror.com%2Ffast-glob%2F-%2Ffast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129"
integrity sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==
dependencies:
"@nodelib/fs.stat" "^2.0.2"
"@nodelib/fs.walk" "^1.2.3"
glob-parent "^5.1.2"
merge2 "^1.3.0"
micromatch "^4.0.4"

fast-glob@^3.2.9:
version "3.3.1"
resolved "http://artifactory.intra.xiaojukeji.com/artifactory/api/npm/npm/fast-glob/-/fast-glob-3.3.1.tgz?dl=https%3A%2F%2Fregistry.npmmirror.com%2Ffast-glob%2F-%2Ffast-glob-3.3.1.tgz#784b4e897340f3dbbef17413b3f11acf03c874c4"
Expand Down Expand Up @@ -4266,6 +4297,15 @@ fs-extra@^7.0.0, fs-extra@^7.0.1:
jsonfile "^4.0.0"
universalify "^0.1.0"

fs-extra@^8.1.0:
version "8.1.0"
resolved "http://artifactory.intra.xiaojukeji.com/artifactory/api/npm/npm/fs-extra/-/fs-extra-8.1.0.tgz?dl=https%3A%2F%2Fregistry.npmmirror.com%2Ffs-extra%2F-%2Ffs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0"
integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==
dependencies:
graceful-fs "^4.2.0"
jsonfile "^4.0.0"
universalify "^0.1.0"

fs-minipass@^1.2.5:
version "1.2.5"
resolved "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d"
Expand Down Expand Up @@ -4572,6 +4612,20 @@ globals@^13.19.0:
dependencies:
type-fest "^0.20.2"

globby@10.0.1:
version "10.0.1"
resolved "http://artifactory.intra.xiaojukeji.com/artifactory/api/npm/npm/globby/-/globby-10.0.1.tgz?dl=https%3A%2F%2Fregistry.npmmirror.com%2Fglobby%2F-%2Fglobby-10.0.1.tgz#4782c34cb75dd683351335c5829cc3420e606b22"
integrity sha512-sSs4inE1FB2YQiymcmTv6NWENryABjUNPeWhOvmn4SjtKybglsyPZxFB3U1/+L1bYi0rNZDqCLlHyLYDl1Pq5A==
dependencies:
"@types/glob" "^7.1.1"
array-union "^2.1.0"
dir-glob "^3.0.1"
fast-glob "^3.0.3"
glob "^7.1.3"
ignore "^5.1.1"
merge2 "^1.2.3"
slash "^3.0.0"

globby@^11.1.0:
version "11.1.0"
resolved "http://artifactory.intra.xiaojukeji.com/artifactory/api/npm/npm/globby/-/globby-11.1.0.tgz?dl=https%3A%2F%2Fregistry.npmmirror.com%2Fglobby%2F-%2Fglobby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b"
Expand Down Expand Up @@ -4832,6 +4886,11 @@ ignore@^3.3.5:
resolved "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043"
integrity sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==

ignore@^5.1.1:
version "5.3.1"
resolved "http://artifactory.intra.xiaojukeji.com/artifactory/api/npm/npm/ignore/-/ignore-5.3.1.tgz?dl=https%3A%2F%2Fregistry.npmmirror.com%2Fignore%2F-%2Fignore-5.3.1.tgz#5073e554cd42c5b33b394375f538b8593e34d4ef"
integrity sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==

ignore@^5.2.0, ignore@^5.2.4:
version "5.2.4"
resolved "http://artifactory.intra.xiaojukeji.com/artifactory/api/npm/npm/ignore/-/ignore-5.2.4.tgz?dl=https%3A%2F%2Fregistry.npmmirror.com%2Fignore%2F-%2Fignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324"
Expand Down Expand Up @@ -5265,6 +5324,11 @@ is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4:
dependencies:
isobject "^3.0.1"

is-plain-object@^3.0.0:
version "3.0.1"
resolved "http://artifactory.intra.xiaojukeji.com/artifactory/api/npm/npm/is-plain-object/-/is-plain-object-3.0.1.tgz?dl=https%3A%2F%2Fregistry.npmmirror.com%2Fis-plain-object%2F-%2Fis-plain-object-3.0.1.tgz#662d92d24c0aa4302407b0d45d21f2251c85f85b"
integrity sha512-Xnpx182SBMrr/aBik8y+GuR4U1L9FqMSojwDQwPMmxyC6bvEqly9UBCxhauBF5vNh2gwWJNX6oDV7O+OM4z34g==

is-promise@^2.1.0:
version "2.1.0"
resolved "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa"
Expand Down Expand Up @@ -8116,6 +8180,17 @@ rimraf@^3.0.2:
dependencies:
glob "^7.1.3"

rollup-plugin-copy@^3.5.0:
version "3.5.0"
resolved "http://artifactory.intra.xiaojukeji.com/artifactory/api/npm/npm/rollup-plugin-copy/-/rollup-plugin-copy-3.5.0.tgz?dl=https%3A%2F%2Fregistry.npmmirror.com%2Frollup-plugin-copy%2F-%2Frollup-plugin-copy-3.5.0.tgz#7ffa2a7a8303e143876fa64fb5eed9022d304eeb"
integrity sha512-wI8D5dvYovRMx/YYKtUNt3Yxaw4ORC9xo6Gt9t22kveWz1enG9QrhVlagzwrxSC455xD1dHMKhIJkbsQ7d48BA==
dependencies:
"@types/fs-extra" "^8.0.1"
colorette "^1.1.0"
fs-extra "^8.1.0"
globby "10.0.1"
is-plain-object "^3.0.0"

rollup-plugin-typescript2@^0.36.0:
version "0.36.0"
resolved "http://artifactory.intra.xiaojukeji.com/artifactory/api/npm/npm/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.36.0.tgz?dl=https%3A%2F%2Fregistry.npmmirror.com%2Frollup-plugin-typescript2%2F-%2Frollup-plugin-typescript2-0.36.0.tgz#309564eb70d710412f5901344ca92045e180ed53"
Expand Down Expand Up @@ -8653,7 +8728,7 @@ string-length@^2.0.0:
astral-regex "^1.0.0"
strip-ansi "^4.0.0"

"string-width-cjs@npm:string-width@^4.2.0":
"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0:
version "4.2.3"
resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
Expand Down Expand Up @@ -8688,15 +8763,6 @@ string-width@^3.0.0, string-width@^3.1.0:
is-fullwidth-code-point "^2.0.0"
strip-ansi "^5.1.0"

string-width@^4.1.0:
version "4.2.3"
resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.1"

string-width@^5.0.1, string-width@^5.1.2:
version "5.1.2"
resolved "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794"
Expand Down

0 comments on commit 79b092a

Please sign in to comment.