Skip to content

Commit f64ec14

Browse files
committed
fix(tests): Address skipped/failing tests for copyItems and searchFiles
1 parent 128cc5e commit f64ec14

Some content is hidden

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

54 files changed

+14323
-3675
lines changed

.eslintcache

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ issuehunt: # Replace with a single IssueHunt username
1111
otechie: # Replace with a single Otechie username
1212
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
1313
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
14-
buy_me_a_coffee: shtse8
14+
buy_me_a_coffee: shtse8

.github/dependabot.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# .github/dependabot.yml
2+
version: 2
3+
updates:
4+
# Dependency updates for npm
5+
- package-ecosystem: 'npm'
6+
directory: '/' # Location of package manifests
7+
schedule:
8+
interval: 'weekly' # Check for updates weekly
9+
open-pull-requests-limit: 10 # Limit open PRs
10+
versioning-strategy: 'auto' # Use default strategy
11+
commit-message:
12+
prefix: 'chore' # Use 'chore' for dependency updates
13+
prefix-development: 'chore(dev)' # Use 'chore(dev)' for devDependencies
14+
include: 'scope'
15+
rebase-strategy: 'auto' # Automatically rebase PRs
16+
17+
# GitHub Actions updates
18+
- package-ecosystem: 'github-actions'
19+
directory: '/' # Location of workflow files
20+
schedule:
21+
interval: 'weekly' # Check for updates weekly
22+
open-pull-requests-limit: 5 # Limit open PRs for actions
23+
commit-message:
24+
prefix: 'chore(ci)' # Use 'chore(ci)' for action updates
25+
include: 'scope'
26+
rebase-strategy: 'auto'

.github/workflows/publish.yml

Lines changed: 82 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,68 @@ on:
66
- main # Trigger on push to main branch
77
tags:
88
- 'v*.*.*' # Trigger on push of version tags (e.g., v0.5.5)
9+
pull_request: # Added PR trigger
10+
branches:
11+
- main
12+
13+
# Prevent concurrent runs for the same PR or branch
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
917

1018
jobs:
19+
validate: # New validation job
20+
name: Validate Code
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v4.1.7 # Specific version
25+
26+
- name: Set up Node.js
27+
uses: actions/setup-node@v4.0.3 # Specific version
28+
with:
29+
node-version: '20'
30+
cache: 'npm' # Added caching
31+
32+
- name: Install dependencies
33+
run: npm ci
34+
35+
- name: Check formatting
36+
run: npm run check-format
37+
38+
- name: Lint code
39+
run: npm run lint
40+
41+
- name: Perform type checking
42+
run: npm run typecheck
43+
44+
- name: Run tests with coverage
45+
run: npm run test:cov
46+
47+
- name: Upload coverage to Coveralls
48+
uses: coverallsapp/github-action@v2.3.0 # Specific version
49+
with:
50+
github-token: ${{ secrets.GITHUB_TOKEN }}
51+
path-to-lcov: ./coverage/lcov.info # Verify path exists after test:cov
52+
flag-name: run-${{ matrix.node-version || 'node-20' }} # Use matrix or default
53+
parallel: false # Set to true if using parallel matrix later
54+
1155
build:
56+
needs: validate # Depends on validation passing
1257
runs-on: ubuntu-latest
1358
outputs:
1459
version: ${{ steps.get_version.outputs.version }}
1560
artifact_name: build-artifacts-archive # Consistent name for upload/download
1661
archive_filename: ${{ steps.archive_build.outputs.archive_name }} # Actual .tar.gz filename
1762
steps:
1863
- name: Checkout repository
19-
uses: actions/checkout@v4
64+
uses: actions/checkout@v4.1.7 # Specific version
2065

2166
- name: Set up Node.js
22-
uses: actions/setup-node@v4
67+
uses: actions/setup-node@v4.0.3 # Specific version
2368
with:
2469
node-version: '20'
70+
cache: 'npm' # Added caching
2571

2672
- name: Install dependencies
2773
run: npm ci
@@ -31,7 +77,6 @@ jobs:
3177

3278
- name: Get package version
3379
id: get_version
34-
# Use tag name if available, otherwise use package.json version
3580
run: |
3681
VERSION=""
3782
if [[ "${{ github.ref_type }}" == "tag" && "${{ github.ref }}" == refs/tags/v* ]]; then
@@ -46,23 +91,27 @@ jobs:
4691
if: startsWith(github.ref, 'refs/tags/v') # Condition: Only run for tags
4792
id: archive_build
4893
run: |
49-
tar -czf build-artifacts.tar.gz build package.json package-lock.json README.md CHANGELOG.md Dockerfile .dockerignore
94+
# Ensure scripts directory is included if postbuild.js is needed
95+
tar -czf build-artifacts.tar.gz build package.json package-lock.json README.md CHANGELOG.md LICENSE Dockerfile .dockerignore scripts/postbuild.js
5096
echo "archive_name=build-artifacts.tar.gz" >> $GITHUB_OUTPUT
5197
5298
- name: Upload build artifacts (only on tag push)
5399
if: startsWith(github.ref, 'refs/tags/v') # Condition: Only run for tags
54-
uses: actions/upload-artifact@v4
100+
uses: actions/upload-artifact@v4.3.4 # Specific version
55101
with:
56102
name: build-artifacts-archive # Use consistent name
57103
path: ${{ steps.archive_build.outputs.archive_name }}
58104

59105
publish-npm:
60-
needs: build
106+
needs: [validate, build] # Depends on validate and build
61107
runs-on: ubuntu-latest
62108
if: startsWith(github.ref, 'refs/tags/v') # Condition: Only run for tags
109+
permissions: # Added permissions for trusted publishing (recommended)
110+
contents: read
111+
id-token: write
63112
steps:
64113
- name: Download build artifacts archive
65-
uses: actions/download-artifact@v4
114+
uses: actions/download-artifact@v4.1.8 # Specific version
66115
with:
67116
name: ${{ needs.build.outputs.artifact_name }} # Use consistent artifact name
68117
path: .
@@ -71,23 +120,31 @@ jobs:
71120
run: tar -xzf build-artifacts.tar.gz # Use the correct archive filename
72121

73122
- name: Set up Node.js for npm publish
74-
uses: actions/setup-node@v4
123+
uses: actions/setup-node@v4.0.3 # Specific version
75124
with:
76125
node-version: '20'
77126
registry-url: 'https://registry.npmjs.org/'
127+
cache: 'npm' # Added caching
128+
129+
# Install only production dependencies before publishing (optional but good practice)
130+
# - name: Install production dependencies
131+
# run: npm ci --omit=dev
78132

79-
- name: Publish to npm
80-
run: npm publish --access public
133+
- name: Publish to npm with provenance
134+
run: npm publish --access public --provenance # Added provenance
81135
env:
82-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
136+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # Still needed for non-provenance or fallback
83137

84138
publish-docker:
85-
needs: build
139+
needs: [validate, build] # Depends on validate and build
86140
runs-on: ubuntu-latest
87141
if: startsWith(github.ref, 'refs/tags/v') # Condition: Only run for tags
142+
permissions: # Added permissions for docker login
143+
contents: read
144+
packages: write
88145
steps:
89146
- name: Download build artifacts archive
90-
uses: actions/download-artifact@v4
147+
uses: actions/download-artifact@v4.1.8 # Specific version
91148
with:
92149
name: ${{ needs.build.outputs.artifact_name }} # Use consistent artifact name
93150
path: .
@@ -102,31 +159,30 @@ jobs:
102159
run: ls -la
103160

104161
- name: Set up QEMU
105-
uses: docker/setup-qemu-action@v3
162+
uses: docker/setup-qemu-action@v3.2.0 # Specific version
106163

107164
- name: Set up Docker Buildx
108-
uses: docker/setup-buildx-action@v3
165+
uses: docker/setup-buildx-action@v3.5.0 # Specific version
109166

110167
- name: Log in to Docker Hub
111-
uses: docker/login-action@v3
168+
uses: docker/login-action@v3.2.0 # Specific version
112169
with:
113170
username: ${{ secrets.DOCKERHUB_USERNAME }}
114171
password: ${{ secrets.DOCKERHUB_TOKEN }}
115172

116173
- name: Extract metadata (tags, labels) for Docker
117174
id: meta
118-
uses: docker/metadata-action@v5
175+
uses: docker/metadata-action@v5.5.1 # Specific version
119176
with:
120177
images: sylphlab/filesystem-mcp
121-
# Use version from the build job output (which is derived from the tag)
122178
tags: |
123179
type=semver,pattern={{version}},value=${{ needs.build.outputs.version }}
124180
type=semver,pattern={{major}}.{{minor}},value=${{ needs.build.outputs.version }}
125181
type=sha,prefix=,suffix=,event=tag
126-
type=raw,value=latest
182+
type=raw,value=latest,enable=${{ github.ref_type == 'tag' }} # Only tag latest on actual tag pushes
127183
128184
- name: Build and push Docker image
129-
uses: docker/build-push-action@v6
185+
uses: docker/build-push-action@v6.5.0 # Specific version
130186
with:
131187
context: .
132188
push: true
@@ -136,15 +192,14 @@ jobs:
136192
cache-to: type=gha,mode=max
137193

138194
create-release:
139-
needs: [build, publish-npm, publish-docker] # Depend on build and both publish jobs
195+
needs: [validate, build, publish-npm, publish-docker] # Depend on validate, build and both publish jobs
140196
runs-on: ubuntu-latest
141197
if: startsWith(github.ref, 'refs/tags/v') # Condition: Only run for tags
142198
permissions:
143-
contents: write
199+
contents: write # Keep write permission
144200
steps:
145-
# No need to checkout repo again if CHANGELOG is in artifact
146201
- name: Download build artifacts archive
147-
uses: actions/download-artifact@v4
202+
uses: actions/download-artifact@v4.1.8 # Specific version
148203
with:
149204
name: ${{ needs.build.outputs.artifact_name }} # Use consistent artifact name
150205
path: .
@@ -153,11 +208,11 @@ jobs:
153208
run: tar -xzf build-artifacts.tar.gz # Use the correct archive filename
154209

155210
- name: Create GitHub Release
156-
uses: softprops/action-gh-release@v2
211+
uses: softprops/action-gh-release@v2.0.6 # Specific version
157212
with:
158213
tag_name: ${{ github.ref_name }}
159214
name: Release ${{ github.ref_name }}
160215
body_path: CHANGELOG.md # Assumes CHANGELOG.md is in the artifact
161-
# files: ${{ needs.build.outputs.archive_filename }} # Attach the actual archive file
216+
# files: ${{ needs.build.outputs.archive_filename }} # Optionally attach the archive
162217
env:
163-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
218+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,27 @@
11
node_modules/
22
build/
33
*.log
4-
.env*
4+
.env*
5+
6+
# Test Coverage
7+
coverage/
8+
9+
# Build output
10+
dist/
11+
12+
# IDE files
13+
.vscode/
14+
.idea/
15+
16+
# OS generated files
17+
.DS_Store
18+
Thumbs.db
19+
20+
# NPM debug logs
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*
24+
25+
# VitePress cache
26+
.vitepress/cache
27+
.vitepress/dist

.prettierrc.cjs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// .prettierrc.cjs
2+
module.exports = {
3+
semi: true,
4+
trailingComma: 'all',
5+
singleQuote: true,
6+
printWidth: 80,
7+
tabWidth: 2,
8+
endOfLine: 'lf',
9+
arrowParens: 'always',
10+
};

CHANGELOG.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,56 +8,61 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
## [0.5.9] - 2025-06-04
99

1010
### Changed
11+
1112
- Updated project ownership to `sylphlab`.
1213
- Updated package name to `@sylphlab/filesystem-mcp`.
1314
- Updated `README.md`, `LICENSE`, and GitHub Actions workflow (`publish.yml`) to reflect new ownership and package name.
1415

15-
1616
## [0.5.8] - 2025-04-05
1717

1818
### Fixed
19-
- Removed `build` directory exclusion from `.dockerignore` to fix Docker build context error where `COPY build ./build` failed.
2019

20+
- Removed `build` directory exclusion from `.dockerignore` to fix Docker build context error where `COPY build ./build` failed.
2121

2222
## [0.5.7] - 2025-04-05
2323

2424
### Fixed
25-
- Corrected artifact archiving in CI/CD workflow (`.github/workflows/publish.yml`) to include the `build` directory itself, resolving Docker build context errors (5f5c7c4).
2625

26+
- Corrected artifact archiving in CI/CD workflow (`.github/workflows/publish.yml`) to include the `build` directory itself, resolving Docker build context errors (5f5c7c4).
2727

2828
## [0.5.6] - 2025-05-04
2929

3030
### Fixed
31+
3132
- Corrected CI/CD artifact handling (`package-lock.json` inclusion, extraction paths) in `publish.yml` to ensure successful npm and Docker publishing (4372afa).
3233
- Simplified CI/CD structure back to a single workflow (`publish.yml`) with conditional artifact upload, removing `ci.yml` and `build-reusable.yml` (38029ca).
3334

3435
### Changed
35-
- Bumped version to 0.5.6 due to previous failed release attempt of 0.5.5.
3636

37+
- Bumped version to 0.5.6 due to previous failed release attempt of 0.5.5.
3738

3839
## [0.5.5] - 2025-05-04
3940

4041
### Changed
41-
- Refined GitHub Actions workflow (`publish.yml`) triggers: publishing jobs (`publish-npm`, `publish-docker`, `create-release`) now run *only* on version tag pushes (`v*.*.*`), not on pushes to `main` (9c0df99).
42+
43+
- Refined GitHub Actions workflow (`publish.yml`) triggers: publishing jobs (`publish-npm`, `publish-docker`, `create-release`) now run _only_ on version tag pushes (`v*.*.*`), not on pushes to `main` (9c0df99).
4244

4345
### Fixed
44-
- Corrected artifact extraction path in the `publish-docker` CI/CD job to resolve "Dockerfile not found" error (708d3f5).
4546

47+
- Corrected artifact extraction path in the `publish-docker` CI/CD job to resolve "Dockerfile not found" error (708d3f5).
4648

4749
## [0.5.3] - 2025-05-04
4850

4951
### Added
52+
5053
- Enhanced path error reporting in `resolvePath` to include original path, resolved path, and project root for better debugging context (3810f14).
5154
- Created `.clinerules` file to document project-specific patterns and preferences, starting with tool usage recommendations (3810f14).
5255
- Enhanced `ENOENT` (File not found) error reporting in `readContent` handler to include resolved path, relative path, and project root (8b82e1c).
5356

5457
### Changed
58+
5559
- Updated `write_content` tool description to recommend using edit tools (`edit_file`, `replace_content`) for modifications (5521102).
5660
- Updated `edit_file` tool description to reinforce its recommendation for modifications (5e44ef2).
5761
- Refactored GitHub Actions workflow (`publish.yml`) to parallelize npm and Docker publishing using separate jobs dependent on a shared build job, improving release speed (3b51c2b).
5862
- Bumped version to 0.5.3.
5963

6064
### Fixed
65+
6166
- Corrected TypeScript errors in `readContent.ts` related to variable scope and imports during error reporting enhancement (8b82e1c).
6267

63-
<!-- Previous versions can be added below -->
68+
<!-- Previous versions can be added below -->

0 commit comments

Comments
 (0)