@@ -67,12 +67,14 @@ const getContext = (context) => {
67
67
*/
68
68
export const listFrameworks = async function ( context ) {
69
69
const { pathExists, packageJson, packageJsonPath, nodeVersion } = getContext ( context )
70
- const { npmDependencies, scripts, runScriptCommand } = await getProjectInfo ( {
70
+ const { npmDependencies, npmDependenciesVersions , scripts, runScriptCommand } = await getProjectInfo ( {
71
71
pathExists,
72
72
packageJson,
73
73
packageJsonPath,
74
74
} )
75
- const frameworks = await pFilter ( FRAMEWORKS , ( framework ) => usesFramework ( framework , { pathExists, npmDependencies } ) )
75
+ const frameworks = await pFilter ( FRAMEWORKS , ( framework ) =>
76
+ usesFramework ( framework , { pathExists, npmDependencies, npmDependenciesVersions } ) ,
77
+ )
76
78
const frameworkInfos = frameworks . map ( ( framework ) =>
77
79
getFrameworkInfo ( framework , { scripts, runScriptCommand, nodeVersion } ) ,
78
80
)
@@ -90,8 +92,12 @@ export const listFrameworks = async function (context) {
90
92
export const hasFramework = async function ( frameworkId , context ) {
91
93
const framework = getFrameworkById ( frameworkId )
92
94
const { pathExists, packageJson, packageJsonPath } = getContext ( context )
93
- const { npmDependencies } = await getProjectInfo ( { pathExists, packageJson, packageJsonPath } )
94
- const result = await usesFramework ( framework , { pathExists, npmDependencies } )
95
+ const { npmDependencies, npmDependenciesVersions } = await getProjectInfo ( {
96
+ pathExists,
97
+ packageJson,
98
+ packageJsonPath,
99
+ } )
100
+ const result = await usesFramework ( framework , { pathExists, npmDependencies, npmDependenciesVersions } )
95
101
return result
96
102
}
97
103
@@ -131,11 +137,12 @@ const getFrameworkId = function ({ id }) {
131
137
}
132
138
133
139
const getProjectInfo = async function ( { pathExists, packageJson, packageJsonPath } ) {
134
- const { npmDependencies, scripts } = await getPackageJsonContent ( {
140
+ const { npmDependencies, npmDependenciesVersions , scripts } = getPackageJsonContent ( {
135
141
packageJson,
136
142
} )
137
143
const runScriptCommand = await getRunScriptCommand ( { pathExists, packageJsonPath } )
138
- return { npmDependencies, scripts, runScriptCommand }
144
+
145
+ return { npmDependencies, npmDependenciesVersions, scripts, runScriptCommand }
139
146
}
140
147
141
148
const getFrameworkInfo = function (
@@ -155,11 +162,12 @@ const getFrameworkInfo = function (
155
162
) {
156
163
const devCommands = getDevCommands ( { frameworkDevCommand, scripts, runScriptCommand } )
157
164
const recommendedPlugins = getPlugins ( plugins , { nodeVersion } )
165
+
158
166
return {
159
167
id,
160
168
name,
161
169
package : {
162
- name : detect . npmDependencies [ 0 ] ,
170
+ name : typeof detect . npmDependencies [ 0 ] === 'string' ? detect . npmDependencies [ 0 ] : detect . npmDependencies [ 0 ] ?. name ,
163
171
version : 'unknown' ,
164
172
} ,
165
173
category,
0 commit comments