diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..3ba13e0c --- /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 00000000..a293d789 --- /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 deleted file mode 100644 index 68a680e6..00000000 --- a/.github/workflows/check-format.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Check code format - -permissions: read-all - -on: - push: - branches: - - main - pull_request: - -jobs: - check-format: - 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: Run format check - run: npm run check-format diff --git a/.github/workflows/presubmit.yml b/.github/workflows/presubmit.yml new file mode 100644 index 00000000..af19347f --- /dev/null +++ b/.github/workflows/presubmit.yml @@ -0,0 +1,64 @@ +name: Check code before submitting + +permissions: read-all + +on: + push: + branches: + - main + pull_request: + +jobs: + check-format: + runs-on: ubuntu-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: Run format check + run: npm run check-format + + check-docs: + runs-on: ubuntu-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 diff --git a/package.json b/package.json index 60dc6818..c9d79db6 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'", diff --git a/scripts/generate-docs.ts b/scripts/generate-docs.ts index 8ab9082b..091b5dfc 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');