create-gasket-app
Advanced tools
Comparing version
@@ -40,3 +40,4 @@ import inquirer from 'inquirer'; | ||
{ name: 'yarn' } | ||
] | ||
], | ||
default: 'npm' | ||
} | ||
@@ -43,0 +44,0 @@ ]) |
@@ -9,16 +9,30 @@ import { withGasketSpinner } from '../with-spinner.js'; | ||
async function postCreateHooks({ gasket, context }) { | ||
const { dest } = context; | ||
const { dest, packageManager } = context; | ||
/** | ||
* Run an npm script in the context of the created application | ||
* @param {string} script name of script | ||
* @returns {Promise} A promise represents if npm succeeds or fails. | ||
* Determines the correct command for running scripts based on the package manager. | ||
* @param {string} script - The name of the script to run. | ||
* @returns {Promise} A promise that resolves if the script runs successfully. | ||
*/ | ||
async function runScript(script) { | ||
return await runShellCommand('pnpm', ['run', script], { cwd: dest }); | ||
let cmd; | ||
switch (packageManager) { | ||
case 'yarn': | ||
cmd = 'yarn'; | ||
break; | ||
case 'pnpm': | ||
cmd = 'pnpm'; | ||
break; | ||
case 'npm': | ||
default: | ||
cmd = 'npm'; | ||
break; | ||
} | ||
return await runShellCommand(cmd, ['run', script], { cwd: dest }); | ||
} | ||
/** | ||
* An object with one value for now, so adding more utilities | ||
* in future is easy. | ||
* An object with one value for now, so adding more utilities in future is easy. | ||
*/ | ||
@@ -25,0 +39,0 @@ const utils = { runScript }; |
{ | ||
"name": "create-gasket-app", | ||
"version": "7.3.1", | ||
"version": "7.3.2", | ||
"description": "starter pack for creating a gasket app", | ||
@@ -28,3 +28,13 @@ "type": "module", | ||
"dependencies": { | ||
"chalk": "^5.4.1", | ||
"@gasket/core": "^7.3.1", | ||
"@gasket/plugin-command": "^7.3.2", | ||
"@gasket/plugin-docs": "^7.3.2", | ||
"@gasket/plugin-docusaurus": "^7.3.1", | ||
"@gasket/plugin-dynamic-plugins": "^7.3.2", | ||
"@gasket/plugin-git": "^7.3.1", | ||
"@gasket/plugin-logger": "^7.3.1", | ||
"@gasket/plugin-metadata": "^7.3.2", | ||
"@gasket/request": "^7.3.1", | ||
"@gasket/utils": "^7.3.1", | ||
"chalk": "^4.1.2", | ||
"commander": "^12.1.0", | ||
@@ -39,15 +49,7 @@ "deepmerge": "^4.3.1", | ||
"ora": "3.4.0", | ||
"semver": "^7.7.1", | ||
"@gasket/core": "^7.3.0", | ||
"@gasket/plugin-command": "^7.3.1", | ||
"@gasket/plugin-docs": "^7.3.1", | ||
"@gasket/plugin-docusaurus": "^7.3.0", | ||
"@gasket/plugin-dynamic-plugins": "^7.3.1", | ||
"@gasket/plugin-git": "^7.3.0", | ||
"@gasket/plugin-logger": "^7.3.0", | ||
"@gasket/plugin-metadata": "^7.3.1", | ||
"@gasket/request": "^7.3.0", | ||
"@gasket/utils": "^7.3.0" | ||
"semver": "^7.7.1" | ||
}, | ||
"devDependencies": { | ||
"@gasket/request": "^7.3.1", | ||
"@jest/globals": "^29.7.0", | ||
"@types/inquirer": "^9.0.7", | ||
@@ -64,4 +66,3 @@ "@types/jest": "^29.5.14", | ||
"jest": "^29.7.0", | ||
"typescript": "^5.7.3", | ||
"@gasket/request": "^7.3.0" | ||
"typescript": "^5.7.3" | ||
}, | ||
@@ -68,0 +69,0 @@ "eslintConfig": { |
96469
0.36%2431
0.54%14
7.69%- Removed
Updated
Updated
Updated
Updated
Updated
Updated
Updated