mirror of
https://github.com/graphql-hive/console
synced 2026-04-21 14:37:17 +00:00
16 lines
561 B
JavaScript
16 lines
561 B
JavaScript
|
|
import { readFileSync, writeFileSync } from 'node:fs';
|
||
|
|
import { join } from 'node:path';
|
||
|
|
|
||
|
|
const __dirname = new URL('.', import.meta.url).pathname;
|
||
|
|
const cliPackageJsonAt = join(__dirname, '..', 'package.json');
|
||
|
|
const corePackageJsonAt = join(__dirname, '..', '..', 'core', 'package.json');
|
||
|
|
|
||
|
|
const version = JSON.parse(readFileSync(corePackageJsonAt, 'utf-8')).version;
|
||
|
|
|
||
|
|
const newPkg = readFileSync(cliPackageJsonAt, 'utf-8').replace(
|
||
|
|
'"@graphql-hive/core": "workspace:*"',
|
||
|
|
`"@graphql-hive/core": "${version}"`,
|
||
|
|
);
|
||
|
|
|
||
|
|
writeFileSync(cliPackageJsonAt, newPkg);
|