Skip to content

Commit eade206

Browse files
committed
feat: another try at fixing babel
1 parent a428185 commit eade206

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

src/serviceFile.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
22

3-
import t, { tsTypeAnnotation } from "@babel/types"
3+
import * as _t from "@babel/types"
44
import * as graphql from "graphql"
55

66
import { AppContext } from "./context.js"
@@ -10,6 +10,8 @@ import { CodeFacts, ModelResolverFacts, ResolverFuncFact } from "./typeFacts.js"
1010
import { TypeMapper, typeMapper } from "./typeMap.js"
1111
import { capitalizeFirstLetter, createAndReferOrInlineArgsForField, inlineArgsForField } from "./utils.js"
1212

13+
const t = (_t as any).default || _t
14+
1315
export const lookAtServiceFile = async (file: string, context: AppContext) => {
1416
const { gql, prisma, pathSettings: settings, codeFacts: serviceFacts, fieldFacts } = context
1517

src/sharedSchema.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
/// The main schema for objects and inputs
22

3-
import t from "@babel/types"
3+
import * as _t from "@babel/types"
4+
45
import * as graphql from "graphql"
56

67
import { AppContext } from "./context.js"
78
import { builder } from "./tsBuilder.js"
89
import { typeMapper } from "./typeMap.js"
910
import { makeStep } from "./utils.js"
1011

12+
const t = (_t as any).default || _t
13+
1114
export const createSharedSchemaFiles = async (context: AppContext, verbose: boolean) => {
1215
const step = makeStep(verbose)
1316
await step("Creating shared schema files", () => createSharedExternalSchemaFile(context))

src/tsBuilder.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import _generator from "@babel/generator"
2-
import _parser from "@babel/parser"
2+
import * as _parser from "@babel/parser"
33
import _traverse from "@babel/traverse"
4-
import _t, {
4+
import {
55
addComment,
66
BlockStatement,
77
Declaration,
@@ -10,6 +10,7 @@ import _t, {
1010
TSType,
1111
TSTypeParameterDeclaration,
1212
} from "@babel/types"
13+
import * as _t from "@babel/types"
1314

1415
interface InterfaceProperty {
1516
docs?: string

0 commit comments

Comments
 (0)