Skip to content

Commit

Permalink
feat: add support for npm 7 and Node 16, migrate to graphiql (#1807)
Browse files Browse the repository at this point in the history
  • Loading branch information
dblythy authored Sep 29, 2021
1 parent d9960de commit b61fc7f
Show file tree
Hide file tree
Showing 8 changed files with 6,674 additions and 6,229 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches:
- '**'
env:
NODE_VERSION: 16.9.0
NODE_VERSION: 16.10.0
jobs:
check-ci:
name: CI Self-Check
Expand Down Expand Up @@ -123,9 +123,8 @@ jobs:
NODE_VERSION: 12.22.6
- name: Node 14
NODE_VERSION: 14.17.6
# Enable the following lines when Parse Dashboard reached Node 16 compatibility
# - name: Node 16
# NODE_VERSION: 16.9.0
- name: Node 16
NODE_VERSION: 16.10.0
fail-fast: false
name: ${{ matrix.name }}
timeout-minutes: 15
Expand Down
12,833 changes: 6,639 additions & 6,194 deletions package-lock.json

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,15 @@
"@babel/runtime": "7.15.4",
"bcryptjs": "2.3.0",
"body-parser": "1.19.0",
"codemirror-graphql": "github:timsuchanek/codemirror-graphql#details-fix",
"commander": "6.2.1",
"connect-flash": "0.1.1",
"cookie-session": "2.0.0-beta.3",
"copy-to-clipboard": "3.2.0",
"create-react-class": "15.7.0",
"csurf": "1.11.0",
"express": "4.17.1",
"graphql": "14.6.0",
"graphql-playground-react": "1.7.20",
"graphiql": "1.4.2",
"graphql": "15.4.0",
"history": "4.10.1",
"immutable": "4.0.0-rc.9",
"immutable-devtools": "0.1.5",
Expand All @@ -56,7 +55,7 @@
"json-file-plus": "3.2.0",
"otpauth": "7.0.5",
"package-json": "6.5.0",
"parse": "3.3.0",
"parse": "3.3.1",
"passport": "0.4.1",
"passport-local": "1.0.0",
"prismjs": "1.25.0",
Expand All @@ -75,7 +74,8 @@
"react-router": "5.2.1",
"react-router-dom": "5.2.1",
"regenerator-runtime": "0.13.8",
"semver": "7.3.4"
"semver": "7.3.4",
"typescript": "4.4.3"
},
"devDependencies": {
"@actions/core": "1.2.6",
Expand Down Expand Up @@ -106,19 +106,19 @@
"jest": "24.8.0",
"madge": "5.0.1",
"marked": "0.8.2",
"node-sass": "5.0.0",
"null-loader": "3.0.0",
"node-sass": "6.0.0",
"null-loader": "4.0.1",
"path-to-regexp": "3.2.0",
"puppeteer": "3.0.0",
"react-test-renderer": "16.13.1",
"request": "2.88.2",
"request-promise": "4.2.5",
"sass-loader": "10.1.1",
"sass-loader": "11.1.1",
"semantic-release": "17.4.6",
"style-loader": "1.1.2",
"svg-prep": "1.0.4",
"webpack": "4.42.1",
"webpack-cli": "3.3.10",
"webpack": "5.53.0",
"webpack-cli": "4.0.0",
"yaml": "1.10.0"
},
"scripts": {
Expand All @@ -141,7 +141,7 @@
"parse-dashboard": "./bin/parse-dashboard"
},
"engines": {
"node": ">=12.0.0 <16.0.0"
"node": ">=12.0.0"
},
"main": "Parse-Dashboard/app.js",
"jest": {
Expand Down
12 changes: 0 additions & 12 deletions src/dashboard/Data/ApiConsole/ApiConsole.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,6 @@
height: calc(100vh - 96px);
margin-top: 96px;
overflow: hidden;

// Workaround to override graphql-playground-react
// animations and query editor height
& > div:not(.empty) > div {
opacity: 1;
transform: unset;
animation: unset;

& > div > :nth-child(2){
height: calc(100vh - 153px);
}
}
}

.empty {
Expand Down
23 changes: 18 additions & 5 deletions src/dashboard/Data/ApiConsole/GraphQLConsole.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
import ParseApp from 'lib/ParseApp';
import PropTypes from 'lib/PropTypes';
import React, { Component } from 'react';
import { Provider } from 'react-redux'
import { Playground, store } from 'graphql-playground-react';
import GraphiQL from 'graphiql';
import EmptyState from 'components/EmptyState/EmptyState.react';
import Toolbar from 'components/Toolbar/Toolbar.react';
import styles from 'dashboard/Data/ApiConsole/ApiConsole.scss';
Expand Down Expand Up @@ -38,9 +37,23 @@ export default class GraphQLConsole extends Component {
headers['X-Parse-Client-Key'] = clientKey
}
content = (
<Provider store={store}>
<Playground endpoint={graphQLServerURL} headers={headers} />
</Provider>
<GraphiQL
fetcher={async graphQLParams => {
const data = await fetch(
graphQLServerURL,
{
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
...headers
},
body: JSON.stringify(graphQLParams),
},
);
return data.json().catch(() => data.text());
}}
/>
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/dashboard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import 'core-js/stable';
import 'regenerator-runtime/runtime';

require('stylesheets/fonts.scss');
require('graphql-playground-react/build/static/css/index.css')
require('graphiql/graphiql.min.css')
installDevTools(Immutable);

var path = window.PARSE_DASHBOARD_PATH || '/';
Expand Down
2 changes: 1 addition & 1 deletion webpack/base.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module.exports = {
exclude: /node_modules/,
use: {
loader: 'babel-loader',
query: {
options: {
plugins: [['@babel/plugin-proposal-decorators', { 'legacy': true }], '@babel/transform-regenerator', '@babel/transform-runtime'],
presets: ['@babel/preset-react', '@babel/preset-env']
},
Expand Down
2 changes: 1 addition & 1 deletion webpack/plugins/svg-prep.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function SvgPrepPlugin(options) {
}

SvgPrepPlugin.prototype.apply = function(compiler) {
compiler.plugin('emit', (compilation, callback) => {
compiler.hooks.emit.tapAsync('SvgPrepPlugin', (compilation, callback) => {
if (!this.options.source) {
return callback();
}
Expand Down

0 comments on commit b61fc7f

Please sign in to comment.