Skip to content

Commit

Permalink
[v4] Remove GraphQLRuleTester from bundle (#1792)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
dimaMachina and github-actions[bot] authored Aug 1, 2023
1 parent f6cdb16 commit 804f8b6
Show file tree
Hide file tree
Showing 127 changed files with 1,103 additions and 1,048 deletions.
9 changes: 9 additions & 0 deletions .changeset/@graphql-eslint_eslint-plugin-1792-dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@graphql-eslint/eslint-plugin': patch
---

dependencies updates:

- Removed dependency
[`@babel/code-frame@^7.18.6` ↗︎](https://www.npmjs.com/package/@babel/code-frame/v/7.18.6) (from
`dependencies`)
15 changes: 15 additions & 0 deletions .changeset/strong-needles-compare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
'@graphql-eslint/eslint-plugin': major
---

Remove `GraphQLRuleTester` from bundle, to test your rules use regular `RuleTester` from eslint

> **Note**: with this change unnecessary dependency `@babel/code-frame` was removed too
```js
import { RuleTester } from 'eslint'

const ruleTester = new RuleTester({
parser: require.resolve('@graphql-eslint/eslint-plugin')
})
```
3 changes: 1 addition & 2 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: pr
on:
pull_request:
branches:
- master
branches: [master]

jobs:
dependencies:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: release
on:
push:
branches:
- master
branches: [master]

jobs:
stable:
Expand Down
18 changes: 2 additions & 16 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: test

on:
push:
branches: [master]
branches: [master, v4]
pull_request:
branches: [master]
branches: [master, v4]

jobs:
lint:
Expand Down Expand Up @@ -44,12 +44,6 @@ jobs:
- name: Build
run: pnpm build

- name: Upload Build Artifact
uses: actions/upload-artifact@v3
with:
name: build-artifact
path: packages/plugin/dist

test:
name: Node.js v${{matrix.node_version}} / GraphQL v${{matrix.graphql_version}} / ESLint v8
timeout-minutes: 60
Expand Down Expand Up @@ -78,14 +72,6 @@ jobs:
- name: Install Dependencies
run: pnpm i --no-frozen-lockfile

# We need build for examples.spec.ts test
# Otherwise we'll get error - Cannot find module 'node_modules/@graphql-eslint/eslint-plugin/dist/index.js'
- name: Download Build Artifact
uses: actions/download-artifact@v3
with:
name: build-artifact
path: packages/plugin/dist

- name: Test
run: pnpm test
env:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/website-integrity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Fetch
run: git fetch origin master

- name: Setup env
- name: Setup ENV
uses: the-guild-org/shared-config/setup@main
with:
nodeVersion: 18
Expand All @@ -28,15 +28,15 @@ jobs:
- name: Compare
run: git diff origin/${{ github.base_ref }}.. -- website/route-lockfile.txt

- name: Diff to file
- name: Diff to File
if: always()
id: diff_result
run: |
echo "result<<EOF" >> $GITHUB_OUTPUT
echo "$(git diff origin/${{ github.base_ref }}.. -- website/route-lockfile.txt)" >> $GITHUB_OUTPUT
echo EOF >> $GITHUB_OUTPUT
- name: Publish a message
- name: Publish a Message
if: always() && contains(steps.diff_result.outputs.result, 'diff')
uses: marocchino/sticky-pull-request-comment@v2
with:
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ name: website

on:
push:
branches:
- master
branches: [master, v4]
pull_request:
branches:
- master
branches: [master, v4]

jobs:
deployment:
Expand Down
2 changes: 1 addition & 1 deletion examples/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
"devDependencies": {
"@eslint/js": "8.46.0",
"@graphql-eslint/eslint-plugin": "workspace:*",
"eslint": "8.38.0"
"eslint": "8.46.0"
}
}
2 changes: 1 addition & 1 deletion examples/code-file/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
"devDependencies": {
"@eslint/js": "8.46.0",
"@graphql-eslint/eslint-plugin": "workspace:*",
"eslint": "8.38.0"
"eslint": "8.46.0"
}
}
2 changes: 1 addition & 1 deletion examples/graphql-config-code-file/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
"devDependencies": {
"@eslint/js": "8.46.0",
"@graphql-eslint/eslint-plugin": "workspace:*",
"eslint": "8.38.0"
"eslint": "8.46.0"
}
}
2 changes: 1 addition & 1 deletion examples/graphql-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
"devDependencies": {
"@eslint/js": "8.46.0",
"@graphql-eslint/eslint-plugin": "workspace:*",
"eslint": "8.38.0"
"eslint": "8.46.0"
}
}
2 changes: 1 addition & 1 deletion examples/monorepo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
"devDependencies": {
"@eslint/js": "8.46.0",
"@graphql-eslint/eslint-plugin": "workspace:*",
"eslint": "8.38.0"
"eslint": "8.46.0"
}
}
2 changes: 1 addition & 1 deletion examples/multiple-projects-graphql-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"devDependencies": {
"@graphql-eslint/eslint-plugin": "workspace:*",
"cosmiconfig-typescript-loader": "5.0.0",
"eslint": "8.38.0",
"eslint": "8.46.0",
"ts-node": "10.9.1",
"typescript": "5.1.6"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/prettier/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"devDependencies": {
"@eslint/js": "8.46.0",
"@graphql-eslint/eslint-plugin": "workspace:*",
"eslint": "8.38.0",
"eslint": "8.46.0",
"eslint-config-prettier": "8.9.0",
"eslint-plugin-prettier": "4.2.1",
"prettier": "2.8.8"
Expand Down
2 changes: 1 addition & 1 deletion examples/svelte-code-file/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"devDependencies": {
"@graphql-eslint/eslint-plugin": "workspace:*",
"eslint": "8.38.0",
"eslint": "8.46.0",
"svelte": "4.1.2",
"svelte-eslint-parser": "0.32.2",
"svelte2tsx": "0.6.19"
Expand Down
2 changes: 1 addition & 1 deletion examples/vue-code-file/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"devDependencies": {
"@graphql-eslint/eslint-plugin": "workspace:*",
"@vue/compiler-sfc": "3.3.4",
"eslint": "8.38.0",
"eslint": "8.46.0",
"vue-eslint-parser": "9.3.1"
}
}
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"pnpm": ">=8"
},
"scripts": {
"build": "pnpm --filter @graphql-eslint/eslint-plugin build && bob check",
"build": "turbo run build --filter=!website && bob check",
"ci:lint": "eslint --ignore-path .gitignore --output-file eslint_report.json --format json .",
"create-rule": "tsx scripts/create-rule.ts",
"generate:configs": "tsx scripts/generate-configs.ts",
Expand All @@ -21,7 +21,7 @@
"prerelease": "NODE_ENV=production pnpm build",
"prettier": "pnpm lint:prettier --write",
"release": "changeset publish",
"test": "vitest ."
"test": "turbo run test --filter=!website"
},
"devDependencies": {
"@changesets/changelog-github": "0.4.8",
Expand All @@ -35,7 +35,7 @@
"chalk": "4.1.2",
"dedent": "1.5.1",
"enquirer": "2.4.1",
"eslint": "8.44.0",
"eslint": "8.46.0",
"eslint-plugin-eslint-plugin": "5.0.7",
"eslint-plugin-tailwindcss": "3.13.0",
"husky": "8.0.3",
Expand All @@ -46,6 +46,7 @@
"rimraf": "5.0.1",
"tsup": "^7.1.0",
"tsx": "3.12.7",
"turbo": "^1.10.12",
"typescript": "5.1.6",
"vitest": "0.30.1"
},
Expand All @@ -54,7 +55,7 @@
},
"pnpm": {
"patchedDependencies": {
"eslint@8.44.0": "patches/eslint@8.31.0.patch",
"eslint@8.46.0": "patches/eslint@8.46.0.patch",
"[email protected]": "patches/[email protected]",
"[email protected]": "patches/[email protected]",
"@vitest/[email protected]": "patches/@[email protected]"
Expand Down
6 changes: 3 additions & 3 deletions packages/plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
"graphql"
],
"scripts": {
"build": "tsup"
"build": "tsup",
"test": "vitest"
},
"peerDependencies": {
"graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0"
},
"dependencies": {
"@babel/code-frame": "^7.18.6",
"@graphql-tools/code-file-loader": "^7.3.6",
"@graphql-tools/graphql-tag-pluck": "^7.3.6",
"@graphql-tools/utils": "^9.0.0",
Expand All @@ -54,7 +54,7 @@
"tslib": "^2.4.1"
},
"devDependencies": {
"@types/babel__code-frame": "7.0.3",
"@theguild/eslint-rule-tester": "workspace:*",
"@types/debug": "4.1.8",
"@types/eslint": "8.37.0",
"@types/estree": "1.0.1",
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion packages/plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { processor } from './processor.js';

export { parseForESLint } from './parser.js';
export { rules } from './rules/index.js';
export * from './testkit.js';
export * from './types.js';
export { requireGraphQLSchemaFromContext, requireSiblingsOperations } from './utils.js';

Expand Down
3 changes: 1 addition & 2 deletions packages/plugin/src/rules/alphabetize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ import {
import { FromSchema } from 'json-schema-to-ts';
import lowerCase from 'lodash.lowercase';
import { GraphQLESTreeNode } from '../estree-converter/index.js';
import { GraphQLESLintRuleListener } from '../testkit.js';
import { GraphQLESLintRule } from '../types.js';
import { GraphQLESLintRule, GraphQLESLintRuleListener } from '../types.js';
import { ARRAY_DEFAULT_OPTIONS, displayNodeName, truthy } from '../utils.js';

const RULE_ID = 'alphabetize';
Expand Down
3 changes: 1 addition & 2 deletions packages/plugin/src/rules/input-name.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import {
} from 'graphql';
import { FromSchema } from 'json-schema-to-ts';
import { GraphQLESTreeNode } from '../estree-converter/index.js';
import { GraphQLESLintRuleListener } from '../testkit.js';
import { GraphQLESLintRule } from '../types.js';
import { GraphQLESLintRule, GraphQLESLintRuleListener } from '../types.js';

const schema = {
type: 'array',
Expand Down
3 changes: 1 addition & 2 deletions packages/plugin/src/rules/naming-convention.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { ASTKindToNode, Kind, NameNode } from 'graphql';
import { FromSchema } from 'json-schema-to-ts';
import { GraphQLESTreeNode } from '../estree-converter/index.js';
import { GraphQLESLintRuleListener } from '../testkit.js';
import { GraphQLESLintRule, ValueOf } from '../types.js';
import { GraphQLESLintRule, ValueOf, GraphQLESLintRuleListener } from '../types.js';
import {
ARRAY_DEFAULT_OPTIONS,
convertCase,
Expand Down
3 changes: 1 addition & 2 deletions packages/plugin/src/rules/relay-edge-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import {
} from 'graphql';
import { FromSchema } from 'json-schema-to-ts';
import { GraphQLESTreeNode } from '../estree-converter/index.js';
import { GraphQLESLintRuleListener } from '../testkit.js';
import { GraphQLESLintRule } from '../types.js';
import { GraphQLESLintRule, GraphQLESLintRuleListener } from '../types.js';
import { getTypeName, requireGraphQLSchemaFromContext } from '../utils.js';

const RULE_ID = 'relay-edge-types';
Expand Down
Loading

0 comments on commit 804f8b6

Please sign in to comment.