Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
sqs committed Dec 28, 2023
1 parent 9b86857 commit a34c174
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 13 deletions.
2 changes: 1 addition & 1 deletion lib/protocol/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
],
"sideEffects": false,
"scripts": {
"generate": "node --no-warnings=ExperimentalWarning --loader ts-node/esm/transpile-only ../schema/dev/generateJsonSchemaTypes.ts src/opencodegraph-protocol.schema.json \"import { Item, Annotation } from '@opencodegraph/schema'\" > src/opencodegraph-protocol.schema.ts && pnpm -w run format \"$PNPM_SCRIPT_SRC_DIR/src/opencodegraph-protocol.schema.ts\"",
"generate": "node --no-warnings=ExperimentalWarning --loader ts-node/esm/transpile-only ../schema/dev/generateJsonSchemaTypes.ts src/opencodegraph-protocol.schema.json \"import { Annotation } from '@opencodegraph/schema'\" > src/opencodegraph-protocol.schema.ts && pnpm -w run format \"$PNPM_SCRIPT_SRC_DIR/src/opencodegraph-protocol.schema.ts\"",
"build": "pnpm run --silent generate && tsc --build",
"test": "vitest",
"prepublishOnly": "tsc --build --clean && pnpm run build"
Expand Down
8 changes: 1 addition & 7 deletions lib/schema/src/opencodegraph.schema.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "opencodegraph.schema.json#",
"title": "Data",
"title": "Schema",
"description": "Metadata about code",
"allowComments": true,
"type": "object",
Expand Down Expand Up @@ -36,12 +36,6 @@
"description": "Information from the annotation intended for consumption by AI, not humans.",
"$ref": "#/definitions/AnnotationAIInfo"
},
"meta": {
"description": "For future use.",
"type": "object",
"additionalProperties": false,
"properties": {}
},
"range": {
"description": "The range in the file that this annotation applies to. If not set, the annotation applies to the entire file.",
"$ref": "#/definitions/Range"
Expand Down
6 changes: 1 addition & 5 deletions lib/schema/src/opencodegraph.schema.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Metadata about code
*/
export interface Data {
export interface Schema {
annotations?: Annotation[]
}
/**
Expand All @@ -18,10 +18,6 @@ export interface Annotation {
url?: string
ui?: AnnotationUI
ai?: AnnotationAIInfo
/**
* For future use.
*/
meta?: {}
range?: Range
}
/**
Expand Down
4 changes: 4 additions & 0 deletions web/content/docs/concepts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,7 @@ How do clients authenticate with providers? Right now, a few hostnames are hard-
### Implementing providers: thin clients or lots-of-logic?

Will OpenCodeGraph providers be super lightweight presentation-layer programs that hit some existing system that makes the data easy to fetch? Maybe that existing system is a separate server built for OCG to hit for now, but ideally in the future (years) it would become a common endpoint for dev tools vendors to expose, like oEmbed.

### Recording additional metadata

How should annotations record other kinds of metadata to make it searchable and exportable? For example, the Storybook provider could add `{"storybook": true}` metadata in an annotation on all storybook files, which would make it possible to identify all storybook files in a code search application.

0 comments on commit a34c174

Please sign in to comment.