File tree Expand file tree Collapse file tree 4 files changed +67
-12
lines changed Expand file tree Collapse file tree 4 files changed +67
-12
lines changed Original file line number Diff line number Diff line change 3
3
import ora from 'ora'
4
4
import consola from 'consola'
5
5
import { defineCommand , runMain } from 'citty'
6
+ import { fileURLToPath } from 'url'
7
+ import { dirname , resolve } from 'path'
6
8
import { analyze } from '../src/index.mjs'
9
+ import { loadJsonFileSync } from 'load-json-file'
10
+
11
+ const __dirname = dirname ( fileURLToPath ( import . meta. url ) )
12
+ const pkg = loadJsonFileSync ( resolve ( __dirname , '../package.json' ) )
7
13
8
14
const main = defineCommand ( {
9
15
meta : {
10
16
name : 'vta' ,
11
- description : 'Vue Telescope Analyzer'
17
+ description : 'Vue Telescope Analyzer' ,
18
+ version : pkg . version
12
19
} ,
13
20
args : {
14
21
url : {
Original file line number Diff line number Diff line change 301
301
"slug" : " nuxt-content" ,
302
302
"name" : " @nuxt/content" ,
303
303
"imgPath" : null ,
304
- "url" : " https://content.nuxtjs.org "
304
+ "url" : " https://content.nuxt.com "
305
305
},
306
306
"detectors" : {
307
307
"js" : " window.$nuxt?.$options?.context?.app?.$content || window.__NUXT__?.config?.public?.content"
378
378
"slug" : " nuxt-image" ,
379
379
"name" : " @nuxt/image" ,
380
380
"imgPath" : null ,
381
- "url" : " https://image.nuxtjs.org "
381
+ "url" : " https://image.nuxt.com "
382
382
},
383
383
"detectors" : {
384
+ "html" : " data-nuxt-img" ,
384
385
"js" : [
385
386
" window.$nuxt?.$img" ,
386
387
" window.__NUXT__?.config?.public?.image" ,
387
388
" window.__unctx__?.get('nuxt-app')?.use()?.$img" ,
388
- " [...document.querySelectorAll('*')].map((el) => el.__vue_app__?.config?.globalProperties?.$img).filter(Boolean).length"
389
+ " [...document.querySelectorAll('*')].map((el) => el.__vue_app__?.config?.globalProperties?.$img).filter(Boolean).length" ,
390
+ " useNuxtApp?.()._img"
389
391
]
390
392
}
391
393
},
509
511
"detectors" : {
510
512
"js" : " useNuxtApp?.()._appConfig?.ui?.variables || window.__unctx__?.get('nuxt-app')?.use()._appConfig?.ui?.variables"
511
513
}
514
+ },
515
+ "nuxt-mdc" : {
516
+ "metas" : {
517
+ "slug" : " nuxt-mdc" ,
518
+ "name" : " @nuxtjs/mdc" ,
519
+ "imgPath" : null ,
520
+ "url" : " https://github.com/nuxt-modules/mdc"
521
+ },
522
+ "detectors" : {
523
+ "js" : " useNuxtApp?.().payload?.config?.public?.mdc || window.__unctx__?.get('nuxt-app')?.use().payload?.config?.public?.mdc"
524
+ }
525
+ },
526
+ "nuxt-studio" : {
527
+ "metas" : {
528
+ "slug" : " nuxt-studio" ,
529
+ "name" : " @nuxthq/studio" ,
530
+ "imgPath" : null ,
531
+ "url" : " https://nuxt.studio"
532
+ },
533
+ "detectors" : {
534
+ "js" : " useNuxtApp?.().payload?.config?.public?.studio || window.__unctx__?.get('nuxt-app')?.use().payload?.config?.public?.studio"
535
+ }
536
+ },
537
+ "nuxt-plausible" : {
538
+ "metas" : {
539
+ "slug" : " nuxt-plausible" ,
540
+ "name" : " @nuxtjs/plausible" ,
541
+ "imgPath" : null ,
542
+ "url" : " https://github.com/nuxt-modules/plausible"
543
+ },
544
+ "detectors" : {
545
+ "js" : " useNuxtApp?.().payload?.config?.public?.plausible || window.__unctx__?.get('nuxt-app')?.use().payload?.config?.public?.plausible"
546
+ }
512
547
}
513
548
}
Original file line number Diff line number Diff line change 1
1
import { parsePatterns , asArray } from './utils.mjs'
2
-
3
- import vue from '../detectors/vue.json' assert { type : 'json ' }
4
- import vueMeta from '../detectors/vue.meta.json' assert { type : 'json ' }
5
- import frameworks from '../detectors/frameworks.json' assert { type : 'json ' }
6
- import plugins from '../detectors/plugins.json' assert { type : 'json ' }
7
- import uis from '../detectors/uis.json' assert { type : 'json ' }
8
- import nuxtMeta from '../detectors/nuxt.meta.json' assert { type : 'json ' }
9
- import nuxtModules from '../detectors/nuxt.modules.json' assert { type : 'json ' }
2
+ import { fileURLToPath } from 'url'
3
+ import { dirname , resolve } from 'path'
4
+ import { loadJsonFileSync } from 'load-json-file'
5
+
6
+ const __dirname = dirname ( fileURLToPath ( import . meta. url ) )
7
+
8
+ const vue = loadJsonFileSync ( resolve ( __dirname , '../detectors/vue.json' ) )
9
+ const vueMeta = loadJsonFileSync ( resolve ( __dirname , '../detectors/vue.meta.json' ) )
10
+ const frameworks = loadJsonFileSync ( resolve ( __dirname , '../detectors/frameworks.json' ) )
11
+ const plugins = loadJsonFileSync ( resolve ( __dirname , '../detectors/plugins.json' ) )
12
+ const uis = loadJsonFileSync ( resolve ( __dirname , '../detectors/uis.json' ) )
13
+ const nuxtMeta = loadJsonFileSync ( resolve ( __dirname , '../detectors/nuxt.meta.json' ) )
14
+ const nuxtModules = loadJsonFileSync ( resolve ( __dirname , '../detectors/nuxt.modules.json' ) )
10
15
11
16
const detectors = {
12
17
vue,
You can’t perform that action at this time.
0 commit comments