Skip to content

Commit

Permalink
[core] Fix CI (mui#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari authored Aug 30, 2023
1 parent b94945e commit fa10432
Show file tree
Hide file tree
Showing 31 changed files with 174 additions and 439 deletions.
23 changes: 0 additions & 23 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,26 +54,6 @@ jobs:
- run:
name: Check for duplicated packages
command: yarn deduplicate
test_unit:
<<: *defaults
steps:
- checkout
- install_js
- run:
name: keymailer
command: |
# latest commit
LATEST_COMMIT=$(git rev-parse HEAD)
# latest commit where lambda/keymailer was changed
FOLDER_COMMIT=$(git log -1 --format=format:%H --full-diff lambda/keymailer)
if [ $FOLDER_COMMIT = $LATEST_COMMIT ]; then
echo "changes, let's run the tests"
yarn workspace keymailer test
else
echo "no changes"
fi
test_lint:
<<: *defaults
steps:
Expand All @@ -97,9 +77,6 @@ workflows:
equal: [pipeline, << pipeline.parameters.workflow >>]
jobs:
- checkout
- test_unit:
requires:
- checkout
- test_lint:
requires:
- checkout
Expand Down
6 changes: 5 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
/tools-public/toolpad/**/*.yml
.cache
/.git
/contributor-dashboard-legacy/
/tools-public/toolpad/.generated/
/tools-public/toolpad/**/*.yml
node_modules
41 changes: 41 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
const path = require('path');
const baseline = require('@mui/monorepo/.eslintrc');

module.exports = {
...baseline,
settings: {
'import/resolver': {
webpack: {
config: path.join(__dirname, './webpackBaseConfig.js'),
},
},
},
/**
* Sorted alphanumerically within each group. built-in and each plugin form
* their own groups.
*/
rules: {
...baseline.rules,
// No time for this
'react/prop-types': 'off',
'jsx-a11y/control-has-associated-label': 'off',
// No time for this
'jsx-a11y/no-autofocus': 'off',
},
overrides: [
...baseline.overrides,
{
files: [
// matching the pattern of the test runner
'accounting/**',
'lambda/**',
'BI/**',
'web/**',
],
rules: {
'no-console': 'off',
'import/no-unresolved': 'off',
},
},
],
};
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ node_modules
# production
/build

src

# misc
.DS_Store
.env.local
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const crypto = require("crypto");
const zlib = require("zlib");
const fetch = require("node-fetch");
const { URL } = require("url");
const util = require("util");
const zlib = require("zlib");

const gzip = util.promisify(zlib.gzip);
/**
Expand Down Expand Up @@ -64,6 +64,7 @@ exports.handler = async function fetchTestProfileArtifactHandler(
url,
version: context.functionVersion,
});
// eslint-disable-next-line no-console
console.log(url, etag);

if (ifNoneMatch === etag) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ async function fetchCircleCIApiV2(endpoint) {
const apiEndpoint = `https://circleci.com/api/v2/`;
const url = `${apiEndpoint}${endpoint}`;

// eslint-disable-next-line no-console
console.log(url);
const response = await fetch(url, {
headers: { "Circle-Token": process.env.CIRCLE_TOKEN },
Expand Down Expand Up @@ -66,7 +67,7 @@ function computeLabel(pipeline) {
* @param {*} event
* @param {*} context
*/
exports.handler = async function fetchTestProfileDetails(event, context) {
exports.handler = async function fetchTestProfileDetails(event) {
const { queryStringParameters } = event;

const jobNumberParameter = queryStringParameters.jobNumber;
Expand All @@ -79,6 +80,7 @@ exports.handler = async function fetchTestProfileDetails(event, context) {
),
};
}
// eslint-disable-next-line no-console
console.log(`fetching details for job #${jobNumber}`);

const job = await fetchCircleCIJobDetails(jobNumber);
Expand Down
11 changes: 5 additions & 6 deletions contributor-dashboard-legacy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,13 @@
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"build": "DISABLE_ESLINT_PLUGIN=true react-scripts build",
"format": "prettier --write .",
"format:check": "prettier --check .",
"lint": "eslint \"src/**/*.{js,tsx}\"",
"test": "echo 'No tests yet' && exit 1",
"test:types": "tsc",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"prettier": {
"useTabs": true
},
Expand All @@ -52,5 +48,8 @@
"last 1 firefox version",
"last 1 safari version"
]
}
},
"engines": {
"node": "^16.0.0"
}
}
9 changes: 2 additions & 7 deletions contributor-dashboard-legacy/src/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import ReactDOM from "react-dom";
import * as React from 'react';
import * as ReactDOM from "react-dom";
import App from "./App";
import * as serviceWorker from "./serviceWorker";

const root = ReactDOM.unstable_createRoot(document.getElementById("root"));
root.render(<App />);

// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();
141 changes: 0 additions & 141 deletions contributor-dashboard-legacy/src/serviceWorker.js

This file was deleted.

5 changes: 0 additions & 5 deletions contributor-dashboard-legacy/src/setupTests.js

This file was deleted.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"@mui/monorepo": "https://github.com/mui/material-ui.git#master",
"@typescript-eslint/eslint-plugin": "^4.11.1",
"@typescript-eslint/parser": "^4.11.1",
"babel-eslint": "^9.0.0",
"eslint": "^7.4.0",
"eslint-config-airbnb-typescript": "^12.3.1",
"eslint-config-prettier": "^8.1.0",
Expand All @@ -31,6 +30,8 @@
},
"dependencies": {},
"workspaces": {
"packages": []
"packages": [
"packages/*"
]
}
}
15 changes: 15 additions & 0 deletions packages/eslint-plugin-material-ui/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "eslint-plugin-material-ui",
"version": "0.1.18",
"private": true,
"description": "Custom eslint rules for MUI.",
"main": "src/index.js",
"dependencies": {},
"devDependencies": {},
"scripts": {},
"repository": {
"type": "git",
"url": "https://github.com/mui/material-ui.git"
},
"license": "MIT"
}
1 change: 1 addition & 0 deletions packages/eslint-plugin-material-ui/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@mui/monorepo/packages/eslint-plugin-material-ui');
1 change: 1 addition & 0 deletions scripts/deduplicate.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import '@mui/monorepo/scripts/deduplicate.mjs';
2 changes: 1 addition & 1 deletion tools-public/toolpad/components/Diff.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function formatDiff(value: number): string {
}

function Diff({ value }: ParsedProps) {
return <>{formatDiff(value)}</>;
return <React.Fragment>{formatDiff(value)}</React.Fragment>;
}

export default createComponent(Diff, {
Expand Down
Loading

0 comments on commit fa10432

Please sign in to comment.