Skip to content

Commit

Permalink
Merge branch 'master-github-upstream' into feature/integrate_visualizer
Browse files Browse the repository at this point in the history
# Conflicts:
#	package-lock.json
#	package.json
#	src/components/Visualiser/Controls.tsx
#	src/components/Visualiser/FlowDiagram.tsx
#	src/components/Visualiser/Nodes/ApplicationNode.tsx
#	src/components/Visualiser/Nodes/PublishNode.tsx
#	src/components/Visualiser/Nodes/SubscribeNode.tsx
#	src/components/Visualiser/Visualiser.tsx
#	src/components/Visualiser/VisualiserTemplate.tsx
#	src/components/Visualiser/utils/node-calculator.ts
#	src/components/Visualiser/utils/node-factory.ts
  • Loading branch information
jonaslagoni committed Nov 24, 2022
2 parents 0b8af00 + b50bdda commit c083908
Show file tree
Hide file tree
Showing 25 changed files with 8,799 additions and 16,172 deletions.
18 changes: 6 additions & 12 deletions .github/workflows/notify-tsc-members-mention.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,22 @@ on:
issue_comment:
types:
- created
- edited

discussion_comment:
types:
- created
- edited

issues:
types:
- opened
- reopened

pull_request_target:
types:
- opened
- reopened
- ready_for_review

discussion:
types:
- created
- edited

jobs:
issue:
Expand Down Expand Up @@ -75,7 +69,7 @@ jobs:
with:
script: |
const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js');
sendEmail('${{github.event.issue.html_url}}');
sendEmail('${{github.event.issue.html_url}}', '${{github.event.issue.title}}');
pull_request:
if: github.event_name == 'pull_request_target' && contains(github.event.pull_request.body, '@asyncapi/tsc_members')
Expand Down Expand Up @@ -120,7 +114,7 @@ jobs:
with:
script: |
const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js');
sendEmail('${{github.event.pull_request.html_url}}');
sendEmail('${{github.event.pull_request.html_url}}', '${{github.event.pull_request.title}}');
discussion:
if: github.event_name == 'discussion' && contains(github.event.discussion.body, '@asyncapi/tsc_members')
Expand Down Expand Up @@ -165,7 +159,7 @@ jobs:
with:
script: |
const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js');
sendEmail('${{github.event.discussion.html_url}}');
sendEmail('${{github.event.discussion.html_url}}', '${{github.event.discussion.title}}');
issue_comment:
if: ${{ github.event_name == 'issue_comment' && !github.event.issue.pull_request && contains(github.event.comment.body, '@asyncapi/tsc_members') }}
Expand Down Expand Up @@ -210,7 +204,7 @@ jobs:
with:
script: |
const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js');
sendEmail('${{github.event.comment.html_url}}');
sendEmail('${{github.event.comment.html_url}}', '${{github.event.issue.title}}');
pr_comment:
if: github.event_name == 'issue_comment' && github.event.issue.pull_request && contains(github.event.comment.body, '@asyncapi/tsc_members')
Expand Down Expand Up @@ -255,7 +249,7 @@ jobs:
with:
script: |
const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js');
sendEmail('${{github.event.comment.html_url}}');
sendEmail('${{github.event.comment.html_url}}', '${{github.event.issue.title}}');
discussion_comment:
if: github.event_name == 'discussion_comment' && contains(github.event.comment.body, '@asyncapi/tsc_members')
Expand Down Expand Up @@ -300,4 +294,4 @@ jobs:
with:
script: |
const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js');
sendEmail('${{github.event.comment.html_url}}');
sendEmail('${{github.event.comment.html_url}}', '${{github.event.discussion.title}}');
4 changes: 2 additions & 2 deletions .github/workflows/scripts/mailchimp/htmlContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This code is centrally managed in https://github.com/asyncapi/.github/
* Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo
*/
module.exports = (link) => {
module.exports = (link, title) => {

return `<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
Expand Down Expand Up @@ -386,7 +386,7 @@ There is a new topic at AsyncAPI Initiative that requires Technical Steering Com
<br>
Please have a look if it is just something you need to be aware of, or maybe your vote is needed.
<br>
<a href="${ link }" style="color:#007c89;font-weight:normal;text-decoration:underline" target="_blank">Click here to see more details on GitHub</a>.
Topic: <a href="${ link }" style="color:#007c89;font-weight:normal;text-decoration:underline" target="_blank">${ title }</a>.
</td>
</tr>
</tbody></table>
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/scripts/mailchimp/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const htmlContent = require('./htmlContent.js');
* Sending API request to mailchimp to schedule email to subscribers
* Input is the URL to issue/discussion or other resource
*/
module.exports = async (link) => {
module.exports = async (link, title) => {

let newCampaign;

Expand All @@ -32,7 +32,7 @@ module.exports = async (link) => {
}
},
settings: {
subject_line: 'AsyncAPI TSC members attention required',
subject_line: `TSC attention required: ${ title }`,
preview_text: 'Check out the latest topic that TSC members have to be aware of',
title: `New topic info - ${ new Date(Date.now()).toUTCString()}`,
from_name: 'AsyncAPI Initiative',
Expand All @@ -47,7 +47,7 @@ module.exports = async (link) => {
* Content of the email is added separately after campaign creation
*/
try {
await mailchimp.campaigns.setContent(newCampaign.id, { html: htmlContent(link) });
await mailchimp.campaigns.setContent(newCampaign.id, { html: htmlContent(link, title) });
} catch (error) {
return core.setFailed(`Failed adding content to campaign: ${ JSON.stringify(error) }`);
}
Expand Down
111 changes: 84 additions & 27 deletions craco.config.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,86 @@
// eslint-disable-next-line
const crypto = require('crypto'); // Force method use SHA-256 to address
const cryptCreateHashOrig = crypto.createHash; // OpenSSL 3.0 deprecation of
crypto.createHash = () => cryptCreateHashOrig('sha256'); // MD4 algorithm

module.exports = {
style: {
postcss: {
plugins: [
require('tailwindcss'),
require('autoprefixer'),
],
},
},
webpack: {
configure: (webpackConfig) => {
webpackConfig.module.rules.push({
test: /\.yml$/i,
loader: 'raw-loader',
});

webpackConfig.resolve.alias = webpackConfig.resolve.alias || {};
webpackConfig.resolve.alias['nimma/fallbacks'] = require.resolve('./node_modules/nimma/dist/legacy/cjs/fallbacks/index.js');
webpackConfig.resolve.alias['nimma/legacy'] = require.resolve('./node_modules/nimma/dist/legacy/cjs/index.js');

return webpackConfig;
/* eslint-disable */

const crypto = require('crypto');
const webpack = require('webpack');

function getFileLoaderRule(rules) {
for (const rule of rules) {
if ("oneOf" in rule) {
const found = getFileLoaderRule(rule.oneOf);
if (found) {
return found;
}
} else if (rule.test === undefined && rule.type === 'asset/resource') {
return rule;
}
}
};
throw new Error("File loader not found");
}

function configureWebpack(webpackConfig) {
// fallbacks
const fallback = webpackConfig.resolve.fallback || {};
Object.assign(fallback, {
assert: require.resolve('assert/'),
buffer: require.resolve('buffer'),
http: require.resolve('stream-http'),
https: require.resolve('https-browserify'),
path: require.resolve('path-browserify'),
stream: require.resolve('stream-browserify'),
zlib: require.resolve('browserify-zlib'),
url: require.resolve('url/'),
util: require.resolve('util/'),
fs: false,
});
webpackConfig.resolve.fallback = fallback;

// aliases
webpackConfig.resolve.alias = webpackConfig.resolve.alias || {};
webpackConfig.resolve.alias['nimma/fallbacks'] = require.resolve('./node_modules/nimma/dist/legacy/cjs/fallbacks/index.js');
webpackConfig.resolve.alias['nimma/legacy'] = require.resolve('./node_modules/nimma/dist/legacy/cjs/index.js');

// plugins
webpackConfig.plugins = (webpackConfig.plugins || []).concat([
new webpack.ProvidePlugin({
process: 'process/browser.js',
Buffer: ['buffer', 'Buffer']
})
]);

// rules/loaders
// workaround for https://github.com/facebook/create-react-app/issues/11889 issue
const fileLoaderRule = getFileLoaderRule(webpackConfig.module.rules);
fileLoaderRule.exclude.push(/\.cjs$/);
webpackConfig.module.rules.push({
test: /\.yml$/i,
type: 'asset/source',
});

// ignore source-map warnings
webpackConfig.ignoreWarnings = [...(webpackConfig.ignoreWarnings || []), /Failed to parse source map/];

return webpackConfig;
}

// Force method use SHA-256 to address OpenSSL 3.0 deprecation of MD4 algorithm
function configureCrypto() {
const cryptCreateHashOrig = crypto.createHash;
crypto.createHash = () => cryptCreateHashOrig('sha256');
}

function setEnvironments() {
process.env.DISABLE_ESLINT_PLUGIN = true;
}

function configureCraco() {
setEnvironments();
configureCrypto();

return {
webpack: {
configure: configureWebpack,
}
};
}

module.exports = configureCraco();
Loading

0 comments on commit c083908

Please sign in to comment.