Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion validator/imported/.npmrc

This file was deleted.

6 changes: 3 additions & 3 deletions validator/imported/export.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import fs from 'fs';
import Module from 'module';
import { testSchema } from './graphql-js/src/validation/__tests__/harness';
import { printSchema } from './graphql-js/src/utilities';
import { safeDump } from 'js-yaml';
import yaml from 'js-yaml';

let schemas = [];
function registerSchema(schema) {
Expand Down Expand Up @@ -132,7 +132,7 @@ fs.readdirSync("./graphql-js/src/validation/__tests__").forEach(file => {

require('./graphql-js/src/validation/__tests__/' + file);

let dump = safeDump(tests, {
let dump = yaml.dump(tests, {
skipInvalid: true,
flowLevel: 5,
noRefs: true,
Expand Down Expand Up @@ -170,7 +170,7 @@ type T {
deeperField: T
}`;

let dump = safeDump(schemaList, {
let dump = yaml.dump(schemaList, {
skipInvalid: true,
flowLevel: 5,
noRefs: true,
Expand Down
29 changes: 18 additions & 11 deletions validator/imported/export.sh
Original file line number Diff line number Diff line change
@@ -1,28 +1,35 @@
#!/bin/bash

REPO_DIR=./graphql-js
PATH=./node_modules/.bin:$PATH
EXPORTER_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

cd $EXPORTER_ROOT
cd "$EXPORTER_ROOT" || exit

GIT_REF=origin/master

if [[ -f "$EXPORTER_ROOT/graphql-js-commit.log" ]] ; then
GIT_REF=$(cat "$EXPORTER_ROOT/graphql-js-commit.log")
fi
echo $GIT_REF

if [[ -d "$REPO_DIR" ]] ; then
echo "fetching latest graphql-js"
cd $REPO_DIR
echo "fetching graphql-js with ${GIT_REF}"
cd "$REPO_DIR" || exit
git fetch origin master
git checkout origin/master
git checkout "$GIT_REF"
git reset --hard
else
echo "cloning graphql-js"
echo "cloning graphql-js with ${GIT_REF}"
git clone --no-tags --single-branch -- https://github.com/graphql/graphql-js $REPO_DIR
cd $REPO_DIR
git checkout origin/master
cd "$REPO_DIR" || exit
git checkout "$GIT_REF"
fi
git rev-parse HEAD > $EXPORTER_ROOT/graphql-js-commit.log

cd $EXPORTER_ROOT
cd "$EXPORTER_ROOT" || exit

echo "installing js dependencies"
npm install
npm ci

echo "exporting tests"
babel-node ./export.js
npx babel-node ./export.js
1 change: 1 addition & 0 deletions validator/imported/graphql-js-commit.log
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
e6c36e0725ea0aabad1a19c68e54180fb7092e3a
Loading