Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 0 additions & 49 deletions .eslintignore

This file was deleted.

152 changes: 0 additions & 152 deletions .eslintrc.json

This file was deleted.

11 changes: 6 additions & 5 deletions .github/split.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
/* eslint-disable no-console */
const fs = require('fs');
const path = require('path');

const BASE_DIR = path.join(__dirname, '../packages/react-integration/cypress/integration');
const WORKER_NUM = +process.env['WORKER_NUM'];
const WORKER_COUNT = +process.env['WORKER_COUNT'];
const WORKER_NUM = +process.env.WORKER_NUM;
const WORKER_COUNT = +process.env.WORKER_COUNT;

const testFiles = fs.readdirSync(BASE_DIR)
const testFiles = fs
.readdirSync(BASE_DIR)
.sort()
.filter((_, i) => i % WORKER_COUNT === WORKER_NUM)
.map(f => path.join(BASE_DIR, f));
.map((f) => path.join(BASE_DIR, f));

console.log(testFiles.join(' '));

57 changes: 30 additions & 27 deletions .github/upload-preview.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-console, camelcase */
const path = require('path');
const { Octokit } = require('@octokit/rest');
const octokit = new Octokit({ auth: process.env.GH_PR_TOKEN });
Expand All @@ -12,22 +13,20 @@ const prbranch = process.env.GITHUB_REF.split('/').pop();

const uploadFolder = process.argv[2];
if (!uploadFolder) {
console.log('Usage: upload-preview uploadFolder');
process.exit(1);
}

const uploadFolderName = path.basename(uploadFolder);
let uploadURL = `${repo}-${prnum ? `pr-${prnum}` : prbranch}`.replace(/[\/|\.]/g, '-');
let uploadURL = `${repo}-${prnum ? `pr-${prnum}` : prbranch}`.replace(/[/|.]/g, '-');

switch(uploadFolderName) {
switch (uploadFolderName) {
case 'coverage':
uploadURL += '-a11y.surge.sh';
break;
case 'public':
if (!prnum && prbranch === 'main') {
uploadURL = 'react-staging.patternfly.org';
}
else {
} else {
uploadURL += '.surge.sh';
}
break;
Expand All @@ -54,41 +53,45 @@ function tryAddComment(comment, commentBody) {
}

if (prnum) {
octokit.issues.listComments({
owner,
repo,
issue_number: prnum
})
.then(res => res.data)
.then(comments => {
octokit.issues
.listComments({
owner,
repo,
issue_number: prnum
})
.then((res) => res.data)
.then((comments) => {
let commentBody = '';
const existingComment = comments.find(comment => comment.user.login === 'patternfly-build');
const existingComment = comments.find((comment) => comment.user.login === 'patternfly-build');
if (existingComment) {
commentBody += existingComment.body.trim();
commentBody += '\n\n';
}

if (uploadFolderName === 'public') {
commentBody += tryAddComment(`Preview: https://${uploadURL}`, commentBody);
}
else if (uploadFolderName === 'coverage') {
} else if (uploadFolderName === 'coverage') {
commentBody += tryAddComment(`A11y report: https://${uploadURL}`, commentBody);
}

if (existingComment) {
octokit.issues.updateComment({
owner,
repo,
comment_id: existingComment.id,
body: commentBody
}).then(() => console.log('Updated comment!'));
octokit.issues
.updateComment({
owner,
repo,
comment_id: existingComment.id,
body: commentBody
})
.then(() => console.log('Updated comment!'));
} else {
octokit.issues.createComment({
owner,
repo,
issue_number: prnum,
body: commentBody
}).then(() => console.log('Created comment!'));
octokit.issues
.createComment({
owner,
repo,
issue_number: prnum,
body: commentBody
})
.then(() => console.log('Created comment!'));
}
});
}
4 changes: 2 additions & 2 deletions eslint.config-md.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import tsParser from '@typescript-eslint/parser';
import markdown from 'eslint-plugin-markdown';
import patternflyReact from 'eslint-plugin-patternfly-react';
import react from 'eslint-plugin-react';
import tseslint from 'typescript-eslint';

export default [
...markdown.configs.recommended,
Expand All @@ -11,7 +11,7 @@ export default [
'patternfly-react': patternflyReact
},
languageOptions: {
parser: tsParser
parser: tseslint.parser
},
settings: {
react: {
Expand Down
Loading