Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade everything; explain plan converted to JSON #496

Merged
merged 57 commits into from
Sep 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
12fd9ed
Upgrade ESLint and babel
benjie Aug 30, 2023
888f0ef
Reset yarn.lock
benjie Aug 30, 2023
d583795
Tweaks so TypeScript compiles again
benjie Aug 30, 2023
bb7b7c8
No longer required
benjie Aug 30, 2023
af0bc87
Lint fixes and edits for tests
benjie Aug 30, 2023
86f1dc5
Upgrade changesets and docusaurus
benjie Aug 31, 2023
a05140b
Upgrade typedoc
benjie Aug 31, 2023
10a6fde
Upgrade TypeScript
benjie Aug 31, 2023
0342e3e
Upgrade prettier
benjie Aug 31, 2023
facc5d9
Reformat code
benjie Aug 31, 2023
a95fdb1
Prettier API now async
benjie Aug 31, 2023
e6b335d
Remove conventional-changelog
benjie Aug 31, 2023
18d2ec7
Update test-related packages
benjie Aug 31, 2023
7882a22
Fix typescript
benjie Aug 31, 2023
0898538
Add prettier v2 for jest compatibility
benjie Aug 31, 2023
2cde0ba
New jest snapshot formatter updates
benjie Aug 31, 2023
a402070
Update various minor dependencies
benjie Aug 31, 2023
a5580ee
Revert @whatwg-node/fetch so tests pass again
benjie Aug 31, 2023
3529bda
Latest version
benjie Aug 31, 2023
7433f2a
Upgrade jsonwebtoken
benjie Aug 31, 2023
ddd00f9
Upgrade envelop
benjie Aug 31, 2023
3b7d5b1
Upgrade mermaid and stuff
benjie Aug 31, 2023
97155fe
Downgrade mermaid (ESM); upgrade GraphiQL
benjie Aug 31, 2023
1349af4
Reset yarn.lock
benjie Aug 31, 2023
473d70b
Ruru working again
benjie Sep 1, 2023
d2528c3
Oops
benjie Sep 1, 2023
95080af
No longer need these hacks
benjie Sep 1, 2023
03d034a
Start moving to JSON-based plan
benjie Sep 1, 2023
08873f3
Convert mermaid rendering to run based on the JSON
benjie Sep 1, 2023
bf5a043
More mermaid rendering fixes
benjie Sep 1, 2023
6d8a82e
Another mermaid diagram fix
benjie Sep 1, 2023
e728533
Update mermaid diagrams
benjie Sep 1, 2023
60bdb28
Extract mermaid methods to their own entrypoint
benjie Sep 1, 2023
25cfdd1
Lint
benjie Sep 1, 2023
9ed5d2a
Reduce storage
benjie Sep 1, 2023
85daa22
Don't bundle mermaid
benjie Sep 1, 2023
161ba36
Iterate on mermaid refactor
benjie Sep 1, 2023
297effc
Don't bundle mermaid
benjie Sep 1, 2023
df629f3
Downgrade API to mermaid 9, fix <br> in SVG
benjie Sep 1, 2023
9b93674
Lint
benjie Sep 1, 2023
64d90b3
Update more deps
benjie Sep 1, 2023
0e1742c
Update minor deps
benjie Sep 1, 2023
e9142c0
Declare more dependencies
benjie Sep 1, 2023
e64ada6
Upgrade @what-wg/fetch now graphql-http compatibility bug has been re…
benjie Sep 1, 2023
e613b47
docs(changeset): `mermaid-js` explain type no longer supported, inste…
benjie Sep 1, 2023
c3c1b99
v2 themes
benjie Sep 1, 2023
0f7a420
Downgrade MDX for Docusaurus compat
benjie Sep 1, 2023
1e425b2
Fix some posttest stuff
benjie Sep 1, 2023
3185369
Update yarn.lock
benjie Sep 1, 2023
c747d91
docs(changeset): Modules converted to ESM to fix compatibility with G…
benjie Sep 1, 2023
d58ee93
Fix Grafast website playground
benjie Sep 1, 2023
bba730f
Mermaid in playground
benjie Sep 1, 2023
c7bdf6d
Fix playground code editing
benjie Sep 1, 2023
149a803
Remove dead code
benjie Sep 1, 2023
1867d36
docs(changeset): Ruru now runs on React 18
benjie Sep 1, 2023
ac092e0
docs(changeset): PostGraphile no longer exports `GraphileBuild` nor `…
benjie Sep 1, 2023
c9bfd98
docs(changeset): Update dependencies (sometimes through major versions).
benjie Sep 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions .changeset/olive-cycles-listen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"postgraphile": patch
---

PostGraphile no longer exports `GraphileBuild` nor `GraphileConfig` - these are
global namespaces.
27 changes: 27 additions & 0 deletions .changeset/pink-toys-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
"@graphile/simplify-inflection": patch
"jest-serializer-graphql-schema": patch
"eslint-plugin-graphile-export": patch
"graphile-build-pg": patch
"graphile-build": patch
"graphile-utils": patch
"jest-serializer-simple": patch
"@grafserv/persisted": patch
"postgraphile": patch
"ruru-components": patch
"pg-introspection": patch
"@dataplan/json": patch
"graphile-config": patch
"graphile-export": patch
"@dataplan/pg": patch
"grafserv": patch
"pgl": patch
"grafast": patch
"tamedevil": patch
"graphile": patch
"pg-sql2": patch
"ruru": patch
"@graphile/lru": patch
---

Update dependencies (sometimes through major versions).
6 changes: 6 additions & 0 deletions .changeset/rich-socks-roll.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"ruru-components": patch
"ruru": patch
---

Ruru now runs on React 18
8 changes: 8 additions & 0 deletions .changeset/sour-penguins-prove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"grafast": patch
---

`mermaid-js` explain type no longer supported, instead use `plan` which produces
a JSON object. You can use the new
`import { planToMermaid } from 'grafast/mermaid'` to convert this object back
into a mermaid definition.
6 changes: 6 additions & 0 deletions .changeset/twelve-experts-trade.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"ruru-components": patch
"ruru": patch
---

Modules converted to ESM to fix compatibility with GraphiQL.
3 changes: 1 addition & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ module.exports = {

// note you must disable the base rule as it can report incorrect errors
"no-duplicate-imports": "off",
"import/no-duplicates": "off",
"@typescript-eslint/no-duplicate-imports": ["error"],
"import/no-duplicates": "error",
},
overrides: [
// Rules for core plugins
Expand Down
8 changes: 4 additions & 4 deletions grafast/bench/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@
"grafast": "workspace:^",
"graphile-config": "workspace:^",
"graphql": "^16.1.0-experimental-stream-defer.6",
"tslib": "^2.5.0"
"tslib": "^2.6.2"
},
"engines": {
"node": ">=16.10"
},
"devDependencies": {
"@types/glob": "^8.1.0",
"glob": "^10.2.2",
"nodemon": "^2.0.15",
"glob": "^10.3.4",
"nodemon": "^3.0.1",
"ts-node": "^10.9.1",
"typescript": "^5.0.4"
"typescript": "^5.2.2"
},
"files": [
"dist",
Expand Down
11 changes: 6 additions & 5 deletions grafast/bench/src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import * as fsp from "node:fs/promises";
import * as path from "node:path";
import { pathToFileURL } from "node:url";

import { glob } from "glob";
import { isSchema } from "grafast/graphql";
import { resolvePresets } from "graphile-config";
import type { ArgsFromOptions, Argv } from "graphile-config/cli";
import { loadConfig } from "graphile-config/load";
import * as fsp from "node:fs/promises";
import * as path from "node:path";
import { pathToFileURL } from "node:url";

import type { GrafastBenchConfig } from ".";
import { bench } from ".";
import type { GrafastBenchConfig } from "./index.js";
import { bench } from "./index.js";

export function options(yargs: Argv) {
return yargs
Expand Down
5 changes: 3 additions & 2 deletions grafast/bench/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { EventEmitter } from "node:stream";

import { execute, isAsyncIterable } from "grafast";
import type {
ExecutionPatchResult,
ExecutionResult,
GraphQLSchema,
} from "grafast/graphql";
import { parse, validate } from "grafast/graphql";
import { EventEmitter } from "node:stream";

import type { BenchOperation, GrafastBenchSetupResult } from "./interfaces.js";
export { GrafastBenchConfig } from "./interfaces.js";
Expand Down Expand Up @@ -37,7 +38,7 @@ export async function bench(
},
) {
const {
setup = () => ({} as any),
setup = () => ({}) as any,
teardown = () => {},
contextFactory = () => ({}),
} = options;
Expand Down
8 changes: 4 additions & 4 deletions grafast/dataplan-json/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"homepage": "https://github.com/graphile/heart/tree/main/grafast/dataplan-json",
"dependencies": {
"chalk": "^4.1.2",
"tslib": "^2.5.0"
"tslib": "^2.6.2"
},
"engines": {
"node": ">=14.17"
Expand All @@ -39,9 +39,9 @@
"dist"
],
"devDependencies": {
"@types/jest": "^27.5.1",
"jest": "^28.1.3",
"@types/jest": "^29.5.4",
"jest": "^29.6.4",
"jest-serializer-simple": "workspace:^",
"typescript": "^5.0.4"
"typescript": "^5.2.2"
}
}
7 changes: 4 additions & 3 deletions grafast/dataplan-pg/__tests__/example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
stripAnsi,
} from "grafast";
import type { AsyncExecutionResult, ExecutionResult } from "grafast/graphql";
import { planToMermaid } from "grafast/mermaid";
import { resolve } from "path";
import { Pool } from "pg";
import prettier from "prettier";
Expand Down Expand Up @@ -69,8 +70,8 @@ async function main() {
const ops = (extensions?.explain as any)?.operations;
if (ops) {
for (const op of ops) {
if (op.type === "mermaid-js") {
console.log(op.diagram);
if (op.type === "plan") {
console.log(planToMermaid(op.plan));
} else {
console.log(`UNKNOWN: ${op.type}`);
}
Expand Down Expand Up @@ -135,7 +136,7 @@ async function main() {
rootValue: null,
},
{
// explain: ["mermaid-js"],
// explain: ["plan"],
},
);

Expand Down
10 changes: 6 additions & 4 deletions grafast/dataplan-pg/__tests__/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
validate,
validateSchema,
} from "grafast/graphql";
import { planToMermaid } from "grafast/mermaid";
import { isAsyncIterable } from "iterall";
import JSON5 from "json5";
import { relative } from "path";
Expand Down Expand Up @@ -190,7 +191,7 @@ export async function runTestQuery(
const subscribe = grafastSubscribe;
const preset: GraphileConfig.ResolvedPreset = {
grafast: {
explain: ["mermaid-js"],
explain: ["plan"],
},
};
const result =
Expand Down Expand Up @@ -528,9 +529,10 @@ export const assertSnapshotsMatch = async (
// Consistently end in a newline
await snapshot(formattedQueries + "\n", sqlFileName);
} else if (only === "mermaid") {
const graphString = extensions?.explain?.operations?.find(
(op) => op.type === "mermaid-js",
)?.diagram;
const planOp = extensions?.explain?.operations?.find(
(op) => op.type === "plan",
);
const graphString = planToMermaid(planOp.plan);
const mermaidFileName = basePath + (ext || "") + ".mermaid";
if (!graphString) {
throw new Error("No plan was emitted for this test!");
Expand Down
Loading