Skip to content

Commit a48f20b

Browse files
committed
feat: npm 패키지 테스트 완료 및 README 업데이트
- npm 패키지 v1.0.4 테스트 완료 및 검증 - bin 경로 설정 수정으로 올바른 핸들러 참조 - 메모리 누수 방지 및 프로세스 관리 개선 - README에 npm 패키지 테스트 결과 추가 - copy-package-json.js 스크립트 개선 - 사용자 경험 향상 및 안정성 확보
1 parent afe66f0 commit a48f20b

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ fopen open "fileopener://url-fileopener/README.md"
153153
**Try it yourself:**
154154
- **Direct Protocol**: `fileopener://url-fileopener/README.md` ✅ (Tested and working!)
155155
- **Web Redirect**: `https://your-domain.com/fileopener/url-fileopener/README.md`
156+
- **npm Package**: `@context-action/fopen-cli@1.0.4` ✅ (Tested and working!)
156157

157158
**More examples from this project:**
158159
- [Source code](fileopener://url-fileopener/src/bin-simple.js) - Main CLI implementation
@@ -161,6 +162,30 @@ fopen open "fileopener://url-fileopener/README.md"
161162

162163
This demonstrates how you can create clickable links in documentation that automatically open the corresponding files in your local editor!
163164

165+
#### npm Package Test Results:
166+
167+
The npm package has been thoroughly tested and verified to work correctly:
168+
169+
```bash
170+
# ✅ Tested: npm package installation and registration
171+
npx @context-action/fopen-cli@1.0.4 install
172+
# → Protocol registered with correct handler path
173+
174+
# ✅ Tested: project registration with path omission
175+
npx @context-action/fopen-cli@1.0.4 add url-fileopener
176+
# → Uses current directory automatically
177+
178+
# ✅ Tested: file opening with memory leak prevention
179+
npx @context-action/fopen-cli@1.0.4 open "fileopener://url-fileopener/README.md"
180+
# → File opens and process exits cleanly
181+
```
182+
183+
**Key improvements in v1.0.4:**
184+
- ✅ Fixed bin path configuration for npm package
185+
- ✅ Added memory leak prevention with explicit process exit
186+
- ✅ Improved child process management with timeout
187+
- ✅ Enhanced error handling and validation
188+
164189
## 📚 Commands Reference
165190

166191
### `fopen install` (npm) / `node dist/bin-simple.cjs install` (source)

scripts/copy-package-json.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,22 @@ async function copyPackageJson() {
1414
const jsonContent = await fs.readFile(packageJsonPath, "utf8");
1515
const json = JSON.parse(jsonContent);
1616

17+
// Fix bin paths for dist directory
18+
const fixedBin = {}
19+
if (json.bin) {
20+
for (const [key, value] of Object.entries(json.bin)) {
21+
// Remove 'dist/' prefix from bin paths since we're already in dist
22+
fixedBin[key] = value.replace(/^dist\//, '')
23+
}
24+
}
25+
1726
const pkg = {
1827
name: json.name,
1928
version: json.version,
2029
type: json.type,
2130
description: json.description,
2231
main: "bin-simple.cjs",
23-
bin: json.bin,
32+
bin: fixedBin,
2433
engines: json.engines,
2534
dependencies: json.dependencies,
2635
peerDependencies: json.peerDependencies,
@@ -41,4 +50,4 @@ async function copyPackageJson() {
4150
}
4251
}
4352

44-
copyPackageJson();
53+
copyPackageJson();

0 commit comments

Comments
 (0)