Skip to content

Commit 52b41e9

Browse files
authored
Upgrade latest version (#7991)
* upgrade latest-version * bump latest-version * revert graphql-cli-codegen-plugin update * add comment
1 parent a1d3c4a commit 52b41e9

File tree

4 files changed

+171
-133
lines changed

4 files changed

+171
-133
lines changed

.changeset/perfect-mails-repair.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@graphql-codegen/cli': patch
3+
---
4+
5+
bump latest-version to patch vuln

packages/graphql-codegen-cli/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"inquirer": "^8.0.0",
6565
"is-glob": "^4.0.1",
6666
"json-to-pretty-yaml": "^1.2.2",
67-
"latest-version": "5.1.0",
67+
"latest-version": "^6.0.0",
6868
"listr": "^0.14.3",
6969
"listr-update-renderer": "^0.5.0",
7070
"log-symbols": "^4.0.0",
@@ -76,13 +76,13 @@
7676
"yargs": "^17.0.0"
7777
},
7878
"devDependencies": {
79+
"@graphql-tools/merge": "8.3.0",
7980
"@types/debounce": "1.2.1",
8081
"@types/inquirer": "8.2.1",
8182
"@types/is-glob": "4.0.2",
8283
"@types/js-yaml": "4.0.5",
8384
"@types/listr": "0.14.4",
8485
"@types/mkdirp": "1.0.2",
85-
"@graphql-tools/merge": "8.3.0",
8686
"bdd-stdin": "0.2.0",
8787
"js-yaml": "4.1.0",
8888
"make-dir": "3.1.0",

packages/graphql-codegen-cli/src/init/helpers.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { writeFileSync, readFileSync } from 'fs';
44
import { Types } from '@graphql-codegen/plugin-helpers';
55
import detectIndent from 'detect-indent';
66
import { Answers } from './types';
7-
import getLatestVersion from 'latest-version';
87

98
// Parses config and writes it to a file
109
export async function writeConfig(answers: Answers, config: Types.Config) {
@@ -26,6 +25,8 @@ export async function writeConfig(answers: Answers, config: Types.Config) {
2625

2726
// Updates package.json (script and plugins as dependencies)
2827
export async function writePackage(answers: Answers, configLocation: string) {
28+
// dynamic import because latest-version is pure ESM
29+
const getLatestVersion = (await import('latest-version')).default;
2930
// script
3031
const pkgPath = resolve(process.cwd(), 'package.json');
3132
const pkgContent = readFileSync(pkgPath, {

0 commit comments

Comments
 (0)