Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v4] Remove GraphQLRuleTester from bundle #1792

Merged
merged 40 commits into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
7be0d52
more
dimaMachina Jul 27, 2023
69bce08
more
dimaMachina Jul 27, 2023
4dda484
more
dimaMachina Jul 27, 2023
dc5a6b7
more
dimaMachina Jul 27, 2023
c7c118e
more
dimaMachina Jul 27, 2023
ac072bf
more
dimaMachina Jul 27, 2023
2c4fe0d
more
dimaMachina Jul 31, 2023
c7ccaed
patches
dimaMachina Jul 31, 2023
48e1ac0
green
dimaMachina Jul 31, 2023
a93afc4
1
dimaMachina Jul 31, 2023
2626683
1
dimaMachina Jul 31, 2023
4dec79b
more
dimaMachina Aug 1, 2023
d8118e5
more
dimaMachina Aug 1, 2023
a2f681a
more
dimaMachina Aug 1, 2023
8dc47af
1
dimaMachina Aug 1, 2023
e7024ad
1
dimaMachina Aug 1, 2023
f556c33
move
dimaMachina Aug 1, 2023
1a44414
more
dimaMachina Aug 1, 2023
810c3b0
more
dimaMachina Aug 1, 2023
c7a3b55
more
dimaMachina Aug 1, 2023
63219cd
more
dimaMachina Aug 1, 2023
fef46f9
more
dimaMachina Aug 1, 2023
dff3241
more
dimaMachina Aug 1, 2023
b08b4de
try
dimaMachina Aug 1, 2023
46ab94f
more
dimaMachina Aug 1, 2023
7a4b29e
aaa
dimaMachina Aug 1, 2023
cf823c0
prettier
dimaMachina Aug 1, 2023
3e05180
add changeset
dimaMachina Aug 1, 2023
7ba2d43
polish
dimaMachina Aug 1, 2023
ede562c
Merge remote-tracking branch 'origin/v4' into v4-rule-tester
dimaMachina Aug 1, 2023
8bc4340
chore(dependencies): updated changesets for modified dependencies
github-actions[bot] Aug 1, 2023
b5e8fc3
yoyou
dimaMachina Aug 1, 2023
9f16e4f
try
dimaMachina Aug 1, 2023
717865d
try
dimaMachina Aug 1, 2023
10dde92
try
dimaMachina Aug 1, 2023
fec413f
try
dimaMachina Aug 1, 2023
dc1edb5
try
dimaMachina Aug 1, 2023
55748da
try
dimaMachina Aug 1, 2023
26fe76c
try
dimaMachina Aug 1, 2023
3360336
try
dimaMachina Aug 1, 2023
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
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",
"eslint-plugin-eslint-plugin@5.0.7": "patches/eslint-plugin-eslint-plugin@5.0.6.patch",
"json-schema-to-markdown@1.1.1": "patches/json-schema-to-markdown@1.1.1.patch",
"@vitest/runner@0.30.1": "patches/@vitest__runner@0.28.4.patch"
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