Skip to content

Commit

Permalink
Merge branch 'main' into ck.unhandledRejection2
Browse files Browse the repository at this point in the history
  • Loading branch information
chrskrchr committed Sep 23, 2022
2 parents 7d48c7e + 269d6aa commit 6598a33
Show file tree
Hide file tree
Showing 284 changed files with 9,024 additions and 3,546 deletions.
7 changes: 0 additions & 7 deletions .babelrc-deno.json

This file was deleted.

10 changes: 0 additions & 10 deletions .babelrc-npm.json

This file was deleted.

9 changes: 0 additions & 9 deletions .babelrc.json

This file was deleted.

1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
/node_modules
/reports
/npmDist
/npmEsmDist
/denoDist
/websiteDist

Expand Down
19 changes: 12 additions & 7 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ rules:
node/no-exports-assign: error
node/no-extraneous-import: error
node/no-extraneous-require: error
node/no-missing-import: [error, { allowModules: ['graphql'] }]
node/no-missing-import: off # Blocked by https://github.com/mysticatea/eslint-plugin-node/issues/248
node/no-missing-require: error
node/no-new-require: error
node/no-path-concat: error
Expand Down Expand Up @@ -84,7 +84,7 @@ rules:

# Static analysis
# https://github.com/benmosher/eslint-plugin-import#static-analysis
import/no-unresolved: [error, { ignore: ['graphql'] }]
import/no-unresolved: off # blocked by https://github.com/import-js/eslint-plugin-import/issues/2170
import/named: error
import/default: error
import/namespace: error
Expand Down Expand Up @@ -130,7 +130,6 @@ rules:
import/extensions:
- error
- ignorePackages
- ts: never # TODO: remove once TS supports extensions
import/order: [error, { newlines-between: always-and-inside-groups }]
import/newline-after-import: error
import/prefer-default-export: off
Expand All @@ -144,7 +143,7 @@ rules:
import/dynamic-import-chunkname: off

##############################################################################
# `eslint-plugin-simple-import-sort` rule list based on `v2.25.x`
# `eslint-plugin-simple-import-sort` rule list based on `v8.0.x`
# https://github.com/lydell/eslint-plugin-simple-import-sort
##############################################################################
simple-import-sort/imports:
Expand Down Expand Up @@ -179,7 +178,7 @@ rules:
simple-import-sort/exports: off # TODO

##############################################################################
# ESLint builtin rules list based on `v8.21.x`
# ESLint builtin rules list based on `v8.23.x`
##############################################################################

# Possible Errors
Expand Down Expand Up @@ -474,6 +473,10 @@ rules:
yield-star-spacing: off

overrides:
- files:
- 'integrationTests/node-esm/**/*.js'
parserOptions:
sourceType: module
- files: '**/*.ts'
parser: '@typescript-eslint/parser'
parserOptions:
Expand All @@ -493,7 +496,7 @@ overrides:
tsdoc/syntax: error

##########################################################################
# `@typescript-eslint/eslint-plugin` rule list based on `v5.33.x`
# `@typescript-eslint/eslint-plugin` rule list based on `v5.37.x`
##########################################################################

# Supported Rules
Expand Down Expand Up @@ -696,8 +699,11 @@ overrides:
node: true
rules:
node/no-sync: off
node/no-extraneous-import: [error, { allowModules: ['graphql'] }]
import/no-unresolved: off
import/no-namespace: off
import/no-nodejs-modules: off
import/no-extraneous-dependencies: off
- files: 'resources/**'
env:
node: true
Expand Down Expand Up @@ -735,7 +741,6 @@ overrides:
version: detect
rules:
node/no-unpublished-require: off
node/no-missing-import: off
import/no-default-export: off
import/no-commonjs: off
import/no-nodejs-modules: off
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,25 @@ jobs:
- name: Run Tests with coverage
run: npm run testonly:cover

codeql:
name: Run CodeQL security scan
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
persist-credentials: false

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: 'javascript, typescript'

- name: Perform CodeQL analysis
uses: github/codeql-action/analyze@v2

build-npm-dist:
name: Build 'npmDist' artifact
runs-on: ubuntu-latest
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/cmd-publish-pr-on-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ name: publish-pr-on-npm
on:
workflow_call:
inputs:
pullRequestJSON:
pull_request_json:
description: String that contain JSON payload for `pull_request` event.
required: true
type: string
secrets:
NPM_CANARY_PR_PUBLISH_TOKEN:
npm_canary_pr_publish_token:
description: NPM token to publish canary release.
required: true
jobs:
Expand All @@ -18,7 +18,7 @@ jobs:
uses: actions/checkout@v3
with:
persist-credentials: false
ref: ${{ fromJSON(inputs.pullRequestJSON).merge_commit_sha }}
ref: ${{ fromJSON(inputs.pull_request_json).merge_commit_sha }}

- name: Setup Node.js
uses: actions/setup-node@v3
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:

- name: Modify NPM package to be canary release
env:
PULL_REQUEST_JSON: ${{ inputs.pullRequestJSON }}
PULL_REQUEST_JSON: ${{ inputs.pull_request_json }}
uses: actions/github-script@v6
with:
script: |
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
- name: Publish NPM package
run: npm publish --ignore-scripts ./npmDist
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_CANARY_PR_PUBLISH_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.npm_canary_pr_publish_token }}

- name: Upload replyMessage
uses: actions/upload-artifact@v3
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/cmd-run-benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: run-benchmark
on:
workflow_call:
inputs:
pullRequestJSON:
pull_request_json:
description: String that contain JSON payload for `pull_request` event.
required: true
type: string
Expand All @@ -15,11 +15,11 @@ jobs:
uses: actions/checkout@v3
with:
persist-credentials: false
ref: ${{ fromJSON(inputs.pullRequestJSON).merge_commit_sha }}
ref: ${{ fromJSON(inputs.pull_request_json).merge_commit_sha }}

- name: Deepen cloned repo
env:
BASE_SHA: ${{ fromJSON(inputs.pullRequestJSON).base.sha }}
BASE_SHA: ${{ fromJSON(inputs.pull_request_json).base.sha }}
run: 'git fetch --depth=1 origin "$BASE_SHA:refs/tags/BASE"'

- name: Setup Node.js
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/github-actions-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
runs-on: ubuntu-latest
outputs:
cmd: ${{ steps.parse-cmd.outputs.cmd }}
pullRequestJSON: ${{ steps.parse-cmd.outputs.pullRequestJSON }}
pull_request_json: ${{ steps.parse-cmd.outputs.pull_request_json }}
steps:
- uses: actions/github-script@v6
with:
Expand All @@ -76,23 +76,23 @@ jobs:
const { url } = context.payload.issue.pull_request;
const { data } = await github.request(url);
core.setOutput('pullRequestJSON', JSON.stringify(data, null, 2));
core.setOutput('pull_request_json', JSON.stringify(data, null, 2));
cmd-publish-pr-on-npm:
needs: [accept-cmd]
if: needs.accept-cmd.outputs.cmd == 'publish-pr-on-npm'
uses: ./.github/workflows/cmd-publish-pr-on-npm.yml
with:
pullRequestJSON: ${{ needs.accept-cmd.outputs.pullRequestJSON }}
pull_request_json: ${{ needs.accept-cmd.outputs.pull_request_json }}
secrets:
NPM_CANARY_PR_PUBLISH_TOKEN: ${{ secrets.NPM_CANARY_PR_PUBLISH_TOKEN }}
npm_canary_pr_publish_token: ${{ secrets.npm_canary_pr_publish_token }}

cmd-run-benchmark:
needs: [accept-cmd]
if: needs.accept-cmd.outputs.cmd == 'run-benchmark'
uses: ./.github/workflows/cmd-run-benchmark.yml
with:
pullRequestJSON: ${{ needs.accept-cmd.outputs.pullRequestJSON }}
pull_request_json: ${{ needs.accept-cmd.outputs.pull_request_json }}

respond-to-cmd:
needs:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
/node_modules
/reports
/npmDist
/npmEsmDist
/denoDist
/websiteDist
6 changes: 3 additions & 3 deletions .mocharc.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
fail-zero: true
throw-deprecation: true
check-leaks: true
require:
- 'ts-node/register/transpile-only'
extension:
- 'ts'
- ts
node-option:
- 'loader=ts-node/esm/transpile-only'
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
/node_modules
/reports
/npmDist
/npmEsmDist
/denoDist
/websiteDist
1 change: 1 addition & 0 deletions cspell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ overrides:
- clsx
- infima

validateDirectives: true
ignoreRegExpList:
- u\{[0-9a-f]{1,8}\}

Expand Down
49 changes: 0 additions & 49 deletions integrationTests/integration-test.ts

This file was deleted.

26 changes: 26 additions & 0 deletions integrationTests/node/index.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const assert = require('assert');
const { readFileSync } = require('fs');

const { graphqlSync } = require('graphql');
const { buildSchema } = require('graphql/utilities');
const { version } = require('graphql/version');

assert.deepStrictEqual(
version,
JSON.parse(readFileSync('./node_modules/graphql/package.json')).version,
);

const schema = buildSchema('type Query { hello: String }');

const result = graphqlSync({
schema,
source: '{ hello }',
rootValue: { hello: 'world' },
});

assert.deepStrictEqual(result, {
data: {
__proto__: null,
hello: 'world',
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
import assert from 'assert';
import { readFileSync } from 'fs';

import { graphqlSync } from 'graphql';
import { buildSchema } from 'graphql/utilities';
import { version } from 'graphql/version';
import { graphqlSync } from 'graphql-esm';
import { buildSchema } from 'graphql-esm/utilities';
import { version } from 'graphql-esm/version';

assert.deepStrictEqual(
version,
JSON.parse(readFileSync('./node_modules/graphql/package.json')).version,
version + '+esm',
JSON.parse(readFileSync('./node_modules/graphql-esm/package.json')).version,
);

const schema = buildSchema('type Query { hello: String }');
Expand Down
3 changes: 2 additions & 1 deletion integrationTests/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"test": "node test.js"
},
"dependencies": {
"graphql": "file:../graphql.tgz"
"graphql": "file:../graphql.tgz",
"graphql-esm": "file:../graphql-esm.tgz"
}
}
Loading

0 comments on commit 6598a33

Please sign in to comment.