Skip to content

Commit

Permalink
Revert recent latest-version upgrade due to ESM issues
Browse files Browse the repository at this point in the history
  • Loading branch information
charlypoly committed Jun 30, 2022
1 parent 430c293 commit 92f7142
Show file tree
Hide file tree
Showing 4 changed files with 130 additions and 158 deletions.
5 changes: 5 additions & 0 deletions .changeset/afraid-clocks-ring.md
@@ -0,0 +1,5 @@
---
"@graphql-codegen/cli": patch
---

Revert "Upgrade latest version"
4 changes: 2 additions & 2 deletions packages/graphql-codegen-cli/package.json
Expand Up @@ -64,7 +64,7 @@
"inquirer": "^8.0.0",
"is-glob": "^4.0.1",
"json-to-pretty-yaml": "^1.2.2",
"latest-version": "^6.0.0",
"latest-version": "5.1.0",
"listr": "^0.14.3",
"listr-update-renderer": "^0.5.0",
"log-symbols": "^4.0.0",
Expand All @@ -76,13 +76,13 @@
"yargs": "^17.0.0"
},
"devDependencies": {
"@graphql-tools/merge": "8.3.0",
"@types/debounce": "1.2.1",
"@types/inquirer": "8.2.1",
"@types/is-glob": "4.0.2",
"@types/js-yaml": "4.0.5",
"@types/listr": "0.14.4",
"@types/mkdirp": "1.0.2",
"@graphql-tools/merge": "8.3.0",
"bdd-stdin": "0.2.0",
"js-yaml": "4.1.0",
"make-dir": "3.1.0",
Expand Down
3 changes: 1 addition & 2 deletions packages/graphql-codegen-cli/src/init/helpers.ts
Expand Up @@ -4,6 +4,7 @@ import { writeFileSync, readFileSync } from 'fs';
import { Types } from '@graphql-codegen/plugin-helpers';
import detectIndent from 'detect-indent';
import { Answers } from './types';
import getLatestVersion from 'latest-version';

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

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

1 comment on commit 92f7142

@vercel
Copy link

@vercel vercel bot commented on 92f7142 Jun 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.