diff --git a/packages/tools/create-basic-tools/CHANGELOG.md b/packages/tools/create-basic-tools/CHANGELOG.md index e1b8d61..b45f099 100644 --- a/packages/tools/create-basic-tools/CHANGELOG.md +++ b/packages/tools/create-basic-tools/CHANGELOG.md @@ -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 diff --git a/packages/tools/create-basic-tools/package.json b/packages/tools/create-basic-tools/package.json index 57e2f91..579c4e4 100644 --- a/packages/tools/create-basic-tools/package.json +++ b/packages/tools/create-basic-tools/package.json @@ -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": { diff --git a/packages/tools/create-basic-tools/src/utils/file-writer.ts b/packages/tools/create-basic-tools/src/utils/file-writer.ts index f85a8da..57aec05 100644 --- a/packages/tools/create-basic-tools/src/utils/file-writer.ts +++ b/packages/tools/create-basic-tools/src/utils/file-writer.ts @@ -27,7 +27,9 @@ export async function copyTemplate( destPath: string, replacements?: Record ): Promise { - 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