Skip to content
Open
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
3 changes: 3 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ module.exports = {
ignoreRestSiblings: true,
},
],
// TODO: Enable this rule when we can turn it on for the website
// and example projects.
// "@typescript-eslint/consistent-type-imports": "error",
"no-constant-condition": ["error", { checkLoops: false }],
"no-constant-binary-expression": "error",
},
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
- name: Build # Integration tests depend upon having .js versions created by tsc
run: pnpm run build
- name: Unit Tests
run: pnpm run test
run: pnpm run testCI
lint:
name: "Lint"
runs-on: ubuntu-latest
Expand Down
7 changes: 0 additions & 7 deletions examples/express-graphql-http/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
{
// Most ts-node options can be specified here using their programmatic names.
"ts-node": {
"files": true,
// It is faster to skip typechecking.
// Remove if you want ts-node to do typechecking.
"transpileOnly": false
},
"grats": {
"nullableByDefault": false
},
Expand Down
7 changes: 0 additions & 7 deletions examples/express-graphql/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
{
// Most ts-node options can be specified here using their programmatic names.
"ts-node": {
// It is faster to skip typechecking.
// Remove if you want ts-node to do typechecking.
"files": true,
"transpileOnly": true
},
"grats": {
"nullableByDefault": false
},
Expand Down
8 changes: 4 additions & 4 deletions examples/production-app/models/PostConnection.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { GqlInfo, Int } from "grats";
import type { GqlInfo, Int } from "grats";
import * as DB from "../Database";
import { VC } from "../ViewerContext";
import { Post } from "./Post";
import { Connection } from "../graphql/Connection";
import type { VC } from "../ViewerContext";
import type { Post } from "./Post";
import type { Connection } from "../graphql/Connection";
import { connectionFromSelectOrCount } from "../graphql/gqlUtils.js";

/**
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"!dist/src/tests"
],
"scripts": {
"test": "ts-node src/tests/test.ts",
"test": "node --experimental-strip-types src/tests/test.ts",
"testCI": "node dist/tests/test.js",
"integration-tests": "node src/tests/integration.mjs",
"build": "rm -rf dist/ && tsc --build",
"format": "prettier . --write",
Expand All @@ -19,8 +20,8 @@
"dependencies": {
"commander": "^10.0.0",
"graphql": "^16.9.0",
"typescript": "5.5.4",
"semver": "^7.5.4"
"semver": "^7.5.4",
"typescript": "5.8.3"
},
"devDependencies": {
"@types/node": "^18.14.6",
Expand All @@ -32,8 +33,7 @@
"node-fetch": "^3.3.1",
"path-browserify": "^1.0.1",
"prettier": "^2.8.7",
"process": "^0.11.10",
"ts-node": "^10.9.1"
"process": "^0.11.10"
},
"prettier": {
"trailingComma": "all"
Expand Down
95 changes: 36 additions & 59 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
CONTEXT_TAG,
INFO_TAG,
DIRECTIVE_TAG,
} from "./Extractor";
} from "./Extractor.ts";

export const ISSUE_URL = "https://github.com/captbaritone/grats/issues";

Expand Down
47 changes: 22 additions & 25 deletions src/Extractor.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {
import type {
FieldDefinitionNode,
InputValueDefinitionNode,
Kind,
NamedTypeNode,
NameNode,
TypeNode,
Expand All @@ -13,40 +12,38 @@ import {
ConstObjectFieldNode,
ConstObjectValueNode,
ConstListValueNode,
assertName,
DefinitionNode,
} from "graphql";
import { assertName } from "graphql";
import {
Kind,
version as graphqlJSVersion,
TokenKind,
GraphQLError,
} from "graphql";
import { gte as semverGte } from "semver";
import {
tsErr,
tsRelated,
import type {
DiagnosticsResult,
gqlErr,
DiagnosticResult,
} from "./utils/DiagnosticError";
import { err, ok } from "./utils/Result";
} from "./utils/DiagnosticError.ts";
import { tsErr, tsRelated, gqlErr } from "./utils/DiagnosticError.ts";
import { err, ok } from "./utils/Result.ts";
import * as ts from "typescript";
import {
DeclarationDefinition,
NameDefinition,
UNRESOLVED_REFERENCE_NAME,
} from "./TypeContext";
import * as E from "./Errors";
import { traverseJSDocTags } from "./utils/JSDoc";
import { GraphQLConstructor } from "./GraphQLConstructor";
import { relativePath } from "./gratsRoot";
import { ISSUE_URL } from "./Errors";
import { detectInvalidComments } from "./comments";
import { extend, invariant } from "./utils/helpers";
import * as Act from "./CodeActions";
import {
import type { DeclarationDefinition, NameDefinition } from "./TypeContext.ts";
import { UNRESOLVED_REFERENCE_NAME } from "./TypeContext.ts";
import * as E from "./Errors.ts";
import { traverseJSDocTags } from "./utils/JSDoc.ts";
import { GraphQLConstructor } from "./GraphQLConstructor.ts";
import { relativePath } from "./gratsRoot.mts";
import { ISSUE_URL } from "./Errors.ts";
import { detectInvalidComments } from "./comments.ts";
import { extend, invariant } from "./utils/helpers.ts";
import * as Act from "./CodeActions.ts";
import type {
InputValueDefinitionNodeOrResolverArg,
ResolverArgument,
} from "./resolverSignature";
import { Parser } from "graphql/language/parser";
} from "./resolverSignature.ts";
import { Parser } from "graphql/language/parser.js";

export const LIBRARY_IMPORT_NAME = "grats";
export const LIBRARY_NAME = "Grats";
Expand Down
2 changes: 1 addition & 1 deletion src/GraphQLAstExtensions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ResolverSignature } from "./resolverSignature";
import type { ResolverSignature } from "./resolverSignature.ts";

/**
* In most cases we can use directives to annotate constructs
Expand Down
Loading
Loading