Skip to content

Use Chosen Package Manager (Catalog) #1044

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Mar 11, 2025
51 changes: 51 additions & 0 deletions .changeset/wise-queens-care.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
"@gasket/plugin-dynamic-plugins": patch
"@gasket/plugin-service-worker": patch
"@gasket/plugin-docs-graphs": patch
"@gasket/plugin-elastic-apm": patch
"@gasket/plugin-https-proxy": patch
"@gasket/plugin-docusaurus": patch
"@gasket/plugin-middleware": patch
"@gasket/plugin-typescript": patch
"@gasket/plugin-happyfeet": patch
"@gasket/typescript-tests": patch
"@gasket/plugin-manifest": patch
"@gasket/plugin-metadata": patch
"@gasket/plugin-analyze": patch
"@gasket/plugin-command": patch
"@gasket/plugin-cypress": patch
"@gasket/plugin-express": patch
"@gasket/plugin-fastify": patch
"@gasket/plugin-swagger": patch
"@gasket/plugin-webpack": patch
"@gasket/plugin-winston": patch
"@gasket/plugin-workbox": patch
"@gasket/plugin-logger": patch
"@gasket/plugin-morgan": patch
"@gasket/plugin-nextjs": patch
"@gasket/preset-nextjs": patch
"@gasket/plugin-https": patch
"@gasket/plugin-mocha": patch
"@gasket/plugin-redux": patch
"@gasket/plugin-data": patch
"@gasket/plugin-docs": patch
"@gasket/plugin-intl": patch
"@gasket/plugin-jest": patch
"@gasket/plugin-lint": patch
"generate-docs-index": patch
"create-gasket-app": patch
"@gasket/plugin-git": patch
"@gasket/preset-api": patch
"@gasket/react-intl": patch
"@gasket/request": patch
"@gasket/assets": patch
"@gasket/nextjs": patch
"@gasket/fetch": patch
"@gasket/redux": patch
"@gasket/utils": patch
"@gasket/core": patch
"@gasket/data": patch
"@gasket/intl": patch
---

Updates to use user-selected package manager. Update all packages to use catalog dep versions.
28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,22 @@
},
"homepage": "https://github.com/godaddy/gasket#readme",
"devDependencies": {
"@changesets/cli": "^2.28.1",
"@docusaurus/core": "^3.7.0",
"@docusaurus/preset-classic": "^3.7.0",
"@docusaurus/theme-mermaid": "^3.7.0",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.0.0",
"@changesets/cli": "catalog:",
"@docusaurus/core": "catalog:",
"@docusaurus/preset-classic": "catalog:",
"@docusaurus/theme-mermaid": "catalog:",
"@typescript-eslint/eslint-plugin": "catalog:",
"@typescript-eslint/parser": "catalog:",
"eslint": "catalog:",
"eslint-config-godaddy": "^7.1.1",
"eslint-config-godaddy-typescript": "^4.0.3",
"eslint-plugin-unicorn": "^55.0.0",
"glob": "^8.1.0",
"jsdom": "^20.0.3",
"nx": "^20.4.6",
"eslint-config-godaddy": "catalog:",
"eslint-config-godaddy-typescript": "catalog:",
"eslint-plugin-unicorn": "catalog:",
"glob": "catalog:",
"jsdom": "catalog:",
"nx": "catalog:",
"react": "catalog:",
"react-dom": "^18.3.1",
"rimraf": "^3.0.2",
"react-dom": "catalog:",
"rimraf": "catalog:",
"search-insights": ">= 1 < 3",
"typescript": "catalog:"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/create-gasket-app/lib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ export interface CreateContext {
/** Names of the plugins that add unit and integration tests */
testPlugins: Array<string>;

/** Which package manager to use (Default: 'npm') */
/** Which package manager to use (Default: 'pnpm') */
packageManager: string;

/** Derived install command (Default: 'npm install') */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ async function choosePackageManager(context, prompt) {
{ name: 'npm' },
{ name: 'pnpm' },
{ name: 'yarn' }
]
],
default: 'pnpm'
}
])
).packageManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,34 @@ import { runShellCommand } from '@gasket/utils';
* @type {import('../../internal').postCreateHooks}
*/
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.
*/
const utils = { runScript };
await gasket.exec('postCreate', context, utils);
Expand Down
43 changes: 22 additions & 21 deletions packages/create-gasket-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,31 +45,32 @@
"@gasket/plugin-metadata": "workspace:^",
"@gasket/request": "workspace:^",
"@gasket/utils": "workspace:^",
"chalk": "^5.4.1",
"commander": "^12.1.0",
"deepmerge": "^4.3.1",
"diagnostics": "^2.0.2",
"glob": "^8.1.0",
"handlebars": "^4.7.8",
"inquirer": "6.5.2",
"json5": "^2.2.3",
"mkdirp": "^1.0.4",
"ora": "3.4.0",
"semver": "^7.7.1"
"chalk": "catalog:",
"commander": "catalog:",
"deepmerge": "catalog:",
"diagnostics": "catalog:",
"glob": "catalog:",
"handlebars": "catalog:",
"inquirer": "catalog:",
"json5": "catalog:",
"mkdirp": "catalog:",
"ora": "catalog:",
"semver": "catalog:"
},
"devDependencies": {
"@gasket/request": "workspace:^",
"@types/inquirer": "^9.0.7",
"@types/jest": "^29.5.14",
"@types/node": "^20.17.19",
"cross-env": "^7.0.3",
"dotenv": "^16.4.7",
"@jest/globals": "catalog:",
"@types/inquirer": "catalog:",
"@types/jest": "catalog:",
"@types/node": "catalog:",
"cross-env": "catalog:",
"dotenv": "catalog:",
"eslint": "catalog:",
"eslint-config-godaddy": "^7.1.1",
"eslint-config-godaddy-typescript": "^4.0.3",
"eslint-plugin-jest": "^28.11.0",
"eslint-plugin-unicorn": "^55.0.0",
"jest": "^29.7.0",
"eslint-config-godaddy": "catalog:",
"eslint-config-godaddy-typescript": "catalog:",
"eslint-plugin-jest": "catalog:",
"eslint-plugin-unicorn": "catalog:",
"jest": "catalog:",
"typescript": "catalog:"
},
"eslintConfig": {
Expand Down
28 changes: 14 additions & 14 deletions packages/gasket-assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,22 @@
},
"homepage": "https://github.com/godaddy/gasket/tree/main/packages/gasket-assets",
"devDependencies": {
"@babel/core": "^7.26.9",
"@babel/node": "^7.26.0",
"@babel/preset-env": "^7.26.9",
"@babel/preset-react": "^7.26.3",
"@svgr/core": "^6.5.1",
"@types/jest": "^29.5.14",
"@types/node": "^20.17.19",
"babel-plugin-add-module-exports": "^1.0.4",
"@babel/core": "catalog:",
"@babel/node": "catalog:",
"@babel/preset-env": "catalog:",
"@babel/preset-react": "catalog:",
"@svgr/core": "catalog:",
"@types/jest": "catalog:",
"@types/node": "catalog:",
"babel-plugin-add-module-exports": "catalog:",
"eslint": "catalog:",
"eslint-config-godaddy": "^7.1.1",
"eslint-config-godaddy-typescript": "^4.0.3",
"eslint-plugin-unicorn": "^55.0.0",
"mkdirp": "^1.0.4",
"eslint-config-godaddy": "catalog:",
"eslint-config-godaddy-typescript": "catalog:",
"eslint-plugin-unicorn": "catalog:",
"mkdirp": "catalog:",
"react": "catalog:",
"recursive-readdir": "^2.2.3",
"rimraf": "^3.0.2",
"recursive-readdir": "catalog:",
"rimraf": "catalog:",
"typescript": "catalog:"
},
"eslintConfig": {
Expand Down
24 changes: 12 additions & 12 deletions packages/gasket-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,21 @@
"homepage": "https://github.com/godaddy/gasket/tree/main/packages/gasket-core",
"dependencies": {
"@gasket/utils": "workspace:^",
"debug": "^4.4.0"
"debug": "catalog:"
},
"devDependencies": {
"@jest/globals": "^29.7.0",
"@swc/cli": "^0.3.14",
"@swc/core": "^1.10.18",
"@types/jest": "^29.5.14",
"@types/node": "^20.17.19",
"cross-env": "^7.0.3",
"@jest/globals": "catalog:",
"@swc/cli": "catalog:",
"@swc/core": "catalog:",
"@types/jest": "catalog:",
"@types/node": "catalog:",
"cross-env": "catalog:",
"eslint": "catalog:",
"eslint-config-godaddy": "^7.1.1",
"eslint-config-godaddy-typescript": "^4.0.3",
"eslint-plugin-jest": "^28.11.0",
"eslint-plugin-unicorn": "^55.0.0",
"jest": "^29.7.0",
"eslint-config-godaddy": "catalog:",
"eslint-config-godaddy-typescript": "catalog:",
"eslint-plugin-jest": "catalog:",
"eslint-plugin-unicorn": "catalog:",
"jest": "catalog:",
"typescript": "catalog:"
},
"eslintConfig": {
Expand Down
24 changes: 12 additions & 12 deletions packages/gasket-data/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,19 @@
},
"devDependencies": {
"@gasket/plugin-data": "workspace:^",
"@jest/globals": "^29.7.0",
"@swc/cli": "^0.3.14",
"@swc/core": "^1.10.18",
"@types/jest": "^29.5.14",
"@types/node": "^20.17.19",
"cross-env": "^7.0.3",
"@jest/globals": "catalog:",
"@swc/cli": "catalog:",
"@swc/core": "catalog:",
"@types/jest": "catalog:",
"@types/node": "catalog:",
"cross-env": "catalog:",
"eslint": "catalog:",
"eslint-config-godaddy": "^7.1.1",
"eslint-config-godaddy-typescript": "^4.0.3",
"eslint-plugin-jest": "^28.11.0",
"eslint-plugin-unicorn": "^55.0.0",
"jest": "^29.7.0",
"jsdom": "^20.0.3",
"eslint-config-godaddy": "catalog:",
"eslint-config-godaddy-typescript": "catalog:",
"eslint-plugin-jest": "catalog:",
"eslint-plugin-unicorn": "catalog:",
"jest": "catalog:",
"jsdom": "catalog:",
"typescript": "catalog:"
},
"eslintConfig": {
Expand Down
36 changes: 18 additions & 18 deletions packages/gasket-fetch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,28 +37,28 @@
},
"homepage": "https://github.com/godaddy/gasket/tree/main/packages/gasket-fetch",
"dependencies": {
"abort-controller": "^3.0.0",
"node-fetch": "^2.7.0"
"abort-controller": "catalog:",
"node-fetch": "catalog:"
},
"devDependencies": {
"@babel/core": "^7.26.9",
"@babel/plugin-transform-runtime": "^7.26.9",
"@babel/preset-env": "^7.26.9",
"@babel/register": "^7.25.9",
"@types/jest": "^29.5.14",
"@types/node": "^20.17.19",
"core-js": "^3.40.0",
"cross-env": "^7.0.3",
"@babel/core": "catalog:",
"@babel/plugin-transform-runtime": "catalog:",
"@babel/preset-env": "catalog:",
"@babel/register": "catalog:",
"@types/jest": "catalog:",
"@types/node": "catalog:",
"core-js": "catalog:",
"cross-env": "catalog:",
"eslint": "catalog:",
"eslint-config-godaddy": "^7.1.1",
"eslint-config-godaddy-typescript": "^4.0.3",
"eslint-plugin-jest": "^28.11.0",
"eslint-plugin-unicorn": "^55.0.0",
"jest": "^29.7.0",
"jsdom": "^20.0.3",
"regenerator-runtime": "^0.14.1",
"eslint-config-godaddy": "catalog:",
"eslint-config-godaddy-typescript": "catalog:",
"eslint-plugin-jest": "catalog:",
"eslint-plugin-unicorn": "catalog:",
"jest": "catalog:",
"jsdom": "catalog:",
"regenerator-runtime": "catalog:",
"typescript": "catalog:",
"whatwg-fetch": "3.6.20"
"whatwg-fetch": "catalog:"
},
"eslintConfig": {
"extends": [
Expand Down
18 changes: 9 additions & 9 deletions packages/gasket-intl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@
},
"homepage": "https://github.com/godaddy/gasket/tree/main/packages/gasket-intl",
"devDependencies": {
"@jest/globals": "^29.7.0",
"@types/jest": "^29.5.14",
"@types/node": "^20.17.19",
"cross-env": "^7.0.3",
"@jest/globals": "catalog:",
"@types/jest": "catalog:",
"@types/node": "catalog:",
"cross-env": "catalog:",
"eslint": "catalog:",
"eslint-config-godaddy": "^7.1.1",
"eslint-config-godaddy-typescript": "^4.0.3",
"eslint-plugin-jest": "^28.11.0",
"eslint-plugin-unicorn": "^55.0.0",
"jest": "^29.7.0",
"eslint-config-godaddy": "catalog:",
"eslint-config-godaddy-typescript": "catalog:",
"eslint-plugin-jest": "catalog:",
"eslint-plugin-unicorn": "catalog:",
"jest": "catalog:",
"typescript": "catalog:"
},
"eslintConfig": {
Expand Down
Loading
Loading