Skip to content
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

Add transformJsonSchema #34

Merged
merged 3 commits into from
Sep 16, 2023
Merged
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
8 changes: 4 additions & 4 deletions packages/transformers/ajsttil/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ export enum TypeMetadataKind {
arrayType,
booleanType,
floatType,
indexSignatureType,
integerType,
literalType,
noneType,
objectType,
or,
propertyType,
stringIndexSignatureType,
stringType,
xor,
}
Expand Down Expand Up @@ -41,8 +41,6 @@ export type ArrayTypeMetadata =
export type BooleanTypeMetadata =
BaseTypeMetadata<TypeMetadataKind.booleanType>;
export type FloatTypeMetadata = BaseTypeMetadata<TypeMetadataKind.floatType>;
export type IndexSignatureType =
OneChildTypeMetadata<TypeMetadataKind.indexSignatureType>;
export type IntegerTypeMetadata =
BaseTypeMetadata<TypeMetadataKind.integerType>;
export interface LiteralTypeMetadata
Expand All @@ -57,6 +55,8 @@ export interface PropertyTypeMetadata
isOptional: boolean;
property: string;
}
export type StringIndexSignatureType =
OneChildTypeMetadata<TypeMetadataKind.stringIndexSignatureType>;
export type StringTypeMetadata = BaseTypeMetadata<TypeMetadataKind.stringType>;
export type XorTypeMetadata = ManyChildrenTypeMetadata<TypeMetadataKind.xor>;

Expand All @@ -66,12 +66,12 @@ export type TypeMedatata =
| ArrayTypeMetadata
| BooleanTypeMetadata
| FloatTypeMetadata
| IndexSignatureType
| IntegerTypeMetadata
| LiteralTypeMetadata
| NoneTypeMetadata
| ObjectTypeMetadata
| OrTypeMetadata
| PropertyTypeMetadata
| StringIndexSignatureType
| StringTypeMetadata
| XorTypeMetadata;
3 changes: 3 additions & 0 deletions packages/transformers/json-schema-2-ajsttil/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [UNRELEASED]

### Added
- Added `transformJsonSchema`.



3 changes: 3 additions & 0 deletions packages/transformers/json-schema-2-ajsttil/jest.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { tsGlobalConfig } from '@cuaklabs/jest-config';

export default tsGlobalConfig;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { jsGlobalConfig } from '@cuaklabs/jest-config';

export default jsGlobalConfig;
12 changes: 11 additions & 1 deletion packages/transformers/json-schema-2-ajsttil/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@
"eslint-plugin-import": "2.26.0",
"eslint-plugin-jest": "27.4.0",
"eslint-plugin-prettier": "5.0.0",
"jest": "29.6.4",
"jest-mock": "29.6.3",
"prettier": "3.0.3",
"rimraf": "5.0.1",
"ts-jest": "29.1.1",
"ts-node": "10.9.1",
"typescript": "5.2.2"
},
"bugs": {
Expand All @@ -37,7 +41,13 @@
"build:clean": "rimraf lib",
"format": "prettier --write ./src/**/*.ts",
"lint": "eslint --ext ts --ignore-path .gitignore ./src",
"prebuild": "pnpm run build:clean"
"prebuild": "pnpm run build:clean",
"test:ts": "jest --config=jest.config.mjs --runInBand",
"test:integration": "pnpm run test --selectProjects Integration",
"test": "jest --config=jest.js.config.mjs --runInBand",
"test:coverage": "pnpm run test --coverage",
"test:uncommitted": "pnpm run test:ts --changedSince=HEAD",
"test:unit": "pnpm run test --selectProjects Unit"
},
"version": "0.1.0"
}
7 changes: 6 additions & 1 deletion packages/transformers/json-schema-2-ajsttil/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
export {};
import { transformJsonSchema } from './jsonSchema/202012/calculations/transformJsonSchema';
import { TransformJsonSchemaContext } from './jsonSchema/202012/models/TransformJsonSchemaContext';

export type { TransformJsonSchemaContext };

export { transformJsonSchema };
Loading