Skip to content
Merged
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
325 changes: 123 additions & 202 deletions bun.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default {
},
generates: {
"test/integration/Types.kt": {
plugins: ["dist/plugin.cjs"],
plugins: ["dist/plugin.mjs"],
},
},
} satisfies CodegenConfig;
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"private": true,
"scripts": {
"build": "tsc && bun generate && docusaurus build",
"generate": "jsdoc2md --files ../dist/plugin.cjs --partial partials/main.hbs --partial partials/scope.hbs -c jsdoc.conf > docs/configuration.md",
"generate": "jsdoc2md --files ../dist/plugin.mjs --partial partials/main.hbs --partial partials/scope.hbs -c jsdoc.conf > docs/configuration.md",
"start": "docusaurus start"
},
"devDependencies": {
Expand Down
14 changes: 12 additions & 2 deletions docs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
{
// This file is not used in compilation. It is here just for a nice editor experience.
"extends": "@docusaurus/tsconfig",
"compilerOptions": {
"baseUrl": "."
"allowJs": true,
"esModuleInterop": true,
"jsx": "preserve",
"target": "ES2022",
"lib": ["ES2022", "DOM"],
"moduleResolution": "bundler",
"module": "esnext",
"noEmit": true,
"paths": {
"@site/*": ["./*"]
},
"skipLibCheck": true
}
}
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@expediagroup/graphql-kotlin-codegen",
"packageManager": "bun@1.3.12",
"main": "dist/plugin.cjs",
"main": "dist/plugin.mjs",
"types": "dist/plugin.d.cts",
"files": [
"dist",
Expand All @@ -28,14 +28,15 @@
"@total-typescript/ts-reset": "0.6.1",
"@types/bun": "1.3.12",
"eslint": "10.2.0",
"glob": "13.0.6",
"husky": "9.1.7",
"prettier": "3.8.2",
"tsup": "8.5.1",
"typescript": "5.9.3",
"tsdown": "0.21.8",
"typescript": "6.0.2",
"typescript-eslint": "8.58.1"
},
"scripts": {
"build": "tsup src/plugin.ts --clean --dts --external graphql",
"build": "tsdown src/plugin.ts --deps.neverBundle graphql",
"docs:build": "bun run build && bun --filter docs build",
"docs:start": "bun --filter docs start",
"format": "prettier --write .",
Expand Down
2 changes: 1 addition & 1 deletion src/visitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { buildInterfaceDefinition } from "./definitions/interface";
import { buildInputObjectDefinition } from "./definitions/input";
import { buildObjectTypeDefinition } from "./definitions/object";
import { buildUnionTypeDefinition } from "./definitions/union";
import { ParsedConfig } from "@graphql-codegen/visitor-plugin-common/typings/base-visitor";
import { ParsedConfig } from "@graphql-codegen/visitor-plugin-common";

export class KotlinVisitor extends BaseVisitor<
RawConfig,
Expand Down
6 changes: 3 additions & 3 deletions test/plugin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { buildSchema } from "graphql";
import { GraphQLKotlinCodegenConfig, plugin } from "../src/plugin";
import { describe, expect, it } from "bun:test";
import { Types } from "@graphql-codegen/plugin-helpers";
import * as glob from "glob";
import { globSync } from "glob";

function buildUnitTest({
testName,
Expand Down Expand Up @@ -33,14 +33,14 @@ function buildUnitTest({
});
}

const testDirectories = glob.sync("./test/unit/*");
const testDirectories = globSync("./test/unit/*");
const testCases = await Promise.all(
testDirectories.map(async (testPath) => {
const testName = testPath.split("/").findLast(Boolean);
if (!testName) throw new Error("Test name not found");
const absolutePath = `${process.cwd()}/${testPath}`;
const configExists =
glob.sync(`${absolutePath}/codegen.config.ts`).length > 0;
globSync(`${absolutePath}/codegen.config.ts`).length > 0;
if (!configExists) {
return {
testName,
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"declaration": true,
"module": "esnext",
"moduleResolution": "node",
"moduleResolution": "bundler",
"noEmit": true,
"noImplicitAny": true,
"noUncheckedIndexedAccess": true,
Expand Down