diff --git a/.agents/skills/writing-changesets/SKILL.md b/.agents/skills/writing-changesets/SKILL.md index 9f87fa7..bcc9f8d 100644 --- a/.agents/skills/writing-changesets/SKILL.md +++ b/.agents/skills/writing-changesets/SKILL.md @@ -17,7 +17,7 @@ Do not add one for documentation-only or test-only changes, changes to the separ ## Package and version bump -The bundle is versioned as one unit. The repository's other released package, the `@hypercerts-org/api` client, is not released yet and is in the Changesets `ignore` list (see `packages/api/README.md`), so until that changes the Changeset frontmatter must target only `@hypercerts-org/happyview-modules`: +The bundle is versioned as one unit. The repository's other released package, the `@hypercerts-org/api` client (`packages/api/`), has its own version and is published to npm; target it when a change alters its query definitions, types or `@hypercerts-org/lexicon` version, and give each package its own entry when a change touches both. For the bundle: ```md --- @@ -59,7 +59,7 @@ Use bullets only when there are several distinct actions or changes to scan. Omi ## Procedure 1. Check the actual diff and read `.changeset/README.md` plus `happyview-modules/README.md` for the current scope and release behavior. -2. Run `pnpm changeset` and select `@hypercerts-org/happyview-modules`, or create a descriptive Markdown file under `.changeset/` with the required frontmatter. +2. Run `pnpm changeset` and select the affected packages, or create a descriptive Markdown file under `.changeset/` with the required frontmatter. 3. Write and review the summary using the plain-language guidance above. Make any adaptation steps concrete and accurate. 4. Run `pnpm changeset status` to check that the Changeset is valid and targets the intended package. diff --git a/.changeset/README.md b/.changeset/README.md index 2b1304f..2d83b0a 100644 --- a/.changeset/README.md +++ b/.changeset/README.md @@ -3,7 +3,7 @@ This repository releases two packages, each with its own version: - `@hypercerts-org/happyview-modules`: the installable API bundle (Lua modules, Lexicons and installer). Released as a Git tag and GitHub Release, not published to npm; operators retrieve the tagged source from this public repository and install it into their own HappyView instance. -- `@hypercerts-org/api`: the TypeScript query definitions and types for clients. Published to npm, with a Git tag and GitHub Release. Not released yet; see [packages/api/README.md](../packages/api/README.md#versioning-and-releases). +- `@hypercerts-org/api`: the TypeScript query definitions and types for clients. Published to npm, with a Git tag and GitHub Release. Add a Changeset when a pull request changes what either package ships. Run: diff --git a/.changeset/api-first-release.md b/.changeset/api-first-release.md new file mode 100644 index 0000000..8a17e7a --- /dev/null +++ b/.changeset/api-first-release.md @@ -0,0 +1,5 @@ +--- +'@hypercerts-org/api': minor +--- + +First release of `@hypercerts-org/api`: TypeScript query definitions and types for the Hypercerts API, for use with the [`@atproto/lex`](https://www.npmjs.com/package/@atproto/lex) client. Every query is at its NSID path (`api.call(org.hypercerts.claim.getActivity, { uri })`), with typed parameters and views. The records in those views are the schemas of `@hypercerts-org/lexicon` 2.0, so a record type is the same in both packages. Install it with its peer dependencies, `@hypercerts-org/lexicon` ^2.0.0 and `@atproto/lex` ^0.4.2. diff --git a/.changeset/config.json b/.changeset/config.json index 15b06fb..12fd09c 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -12,7 +12,7 @@ "access": "restricted", "baseBranch": "main", "updateInternalDependencies": "patch", - "ignore": ["hypercerts-api-endpoints", "@hypercerts-org/api"], + "ignore": ["hypercerts-api-endpoints"], "privatePackages": { "version": true, "tag": true diff --git a/docs/coverage.json b/docs/coverage.json index a1af9a8..5e596e4 100644 --- a/docs/coverage.json +++ b/docs/coverage.json @@ -1,7 +1,7 @@ { "source": { "apiManifest": "happyview-modules/manifest.json", - "pinnedLexiconPackage": "1.6.0" + "pinnedLexiconPackage": "2.0.0" }, "runtimeValidation": "not-assessed", "deploymentValidation": "not-assessed", diff --git a/docs/openapi.json b/docs/openapi.json index e677dfd..ac20663 100644 --- a/docs/openapi.json +++ b/docs/openapi.json @@ -8498,6 +8498,6 @@ } } }, - "x-hypercerts-source": "happyview-modules/manifest.json; @hypercerts-org/lexicon@1.6.0", + "x-hypercerts-source": "happyview-modules/manifest.json; @hypercerts-org/lexicon@2.0.0", "x-hypercerts-unresolved-references": [] } diff --git a/docs/sources/index.json b/docs/sources/index.json index 9b8daad..e87fdaa 100644 --- a/docs/sources/index.json +++ b/docs/sources/index.json @@ -1,6 +1,6 @@ { "apiManifest": "happyview-modules/manifest.json", - "pinnedLexiconPackage": "1.6.0", + "pinnedLexiconPackage": "2.0.0", "sourcePolicy": "Explorer operations are the query/procedure Lexicons declared by modules in happyview-modules/manifest.json. Referenced schemas are resolved from that manifest and its pinned Lexicon package; no remote refs are fetched.", "runtimeValidation": "not-assessed", "deploymentValidation": "not-assessed", diff --git a/happyview-modules/package.json b/happyview-modules/package.json index 0b0976b..f938b92 100644 --- a/happyview-modules/package.json +++ b/happyview-modules/package.json @@ -8,7 +8,7 @@ "@atcute/cid": "2.4.1", "@atproto/lexicon": "0.6.2", "@atproto/syntax": "0.5.4", - "@hypercerts-org/lexicon": "1.6.0" + "@hypercerts-org/lexicon": "2.0.0" }, "scripts": { "lint:js": "eslint --max-warnings=0 --report-unused-disable-directives .", diff --git a/packages/api/README.md b/packages/api/README.md index f10a56f..c982709 100644 --- a/packages/api/README.md +++ b/packages/api/README.md @@ -1,6 +1,10 @@ # @hypercerts-org/api -TypeScript query definitions and types for the Hypercerts API, for use with [`@atproto/lex`](https://www.npmjs.com/package/@atproto/lex). Not published to npm yet (see [Versioning and releases](#versioning-and-releases)); use it from this workspace, or from a tarball made with `pnpm pack` (which builds first). A git dependency does not work: `dist/` is not committed. +TypeScript query definitions and types for the Hypercerts API, for use with [`@atproto/lex`](https://www.npmjs.com/package/@atproto/lex). Install it with its peer dependencies: + +```sh +npm install @hypercerts-org/api @hypercerts-org/lexicon @atproto/lex +``` ```ts import { Client } from "@atproto/lex"; @@ -19,10 +23,10 @@ type Activity = org.hypercerts.claim.activity.Main; // the record, from @hyperce ## What it contains -The package exports [lex's NSID namespace tree](https://www.npmjs.com/package/@atproto/lex) (`app`, `com`, `org`, `pub`), the same layout as `@hypercerts-org/lexicon/records`, so every name is an NSID: +The package exports [lex's NSID namespace tree](https://www.npmjs.com/package/@atproto/lex) (`app`, `com`, `org`, `pub`), the same layout as [`@hypercerts-org/lexicon`](https://www.npmjs.com/package/@hypercerts-org/lexicon), so every name is an NSID: - Each query is at its NSID path (`org.hypercerts.claim.getActivity`), for `Client.call`, with its parameter and view types on the same path (`.$Params`, `.ActivityView`). Shared views are in `org.hypercerts.api.defs` and `org.hypercerts.entity.defs`. -- The records and other definitions the queries reference are in the same tree, but they are the modules of [`@hypercerts-org/lexicon/records`](https://github.com/hypercerts-org/hypercerts-lexicon), re-exported, not copied: `org.hypercerts.claim.activity` is the same module in both packages, and `ActivityView["record"]` is `org.hypercerts.claim.activity.Main`. A record no query returns, such as `org.hyperboards.board`, is not in this tree; import it from `@hypercerts-org/lexicon/records`. Where a record has queries under its NSID (`org.hypercerts.collection`), the namespace here adds the query modules to the record's exports. +- The records and other definitions the queries reference are in the same tree, but they are the modules of [`@hypercerts-org/lexicon`](https://github.com/hypercerts-org/hypercerts-lexicon), re-exported, not copied: `org.hypercerts.claim.activity` is the same module in both packages, and `ActivityView["record"]` is `org.hypercerts.claim.activity.Main`. A record no query returns, such as `org.hyperboards.board`, is not in this tree; import it from `@hypercerts-org/lexicon`. Where a record has queries under its NSID (`org.hypercerts.collection`), the namespace here adds the query modules to the record's exports. - `LEXICON_VERSION`: the `@hypercerts-org/lexicon` version the definitions were generated from, also in `package.json` as `hypercerts.lexiconVersion`. ESM only. `@atproto/lex` and `@hypercerts-org/lexicon` are peer dependencies; install versions in the declared ranges. @@ -33,7 +37,7 @@ ESM only. `@atproto/lex` and `@hypercerts-org/lexicon` are peer dependencies; in ## How it is generated -`pnpm generate` (or `pnpm client:generate` from the repository root) runs `lex build --index-file` over the Lexicons declared in `happyview-modules/manifest.json` `validationLexicons`: the API's own Lexicons from `happyview-modules/lexicons/`, and the record Lexicons they reference, read from the installed `@hypercerts-org/lexicon`. It keeps the modules of the API's own Lexicons and the namespace modules on the path to them, points every other import or re-export at `@hypercerts-org/lexicon/records/` (and fails if a module is missing there), writes `src/lexicons/` and `src/index.ts`, and records the Lexicon version in `package.json`. +`pnpm generate` (or `pnpm client:generate` from the repository root) runs `lex build --index-file` over the Lexicons declared in `happyview-modules/manifest.json` `validationLexicons`: the API's own Lexicons from `happyview-modules/lexicons/`, and the record Lexicons they reference, read from the installed `@hypercerts-org/lexicon`. It keeps the modules of the API's own Lexicons and the namespace modules on the path to them, points every other import or re-export at `@hypercerts-org/lexicon/`, or at the package root for a top-level namespace (`com`, `pub`), and fails if the lexicon package does not export it, writes `src/lexicons/` and `src/index.ts`, and records the Lexicon version in `package.json`. Generated files start with a banner naming `scripts/generate.js`, which rewrites lex's output. They are committed, unlike in the lexicon repository: `src/` is what reviewers see change when an API Lexicon changes, and `pnpm check:generated` fails when it is stale. Do not edit them. @@ -41,10 +45,6 @@ Regenerate whenever a query Lexicon, `happyview-modules/manifest.json`, the `@hy The generator works around [bluesky-social/atproto#5738](https://github.com/bluesky-social/atproto/issues/5738), broken imports for queries under a record NSID. Remove the workaround once it is fixed upstream. -## Unreleased lexicon package - -`@hypercerts-org/lexicon/records` is not released yet ([hypercerts-lexicon#270](https://github.com/hypercerts-org/hypercerts-lexicon/pull/270)). Until it is, the package builds against `vendor/hypercerts-org-lexicon-1.7.0.tgz`, a packed build of that pull request. Replace it with the published version (`"@hypercerts-org/lexicon": "1.7.0"`) and delete `vendor/` once it is on npm. - ## Commands Run from `packages/api/`: @@ -65,10 +65,9 @@ Tooling follows the SDK repository (TECH-748): Biome, TypeScript 7, ESM, Node 24 The package is versioned with Changesets, independently of the API modules. The release workflow publishes it to npm with [Trusted Publishing](https://docs.npmjs.com/trusted-publishers) and provenance, and creates an `@hypercerts-org/api@X.Y.Z` tag and GitHub Release, when a Release PR that bumps it is merged. -It is not released yet: it is `private` and listed in the Changesets `ignore` list until it builds against a published lexicon package. To start releasing it: +The first release needs a Trusted Publisher for `@hypercerts-org/api` on npmjs.com (repository `hypercerts-org/api`, workflow `release.yml`). If npm requires the package to exist before one can be configured, an owner of the `@hypercerts-org` npm scope publishes the first version by hand. -1. Configure a Trusted Publisher for `@hypercerts-org/api` on npmjs.com: repository `hypercerts-org/api`, workflow `release.yml`. If npm requires the package to exist first, an owner of the `@hypercerts-org` npm scope publishes the first version by hand. -2. In one pull request: remove `"private": true`, remove the package from `ignore` in `.changeset/config.json`, and add a changeset for it. +`@hypercerts-org/lexicon` is a peer dependency: the record types come from it. The version the package is generated from is pinned in `devDependencies` and must match the one `happyview-modules/` validates against (a test checks this), so the client's types describe what the server accepts. When it changes, regenerate `src/` (see [How it is generated](#how-it-is-generated)). ## License diff --git a/packages/api/package.json b/packages/api/package.json index 3b62900..91d4dd9 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -1,7 +1,6 @@ { "name": "@hypercerts-org/api", "version": "0.0.0", - "private": true, "description": "TypeScript query definitions and types for the Hypercerts API, for use with @atproto/lex", "license": "MIT OR Apache-2.0", "repository": { @@ -31,7 +30,7 @@ "access": "public" }, "hypercerts": { - "lexiconVersion": "1.7.0" + "lexiconVersion": "2.0.0" }, "scripts": { "generate": "node scripts/generate.js", @@ -48,12 +47,12 @@ }, "peerDependencies": { "@atproto/lex": "^0.4.2", - "@hypercerts-org/lexicon": "^1.7.0" + "@hypercerts-org/lexicon": "^2.0.0" }, "devDependencies": { "@atproto/lex": "0.4.2", "@biomejs/biome": "2.6.3", - "@hypercerts-org/lexicon": "file:vendor/hypercerts-org-lexicon-1.7.0.tgz", + "@hypercerts-org/lexicon": "2.0.0", "@types/node": "24.19.2", "typescript": "7.0.2", "vite": "8.3.5" diff --git a/packages/api/scripts/check-package.js b/packages/api/scripts/check-package.js index 31f043a..cb5910d 100644 --- a/packages/api/scripts/check-package.js +++ b/packages/api/scripts/check-package.js @@ -16,7 +16,7 @@ const packageJson = readJson(path.join(packageRoot, "package.json")); const pinned = (name) => { const version = packageJson.devDependencies?.[name]; if (!version) throw new Error(`check-package: ${name} must be a devDependency`); - return version.replace(/^file:/, `file:${packageRoot}/`); + return version; }; // Child processes must not inherit the parent's npm and pnpm settings. @@ -94,7 +94,7 @@ function createConsumer(dir, tarball) { /** @param {string} consumer */ function checkNode(consumer) { const script = `import { LEXICON_VERSION, org } from "@hypercerts-org/api"; -import { org as records } from "@hypercerts-org/lexicon/records"; +import { org as records } from "@hypercerts-org/lexicon"; if (org.hypercerts.claim.getActivity.main.nsid !== "org.hypercerts.claim.getActivity") throw new Error("query"); if (org.hypercerts.claim.activity.main !== records.hypercerts.claim.activity.main) throw new Error("records are not shared"); if (LEXICON_VERSION !== ${JSON.stringify(packageJson.hypercerts.lexiconVersion)}) throw new Error("LEXICON_VERSION");`; @@ -108,7 +108,7 @@ function checkTypes(consumer) { path.join(consumer, "src", "types.ts"), `import { Client } from "@atproto/lex"; import { org } from "@hypercerts-org/api"; -import { org as records } from "@hypercerts-org/lexicon/records"; +import { org as records } from "@hypercerts-org/lexicon"; const api = new Client("https://api.example"); const uri = "at://did:plc:abc123/org.hypercerts.claim.activity/3k2abc" as const; export async function record(): Promise { diff --git a/packages/api/scripts/generate.js b/packages/api/scripts/generate.js index e64a050..b310230 100644 --- a/packages/api/scripts/generate.js +++ b/packages/api/scripts/generate.js @@ -2,9 +2,9 @@ // happyview-modules/manifest.json, in lex's own layout: the package exports lex's NSID // namespace tree (app, com, org, pub), as in the @atproto/lex documentation. // Modules for the API's own Lexicons (happyview-modules/lexicons/) are generated here; -// everything else in the tree (records and their definitions) points at -// @hypercerts-org/lexicon/records, so no record code is copied. Run with -// --check to fail when the committed output is stale. +// everything else in the tree (records and their definitions) points at the +// modules of @hypercerts-org/lexicon at the same NSID path, so no record code is +// copied. Run with --check to fail when the committed output is stale. import { execFileSync } from "node:child_process"; import { existsSync } from "node:fs"; import { mkdir, mkdtemp, readdir, readFile, rm, writeFile } from "node:fs/promises"; @@ -16,7 +16,7 @@ import { fileURLToPath } from "node:url"; const packageRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), ".."); const modulesRoot = path.resolve(packageRoot, "../../happyview-modules"); const lexEntry = path.join(packageRoot, "node_modules/@atproto/lex/bin/lex"); -const recordsSpecifier = "@hypercerts-org/lexicon/records"; +const recordsSpecifier = "@hypercerts-org/lexicon"; const header = '/*\n * THIS FILE WAS GENERATED BY scripts/generate.js WITH "@atproto/lex". DO NOT EDIT.\n */'; const lexHeader = '/*\n * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT.\n */'; @@ -91,12 +91,13 @@ function keptFiles(files, localIds) { /** * Keeps only this package's modules and points every import or re-export of - * another module at @hypercerts-org/lexicon/records. + * another module at the same NSID path in @hypercerts-org/lexicon. Paths are + * resolved through the lexicon package's exports, so a module it does not + * export fails here rather than in a consumer. * @param {string} lexiconsDir generated output * @param {string[]} localIds - * @param {string} lexiconRoot installed @hypercerts-org/lexicon */ -async function linkRecords(lexiconsDir, localIds, lexiconRoot) { +async function linkRecords(lexiconsDir, localIds) { const files = await listFiles(lexiconsDir); const keep = keptFiles(files, localIds); await Promise.all( @@ -104,27 +105,44 @@ async function linkRecords(lexiconsDir, localIds, lexiconRoot) { ); await removeEmptyDirectories(lexiconsDir); + const require = createRequire(path.join(packageRoot, "package.json")); + const rootExports = new Set(Object.keys(await import(recordsSpecifier))); + for (const file of keep) { const absolute = path.join(lexiconsDir, file); const source = await readFile(absolute, "utf8"); const directory = path.posix.dirname(file); - const linked = source.replaceAll(/from "(\.\.?\/[^"]+)"/g, (match, specifier) => { - // Workaround for bluesky-social/atproto#5738: @atproto/lex 0.4.2 emits - // "./.defs.js" for a query whose namespace is a record NSID - // (org.hypercerts.collection.getCollection imports - // org.hypercerts.collection). Remove once fixed upstream. - const fixed = - specifier === "./.defs.js" ? `../${path.posix.basename(directory)}.defs.js` : specifier; - const target = path.posix.normalize(path.posix.join(directory, fixed)); - if (keep.has(target.replace(/\.js$/, ".ts"))) { - return fixed === specifier ? match : `from "${fixed}"`; - } - const modulePath = target.slice(0, -".js".length); - if (!existsSync(path.join(lexiconRoot, "dist/records", `${modulePath}.js`))) { - throw new Error(`${file} needs ${modulePath}, which ${recordsSpecifier} does not export`); - } - return `from "${recordsSpecifier}/${modulePath}"`; - }); + const linked = source.replaceAll( + /(export \* as (\w+) )?from "(\.\.?\/[^"]+)"/g, + (match, reexport, name, specifier) => { + // Workaround for bluesky-social/atproto#5738: @atproto/lex 0.4.2 emits + // "./.defs.js" for a query whose namespace is a record NSID + // (org.hypercerts.collection.getCollection imports + // org.hypercerts.collection). Remove once fixed upstream. + const fixed = + specifier === "./.defs.js" ? `../${path.posix.basename(directory)}.defs.js` : specifier; + const target = path.posix.normalize(path.posix.join(directory, fixed)); + if (keep.has(target.replace(/\.js$/, ".ts"))) { + return fixed === specifier ? match : `${reexport ?? ""}from "${fixed}"`; + } + const modulePath = target.slice(0, -".js".length); + // A top-level namespace (app, com, org, pub) is a root export, not a subpath. + if (!modulePath.includes("/")) { + if (name !== modulePath || !rootExports.has(name)) { + throw new Error( + `${file} needs ${modulePath}, which ${recordsSpecifier} does not export`, + ); + } + return `export { ${name} } from "${recordsSpecifier}"`; + } + try { + require.resolve(`${recordsSpecifier}/${modulePath}`); + } catch { + throw new Error(`${file} needs ${modulePath}, which ${recordsSpecifier} does not export`); + } + return `${reexport ?? ""}from "${recordsSpecifier}/${modulePath}"`; + }, + ); if (linked !== source) await writeFile(absolute, linked); } } @@ -234,7 +252,7 @@ async function generate(srcDir, lexiconPkg) { await rm(inputDir, { recursive: true, force: true }); } const localIds = lexicons.filter((entry) => entry.local).map((entry) => entry.id); - await linkRecords(lexiconsDir, localIds, lexiconPkg.root); + await linkRecords(lexiconsDir, localIds); await normalizeOutput(lexiconsDir); await writeIndex(srcDir, lexiconPkg.version); } diff --git a/packages/api/src/index.ts b/packages/api/src/index.ts index c2fee06..de9d0fb 100644 --- a/packages/api/src/index.ts +++ b/packages/api/src/index.ts @@ -4,9 +4,9 @@ // lex's NSID namespace tree for the Hypercerts API: queries are generated // here; the records and other definitions they reference come from -// @hypercerts-org/lexicon/records, so org.hypercerts.claim.activity is the same +// @hypercerts-org/lexicon, so org.hypercerts.claim.activity is the same // module in both packages. export * from "./lexicons/index.js"; /** Version of @hypercerts-org/lexicon these definitions were generated from. */ -export const LEXICON_VERSION = "1.7.0"; +export const LEXICON_VERSION = "2.0.0"; diff --git a/packages/api/src/lexicons/app.ts b/packages/api/src/lexicons/app.ts index 622ce8d..bea10e2 100644 --- a/packages/api/src/lexicons/app.ts +++ b/packages/api/src/lexicons/app.ts @@ -2,5 +2,5 @@ * THIS FILE WAS GENERATED BY scripts/generate.js WITH "@atproto/lex". DO NOT EDIT. */ -export * as bsky from "@hypercerts-org/lexicon/records/app/bsky"; +export * as bsky from "@hypercerts-org/lexicon/app/bsky"; export * as certified from "./app/certified.js"; diff --git a/packages/api/src/lexicons/app/certified.ts b/packages/api/src/lexicons/app/certified.ts index 6e0e047..f7b1e52 100644 --- a/packages/api/src/lexicons/app/certified.ts +++ b/packages/api/src/lexicons/app/certified.ts @@ -4,9 +4,9 @@ export * as actor from "./certified/actor.js"; export * as badge from "./certified/badge.js"; -export * as defs from "@hypercerts-org/lexicon/records/app/certified/defs"; +export * as defs from "@hypercerts-org/lexicon/app/certified/defs"; export * as feed from "./certified/feed.js"; export * as graph from "./certified/graph.js"; export * as link from "./certified/link.js"; export * as location from "./certified/location.js"; -export * as signature from "@hypercerts-org/lexicon/records/app/certified/signature"; +export * as signature from "@hypercerts-org/lexicon/app/certified/signature"; diff --git a/packages/api/src/lexicons/app/certified/actor.ts b/packages/api/src/lexicons/app/certified/actor.ts index 5d03da1..3df94e9 100644 --- a/packages/api/src/lexicons/app/certified/actor.ts +++ b/packages/api/src/lexicons/app/certified/actor.ts @@ -8,7 +8,7 @@ export * as getProfile from "./actor/getProfile.js"; export * as getProfiles from "./actor/getProfiles.js"; export * as listOrganizations from "./actor/listOrganizations.js"; export * as listProfiles from "./actor/listProfiles.js"; -export * as organization from "@hypercerts-org/lexicon/records/app/certified/actor/organization"; -export * as profile from "@hypercerts-org/lexicon/records/app/certified/actor/profile"; +export * as organization from "@hypercerts-org/lexicon/app/certified/actor/organization"; +export * as profile from "@hypercerts-org/lexicon/app/certified/actor/profile"; export * as searchOrganizations from "./actor/searchOrganizations.js"; export * as searchProfiles from "./actor/searchProfiles.js"; diff --git a/packages/api/src/lexicons/app/certified/badge.ts b/packages/api/src/lexicons/app/certified/badge.ts index cdeda83..f1a575f 100644 --- a/packages/api/src/lexicons/app/certified/badge.ts +++ b/packages/api/src/lexicons/app/certified/badge.ts @@ -2,13 +2,13 @@ * THIS FILE WAS GENERATED BY scripts/generate.js WITH "@atproto/lex". DO NOT EDIT. */ -export * as award from "@hypercerts-org/lexicon/records/app/certified/badge/award"; -export * as definition from "@hypercerts-org/lexicon/records/app/certified/badge/definition"; +export * as award from "@hypercerts-org/lexicon/app/certified/badge/award"; +export * as definition from "@hypercerts-org/lexicon/app/certified/badge/definition"; export * as getBadgeAward from "./badge/getBadgeAward.js"; export * as getBadgeDefinition from "./badge/getBadgeDefinition.js"; export * as getBadgeResponse from "./badge/getBadgeResponse.js"; export * as listBadgeAwards from "./badge/listBadgeAwards.js"; export * as listBadgeDefinitions from "./badge/listBadgeDefinitions.js"; export * as listBadgeResponses from "./badge/listBadgeResponses.js"; -export * as response from "@hypercerts-org/lexicon/records/app/certified/badge/response"; +export * as response from "@hypercerts-org/lexicon/app/certified/badge/response"; export * as searchBadgeDefinitions from "./badge/searchBadgeDefinitions.js"; diff --git a/packages/api/src/lexicons/app/certified/badge/getBadgeAward.defs.ts b/packages/api/src/lexicons/app/certified/badge/getBadgeAward.defs.ts index 709c8ac..3c6f488 100644 --- a/packages/api/src/lexicons/app/certified/badge/getBadgeAward.defs.ts +++ b/packages/api/src/lexicons/app/certified/badge/getBadgeAward.defs.ts @@ -4,9 +4,9 @@ import { l } from "@atproto/lex"; import * as ApiDefs from "../../../org/hypercerts/api/defs.defs.js"; -import * as BadgeAward from "@hypercerts-org/lexicon/records/app/certified/badge/award.defs"; -import * as BadgeDefinition from "@hypercerts-org/lexicon/records/app/certified/badge/definition.defs"; -import * as BadgeResponse from "@hypercerts-org/lexicon/records/app/certified/badge/response.defs"; +import * as BadgeAward from "@hypercerts-org/lexicon/app/certified/badge/award.defs"; +import * as BadgeDefinition from "@hypercerts-org/lexicon/app/certified/badge/definition.defs"; +import * as BadgeResponse from "@hypercerts-org/lexicon/app/certified/badge/response.defs"; const $nsid = "app.certified.badge.getBadgeAward"; diff --git a/packages/api/src/lexicons/app/certified/badge/getBadgeDefinition.defs.ts b/packages/api/src/lexicons/app/certified/badge/getBadgeDefinition.defs.ts index 1a75a5f..22681ea 100644 --- a/packages/api/src/lexicons/app/certified/badge/getBadgeDefinition.defs.ts +++ b/packages/api/src/lexicons/app/certified/badge/getBadgeDefinition.defs.ts @@ -4,7 +4,7 @@ import { l } from "@atproto/lex"; import * as ApiDefs from "../../../org/hypercerts/api/defs.defs.js"; -import * as BadgeDefinition from "@hypercerts-org/lexicon/records/app/certified/badge/definition.defs"; +import * as BadgeDefinition from "@hypercerts-org/lexicon/app/certified/badge/definition.defs"; const $nsid = "app.certified.badge.getBadgeDefinition"; diff --git a/packages/api/src/lexicons/app/certified/badge/getBadgeResponse.defs.ts b/packages/api/src/lexicons/app/certified/badge/getBadgeResponse.defs.ts index 3f7b7ee..edb73c8 100644 --- a/packages/api/src/lexicons/app/certified/badge/getBadgeResponse.defs.ts +++ b/packages/api/src/lexicons/app/certified/badge/getBadgeResponse.defs.ts @@ -4,7 +4,7 @@ import { l } from "@atproto/lex"; import * as ApiDefs from "../../../org/hypercerts/api/defs.defs.js"; -import * as BadgeResponse from "@hypercerts-org/lexicon/records/app/certified/badge/response.defs"; +import * as BadgeResponse from "@hypercerts-org/lexicon/app/certified/badge/response.defs"; const $nsid = "app.certified.badge.getBadgeResponse"; diff --git a/packages/api/src/lexicons/app/certified/badge/searchBadgeDefinitions.defs.ts b/packages/api/src/lexicons/app/certified/badge/searchBadgeDefinitions.defs.ts index 89f2695..15ad401 100644 --- a/packages/api/src/lexicons/app/certified/badge/searchBadgeDefinitions.defs.ts +++ b/packages/api/src/lexicons/app/certified/badge/searchBadgeDefinitions.defs.ts @@ -4,7 +4,7 @@ import { l } from "@atproto/lex"; import * as ApiDefs from "../../../org/hypercerts/api/defs.defs.js"; -import * as BadgeDefinition from "@hypercerts-org/lexicon/records/app/certified/badge/definition.defs"; +import * as BadgeDefinition from "@hypercerts-org/lexicon/app/certified/badge/definition.defs"; const $nsid = "app.certified.badge.searchBadgeDefinitions"; diff --git a/packages/api/src/lexicons/app/certified/feed.ts b/packages/api/src/lexicons/app/certified/feed.ts index d8d88b3..f681e30 100644 --- a/packages/api/src/lexicons/app/certified/feed.ts +++ b/packages/api/src/lexicons/app/certified/feed.ts @@ -8,5 +8,5 @@ export * as getActorReposts from "./feed/getActorReposts.js"; export * as getLikes from "./feed/getLikes.js"; export * as getReactionCounts from "./feed/getReactionCounts.js"; export * as getReposts from "./feed/getReposts.js"; -export * as like from "@hypercerts-org/lexicon/records/app/certified/feed/like"; -export * as repost from "@hypercerts-org/lexicon/records/app/certified/feed/repost"; +export * as like from "@hypercerts-org/lexicon/app/certified/feed/like"; +export * as repost from "@hypercerts-org/lexicon/app/certified/feed/repost"; diff --git a/packages/api/src/lexicons/app/certified/feed/getLikes.defs.ts b/packages/api/src/lexicons/app/certified/feed/getLikes.defs.ts index 09695d7..4447d0d 100644 --- a/packages/api/src/lexicons/app/certified/feed/getLikes.defs.ts +++ b/packages/api/src/lexicons/app/certified/feed/getLikes.defs.ts @@ -4,7 +4,7 @@ import { l } from "@atproto/lex"; import * as ApiDefs from "../../../org/hypercerts/api/defs.defs.js"; -import * as FeedLike from "@hypercerts-org/lexicon/records/app/certified/feed/like.defs"; +import * as FeedLike from "@hypercerts-org/lexicon/app/certified/feed/like.defs"; const $nsid = "app.certified.feed.getLikes"; diff --git a/packages/api/src/lexicons/app/certified/feed/getReposts.defs.ts b/packages/api/src/lexicons/app/certified/feed/getReposts.defs.ts index 96e00f2..421d804 100644 --- a/packages/api/src/lexicons/app/certified/feed/getReposts.defs.ts +++ b/packages/api/src/lexicons/app/certified/feed/getReposts.defs.ts @@ -4,7 +4,7 @@ import { l } from "@atproto/lex"; import * as ApiDefs from "../../../org/hypercerts/api/defs.defs.js"; -import * as FeedRepost from "@hypercerts-org/lexicon/records/app/certified/feed/repost.defs"; +import * as FeedRepost from "@hypercerts-org/lexicon/app/certified/feed/repost.defs"; const $nsid = "app.certified.feed.getReposts"; diff --git a/packages/api/src/lexicons/app/certified/graph.ts b/packages/api/src/lexicons/app/certified/graph.ts index bffcd84..649f9c6 100644 --- a/packages/api/src/lexicons/app/certified/graph.ts +++ b/packages/api/src/lexicons/app/certified/graph.ts @@ -2,8 +2,8 @@ * THIS FILE WAS GENERATED BY scripts/generate.js WITH "@atproto/lex". DO NOT EDIT. */ -export * as entityFollow from "@hypercerts-org/lexicon/records/app/certified/graph/entityFollow"; -export * as follow from "@hypercerts-org/lexicon/records/app/certified/graph/follow"; +export * as entityFollow from "@hypercerts-org/lexicon/app/certified/graph/entityFollow"; +export * as follow from "@hypercerts-org/lexicon/app/certified/graph/follow"; export * as getEntityFollow from "./graph/getEntityFollow.js"; export * as getEntityFollows from "./graph/getEntityFollows.js"; export * as getFollow from "./graph/getFollow.js"; diff --git a/packages/api/src/lexicons/app/certified/graph/getEntityFollow.defs.ts b/packages/api/src/lexicons/app/certified/graph/getEntityFollow.defs.ts index 9779802..608cfd3 100644 --- a/packages/api/src/lexicons/app/certified/graph/getEntityFollow.defs.ts +++ b/packages/api/src/lexicons/app/certified/graph/getEntityFollow.defs.ts @@ -3,7 +3,7 @@ */ import { l } from "@atproto/lex"; -import * as GraphEntityFollow from "@hypercerts-org/lexicon/records/app/certified/graph/entityFollow.defs"; +import * as GraphEntityFollow from "@hypercerts-org/lexicon/app/certified/graph/entityFollow.defs"; const $nsid = "app.certified.graph.getEntityFollow"; diff --git a/packages/api/src/lexicons/app/certified/graph/getFollow.defs.ts b/packages/api/src/lexicons/app/certified/graph/getFollow.defs.ts index 91c27fa..411ca15 100644 --- a/packages/api/src/lexicons/app/certified/graph/getFollow.defs.ts +++ b/packages/api/src/lexicons/app/certified/graph/getFollow.defs.ts @@ -4,7 +4,7 @@ import { l } from "@atproto/lex"; import * as ApiDefs from "../../../org/hypercerts/api/defs.defs.js"; -import * as GraphFollow from "@hypercerts-org/lexicon/records/app/certified/graph/follow.defs"; +import * as GraphFollow from "@hypercerts-org/lexicon/app/certified/graph/follow.defs"; const $nsid = "app.certified.graph.getFollow"; diff --git a/packages/api/src/lexicons/app/certified/graph/listRecentFollows.defs.ts b/packages/api/src/lexicons/app/certified/graph/listRecentFollows.defs.ts index 5716bc4..d197cf5 100644 --- a/packages/api/src/lexicons/app/certified/graph/listRecentFollows.defs.ts +++ b/packages/api/src/lexicons/app/certified/graph/listRecentFollows.defs.ts @@ -3,8 +3,8 @@ */ import { l } from "@atproto/lex"; -import * as GraphEntityFollow from "@hypercerts-org/lexicon/records/app/certified/graph/entityFollow.defs"; -import * as GraphFollow from "@hypercerts-org/lexicon/records/app/certified/graph/follow.defs"; +import * as GraphEntityFollow from "@hypercerts-org/lexicon/app/certified/graph/entityFollow.defs"; +import * as GraphFollow from "@hypercerts-org/lexicon/app/certified/graph/follow.defs"; const $nsid = "app.certified.graph.listRecentFollows"; diff --git a/packages/api/src/lexicons/app/certified/link.ts b/packages/api/src/lexicons/app/certified/link.ts index 21ec64c..8499594 100644 --- a/packages/api/src/lexicons/app/certified/link.ts +++ b/packages/api/src/lexicons/app/certified/link.ts @@ -2,6 +2,6 @@ * THIS FILE WAS GENERATED BY scripts/generate.js WITH "@atproto/lex". DO NOT EDIT. */ -export * as evm from "@hypercerts-org/lexicon/records/app/certified/link/evm"; +export * as evm from "@hypercerts-org/lexicon/app/certified/link/evm"; export * as getEvmLink from "./link/getEvmLink.js"; export * as listEvmLinks from "./link/listEvmLinks.js"; diff --git a/packages/api/src/lexicons/app/certified/link/getEvmLink.defs.ts b/packages/api/src/lexicons/app/certified/link/getEvmLink.defs.ts index 52f69f3..1e11a34 100644 --- a/packages/api/src/lexicons/app/certified/link/getEvmLink.defs.ts +++ b/packages/api/src/lexicons/app/certified/link/getEvmLink.defs.ts @@ -4,7 +4,7 @@ import { l } from "@atproto/lex"; import * as ApiDefs from "../../../org/hypercerts/api/defs.defs.js"; -import * as LinkEvm from "@hypercerts-org/lexicon/records/app/certified/link/evm.defs"; +import * as LinkEvm from "@hypercerts-org/lexicon/app/certified/link/evm.defs"; const $nsid = "app.certified.link.getEvmLink"; diff --git a/packages/api/src/lexicons/app/certified/location.ts b/packages/api/src/lexicons/app/certified/location.ts index 5064950..cc02a44 100644 --- a/packages/api/src/lexicons/app/certified/location.ts +++ b/packages/api/src/lexicons/app/certified/location.ts @@ -2,7 +2,7 @@ * THIS FILE WAS GENERATED BY scripts/generate.js WITH "@atproto/lex". DO NOT EDIT. */ -export * from "@hypercerts-org/lexicon/records/app/certified/location.defs"; -export { main as default } from "@hypercerts-org/lexicon/records/app/certified/location.defs"; +export * from "@hypercerts-org/lexicon/app/certified/location.defs"; +export { main as default } from "@hypercerts-org/lexicon/app/certified/location.defs"; export * as getLocation from "./location/getLocation.js"; export * as listLocations from "./location/listLocations.js"; diff --git a/packages/api/src/lexicons/app/certified/location/getLocation.defs.ts b/packages/api/src/lexicons/app/certified/location/getLocation.defs.ts index dc644e2..0326d7c 100644 --- a/packages/api/src/lexicons/app/certified/location/getLocation.defs.ts +++ b/packages/api/src/lexicons/app/certified/location/getLocation.defs.ts @@ -4,7 +4,7 @@ import { l } from "@atproto/lex"; import * as ApiDefs from "../../../org/hypercerts/api/defs.defs.js"; -import * as CertifiedLocation from "@hypercerts-org/lexicon/records/app/certified/location.defs"; +import * as CertifiedLocation from "@hypercerts-org/lexicon/app/certified/location.defs"; const $nsid = "app.certified.location.getLocation"; diff --git a/packages/api/src/lexicons/index.ts b/packages/api/src/lexicons/index.ts index 4f13f45..b779835 100644 --- a/packages/api/src/lexicons/index.ts +++ b/packages/api/src/lexicons/index.ts @@ -2,7 +2,7 @@ * THIS FILE WAS GENERATED BY scripts/generate.js WITH "@atproto/lex". DO NOT EDIT. */ +export { com } from "@hypercerts-org/lexicon"; +export { pub } from "@hypercerts-org/lexicon"; export * as app from "./app.js"; -export * as com from "@hypercerts-org/lexicon/records/com"; export * as org from "./org.js"; -export * as pub from "@hypercerts-org/lexicon/records/pub"; diff --git a/packages/api/src/lexicons/org/hypercerts.ts b/packages/api/src/lexicons/org/hypercerts.ts index 2da2a6c..c79ca66 100644 --- a/packages/api/src/lexicons/org/hypercerts.ts +++ b/packages/api/src/lexicons/org/hypercerts.ts @@ -6,7 +6,7 @@ export * as api from "./hypercerts/api.js"; export * as claim from "./hypercerts/claim.js"; export * as collection from "./hypercerts/collection.js"; export * as context from "./hypercerts/context.js"; -export * as defs from "@hypercerts-org/lexicon/records/org/hypercerts/defs"; +export * as defs from "@hypercerts-org/lexicon/org/hypercerts/defs"; export * as entity from "./hypercerts/entity.js"; export * as funding from "./hypercerts/funding.js"; export * as vocab from "./hypercerts/vocab.js"; diff --git a/packages/api/src/lexicons/org/hypercerts/api/defs.defs.ts b/packages/api/src/lexicons/org/hypercerts/api/defs.defs.ts index d2b6edc..5187006 100644 --- a/packages/api/src/lexicons/org/hypercerts/api/defs.defs.ts +++ b/packages/api/src/lexicons/org/hypercerts/api/defs.defs.ts @@ -3,9 +3,9 @@ */ import { l } from "@atproto/lex"; -import * as ActorOrganization from "@hypercerts-org/lexicon/records/app/certified/actor/organization.defs"; -import * as ActorProfile from "@hypercerts-org/lexicon/records/app/certified/actor/profile.defs"; -import * as ContextAcknowledgement from "@hypercerts-org/lexicon/records/org/hypercerts/context/acknowledgement.defs"; +import * as ActorOrganization from "@hypercerts-org/lexicon/app/certified/actor/organization.defs"; +import * as ActorProfile from "@hypercerts-org/lexicon/app/certified/actor/profile.defs"; +import * as ContextAcknowledgement from "@hypercerts-org/lexicon/org/hypercerts/context/acknowledgement.defs"; const $nsid = "org.hypercerts.api.defs"; diff --git a/packages/api/src/lexicons/org/hypercerts/claim.ts b/packages/api/src/lexicons/org/hypercerts/claim.ts index ff3bf61..e45457e 100644 --- a/packages/api/src/lexicons/org/hypercerts/claim.ts +++ b/packages/api/src/lexicons/org/hypercerts/claim.ts @@ -2,9 +2,9 @@ * THIS FILE WAS GENERATED BY scripts/generate.js WITH "@atproto/lex". DO NOT EDIT. */ -export * as activity from "@hypercerts-org/lexicon/records/org/hypercerts/claim/activity"; -export * as contribution from "@hypercerts-org/lexicon/records/org/hypercerts/claim/contribution"; -export * as contributorInformation from "@hypercerts-org/lexicon/records/org/hypercerts/claim/contributorInformation"; +export * as activity from "@hypercerts-org/lexicon/org/hypercerts/claim/activity"; +export * as contribution from "@hypercerts-org/lexicon/org/hypercerts/claim/contribution"; +export * as contributorInformation from "@hypercerts-org/lexicon/org/hypercerts/claim/contributorInformation"; export * as getActivity from "./claim/getActivity.js"; export * as getContribution from "./claim/getContribution.js"; export * as getContributorInformation from "./claim/getContributorInformation.js"; @@ -13,5 +13,5 @@ export * as listActivities from "./claim/listActivities.js"; export * as listContributions from "./claim/listContributions.js"; export * as listContributorInformation from "./claim/listContributorInformation.js"; export * as listRights from "./claim/listRights.js"; -export * as rights from "@hypercerts-org/lexicon/records/org/hypercerts/claim/rights"; +export * as rights from "@hypercerts-org/lexicon/org/hypercerts/claim/rights"; export * as searchActivities from "./claim/searchActivities.js"; diff --git a/packages/api/src/lexicons/org/hypercerts/claim/getActivity.defs.ts b/packages/api/src/lexicons/org/hypercerts/claim/getActivity.defs.ts index 5462b08..782c17e 100644 --- a/packages/api/src/lexicons/org/hypercerts/claim/getActivity.defs.ts +++ b/packages/api/src/lexicons/org/hypercerts/claim/getActivity.defs.ts @@ -4,9 +4,9 @@ import { l } from "@atproto/lex"; import * as ApiDefs from "../api/defs.defs.js"; -import * as ClaimActivity from "@hypercerts-org/lexicon/records/org/hypercerts/claim/activity.defs"; -import * as ClaimContributorInformation from "@hypercerts-org/lexicon/records/org/hypercerts/claim/contributorInformation.defs"; -import * as RepoStrongRef from "@hypercerts-org/lexicon/records/com/atproto/repo/strongRef.defs"; +import * as ClaimActivity from "@hypercerts-org/lexicon/org/hypercerts/claim/activity.defs"; +import * as ClaimContributorInformation from "@hypercerts-org/lexicon/org/hypercerts/claim/contributorInformation.defs"; +import * as RepoStrongRef from "@hypercerts-org/lexicon/com/atproto/repo/strongRef.defs"; const $nsid = "org.hypercerts.claim.getActivity"; diff --git a/packages/api/src/lexicons/org/hypercerts/claim/getContribution.defs.ts b/packages/api/src/lexicons/org/hypercerts/claim/getContribution.defs.ts index 8f787a5..5d7522f 100644 --- a/packages/api/src/lexicons/org/hypercerts/claim/getContribution.defs.ts +++ b/packages/api/src/lexicons/org/hypercerts/claim/getContribution.defs.ts @@ -4,7 +4,7 @@ import { l } from "@atproto/lex"; import * as ApiDefs from "../api/defs.defs.js"; -import * as ClaimContribution from "@hypercerts-org/lexicon/records/org/hypercerts/claim/contribution.defs"; +import * as ClaimContribution from "@hypercerts-org/lexicon/org/hypercerts/claim/contribution.defs"; const $nsid = "org.hypercerts.claim.getContribution"; diff --git a/packages/api/src/lexicons/org/hypercerts/claim/getContributorInformation.defs.ts b/packages/api/src/lexicons/org/hypercerts/claim/getContributorInformation.defs.ts index 3920869..dc4e623 100644 --- a/packages/api/src/lexicons/org/hypercerts/claim/getContributorInformation.defs.ts +++ b/packages/api/src/lexicons/org/hypercerts/claim/getContributorInformation.defs.ts @@ -4,7 +4,7 @@ import { l } from "@atproto/lex"; import * as ApiDefs from "../api/defs.defs.js"; -import * as ClaimContributorInformation from "@hypercerts-org/lexicon/records/org/hypercerts/claim/contributorInformation.defs"; +import * as ClaimContributorInformation from "@hypercerts-org/lexicon/org/hypercerts/claim/contributorInformation.defs"; const $nsid = "org.hypercerts.claim.getContributorInformation"; diff --git a/packages/api/src/lexicons/org/hypercerts/claim/getRights.defs.ts b/packages/api/src/lexicons/org/hypercerts/claim/getRights.defs.ts index 1ee8aae..87124c3 100644 --- a/packages/api/src/lexicons/org/hypercerts/claim/getRights.defs.ts +++ b/packages/api/src/lexicons/org/hypercerts/claim/getRights.defs.ts @@ -4,7 +4,7 @@ import { l } from "@atproto/lex"; import * as ApiDefs from "../api/defs.defs.js"; -import * as ClaimRights from "@hypercerts-org/lexicon/records/org/hypercerts/claim/rights.defs"; +import * as ClaimRights from "@hypercerts-org/lexicon/org/hypercerts/claim/rights.defs"; const $nsid = "org.hypercerts.claim.getRights"; diff --git a/packages/api/src/lexicons/org/hypercerts/collection.ts b/packages/api/src/lexicons/org/hypercerts/collection.ts index e614a84..4b2d260 100644 --- a/packages/api/src/lexicons/org/hypercerts/collection.ts +++ b/packages/api/src/lexicons/org/hypercerts/collection.ts @@ -2,8 +2,8 @@ * THIS FILE WAS GENERATED BY scripts/generate.js WITH "@atproto/lex". DO NOT EDIT. */ -export * from "@hypercerts-org/lexicon/records/org/hypercerts/collection.defs"; -export { main as default } from "@hypercerts-org/lexicon/records/org/hypercerts/collection.defs"; +export * from "@hypercerts-org/lexicon/org/hypercerts/collection.defs"; +export { main as default } from "@hypercerts-org/lexicon/org/hypercerts/collection.defs"; export * as getCollection from "./collection/getCollection.js"; export * as listCollectionItems from "./collection/listCollectionItems.js"; export * as listCollections from "./collection/listCollections.js"; diff --git a/packages/api/src/lexicons/org/hypercerts/collection/getCollection.defs.ts b/packages/api/src/lexicons/org/hypercerts/collection/getCollection.defs.ts index 05b946a..4101e94 100644 --- a/packages/api/src/lexicons/org/hypercerts/collection/getCollection.defs.ts +++ b/packages/api/src/lexicons/org/hypercerts/collection/getCollection.defs.ts @@ -3,11 +3,11 @@ */ import { l } from "@atproto/lex"; -import * as ActorOrganization from "@hypercerts-org/lexicon/records/app/certified/actor/organization.defs"; -import * as ActorProfile from "@hypercerts-org/lexicon/records/app/certified/actor/profile.defs"; -import * as CertifiedLocation from "@hypercerts-org/lexicon/records/app/certified/location.defs"; -import * as HypercertsCollection from "@hypercerts-org/lexicon/records/org/hypercerts/collection.defs"; -import * as VocabTag from "@hypercerts-org/lexicon/records/org/hypercerts/vocab/tag.defs"; +import * as ActorOrganization from "@hypercerts-org/lexicon/app/certified/actor/organization.defs"; +import * as ActorProfile from "@hypercerts-org/lexicon/app/certified/actor/profile.defs"; +import * as CertifiedLocation from "@hypercerts-org/lexicon/app/certified/location.defs"; +import * as HypercertsCollection from "@hypercerts-org/lexicon/org/hypercerts/collection.defs"; +import * as VocabTag from "@hypercerts-org/lexicon/org/hypercerts/vocab/tag.defs"; const $nsid = "org.hypercerts.collection.getCollection"; diff --git a/packages/api/src/lexicons/org/hypercerts/collection/listCollectionItems.defs.ts b/packages/api/src/lexicons/org/hypercerts/collection/listCollectionItems.defs.ts index e90c05b..aecdeec 100644 --- a/packages/api/src/lexicons/org/hypercerts/collection/listCollectionItems.defs.ts +++ b/packages/api/src/lexicons/org/hypercerts/collection/listCollectionItems.defs.ts @@ -5,8 +5,8 @@ import { l } from "@atproto/lex"; import * as ClaimGetActivity from "../claim/getActivity.defs.js"; import * as CollectionGetCollection from "./getCollection.defs.js"; -import * as EntityFeature from "@hypercerts-org/lexicon/records/org/hypercerts/entity/feature.defs"; -import * as RepoStrongRef from "@hypercerts-org/lexicon/records/com/atproto/repo/strongRef.defs"; +import * as EntityFeature from "@hypercerts-org/lexicon/org/hypercerts/entity/feature.defs"; +import * as RepoStrongRef from "@hypercerts-org/lexicon/com/atproto/repo/strongRef.defs"; const $nsid = "org.hypercerts.collection.listCollectionItems"; diff --git a/packages/api/src/lexicons/org/hypercerts/context.ts b/packages/api/src/lexicons/org/hypercerts/context.ts index 60c0767..32cdc30 100644 --- a/packages/api/src/lexicons/org/hypercerts/context.ts +++ b/packages/api/src/lexicons/org/hypercerts/context.ts @@ -2,9 +2,9 @@ * THIS FILE WAS GENERATED BY scripts/generate.js WITH "@atproto/lex". DO NOT EDIT. */ -export * as acknowledgement from "@hypercerts-org/lexicon/records/org/hypercerts/context/acknowledgement"; -export * as attachment from "@hypercerts-org/lexicon/records/org/hypercerts/context/attachment"; -export * as evaluation from "@hypercerts-org/lexicon/records/org/hypercerts/context/evaluation"; +export * as acknowledgement from "@hypercerts-org/lexicon/org/hypercerts/context/acknowledgement"; +export * as attachment from "@hypercerts-org/lexicon/org/hypercerts/context/attachment"; +export * as evaluation from "@hypercerts-org/lexicon/org/hypercerts/context/evaluation"; export * as getAcknowledgement from "./context/getAcknowledgement.js"; export * as getAttachment from "./context/getAttachment.js"; export * as getEvaluation from "./context/getEvaluation.js"; @@ -13,4 +13,4 @@ export * as listAcknowledgements from "./context/listAcknowledgements.js"; export * as listAttachments from "./context/listAttachments.js"; export * as listEvaluations from "./context/listEvaluations.js"; export * as listMeasurements from "./context/listMeasurements.js"; -export * as measurement from "@hypercerts-org/lexicon/records/org/hypercerts/context/measurement"; +export * as measurement from "@hypercerts-org/lexicon/org/hypercerts/context/measurement"; diff --git a/packages/api/src/lexicons/org/hypercerts/context/getAttachment.defs.ts b/packages/api/src/lexicons/org/hypercerts/context/getAttachment.defs.ts index 01e2e03..6263fae 100644 --- a/packages/api/src/lexicons/org/hypercerts/context/getAttachment.defs.ts +++ b/packages/api/src/lexicons/org/hypercerts/context/getAttachment.defs.ts @@ -4,7 +4,7 @@ import { l } from "@atproto/lex"; import * as ApiDefs from "../api/defs.defs.js"; -import * as ContextAttachment from "@hypercerts-org/lexicon/records/org/hypercerts/context/attachment.defs"; +import * as ContextAttachment from "@hypercerts-org/lexicon/org/hypercerts/context/attachment.defs"; const $nsid = "org.hypercerts.context.getAttachment"; diff --git a/packages/api/src/lexicons/org/hypercerts/context/getEvaluation.defs.ts b/packages/api/src/lexicons/org/hypercerts/context/getEvaluation.defs.ts index 62df9ac..cc4b6f8 100644 --- a/packages/api/src/lexicons/org/hypercerts/context/getEvaluation.defs.ts +++ b/packages/api/src/lexicons/org/hypercerts/context/getEvaluation.defs.ts @@ -4,7 +4,7 @@ import { l } from "@atproto/lex"; import * as ApiDefs from "../api/defs.defs.js"; -import * as ContextEvaluation from "@hypercerts-org/lexicon/records/org/hypercerts/context/evaluation.defs"; +import * as ContextEvaluation from "@hypercerts-org/lexicon/org/hypercerts/context/evaluation.defs"; const $nsid = "org.hypercerts.context.getEvaluation"; diff --git a/packages/api/src/lexicons/org/hypercerts/context/getMeasurement.defs.ts b/packages/api/src/lexicons/org/hypercerts/context/getMeasurement.defs.ts index e7833ca..e2df548 100644 --- a/packages/api/src/lexicons/org/hypercerts/context/getMeasurement.defs.ts +++ b/packages/api/src/lexicons/org/hypercerts/context/getMeasurement.defs.ts @@ -4,7 +4,7 @@ import { l } from "@atproto/lex"; import * as ApiDefs from "../api/defs.defs.js"; -import * as ContextMeasurement from "@hypercerts-org/lexicon/records/org/hypercerts/context/measurement.defs"; +import * as ContextMeasurement from "@hypercerts-org/lexicon/org/hypercerts/context/measurement.defs"; const $nsid = "org.hypercerts.context.getMeasurement"; diff --git a/packages/api/src/lexicons/org/hypercerts/entity.ts b/packages/api/src/lexicons/org/hypercerts/entity.ts index 5192456..e77bf4a 100644 --- a/packages/api/src/lexicons/org/hypercerts/entity.ts +++ b/packages/api/src/lexicons/org/hypercerts/entity.ts @@ -3,6 +3,6 @@ */ export * as defs from "./entity/defs.js"; -export * as feature from "@hypercerts-org/lexicon/records/org/hypercerts/entity/feature"; +export * as feature from "@hypercerts-org/lexicon/org/hypercerts/entity/feature"; export * as getFeature from "./entity/getFeature.js"; export * as listFeatures from "./entity/listFeatures.js"; diff --git a/packages/api/src/lexicons/org/hypercerts/entity/defs.defs.ts b/packages/api/src/lexicons/org/hypercerts/entity/defs.defs.ts index aa7d2f6..9492be0 100644 --- a/packages/api/src/lexicons/org/hypercerts/entity/defs.defs.ts +++ b/packages/api/src/lexicons/org/hypercerts/entity/defs.defs.ts @@ -4,7 +4,7 @@ import { l } from "@atproto/lex"; import * as ApiDefs from "../api/defs.defs.js"; -import * as EntityFeature from "@hypercerts-org/lexicon/records/org/hypercerts/entity/feature.defs"; +import * as EntityFeature from "@hypercerts-org/lexicon/org/hypercerts/entity/feature.defs"; const $nsid = "org.hypercerts.entity.defs"; diff --git a/packages/api/src/lexicons/org/hypercerts/funding.ts b/packages/api/src/lexicons/org/hypercerts/funding.ts index 51c618b..b443c83 100644 --- a/packages/api/src/lexicons/org/hypercerts/funding.ts +++ b/packages/api/src/lexicons/org/hypercerts/funding.ts @@ -4,4 +4,4 @@ export * as getReceipt from "./funding/getReceipt.js"; export * as listReceipts from "./funding/listReceipts.js"; -export * as receipt from "@hypercerts-org/lexicon/records/org/hypercerts/funding/receipt"; +export * as receipt from "@hypercerts-org/lexicon/org/hypercerts/funding/receipt"; diff --git a/packages/api/src/lexicons/org/hypercerts/funding/getReceipt.defs.ts b/packages/api/src/lexicons/org/hypercerts/funding/getReceipt.defs.ts index 92fc5f3..ac440b1 100644 --- a/packages/api/src/lexicons/org/hypercerts/funding/getReceipt.defs.ts +++ b/packages/api/src/lexicons/org/hypercerts/funding/getReceipt.defs.ts @@ -4,7 +4,7 @@ import { l } from "@atproto/lex"; import * as ApiDefs from "../api/defs.defs.js"; -import * as FundingReceipt from "@hypercerts-org/lexicon/records/org/hypercerts/funding/receipt.defs"; +import * as FundingReceipt from "@hypercerts-org/lexicon/org/hypercerts/funding/receipt.defs"; const $nsid = "org.hypercerts.funding.getReceipt"; diff --git a/packages/api/src/lexicons/org/hypercerts/vocab.ts b/packages/api/src/lexicons/org/hypercerts/vocab.ts index 5b36479..fe22741 100644 --- a/packages/api/src/lexicons/org/hypercerts/vocab.ts +++ b/packages/api/src/lexicons/org/hypercerts/vocab.ts @@ -4,4 +4,4 @@ export * as getVocabTag from "./vocab/getVocabTag.js"; export * as listVocabTags from "./vocab/listVocabTags.js"; -export * as tag from "@hypercerts-org/lexicon/records/org/hypercerts/vocab/tag"; +export * as tag from "@hypercerts-org/lexicon/org/hypercerts/vocab/tag"; diff --git a/packages/api/src/lexicons/org/hypercerts/vocab/getVocabTag.defs.ts b/packages/api/src/lexicons/org/hypercerts/vocab/getVocabTag.defs.ts index 0a841e7..c6570f0 100644 --- a/packages/api/src/lexicons/org/hypercerts/vocab/getVocabTag.defs.ts +++ b/packages/api/src/lexicons/org/hypercerts/vocab/getVocabTag.defs.ts @@ -4,7 +4,7 @@ import { l } from "@atproto/lex"; import * as ApiDefs from "../api/defs.defs.js"; -import * as VocabTag from "@hypercerts-org/lexicon/records/org/hypercerts/vocab/tag.defs"; +import * as VocabTag from "@hypercerts-org/lexicon/org/hypercerts/vocab/tag.defs"; const $nsid = "org.hypercerts.vocab.getVocabTag"; diff --git a/packages/api/src/lexicons/org/hypercerts/workscope.ts b/packages/api/src/lexicons/org/hypercerts/workscope.ts index 93a92c2..bcc028b 100644 --- a/packages/api/src/lexicons/org/hypercerts/workscope.ts +++ b/packages/api/src/lexicons/org/hypercerts/workscope.ts @@ -2,7 +2,7 @@ * THIS FILE WAS GENERATED BY scripts/generate.js WITH "@atproto/lex". DO NOT EDIT. */ -export * as cel from "@hypercerts-org/lexicon/records/org/hypercerts/workscope/cel"; +export * as cel from "@hypercerts-org/lexicon/org/hypercerts/workscope/cel"; export * as getWorkscopeTag from "./workscope/getWorkscopeTag.js"; export * as listWorkscopeTags from "./workscope/listWorkscopeTags.js"; -export * as tag from "@hypercerts-org/lexicon/records/org/hypercerts/workscope/tag"; +export * as tag from "@hypercerts-org/lexicon/org/hypercerts/workscope/tag"; diff --git a/packages/api/src/lexicons/org/hypercerts/workscope/getWorkscopeTag.defs.ts b/packages/api/src/lexicons/org/hypercerts/workscope/getWorkscopeTag.defs.ts index a6cea68..20e4d73 100644 --- a/packages/api/src/lexicons/org/hypercerts/workscope/getWorkscopeTag.defs.ts +++ b/packages/api/src/lexicons/org/hypercerts/workscope/getWorkscopeTag.defs.ts @@ -4,7 +4,7 @@ import { l } from "@atproto/lex"; import * as ApiDefs from "../api/defs.defs.js"; -import * as WorkscopeTag from "@hypercerts-org/lexicon/records/org/hypercerts/workscope/tag.defs"; +import * as WorkscopeTag from "@hypercerts-org/lexicon/org/hypercerts/workscope/tag.defs"; const $nsid = "org.hypercerts.workscope.getWorkscopeTag"; diff --git a/packages/api/test/client.test.js b/packages/api/test/client.test.js index 04503af..5dd2286 100644 --- a/packages/api/test/client.test.js +++ b/packages/api/test/client.test.js @@ -21,6 +21,16 @@ test("LEXICON_VERSION matches the package metadata", () => { assert.equal(api.LEXICON_VERSION, packageJson.hypercerts.lexiconVersion); }); +// The client's record types must describe what the server modules validate. +test("the client and the server modules use the same @hypercerts-org/lexicon", async () => { + const modules = JSON.parse( + await readFile(new URL("../../../happyview-modules/package.json", import.meta.url), "utf8"), + ); + const serverVersion = modules.dependencies["@hypercerts-org/lexicon"]; + assert.equal(packageJson.devDependencies["@hypercerts-org/lexicon"], serverVersion); + assert.equal(api.LEXICON_VERSION, serverVersion); +}); + /** * Follows an NSID through lex's namespace tree: org.hypercerts.claim.getActivity. * @param {object} root @@ -31,7 +41,7 @@ const lookup = (root, nsid) => nsid.split(".").reduce((node, part) => /** @type {any} */ (node)?.[part], root); test("every Lexicon in happyview-modules/manifest.json is at its NSID path", async () => { - const records = await import("@hypercerts-org/lexicon/records"); + const records = await import("@hypercerts-org/lexicon"); const sources = manifest.validationLexicons; const queryIds = sources .filter((/** @type {any} */ source) => source.path && !source.id.endsWith(".defs")) @@ -56,7 +66,7 @@ test("every Lexicon in happyview-modules/manifest.json is at its NSID path", asy } }); -test("embedded records are validated with the schemas from @hypercerts-org/lexicon/records", async () => { +test("embedded records are validated with the schemas from @hypercerts-org/lexicon", async () => { const view = { uri: "at://did:plc:abc123/org.hypercerts.claim.activity/3k2abc", cid: "bafyreie5737gdxlw5i64vzichcalba3z2v5n6icifvx5xytvske7mr3hpm", diff --git a/packages/api/test/types.ts b/packages/api/test/types.ts index fcdab85..f4b970f 100644 --- a/packages/api/test/types.ts +++ b/packages/api/test/types.ts @@ -2,7 +2,7 @@ // (tsconfig.test.json), never run. Each @ts-expect-error must stay an error. import { Client } from "@atproto/lex"; import { app, org } from "@hypercerts-org/api"; -import type { org as records } from "@hypercerts-org/lexicon/records"; +import type { org as records } from "@hypercerts-org/lexicon"; const api = new Client("https://api.example"); const uri = "at://did:plc:abc123/org.hypercerts.claim.activity/3k2abc" as const; @@ -14,7 +14,7 @@ export async function views(): Promise { return activity; } -// Records in the API tree are the modules of @hypercerts-org/lexicon/records. +// Records in the API tree are the modules of @hypercerts-org/lexicon. export const record = (view: ActivityView): records.hypercerts.claim.activity.Main => view.record; export const sameRecord = ( activity: records.hypercerts.claim.activity.Main, diff --git a/packages/api/vendor/hypercerts-org-lexicon-1.7.0.tgz b/packages/api/vendor/hypercerts-org-lexicon-1.7.0.tgz deleted file mode 100644 index 36109f7..0000000 Binary files a/packages/api/vendor/hypercerts-org-lexicon-1.7.0.tgz and /dev/null differ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3951420..8cab5c8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -61,8 +61,8 @@ importers: specifier: 0.5.4 version: 0.5.4 '@hypercerts-org/lexicon': - specifier: 1.6.0 - version: 1.6.0(@atproto/xrpc@0.8.13) + specifier: 2.0.0 + version: 2.0.0(@atproto/lex@0.4.2) devDependencies: '@eslint/js': specifier: ^10.0.1 @@ -89,8 +89,8 @@ importers: specifier: 2.6.3 version: 2.6.3 '@hypercerts-org/lexicon': - specifier: file:vendor/hypercerts-org-lexicon-1.7.0.tgz - version: file:packages/api/vendor/hypercerts-org-lexicon-1.7.0.tgz(@atproto/lex@0.4.2) + specifier: 2.0.0 + version: 2.0.0(@atproto/lex@0.4.2) '@types/node': specifier: 24.19.2 version: 24.19.2 @@ -244,10 +244,6 @@ packages: '@atproto/lexicon@0.6.2': resolution: {integrity: sha512-p3Ly6hinVZW0ETuAXZMeUGwuMm3g8HvQMQ41yyEE6AL0hAkfeKFaZKos6BdBrr6CjkpbrDZqE8M+5+QOceysMw==} - '@atproto/lexicon@0.7.14': - resolution: {integrity: sha512-hDG2+61JTrvxDFtoojDFxKmZkFVl/lR/jFi82gSN0zNDjr+dlpUGKlG9MoPBkUKK83+Pi+I2jZ55xXboJq6JTA==} - engines: {node: '>=22'} - '@atproto/repo@0.11.2': resolution: {integrity: sha512-I4Nak2e9O7mzBO9y7RNYwCnjcHoNafG1mmDj3vomLp2U8x6a8zlMZVq44mqx6mCMzXgnYKOZGigWRAAuS//FgQ==} engines: {node: '>=22'} @@ -259,10 +255,6 @@ packages: resolution: {integrity: sha512-MJ+QUo8yzAGP2SOQKs2CBI2ouY5KaO9Pv5a7laX3xtrkfWmS/s96L/FCJm5VBHEvKXmd6ap/HSGypYclQcfoWA==} engines: {node: '>=22'} - '@atproto/xrpc@0.8.13': - resolution: {integrity: sha512-htpi93/Zqyk5WsT+RrWemxMcJFJx2M4VT8i8avuWJTyr7AZ42qvPsIdVsaPdOOS3rZwodq/SdZXJFgspJ4yc5g==} - engines: {node: '>=22'} - '@babel/helper-string-parser@7.29.7': resolution: {integrity: sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==} engines: {node: '>=6.9.0'} @@ -553,19 +545,11 @@ packages: resolution: {integrity: sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==} engines: {node: '>=18.18'} - '@hypercerts-org/lexicon@1.6.0': - resolution: {integrity: sha512-lJJzCgSFJkGhsOXBtVJOnQUgwaodMQD+0a10PryANuA77es0O34o1+I7BMyXVcMm/fW/6+hYvBeWpYsRXWpQ0g==} - peerDependencies: - '@atproto/xrpc': '*' - - '@hypercerts-org/lexicon@file:packages/api/vendor/hypercerts-org-lexicon-1.7.0.tgz': - resolution: {integrity: sha512-K2A8fRxPD9iCCJJeLrFCRRwPy/3LgSpb4xFEI+eBagO2t7PIkcQ9FOc3WIwwdjcE6CISpkSV3Spta2RICNGn8w==, tarball: file:packages/api/vendor/hypercerts-org-lexicon-1.7.0.tgz} - version: 1.7.0 + '@hypercerts-org/lexicon@2.0.0': + resolution: {integrity: sha512-5R0QCP1iGf+kcK8RM5LfveeE26FdnocUMevwp9D/hJsZCHYTmSbAKRgF5rDnFBh/ckxYO4W1d8wZJij5TKE9Zw==} + engines: {node: '>=22'} peerDependencies: '@atproto/lex': ^0.4.2 - peerDependenciesMeta: - '@atproto/lex': - optional: true '@hypercerts-org/ui-react@0.2.0': resolution: {integrity: sha512-3/8PJluH07euvnAliQaIYGsVrrpTApeo/NgwoHMQpRTf8PXOagoEhnv/NffSgJNfTKao5ShKLCk5F5I6gpKLLw==} @@ -2726,13 +2710,6 @@ snapshots: multiformats: 9.9.0 zod: 3.25.76 - '@atproto/lexicon@0.7.14': - dependencies: - '@atproto/common-web': 0.5.15 - '@atproto/syntax': 0.7.7 - multiformats: 13.4.2 - zod: 3.25.76 - '@atproto/repo@0.11.2': dependencies: '@atproto/common': 0.8.7 @@ -2753,11 +2730,6 @@ snapshots: iso-datestring-validator: 2.2.2 tslib: 2.8.1 - '@atproto/xrpc@0.8.13': - dependencies: - '@atproto/lexicon': 0.7.14 - zod: 3.25.76 - '@babel/helper-string-parser@7.29.7': {} '@babel/helper-validator-identifier@7.29.7': {} @@ -3135,18 +3107,11 @@ snapshots: '@humanwhocodes/retry@0.4.3': {} - '@hypercerts-org/lexicon@1.6.0(@atproto/xrpc@0.8.13)': - dependencies: - '@atproto/lexicon': 0.6.2 - '@atproto/xrpc': 0.8.13 - multiformats: 13.4.2 - - '@hypercerts-org/lexicon@file:packages/api/vendor/hypercerts-org-lexicon-1.7.0.tgz(@atproto/lex@0.4.2)': + '@hypercerts-org/lexicon@2.0.0(@atproto/lex@0.4.2)': dependencies: + '@atproto/lex': 0.4.2 '@atproto/lexicon': 0.6.2 multiformats: 13.4.2 - optionalDependencies: - '@atproto/lex': 0.4.2 '@hypercerts-org/ui-react@0.2.0(react-dom@19.3.0(react@19.3.0))(react@19.3.0)': dependencies: