Skip to content

Commit 92f7142

Browse files
authored
Revert recent latest-version upgrade due to ESM issues
1 parent 430c293 commit 92f7142

File tree

4 files changed

+130
-158
lines changed

4 files changed

+130
-158
lines changed

.changeset/afraid-clocks-ring.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+
Revert "Upgrade latest version"

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": "^6.0.0",
67+
"latest-version": "5.1.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",
8079
"@types/debounce": "1.2.1",
8180
"@types/inquirer": "8.2.1",
8281
"@types/is-glob": "4.0.2",
8382
"@types/js-yaml": "4.0.5",
8483
"@types/listr": "0.14.4",
8584
"@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: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ 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';
78

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

2627
// Updates package.json (script and plugins as dependencies)
2728
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;
3029
// script
3130
const pkgPath = resolve(process.cwd(), 'package.json');
3231
const pkgContent = readFileSync(pkgPath, {

0 commit comments

Comments
 (0)