This repository was archived by the owner on Jan 23, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +6
-20
lines changed
Expand file tree Collapse file tree 4 files changed +6
-20
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ import { tasks } from './Tasks'
1616import { greet } from './src/Chalk/greet'
1717import { showArt } from './src/Chalk/art'
1818import { getHelp } from './src/Chalk/help'
19- import { getState , packageManager } from './src/Helpers'
19+ import { getState } from './src/Helpers'
2020
2121/**
2222 * Running all the tasks to create a new project.
@@ -42,7 +42,7 @@ export async function runTasks(args: string[]) {
4242 * Show help when no arguments are passed
4343 */
4444 if ( ! argv . _ . length ) {
45- console . log ( getHelp ( packageManager ) )
45+ console . log ( getHelp ( utils . getPackageManager ( process . cwd ( ) ) ) )
4646 return
4747 }
4848
@@ -58,7 +58,7 @@ export async function runTasks(args: string[]) {
5858 * Setup state
5959 */
6060 const state = await getState ( projectPath , {
61- client : packageManager ,
61+ client : utils . getPackageManager ( projectPath ) ,
6262 projectName : argv . name ,
6363 debug : argv . debug ,
6464 boilerplate : argv . boilerplate ,
Original file line number Diff line number Diff line change 88 */
99
1010import { logger } from '@adonisjs/sink'
11- import type { SupportedPackageManager } from '../Helpers'
1211
1312/**
1413 * Text to show on the help screen. Its simple and hence writing it
1514 * by hand is fine
1615 */
17- export const getHelp = ( packageManager : SupportedPackageManager ) => {
16+ export const getHelp = ( packageManager : 'npm' | 'pnpm' | 'yarn' ) => {
1817 const runSentence =
1918 packageManager === 'yarn'
2019 ? 'yarn create adonis-ts-app'
Original file line number Diff line number Diff line change 99
1010import { logger as sinkLogger , files } from '@adonisjs/sink'
1111import { ApplicationContract } from '@ioc:Adonis/Core/Application'
12- import type { SupportedPackageManager } from '../Helpers'
1312
1413/**
1514 * Shape of task functions
@@ -27,7 +26,7 @@ export type CliState = {
2726 baseName : string
2827 absPath : string
2928 debug : boolean
30- client : SupportedPackageManager
29+ client : 'npm' | 'pnpm' | 'yarn'
3130 boilerplate : 'web' | 'api' | 'slim'
3231 projectName : string
3332 eslint : boolean
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ export async function getState(
3030 projectName ?: string
3131 eslint ?: boolean
3232 prettier ?: boolean
33- client : SupportedPackageManager
33+ client : 'npm' | 'pnpm' | 'yarn'
3434 encore ?: boolean
3535 }
3636) : Promise < CliState > {
@@ -196,15 +196,3 @@ export function getInstallMessage(list: string[]): string {
196196
197197 return dependencies . join ( ', ' )
198198}
199-
200- export type SupportedPackageManager = typeof packageManager
201-
202- /**
203- * Detect what package manager is in used, fallback to npm.
204- */
205- export const packageManager =
206- process . env . npm_execpath && process . env . npm_execpath . includes ( 'yarn' )
207- ? 'yarn'
208- : process . env . npm_execpath && process . env . npm_execpath . includes ( 'pnpm' )
209- ? 'pnpm'
210- : 'npm'
You can’t perform that action at this time.
0 commit comments