-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e7aaef2
commit ff1465c
Showing
22 changed files
with
352 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@powership/boilerplate", | ||
"version": "3.3.7", | ||
"version": "3.3.10", | ||
"author": "antoniopresto <[email protected]>", | ||
"sideEffects": false, | ||
"type": "module", | ||
|
@@ -61,7 +61,7 @@ | |
"ts-jest": "*", | ||
"typedoc": "*", | ||
"typescript": "*", | ||
"@powership/babel-plugins": "3.3.7", | ||
"@powership/babel-plugins": "3.3.10", | ||
"@babel/preset-typescript": "*", | ||
"@babel/preset-env": "*", | ||
"@babel/plugin-transform-typescript": "*", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "logstorm", | ||
"version": "3.3.7", | ||
"version": "3.3.10", | ||
"typings": "out", | ||
"author": "antoniopresto <[email protected]>", | ||
"type": "module", | ||
|
@@ -124,6 +124,6 @@ | |
"tsx": "*", | ||
"ulid": "*", | ||
"url-pattern": "*", | ||
"@powership/utils": "3.3.7" | ||
"@powership/utils": "3.3.10" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "powership", | ||
"version": "3.3.7", | ||
"version": "3.3.10", | ||
"author": "antoniopresto <[email protected]>", | ||
"type": "module", | ||
"main": "./out/index.cjs", | ||
|
@@ -105,11 +105,11 @@ | |
"tsconfig": "./tsconfig.module.json" | ||
}, | ||
"peerDependencies": { | ||
"@powership/utils": "3.3.7", | ||
"@powership/schema": "3.3.7", | ||
"@powership/entity": "3.3.7", | ||
"@powership/utils": "3.3.10", | ||
"@powership/schema": "3.3.10", | ||
"@powership/entity": "3.3.10", | ||
"highlight.js": "*", | ||
"@powership/transporter": "3.3.7", | ||
"@powership/transporter": "3.3.10", | ||
"dataloader": "*", | ||
"plugin-hooks": "*", | ||
"sift": "*", | ||
|
@@ -152,12 +152,12 @@ | |
"tsx": "*", | ||
"ulid": "*", | ||
"url-pattern": "*", | ||
"plugin-engine": "3.3.7", | ||
"plugin-engine": "3.3.10", | ||
"body-parser": "*", | ||
"graphql-playground-html": "*", | ||
"http-errors": "*", | ||
"http-status-codes": "*", | ||
"logstorm": "3.3.7", | ||
"@powership/server": "3.3.7" | ||
"logstorm": "3.3.10", | ||
"@powership/server": "3.3.10" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "runmate", | ||
"version": "3.3.7", | ||
"version": "3.3.10", | ||
"typings": "out", | ||
"author": "antoniopresto <[email protected]>", | ||
"license": "MIT", | ||
|
@@ -141,8 +141,8 @@ | |
"ts-toolbelt": "*", | ||
"ulid": "*", | ||
"url-pattern": "*", | ||
"@powership/utils": "3.3.7", | ||
"logstorm": "3.3.7", | ||
"@powership/utils": "3.3.10", | ||
"logstorm": "3.3.10", | ||
"@types/vorpal": "*", | ||
"@types/glob": "*" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
import { keys } from '@powership/utils'; | ||
|
||
import { createType, GraphType } from './GraphType/GraphType'; | ||
import { FieldDefinitions, FieldTypeName } from './fields/_fieldDefinitions'; | ||
import { FieldDefinition } from './fields/_parseFields'; | ||
import { types } from './fields/fieldTypes'; | ||
|
||
export type __Cast<A1 extends any, A2 extends any> = A1 extends A2 ? A1 : A2; | ||
|
||
export type CreateType< | ||
Name extends FieldTypeName, | ||
Definition extends FieldDefinitions[Name] | ||
> = [Extract<Definition, undefined>] extends [never] | ||
? <Def extends Definition>( | ||
...params: [name: string, definition: Def] | [definition: Def] | ||
) => GraphType<__Cast<{ [N in Name]: Def }, FieldDefinition>> | ||
: // | ||
// | ||
// | ||
<Def extends Definition>( | ||
...params: [name?: string, definition?: Def] | [definition?: Def] | ||
) => GraphType<__Cast<{ [N in Name]: Def }, FieldDefinition>>; | ||
|
||
export type _Creators<Name extends FieldTypeName> = | ||
FieldDefinitions[Name] extends unknown | ||
? CreateType<Name, FieldDefinitions[Name]> | ||
: never; | ||
|
||
export type Creators = { | ||
[Name in FieldTypeName]: Name extends unknown ? _Creators<Name> : never; | ||
}; | ||
|
||
export const t = keys(types).reduce((acc, tname) => { | ||
function fn(...args: any[]) { | ||
if (typeof args[0] === 'string') { | ||
// @ts-ignore | ||
return createType(args[0], { [tname]: args[1] }); | ||
} | ||
// @ts-ignore | ||
return createType({ [tname]: args[1] }); | ||
} | ||
|
||
Object.defineProperty(fn, 'name', { value: `${tname}Type` }); | ||
|
||
return { ...acc, [tname]: fn }; | ||
}, {} as any) as unknown as Creators; | ||
|
||
const { | ||
boolean: booleanType, | ||
string: stringType, | ||
ID: idType, | ||
any: anyType, | ||
float: floatType, | ||
object: objectType, | ||
undefined: undefinedType, | ||
cursor: cursorType, | ||
int: intType, | ||
array: arrayType, | ||
date: dateType, | ||
unknown: unknownType, | ||
email: emailType, | ||
literal: literalType, | ||
enum: enumType, | ||
null: nullType, | ||
meta: metaType, | ||
record: recordType, | ||
ulid: ulidType, | ||
union: unionType, | ||
phone: phoneType, | ||
alias: aliasType, | ||
} = t; | ||
|
||
export { | ||
booleanType, | ||
stringType, | ||
idType, | ||
anyType, | ||
floatType, | ||
objectType, | ||
undefinedType, | ||
cursorType, | ||
intType, | ||
arrayType, | ||
dateType, | ||
unknownType, | ||
emailType, | ||
literalType, | ||
enumType, | ||
nullType, | ||
metaType, | ||
recordType, | ||
ulidType, | ||
unionType, | ||
phoneType, | ||
aliasType, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.