Skip to content

Commit ecce932

Browse files
feat: Update output mode logic for Claude client and enhance documentation (#123)
* feat: Update output mode logic for Claude client and enhance documentation * feat: Add workflow for publishing alpha versions to Verdaccio * feat: Improve GitHub Actions workflow by adding job names for clarity * feat: Update codecall configuration and schema to support optional parameters * fix: Refactor service injection and improve error handling in flow instance * fix: Adjust context declaration order in flow instance for clarity * fix: Update ESLint configuration to allow unused variables with underscore prefix * fix: Enhance error handling by replacing generic errors with InternalMcpError in flow instance
1 parent 5fca436 commit ecce932

File tree

47 files changed

+356
-237
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+356
-237
lines changed
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Publish Alpha to Verdaccio
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
base_version:
7+
description: "Base version (leave empty to use package.json)"
8+
required: false
9+
type: string
10+
default: ""
11+
12+
jobs:
13+
publish-alpha:
14+
runs-on: ubuntu-latest
15+
env:
16+
NX_DAEMON: "false"
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Setup Node
24+
uses: actions/setup-node@v6
25+
with:
26+
node-version-file: ".nvmrc"
27+
cache: "yarn"
28+
29+
- name: Install dependencies
30+
run: yarn install --frozen-lockfile
31+
32+
- name: Resolve synchronized libs
33+
id: libs
34+
shell: bash
35+
run: |
36+
set -euo pipefail
37+
PROJECTS=$(npx nx show projects -p tag:versioning:synchronized --type lib --json | node -e "console.log(JSON.parse(require('fs').readFileSync(0,'utf8')).join(','))")
38+
echo "projects=$PROJECTS" >> "$GITHUB_OUTPUT"
39+
echo "Found libs: $PROJECTS"
40+
41+
- name: Calculate alpha version
42+
id: version
43+
shell: bash
44+
run: |
45+
set -euo pipefail
46+
FULL_SHA=$(git rev-parse HEAD)
47+
SHA_SUFFIX="${FULL_SHA: -16}"
48+
if [ -n "${{ inputs.base_version }}" ]; then
49+
BASE="${{ inputs.base_version }}"
50+
else
51+
BASE=$(node -e "console.log(require('./package.json').version)")
52+
fi
53+
ALPHA_VERSION="${BASE}-alpha.${SHA_SUFFIX}"
54+
echo "version=$ALPHA_VERSION" >> "$GITHUB_OUTPUT"
55+
echo "Alpha version: $ALPHA_VERSION"
56+
57+
- name: Update package versions with Nx
58+
run: npx nx release version ${{ steps.version.outputs.version }} --skip-lockfile-update
59+
60+
- name: Build all packages
61+
run: npx nx run-many --targets=build --projects="${{ steps.libs.outputs.projects }}" --parallel
62+
63+
- name: Configure npm for Verdaccio
64+
shell: bash
65+
run: |
66+
set -euo pipefail
67+
REGISTRY_HOST="${VERDACCIO_REGISTRY_URL#https://}"
68+
REGISTRY_HOST="${REGISTRY_HOST#http://}"
69+
echo "//${REGISTRY_HOST}/:_authToken=${VERDACCIO_TOKEN}" >> ~/.npmrc
70+
env:
71+
VERDACCIO_REGISTRY_URL: ${{ secrets.VERDACCIO_REGISTRY_URL }}
72+
VERDACCIO_TOKEN: ${{ secrets.VERDACCIO_TOKEN }}
73+
74+
- name: Publish to Verdaccio
75+
run: npx nx release publish --registry=${{ secrets.VERDACCIO_REGISTRY_URL }}
76+
77+
- name: Summary
78+
run: |
79+
echo "✅ Published alpha version: ${{ steps.version.outputs.version }}"
80+
echo "📦 Packages: ${{ steps.libs.outputs.projects }}"
81+
echo "🎯 Registry: Verdaccio (private)"

.github/workflows/push.yml

Lines changed: 26 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ concurrency:
99
jobs:
1010
# Shared setup job that other jobs can reference
1111
setup:
12+
name: "Setup"
1213
runs-on: ubuntu-latest
1314
outputs:
1415
node-version: ${{ steps.node-version.outputs.version }}
@@ -22,6 +23,7 @@ jobs:
2223

2324
# Lint and format checks (fast, independent)
2425
lint:
26+
name: "Lint & Format Checks"
2527
needs: setup
2628
runs-on: ubuntu-latest
2729
env:
@@ -46,14 +48,14 @@ jobs:
4648

4749
- name: Run linter
4850
run: npx nx affected -t lint
49-
continue-on-error: true
5051

5152
- name: Run prettier
5253
run: npx prettier --check .
5354
continue-on-error: true
5455

5556
# Build all libraries
5657
build:
58+
name: "Build Libraries"
5759
needs: setup
5860
runs-on: ubuntu-latest
5961
env:
@@ -90,6 +92,7 @@ jobs:
9092

9193
# Unit tests (depends on build)
9294
unit-tests:
95+
name: "Unit Tests"
9396
needs: [setup, build]
9497
runs-on: ubuntu-latest
9598
env:
@@ -120,72 +123,28 @@ jobs:
120123
- name: Run unit tests
121124
run: npx nx affected -t test --passWithNoTests --exclude='demo-e2e-*'
122125

123-
# E2E tests - split into batches for parallelization
124-
e2e-batch-1:
125-
needs: [setup, build]
126-
runs-on: ubuntu-latest
127-
env:
128-
NX_DAEMON: "false"
129-
steps:
130-
- name: Checkout code
131-
uses: actions/checkout@v4
132-
with:
133-
fetch-depth: 0
134-
135-
- name: Setup Node
136-
uses: actions/setup-node@v6
137-
with:
138-
node-version: ${{ needs.setup.outputs.node-version }}
139-
cache: "yarn"
140-
141-
- name: Install dependencies
142-
run: yarn install --frozen-lockfile
143-
144-
- name: Download build artifacts
145-
uses: actions/download-artifact@v4
146-
with:
147-
name: dist
148-
149-
- name: Set Nx SHAs
150-
uses: nrwl/nx-set-shas@v4
151-
152-
- name: Run E2E tests (batch 1)
153-
run: npx nx run-many -t test --projects=demo-e2e-public,demo-e2e-transparent,demo-e2e-openapi,demo-e2e-codecall
154-
155-
e2e-batch-2:
156-
needs: [setup, build]
157-
runs-on: ubuntu-latest
158-
env:
159-
NX_DAEMON: "false"
160-
steps:
161-
- name: Checkout code
162-
uses: actions/checkout@v4
163-
with:
164-
fetch-depth: 0
165-
166-
- name: Setup Node
167-
uses: actions/setup-node@v6
168-
with:
169-
node-version: ${{ needs.setup.outputs.node-version }}
170-
cache: "yarn"
171-
172-
- name: Install dependencies
173-
run: yarn install --frozen-lockfile
174-
175-
- name: Download build artifacts
176-
uses: actions/download-artifact@v4
177-
with:
178-
name: dist
179-
180-
- name: Set Nx SHAs
181-
uses: nrwl/nx-set-shas@v4
182-
183-
- name: Run E2E tests (batch 2)
184-
run: npx nx run-many -t test --projects=demo-e2e-redis,demo-e2e-providers,demo-e2e-cache,demo-e2e-ui
185-
186-
e2e-batch-3:
126+
# E2E tests - matrix strategy for parallelization
127+
e2e-tests:
128+
name: "E2E Tests (${{ matrix.project }})"
187129
needs: [setup, build]
188130
runs-on: ubuntu-latest
131+
strategy:
132+
fail-fast: false
133+
matrix:
134+
project:
135+
- demo-e2e-public
136+
- demo-e2e-transparent
137+
- demo-e2e-openapi
138+
- demo-e2e-codecall
139+
- demo-e2e-redis
140+
- demo-e2e-providers
141+
- demo-e2e-cache
142+
- demo-e2e-ui
143+
- demo-e2e-hooks
144+
- demo-e2e-errors
145+
- demo-e2e-notifications
146+
- demo-e2e-serverless
147+
- demo-e2e-multiapp
189148
env:
190149
NX_DAEMON: "false"
191150
steps:
@@ -211,5 +170,5 @@ jobs:
211170
- name: Set Nx SHAs
212171
uses: nrwl/nx-set-shas@v4
213172

214-
- name: Run E2E tests (batch 3)
215-
run: npx nx run-many -t test --projects=demo-e2e-hooks,demo-e2e-errors,demo-e2e-notifications,demo-e2e-serverless,demo-e2e-multiapp
173+
- name: Run E2E tests (${{ matrix.project }})
174+
run: npx nx run ${{ matrix.project }}:test

apps/auth/demo-orchestrated-auth/jest.e2e.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable */
21
export default {
32
displayName: 'demo-orchestrated-auth-e2e',
43
preset: '../../../jest.preset.js',

apps/auth/demo-public/jest.e2e.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable */
21
export default {
32
displayName: 'demo-public-e2e',
43
preset: '../../../jest.preset.js',

apps/auth/demo-transparent-auth/jest.e2e.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable */
21
export default {
32
displayName: 'demo-transparent-auth-e2e',
43
preset: '../../../jest.preset.js',

apps/demo/jest.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable */
21
module.exports = {
32
displayName: '@frontmcp/demo',
43
preset: '../../jest.preset.js',

apps/ui/mdx-demo/jest.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable */
21
module.exports = {
32
displayName: '@frontmcp/mdx-demo',
43
preset: '../../../jest.preset.js',

apps/ui/react-demo/jest.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable */
21
module.exports = {
32
displayName: '@frontmcp/react-demo',
43
preset: '../../../jest.preset.js',

eslint.config.mjs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,22 @@ export default [
1111
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
1212
rules: {
1313
'@typescript-eslint/no-explicit-any': 'warn',
14+
'@typescript-eslint/no-empty-function': 'warn',
15+
'@typescript-eslint/no-empty-interface': 'warn',
16+
'@typescript-eslint/no-empty-object-type': 'warn',
17+
'@typescript-eslint/no-unused-vars': [
18+
'warn',
19+
{
20+
argsIgnorePattern: '^_',
21+
varsIgnorePattern: '^_',
22+
caughtErrorsIgnorePattern: '^_',
23+
},
24+
],
1425
'@nx/enforce-module-boundaries': [
1526
'error',
1627
{
1728
enforceBuildableLibDependency: true,
18-
allow: ['^.*/eslint(\\.base)?\\.config\\.[cm]?[jt]s$'],
29+
allow: ['^.*/eslint(\\.base)?\\.config\\.[cm]?[jt]s$', '@frontmcp/sdk'],
1930
depConstraints: [
2031
{
2132
sourceTag: '*',
@@ -40,4 +51,14 @@ export default [
4051
'@typescript-eslint/no-unsafe-function-type': 'off',
4152
},
4253
},
54+
{
55+
// Relax rules for test files
56+
files: ['**/*.test.ts', '**/*.spec.ts', '**/__tests__/**/*.ts', '**/__test-utils__/**/*.ts', '**/fixtures/**/*.ts', '**/mocks/**/*.ts', '**/*.mock.ts'],
57+
rules: {
58+
'@typescript-eslint/no-empty-function': 'off',
59+
'@typescript-eslint/no-explicit-any': 'off',
60+
'@typescript-eslint/no-unused-vars': 'off',
61+
'no-unused-private-class-members': 'off',
62+
},
63+
},
4364
];

libs/adapters/src/openapi/openapi.utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ export function buildRequest(
137137
const headerValue = coerceToString(value, mapper.key, 'header');
138138
// Validate header values for injection attacks
139139
// Check for: CR, LF, null byte, form feed, vertical tab
140+
// eslint-disable-next-line no-control-regex
140141
if (/[\r\n\x00\f\v]/.test(headerValue)) {
141142
throw new Error(
142143
`Invalid header value for '${mapper.key}': contains control characters (possible header injection attack)`,

0 commit comments

Comments
 (0)