@embracesql/shared
Advanced tools
Comparing version 0.0.2 to 0.0.3
{ | ||
"name": "@embracesql/shared", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "EmbraceSQL shared types between browser and node.", | ||
@@ -13,9 +13,7 @@ "type": "module", | ||
"dependencies": { | ||
"change-case": ">=4.0.0", | ||
"change-case": "^5.3.0", | ||
"parsimmon": "^1.18.1", | ||
"uuid": "^9.0.1" | ||
}, | ||
"devDependencies": { | ||
"ts-jest": "^29.1.1" | ||
}, | ||
"gitHead": "ae6361bd48bb27798c635cdb30e0990d5c90960c" | ||
"gitHead": "ce8c43da83ab6e340d337431a8d18e652a127cbd" | ||
} |
@@ -1,2 +0,2 @@ | ||
import { GenerationContext } from "."; | ||
import { GeneratesTypeScriptParser, GenerationContext } from "."; | ||
import { DispatchOperation } from "./index"; | ||
@@ -20,2 +20,3 @@ import { camelCase, pascalCase } from "change-case"; | ||
IndexColumn, | ||
Type, | ||
} | ||
@@ -78,2 +79,3 @@ | ||
[ASTKind.IndexColumn]?: Visitor<IndexColumnNode>; | ||
[ASTKind.Type]?: Visitor<TypeNode>; | ||
}; | ||
@@ -185,2 +187,13 @@ | ||
/** | ||
* Represents a single type inside of postgres. | ||
* | ||
* These are grouped by schema. | ||
*/ | ||
export class TypeNode extends ASTNode { | ||
constructor(schema: SchemaNode, public parser: GeneratesTypeScriptParser) { | ||
super(ASTKind.Type, schema); | ||
} | ||
} | ||
/** | ||
* Collects all tables in a schema in a database. | ||
@@ -187,0 +200,0 @@ */ |
@@ -5,2 +5,3 @@ import { DatabaseNode, VisitorMap } from "./ast"; | ||
export * from "./typescript"; | ||
export * from "./parsers"; | ||
@@ -100,1 +101,3 @@ /** | ||
export type DispatchOperation = "" | ".create"; | ||
export type { GeneratesTypeScriptParser } from "./typescript"; |
@@ -0,1 +1,2 @@ | ||
import { GenerationContext } from "."; | ||
import { ASTNode, Visitor, isNamed } from "./ast"; | ||
@@ -49,1 +50,12 @@ import { pascalCase } from "change-case"; | ||
}; | ||
/** | ||
* Pretty much everything touched with JS/TS ends up as a string. | ||
* And needs to be parsed back from a string to a type. | ||
* | ||
* Implement this interface to generate a function that is a parser from | ||
* string back to a type. | ||
*/ | ||
export interface GeneratesTypeScriptParser { | ||
typescriptTypeParser(context: GenerationContext) : string; | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
18004
0
12
600
1
3
+ Addedparsimmon@^1.18.1
+ Addedparsimmon@1.18.1(transitive)
Updatedchange-case@^5.3.0