/g, '') + .replace(/<\/p>/g, '') + .replace(/‘/g, "'") + .replace(/’/g, "'") + ; + + } + +} diff --git a/test/fixtures/three.graphql/schema/index.js b/test/fixtures/three.graphql/schema/index.js index 261acbe8c53f05..bdf87a834c6645 100644 --- a/test/fixtures/three.graphql/schema/index.js +++ b/test/fixtures/three.graphql/schema/index.js @@ -101,9 +101,9 @@ const buffer = (Object.keys(map) .reduce((output, input) => Buffer.concat([output, input]), Buffer(0)) ) -const implementations = Object -.keys(map) -.map((key) => map[key]) -.reduce((i, type) => Object.assign(i, type.implementation), {}) +const implementations = (Object.keys(map) + .map((key) => map[key]) + .reduce((i, type) => Object.assign(i, type.implementation), {}) +) module.exports = createSchema(String(buffer), implementations).schema diff --git a/test/fixtures/three.graphql/scripts/audit.sh b/test/fixtures/three.graphql/scripts/audit.sh index ff17e43b00e16b..7a0fabb63858f1 100644 --- a/test/fixtures/three.graphql/scripts/audit.sh +++ b/test/fixtures/three.graphql/scripts/audit.sh @@ -8,7 +8,10 @@ echo -e "\n$hr\nRESOLVE VERSION\n$hr" # https://github.com/apollographql/react-apollo/issues/742#issuecomment-338366662 # https://github.com/matthewmueller/graph.ql/blob/master/package.json # https://stackoverflow.com/a/56515445/4058484 -echo Resolving a duplicate version of graphql and use one version only: find node_modules -name graphql grep version node_modules/graphql/package.json rm -rf node_modules/graph.ql/node_modules/graphql + +echo -e "\n$hr\nLIST VERSION\n$hr" +# https://stackoverflow.com/a/25497068/4058484 +npm list --depth=0 diff --git a/test/fixtures/three.graphql/scripts/build.sh b/test/fixtures/three.graphql/scripts/build.sh index 57b58297e8d302..995decc8b76dd9 100644 --- a/test/fixtures/three.graphql/scripts/build.sh +++ b/test/fixtures/three.graphql/scripts/build.sh @@ -1,16 +1,17 @@ #!/bin/bash # Run browserify -browserify editor.js -t brfs -o build.js +browserify editor.js -t brfs -o build.js --no-babelrc -# Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps -# https://fb.me/react-derived-state -npx react-codemod rename-unsafe-lifecycles +# Resolving: Error/Warning +REPLACE='return null' +FIND='throw new TypeError("\Int cannot represent non-integer value: ".concat((0, _inspect.default)(value)))' +sed -i "s|$FIND|$REPLACE|g" build.js -# Resolving: TypeError Int cannot represent non-integer value -SED_ERROR='throw new TypeError("\Int cannot represent non-integer value: ".concat((0, _inspect.default)(value)))' -sed -i "s/$SED_ERROR/return null/g" build.js +FIND="warning\$1(false, 'Encountered two children with the same key" +REPLACE="// warning\$1(false, 'Encountered two children with the same key" +sed -i "s|$FIND|$REPLACE|g" build.js -# Resolving: Variable "$width" got invalid value NaN; Expected type Float. Float cannot represent non numeric value: NaN -#SED_ERROR='throw new TypeError("Float cannot represent non numeric value: ".concat((0, _inspect.default)(value)))' -#sed -i "s/$SED_ERROR/return null/g" build.js +FIND="warning\$1(false, 'Invalid aria prop" +REPLACE="// warning\$1(false, 'Invalid aria prop" +sed -i "s|$FIND|$REPLACE|g" build.js diff --git a/test/fixtures/three.graphql/scripts/install.sh b/test/fixtures/three.graphql/scripts/install.sh index e6c469d6292169..cb78794a8beb68 100644 --- a/test/fixtures/three.graphql/scripts/install.sh +++ b/test/fixtures/three.graphql/scripts/install.sh @@ -2,5 +2,4 @@ # ..reserve for code - echo -e "\n$hr\nPOSTINSTALL\n$hr" diff --git a/test/fixtures/three.graphql/scripts/postinstall.sh b/test/fixtures/three.graphql/scripts/postinstall.sh index 2a4a3ed6531789..a8cf9d90e201a2 100644 --- a/test/fixtures/three.graphql/scripts/postinstall.sh +++ b/test/fixtures/three.graphql/scripts/postinstall.sh @@ -2,4 +2,3 @@ # Copy graphiql.css to current directory cp -f node_modules/graphiql/graphiql.css . - diff --git a/test/fixtures/three.graphql/scripts/preinstall.sh b/test/fixtures/three.graphql/scripts/preinstall.sh index e7acf9110e45a5..c6b829e2eb0272 100644 --- a/test/fixtures/three.graphql/scripts/preinstall.sh +++ b/test/fixtures/three.graphql/scripts/preinstall.sh @@ -2,6 +2,11 @@ # Update npm to the latest sudo npm install npm@latest -g -# Delete all regenerated files +# Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps +# Refereence: https://fb.me/react-derived-state +echo -e "\n$hr\nNPX REACT\n$hr" rm -rf graphiql.css package-lock.json yarn.lock +npx react-codemod rename-unsafe-lifecycles + +# Delete all regenerated files echo -e "\n$hr\nINSTALL\n$hr" diff --git a/test/fixtures/three.graphql/scripts/test.sh b/test/fixtures/three.graphql/scripts/test.sh index 89028d380d3990..0f0cfd785084c8 100644 --- a/test/fixtures/three.graphql/scripts/test.sh +++ b/test/fixtures/three.graphql/scripts/test.sh @@ -5,6 +5,5 @@ # Debug # https://www.npmjs.com/package/debug -npm install debug #DEBUG=http node app.js #node --inspect test.js