From d2c79572f9ad625889fccd9c1ef3f181fe3d199f Mon Sep 17 00:00:00 2001 From: Nikolay Vitkov Date: Thu, 11 Sep 2025 13:21:23 +0200 Subject: [PATCH 1/4] ci: preconfigure CI jobs --- .github/ISSUE_TEMPLATE/config.yml | 1 + .github/dependabot.yml | 29 ++++++++++++++++++++++++++++ .github/workflows/check-format.yml | 31 ++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/dependabot.yml diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000..3ba13e0ce --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: false diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..a293d789e --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,29 @@ +version: 2 +updates: + - package-ecosystem: npm + directory: / + schedule: + interval: weekly + day: 'sunday' + time: '02:00' + timezone: Europe/Berlin + groups: + dependencies: + dependency-type: production + patterns: + - '*' + dev-dependencies: + dependency-type: development + patterns: + - '*' + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly + day: 'sunday' + time: '04:00' + timezone: Europe/Berlin + groups: + all: + patterns: + - '*' diff --git a/.github/workflows/check-format.yml b/.github/workflows/check-format.yml index 68a680e6b..8d21b2025 100644 --- a/.github/workflows/check-format.yml +++ b/.github/workflows/check-format.yml @@ -29,3 +29,34 @@ jobs: - name: Run format check run: npm run check-format + check-docs: + runs-on: ubuntu-latest # You can also use 'macos-latest' or 'windows-latest' + + steps: + - name: Check out repository + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + fetch-depth: 2 + + - name: Set up Node.js + uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 + with: + cache: npm + node-version-file: '.nvmrc' + + - name: Install dependencies + run: npm ci + + - name: Generate documents + run: npm run generate-docs + - name: Check if autogenerated docs differ + run: | + diff_file=$(mktemp doc_diff_XXXXXX) + git diff --color > $diff_file + if [[ -s $diff_file ]]; then + echo "Please update the documentation by running 'npm run docs'. The following was the diff" + cat $diff_file + rm $diff_file + exit 1 + fi + rm $diff_file From ed5bb71dfeee6c41be82903f0c1708fa07d81b5d Mon Sep 17 00:00:00 2001 From: Nikolay Vitkov Date: Thu, 11 Sep 2025 13:26:57 +0200 Subject: [PATCH 2/4] fixes --- .github/workflows/{check-format.yml => presubmit.yml} | 8 +++++--- package.json | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) rename .github/workflows/{check-format.yml => presubmit.yml} (88%) diff --git a/.github/workflows/check-format.yml b/.github/workflows/presubmit.yml similarity index 88% rename from .github/workflows/check-format.yml rename to .github/workflows/presubmit.yml index 8d21b2025..af19347f8 100644 --- a/.github/workflows/check-format.yml +++ b/.github/workflows/presubmit.yml @@ -1,4 +1,4 @@ -name: Check code format +name: Check code before submitting permissions: read-all @@ -10,7 +10,7 @@ on: jobs: check-format: - runs-on: ubuntu-latest # You can also use 'macos-latest' or 'windows-latest' + runs-on: ubuntu-latest steps: - name: Check out repository @@ -29,8 +29,9 @@ jobs: - name: Run format check run: npm run check-format + check-docs: - runs-on: ubuntu-latest # You can also use 'macos-latest' or 'windows-latest' + runs-on: ubuntu-latest steps: - name: Check out repository @@ -49,6 +50,7 @@ jobs: - name: Generate documents run: npm run generate-docs + - name: Check if autogenerated docs differ run: | diff_file=$(mktemp doc_diff_XXXXXX) diff --git a/package.json b/package.json index 60dc68187..c9d79db6e 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "build": "tsc && node --experimental-strip-types scripts/post-build.ts", "format": "eslint --cache --fix . ;prettier --write --cache .", "check-format": "eslint --cache .; prettier --check --cache .;", - "generate-docs": "node --experimental-strip-types scripts/generate-docs.ts", + "generate-docs": "npm run build && node --experimental-strip-types scripts/generate-docs.ts", "start": "npm run build && node build/src/index.js", "start-debug": "DEBUG=mcp:* DEBUG_COLORS=false npm run build && node build/src/index.js", "test": "npm run build && npx puppeteer browsers install chrome@latest && PUPPETEER_CHROME_VERSION=latest node --test-force-exit --test 'build/tests/**/*.test.js'", From 14bd0d51e854d16b3d4ce7af3ec014646c4c2dc8 Mon Sep 17 00:00:00 2001 From: Nikolay Vitkov Date: Thu, 11 Sep 2025 13:31:30 +0200 Subject: [PATCH 3/4] fix --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 7811e4a25..3b032a2b6 100644 --- a/README.md +++ b/README.md @@ -168,5 +168,4 @@ Examples: npx chrome-devtools-mcp@latest --logFile /tmp/log.txt Save logs to a file npx chrome-devtools-mcp@latest --help Print CLI options ``` - From d4f31fb3fdc263887d77d2386c7909168841c361 Mon Sep 17 00:00:00 2001 From: Nikolay Vitkov Date: Thu, 11 Sep 2025 13:37:56 +0200 Subject: [PATCH 4/4] fix --- README.md | 1 + scripts/generate-docs.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3b032a2b6..7811e4a25 100644 --- a/README.md +++ b/README.md @@ -168,4 +168,5 @@ Examples: npx chrome-devtools-mcp@latest --logFile /tmp/log.txt Save logs to a file npx chrome-devtools-mcp@latest --help Print CLI options ``` + diff --git a/scripts/generate-docs.ts b/scripts/generate-docs.ts index 8ab9082b6..091b5dfcf 100644 --- a/scripts/generate-docs.ts +++ b/scripts/generate-docs.ts @@ -119,7 +119,7 @@ function updateReadmeWithConfigOptions(help: string): void { const before = readmeContent.substring(0, beginIndex + beginMarker.length); const after = readmeContent.substring(endIndex); - const updatedContent = before + '\n\n```sh\n' + help + '```\n' + after; + const updatedContent = before + '\n\n```sh\n' + help + '```\n\n' + after; fs.writeFileSync(README_PATH, updatedContent); console.log('Updated README.md with config options');