From a6be826b47d8cb2cfc28789c1003768e3484c4ad Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 07:52:09 +0000 Subject: [PATCH 1/3] Bump yargs to ^18.0.0 --- docs/package.json | 2 +- package.json | 2 +- packages/mui-codemod/package.json | 2 +- packages/mui-icons-material/package.json | 2 +- pnpm-lock.yaml | 80 +++++++++++++++++++++--- test/package.json | 2 +- 6 files changed, 75 insertions(+), 15 deletions(-) diff --git a/docs/package.json b/docs/package.json index 987a40d15dcdf8..8b1e2422d3e304 100644 --- a/docs/package.json +++ b/docs/package.json @@ -137,6 +137,6 @@ "@playwright/test": "^1.54.1", "prettier": "^3.6.2", "tailwindcss": "^4.1.11", - "yargs": "^17.7.2" + "yargs": "^18.0.0" } } diff --git a/package.json b/package.json index b04d80113fd6c4..1458361857cb94 100644 --- a/package.json +++ b/package.json @@ -203,7 +203,7 @@ "webpack": "^5.100.2", "webpack-bundle-analyzer": "^4.10.2", "webpack-cli": "^6.0.1", - "yargs": "^17.7.2" + "yargs": "^18.0.0" }, "packageManager": "pnpm@10.13.1", "engines": { diff --git a/packages/mui-codemod/package.json b/packages/mui-codemod/package.json index 792c123854d918..fce37702fb2c78 100644 --- a/packages/mui-codemod/package.json +++ b/packages/mui-codemod/package.json @@ -36,7 +36,7 @@ "jscodeshift-add-imports": "^1.0.11", "postcss": "^8.5.6", "postcss-cli": "^11.0.1", - "yargs": "^17.7.2" + "yargs": "^18.0.0" }, "devDependencies": { "@types/chai": "^4.3.20", diff --git a/packages/mui-icons-material/package.json b/packages/mui-icons-material/package.json index 82c6b1c9d21dd3..9a559c38c1a6f2 100644 --- a/packages/mui-icons-material/package.json +++ b/packages/mui-icons-material/package.json @@ -63,7 +63,7 @@ "rimraf": "^6.0.1", "shx": "^0.4.0", "svgo": "^4.0.0", - "yargs": "^17.7.2" + "yargs": "^18.0.0" }, "peerDependencies": { "@mui/material": "workspace:^", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 88e6b25eadedba..fbb50e513eb675 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -329,8 +329,8 @@ importers: specifier: ^6.0.1 version: 6.0.1(webpack-bundle-analyzer@4.10.2)(webpack@5.100.2) yargs: - specifier: ^17.7.2 - version: 17.7.2 + specifier: ^18.0.0 + version: 18.0.0 apps/bare-next-app: dependencies: @@ -888,8 +888,8 @@ importers: specifier: ^4.1.11 version: 4.1.11 yargs: - specifier: ^17.7.2 - version: 17.7.2 + specifier: ^18.0.0 + version: 18.0.0 packages-internal/docs-utils: dependencies: @@ -1249,8 +1249,8 @@ importers: specifier: ^11.0.1 version: 11.0.1(jiti@2.4.2)(postcss@8.5.6)(tsx@4.20.3) yargs: - specifier: ^17.7.2 - version: 17.7.2 + specifier: ^18.0.0 + version: 18.0.0 devDependencies: '@types/chai': specifier: ^4.3.20 @@ -1425,8 +1425,8 @@ importers: specifier: ^4.0.0 version: 4.0.0 yargs: - specifier: ^17.7.2 - version: 17.7.2 + specifier: ^18.0.0 + version: 18.0.0 publishDirectory: build packages/mui-joy: @@ -2136,8 +2136,8 @@ importers: specifier: ^5.100.2 version: 5.100.2(webpack-cli@6.0.1(webpack-bundle-analyzer@4.10.2)(webpack@5.100.2)) yargs: - specifier: ^17.7.2 - version: 17.7.2 + specifier: ^18.0.0 + version: 18.0.0 test/bundle-size: dependencies: @@ -7362,6 +7362,10 @@ packages: resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} engines: {node: '>=12'} + cliui@9.0.1: + resolution: {integrity: sha512-k7ndgKhwoQveBL+/1tqGJYNz097I7WOvwbmmU2AR5+magtbjPWQTS1C5vzGkBC8Ym8UWRzfKUzUUqFLypY4Q+w==} + engines: {node: '>=20'} + clone-deep@4.0.1: resolution: {integrity: sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==} engines: {node: '>=6'} @@ -8244,6 +8248,9 @@ packages: elliptic@6.6.1: resolution: {integrity: sha512-RaddvvMatK2LJHqFJ+YA4WysVN5Ita9E35botqIYspQ4TkRAlCicdzKOjlyv/1Za5RyTNn7di//eEV0uTAfe3g==} + emoji-regex@10.4.0: + resolution: {integrity: sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==} + emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} @@ -9052,6 +9059,10 @@ packages: resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} engines: {node: 6.* || 8.* || >= 10.*} + get-east-asian-width@1.3.0: + resolution: {integrity: sha512-vpeMIQKxczTD/0s2CdEWHcb0eeJe6TFjxb+J5xgX7hScxqrGuyjmv4c1D4A/gelKfyox0gJJwIHF+fLjeaM8kQ==} + engines: {node: '>=18'} + get-func-name@2.0.2: resolution: {integrity: sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==} @@ -13203,6 +13214,10 @@ packages: resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} engines: {node: '>=12'} + string-width@7.2.0: + resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==} + engines: {node: '>=18'} + string.prototype.includes@2.0.1: resolution: {integrity: sha512-o7+c9bW6zpAdJHTtujeePODAhkuicdAryFsfVKwA+wGw89wJ4GTY484WTucM9hLtDEOpOvI+aHnzqnC5lHp4Rg==} engines: {node: '>= 0.4'} @@ -14313,6 +14328,10 @@ packages: resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} engines: {node: '>=12'} + wrap-ansi@9.0.0: + resolution: {integrity: sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==} + engines: {node: '>=18'} + wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} @@ -14463,6 +14482,10 @@ packages: resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} engines: {node: '>=12'} + yargs-parser@22.0.0: + resolution: {integrity: sha512-rwu/ClNdSMpkSrUb+d6BRsSkLUq1fmfsY6TOpYzTwvwkg1/NRG85KBy3kq++A8LKQwX6lsu+aWad+2khvuXrqw==} + engines: {node: ^20.19.0 || ^22.12.0 || >=23} + yargs-unparser@2.0.0: resolution: {integrity: sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==} engines: {node: '>=10'} @@ -14479,6 +14502,10 @@ packages: resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} engines: {node: '>=12'} + yargs@18.0.0: + resolution: {integrity: sha512-4UEqdc2RYGHZc7Doyqkrqiln3p9X2DZVxaGbwhn2pi7MrRagKaOcIKe8L3OxYcbhXLgLFUS3zAYuQjKBQgmuNg==} + engines: {node: ^20.19.0 || ^22.12.0 || >=23} + yauzl@2.10.0: resolution: {integrity: sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==} @@ -21155,6 +21182,12 @@ snapshots: strip-ansi: 6.0.1 wrap-ansi: 7.0.0 + cliui@9.0.1: + dependencies: + string-width: 7.2.0 + strip-ansi: 7.1.0 + wrap-ansi: 9.0.0 + clone-deep@4.0.1: dependencies: is-plain-object: 2.0.4 @@ -22132,6 +22165,8 @@ snapshots: minimalistic-assert: 1.0.1 minimalistic-crypto-utils: 1.0.1 + emoji-regex@10.4.0: {} + emoji-regex@8.0.0: {} emoji-regex@9.2.2: {} @@ -23284,6 +23319,8 @@ snapshots: get-caller-file@2.0.5: {} + get-east-asian-width@1.3.0: {} + get-func-name@2.0.2: {} get-intrinsic@1.3.0: @@ -28356,6 +28393,12 @@ snapshots: emoji-regex: 9.2.2 strip-ansi: 7.1.0 + string-width@7.2.0: + dependencies: + emoji-regex: 10.4.0 + get-east-asian-width: 1.3.0 + strip-ansi: 7.1.0 + string.prototype.includes@2.0.1: dependencies: call-bind: 1.0.8 @@ -29590,6 +29633,12 @@ snapshots: string-width: 5.1.2 strip-ansi: 7.1.0 + wrap-ansi@9.0.0: + dependencies: + ansi-styles: 6.2.1 + string-width: 7.2.0 + strip-ansi: 7.1.0 + wrappy@1.0.2: {} write-file-atomic@2.4.3: @@ -29694,6 +29743,8 @@ snapshots: yargs-parser@21.1.1: {} + yargs-parser@22.0.0: {} + yargs-unparser@2.0.0: dependencies: camelcase: 6.3.0 @@ -29735,6 +29786,15 @@ snapshots: y18n: 5.0.8 yargs-parser: 21.1.1 + yargs@18.0.0: + dependencies: + cliui: 9.0.1 + escalade: 3.2.0 + get-caller-file: 2.0.5 + string-width: 7.2.0 + y18n: 5.0.8 + yargs-parser: 22.0.0 + yauzl@2.10.0: dependencies: buffer-crc32: 0.2.13 diff --git a/test/package.json b/test/package.json index 7f2a2a184e427a..195cfe08bee361 100644 --- a/test/package.json +++ b/test/package.json @@ -40,7 +40,7 @@ "stylis": "4.2.0", "webfontloader": "^1.6.28", "webpack": "^5.100.2", - "yargs": "^17.7.2" + "yargs": "^18.0.0" }, "dependencies": { "@react-spring/web": "^10.0.1" From 066fb44416df8a68180baba29b70c2c736241e1a Mon Sep 17 00:00:00 2001 From: ZeeshanTamboli Date: Mon, 21 Jul 2025 15:49:33 +0530 Subject: [PATCH 2/3] fix yargs v18 for proptypes --- scripts/generateProptypes.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/generateProptypes.ts b/scripts/generateProptypes.ts index 11fb7da8c3f36c..89172d6663688c 100644 --- a/scripts/generateProptypes.ts +++ b/scripts/generateProptypes.ts @@ -4,7 +4,7 @@ import * as fse from 'fs-extra'; import * as prettier from 'prettier'; import glob from 'fast-glob'; import * as _ from 'lodash'; -import * as yargs from 'yargs'; +import yargs from 'yargs'; import { LiteralType } from '@mui/internal-scripts/typescript-to-proptypes/src/models'; import { fixBabelGeneratorIssues, @@ -372,7 +372,7 @@ async function run(argv: HandlerArgv) { } } -yargs +yargs() .command({ command: '$0', describe: 'Generates Component.propTypes from TypeScript declarations', From e5c3f35f3e4355d8303373874fc66782bc0e4e56 Mon Sep 17 00:00:00 2001 From: ZeeshanTamboli Date: Mon, 21 Jul 2025 16:00:33 +0530 Subject: [PATCH 3/3] refactor formattedTSDemos file to ESM format to suuport yargs v18 whih supports only ESM now --- docs/scripts/formattedTSDemos.js | 39 +++++++++++++++++--------------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/docs/scripts/formattedTSDemos.js b/docs/scripts/formattedTSDemos.js index 0afcfdf4309bab..2628ae095c7e07 100644 --- a/docs/scripts/formattedTSDemos.js +++ b/docs/scripts/formattedTSDemos.js @@ -5,27 +5,30 @@ * would indicate equivalence. */ +import path from 'path'; +import fse from 'fs-extra'; +import * as babel from '@babel/core'; +import prettier from 'prettier'; +import { fileURLToPath } from 'url'; +import { + getPropTypesFromFile, + injectPropTypesInFile, +} from '@mui/internal-scripts/typescript-to-proptypes'; +import { createTypeScriptProjectBuilder } from '@mui-internal/api-docs-builder/utils/createTypeScriptProject'; +import yargs from 'yargs'; +import { fixBabelGeneratorIssues, fixLineEndings } from '@mui/internal-docs-utils'; +// eslint-disable-next-line import/no-relative-packages +import CORE_TYPESCRIPT_PROJECTS from '../../scripts/coreTypeScriptProjects'; + +const filename = fileURLToPath(import.meta.url); +const dirname = path.dirname(filename); + /** * List of demos or folders to ignore when transpiling. * Only ignore files that aren't used in the UI. */ const ignoreList = ['/pages.ts', 'docs/data/joy/getting-started/templates']; -const path = require('path'); -const fse = require('fs-extra'); -const babel = require('@babel/core'); -const prettier = require('prettier'); -const { - getPropTypesFromFile, - injectPropTypesInFile, -} = require('@mui/internal-scripts/typescript-to-proptypes'); -const { - createTypeScriptProjectBuilder, -} = require('@mui-internal/api-docs-builder/utils/createTypeScriptProject'); -const yargs = require('yargs'); -const { fixBabelGeneratorIssues, fixLineEndings } = require('@mui/internal-docs-utils'); -const { default: CORE_TYPESCRIPT_PROJECTS } = require('../../scripts/coreTypeScriptProjects'); - const babelConfig = { presets: ['@babel/preset-typescript'], plugins: [], @@ -35,7 +38,7 @@ const babelConfig = { shouldPrintComment: (comment) => !comment.startsWith(' @babel-ignore-comment-in-output'), }; -const workspaceRoot = path.join(__dirname, '../../'); +const workspaceRoot = path.join(dirname, '../../'); async function getFiles(root) { const files = []; @@ -91,7 +94,7 @@ async function transpileFile(tsxPath, project) { if (enableJSXPreview) { transformOptions.plugins = transformOptions.plugins.concat([ [ - require.resolve('docs/src/modules/utils/babel-plugin-jsx-preview'), + path.resolve('docs/src/modules/utils/babel-plugin-jsx-preview'), { maxLines: 16, outputFilename: `${tsxPath}.preview` }, ], ]); @@ -213,7 +216,7 @@ async function main(argv) { console.log('\nWatching for file changes...'); } -yargs +yargs() .command({ command: '$0', description: 'transpile TypeScript demos',