diff --git a/.eslintrc b/.eslintrc index ca9c0acf70..a9435739e5 100644 --- a/.eslintrc +++ b/.eslintrc @@ -16,6 +16,9 @@ "import/no-unresolved": 0, "import/no-named-as-default": 0, "import/no-named-as-default-member": 0, + "import/no-useless-path-segments": 1, + "import/no-cycle":0, //temporarily off + "import/no-import-module-exports": 0, //temporarily off "import/extensions": [ // override airbnb setting to allow imports of js, jsx, ts, and tsx files to auto-resolve instead of error "error", "ignorePackages", @@ -27,12 +30,19 @@ } ], "comma-dangle": 0, // not sure why airbnb turned this on. gross! + "default-param-last": 0, + "no-else-return" :0, "indent": 0, "no-console": 0, "no-alert": 0, + "no-import-assign": 2, + "no-promise-executor-return": 0, //temporarily off + "no-restricted-exports": 1, "no-underscore-dangle": 0, "no-useless-catch": 2, + "prefer-object-spread": 0, "max-len": [1, 120, 2, {"ignoreComments": true, "ignoreTemplateLiterals": true}], + "max-classes-per-file": 0, "quote-props": [1, "as-needed"], "no-unused-vars": [1, {"vars": "local", "args": "none"}], "consistent-return": ["error", { "treatUndefinedAsUnspecified": true }], @@ -46,7 +56,19 @@ { "ignorePureComponents": true }], "class-methods-use-this": 0, - "react/jsx-no-bind": [2, {"allowBind": true, "allowArrowFunctions": true}], + "react/button-has-type": 0, + "react/destructuring-assignment":0, + "react/function-component-definition": 0, + "react/jsx-curly-newline":0, + "react/jsx-fragments":0, + "react/jsx-no-useless-fragment":0, // temporarily off + "react/jsx-one-expression-per-line": 0, + "react/jsx-props-no-spreading": 0, + "react/jsx-wrap-multilines": 0, + "react/jsx-no-bind": [2, {"allowBind": true, "allowArrowFunctions": true, "allowFunctions": true}], + "react/no-deprecated": 0, //temporarily off + "react/no-unused-class-component-methods": 1, + "react/sort-comp": 0, "no-return-assign": [2, "except-parens"], "jsx-a11y/anchor-is-valid": [ "error", @@ -59,6 +81,8 @@ ] } ], + "jsx-a11y/control-has-associated-label": 0, //temporarily off + "jsx-a11y/label-has-associated-control": 0, //temporarily off "jsx-a11y/label-has-for": [ 2, { diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c3360bb029..59553a7a6c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: - name: Use Node.js uses: actions/setup-node@v1 with: - node-version: '16.14.x' + node-version: '18.20.x' - run: npm install - run: npm run test - run: npm run lint diff --git a/.nvmrc b/.nvmrc index d9f880069d..08b7109d00 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -16.14.2 +18.20.8 diff --git a/.travis.yml b/.travis.yml index 6888df8a26..553859080c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ sudo: required language: node_js node_js: - - "16.14.2" + - "18.20.8" cache: directories: diff --git a/Dockerfile b/Dockerfile index 3c18288058..19c513f105 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:16.14.2 AS base +FROM node:18.20.8 AS base ENV APP_HOME=/usr/src/app \ TERM=xterm RUN mkdir -p $APP_HOME diff --git a/client/common/useKeyDownHandlers.js b/client/common/useKeyDownHandlers.js index dbe2ee06bb..7259574e82 100644 --- a/client/common/useKeyDownHandlers.js +++ b/client/common/useKeyDownHandlers.js @@ -66,3 +66,7 @@ export const DocumentKeyDown = ({ handlers }) => { DocumentKeyDown.propTypes = { handlers: PropTypes.objectOf(PropTypes.func) }; + +DocumentKeyDown.defaultProps = { + handlers: {} +}; diff --git a/client/components/RootPage.jsx b/client/components/RootPage.jsx index 72057b5cc7..7cb3b35cc4 100644 --- a/client/components/RootPage.jsx +++ b/client/components/RootPage.jsx @@ -2,18 +2,19 @@ import styled from 'styled-components'; import { prop } from '../theme'; const RootPage = styled.div` - min-height: 100%; + min-height: 100vh; + height: ${({ fixedHeight }) => fixedHeight || '100vh'}; display: flex; - justify-content: start; + justify-content: flex-start; flex-direction: column; color: ${prop('primaryTextColor')}; background-color: ${prop('backgroundColor')}; - height: ${({ fixedHeight }) => fixedHeight || 'initial'}; @media (max-width: 770px) { height: 100%; overflow: hidden; } + @media print { @page { page-orientation: landscape; diff --git a/client/index.jsx b/client/index.jsx index 313334dc20..27befe8421 100644 --- a/client/index.jsx +++ b/client/index.jsx @@ -35,12 +35,12 @@ script.src = 'https://foundation-donate-banner.netlify.app/static/js/main.js'; document.body.appendChild(script); const App = () => ( - <> +
{children}
diff --git a/client/modules/IDE/components/VersionPicker.jsx b/client/modules/IDE/components/VersionPicker.jsx
index c80a35e806..cd891d020c 100644
--- a/client/modules/IDE/components/VersionPicker.jsx
+++ b/client/modules/IDE/components/VersionPicker.jsx
@@ -10,8 +10,9 @@ import { p5Versions } from '../../../../common/p5Versions';
import MenuItem from '../../../components/Dropdown/MenuItem';
import DropdownMenu from '../../../components/Dropdown/DropdownMenu';
import { updateFileContent } from '../actions/files';
+// eslint-disable-next-line import/no-cycle
import { CmControllerContext } from '../pages/IDEView';
-import { DropdownArrowIcon } from '../.././../common/icons';
+import { DropdownArrowIcon } from '../../../common/icons';
const VersionPickerButton = styled.div`
display: flex;
diff --git a/client/modules/IDE/hooks/useP5Version.jsx b/client/modules/IDE/hooks/useP5Version.jsx
index 643a01cf7e..fc191788ca 100644
--- a/client/modules/IDE/hooks/useP5Version.jsx
+++ b/client/modules/IDE/hooks/useP5Version.jsx
@@ -196,6 +196,7 @@ export function P5VersionProvider(props) {
return null;
}, [indexSrc]);
+ // eslint-disable-next-line react/jsx-no-constructed-context-values
const value = { indexID, versionInfo };
return (
diff --git a/client/modules/IDE/utils/consoleStyles.js b/client/modules/IDE/utils/consoleStyles.js
index 62bba0c6fb..83d53b49c3 100644
--- a/client/modules/IDE/utils/consoleStyles.js
+++ b/client/modules/IDE/utils/consoleStyles.js
@@ -160,14 +160,6 @@ const getConsoleFeedStyle = (theme, fontSize) => {
};
switch (theme) {
- case 'light':
- default:
- return Object.assign(
- CONSOLE_FEED_LIGHT_STYLES || {},
- CONSOLE_FEED_LIGHT_ICONS,
- CONSOLE_FEED_SIZES,
- style
- );
case 'dark':
return Object.assign(
CONSOLE_FEED_DARK_STYLES || {},
@@ -182,6 +174,14 @@ const getConsoleFeedStyle = (theme, fontSize) => {
CONSOLE_FEED_SIZES,
style
);
+ case 'light':
+ default:
+ return Object.assign(
+ CONSOLE_FEED_LIGHT_STYLES || {},
+ CONSOLE_FEED_LIGHT_ICONS,
+ CONSOLE_FEED_SIZES,
+ style
+ );
}
};
diff --git a/client/styles/base/_base.scss b/client/styles/base/_base.scss
index ad17249932..90e11ba208 100644
--- a/client/styles/base/_base.scss
+++ b/client/styles/base/_base.scss
@@ -51,7 +51,7 @@ button {
.root-app,
.app {
min-height: 100%;
- height: 100%;
+ height: 100vh;
}
a {
diff --git a/client/styles/components/_preview-frame.scss b/client/styles/components/_preview-frame.scss
index f56a0d9d27..81d497bb05 100644
--- a/client/styles/components/_preview-frame.scss
+++ b/client/styles/components/_preview-frame.scss
@@ -3,7 +3,8 @@
.preview-frame-holder {
display: flex;
flex-direction: column;
- height: 100%;
+ height: 100% !important;
+ overflow: hidden;
}
.preview-frame-overlay {
diff --git a/client/styles/main.scss b/client/styles/main.scss
index 8f97079bdd..42a7b04b4b 100644
--- a/client/styles/main.scss
+++ b/client/styles/main.scss
@@ -6,11 +6,11 @@
@import 'base/reset';
@import 'base/base';
-@import '../../node_modules/codemirror/lib/codemirror';
-@import '../../node_modules/codemirror/addon/lint/lint';
-@import '../../node_modules/codemirror-colorpicker/addon/codemirror-colorpicker';
-@import '../../node_modules/dropzone/dist/dropzone';
-@import '../../node_modules/primer-tooltips/build/build';
+@import '~codemirror/lib/codemirror';
+@import '~codemirror/addon/lint/lint';
+@import '~codemirror-colorpicker/addon/codemirror-colorpicker';
+@import '~dropzone/dist/dropzone';
+@import '~primer-tooltips/build/build';
@import 'components/p5-light-codemirror-theme';
@import 'components/p5-dark-codemirror-theme';
diff --git a/client/test-utils.js b/client/test-utils.js
index b8594842f0..9b7c8aab31 100644
--- a/client/test-utils.js
+++ b/client/test-utils.js
@@ -12,7 +12,7 @@
// eslint-disable-next-line import/no-extraneous-dependencies
import { render } from '@testing-library/react';
-import React from 'react';
+import React, { useMemo } from 'react';
import PropTypes from 'prop-types';
import { Provider } from 'react-redux';
import { Router } from 'react-router-dom';
@@ -34,9 +34,10 @@ export * from '@testing-library/react';
const ResponsiveProvider = ({ children, mobile, deviceWidth }) => {
const width = deviceWidth ?? (mobile ? 400 : 1000);
+ const value = useMemo(() => ({ width }), [width]);
return (
// eslint-disable-next-line react/jsx-filename-extension
-