Skip to content

Commit c1443a2

Browse files
committed
Fix overrides, revert new package
1 parent b867beb commit c1443a2

3 files changed

Lines changed: 35 additions & 27 deletions

File tree

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"graphql": "16.14.0",
6868
"husky": "9.1.7",
6969
"jest-diff": "30.4.1",
70-
"lint-staged": "17.0.5",
70+
"lint-staged": "17.0.4",
7171
"memfs": "4.57.2",
7272
"patch-package": "8.0.1",
7373
"prettier": "3.8.3",
@@ -82,7 +82,8 @@
8282
"tsx": "4.22.0",
8383
"typescript": "6.0.3",
8484
"vitest": "4.1.6",
85-
"wrangler": "4.92.0"
85+
"wrangler": "4.92.0",
86+
"yaml": "2.9.0"
8687
},
8788
"lint-staged": {
8889
"packages/**/src/**/*.{ts,tsx}": [

pnpm-lock.yaml

Lines changed: 22 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/match-graphql.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
1-
const { writeFileSync } = require('fs');
1+
const fs = require('fs');
22
const { resolve } = require('path');
33
const { argv, cwd } = require('process');
4+
const yaml = require('yaml');
45

56
const pkgPath = resolve(cwd(), './package.json');
67

78
const pkg = require(pkgPath);
89

910
const version = argv[2];
1011

11-
pkg.resolutions ||= {};
1212
if (pkg.devDependencies.graphql?.startsWith(version)) {
1313
// eslint-disable-next-line no-console
1414
console.info(`GraphQL v${version} is match! Skipping.`);
1515
return;
1616
}
1717

18-
const npmVersion = version.includes('-') ? version : `^${version}`;
19-
pkg.devDependencies.graphql = npmVersion;
20-
pkg.resolutions.graphql = npmVersion;
18+
const pnpmWorkspaceFile = './pnpm-workspace.yaml';
2119

22-
writeFileSync(pkgPath, JSON.stringify(pkg, null, 2), 'utf8');
20+
const file = fs.readFileSync(pnpmWorkspaceFile, 'utf8');
21+
const parsedFile = yaml.parse(file);
22+
23+
parsedFile.overrides ||= {};
24+
parsedFile.overrides.graphql = '15';
25+
26+
fs.writeFileSync(pnpmWorkspaceFile, yaml.stringify(parsedFile), 'utf8');

0 commit comments

Comments
 (0)