Skip to content

Commit

Permalink
Feat/62 adding schema generator code (#5)
Browse files Browse the repository at this point in the history
* feat: adding schema-generator code

* feat: updating root package.json

* feat: adding types file

* feat: adding functionality to run tests
  • Loading branch information
April-Bates-Dev authored Aug 23, 2023
1 parent b59f626 commit 64e9c04
Show file tree
Hide file tree
Showing 17 changed files with 4,563 additions and 111 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Contract } from "src/types";
import { Contract } from "../../types";
export interface PersonRegisteredContract extends Contract {
"detail-type": "PersonRegisteredContract";
detail: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Contract } from "src/types";
import { Contract } from "../../types";
export interface PersonRegisteredContract extends Contract {
"detail-type": "PersonRegisteredContract";
detail: {
Expand Down
9 changes: 9 additions & 0 deletions example-architecture/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export interface Contract {
readonly "detail-type": string;
readonly detail: Detail;
}

export interface Detail {
readonly "detail-version": number;
readonly data: Record<string, unknown>;
}
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
"repository": "https://github.com/aleios-cloud/eventbridge-toolbox.git",
"scripts": {
"clean": "rimraf dist",
"test": "vitest run",
"lint-fix": "eslint . --ext=js,ts --fix",
"lint-test": "eslint . --ext=js,ts",
"build": "pnpm clean && tsc && cp src/doc-template.md dist/doc-template.md"
"build": "pnpm clean && tsc",
"generate-example-docs": "ts-node --esm src/script.ts example-architecture/events/contracts event-catalog/events"
},
"files": [
"dist"
Expand Down Expand Up @@ -38,6 +40,7 @@
"ts-json-schema-generator": "^1.2.0",
"ts-node": "^10.9.1",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.1.6"
"typescript": "^5.1.6",
"vitest": "^0.34.1"
}
}
}
Loading

0 comments on commit 64e9c04

Please sign in to comment.