diff --git a/packages/graphql-codegen-cli/package.json b/packages/graphql-codegen-cli/package.json index 51b5a4a1495..584d288d92f 100644 --- a/packages/graphql-codegen-cli/package.json +++ b/packages/graphql-codegen-cli/package.json @@ -84,7 +84,6 @@ "@types/is-glob": "4.0.4", "@types/js-yaml": "4.0.9", "@types/micromatch": "^4.0.2", - "@types/mkdirp": "2.0.0", "@types/shell-quote": "1.7.5", "bdd-stdin": "0.2.0", "change-case-all": "1.0.15", diff --git a/packages/utils/graphql-codegen-testing/src/typescript.ts b/packages/utils/graphql-codegen-testing/src/typescript.ts index aed6c26a6f6..dc8212458a4 100644 --- a/packages/utils/graphql-codegen-testing/src/typescript.ts +++ b/packages/utils/graphql-codegen-testing/src/typescript.ts @@ -59,7 +59,9 @@ export function validateTs( const contents: string = typeof pluginOutput === 'string' ? pluginOutput - : [...(pluginOutput.prepend || []), pluginOutput.content, ...(pluginOutput.append || [])].join('\n'); + : [...new Set([...(pluginOutput.prepend || []), pluginOutput.content, ...(pluginOutput.append || [])])].join( + '\n' + ); const testFile = `test-file.${isTsx ? 'tsx' : 'ts'}`; const errors: string[] = []; @@ -147,7 +149,10 @@ export function validateTs( }); if (relevantErrors && relevantErrors.length > 0) { - throw new Error(relevantErrors.join('\n')); + if (relevantErrors.length === 1) { + throw new Error(relevantErrors[0]); + } + throw new AggregateError(relevantErrors, relevantErrors.join('\n')); } } diff --git a/patches/listr2+4.0.5.patch b/patches/listr2+4.0.5.patch deleted file mode 100644 index 0fb17569482..00000000000 --- a/patches/listr2+4.0.5.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/node_modules/listr2/dist/index.cjs b/node_modules/listr2/dist/index.cjs -index 97af302..8715bd9 100644 ---- a/node_modules/listr2/dist/index.cjs -+++ b/node_modules/listr2/dist/index.cjs -@@ -406,7 +406,7 @@ var _DefaultRenderer = class { - } - str = `${icon} ${str}`; - let parsedStr; -- let columns = process.stdout.columns ? process.stdout.columns : 80; -+ let columns = process.stdout.columns ? process.stdout.columns : process.platform === 'win32' ? 1000 : 80; - columns = columns - level * this.options.indentation - 2; - switch (this.options.formatOutput) { - case "truncate": diff --git a/yarn.lock b/yarn.lock index 199973aef4c..0bec71a6dda 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4394,13 +4394,6 @@ resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.2.tgz#ee771e2ba4b3dc5b372935d549fd9617bf345b8c" integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== -"@types/mkdirp@2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@types/mkdirp/-/mkdirp-2.0.0.tgz#d14f087a889c3744e7cc41e82ad762b047ebc636" - integrity sha512-c/iUqMymAlxLAyIK3u5SzrwkrkyOdv1XDc91T+b5FsY7Jr6ERhUD19jJHOhPW4GD6tmN6mFEorfSdks525pwdQ== - dependencies: - mkdirp "*" - "@types/ms@*": version "0.7.31" resolved "https://registry.yarnpkg.com/@types/ms/-/ms-0.7.31.tgz#31b7ca6407128a3d2bbc27fe2d21b345397f6197" @@ -12105,16 +12098,16 @@ mj-context-menu@^0.6.1: resolved "https://registry.yarnpkg.com/mj-context-menu/-/mj-context-menu-0.6.1.tgz#a043c5282bf7e1cf3821de07b13525ca6f85aa69" integrity sha512-7NO5s6n10TIV96d4g2uDpG7ZDpIhMh0QNfGdJw/W47JswFcosz457wqz/b5sAKvl12sxINGFCn80NZHKwxQEXA== -mkdirp@*, mkdirp@^2.0.0: - version "2.1.6" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-2.1.6.tgz#964fbcb12b2d8c5d6fbc62a963ac95a273e2cc19" - integrity sha512-+hEnITedc8LAtIP9u3HJDFIdcLV2vXP33sqLLIzkv1Db1zO/1OxbvYf0Y1OC/S/Qo5dxHXepofhmxL02PsKe+A== - mkdirp@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== +mkdirp@^2.0.0: + version "2.1.6" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-2.1.6.tgz#964fbcb12b2d8c5d6fbc62a963ac95a273e2cc19" + integrity sha512-+hEnITedc8LAtIP9u3HJDFIdcLV2vXP33sqLLIzkv1Db1zO/1OxbvYf0Y1OC/S/Qo5dxHXepofhmxL02PsKe+A== + mock-stdin@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/mock-stdin/-/mock-stdin-0.3.0.tgz#f40d2a513a114e6d547480625b5ef5190744bd4d"