From 9111442482cad0bc73c6f05942ac5ac2742ad636 Mon Sep 17 00:00:00 2001 From: neverland Date: Wed, 12 Nov 2025 13:50:06 +0800 Subject: [PATCH] docs: move license headers to THIRDPARTY.md --- THIRDPARTY.md | 24 ++++++++++++++++++++++++ client/errorOverlayEntry.js | 9 --------- client/overlay/index.js | 9 --------- client/reactRefresh.js | 2 -- client/reactRefreshEntry.js | 10 ---------- client/refreshUtils.js | 10 ---------- client/utils/ansi-html.js | 11 ++--------- src/index.ts | 4 ++-- src/sockets/WDSSocket.ts | 9 --------- src/sockets/WHMEventSource.ts | 11 ----------- 10 files changed, 28 insertions(+), 71 deletions(-) create mode 100644 THIRDPARTY.md diff --git a/THIRDPARTY.md b/THIRDPARTY.md new file mode 100644 index 0000000..7d385a9 --- /dev/null +++ b/THIRDPARTY.md @@ -0,0 +1,24 @@ +# Third-Party Notices + +This project includes portions of code derived from third-party open-source software. + +Each component retains its original license and attribution as noted below. + +### pmmmwh/react-refresh-webpack-plugin + +- **Source:** https://github.com/pmmmwh/react-refresh-webpack-plugin/tree/0b960573797bf38926937994c481e4fec9ed8aa6 +- **License:** MIT +- **Author:** Michael Mok +- **Copyright (c)** 2019 Michael Mok + +The original license text is available at: https://github.com/pmmmwh/react-refresh-webpack-plugin/blob/0b960573797bf38926937994c481e4fec9ed8aa6/LICENSE + +### mahdyar/ansi-html-community + +- **Source:** https://github.com/mahdyar/ansi-html-community/tree/b86cc3f1fa1d118477877352f0eafe1a70fd20ab +- **License:** Apache License 2.0 +- **Original Author:** @Tjatse + +Some utility code from this repository was adapted to enhance ANSI color parsing behavior. + +The original license text is available at: https://github.com/mahdyar/ansi-html-community/blob/b86cc3f1fa1d118477877352f0eafe1a70fd20ab/LICENSE diff --git a/client/errorOverlayEntry.js b/client/errorOverlayEntry.js index 607b97f..1e30712 100644 --- a/client/errorOverlayEntry.js +++ b/client/errorOverlayEntry.js @@ -1,13 +1,4 @@ /* global __react_refresh_error_overlay__, __react_refresh_socket__, __resourceQuery */ -/** - * The following code is modified based on - * https://github.com/pmmmwh/react-refresh-webpack-plugin/blob/f1c8b9a44198449093ca95f85af5df97925e1cfc/client/ErrorOverlayEntry.js - * - * MIT Licensed - * Author Michael Mok - * Copyright (c) 2019 Michael Mok - * https://github.com/pmmmwh/react-refresh-webpack-plugin/blob/0b960573797bf38926937994c481e4fec9ed8aa6/LICENSE - */ const events = require('./utils/errorEventHandlers.js'); const formatWebpackErrors = require('./utils/formatWebpackErrors.js'); const runWithRetry = require('./utils/retry.js'); diff --git a/client/overlay/index.js b/client/overlay/index.js index 0cd6000..03bf231 100644 --- a/client/overlay/index.js +++ b/client/overlay/index.js @@ -1,12 +1,3 @@ -/** - * The following code is modified based on - * https://github.com/pmmmwh/react-refresh-webpack-plugin/blob/f1c8b9a44198449093ca95f85af5df97925e1cfc/overlay/index.js - * - * MIT Licensed - * Author Michael Mok - * Copyright (c) 2019 Michael Mok - * https://github.com/pmmmwh/react-refresh-webpack-plugin/blob/0b960573797bf38926937994c481e4fec9ed8aa6/LICENSE - */ const RuntimeErrorFooter = require('./components/RuntimeErrorFooter.js'); const RuntimeErrorHeader = require('./components/RuntimeErrorHeader.js'); const CompileErrorContainer = require('./containers/CompileErrorContainer.js'); diff --git a/client/reactRefresh.js b/client/reactRefresh.js index b76a62a..55ca798 100644 --- a/client/reactRefresh.js +++ b/client/reactRefresh.js @@ -1,8 +1,6 @@ -// Thanks https://github.com/pmmmwh/react-refresh-webpack-plugin const RefreshUtils = require('./refreshUtils'); const RefreshRuntime = require('react-refresh/runtime'); -// Port from https://github.com/pmmmwh/react-refresh-webpack-plugin/blob/main/loader/utils/getRefreshModuleRuntime.js#L29 function refresh(moduleId, webpackHot) { const currentExports = RefreshUtils.getModuleExports(moduleId); const fn = (exports) => { diff --git a/client/reactRefreshEntry.js b/client/reactRefreshEntry.js index 67abb54..7d38640 100644 --- a/client/reactRefreshEntry.js +++ b/client/reactRefreshEntry.js @@ -1,13 +1,3 @@ -/** - * The following code is modified based on - * https://github.com/pmmmwh/react-refresh-webpack-plugin/blob/0b960573797bf38926937994c481e4fec9ed8aa6/client/ReactRefreshEntry.js - * - * MIT Licensed - * Author Michael Mok - * Copyright (c) 2019 Michael Mok - * https://github.com/pmmmwh/react-refresh-webpack-plugin/blob/0b960573797bf38926937994c481e4fec9ed8aa6/LICENSE - */ - var RefreshRuntime = require('react-refresh/runtime'); var safeThis = (function () { // copied from core-js-pure/features/global-this diff --git a/client/refreshUtils.js b/client/refreshUtils.js index cf3a8e1..1ff03da 100644 --- a/client/refreshUtils.js +++ b/client/refreshUtils.js @@ -1,13 +1,3 @@ -/** - * The following code is modified based on - * https://github.com/pmmmwh/react-refresh-webpack-plugin/blob/0b960573797bf38926937994c481e4fec9ed8aa6/lib/runtime/RefreshUtils.js - * - * MIT Licensed - * Author Michael Mok - * Copyright (c) 2019 Michael Mok - * https://github.com/pmmmwh/react-refresh-webpack-plugin/blob/0b960573797bf38926937994c481e4fec9ed8aa6/LICENSE - */ - /* global __webpack_require__ */ var Refresh = require('react-refresh/runtime'); diff --git a/client/utils/ansi-html.js b/client/utils/ansi-html.js index 113d48b..3b318e6 100644 --- a/client/utils/ansi-html.js +++ b/client/utils/ansi-html.js @@ -1,15 +1,8 @@ /* eslint-disable */ // @ts-nocheck /** - * The following code is modified based on - * https://github.com/mahdyar/ansi-html-community/blob/b86cc3f1fa1d118477877352f0eafe1a70fd20ab/index.js - * - * Supported: - * - added support for 24-bit RGB colors. - * - * Apache 2.0 Licensed - * Author @Tjatse - * https://github.com/mahdyar/ansi-html-community/blob/master/LICENSE + * The following code is modified based on mahdyar/ansi-html-community + * Added support for 24-bit RGB colors. */ 'use strict'; diff --git a/src/index.ts b/src/index.ts index 915561b..1f371ae 100644 --- a/src/index.ts +++ b/src/index.ts @@ -100,8 +100,8 @@ class ReactRefreshRspackPlugin { }, resourceQuery: this.options.resourceQuery, dependency: { - // `new URL("static/sdk.js", import.meta.url)` the sdk.js is an asset module - // we shoudn't inject react refresh for asset module + // Assets loaded via `new URL("static/sdk.js", import.meta.url)` are asset modules + // React Refresh should not be injected for asset modules as they are static resources not: ['url'], }, use: ReactRefreshRspackPlugin.loader, diff --git a/src/sockets/WDSSocket.ts b/src/sockets/WDSSocket.ts index 3c10337..d02eace 100644 --- a/src/sockets/WDSSocket.ts +++ b/src/sockets/WDSSocket.ts @@ -1,12 +1,3 @@ -/** - * The following code is modified based on - * https://github.com/pmmmwh/react-refresh-webpack-plugin/blob/f1c8b9a44198449093ca95f85af5df97925e1cfc/sockets/WDSSocket.js - * - * MIT Licensed - * Author Michael Mok - * Copyright (c) 2019 Michael Mok - * https://github.com/pmmmwh/react-refresh-webpack-plugin/blob/0b960573797bf38926937994c481e4fec9ed8aa6/LICENSE - */ import getSocketUrlParts from './utils/getSocketUrlParts'; import getUrlFromParts from './utils/getUrlFromParts'; import getWDSMetadata from './utils/getWDSMetadata'; diff --git a/src/sockets/WHMEventSource.ts b/src/sockets/WHMEventSource.ts index 2c268e4..ba39d4c 100644 --- a/src/sockets/WHMEventSource.ts +++ b/src/sockets/WHMEventSource.ts @@ -1,16 +1,5 @@ -/** - * The following code is modified based on - * https://github.com/pmmmwh/react-refresh-webpack-plugin/blob/f770d3962c388da01eeda7079bff5f40c93992d2/sockets/WHMEventSource.js - * - * MIT Licensed - * Author Michael Mok - * Copyright (c) 2019 Michael Mok - * https://github.com/pmmmwh/react-refresh-webpack-plugin/blob/f770d3962c388da01eeda7079bff5f40c93992d2/LICENSE - */ - /** * The hard-coded singleton key for webpack-hot-middleware's client instance. - * * [Ref](https://github.com/webpack-contrib/webpack-hot-middleware/blob/cb29abb9dde435a1ac8e9b19f82d7d36b1093198/client.js#L152) */ const singletonKey = '__webpack_hot_middleware_reporter__';