Thanks to visit codestin.com
Credit goes to github.com

Skip to content
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/sites/src/views/components-doc/cmp-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const languageMap = {
}

const getWebdocPath = (path) => {
if (path?.startsWith('grid-') && path !== 'grid-select') {
if (path?.startsWith('grid-') && path !== 'grid-select' && path !== 'grid-kit') {
return 'grid'
} else if (path?.startsWith('chart-')) {
return 'chart'
Expand Down
2 changes: 1 addition & 1 deletion examples/sites/src/views/components-doc/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import Saas from './saas.vue'
import Mobile from './mobile.vue'
import Pc from './pc.vue'
import Plus from './pc.vue'
import Plus from './plus.vue'

let componentDocs
const mode = import.meta.env.VITE_APP_MODE
Expand Down
16 changes: 8 additions & 8 deletions examples/sites/src/views/components-doc/plus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@
<script setup>
import { fetchDemosFile } from '@/tools'
import ComponentDocs from './common.vue'
import { getWebdocPath } from './cmp-config'

const baseUrl = import.meta.env.BASE_URL
const loadData = ({ cmpId, lang }) => {
const promiseArr = [
fetchDemosFile(`@demos/app/${getWebdocPath(cmpId)}/webdoc/${cmpId}.${lang}.md`),
fetchDemosFile(`@demos/app/${cmpId}/webdoc/${cmpId}.${lang}.md`),
import(
/* @vite-ignore */
`${baseUrl}@demos/apis/${cmpId}.js`
),
import(
/* @vite-ignore */
`${baseUrl}@demos/app/${getWebdocPath(cmpId)}/webdoc/${cmpId}.js`
)
]

// 兼容ts文档, 如果是ts文档则不拉取demos配置
if (['interfaces', 'types', 'classes'].includes(cmpId)) {
promiseArr.pop()
if (!['interfaces', 'types', 'classes'].includes(cmpId)) {
promiseArr.push(
import(
/* @vite-ignore */
`${baseUrl}@demos/app/${cmpId}/webdoc/${cmpId}.js`
)
)
}

return Promise.all(promiseArr).then(([mdString, apisJson, demosJson]) => {
Expand Down
4 changes: 2 additions & 2 deletions examples/sites/vite.extend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ const modeModifyMap = {
viteConfig.build.rollupOptions.input.mobile = path.resolve(__dirname, './mobile.html')
},
plus(viteConfig) {
const demosPath = '../plusdocs/pc'
const demosPath = '../plusdocs'
const apisPath = '../plusdocs/apis'
viteConfig.resolve.alias['@menu'] = path.resolve(demosPath)
viteConfig.resolve.alias['@demo'] = path.resolve(demosPath)
viteConfig.resolve.alias['@demos'] = path.resolve(demosPath)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Renamed alias from '@demo' to '@demos'

The alias has been renamed from '@demo' to '@demos' to maintain consistency with other alias references in the codebase.


🏁 Script executed:

#!/bin/bash
# Check for any references to the old '@demo' alias that might need updating
rg -l "@demo" --type=js --type=vue --type=ts

Length of output: 72


Alias Replacement Verification Needed: Confirm No Residual '@demo' References

To ensure consistency, please re-run the following commands to search for any lingering references to '@demo' using explicit file glob patterns:

If these commands return no files, it confirms that the alias update—from '@demo' to '@demos' in examples/sites/vite.extend.ts—is applied consistently across the codebase.


🏁 Script executed:

#!/bin/bash
# Re-run search for the old alias '@demo' using proper glob patterns for file types

echo "Checking JavaScript files (.js):"
rg -l "@demo" -g "*.js"

echo "Checking TypeScript files (.ts):"
rg -l "@demo" -g "*.ts"

echo "Checking Vue files (.vue):"
rg -l "@demo" -g "*.vue"

Length of output: 841


Ensure Uniform Alias Update Across the Codebase

While the change in examples/sites/vite.extend.ts (line 85) correctly updates the alias to '@demos', our re-verification reveals multiple occurrences of '@demo' in the following files:

  • JavaScript Files:

    • examples/sites/src/main.js
    • examples/sites/src/tools/useTemplateMode.js
    • examples/sites/src/views/components-doc/cmp-config.js
    • examples/sites/src/views/docs/docConfig.js
  • TypeScript Files:

    • examples/sites/vite.config.ts
    • (and potentially other instances within) examples/sites/vite.extend.ts
  • Vue Files:

    • examples/sites/playground/App.vue
    • examples/sites/src/views/components-doc/components/demo.vue
    • examples/sites/src/views/components-doc/pc.vue
    • examples/sites/src/views/components-doc/mobile.vue
    • examples/sites/src/views/components-doc/plus.vue
    • examples/sites/src/views/overview.vue
    • examples/sites/src/views/components-doc/saas.vue

To maintain consistency with the alias update, please review these files and update any remaining '@demo' references to '@demos', or confirm if they are intentionally left unchanged.

viteConfig.tinyCustom.copyTarget = [
{
src: `${demosPath}/*`,
Expand Down
Loading