From 500e1619afa58e12e2e5802564bc1bac7a7dac39 Mon Sep 17 00:00:00 2001 From: Nikolay Vitkov Date: Fri, 17 Oct 2025 17:02:50 +0200 Subject: [PATCH 1/3] chore: clean up rollup config --- .github/workflows/publish-to-npm-on-tag.yml | 4 ++ package-lock.json | 67 --------------------- package.json | 2 - rollup.config.mjs | 28 +++------ 4 files changed, 12 insertions(+), 89 deletions(-) diff --git a/.github/workflows/publish-to-npm-on-tag.yml b/.github/workflows/publish-to-npm-on-tag.yml index 1e8ec6ef..007474e8 100644 --- a/.github/workflows/publish-to-npm-on-tag.yml +++ b/.github/workflows/publish-to-npm-on-tag.yml @@ -45,6 +45,8 @@ jobs: - name: Build run: npm run build + env: + NODE_ENV: 'production' - name: Publish run: | @@ -76,6 +78,8 @@ jobs: - name: Build run: npm run build + env: + NODE_ENV: 'production' - name: Install MCP Publisher run: | diff --git a/package-lock.json b/package-lock.json index 22164356..007c7471 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,8 +21,6 @@ "devDependencies": { "@eslint/js": "^9.35.0", "@modelcontextprotocol/sdk": "1.20.0", - "@rollup/plugin-commonjs": "^28.0.8", - "@rollup/plugin-json": "^6.1.0", "@rollup/plugin-node-resolve": "^16.0.3", "@stylistic/eslint-plugin": "^5.4.0", "@types/debug": "^4.1.12", @@ -578,54 +576,6 @@ "node": ">=12" } }, - "node_modules/@rollup/plugin-commonjs": { - "version": "28.0.8", - "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-28.0.8.tgz", - "integrity": "sha512-o1Ug9PxYsF61R7/NXO/GgMZZproLd/WH2XA53Tp9ppf6bU1lMlTtC/gUM6zM3mesi2E0rypk+PNtVrELREyWEQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@rollup/pluginutils": "^5.0.1", - "commondir": "^1.0.1", - "estree-walker": "^2.0.2", - "fdir": "^6.2.0", - "is-reference": "1.2.1", - "magic-string": "^0.30.3", - "picomatch": "^4.0.2" - }, - "engines": { - "node": ">=16.0.0 || 14 >= 14.17" - }, - "peerDependencies": { - "rollup": "^2.68.0||^3.0.0||^4.0.0" - }, - "peerDependenciesMeta": { - "rollup": { - "optional": true - } - } - }, - "node_modules/@rollup/plugin-json": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-6.1.0.tgz", - "integrity": "sha512-EGI2te5ENk1coGeADSIwZ7G2Q8CJS2sF120T7jLw4xFw9n7wIOXHo+kIYRAoVpJAN+kmqZSoO3Fp4JtoNF4ReA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@rollup/pluginutils": "^5.1.0" - }, - "engines": { - "node": ">=14.0.0" - }, - "peerDependencies": { - "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" - }, - "peerDependenciesMeta": { - "rollup": { - "optional": true - } - } - }, "node_modules/@rollup/plugin-node-resolve": { "version": "16.0.3", "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-16.0.3.tgz", @@ -2264,13 +2214,6 @@ "dev": true, "license": "MIT" }, - "node_modules/commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", - "dev": true, - "license": "MIT" - }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -4336,16 +4279,6 @@ "dev": true, "license": "MIT" }, - "node_modules/is-reference": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", - "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/estree": "*" - } - }, "node_modules/is-regex": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", diff --git a/package.json b/package.json index a54543a6..daada611 100644 --- a/package.json +++ b/package.json @@ -46,8 +46,6 @@ "devDependencies": { "@eslint/js": "^9.35.0", "@modelcontextprotocol/sdk": "1.20.0", - "@rollup/plugin-commonjs": "^28.0.8", - "@rollup/plugin-json": "^6.1.0", "@rollup/plugin-node-resolve": "^16.0.3", "@stylistic/eslint-plugin": "^5.4.0", "@types/debug": "^4.1.12", diff --git a/rollup.config.mjs b/rollup.config.mjs index 554c26cd..8b1ee467 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -1,32 +1,23 @@ /** - * Copyright 2021 Google LLC. - * Copyright (c) Microsoft Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * @license + * Copyright 2025 Google Inc. + * SPDX-License-Identifier: Apache-2.0 */ + import path from 'node:path'; -import commonjs from '@rollup/plugin-commonjs'; -import json from '@rollup/plugin-json'; import {nodeResolve} from '@rollup/plugin-node-resolve'; import cleanup from 'rollup-plugin-cleanup'; import license from 'rollup-plugin-license'; +const isProduction = process.env.NODE_ENV === 'production'; + +/** @type {import('rollup').RollupOptions} */ const sdk = { input: './build/src/third_party/modelcontextprotocol-sdk/index.js', output: { file: './build/src/third_party/modelcontextprotocol-sdk/index.js', - sourcemap: false, + sourcemap: !isProduction, format: 'esm', }, plugins: [ @@ -37,7 +28,6 @@ const sdk = { comments: [/Copyright/i], }), license({ - debug: true, thirdParty: { allow: { test: dependency => { @@ -79,8 +69,6 @@ const sdk = { }, }, }), - commonjs(), - json(), nodeResolve(), ], }; From 57e7835b60c39999d9064d94b7b50f8083eed32b Mon Sep 17 00:00:00 2001 From: Nikolay Vitkov Date: Fri, 17 Oct 2025 17:09:29 +0200 Subject: [PATCH 2/3] revert --- package-lock.json | 67 +++++++++++++++++++++++++++++++++++++++++++++++ package.json | 2 ++ rollup.config.mjs | 4 +++ 3 files changed, 73 insertions(+) diff --git a/package-lock.json b/package-lock.json index 007c7471..22164356 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,6 +21,8 @@ "devDependencies": { "@eslint/js": "^9.35.0", "@modelcontextprotocol/sdk": "1.20.0", + "@rollup/plugin-commonjs": "^28.0.8", + "@rollup/plugin-json": "^6.1.0", "@rollup/plugin-node-resolve": "^16.0.3", "@stylistic/eslint-plugin": "^5.4.0", "@types/debug": "^4.1.12", @@ -576,6 +578,54 @@ "node": ">=12" } }, + "node_modules/@rollup/plugin-commonjs": { + "version": "28.0.8", + "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-28.0.8.tgz", + "integrity": "sha512-o1Ug9PxYsF61R7/NXO/GgMZZproLd/WH2XA53Tp9ppf6bU1lMlTtC/gUM6zM3mesi2E0rypk+PNtVrELREyWEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^5.0.1", + "commondir": "^1.0.1", + "estree-walker": "^2.0.2", + "fdir": "^6.2.0", + "is-reference": "1.2.1", + "magic-string": "^0.30.3", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=16.0.0 || 14 >= 14.17" + }, + "peerDependencies": { + "rollup": "^2.68.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-json": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-6.1.0.tgz", + "integrity": "sha512-EGI2te5ENk1coGeADSIwZ7G2Q8CJS2sF120T7jLw4xFw9n7wIOXHo+kIYRAoVpJAN+kmqZSoO3Fp4JtoNF4ReA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^5.1.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, "node_modules/@rollup/plugin-node-resolve": { "version": "16.0.3", "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-16.0.3.tgz", @@ -2214,6 +2264,13 @@ "dev": true, "license": "MIT" }, + "node_modules/commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", + "dev": true, + "license": "MIT" + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -4279,6 +4336,16 @@ "dev": true, "license": "MIT" }, + "node_modules/is-reference": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", + "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "*" + } + }, "node_modules/is-regex": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", diff --git a/package.json b/package.json index daada611..a54543a6 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,8 @@ "devDependencies": { "@eslint/js": "^9.35.0", "@modelcontextprotocol/sdk": "1.20.0", + "@rollup/plugin-commonjs": "^28.0.8", + "@rollup/plugin-json": "^6.1.0", "@rollup/plugin-node-resolve": "^16.0.3", "@stylistic/eslint-plugin": "^5.4.0", "@types/debug": "^4.1.12", diff --git a/rollup.config.mjs b/rollup.config.mjs index 8b1ee467..5aca0104 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -6,6 +6,8 @@ import path from 'node:path'; +import commonjs from '@rollup/plugin-commonjs'; +import json from '@rollup/plugin-json'; import {nodeResolve} from '@rollup/plugin-node-resolve'; import cleanup from 'rollup-plugin-cleanup'; import license from 'rollup-plugin-license'; @@ -69,6 +71,8 @@ const sdk = { }, }, }), + commonjs(), + json(), nodeResolve(), ], }; From c21e91982f4e0327ca8f260e57907d810aa939fc Mon Sep 17 00:00:00 2001 From: Nikolay Vitkov Date: Fri, 17 Oct 2025 17:39:31 +0200 Subject: [PATCH 3/3] revert: header change --- rollup.config.mjs | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/rollup.config.mjs b/rollup.config.mjs index 5aca0104..b03ee276 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -1,7 +1,22 @@ /** - * @license - * Copyright 2025 Google Inc. - * SPDX-License-Identifier: Apache-2.0 + * Copyright 2021 Google LLC. + * Copyright (c) Microsoft Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @fileoverview take from {@link https://github.com/GoogleChromeLabs/chromium-bidi/blob/main/rollup.config.mjs | chromium-bidi} + * and modified to specific requirement. */ import path from 'node:path';