fix(create-basic-tools): correct template path resolution for npx execution

Version @tpmjs/create-basic-tools@1.0.6

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Ajax Davis 2025-12-05 09:06:52 +10:00
parent 79547ff52e
commit 96c53ed49a
3 changed files with 12 additions and 2 deletions

View file

@ -1,5 +1,13 @@
# @tpmjs/create-basic-tools
## 1.0.6
### Patch Changes
- fix: correct template path resolution for npx execution
Fixed template path resolution from `../../templates` to `../templates` to work correctly when the package is run via npx. After tsup compilation, the bundle is in `dist/` and only needs to go up one level to reach the package root where templates are located.
## 1.0.0
### Major Changes

View file

@ -1,6 +1,6 @@
{
"name": "@tpmjs/create-basic-tools",
"version": "1.0.5",
"version": "1.0.6",
"description": "CLI generator for scaffolding production-ready TPMJS tool packages",
"type": "module",
"bin": {

View file

@ -27,7 +27,9 @@ export async function copyTemplate(
destPath: string,
replacements?: Record<string, string>
): Promise<void> {
const templatePath = path.join(__dirname, '../../templates', templateName);
// After tsup compilation, __dirname points to dist/
// Templates are at package root, so we only need to go up one level
const templatePath = path.join(__dirname, '../templates', templateName);
let content = await fs.readFile(templatePath, 'utf-8');
// Apply replacements if provided