Skip to content

Commit

Permalink
merge latest upstream changes (#104)
Browse files Browse the repository at this point in the history
* execute: fix spec section names in comments (graphql#3376)

* lexer-tests: Use tildas as invalid characters (graphql#3377)

* Preserve non-error values thrown from resolvers (graphql#3384)

* Add support for Node17 (graphql#3386)

* Update package-lock.json (graphql#3387)

* Drop "eslint-plugin-istanbul" and implement as internal ESLint rule (graphql#3388)

* package.json: Drop unused '@babel/eslint-parser' (graphql#3389)

* Update deps (graphql#3390)

* Enable '@typescript-eslint/switch-exhaustiveness-check' rule (graphql#3391)

* Remove $FlowFixMe comments (graphql#3392)

* typeFromAST: use exhaustive switch and remove invariant (graphql#3396)

* Update doc examples to reflect the current API (graphql#3393)

* Switch coverage from nyc to c8 (graphql#3398)

* Update deps (graphql#3399)

* expectJSON: improve readability (graphql#3400)

* tests: Improve formating of strings with 'dedent' tag (graphql#3401)

* ci: add check that 'package-lock.json' doesn't have conflicts (graphql#3403)

* github/workflows: simplify npm cache setup (graphql#3404)

* Use for '--ignore-scripts' for all `npm ci` & `npm install` (graphql#3405)

* Simplify code by replacing Object.entries with Object.keys (graphql#3406)

* ci: add check for unnessary duplicates in package-lock.json (graphql#3407)

* update lockfile

* Fix ci merge

* fix package-lock file

...starting again from most current graphql-js

Co-authored-by: Alex Reilly <fabiobean2@gmail.com>
Co-authored-by: Ivan Goncharov <ivan.goncharov.ua@gmail.com>
Co-authored-by: Paul Serraino <pserraino99@gmail.com>
  • Loading branch information
4 people committed Dec 6, 2021
1 parent 719ef94 commit 62d68bf
Show file tree
Hide file tree
Showing 33 changed files with 4,303 additions and 5,147 deletions.
22 changes: 22 additions & 0 deletions .c8rc.json
@@ -0,0 +1,22 @@
{
"all": true,
"include": ["src/"],
"exclude": [
"src/**/index.ts",
"src/**/*-fuzz.ts",
"src/jsutils/Maybe.ts",
"src/jsutils/ObjMap.ts",
"src/jsutils/PromiseOrValue.ts",
"src/utilities/typedQueryDocumentNode.ts"
],
"clean": true,
"temp-directory": "coverage",
"report-dir": "coverage",
"skip-full": true,
"reporter": ["json", "html", "text"],
"check-coverage": true,
"branches": 100,
"lines": 100,
"functions": 100,
"statements": 100
}
17 changes: 5 additions & 12 deletions .eslintrc.yml
Expand Up @@ -8,7 +8,6 @@ reportUnusedDisableDirectives: true
plugins:
- internal-rules
- node
- istanbul
- import
settings:
node:
Expand All @@ -24,14 +23,6 @@ rules:
internal-rules/no-dir-import: error
internal-rules/require-to-string-tag: off

##############################################################################
# `eslint-plugin-istanbul` rule list based on `v0.1.2`
# https://github.com/istanbuljs/eslint-plugin-istanbul#rules
##############################################################################

istanbul/no-ignore-file: error
istanbul/prefer-ignore-reason: error

##############################################################################
# `eslint-plugin-node` rule list based on `v11.1.x`
##############################################################################
Expand Down Expand Up @@ -150,7 +141,7 @@ rules:
import/dynamic-import-chunkname: off

##############################################################################
# ESLint builtin rules list based on `v7.32.x`
# ESLint builtin rules list based on `v8.3.x`
##############################################################################

# Possible Errors
Expand Down Expand Up @@ -193,6 +184,7 @@ rules:
no-unsafe-finally: error
no-unsafe-negation: error
no-unsafe-optional-chaining: [error, { disallowArithmeticOperators: true }]
no-unused-private-class-members: error
no-useless-backreference: error
require-atomic-updates: error
use-isnan: error
Expand Down Expand Up @@ -461,7 +453,7 @@ overrides:
tsdoc/syntax: error

##########################################################################
# `@typescript-eslint/eslint-plugin` rule list based on `v5.0.x`
# `@typescript-eslint/eslint-plugin` rule list based on `v5.5.x`
##########################################################################

# Supported Rules
Expand All @@ -477,6 +469,7 @@ overrides:
[error, index-signature]
'@typescript-eslint/consistent-type-assertions': off # TODO temporarily disable
'@typescript-eslint/consistent-type-definitions': error
'@typescript-eslint/consistent-type-exports': error
'@typescript-eslint/consistent-type-imports': error
'@typescript-eslint/explicit-function-return-type': off # TODO consider
'@typescript-eslint/explicit-member-accessibility': off # TODO consider
Expand Down Expand Up @@ -544,7 +537,7 @@ overrides:
'@typescript-eslint/restrict-template-expressions': off #TODO temporarily disabled
'@typescript-eslint/sort-type-union-intersection-members': off # TODO consider
'@typescript-eslint/strict-boolean-expressions': off # TODO consider
'@typescript-eslint/switch-exhaustiveness-check': off #TODO temporarily disabled
'@typescript-eslint/switch-exhaustiveness-check': error
'@typescript-eslint/triple-slash-reference': error
'@typescript-eslint/typedef': off
'@typescript-eslint/unbound-method': off # TODO consider
Expand Down
118 changes: 36 additions & 82 deletions .github/workflows/ci.yml
@@ -1,7 +1,7 @@
name: CI
on: [push, pull_request]
env:
NODE_VERSION_USED_FOR_DEVELOPMENT: 16
NODE_VERSION_USED_FOR_DEVELOPMENT: 17
jobs:
lint:
name: Lint source files
Expand All @@ -13,18 +13,11 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v2
with:
cache: npm
node-version: ${{ env.NODE_VERSION_USED_FOR_DEVELOPMENT }}

- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
- name: Install Dependencies
run: npm ci
run: npm ci --ignore-scripts

- name: Lint ESLint
run: npm run lint
Expand Down Expand Up @@ -65,14 +58,24 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v2
with:
cache: npm
node-version: ${{ env.NODE_VERSION_USED_FOR_DEVELOPMENT }}

- name: Run npm install
run: npm install --package-lock-only --engine-strict --strict-peer-deps
run: npm install --ignore-scripts --engine-strict --strict-peer-deps

- name: Check that package-lock.json is in sync with package.json
run: git diff --exit-code package-lock.json

- name: Run npm dedupe
run: npm dedupe

- name: Check that package-lock.json doesn't contain unnecessary duplicates
run: git diff --exit-code package-lock.json

- name: Check that package-lock.json doesn't have conflicts
run: npm ls --depth 999

coverage:
name: Measure test coverage
runs-on: ubuntu-latest
Expand All @@ -83,18 +86,11 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v2
with:
cache: npm
node-version: ${{ env.NODE_VERSION_USED_FOR_DEVELOPMENT }}

- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
- name: Install Dependencies
run: npm ci
run: npm ci --ignore-scripts

- name: Run tests and measure code coverage
run: npm run testonly:cover
Expand All @@ -111,7 +107,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node_version_to_setup: [12, 14, 16]
node_version_to_setup: [12, 14, 16, 17]
graphql_version: [15, 16]
steps:
- name: Checkout repo
Expand All @@ -120,21 +116,14 @@ jobs:
- name: Setup Node.js v${{ matrix.node_version_to_setup }}
uses: actions/setup-node@v2
with:
cache: npm
node-version: ${{ matrix.node_version_to_setup }}

- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.OS }}-node-${{ matrix.graphql_version }}-graphql-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-${{ matrix.graphql_version }}-graphql-
- name: Install Dependencies
run: npm ci --ignore-scripts

- name: Force GraphQL Version
run: npm install graphql@${{ matrix.graphql_version }}

- name: Install Dependencies
run: npm install
run: npm install graphql@${{ matrix.graphql_version }} --save=false

- name: Run Tests
run: npm run testonly
Expand All @@ -149,24 +138,17 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v2

- name: Setup Node.js
- name: Setup Node.js v${{ matrix.node_version_to_setup }}
uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION_USED_FOR_DEVELOPMENT }}
cache: npm
node-version: ${{ matrix.node_version_to_setup }}

- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.OS }}-node-${{ matrix.graphql_version }}-graphql-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-${{ matrix.graphql_version }}-graphql-
- name: Install Dependencies
run: npm ci --ignore-scripts

- name: Force GraphQL Version
run: npm install graphql@${{ matrix.graphql_version }}

- name: Install Dependencies
run: npm install
run: npm install graphql@${{ matrix.graphql_version }} --save=false

- name: Run Build
run: npm run build
Expand All @@ -183,18 +165,11 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v2
with:
cache: npm
node-version: ${{ env.NODE_VERSION_USED_FOR_DEVELOPMENT }}

- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
- name: Install Dependencies
run: npm ci
run: npm ci --ignore-scripts

- name: Run Benchmark
run: 'npm run benchmark -- --revs HEAD HEAD~1'
Expand All @@ -211,18 +186,11 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v2
with:
cache: npm
node-version: ${{ env.NODE_VERSION_USED_FOR_DEVELOPMENT }}

- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
- name: Install Dependencies
run: npm ci
run: npm ci --ignore-scripts

- name: Generate report
run: 'node resources/diff-npm-package.js $BASE_COMMIT HEAD'
Expand Down Expand Up @@ -251,18 +219,11 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v2
with:
cache: npm
node-version: ${{ env.NODE_VERSION_USED_FOR_DEVELOPMENT }}

- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
- name: Install Dependencies
run: npm ci
run: npm ci --ignore-scripts

- name: Build NPM package
run: npm run build:npm
Expand All @@ -287,18 +248,11 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: ${{ env.GITHUB_TOKEN }}

- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
cache: npm
node-version: ${{ env.NODE_VERSION_USED_FOR_DEVELOPMENT }}

- name: Install Dependencies
run: npm ci
run: npm ci --ignore-scripts

- name: Build Deno package
run: npm run build:deno
Expand Down
15 changes: 0 additions & 15 deletions .nycrc.yml

This file was deleted.

9 changes: 5 additions & 4 deletions benchmark/benchmark.js
Expand Up @@ -58,9 +58,10 @@ function prepareBenchmarkProjects(revisionList) {
path.join(projectPath, 'package.json'),
'{ "private": true }',
);
exec('npm --quiet install ' + prepareNPMPackage(revision), {
cwd: projectPath,
});
exec(
'npm --quiet install --ignore-scripts ' + prepareNPMPackage(revision),
{ cwd: projectPath },
);
exec(`cp -R ${localDir('benchmark')} ${projectPath}`);

return { revision, projectPath };
Expand All @@ -86,7 +87,7 @@ function prepareBenchmarkProjects(revisionList) {
fs.rmSync(repoDir, { recursive: true, force: true });
fs.mkdirSync(repoDir);
exec(`git archive "${hash}" | tar -xC "${repoDir}"`);
exec('npm --quiet ci', { cwd: repoDir });
exec('npm --quiet ci --ignore-scripts', { cwd: repoDir });
fs.renameSync(buildNPMArchive(repoDir), archivePath);
fs.rmSync(repoDir, { recursive: true });
return archivePath;
Expand Down
1 change: 1 addition & 0 deletions cspell.yml
@@ -1,5 +1,6 @@
language: en
useGitignore: true
# TODO enableGlobDot: true
ignorePaths:
# Excluded from spelling check
- cspell.yml
Expand Down

0 comments on commit 62d68bf

Please sign in to comment.