mirror of
				https://github.com/strapi/strapi.git
				synced 2025-10-31 09:56:44 +00:00 
			
		
		
		
	Fetch useYarn info
This commit is contained in:
		
							parent
							
								
									9130c8304c
								
							
						
					
					
						commit
						ab18a34b7a
					
				| @ -13,7 +13,7 @@ import { useNotifyAT } from '@strapi/design-system/LiveRegions'; | ||||
| import { Grid, GridItem } from '@strapi/design-system/Grid'; | ||||
| import { Layout, HeaderLayout, ContentLayout } from '@strapi/design-system/Layout'; | ||||
| import { Main } from '@strapi/design-system/Main'; | ||||
| import { fetchPlugins, fetchDependencies } from './utils/api'; | ||||
| import { fetchPlugins, fetchAppInformation } from './utils/api'; | ||||
| import adminPermissions from '../../permissions'; | ||||
| import PluginCard from './components/PluginCard'; | ||||
| 
 | ||||
| @ -41,8 +41,8 @@ const MarketPlacePage = () => { | ||||
|   }; | ||||
| 
 | ||||
|   const { status: installedDependenciesStatus, data: installedDependenciesResponse } = useQuery( | ||||
|     'list-dependencies', | ||||
|     () => fetchDependencies(notifyLoad), | ||||
|     'app-information', | ||||
|     () => fetchAppInformation(notifyLoad), | ||||
|     { | ||||
|       onError: () => { | ||||
|         toggleNotification({ | ||||
| @ -91,7 +91,11 @@ const MarketPlacePage = () => { | ||||
|     ); | ||||
|   } | ||||
| 
 | ||||
|   const installedPackages = Object.keys(installedDependenciesResponse.data.dependencies); | ||||
|   const { dependencies, useYarn } = installedDependenciesResponse.data; | ||||
|   const installedPackages = Object.keys(dependencies); | ||||
| 
 | ||||
|   // TODO: implement and remove
 | ||||
|   console.log({ useYarn }); | ||||
| 
 | ||||
|   return ( | ||||
|     <CheckPagePermissions permissions={adminPermissions.marketplace.main}> | ||||
|  | ||||
| @ -17,7 +17,7 @@ const fetchPlugins = async notify => { | ||||
|   return filteredResponse; | ||||
| }; | ||||
| 
 | ||||
| const fetchDependencies = async notify => { | ||||
| const fetchAppInformation = async notify => { | ||||
|   const { data } = await axiosInstance.get('/admin/information'); | ||||
| 
 | ||||
|   notify(); | ||||
| @ -25,4 +25,4 @@ const fetchDependencies = async notify => { | ||||
|   return data; | ||||
| }; | ||||
| 
 | ||||
| export { fetchPlugins, fetchDependencies }; | ||||
| export { fetchPlugins, fetchAppInformation }; | ||||
|  | ||||
| @ -1,7 +1,9 @@ | ||||
| 'use strict'; | ||||
| 
 | ||||
| const path = require('path'); | ||||
| const execa = require('execa'); | ||||
| const _ = require('lodash'); | ||||
| const { exists } = require('fs-extra'); | ||||
| const { ValidationError } = require('@strapi/utils').errors; | ||||
| // eslint-disable-next-line node/no-extraneous-require
 | ||||
| const ee = require('@strapi/strapi/lib/utils/ee'); | ||||
| @ -48,6 +50,7 @@ module.exports = { | ||||
|     const dependencies = strapi.config.get('info.dependencies', {}); | ||||
|     const nodeVersion = process.version; | ||||
|     const communityEdition = !strapi.EE; | ||||
|     const useYarn = await exists(path.join(process.cwd(), 'yarn.lock')); | ||||
| 
 | ||||
|     return { | ||||
|       data: { | ||||
| @ -57,6 +60,7 @@ module.exports = { | ||||
|         nodeVersion, | ||||
|         communityEdition, | ||||
|         dependencies, | ||||
|         useYarn, | ||||
|       }, | ||||
|     }; | ||||
|   }, | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Rémi de Juvigny
						Rémi de Juvigny