Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/ensnode.io/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,12 @@
"tailwindcss": "catalog:"
},
"devDependencies": {
"@types/node": "catalog:",
"@types/react": "catalog:",
"@types/react-dom": "catalog:",
"enskit": "workspace:*",
"tsx": "^4.19.3",
"typescript": "catalog:",
"vitest": "catalog:"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { existsSync, readFileSync, writeFileSync } from "node:fs";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";

import { ACTIVE_OMNIGRAPH_VERSION } from "../src/data/omnigraph-examples/active.ts";
import {
ACTIVE_OMNIGRAPH_VERSION,
normalizeOmnigraphVersion,
} from "../src/data/omnigraph-examples/active.ts";
import { OMNIGRAPH_EXAMPLES_META } from "../src/data/omnigraph-examples/meta.ts";
import type { SnapshotExample } from "../src/data/omnigraph-examples/types.ts";
import { ENSNODE_URL } from "../src/lib/playground/constants.ts";
Expand All @@ -16,7 +19,9 @@ function logError(message: string, id?: string) {
}

// Target version defaults to the active one; override to fill responses for a staged version.
const version = process.env.OMNIGRAPH_VERSION ?? ACTIVE_OMNIGRAPH_VERSION;
const version = normalizeOmnigraphVersion(
process.env.OMNIGRAPH_VERSION ?? ACTIVE_OMNIGRAPH_VERSION,
);
// Used as a directory name; reject anything that could escape the versions/ dir.
if (!/^[0-9A-Za-z._-]+$/.test(version) || version.includes("..")) {
logError(`Invalid version "${version}": use only letters, digits, '.', '_', '-'.`);
Expand Down
11 changes: 7 additions & 4 deletions docs/ensnode.io/scripts/snapshot-omnigraph-version.mts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { buildSchema, parse, validate } from "graphql";
import { getNamespaceSpecificValue } from "@ensnode/ensnode-sdk";
import { GRAPHQL_API_EXAMPLE_QUERIES } from "@ensnode/ensnode-sdk/internal";

import { normalizeOmnigraphVersion } from "../src/data/omnigraph-examples/active.ts";
import type { SnapshotExample } from "../src/data/omnigraph-examples/types.ts";
import { DOCS_OMNIGRAPH_NAMESPACE, ENSNODE_URL } from "../src/lib/playground/constants.ts";

Expand All @@ -16,16 +17,18 @@ import { DOCS_OMNIGRAPH_NAMESPACE, ENSNODE_URL } from "../src/lib/playground/con
// — by construction — valid against that release's schema. Responses are filled separately
// (`pnpm omnigraph-examples:refresh-responses`) once the version is live in production.
//
// Usage: pnpm omnigraph:snapshot <version> e.g. pnpm omnigraph:snapshot v1.14.0
// Usage: pnpm omnigraph:snapshot <version> e.g. pnpm omnigraph:snapshot 1.14.0
// Accepts an optional leading `v` (`v1.14.0` → `1.14.0`).

const version = process.argv[2];
if (!version) {
const rawVersion = process.argv[2];
if (!rawVersion) {
console.error("Usage: pnpm omnigraph:snapshot <version>");
process.exit(1);
}
const version = normalizeOmnigraphVersion(rawVersion);
// Used as a directory name; reject anything that could escape the versions/ dir.
if (!/^[0-9A-Za-z._-]+$/.test(version) || version.includes("..")) {
console.error(`Invalid version "${version}": use only letters, digits, '.', '_', '-'.`);
console.error(`Invalid version "${rawVersion}": use only letters, digits, '.', '_', '-'.`);
process.exit(1);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
import type { AstroLogoProps } from "./shared-types";

const { className, ...props } = Astro.props as AstroLogoProps;
---

<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="currentColor"
class={className}
{...props}
aria-hidden="true"
>
<path d="M10.797 14.182H3.635L16.728 0l-3.525 9.818h7.162L7.272 24l3.524-9.818Z" />
</svg>
Loading
Loading