Skip to content

Commit

Permalink
Upgrade node (#146)
Browse files Browse the repository at this point in the history
* Upgrade node to 20

* Update documentation

* Reconcile plugin

* Plugin and Collapsable visual updates

* Upgrade node to 20

* Remove nodeVersion

* Using Node 16

* Removed preset warning

* Upgrade prettier

* Updated http middleware

* Upgraded cypress

* Re-add html-webpack-plugin

* Node to 20

* Removing cypress web server
  • Loading branch information
obgibson authored Apr 26, 2024
1 parent 5cc5124 commit 4b81474
Show file tree
Hide file tree
Showing 29 changed files with 3,062 additions and 3,179 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

strategy:
matrix:
node-version: [14.x]
node-version: [20.x]

env:
CI: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

strategy:
matrix:
node-version: [14.x]
node-version: [20.x]

steps:
- uses: actions/checkout@v2
Expand Down
11 changes: 11 additions & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { defineConfig } from "cypress";

export default defineConfig({
component: {
devServer: {
framework: "create-react-app",
bundler: "webpack",
},
specPattern: "**/*.test.cypress.{js,ts,jsx,tsx}"
},
});
11 changes: 0 additions & 11 deletions cypress.json

This file was deleted.

11 changes: 11 additions & 0 deletions cypress.plugin-api.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { defineConfig } from 'cypress';

export default defineConfig({
component: {
devServer: {
framework: 'create-react-app',
bundler: 'webpack',
},
specPattern: 'plugin-api/**/*.test.cypress.{js,ts,jsx,tsx}',
},
});
13 changes: 0 additions & 13 deletions cypress.plugin-api.json

This file was deleted.

11 changes: 11 additions & 0 deletions cypress.plugin-dev.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { defineConfig } from 'cypress';

export default defineConfig({
component: {
devServer: {
framework: 'create-react-app',
bundler: 'webpack',
},
specPattern: 'plugin-api/dev/**/*.test.cypress.{js,ts,jsx,tsx}',
},
});
13 changes: 0 additions & 13 deletions cypress.plugin-dev.json

This file was deleted.

1 change: 0 additions & 1 deletion cypress/support/commands.js

This file was deleted.

38 changes: 38 additions & 0 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/// <reference types="cypress" />
// ***********************************************
// This example commands.ts shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add('login', (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
//
// declare global {
// namespace Cypress {
// interface Chainable {
// login(email: string, password: string): Chainable<void>
// drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
// dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
// visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
// }
// }
// }
import 'cypress-wait-until';
12 changes: 12 additions & 0 deletions cypress/support/component-index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>Components App</title>
</head>
<body>
<div data-cy-root></div>
</body>
</html>
39 changes: 39 additions & 0 deletions cypress/support/component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// ***********************************************************
// This example support/component.ts is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands'

// Alternatively you can use CommonJS syntax:
// require('./commands')

import { mount } from 'cypress/react18'

// Augment the Cypress namespace to include type definitions for
// your custom command.
// Alternatively, can be defined in cypress/support/component.d.ts
// with a <reference path="./component" /> at the top of your spec.
declare global {
namespace Cypress {
interface Chainable {
mount: typeof mount
}
}
}

Cypress.Commands.add('mount', mount)

// Example use:
// cy.mount(<MyComponent />)
20 changes: 20 additions & 0 deletions cypress/support/e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// ***********************************************************
// This example support/e2e.ts is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands'

// Alternatively you can use CommonJS syntax:
// require('./commands')
25 changes: 13 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@
"cypress:open": "cypress open",
"cypress:run": "cypress run",
"test": "cypress open-ct",
"test:ci": "cypress run-ct --config watchForFileChanges=false",
"test:pluginapi": "cypress open-ct --config-file ./cypress.plugin-api.json",
"test:pluginapi:ci": "cypress run-ct --config-file ./cypress.plugin-api.json",
"test:ci": "cypress run --component --config watchForFileChanges=false",
"test:pluginapi": "cypress open-ct --config-file ./cypress.plugin-api.config.ts",
"test:pluginapi:ci": "cypress run --component --config-file ./cypress.plugin-api.config.ts",
"lint": "eslint \"./src/**/*.{ts,tsx}\"",
"eject": "react-scripts eject",
"format": "prettier --write src",
"dev:plugin": "concurrently --kill-others --names \"PLUGIN-SERVE,DEV\" -c \"bgBlue.bold,bgMagenta.bold\" \"npm:dev-plugin-serve\" \"npm:dev-plugin-cypress\"",
"dev-plugin-serve": "serve ./plugin-api",
"dev-plugin-cypress": "cypress open-ct --config-file ./cypress.plugin-dev.json"
"dev-plugin-cypress": "cypress open-ct --config-file ./cypress.plugin-dev.config.ts"
},
"browserslist": {
"production": [
Expand All @@ -54,8 +54,8 @@
]
},
"devDependencies": {
"@cypress/react": "^5.12.1",
"@cypress/webpack-dev-server": "^1.8.0",
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@cypress/react": "^8.0.0",
"@types/node": "^18.16.3",
"@types/react": "^18.2.5",
"@types/react-dom": "^18.2.3",
Expand All @@ -67,18 +67,19 @@
"@typescript-eslint/parser": "^5.59.2",
"concurrently": "^8.0.1",
"cross-env": "^7.0.3",
"cypress": "^9.3.1",
"cypress-wait-until": "^1.7.1",
"eslint-config-prettier": "^8.8.0",
"cypress": "^13.8.1",
"cypress-wait-until": "^3.0.1",
"eslint-config-prettier": "^9.1.0",
"eslint-config-react-app": "^7.0.1",
"eslint-plugin-import": "^2.23.3",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.23.2",
"eslint-plugin-react-hooks": "^4.2.0",
"http-proxy-middleware": "^2.0.6",
"html-webpack-plugin": "^5.6.0",
"http-proxy-middleware": "^3.0.0",
"mock-websocket": "^0.0.7",
"prettier": "^2.8.8",
"prettier": "^3.2.5",
"react-scripts": "^5.0.1",
"serve": "^14.2.0",
"setimmediate": "^1.0.5",
Expand Down
15 changes: 13 additions & 2 deletions src/GlobalStyle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,19 @@ const globalCSS = css`
}
body {
font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell',
'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-family:
'Roboto',
-apple-system,
BlinkMacSystemFont,
'Segoe UI',
'Roboto',
'Oxygen',
'Ubuntu',
'Cantarell',
'Fira Sans',
'Droid Sans',
'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: ${(p) => p.theme.color.text.dark};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@ describe('Collapsable test', () => {
cy.get('[data-testid="collapsable-header"]')
.click()
.then(() => {
cy.get('[data-testid="collapsable-header"]')
.find('.icon-arrowDown')
.invoke('attr', 'rotate')
.should('eq', '0');
cy.get('[data-testid="collapsable-header"]').find('.icon-arrowDown').invoke('attr', 'rotate').should('eq', '0');
cy.get('[data-testid="collapsable-content"]').should('be.visible');
});

// check that the component renders correctly when closed
cy.get('[data-testid="collapsable-header"]')
.click()
.then(() => {
cy.get('[data-testid="collapsable-header"]').find('.icon-arrowDown').invoke('attr', 'rotate').should('eq', '-90');
cy.get('[data-testid="collapsable-header"]')
.find('.icon-arrowDown')
.invoke('attr', 'rotate')
.should('eq', '-90');
cy.get('[data-testid="collapsable-content"]').not('visible');
});
});
Expand Down
4 changes: 2 additions & 2 deletions src/components/ConnectionStatus/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ const ConnectionStatus: React.FC = () => {
{status === 'Stale'
? t('connection.data-might-be-stale')
: status === 'Connected'
? t('connection.connected')
: t('connection.waiting-for-connection')}
? t('connection.connected')
: t('connection.waiting-for-connection')}
</Text>
<StatusColorIndicator status={status} />
</Wrapper>
Expand Down
16 changes: 8 additions & 8 deletions src/components/DAG/components/DAGContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -257,18 +257,18 @@ const StatusColorStyles = css<{ state: TaskStatus }>`
p.state === 'completed'
? p.theme.notification.success.text
: p.state === 'running'
? p.theme.notification.warning.text
: p.state === 'failed'
? p.theme.notification.danger.text
: p.theme.color.border.mid};
? p.theme.notification.warning.text
: p.state === 'failed'
? p.theme.notification.danger.text
: p.theme.color.border.mid};
background: ${(p) =>
p.state === 'completed'
? mix(0.05, p.theme.notification.success.text, '#fff')
: p.state === 'running'
? mix(0.05, p.theme.notification.warning.text, '#fff')
: p.state === 'failed'
? mix(0.05, p.theme.notification.danger.text, '#fff')
: '#fff'};
? mix(0.05, p.theme.notification.warning.text, '#fff')
: p.state === 'failed'
? mix(0.05, p.theme.notification.danger.text, '#fff')
: '#fff'};
`;

const NormalItem = styled.div<{ state: TaskStatus }>`
Expand Down
12 changes: 6 additions & 6 deletions src/components/Spinner/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ const getSize = (p: {
borderWidth: p.borderWidth,
}
: p.sm
? p.theme.spinner.sizes.sm
: p.md
? p.theme.spinner.sizes.md
: p.lg
? p.theme.spinner.sizes.lg
: p.theme.spinner.sizes.sm;
? p.theme.spinner.sizes.sm
: p.md
? p.theme.spinner.sizes.md
: p.lg
? p.theme.spinner.sizes.lg
: p.theme.spinner.sizes.sm;

type Props = { size?: number; borderWidth?: number; sm?: boolean; md?: boolean; lg?: boolean };

Expand Down
4 changes: 3 additions & 1 deletion src/components/Table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ const TRHoverStyle = css`

export const TR = styled.tr<{ clickable?: boolean; stale?: boolean; active?: boolean }>`
cursor: ${(p) => (p.clickable ? 'pointer' : 'auto')};
transition: background 0.15s, opacity 0.15s;
transition:
background 0.15s,
opacity 0.15s;
&:hover {
${TRHoverStyle}
}
Expand Down
4 changes: 3 additions & 1 deletion src/components/Timeline/Footer/MinimapRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ const MinimapLine = styled.div<{ status: TaskStatus }>`
min-height: 2px;
margin-bottom: 1px;
min-width: 2px;
transition: width 0.5s, left 0.5s;
transition:
width 0.5s,
left 0.5s;
`;

export default MinimapRow;
Loading

0 comments on commit 4b81474

Please sign in to comment.