Skip to content

Commit 056e723

Browse files
committed
making progress converting to typescript project refernces
1 parent 93bcd96 commit 056e723

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+3559
-145
lines changed

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
},
1212
"scripts": {
1313
"bootstrap": "lerna bootstrap",
14-
"build": "lerna run build",
15-
"rebuild": "lerna run rebuild",
14+
"build": "tsc --build --verbose",
15+
"rebuild": "tsc --build --force --verbose",
1616
"publish": "lerna publish"
1717
},
1818
"devDependencies": {

packages/graphql-codegen-hasura-client-config/package.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@
99
"type": "git",
1010
"url": "git+https://github.com/ahrnee/graphql-codegen-hasura"
1111
},
12-
"scripts": {
13-
"build": "tsc --build --verbose",
14-
"rebuild": "tsc --build --force --verbose"
15-
},
12+
"scripts": {},
1613
"publishConfig": {
1714
"access": "public"
1815
},

packages/graphql-codegen-hasura-client-config/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
injectEntityCacheRedirect,
1212
injectGlobalConfigCode,
1313
injectCombinedTypePolicyObject
14-
} from "../../shared";
14+
} from "graphql-codegen-hasura-shared";
1515

1616
// -----------------------------------------------------
1717
//
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,9 @@
11
{
2+
"extends": "../../tsconfig-base",
23
"compilerOptions": {
3-
"esModuleInterop": true,
4-
"importHelpers": true,
5-
"experimentalDecorators": true,
6-
"module": "commonjs",
7-
"target": "es2018",
8-
"lib": ["es6", "esnext", "es2015", "dom"],
9-
"suppressImplicitAnyIndexErrors": true,
10-
"moduleResolution": "node",
11-
"emitDecoratorMetadata": true,
12-
"sourceMap": true,
13-
"declaration": true,
14-
"outDir": "./dist/",
15-
"noImplicitAny": false,
16-
"noImplicitThis": true,
17-
"alwaysStrict": true,
18-
"noImplicitReturns": true,
19-
"noUnusedLocals": false,
20-
"noUnusedParameters": false
4+
"outDir": "dist",
215
},
226
"include": ["src/**/*.ts"],
23-
"exclude": ["node_modules", "tests", "dist"]
7+
"exclude": ["node_modules", "tests", "dist"],
8+
"references": [{ "path": "../graphql-codegen-hasura-shared" }]
249
}

packages/graphql-codegen-hasura-core/package.json

+2-5
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,10 @@
99
"type": "git",
1010
"url": "git+https://github.com/ahrnee/graphql-codegen-hasura"
1111
},
12-
"scripts": {
13-
"build": "rm -r dist/ && mkdir -p dist/ && cp package.json dist/ && tsc --build --verbose",
14-
"rebuild": "rm -r dist/ && mkdir -p dist/ && cp package.json dist/ && tsc --build --force --verbose"
15-
},
12+
"scripts": {},
1613
"publishConfig": {
1714
"access": "public",
18-
"directory": "dist"
15+
"directory": "dist/src"
1916
},
2017
"peerDependencies": {
2118
"graphql-tag": "^2.0.0"

packages/graphql-codegen-hasura-core/tsconfig.json

+2-18
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,7 @@
11
{
2+
"extends": "../../tsconfig-base",
23
"compilerOptions": {
3-
"esModuleInterop": true,
4-
"importHelpers": true,
5-
"experimentalDecorators": true,
6-
"module": "commonjs",
7-
"target": "es2018",
8-
"lib": ["es6", "esnext", "es2015", "dom"],
9-
"suppressImplicitAnyIndexErrors": true,
10-
"moduleResolution": "node",
11-
"emitDecoratorMetadata": true,
12-
"sourceMap": true,
13-
"declaration": true,
14-
"outDir": "./dist/",
15-
"noImplicitAny": false,
16-
"noImplicitThis": true,
17-
"alwaysStrict": true,
18-
"noImplicitReturns": true,
19-
"noUnusedLocals": false,
20-
"noUnusedParameters": false,
4+
"outDir": "dist",
215
},
226
"include": ["src/**/*.ts"],
237
"exclude": ["node_modules", "tests", "dist"]

packages/graphql-codegen-hasura-gql/package.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@
99
"type": "git",
1010
"url": "git+https://github.com/ahrnee/graphql-codegen-hasura"
1111
},
12-
"scripts": {
13-
"build": "tsc --build --verbose",
14-
"rebuild": "tsc --build --force --verbose"
15-
},
12+
"scripts": {},
1613
"publishConfig": {
1714
"access": "public"
1815
},

packages/graphql-codegen-hasura-gql/src/index.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,16 @@ import { PluginFunction, Types } from "@graphql-codegen/plugin-helpers";
22
import { RawTypesConfig } from "@graphql-codegen/visitor-plugin-common";
33
import { FragmentDefinitionNode, GraphQLSchema } from "graphql";
44
import { TypeMap } from "graphql/type/schema";
5-
import { getPrimaryKeyIdField, injectDeleteGql, injectFetchGql, injectFragmentImport, injectInsertGql, injectUpdateGql, ContentManager, injectGlobalGqlCode } from "../../shared";
5+
import {
6+
getPrimaryKeyIdField,
7+
injectDeleteGql,
8+
injectFetchGql,
9+
injectFragmentImport,
10+
injectInsertGql,
11+
injectUpdateGql,
12+
ContentManager,
13+
injectGlobalGqlCode
14+
} from "graphql-codegen-hasura-shared";
615

716
// -----------------------------------------------------
817
//
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,9 @@
11
{
2+
"extends": "../../tsconfig-base",
23
"compilerOptions": {
3-
"esModuleInterop": true,
4-
"importHelpers": true,
5-
"experimentalDecorators": true,
6-
"module": "commonjs",
7-
"target": "es2018",
8-
"lib": ["es6", "esnext", "es2015", "dom"],
9-
"suppressImplicitAnyIndexErrors": true,
10-
"moduleResolution": "node",
11-
"emitDecoratorMetadata": true,
12-
"sourceMap": true,
13-
"declaration": true,
14-
"outDir": "./dist/",
15-
"noImplicitAny": false,
16-
"noImplicitThis": true,
17-
"alwaysStrict": true,
18-
"noImplicitReturns": true,
19-
"noUnusedLocals": false,
20-
"noUnusedParameters": false,
4+
"outDir": "dist",
215
},
226
"include": ["src/**/*.ts"],
23-
"exclude": ["node_modules", "tests", "dist"]
7+
"exclude": ["node_modules", "tests", "dist"],
8+
"references": [{ "path": "../graphql-codegen-hasura-shared" }]
249
}

packages/graphql-codegen-hasura-react/package.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@
99
"type": "git",
1010
"url": "git+https://github.com/ahrnee/graphql-codegen-hasura"
1111
},
12-
"scripts": {
13-
"build": "tsc --build --verbose",
14-
"rebuild": "tsc --build --force --verbose"
15-
},
12+
"scripts": {},
1613
"publishConfig": {
1714
"access": "public"
1815
},

packages/graphql-codegen-hasura-react/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
injectInsertReact,
1212
injectSharedReact,
1313
injectUpdateReact
14-
} from "../../shared";
14+
} from "graphql-codegen-hasura-shared";
1515

1616
// -----------------------------------------------------
1717
//
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,9 @@
11
{
2+
"extends": "../../tsconfig-base",
23
"compilerOptions": {
3-
"esModuleInterop": true,
4-
"importHelpers": true,
5-
"experimentalDecorators": true,
6-
"module": "commonjs",
7-
"target": "es2018",
8-
"lib": ["es6", "esnext", "es2015", "dom"],
9-
"suppressImplicitAnyIndexErrors": true,
10-
"moduleResolution": "node",
11-
"emitDecoratorMetadata": true,
12-
"sourceMap": true,
13-
"declaration": true,
14-
"outDir": "./dist/",
15-
"noImplicitAny": false,
16-
"noImplicitThis": true,
17-
"alwaysStrict": true,
18-
"noImplicitReturns": true,
19-
"noUnusedLocals": false,
20-
"noUnusedParameters": false,
4+
"outDir": "dist",
215
},
226
"include": ["src/**/*.ts"],
23-
"exclude": ["node_modules", "tests", "dist"]
7+
"exclude": ["node_modules", "tests", "dist"],
8+
"references": [{ "path": "../graphql-codegen-hasura-shared" }]
249
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import { FieldDefinitionNode, FragmentDefinitionNode } from "graphql";
2+
import { TypeMap } from "graphql/type/schema";
3+
import { ContentManager } from ".";
4+
export declare function injectGlobalConfigCode({ contentManager, typescriptCodegenOutputPath, withResolverTypes, withTypePolicies }: {
5+
contentManager: ContentManager;
6+
typescriptCodegenOutputPath: string;
7+
withResolverTypes: boolean;
8+
withTypePolicies: boolean;
9+
}): void;
10+
export declare function injectEntityTypePolicy({ contentManager, entityName, fragmentName, trimString, primaryKeyIdField, typescriptCodegenOutputPath }: {
11+
contentManager: ContentManager;
12+
entityName: string;
13+
fragmentName: string;
14+
trimString?: string;
15+
primaryKeyIdField?: FieldDefinitionNode | null;
16+
typescriptCodegenOutputPath: string;
17+
}): void;
18+
export declare function injectEntityCacheRedirect({ contentManager, entityName, fragmentName, trimString, primaryKeyIdField, typescriptCodegenOutputPath }: {
19+
contentManager: ContentManager;
20+
entityName: string;
21+
fragmentName: string;
22+
trimString?: string;
23+
primaryKeyIdField?: FieldDefinitionNode | null;
24+
typescriptCodegenOutputPath: string;
25+
}): void;
26+
export declare function injectEntityResolverTypes({ contentManager, entityName, fragmentName, trimString, primaryKeyIdField, typescriptCodegenOutputPath }: {
27+
contentManager: ContentManager;
28+
entityName: string;
29+
fragmentName: string;
30+
trimString?: string;
31+
primaryKeyIdField: FieldDefinitionNode;
32+
typescriptCodegenOutputPath: string;
33+
}): void;
34+
export declare function injectCombinedTypePolicyObject(fragmentDefinitionNodes: FragmentDefinitionNode[], contentManager: ContentManager, schemaTypeMap: TypeMap, trimString?: string): void;

packages/graphql-codegen-hasura-shared/dist/src/configInjectors.js

+145
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/graphql-codegen-hasura-shared/dist/src/configInjectors.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)