File tree 11 files changed +25
-25
lines changed
11 files changed +25
-25
lines changed File renamed without changes.
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ const config: CodegenConfig = {
12
12
preset : 'import-types' ,
13
13
plugins : [ 'typescript-operations' ] ,
14
14
presetConfig : {
15
- typesPath : './graphql-types' ,
15
+ typesPath : './graphql-types.js ' ,
16
16
} ,
17
17
} ,
18
18
} ,
Original file line number Diff line number Diff line change 1
- module . exports = {
2
- preset : 'ts-jest' ,
1
+ /** @type {import('ts-jest').JestConfigWithTsJest } */
2
+ export default {
3
+ preset : 'ts-jest/presets/default-esm' ,
3
4
clearMocks : true ,
4
- testEnvironment : 'node' ,
5
- testMatch : [ '**/*.test.ts' ] ,
6
- verbose : true
5
+ // https://kulshekhar.github.io/ts-jest/docs/guides/esm-support/
6
+ moduleNameMapper : {
7
+ '^(\\.{1,2}/.*)\\.js$' : '$1' ,
8
+ } ,
7
9
}
Original file line number Diff line number Diff line change 7
7
"test" : " jest" ,
8
8
"graphql-codegen" : " graphql-codegen --config graphql-codegen.ts"
9
9
},
10
+ "type" : " module" ,
10
11
"dependencies" : {
11
12
"@actions/core" : " 1.10.1" ,
12
13
"@actions/github" : " 6.0.0" ,
Original file line number Diff line number Diff line change 1
- import * as Types from './graphql-types' ;
1
+ import * as Types from './graphql-types.js ' ;
2
2
3
3
export type CommentsQueryVariables = Types . Exact < {
4
4
owner : Types . Scalars [ 'String' ] [ 'input' ] ;
Original file line number Diff line number Diff line change 1
1
import * as core from '@actions/core'
2
- import { run } from './run'
2
+ import { run } from './run.js '
3
3
4
4
const main = async ( ) : Promise < void > => {
5
5
await run ( {
Original file line number Diff line number Diff line change 1
- import { GitHub } from '@actions/github/lib/utils '
2
- import { CommentsQuery , CommentsQueryVariables } from '../generated/graphql'
1
+ import * as github from '@actions/github'
2
+ import { CommentsQuery , CommentsQueryVariables } from '../generated/graphql.js '
3
3
4
- type Octokit = InstanceType < typeof GitHub >
4
+ type Octokit = ReturnType < typeof github . getOctokit >
5
5
6
6
const query = /* GraphQL */ `
7
7
query comments($owner: String!, $name: String!, $number: Int!) {
Original file line number Diff line number Diff line change 1
- import { GitHub } from '@actions/github/lib/utils '
2
- import { MinimizeCommentMutation , MinimizeCommentMutationVariables } from '../generated/graphql'
1
+ import * as github from '@actions/github'
2
+ import { MinimizeCommentMutation , MinimizeCommentMutationVariables } from '../generated/graphql.js '
3
3
4
- type Octokit = InstanceType < typeof GitHub >
4
+ type Octokit = ReturnType < typeof github . getOctokit >
5
5
6
6
const query = /* GraphQL */ `
7
7
mutation minimizeComment($id: ID!) {
@@ -13,7 +13,7 @@ const query = /* GraphQL */ `
13
13
14
14
export const minimizeComment = async (
15
15
o : Octokit ,
16
- v : MinimizeCommentMutationVariables
16
+ v : MinimizeCommentMutationVariables ,
17
17
) : Promise < MinimizeCommentMutation > => {
18
18
return await o . graphql < MinimizeCommentMutation > ( query , v )
19
19
}
Original file line number Diff line number Diff line change 1
1
import * as core from '@actions/core'
2
2
import * as github from '@actions/github'
3
- import { GitHub } from '@actions/github/lib/utils'
4
- import { CommentsQuery } from './generated/graphql'
5
- import { queryComments } from './queries/comments'
6
- import { minimizeComment } from './queries/minimize'
3
+ import { CommentsQuery } from './generated/graphql.js'
4
+ import { queryComments } from './queries/comments.js'
5
+ import { minimizeComment } from './queries/minimize.js'
7
6
8
- type Octokit = InstanceType < typeof GitHub >
7
+ type Octokit = ReturnType < typeof github . getOctokit >
9
8
10
9
type Inputs = {
11
10
authors : string [ ]
Original file line number Diff line number Diff line change 1
- import { toMinimize } from '../src/run'
1
+ import { toMinimize } from '../src/run.js '
2
2
3
3
describe ( 'filter to minimize' , ( ) => {
4
4
test ( 'no filter' , ( ) => {
Original file line number Diff line number Diff line change 1
1
{
2
- "extends" : " @tsconfig/node20/tsconfig.json" ,
3
- "compilerOptions" : {
4
- "outDir" : " ./lib"
5
- }
2
+ "$schema" : " https://json.schemastore.org/tsconfig" ,
3
+ "extends" : " @tsconfig/node20/tsconfig.json"
6
4
}
You can’t perform that action at this time.
0 commit comments