-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat!: wip first naive json db semantic-conv #63
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GJ!
Please go over the code files and improve the spacing and grouping of related code parts.
package.json
Outdated
@@ -11,11 +21,14 @@ | |||
"lint": "eslint .", | |||
"lint:fix": "eslint --fix .", | |||
"release": "standard-version", | |||
"prebuild": "npm run clean", | |||
"prebuild": "npm run clean && npm run validate && npm run generateTypes && npm run generateAttributes", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generate types should not run in prebuild.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed.
package.json
Outdated
"generateAttributes": "node --import=tsimp/import scripts/build-semantic-conventions.mts", | ||
"generateTypes": "json2ts schemas/attribute.schema.json > scripts/autogen.mts", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets change is so the format of the name is generate:types
like with format and lint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
schemas/attribute.schema.json
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add descriptions to the various fields
src/semanticConventions/README.md
Outdated
## example | ||
Below are short examples for schema definition and domain.json files. | ||
|
||
### Some json-schema definition | ||
```json | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema", | ||
"type": "object", | ||
"additionalProperties": false, | ||
"title": "cat family hierarchy schema", | ||
"required": ["clan", "content"], | ||
"properties": { | ||
"clan": { | ||
"type": "string" | ||
}, | ||
"content": { | ||
"$ref": "#/definitions/recursive" | ||
} | ||
}, | ||
"definitions": { | ||
"recursive": { | ||
"type": "object", | ||
"additionalProperties": false, | ||
"title": "clan tree", | ||
"required": ["propertyName", "description"], | ||
"properties": { | ||
"propertyName": { | ||
"type": "string" | ||
}, | ||
"kind": { | ||
"type": "string" | ||
}, | ||
"description": { | ||
"type": "string" | ||
}, | ||
"deprecated": { | ||
"type": "boolean" | ||
}, | ||
"subAttributes": { | ||
"type": "object", | ||
"additionalProperties": { | ||
"$ref": "#/definitions/recursive" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
### Convert json-schema definition into typescripts | ||
running CLI (json2ts) | ||
|
||
```bash | ||
npx json2ts schemas/cats.schema.json > scripts/cats.mts | ||
``` | ||
|
||
Will expect ts autogenerated module with types | ||
|
||
```typescript | ||
/* eslint-disable */ | ||
/** | ||
* This file was automatically generated by json-schema-to-typescript. | ||
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, | ||
* and run json-schema-to-typescript to regenerate this file. | ||
*/ | ||
|
||
export interface ConventionSchema { | ||
domain?: string; | ||
content: AttributeDescription; | ||
} | ||
export interface AttributeDescription { | ||
propertyName: string; | ||
kind?: string; | ||
description: string; | ||
deprecated?: boolean; | ||
subAttributes?: { | ||
[k: string]: AttributeDescription; | ||
}; | ||
} | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we talked, this is not needed, only short section on when and how to generate types
Co-authored-by: Ofer <[email protected]>
Co-authored-by: Ofer <[email protected]>
Co-authored-by: Ofer <[email protected]>
Co-authored-by: Ofer <[email protected]>
Co-authored-by: Ofer <[email protected]>
Co-authored-by: Ofer <[email protected]>
Co-authored-by: Ofer <[email protected]>
Co-authored-by: Ofer <[email protected]>
Co-authored-by: Ofer <[email protected]>
…emetry into semanticsAttributesInfra
…emetry into semanticsAttributesInfra
If this a WIP, then please don't add the |
I added this as the ts config changes breaks existing code. |
Ok, NP. |
Co-authored-by: Shimon Cohen <[email protected]>
Co-authored-by: Shimon Cohen <[email protected]>
Co-authored-by: Shimon Cohen <[email protected]>
Co-authored-by: Shimon Cohen <[email protected]>
Co-authored-by: Shimon Cohen <[email protected]>
Co-authored-by: Shimon Cohen <[email protected]>
Co-authored-by: Shimon Cohen <[email protected]>
…emetry into semanticsAttributesInfra
MapColonies implementaion for semantic convention of project attributes
first imlementation of static db (json) based.
Raster domain oriented