@@ -5,25 +5,12 @@ const globby = require('globby')
5
5
const isBinary = require ( 'isbinaryfile' )
6
6
const yaml = require ( 'yaml-front-matter' )
7
7
const mergeDeps = require ( './util/mergeDeps' )
8
- const { isOfficialPlugin , toShortPluginId } = require ( '@vue/cli-shared-utils' )
8
+ const { getPluginLink , toShortPluginId } = require ( '@vue/cli-shared-utils' )
9
9
10
10
const isString = val => typeof val === 'string'
11
11
const isFunction = val => typeof val === 'function'
12
12
const isObject = val => val && typeof val === 'object'
13
13
14
- // get link for a 3rd party plugin.
15
- function getLink ( id ) {
16
- let pkg = { }
17
- try {
18
- pkg = require ( `${ id } /package.json` )
19
- } catch ( e ) { }
20
- return (
21
- pkg . homepage ||
22
- ( pkg . repository && pkg . repository . url ) ||
23
- `https://www.npmjs.com/package/${ id . replace ( `/` , `%2F` ) } `
24
- )
25
- }
26
-
27
14
class GeneratorAPI {
28
15
/**
29
16
* @param {string } id - Id of the owner plugin
@@ -39,15 +26,10 @@ class GeneratorAPI {
39
26
40
27
this . pluginsData = generator . plugins
41
28
. filter ( ( { id } ) => id !== `@vue/cli-service` )
42
- . map ( ( { id } ) => {
43
- const name = toShortPluginId ( id )
44
- return {
45
- name : name ,
46
- link : isOfficialPlugin ( id )
47
- ? `https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-${ name } `
48
- : getLink ( id )
49
- }
50
- } )
29
+ . map ( ( { id } ) => ( {
30
+ name : toShortPluginId ( id ) ,
31
+ link : getPluginLink ( id )
32
+ } ) )
51
33
}
52
34
53
35
/**
0 commit comments