Skip to content

Commit d5ac377

Browse files
authored
move to root to esm (#1323)
1 parent 5e19559 commit d5ac377

File tree

14 files changed

+80
-99
lines changed

14 files changed

+80
-99
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
packageManager: pnpm
3737

3838
- name: Use GraphQL v${{matrix.graphql_version}}
39-
run: node ./scripts/match-graphql.mjs ${{matrix.graphql_version}}
39+
run: node ./scripts/match-graphql.js ${{matrix.graphql_version}}
4040

4141
- name: Install Dependencies
4242
run: pnpm i --no-frozen-lockfile
@@ -73,7 +73,7 @@ jobs:
7373
packageManager: pnpm
7474

7575
- name: Use GraphQL v${{matrix.graphql_version}}
76-
run: node scripts/match-graphql.mjs ${{matrix.graphql_version}}
76+
run: node scripts/match-graphql.js ${{matrix.graphql_version}}
7777

7878
- name: Install Dependencies
7979
run: pnpm i --no-frozen-lockfile

babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.exports = {
1+
export default {
22
presets: [
33
['@babel/preset-env', { targets: { node: process.versions.node.split('.')[0] } }],
44
'@babel/preset-typescript',

bob.config.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

jest.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.exports = {
1+
export default {
22
modulePathIgnorePatterns: ['/dist/'],
33
moduleNameMapper: {
44
'@graphql-eslint/eslint-plugin': '<rootDir>/packages/plugin/src/index.ts',
@@ -7,5 +7,5 @@ module.exports = {
77
'^.+\\.(t|j)sx?$': '@swc/jest',
88
},
99
snapshotSerializers: ['jest-snapshot-serializer-raw/always'],
10-
snapshotResolver: './snapshot-resolver.js',
10+
snapshotResolver: './snapshot-resolver.cjs',
1111
};

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
{
2+
"type": "module",
23
"repository": "https://github.com/B2o5T/graphql-eslint",
34
"author": "Dotan Simha <[email protected]>",
45
"license": "MIT",
56
"private": true,
67
"scripts": {
78
"build": "yarn transpile-ts && bob build",
89
"ci:lint": "eslint --ignore-path .gitignore --ext ts,js . --output-file eslint_report.json --format json",
10+
"create-rule": "tsx scripts/create-rule.ts",
911
"generate:configs": "tsx scripts/generate-configs.ts",
1012
"generate:docs": "tsx scripts/generate-docs.ts",
1113
"lint": "eslint --ignore-path .gitignore --ext ts,js .",
@@ -51,7 +53,6 @@
5153
"lint-staged": "13.1.0",
5254
"prettier": "2.8.1",
5355
"rimraf": "3.0.2",
54-
"ts-node": "^10.9.1",
5556
"tsx": "^3.12.1",
5657
"typescript": "4.9.4"
5758
},

packages/plugin/tests/mocks/graphql-server.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
import { readFileSync } from 'fs';
2-
import { resolve } from 'path';
3-
import { createServer, Server, IncomingMessage, ServerResponse } from 'http';
1+
import { readFileSync } from 'node:fs';
2+
import { resolve } from 'node:path';
3+
import { createServer, Server, IncomingMessage, ServerResponse } from 'node:http';
44
import { buildSchema, introspectionFromSchema } from 'graphql';
5+
import { fileURLToPath } from 'node:url';
6+
7+
const __dirname = fileURLToPath(new URL('.', import.meta.url));
58

69
const sdlSchema = readFileSync(resolve(__dirname, 'user-schema.graphql'), 'utf8');
710
const graphqlSchemaObj = buildSchema(sdlSchema);

packages/plugin/tests/schema.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ describe('schema', () => {
4343
let url;
4444

4545
beforeAll(done => {
46-
const tsNodeCommand = resolve(process.cwd(), 'node_modules/.bin/ts-node');
46+
const tsNodeCommand = resolve(process.cwd(), 'node_modules/.bin/tsx');
4747
const serverPath = resolve(__dirname, 'mocks/graphql-server.ts');
4848

4949
// Import `TestGraphQLServer` and run it in this file will don't work
@@ -60,7 +60,7 @@ describe('schema', () => {
6060
});
6161

6262
afterAll(done => {
63-
local.on('close', done);
63+
local.on('close', () => done());
6464
local.kill();
6565
});
6666

pnpm-lock.yaml

Lines changed: 29 additions & 52 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)