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 33import ora from 'ora'
44import consola from 'consola'
55import { defineCommand , runMain } from 'citty'
6+ import { fileURLToPath } from 'url'
7+ import { dirname , resolve } from 'path'
68import { 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' ) )
713
814const main = defineCommand ( {
915 meta : {
1016 name : 'vta' ,
11- description : 'Vue Telescope Analyzer'
17+ description : 'Vue Telescope Analyzer' ,
18+ version : pkg . version
1219 } ,
1320 args : {
1421 url : {
Original file line number Diff line number Diff line change 301301 "slug" : " nuxt-content" ,
302302 "name" : " @nuxt/content" ,
303303 "imgPath" : null ,
304- "url" : " https://content.nuxtjs.org "
304+ "url" : " https://content.nuxt.com "
305305 },
306306 "detectors" : {
307307 "js" : " window.$nuxt?.$options?.context?.app?.$content || window.__NUXT__?.config?.public?.content"
378378 "slug" : " nuxt-image" ,
379379 "name" : " @nuxt/image" ,
380380 "imgPath" : null ,
381- "url" : " https://image.nuxtjs.org "
381+ "url" : " https://image.nuxt.com "
382382 },
383383 "detectors" : {
384+ "html" : " data-nuxt-img" ,
384385 "js" : [
385386 " window.$nuxt?.$img" ,
386387 " window.__NUXT__?.config?.public?.image" ,
387388 " 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"
389391 ]
390392 }
391393 },
509511 "detectors" : {
510512 "js" : " useNuxtApp?.()._appConfig?.ui?.variables || window.__unctx__?.get('nuxt-app')?.use()._appConfig?.ui?.variables"
511513 }
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+ }
512547 }
513548}
Original file line number Diff line number Diff line change 11import { 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' ) )
1015
1116const detectors = {
1217 vue,
You can’t perform that action at this time.
0 commit comments