diff --git a/examples/30_gql/gql_gql-document-node.ts b/examples/30_gql/gql_gql-document-node.ts index 30b7edf73..d398b48db 100644 --- a/examples/30_gql/gql_gql-document-node.ts +++ b/examples/30_gql/gql_gql-document-node.ts @@ -3,7 +3,8 @@ */ import { parse } from 'graphql' -import { Opentelemetry, Throws } from '../../src/entrypoints/extensions.js' +import { Opentelemetry } from '../../src/entrypoints/extensions/opentelemetry/runtime.js' +import { Throws } from '../../src/entrypoints/extensions/throws/runtime.js' import { Graffle } from '../../src/entrypoints/main.js' import { publicGraphQLSchemaEndpoints, show } from '../$/helpers.js' diff --git a/examples/60_extension/extension_introspection__introspection.ts b/examples/60_extension/extension_introspection__introspection.ts index d48ce617c..2192fa35d 100644 --- a/examples/60_extension/extension_introspection__introspection.ts +++ b/examples/60_extension/extension_introspection__introspection.ts @@ -2,7 +2,7 @@ * This example shows how to use the Introspection extension to easily introspect your schema. */ -import { Introspection } from '../../src/entrypoints/extensions.js' +import { Introspection } from '../../src/entrypoints/extensions/introspection/runtime.js' import { Pokemon } from '../../tests/_/schemas/pokemon/graffle/__.js' import { interceptAndShowUncaughtErrors, show } from '../$/show.js' diff --git a/examples/60_extension/extension_opentelemetry__opentelemetry.ts b/examples/60_extension/extension_opentelemetry__opentelemetry.ts index b976b10aa..345556b57 100644 --- a/examples/60_extension/extension_opentelemetry__opentelemetry.ts +++ b/examples/60_extension/extension_opentelemetry__opentelemetry.ts @@ -1,6 +1,6 @@ import { ConsoleSpanExporter, SimpleSpanProcessor } from '@opentelemetry/sdk-trace-base' import { NodeTracerProvider } from '@opentelemetry/sdk-trace-node' -import { Opentelemetry } from '../../src/entrypoints/extensions.js' +import { Opentelemetry } from '../../src/entrypoints/extensions/opentelemetry/runtime.js' import { Pokemon } from '../../tests/_/schemas/pokemon/graffle/__.js' import { interceptAndShowOutput, show } from '../$/helpers.js' diff --git a/examples/60_extension/extension_throws__throws.ts b/examples/60_extension/extension_throws__throws.ts index 8c6fe09a7..da8e558d3 100644 --- a/examples/60_extension/extension_throws__throws.ts +++ b/examples/60_extension/extension_throws__throws.ts @@ -2,7 +2,7 @@ * This example shows how to use the Throws extension to throw errors for one-off cases. */ -import { Throws } from '../../src/entrypoints/extensions.js' +import { Throws } from '../../src/entrypoints/extensions/throws/runtime.js' import { Pokemon } from '../../tests/_/schemas/pokemon/graffle/__.js' import { interceptAndShowUncaughtErrors, show } from '../$/show.js' diff --git a/examples/__outputs__/10_transport-http/transport-http_extension_headers__dynamicHeaders.output.txt b/examples/__outputs__/10_transport-http/transport-http_extension_headers__dynamicHeaders.output.txt index c79aa7808..ddfd4dd3e 100644 --- a/examples/__outputs__/10_transport-http/transport-http_extension_headers__dynamicHeaders.output.txt +++ b/examples/__outputs__/10_transport-http/transport-http_extension_headers__dynamicHeaders.output.txt @@ -4,7 +4,7 @@ headers: Headers { accept: 'application/graphql-response+json; charset=utf-8, application/json; charset=utf-8', 'content-type': 'application/json', - 'x-sent-at-time': '1729696838476' + 'x-sent-at-time': '1729824583010' }, signal: undefined, method: 'post', diff --git a/examples/__outputs__/20_output/output_envelope.output.txt b/examples/__outputs__/20_output/output_envelope.output.txt index cc680b831..19e0af908 100644 --- a/examples/__outputs__/20_output/output_envelope.output.txt +++ b/examples/__outputs__/20_output/output_envelope.output.txt @@ -10,15 +10,13 @@ { name: 'Weedle' } ] }, - errors: undefined, - extensions: undefined, response: Response { status: 200, statusText: 'OK', headers: Headers { 'content-type': 'application/graphql-response+json; charset=utf-8', 'content-length': '142', - date: 'Wed, 23 Oct 2024 15:20:39 GMT', + date: 'Fri, 25 Oct 2024 02:49:44 GMT', connection: 'keep-alive', 'keep-alive': 'timeout=5' }, diff --git a/examples/__outputs__/60_extension/extension_opentelemetry__opentelemetry.output.txt b/examples/__outputs__/60_extension/extension_opentelemetry__opentelemetry.output.txt index 7a1d936c7..27fcdbde4 100644 --- a/examples/__outputs__/60_extension/extension_opentelemetry__opentelemetry.output.txt +++ b/examples/__outputs__/60_extension/extension_opentelemetry__opentelemetry.output.txt @@ -5,18 +5,18 @@ 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.7.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.26.0' + 'telemetry.sdk.version': '1.27.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '9d3e044ef7452a5b0e773ac8a7e6c8bd', - parentId: 'fdbedbd147dc630c', + traceId: '3b96fa441684458a1d46a660a7980d58', + parentId: 'f1eb7799e82ca59a', traceState: undefined, name: 'encode', - id: '4f8b5fccd96cc062', + id: 'bb6b0c035e3cbc85', kind: 0, - timestamp: 1729696839648000, - duration: 1705.875, + timestamp: 1729824584441000, + duration: 1365.042, attributes: {}, status: { code: 0 }, events: [], @@ -29,18 +29,18 @@ 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.7.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.26.0' + 'telemetry.sdk.version': '1.27.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '9d3e044ef7452a5b0e773ac8a7e6c8bd', - parentId: 'fdbedbd147dc630c', + traceId: '3b96fa441684458a1d46a660a7980d58', + parentId: 'f1eb7799e82ca59a', traceState: undefined, name: 'pack', - id: 'a2cb6c68bb391b81', + id: '996cd2f8c264080a', kind: 0, - timestamp: 1729696839652000, - duration: 16711.541, + timestamp: 1729824584444000, + duration: 12774.667, attributes: {}, status: { code: 0 }, events: [], @@ -53,18 +53,18 @@ 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.7.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.26.0' + 'telemetry.sdk.version': '1.27.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '9d3e044ef7452a5b0e773ac8a7e6c8bd', - parentId: 'fdbedbd147dc630c', + traceId: '3b96fa441684458a1d46a660a7980d58', + parentId: 'f1eb7799e82ca59a', traceState: undefined, name: 'exchange', - id: '95bc25186061869d', + id: '3ad972c399fb8ec2', kind: 0, - timestamp: 1729696839669000, - duration: 21608.417, + timestamp: 1729824584458000, + duration: 21008.167, attributes: {}, status: { code: 0 }, events: [], @@ -77,18 +77,18 @@ 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.7.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.26.0' + 'telemetry.sdk.version': '1.27.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '9d3e044ef7452a5b0e773ac8a7e6c8bd', - parentId: 'fdbedbd147dc630c', + traceId: '3b96fa441684458a1d46a660a7980d58', + parentId: 'f1eb7799e82ca59a', traceState: undefined, name: 'unpack', - id: 'f33a840d705729c6', + id: 'bbdb7c3156b126e9', kind: 0, - timestamp: 1729696839691000, - duration: 1755.75, + timestamp: 1729824584479000, + duration: 1927.291, attributes: {}, status: { code: 0 }, events: [], @@ -101,18 +101,18 @@ 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.7.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.26.0' + 'telemetry.sdk.version': '1.27.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '9d3e044ef7452a5b0e773ac8a7e6c8bd', - parentId: 'fdbedbd147dc630c', + traceId: '3b96fa441684458a1d46a660a7980d58', + parentId: 'f1eb7799e82ca59a', traceState: undefined, name: 'decode', - id: 'd5abeead8c05a053', + id: 'e311421c9b0a3a5d', kind: 0, - timestamp: 1729696839693000, - duration: 313.709, + timestamp: 1729824584481000, + duration: 221.916, attributes: {}, status: { code: 0 }, events: [], @@ -125,18 +125,18 @@ 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.7.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.26.0' + 'telemetry.sdk.version': '1.27.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '9d3e044ef7452a5b0e773ac8a7e6c8bd', + traceId: '3b96fa441684458a1d46a660a7980d58', parentId: undefined, traceState: undefined, name: 'request', - id: 'fdbedbd147dc630c', + id: 'f1eb7799e82ca59a', kind: 0, - timestamp: 1729696839647000, - duration: 46403, + timestamp: 1729824584440000, + duration: 40916.625, attributes: {}, status: { code: 0 }, events: [], diff --git a/package.json b/package.json index 4e4b5357f..706e5ab5f 100644 --- a/package.json +++ b/package.json @@ -18,9 +18,34 @@ "default": "./build/entrypoints/generator.js" } }, - "./extensions": { + "./extensions/upload": { "import": { - "default": "./build/entrypoints/extensions.js" + "default": "./build/entrypoints/extensions/upload/runtime.js" + } + }, + "./extensions/throws": { + "import": { + "default": "./build/entrypoints/extensions/throws/runtime.js" + } + }, + "./extensions/opentelemetry": { + "import": { + "default": "./build/entrypoints/extensions/opentelemetry/runtime.js" + } + }, + "./extensions/introspection": { + "import": { + "default": "./build/entrypoints/extensions/introspection/runtime.js" + } + }, + "./extensions/schema-errors": { + "import": { + "default": "./build/entrypoints/extensions/schema-errors/runtime.js" + } + }, + "./extensions/schema-errors/generator": { + "import": { + "default": "./build/entrypoints/extensions/schema-errors/gentime.js" } }, "./client": { diff --git a/scripts/generate-examples-derivatives/generate-docs.ts b/scripts/generate-examples-derivatives/generate-docs.ts index a0d0d344e..0757667f6 100644 --- a/scripts/generate-examples-derivatives/generate-docs.ts +++ b/scripts/generate-examples-derivatives/generate-docs.ts @@ -131,6 +131,14 @@ const generateExampleLinksSnippets = async (examplesTransformed: ExampleTransfor const transformRewriteGraffleImports = (example: Example) => { const newContent = example.file.content .replaceAll(/from '.+\/tests\/_\/schemas\/(.*)\/graffle\/(.+)\.js'/g, `from './$1/$2.js'`) + .replaceAll( + /from '.*entrypoints\/extensions\/(.*?)\/runtime.js'/g, + `from 'graffle/extensions/$1'`, + ) + .replaceAll( + /from '.*entrypoints\/extensions\/(.*?)\/gentime.js'/g, + `from 'graffle/extensions/$1/generator'`, + ) .replaceAll( /from '.*entrypoints\/main.js'/g, `from 'graffle'`, diff --git a/src/entrypoints/extensions.ts b/src/entrypoints/extensions.ts deleted file mode 100644 index f25590107..000000000 --- a/src/entrypoints/extensions.ts +++ /dev/null @@ -1,5 +0,0 @@ -export { Introspection } from '../extensions/Introspection/Introspection.js' -export { Opentelemetry } from '../extensions/Opentelemetry/Opentelemetry.js' -export { SchemaErrors } from '../extensions/SchemaErrors/SchemaErrors.js' -export { Throws } from '../extensions/Throws/Throws.js' -export { Upload } from '../extensions/Upload/Upload.js' diff --git a/src/entrypoints/extensions/introspection/runtime.ts b/src/entrypoints/extensions/introspection/runtime.ts new file mode 100644 index 000000000..ea9ade3e6 --- /dev/null +++ b/src/entrypoints/extensions/introspection/runtime.ts @@ -0,0 +1 @@ +export { Introspection } from '../../../extensions/Introspection/Introspection.js' diff --git a/src/entrypoints/extensions/opentelemetry/runtime.ts b/src/entrypoints/extensions/opentelemetry/runtime.ts new file mode 100644 index 000000000..5025a7c59 --- /dev/null +++ b/src/entrypoints/extensions/opentelemetry/runtime.ts @@ -0,0 +1 @@ +export { Opentelemetry } from '../../../extensions/Opentelemetry/Opentelemetry.js' diff --git a/src/entrypoints/extensions/schema-errors/_.ts b/src/entrypoints/extensions/schema-errors/_.ts deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/entrypoints/extensions/schema-errors/generator/_.ts b/src/entrypoints/extensions/schema-errors/generator/_.ts deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/entrypoints/extensions/schema-errors/gentime.ts b/src/entrypoints/extensions/schema-errors/gentime.ts new file mode 100644 index 000000000..5048f58b3 --- /dev/null +++ b/src/entrypoints/extensions/schema-errors/gentime.ts @@ -0,0 +1 @@ +export { SchemaErrors } from '../../../extensions/SchemaErrors/gentime.js' diff --git a/src/entrypoints/extensions/schema-errors/runtime.ts b/src/entrypoints/extensions/schema-errors/runtime.ts new file mode 100644 index 000000000..c8703e6bb --- /dev/null +++ b/src/entrypoints/extensions/schema-errors/runtime.ts @@ -0,0 +1 @@ +export { SchemaErrors } from '../../../extensions/SchemaErrors/runtime.js' diff --git a/src/entrypoints/extensions/throws/runtime.ts b/src/entrypoints/extensions/throws/runtime.ts new file mode 100644 index 000000000..57fea0774 --- /dev/null +++ b/src/entrypoints/extensions/throws/runtime.ts @@ -0,0 +1 @@ +export { Throws } from '../../../extensions/Throws/Throws.js' diff --git a/src/entrypoints/extensions/upload/runtime.ts b/src/entrypoints/extensions/upload/runtime.ts new file mode 100644 index 000000000..d3eae2ebf --- /dev/null +++ b/src/entrypoints/extensions/upload/runtime.ts @@ -0,0 +1 @@ +export { Upload } from '../../../extensions/Upload/Upload.js' diff --git a/src/extensions/Introspection/Introspection.ts b/src/extensions/Introspection/Introspection.ts index b28878754..2bafa1f5c 100644 --- a/src/extensions/Introspection/Introspection.ts +++ b/src/extensions/Introspection/Introspection.ts @@ -12,7 +12,7 @@ import { createConfig, type Input } from './config.js' * @example * * ```ts - * import { Introspection } from 'graffle/extensions' + * import { Introspection } from 'graffle/extensions/introspection' * * const graffle = new Graffle({ * schema: 'http://localhost:3000/graphql', diff --git a/src/extensions/Opentelemetry/documentation.md b/src/extensions/Opentelemetry/documentation.md index d15dfc56b..0c60174d8 100644 --- a/src/extensions/Opentelemetry/documentation.md +++ b/src/extensions/Opentelemetry/documentation.md @@ -16,7 +16,7 @@ pnpm add @opentelemetry/api ```ts twoslash import { Graffle } from 'graffle' -import { Opentelemetry } from 'graffle/extensions' +import { Opentelemetry } from 'graffle/extensions/opentelemetry' const graffle = Graffle.create({ schema: '...' }).use(Opentelemetry()) ``` diff --git a/src/extensions/SchemaErrors/documentation.md b/src/extensions/SchemaErrors/documentation.md index 60effbfbe..15a7a4b50 100644 --- a/src/extensions/SchemaErrors/documentation.md +++ b/src/extensions/SchemaErrors/documentation.md @@ -9,7 +9,7 @@ This extension requires generation and also itself extends the generator. You mu ```ts // graffle.config.ts -import { SchemaErrors } from 'graffle/extensions' +import { SchemaErrors } from 'graffle/extensions/schema-errors/generator' import { Generator } from 'graffle/generator' export default Generator @@ -20,7 +20,7 @@ export default Generator ```ts twoslash // your/app/code.ts import { Graffle } from 'graffle' -import { SchemaErrors } from 'graffle/extensions' +import { SchemaErrors } from 'graffle/extensions/schema-errors' const graffle = Graffle.create({ schema: '...' }).use(SchemaErrors()) ``` diff --git a/src/extensions/SchemaErrors/generator.ts b/src/extensions/SchemaErrors/gentime.ts similarity index 100% rename from src/extensions/SchemaErrors/generator.ts rename to src/extensions/SchemaErrors/gentime.ts diff --git a/src/extensions/SchemaErrors/SchemaErrors.ts b/src/extensions/SchemaErrors/runtime.ts similarity index 100% rename from src/extensions/SchemaErrors/SchemaErrors.ts rename to src/extensions/SchemaErrors/runtime.ts diff --git a/src/extensions/SchemaErrors/tests/SchemaError.test-d.ts b/src/extensions/SchemaErrors/tests/SchemaError.test-d.ts index 3c597e3b6..9bcb1d94c 100644 --- a/src/extensions/SchemaErrors/tests/SchemaError.test-d.ts +++ b/src/extensions/SchemaErrors/tests/SchemaError.test-d.ts @@ -1,7 +1,7 @@ import { describe, expectTypeOf, test } from 'vitest' import { schema } from '../../../../tests/_/schemas/kitchen-sink/schema.js' import { type Extension } from '../../../layers/6_client/extension/extension.js' -import { SchemaErrors } from '../SchemaErrors.js' +import { SchemaErrors } from '../runtime.js' import { GraffleSchemaErrors } from './fixture/graffle/__.js' const g = GraffleSchemaErrors.create({ schema }).use(SchemaErrors()) diff --git a/src/extensions/SchemaErrors/tests/SchemaErrors.test.ts b/src/extensions/SchemaErrors/tests/SchemaErrors.test.ts index 904b92dac..cf2beba6e 100644 --- a/src/extensions/SchemaErrors/tests/SchemaErrors.test.ts +++ b/src/extensions/SchemaErrors/tests/SchemaErrors.test.ts @@ -3,7 +3,7 @@ import { describe, expect, test } from 'vitest' import { db } from '../../../../tests/_/schemas/db.js' import { schema } from '../../../../tests/_/schemas/kitchen-sink/schema.js' import type { Errors } from '../../../lib/errors/__.js' -import { SchemaErrors } from '../SchemaErrors.js' +import { SchemaErrors } from '../runtime.js' import { GraffleSchemaErrors } from './fixture/graffle/__.js' const graffle = GraffleSchemaErrors diff --git a/src/extensions/SchemaErrors/tests/fixture/graffle.config.ts b/src/extensions/SchemaErrors/tests/fixture/graffle.config.ts index 7ee6278a0..2cc3fab35 100644 --- a/src/extensions/SchemaErrors/tests/fixture/graffle.config.ts +++ b/src/extensions/SchemaErrors/tests/fixture/graffle.config.ts @@ -1,6 +1,6 @@ import { schema } from '../../../../../tests/_/schemas/kitchen-sink/schema.js' import { Generator } from '../../../../entrypoints/generator.js' -import { SchemaErrors } from '../../generator.js' +import { SchemaErrors } from '../../gentime.js' export default Generator .configure({ diff --git a/src/extensions/Throws/documentation.md b/src/extensions/Throws/documentation.md index 84ed6e695..131d86dd9 100644 --- a/src/extensions/Throws/documentation.md +++ b/src/extensions/Throws/documentation.md @@ -36,7 +36,7 @@ graffle.throws().query.foo() ```ts twoslash import { Graffle } from 'graffle' -import { Throws } from 'graffle/extensions' +import { Throws } from 'graffle/extensions/throws' const graffle = Graffle.create({ schema: '...' }).use(Throws()) ``` diff --git a/src/extensions/Upload/documentation.md b/src/extensions/Upload/documentation.md index 0f42fb253..46cb19f36 100644 --- a/src/extensions/Upload/documentation.md +++ b/src/extensions/Upload/documentation.md @@ -10,7 +10,7 @@ Adds support for [GraphQL Multipart Request](https://github.com/jaydenseric/grap ```ts twoslash import { Graffle } from 'graffle' -import { Upload } from 'graffle/extensions' +import { Upload } from 'graffle/extensions/upload' const graffle = Graffle.create({ schema: '...' }).use(Upload()) ``` diff --git a/src/generator/config/config.ts b/src/generator/config/config.ts index ca8060c5f..e5d6d0c98 100644 --- a/src/generator/config/config.ts +++ b/src/generator/config/config.ts @@ -1,7 +1,7 @@ import fs from 'node:fs/promises' import * as Path from 'node:path' import { Graffle } from '../../entrypoints/__Graffle.js' -import { Introspection } from '../../entrypoints/extensions.js' +import { Introspection } from '../../extensions/Introspection/Introspection.js' import { ConfigManager } from '../../lib/config-manager/__.js' import { fileExists, isPathToADirectory, toAbsolutePath, toFilePath } from '../../lib/fs.js' import { Grafaid } from '../../lib/grafaid/__.js' diff --git a/website/content/_snippets/examples/extension/introspection.detail.md b/website/content/_snippets/examples/extension/introspection.detail.md index 9cfd45144..15c9b734d 100644 --- a/website/content/_snippets/examples/extension/introspection.detail.md +++ b/website/content/_snippets/examples/extension/introspection.detail.md @@ -5,7 +5,7 @@ ```ts twoslash -import { Introspection } from 'graffle/extensions' +import { Introspection } from 'graffle/extensions/introspection' import { Pokemon } from './pokemon/__.js' const pokemon = Pokemon.create().use(Introspection()) diff --git a/website/content/_snippets/examples/extension/introspection.md b/website/content/_snippets/examples/extension/introspection.md index 90175c539..596d05535 100644 --- a/website/content/_snippets/examples/extension/introspection.md +++ b/website/content/_snippets/examples/extension/introspection.md @@ -3,7 +3,7 @@ ```ts twoslash -import { Introspection } from 'graffle/extensions' +import { Introspection } from 'graffle/extensions/introspection' import { Pokemon } from './pokemon/__.js' const pokemon = Pokemon.create().use(Introspection()) diff --git a/website/content/_snippets/examples/extension/opentelemetry.detail.md b/website/content/_snippets/examples/extension/opentelemetry.detail.md index 58e072f0f..8ae539afa 100644 --- a/website/content/_snippets/examples/extension/opentelemetry.detail.md +++ b/website/content/_snippets/examples/extension/opentelemetry.detail.md @@ -7,7 +7,7 @@ ```ts twoslash import { ConsoleSpanExporter, SimpleSpanProcessor } from '@opentelemetry/sdk-trace-base' import { NodeTracerProvider } from '@opentelemetry/sdk-trace-node' -import { Opentelemetry } from 'graffle/extensions' +import { Opentelemetry } from 'graffle/extensions/opentelemetry' import { Pokemon } from './pokemon/__.js' // Setup Opentelemetry @@ -33,18 +33,18 @@ console.log(data) 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.7.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.26.0' + 'telemetry.sdk.version': '1.27.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '9d3e044ef7452a5b0e773ac8a7e6c8bd', - parentId: 'fdbedbd147dc630c', + traceId: '3b96fa441684458a1d46a660a7980d58', + parentId: 'f1eb7799e82ca59a', traceState: undefined, name: 'encode', - id: '4f8b5fccd96cc062', + id: 'bb6b0c035e3cbc85', kind: 0, - timestamp: 1729696839648000, - duration: 1705.875, + timestamp: 1729824584441000, + duration: 1365.042, attributes: {}, status: { code: 0 }, events: [], @@ -60,18 +60,18 @@ console.log(data) 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.7.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.26.0' + 'telemetry.sdk.version': '1.27.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '9d3e044ef7452a5b0e773ac8a7e6c8bd', - parentId: 'fdbedbd147dc630c', + traceId: '3b96fa441684458a1d46a660a7980d58', + parentId: 'f1eb7799e82ca59a', traceState: undefined, name: 'pack', - id: 'a2cb6c68bb391b81', + id: '996cd2f8c264080a', kind: 0, - timestamp: 1729696839652000, - duration: 16711.541, + timestamp: 1729824584444000, + duration: 12774.667, attributes: {}, status: { code: 0 }, events: [], @@ -87,18 +87,18 @@ console.log(data) 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.7.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.26.0' + 'telemetry.sdk.version': '1.27.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '9d3e044ef7452a5b0e773ac8a7e6c8bd', - parentId: 'fdbedbd147dc630c', + traceId: '3b96fa441684458a1d46a660a7980d58', + parentId: 'f1eb7799e82ca59a', traceState: undefined, name: 'exchange', - id: '95bc25186061869d', + id: '3ad972c399fb8ec2', kind: 0, - timestamp: 1729696839669000, - duration: 21608.417, + timestamp: 1729824584458000, + duration: 21008.167, attributes: {}, status: { code: 0 }, events: [], @@ -114,18 +114,18 @@ console.log(data) 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.7.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.26.0' + 'telemetry.sdk.version': '1.27.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '9d3e044ef7452a5b0e773ac8a7e6c8bd', - parentId: 'fdbedbd147dc630c', + traceId: '3b96fa441684458a1d46a660a7980d58', + parentId: 'f1eb7799e82ca59a', traceState: undefined, name: 'unpack', - id: 'f33a840d705729c6', + id: 'bbdb7c3156b126e9', kind: 0, - timestamp: 1729696839691000, - duration: 1755.75, + timestamp: 1729824584479000, + duration: 1927.291, attributes: {}, status: { code: 0 }, events: [], @@ -141,18 +141,18 @@ console.log(data) 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.7.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.26.0' + 'telemetry.sdk.version': '1.27.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '9d3e044ef7452a5b0e773ac8a7e6c8bd', - parentId: 'fdbedbd147dc630c', + traceId: '3b96fa441684458a1d46a660a7980d58', + parentId: 'f1eb7799e82ca59a', traceState: undefined, name: 'decode', - id: 'd5abeead8c05a053', + id: 'e311421c9b0a3a5d', kind: 0, - timestamp: 1729696839693000, - duration: 313.709, + timestamp: 1729824584481000, + duration: 221.916, attributes: {}, status: { code: 0 }, events: [], @@ -168,18 +168,18 @@ console.log(data) 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.7.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.26.0' + 'telemetry.sdk.version': '1.27.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '9d3e044ef7452a5b0e773ac8a7e6c8bd', + traceId: '3b96fa441684458a1d46a660a7980d58', parentId: undefined, traceState: undefined, name: 'request', - id: 'fdbedbd147dc630c', + id: 'f1eb7799e82ca59a', kind: 0, - timestamp: 1729696839647000, - duration: 46403, + timestamp: 1729824584440000, + duration: 40916.625, attributes: {}, status: { code: 0 }, events: [], diff --git a/website/content/_snippets/examples/extension/opentelemetry.md b/website/content/_snippets/examples/extension/opentelemetry.md index b7cec88a7..7b1ea8cf3 100644 --- a/website/content/_snippets/examples/extension/opentelemetry.md +++ b/website/content/_snippets/examples/extension/opentelemetry.md @@ -5,7 +5,7 @@ ```ts twoslash import { ConsoleSpanExporter, SimpleSpanProcessor } from '@opentelemetry/sdk-trace-base' import { NodeTracerProvider } from '@opentelemetry/sdk-trace-node' -import { Opentelemetry } from 'graffle/extensions' +import { Opentelemetry } from 'graffle/extensions/opentelemetry' import { Pokemon } from './pokemon/__.js' // Setup Opentelemetry @@ -31,18 +31,18 @@ console.log(data) 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.7.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.26.0' + 'telemetry.sdk.version': '1.27.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '9d3e044ef7452a5b0e773ac8a7e6c8bd', - parentId: 'fdbedbd147dc630c', + traceId: '3b96fa441684458a1d46a660a7980d58', + parentId: 'f1eb7799e82ca59a', traceState: undefined, name: 'encode', - id: '4f8b5fccd96cc062', + id: 'bb6b0c035e3cbc85', kind: 0, - timestamp: 1729696839648000, - duration: 1705.875, + timestamp: 1729824584441000, + duration: 1365.042, attributes: {}, status: { code: 0 }, events: [], @@ -58,18 +58,18 @@ console.log(data) 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.7.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.26.0' + 'telemetry.sdk.version': '1.27.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '9d3e044ef7452a5b0e773ac8a7e6c8bd', - parentId: 'fdbedbd147dc630c', + traceId: '3b96fa441684458a1d46a660a7980d58', + parentId: 'f1eb7799e82ca59a', traceState: undefined, name: 'pack', - id: 'a2cb6c68bb391b81', + id: '996cd2f8c264080a', kind: 0, - timestamp: 1729696839652000, - duration: 16711.541, + timestamp: 1729824584444000, + duration: 12774.667, attributes: {}, status: { code: 0 }, events: [], @@ -85,18 +85,18 @@ console.log(data) 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.7.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.26.0' + 'telemetry.sdk.version': '1.27.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '9d3e044ef7452a5b0e773ac8a7e6c8bd', - parentId: 'fdbedbd147dc630c', + traceId: '3b96fa441684458a1d46a660a7980d58', + parentId: 'f1eb7799e82ca59a', traceState: undefined, name: 'exchange', - id: '95bc25186061869d', + id: '3ad972c399fb8ec2', kind: 0, - timestamp: 1729696839669000, - duration: 21608.417, + timestamp: 1729824584458000, + duration: 21008.167, attributes: {}, status: { code: 0 }, events: [], @@ -112,18 +112,18 @@ console.log(data) 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.7.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.26.0' + 'telemetry.sdk.version': '1.27.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '9d3e044ef7452a5b0e773ac8a7e6c8bd', - parentId: 'fdbedbd147dc630c', + traceId: '3b96fa441684458a1d46a660a7980d58', + parentId: 'f1eb7799e82ca59a', traceState: undefined, name: 'unpack', - id: 'f33a840d705729c6', + id: 'bbdb7c3156b126e9', kind: 0, - timestamp: 1729696839691000, - duration: 1755.75, + timestamp: 1729824584479000, + duration: 1927.291, attributes: {}, status: { code: 0 }, events: [], @@ -139,18 +139,18 @@ console.log(data) 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.7.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.26.0' + 'telemetry.sdk.version': '1.27.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '9d3e044ef7452a5b0e773ac8a7e6c8bd', - parentId: 'fdbedbd147dc630c', + traceId: '3b96fa441684458a1d46a660a7980d58', + parentId: 'f1eb7799e82ca59a', traceState: undefined, name: 'decode', - id: 'd5abeead8c05a053', + id: 'e311421c9b0a3a5d', kind: 0, - timestamp: 1729696839693000, - duration: 313.709, + timestamp: 1729824584481000, + duration: 221.916, attributes: {}, status: { code: 0 }, events: [], @@ -166,18 +166,18 @@ console.log(data) 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.7.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.26.0' + 'telemetry.sdk.version': '1.27.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '9d3e044ef7452a5b0e773ac8a7e6c8bd', + traceId: '3b96fa441684458a1d46a660a7980d58', parentId: undefined, traceState: undefined, name: 'request', - id: 'fdbedbd147dc630c', + id: 'f1eb7799e82ca59a', kind: 0, - timestamp: 1729696839647000, - duration: 46403, + timestamp: 1729824584440000, + duration: 40916.625, attributes: {}, status: { code: 0 }, events: [], diff --git a/website/content/_snippets/examples/extension/throws.detail.md b/website/content/_snippets/examples/extension/throws.detail.md index ba76ff3a2..1ce2fa3cd 100644 --- a/website/content/_snippets/examples/extension/throws.detail.md +++ b/website/content/_snippets/examples/extension/throws.detail.md @@ -5,7 +5,7 @@ ```ts twoslash -import { Throws } from 'graffle/extensions' +import { Throws } from 'graffle/extensions/throws' import { Pokemon } from './pokemon/__.js' const pokemon = Pokemon diff --git a/website/content/_snippets/examples/extension/throws.md b/website/content/_snippets/examples/extension/throws.md index 135eb8a14..1a4b936f5 100644 --- a/website/content/_snippets/examples/extension/throws.md +++ b/website/content/_snippets/examples/extension/throws.md @@ -3,7 +3,7 @@ ```ts twoslash -import { Throws } from 'graffle/extensions' +import { Throws } from 'graffle/extensions/throws' import { Pokemon } from './pokemon/__.js' const pokemon = Pokemon diff --git a/website/content/_snippets/examples/gql/gql-document-node.detail.md b/website/content/_snippets/examples/gql/gql-document-node.detail.md index 55018f978..cd636fb84 100644 --- a/website/content/_snippets/examples/gql/gql-document-node.detail.md +++ b/website/content/_snippets/examples/gql/gql-document-node.detail.md @@ -6,7 +6,8 @@ ```ts twoslash import { parse } from 'graphql' -import { Opentelemetry, Throws } from 'graffle/extensions' +import { Opentelemetry } from 'graffle/extensions/opentelemetry' +import { Throws } from 'graffle/extensions/throws' import { Graffle } from 'graffle' const graffle = Graffle.create({ diff --git a/website/content/_snippets/examples/gql/gql-document-node.md b/website/content/_snippets/examples/gql/gql-document-node.md index af65235d2..19b87dacf 100644 --- a/website/content/_snippets/examples/gql/gql-document-node.md +++ b/website/content/_snippets/examples/gql/gql-document-node.md @@ -4,7 +4,8 @@ ```ts twoslash import { parse } from 'graphql' -import { Opentelemetry, Throws } from 'graffle/extensions' +import { Opentelemetry } from 'graffle/extensions/opentelemetry' +import { Throws } from 'graffle/extensions/throws' import { Graffle } from 'graffle' const graffle = Graffle.create({ diff --git a/website/content/_snippets/examples/output/envelope.detail.md b/website/content/_snippets/examples/output/envelope.detail.md index cddb96a17..5c1b6955d 100644 --- a/website/content/_snippets/examples/output/envelope.detail.md +++ b/website/content/_snippets/examples/output/envelope.detail.md @@ -32,15 +32,13 @@ console.log(result) { name: 'Weedle' } ] }, - errors: undefined, - extensions: undefined, response: Response { status: 200, statusText: 'OK', headers: Headers { 'content-type': 'application/graphql-response+json; charset=utf-8', 'content-length': '142', - date: 'Wed, 23 Oct 2024 15:20:39 GMT', + date: 'Fri, 25 Oct 2024 02:49:44 GMT', connection: 'keep-alive', 'keep-alive': 'timeout=5' }, diff --git a/website/content/_snippets/examples/output/envelope.md b/website/content/_snippets/examples/output/envelope.md index c94614dc8..a02f376f9 100644 --- a/website/content/_snippets/examples/output/envelope.md +++ b/website/content/_snippets/examples/output/envelope.md @@ -30,15 +30,13 @@ console.log(result) { name: 'Weedle' } ] }, - errors: undefined, - extensions: undefined, response: Response { status: 200, statusText: 'OK', headers: Headers { 'content-type': 'application/graphql-response+json; charset=utf-8', 'content-length': '142', - date: 'Wed, 23 Oct 2024 15:20:39 GMT', + date: 'Fri, 25 Oct 2024 02:49:44 GMT', connection: 'keep-alive', 'keep-alive': 'timeout=5' }, diff --git a/website/content/_snippets/examples/output/return-error-execution.detail.md b/website/content/_snippets/examples/output/return-error-execution.detail.md index e7dd5d3ea..2efa8cf35 100644 --- a/website/content/_snippets/examples/output/return-error-execution.detail.md +++ b/website/content/_snippets/examples/output/return-error-execution.detail.md @@ -54,7 +54,7 @@ ContextualAggregateError: One or more errors in the execution result. context: {}, cause: undefined, errors: [ - GraphQLError: [ + ContextualError: [ { "code": "too_small", "minimum": 1, @@ -67,15 +67,15 @@ ContextualAggregateError: One or more errors in the execution result. ] } ] - at (/some/path/to/http.ts:XX:XX:47) + at (/some/path/to/handleOutput.ts:XX:XX:16) at Array.map () - at parseExecutionResult (/some/path/to/http.ts:XX:XX:28) - at Object.unpack (/some/path/to/core.ts:XX:XX:26) + at handleOutput (/some/path/to/handleOutput.ts:XX:XX:21) + at executeDocument (/some/path/to/requestMethods.ts:XX:XX:10) at process.processTicksAndRejections (node:internal/process/task_queues:XX:XX) - at async runHook (/some/path/to/runHook.ts:XX:XX:16) { - path: [ 'addPokemon' ], - locations: undefined, - extensions: [Object: null prototype] {} + at async executeRootField (/some/path/to/requestMethods.ts:XX:XX:18) + at async (/some/path/to/output_return-error_return-error-execution__return-error-execution.ts:XX:XX:16) { + context: { locations: [ { line: 2, column: 3 } ], path: [ 'addPokemon' ] }, + cause: undefined } ] } diff --git a/website/content/_snippets/examples/output/return-error-execution.md b/website/content/_snippets/examples/output/return-error-execution.md index 2951c10f8..5352993b5 100644 --- a/website/content/_snippets/examples/output/return-error-execution.md +++ b/website/content/_snippets/examples/output/return-error-execution.md @@ -52,7 +52,7 @@ ContextualAggregateError: One or more errors in the execution result. context: {}, cause: undefined, errors: [ - GraphQLError: [ + ContextualError: [ { "code": "too_small", "minimum": 1, @@ -65,15 +65,15 @@ ContextualAggregateError: One or more errors in the execution result. ] } ] - at (/some/path/to/http.ts:XX:XX:47) + at (/some/path/to/handleOutput.ts:XX:XX:16) at Array.map () - at parseExecutionResult (/some/path/to/http.ts:XX:XX:28) - at Object.unpack (/some/path/to/core.ts:XX:XX:26) + at handleOutput (/some/path/to/handleOutput.ts:XX:XX:21) + at executeDocument (/some/path/to/requestMethods.ts:XX:XX:10) at process.processTicksAndRejections (node:internal/process/task_queues:XX:XX) - at async runHook (/some/path/to/runHook.ts:XX:XX:16) { - path: [ 'addPokemon' ], - locations: undefined, - extensions: [Object: null prototype] {} + at async executeRootField (/some/path/to/requestMethods.ts:XX:XX:18) + at async (/some/path/to/output_return-error_return-error-execution__return-error-execution.ts:XX:XX:16) { + context: { locations: [ { line: 2, column: 3 } ], path: [ 'addPokemon' ] }, + cause: undefined } ] } diff --git a/website/content/_snippets/examples/transport-http/dynamic-headers.detail.md b/website/content/_snippets/examples/transport-http/dynamic-headers.detail.md index 2faaffe0b..9ee3b7b05 100644 --- a/website/content/_snippets/examples/transport-http/dynamic-headers.detail.md +++ b/website/content/_snippets/examples/transport-http/dynamic-headers.detail.md @@ -38,7 +38,7 @@ await graffle.gql`{ pokemons { name } }`.send() headers: Headers { accept: 'application/graphql-response+json; charset=utf-8, application/json; charset=utf-8', 'content-type': 'application/json', - 'x-sent-at-time': '1729696838476' + 'x-sent-at-time': '1729824583010' }, signal: undefined, method: 'post', diff --git a/website/content/_snippets/examples/transport-http/dynamic-headers.md b/website/content/_snippets/examples/transport-http/dynamic-headers.md index 999dc3940..f23f94867 100644 --- a/website/content/_snippets/examples/transport-http/dynamic-headers.md +++ b/website/content/_snippets/examples/transport-http/dynamic-headers.md @@ -36,7 +36,7 @@ await graffle.gql`{ pokemons { name } }`.send() headers: Headers { accept: 'application/graphql-response+json; charset=utf-8, application/json; charset=utf-8', 'content-type': 'application/json', - 'x-sent-at-time': '1729696838476' + 'x-sent-at-time': '1729824583010' }, signal: undefined, method: 'post', diff --git a/website/content/examples/10_transport-http/dynamic-headers.md b/website/content/examples/10_transport-http/dynamic-headers.md index 15b30ef60..292ef6f5e 100644 --- a/website/content/examples/10_transport-http/dynamic-headers.md +++ b/website/content/examples/10_transport-http/dynamic-headers.md @@ -43,7 +43,7 @@ await graffle.gql`{ pokemons { name } }`.send() headers: Headers { accept: 'application/graphql-response+json; charset=utf-8, application/json; charset=utf-8', 'content-type': 'application/json', - 'x-sent-at-time': '1729696838476' + 'x-sent-at-time': '1729824583010' }, signal: undefined, method: 'post', diff --git a/website/content/examples/20_output/envelope.md b/website/content/examples/20_output/envelope.md index db52fee21..e164f120a 100644 --- a/website/content/examples/20_output/envelope.md +++ b/website/content/examples/20_output/envelope.md @@ -37,15 +37,13 @@ console.log(result) { name: 'Weedle' } ] }, - errors: undefined, - extensions: undefined, response: Response { status: 200, statusText: 'OK', headers: Headers { 'content-type': 'application/graphql-response+json; charset=utf-8', 'content-length': '142', - date: 'Wed, 23 Oct 2024 15:20:39 GMT', + date: 'Fri, 25 Oct 2024 02:49:44 GMT', connection: 'keep-alive', 'keep-alive': 'timeout=5' }, diff --git a/website/content/examples/20_output/return-error-execution.md b/website/content/examples/20_output/return-error-execution.md index 01a177a92..e4e99fdbd 100644 --- a/website/content/examples/20_output/return-error-execution.md +++ b/website/content/examples/20_output/return-error-execution.md @@ -59,7 +59,7 @@ ContextualAggregateError: One or more errors in the execution result. context: {}, cause: undefined, errors: [ - GraphQLError: [ + ContextualError: [ { "code": "too_small", "minimum": 1, @@ -72,15 +72,15 @@ ContextualAggregateError: One or more errors in the execution result. ] } ] - at (/some/path/to/http.ts:XX:XX:47) + at (/some/path/to/handleOutput.ts:XX:XX:16) at Array.map () - at parseExecutionResult (/some/path/to/http.ts:XX:XX:28) - at Object.unpack (/some/path/to/core.ts:XX:XX:26) + at handleOutput (/some/path/to/handleOutput.ts:XX:XX:21) + at executeDocument (/some/path/to/requestMethods.ts:XX:XX:10) at process.processTicksAndRejections (node:internal/process/task_queues:XX:XX) - at async runHook (/some/path/to/runHook.ts:XX:XX:16) { - path: [ 'addPokemon' ], - locations: undefined, - extensions: [Object: null prototype] {} + at async executeRootField (/some/path/to/requestMethods.ts:XX:XX:18) + at async (/some/path/to/output_return-error_return-error-execution__return-error-execution.ts:XX:XX:16) { + context: { locations: [ { line: 2, column: 3 } ], path: [ 'addPokemon' ] }, + cause: undefined } ] } diff --git a/website/content/examples/30_gql/gql-document-node.md b/website/content/examples/30_gql/gql-document-node.md index e53d26d2b..eebdd2c34 100644 --- a/website/content/examples/30_gql/gql-document-node.md +++ b/website/content/examples/30_gql/gql-document-node.md @@ -9,7 +9,8 @@ This example shows how to send a request using a Document instance for the Graph ```ts twoslash import { parse } from 'graphql' -import { Opentelemetry, Throws } from 'graffle/extensions' +import { Opentelemetry } from 'graffle/extensions/opentelemetry' +import { Throws } from 'graffle/extensions/throws' import { Graffle } from 'graffle' const graffle = Graffle.create({ diff --git a/website/content/examples/60_extension/introspection.md b/website/content/examples/60_extension/introspection.md index 42d338c3d..34869410e 100644 --- a/website/content/examples/60_extension/introspection.md +++ b/website/content/examples/60_extension/introspection.md @@ -8,7 +8,7 @@ This example shows how to use the Introspection extension to easily introspect y ```ts twoslash -import { Introspection } from 'graffle/extensions' +import { Introspection } from 'graffle/extensions/introspection' import { Pokemon } from './pokemon/__.js' const pokemon = Pokemon.create().use(Introspection()) diff --git a/website/content/examples/60_extension/opentelemetry.md b/website/content/examples/60_extension/opentelemetry.md index bd82e49b1..8d567328c 100644 --- a/website/content/examples/60_extension/opentelemetry.md +++ b/website/content/examples/60_extension/opentelemetry.md @@ -8,7 +8,7 @@ aside: false ```ts twoslash import { ConsoleSpanExporter, SimpleSpanProcessor } from '@opentelemetry/sdk-trace-base' import { NodeTracerProvider } from '@opentelemetry/sdk-trace-node' -import { Opentelemetry } from 'graffle/extensions' +import { Opentelemetry } from 'graffle/extensions/opentelemetry' import { Pokemon } from './pokemon/__.js' // Setup Opentelemetry @@ -36,18 +36,18 @@ console.log(data) 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.7.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.26.0' + 'telemetry.sdk.version': '1.27.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '9d3e044ef7452a5b0e773ac8a7e6c8bd', - parentId: 'fdbedbd147dc630c', + traceId: '3b96fa441684458a1d46a660a7980d58', + parentId: 'f1eb7799e82ca59a', traceState: undefined, name: 'encode', - id: '4f8b5fccd96cc062', + id: 'bb6b0c035e3cbc85', kind: 0, - timestamp: 1729696839648000, - duration: 1705.875, + timestamp: 1729824584441000, + duration: 1365.042, attributes: {}, status: { code: 0 }, events: [], @@ -63,18 +63,18 @@ console.log(data) 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.7.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.26.0' + 'telemetry.sdk.version': '1.27.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '9d3e044ef7452a5b0e773ac8a7e6c8bd', - parentId: 'fdbedbd147dc630c', + traceId: '3b96fa441684458a1d46a660a7980d58', + parentId: 'f1eb7799e82ca59a', traceState: undefined, name: 'pack', - id: 'a2cb6c68bb391b81', + id: '996cd2f8c264080a', kind: 0, - timestamp: 1729696839652000, - duration: 16711.541, + timestamp: 1729824584444000, + duration: 12774.667, attributes: {}, status: { code: 0 }, events: [], @@ -90,18 +90,18 @@ console.log(data) 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.7.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.26.0' + 'telemetry.sdk.version': '1.27.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '9d3e044ef7452a5b0e773ac8a7e6c8bd', - parentId: 'fdbedbd147dc630c', + traceId: '3b96fa441684458a1d46a660a7980d58', + parentId: 'f1eb7799e82ca59a', traceState: undefined, name: 'exchange', - id: '95bc25186061869d', + id: '3ad972c399fb8ec2', kind: 0, - timestamp: 1729696839669000, - duration: 21608.417, + timestamp: 1729824584458000, + duration: 21008.167, attributes: {}, status: { code: 0 }, events: [], @@ -117,18 +117,18 @@ console.log(data) 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.7.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.26.0' + 'telemetry.sdk.version': '1.27.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '9d3e044ef7452a5b0e773ac8a7e6c8bd', - parentId: 'fdbedbd147dc630c', + traceId: '3b96fa441684458a1d46a660a7980d58', + parentId: 'f1eb7799e82ca59a', traceState: undefined, name: 'unpack', - id: 'f33a840d705729c6', + id: 'bbdb7c3156b126e9', kind: 0, - timestamp: 1729696839691000, - duration: 1755.75, + timestamp: 1729824584479000, + duration: 1927.291, attributes: {}, status: { code: 0 }, events: [], @@ -144,18 +144,18 @@ console.log(data) 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.7.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.26.0' + 'telemetry.sdk.version': '1.27.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '9d3e044ef7452a5b0e773ac8a7e6c8bd', - parentId: 'fdbedbd147dc630c', + traceId: '3b96fa441684458a1d46a660a7980d58', + parentId: 'f1eb7799e82ca59a', traceState: undefined, name: 'decode', - id: 'd5abeead8c05a053', + id: 'e311421c9b0a3a5d', kind: 0, - timestamp: 1729696839693000, - duration: 313.709, + timestamp: 1729824584481000, + duration: 221.916, attributes: {}, status: { code: 0 }, events: [], @@ -171,18 +171,18 @@ console.log(data) 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.7.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.26.0' + 'telemetry.sdk.version': '1.27.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '9d3e044ef7452a5b0e773ac8a7e6c8bd', + traceId: '3b96fa441684458a1d46a660a7980d58', parentId: undefined, traceState: undefined, name: 'request', - id: 'fdbedbd147dc630c', + id: 'f1eb7799e82ca59a', kind: 0, - timestamp: 1729696839647000, - duration: 46403, + timestamp: 1729824584440000, + duration: 40916.625, attributes: {}, status: { code: 0 }, events: [], diff --git a/website/content/examples/60_extension/throws.md b/website/content/examples/60_extension/throws.md index 397fe4115..c764c4a84 100644 --- a/website/content/examples/60_extension/throws.md +++ b/website/content/examples/60_extension/throws.md @@ -8,7 +8,7 @@ This example shows how to use the Throws extension to throw errors for one-off c ```ts twoslash -import { Throws } from 'graffle/extensions' +import { Throws } from 'graffle/extensions/throws' import { Pokemon } from './pokemon/__.js' const pokemon = Pokemon