From 8f27fd7a6963820474cb3a383bc17e85039259ca Mon Sep 17 00:00:00 2001 From: Ralph Khreish <35776126+Crunchyman-ralph@users.noreply.github.com> Date: Mon, 1 Sep 2025 21:18:11 +0200 Subject: [PATCH] fix: deployment issues with typescript and dist --- package.json | 10 +-- {assets => public/assets}/.windsurfrules | 0 {assets => public/assets}/AGENTS.md | 0 .../assets}/claude/TM_COMMANDS_GUIDE.md | 0 .../assets}/claude/agents/task-checker.md | 0 .../assets}/claude/agents/task-executor.md | 0 .../claude/agents/task-orchestrator.md | 0 .../tm/add-dependency/add-dependency.md | 0 .../commands/tm/add-subtask/add-subtask.md | 0 .../tm/add-subtask/convert-task-to-subtask.md | 0 .../claude/commands/tm/add-task/add-task.md | 0 .../analyze-complexity/analyze-complexity.md | 0 .../tm/clear-subtasks/clear-all-subtasks.md | 0 .../tm/clear-subtasks/clear-subtasks.md | 0 .../tm/complexity-report/complexity-report.md | 0 .../commands/tm/expand/expand-all-tasks.md | 0 .../claude/commands/tm/expand/expand-task.md | 0 .../tm/fix-dependencies/fix-dependencies.md | 0 .../commands/tm/generate/generate-tasks.md | 0 .../assets}/claude/commands/tm/help.md | 0 .../commands/tm/init/init-project-quick.md | 0 .../claude/commands/tm/init/init-project.md | 0 .../assets}/claude/commands/tm/learn.md | 0 .../commands/tm/list/list-tasks-by-status.md | 0 .../tm/list/list-tasks-with-subtasks.md | 0 .../claude/commands/tm/list/list-tasks.md | 0 .../claude/commands/tm/models/setup-models.md | 0 .../claude/commands/tm/models/view-models.md | 0 .../claude/commands/tm/next/next-task.md | 0 .../tm/parse-prd/parse-prd-with-research.md | 0 .../claude/commands/tm/parse-prd/parse-prd.md | 0 .../tm/remove-dependency/remove-dependency.md | 0 .../tm/remove-subtask/remove-subtask.md | 0 .../commands/tm/remove-task/remove-task.md | 0 .../commands/tm/set-status/to-cancelled.md | 0 .../commands/tm/set-status/to-deferred.md | 0 .../claude/commands/tm/set-status/to-done.md | 0 .../commands/tm/set-status/to-in-progress.md | 0 .../commands/tm/set-status/to-pending.md | 0 .../commands/tm/set-status/to-review.md | 0 .../commands/tm/setup/install-taskmaster.md | 0 .../tm/setup/quick-install-taskmaster.md | 0 .../claude/commands/tm/show/show-task.md | 0 .../commands/tm/status/project-status.md | 0 .../commands/tm/sync-readme/sync-readme.md | 0 .../assets}/claude/commands/tm/tm-main.md | 0 .../commands/tm/update/update-single-task.md | 0 .../claude/commands/tm/update/update-task.md | 0 .../tm/update/update-tasks-from-id.md | 0 .../commands/tm/utils/analyze-project.md | 0 .../validate-dependencies.md | 0 .../tm/workflows/auto-implement-tasks.md | 0 .../commands/tm/workflows/command-pipeline.md | 0 .../commands/tm/workflows/smart-workflow.md | 0 {assets => public/assets}/config.json | 0 {assets => public/assets}/env.example | 0 {assets => public/assets}/example_prd.txt | 0 {assets => public/assets}/gitignore | 0 .../tm-code-change-task-tracker.kiro.hook | 0 .../tm-complexity-analyzer.kiro.hook | 0 .../tm-daily-standup-assistant.kiro.hook | 0 .../tm-git-commit-task-linker.kiro.hook | 0 .../tm-pr-readiness-checker.kiro.hook | 0 ...task-dependency-auto-progression.kiro.hook | 0 .../tm-test-success-task-completer.kiro.hook | 0 .../.roo/rules-architect/architect-rules | 0 .../assets}/roocode/.roo/rules-ask/ask-rules | 0 .../roocode/.roo/rules-code/code-rules | 0 .../roocode/.roo/rules-debug/debug-rules | 0 .../rules-orchestrator/orchestrator-rules | 0 .../roocode/.roo/rules-test/test-rules | 0 {assets => public/assets}/roocode/.roomodes | 0 .../assets}/rules/cursor_rules.mdc | 0 .../assets}/rules/dev_workflow.mdc | 0 .../assets}/rules/self_improve.mdc | 0 .../assets}/rules/taskmaster.mdc | 0 .../rules/taskmaster_hooks_workflow.mdc | 0 {assets => public/assets}/scripts_README.md | 0 scripts/init.js | 33 ++------ src/utils/asset-resolver.js | 84 +++++++++++++++++++ src/utils/rule-transformer.js | 62 ++++++++++---- tsup.config.ts | 1 + 82 files changed, 144 insertions(+), 46 deletions(-) rename {assets => public/assets}/.windsurfrules (100%) rename {assets => public/assets}/AGENTS.md (100%) rename {assets => public/assets}/claude/TM_COMMANDS_GUIDE.md (100%) rename {assets => public/assets}/claude/agents/task-checker.md (100%) rename {assets => public/assets}/claude/agents/task-executor.md (100%) rename {assets => public/assets}/claude/agents/task-orchestrator.md (100%) rename {assets => public/assets}/claude/commands/tm/add-dependency/add-dependency.md (100%) rename {assets => public/assets}/claude/commands/tm/add-subtask/add-subtask.md (100%) rename {assets => public/assets}/claude/commands/tm/add-subtask/convert-task-to-subtask.md (100%) rename {assets => public/assets}/claude/commands/tm/add-task/add-task.md (100%) rename {assets => public/assets}/claude/commands/tm/analyze-complexity/analyze-complexity.md (100%) rename {assets => public/assets}/claude/commands/tm/clear-subtasks/clear-all-subtasks.md (100%) rename {assets => public/assets}/claude/commands/tm/clear-subtasks/clear-subtasks.md (100%) rename {assets => public/assets}/claude/commands/tm/complexity-report/complexity-report.md (100%) rename {assets => public/assets}/claude/commands/tm/expand/expand-all-tasks.md (100%) rename {assets => public/assets}/claude/commands/tm/expand/expand-task.md (100%) rename {assets => public/assets}/claude/commands/tm/fix-dependencies/fix-dependencies.md (100%) rename {assets => public/assets}/claude/commands/tm/generate/generate-tasks.md (100%) rename {assets => public/assets}/claude/commands/tm/help.md (100%) rename {assets => public/assets}/claude/commands/tm/init/init-project-quick.md (100%) rename {assets => public/assets}/claude/commands/tm/init/init-project.md (100%) rename {assets => public/assets}/claude/commands/tm/learn.md (100%) rename {assets => public/assets}/claude/commands/tm/list/list-tasks-by-status.md (100%) rename {assets => public/assets}/claude/commands/tm/list/list-tasks-with-subtasks.md (100%) rename {assets => public/assets}/claude/commands/tm/list/list-tasks.md (100%) rename {assets => public/assets}/claude/commands/tm/models/setup-models.md (100%) rename {assets => public/assets}/claude/commands/tm/models/view-models.md (100%) rename {assets => public/assets}/claude/commands/tm/next/next-task.md (100%) rename {assets => public/assets}/claude/commands/tm/parse-prd/parse-prd-with-research.md (100%) rename {assets => public/assets}/claude/commands/tm/parse-prd/parse-prd.md (100%) rename {assets => public/assets}/claude/commands/tm/remove-dependency/remove-dependency.md (100%) rename {assets => public/assets}/claude/commands/tm/remove-subtask/remove-subtask.md (100%) rename {assets => public/assets}/claude/commands/tm/remove-task/remove-task.md (100%) rename {assets => public/assets}/claude/commands/tm/set-status/to-cancelled.md (100%) rename {assets => public/assets}/claude/commands/tm/set-status/to-deferred.md (100%) rename {assets => public/assets}/claude/commands/tm/set-status/to-done.md (100%) rename {assets => public/assets}/claude/commands/tm/set-status/to-in-progress.md (100%) rename {assets => public/assets}/claude/commands/tm/set-status/to-pending.md (100%) rename {assets => public/assets}/claude/commands/tm/set-status/to-review.md (100%) rename {assets => public/assets}/claude/commands/tm/setup/install-taskmaster.md (100%) rename {assets => public/assets}/claude/commands/tm/setup/quick-install-taskmaster.md (100%) rename {assets => public/assets}/claude/commands/tm/show/show-task.md (100%) rename {assets => public/assets}/claude/commands/tm/status/project-status.md (100%) rename {assets => public/assets}/claude/commands/tm/sync-readme/sync-readme.md (100%) rename {assets => public/assets}/claude/commands/tm/tm-main.md (100%) rename {assets => public/assets}/claude/commands/tm/update/update-single-task.md (100%) rename {assets => public/assets}/claude/commands/tm/update/update-task.md (100%) rename {assets => public/assets}/claude/commands/tm/update/update-tasks-from-id.md (100%) rename {assets => public/assets}/claude/commands/tm/utils/analyze-project.md (100%) rename {assets => public/assets}/claude/commands/tm/validate-dependencies/validate-dependencies.md (100%) rename {assets => public/assets}/claude/commands/tm/workflows/auto-implement-tasks.md (100%) rename {assets => public/assets}/claude/commands/tm/workflows/command-pipeline.md (100%) rename {assets => public/assets}/claude/commands/tm/workflows/smart-workflow.md (100%) rename {assets => public/assets}/config.json (100%) rename {assets => public/assets}/env.example (100%) rename {assets => public/assets}/example_prd.txt (100%) rename {assets => public/assets}/gitignore (100%) rename {assets => public/assets}/kiro-hooks/tm-code-change-task-tracker.kiro.hook (100%) rename {assets => public/assets}/kiro-hooks/tm-complexity-analyzer.kiro.hook (100%) rename {assets => public/assets}/kiro-hooks/tm-daily-standup-assistant.kiro.hook (100%) rename {assets => public/assets}/kiro-hooks/tm-git-commit-task-linker.kiro.hook (100%) rename {assets => public/assets}/kiro-hooks/tm-pr-readiness-checker.kiro.hook (100%) rename {assets => public/assets}/kiro-hooks/tm-task-dependency-auto-progression.kiro.hook (100%) rename {assets => public/assets}/kiro-hooks/tm-test-success-task-completer.kiro.hook (100%) rename {assets => public/assets}/roocode/.roo/rules-architect/architect-rules (100%) rename {assets => public/assets}/roocode/.roo/rules-ask/ask-rules (100%) rename {assets => public/assets}/roocode/.roo/rules-code/code-rules (100%) rename {assets => public/assets}/roocode/.roo/rules-debug/debug-rules (100%) rename {assets => public/assets}/roocode/.roo/rules-orchestrator/orchestrator-rules (100%) rename {assets => public/assets}/roocode/.roo/rules-test/test-rules (100%) rename {assets => public/assets}/roocode/.roomodes (100%) rename {assets => public/assets}/rules/cursor_rules.mdc (100%) rename {assets => public/assets}/rules/dev_workflow.mdc (100%) rename {assets => public/assets}/rules/self_improve.mdc (100%) rename {assets => public/assets}/rules/taskmaster.mdc (100%) rename {assets => public/assets}/rules/taskmaster_hooks_workflow.mdc (100%) rename {assets => public/assets}/scripts_README.md (100%) create mode 100644 src/utils/asset-resolver.js diff --git a/package.json b/package.json index 151ed6ae..b8324096 100644 --- a/package.json +++ b/package.json @@ -110,14 +110,10 @@ "url": "https://github.com/eyaltoledano/claude-task-master/issues" }, "files": [ - "scripts/**", - "assets/**", - ".cursor/**", + "dist/**", "README-task-master.md", - "index.js", - "bin/**", - "mcp-server/**", - "src/**" + "README.md", + "LICENSE" ], "overrides": { "node-fetch": "^2.6.12", diff --git a/assets/.windsurfrules b/public/assets/.windsurfrules similarity index 100% rename from assets/.windsurfrules rename to public/assets/.windsurfrules diff --git a/assets/AGENTS.md b/public/assets/AGENTS.md similarity index 100% rename from assets/AGENTS.md rename to public/assets/AGENTS.md diff --git a/assets/claude/TM_COMMANDS_GUIDE.md b/public/assets/claude/TM_COMMANDS_GUIDE.md similarity index 100% rename from assets/claude/TM_COMMANDS_GUIDE.md rename to public/assets/claude/TM_COMMANDS_GUIDE.md diff --git a/assets/claude/agents/task-checker.md b/public/assets/claude/agents/task-checker.md similarity index 100% rename from assets/claude/agents/task-checker.md rename to public/assets/claude/agents/task-checker.md diff --git a/assets/claude/agents/task-executor.md b/public/assets/claude/agents/task-executor.md similarity index 100% rename from assets/claude/agents/task-executor.md rename to public/assets/claude/agents/task-executor.md diff --git a/assets/claude/agents/task-orchestrator.md b/public/assets/claude/agents/task-orchestrator.md similarity index 100% rename from assets/claude/agents/task-orchestrator.md rename to public/assets/claude/agents/task-orchestrator.md diff --git a/assets/claude/commands/tm/add-dependency/add-dependency.md b/public/assets/claude/commands/tm/add-dependency/add-dependency.md similarity index 100% rename from assets/claude/commands/tm/add-dependency/add-dependency.md rename to public/assets/claude/commands/tm/add-dependency/add-dependency.md diff --git a/assets/claude/commands/tm/add-subtask/add-subtask.md b/public/assets/claude/commands/tm/add-subtask/add-subtask.md similarity index 100% rename from assets/claude/commands/tm/add-subtask/add-subtask.md rename to public/assets/claude/commands/tm/add-subtask/add-subtask.md diff --git a/assets/claude/commands/tm/add-subtask/convert-task-to-subtask.md b/public/assets/claude/commands/tm/add-subtask/convert-task-to-subtask.md similarity index 100% rename from assets/claude/commands/tm/add-subtask/convert-task-to-subtask.md rename to public/assets/claude/commands/tm/add-subtask/convert-task-to-subtask.md diff --git a/assets/claude/commands/tm/add-task/add-task.md b/public/assets/claude/commands/tm/add-task/add-task.md similarity index 100% rename from assets/claude/commands/tm/add-task/add-task.md rename to public/assets/claude/commands/tm/add-task/add-task.md diff --git a/assets/claude/commands/tm/analyze-complexity/analyze-complexity.md b/public/assets/claude/commands/tm/analyze-complexity/analyze-complexity.md similarity index 100% rename from assets/claude/commands/tm/analyze-complexity/analyze-complexity.md rename to public/assets/claude/commands/tm/analyze-complexity/analyze-complexity.md diff --git a/assets/claude/commands/tm/clear-subtasks/clear-all-subtasks.md b/public/assets/claude/commands/tm/clear-subtasks/clear-all-subtasks.md similarity index 100% rename from assets/claude/commands/tm/clear-subtasks/clear-all-subtasks.md rename to public/assets/claude/commands/tm/clear-subtasks/clear-all-subtasks.md diff --git a/assets/claude/commands/tm/clear-subtasks/clear-subtasks.md b/public/assets/claude/commands/tm/clear-subtasks/clear-subtasks.md similarity index 100% rename from assets/claude/commands/tm/clear-subtasks/clear-subtasks.md rename to public/assets/claude/commands/tm/clear-subtasks/clear-subtasks.md diff --git a/assets/claude/commands/tm/complexity-report/complexity-report.md b/public/assets/claude/commands/tm/complexity-report/complexity-report.md similarity index 100% rename from assets/claude/commands/tm/complexity-report/complexity-report.md rename to public/assets/claude/commands/tm/complexity-report/complexity-report.md diff --git a/assets/claude/commands/tm/expand/expand-all-tasks.md b/public/assets/claude/commands/tm/expand/expand-all-tasks.md similarity index 100% rename from assets/claude/commands/tm/expand/expand-all-tasks.md rename to public/assets/claude/commands/tm/expand/expand-all-tasks.md diff --git a/assets/claude/commands/tm/expand/expand-task.md b/public/assets/claude/commands/tm/expand/expand-task.md similarity index 100% rename from assets/claude/commands/tm/expand/expand-task.md rename to public/assets/claude/commands/tm/expand/expand-task.md diff --git a/assets/claude/commands/tm/fix-dependencies/fix-dependencies.md b/public/assets/claude/commands/tm/fix-dependencies/fix-dependencies.md similarity index 100% rename from assets/claude/commands/tm/fix-dependencies/fix-dependencies.md rename to public/assets/claude/commands/tm/fix-dependencies/fix-dependencies.md diff --git a/assets/claude/commands/tm/generate/generate-tasks.md b/public/assets/claude/commands/tm/generate/generate-tasks.md similarity index 100% rename from assets/claude/commands/tm/generate/generate-tasks.md rename to public/assets/claude/commands/tm/generate/generate-tasks.md diff --git a/assets/claude/commands/tm/help.md b/public/assets/claude/commands/tm/help.md similarity index 100% rename from assets/claude/commands/tm/help.md rename to public/assets/claude/commands/tm/help.md diff --git a/assets/claude/commands/tm/init/init-project-quick.md b/public/assets/claude/commands/tm/init/init-project-quick.md similarity index 100% rename from assets/claude/commands/tm/init/init-project-quick.md rename to public/assets/claude/commands/tm/init/init-project-quick.md diff --git a/assets/claude/commands/tm/init/init-project.md b/public/assets/claude/commands/tm/init/init-project.md similarity index 100% rename from assets/claude/commands/tm/init/init-project.md rename to public/assets/claude/commands/tm/init/init-project.md diff --git a/assets/claude/commands/tm/learn.md b/public/assets/claude/commands/tm/learn.md similarity index 100% rename from assets/claude/commands/tm/learn.md rename to public/assets/claude/commands/tm/learn.md diff --git a/assets/claude/commands/tm/list/list-tasks-by-status.md b/public/assets/claude/commands/tm/list/list-tasks-by-status.md similarity index 100% rename from assets/claude/commands/tm/list/list-tasks-by-status.md rename to public/assets/claude/commands/tm/list/list-tasks-by-status.md diff --git a/assets/claude/commands/tm/list/list-tasks-with-subtasks.md b/public/assets/claude/commands/tm/list/list-tasks-with-subtasks.md similarity index 100% rename from assets/claude/commands/tm/list/list-tasks-with-subtasks.md rename to public/assets/claude/commands/tm/list/list-tasks-with-subtasks.md diff --git a/assets/claude/commands/tm/list/list-tasks.md b/public/assets/claude/commands/tm/list/list-tasks.md similarity index 100% rename from assets/claude/commands/tm/list/list-tasks.md rename to public/assets/claude/commands/tm/list/list-tasks.md diff --git a/assets/claude/commands/tm/models/setup-models.md b/public/assets/claude/commands/tm/models/setup-models.md similarity index 100% rename from assets/claude/commands/tm/models/setup-models.md rename to public/assets/claude/commands/tm/models/setup-models.md diff --git a/assets/claude/commands/tm/models/view-models.md b/public/assets/claude/commands/tm/models/view-models.md similarity index 100% rename from assets/claude/commands/tm/models/view-models.md rename to public/assets/claude/commands/tm/models/view-models.md diff --git a/assets/claude/commands/tm/next/next-task.md b/public/assets/claude/commands/tm/next/next-task.md similarity index 100% rename from assets/claude/commands/tm/next/next-task.md rename to public/assets/claude/commands/tm/next/next-task.md diff --git a/assets/claude/commands/tm/parse-prd/parse-prd-with-research.md b/public/assets/claude/commands/tm/parse-prd/parse-prd-with-research.md similarity index 100% rename from assets/claude/commands/tm/parse-prd/parse-prd-with-research.md rename to public/assets/claude/commands/tm/parse-prd/parse-prd-with-research.md diff --git a/assets/claude/commands/tm/parse-prd/parse-prd.md b/public/assets/claude/commands/tm/parse-prd/parse-prd.md similarity index 100% rename from assets/claude/commands/tm/parse-prd/parse-prd.md rename to public/assets/claude/commands/tm/parse-prd/parse-prd.md diff --git a/assets/claude/commands/tm/remove-dependency/remove-dependency.md b/public/assets/claude/commands/tm/remove-dependency/remove-dependency.md similarity index 100% rename from assets/claude/commands/tm/remove-dependency/remove-dependency.md rename to public/assets/claude/commands/tm/remove-dependency/remove-dependency.md diff --git a/assets/claude/commands/tm/remove-subtask/remove-subtask.md b/public/assets/claude/commands/tm/remove-subtask/remove-subtask.md similarity index 100% rename from assets/claude/commands/tm/remove-subtask/remove-subtask.md rename to public/assets/claude/commands/tm/remove-subtask/remove-subtask.md diff --git a/assets/claude/commands/tm/remove-task/remove-task.md b/public/assets/claude/commands/tm/remove-task/remove-task.md similarity index 100% rename from assets/claude/commands/tm/remove-task/remove-task.md rename to public/assets/claude/commands/tm/remove-task/remove-task.md diff --git a/assets/claude/commands/tm/set-status/to-cancelled.md b/public/assets/claude/commands/tm/set-status/to-cancelled.md similarity index 100% rename from assets/claude/commands/tm/set-status/to-cancelled.md rename to public/assets/claude/commands/tm/set-status/to-cancelled.md diff --git a/assets/claude/commands/tm/set-status/to-deferred.md b/public/assets/claude/commands/tm/set-status/to-deferred.md similarity index 100% rename from assets/claude/commands/tm/set-status/to-deferred.md rename to public/assets/claude/commands/tm/set-status/to-deferred.md diff --git a/assets/claude/commands/tm/set-status/to-done.md b/public/assets/claude/commands/tm/set-status/to-done.md similarity index 100% rename from assets/claude/commands/tm/set-status/to-done.md rename to public/assets/claude/commands/tm/set-status/to-done.md diff --git a/assets/claude/commands/tm/set-status/to-in-progress.md b/public/assets/claude/commands/tm/set-status/to-in-progress.md similarity index 100% rename from assets/claude/commands/tm/set-status/to-in-progress.md rename to public/assets/claude/commands/tm/set-status/to-in-progress.md diff --git a/assets/claude/commands/tm/set-status/to-pending.md b/public/assets/claude/commands/tm/set-status/to-pending.md similarity index 100% rename from assets/claude/commands/tm/set-status/to-pending.md rename to public/assets/claude/commands/tm/set-status/to-pending.md diff --git a/assets/claude/commands/tm/set-status/to-review.md b/public/assets/claude/commands/tm/set-status/to-review.md similarity index 100% rename from assets/claude/commands/tm/set-status/to-review.md rename to public/assets/claude/commands/tm/set-status/to-review.md diff --git a/assets/claude/commands/tm/setup/install-taskmaster.md b/public/assets/claude/commands/tm/setup/install-taskmaster.md similarity index 100% rename from assets/claude/commands/tm/setup/install-taskmaster.md rename to public/assets/claude/commands/tm/setup/install-taskmaster.md diff --git a/assets/claude/commands/tm/setup/quick-install-taskmaster.md b/public/assets/claude/commands/tm/setup/quick-install-taskmaster.md similarity index 100% rename from assets/claude/commands/tm/setup/quick-install-taskmaster.md rename to public/assets/claude/commands/tm/setup/quick-install-taskmaster.md diff --git a/assets/claude/commands/tm/show/show-task.md b/public/assets/claude/commands/tm/show/show-task.md similarity index 100% rename from assets/claude/commands/tm/show/show-task.md rename to public/assets/claude/commands/tm/show/show-task.md diff --git a/assets/claude/commands/tm/status/project-status.md b/public/assets/claude/commands/tm/status/project-status.md similarity index 100% rename from assets/claude/commands/tm/status/project-status.md rename to public/assets/claude/commands/tm/status/project-status.md diff --git a/assets/claude/commands/tm/sync-readme/sync-readme.md b/public/assets/claude/commands/tm/sync-readme/sync-readme.md similarity index 100% rename from assets/claude/commands/tm/sync-readme/sync-readme.md rename to public/assets/claude/commands/tm/sync-readme/sync-readme.md diff --git a/assets/claude/commands/tm/tm-main.md b/public/assets/claude/commands/tm/tm-main.md similarity index 100% rename from assets/claude/commands/tm/tm-main.md rename to public/assets/claude/commands/tm/tm-main.md diff --git a/assets/claude/commands/tm/update/update-single-task.md b/public/assets/claude/commands/tm/update/update-single-task.md similarity index 100% rename from assets/claude/commands/tm/update/update-single-task.md rename to public/assets/claude/commands/tm/update/update-single-task.md diff --git a/assets/claude/commands/tm/update/update-task.md b/public/assets/claude/commands/tm/update/update-task.md similarity index 100% rename from assets/claude/commands/tm/update/update-task.md rename to public/assets/claude/commands/tm/update/update-task.md diff --git a/assets/claude/commands/tm/update/update-tasks-from-id.md b/public/assets/claude/commands/tm/update/update-tasks-from-id.md similarity index 100% rename from assets/claude/commands/tm/update/update-tasks-from-id.md rename to public/assets/claude/commands/tm/update/update-tasks-from-id.md diff --git a/assets/claude/commands/tm/utils/analyze-project.md b/public/assets/claude/commands/tm/utils/analyze-project.md similarity index 100% rename from assets/claude/commands/tm/utils/analyze-project.md rename to public/assets/claude/commands/tm/utils/analyze-project.md diff --git a/assets/claude/commands/tm/validate-dependencies/validate-dependencies.md b/public/assets/claude/commands/tm/validate-dependencies/validate-dependencies.md similarity index 100% rename from assets/claude/commands/tm/validate-dependencies/validate-dependencies.md rename to public/assets/claude/commands/tm/validate-dependencies/validate-dependencies.md diff --git a/assets/claude/commands/tm/workflows/auto-implement-tasks.md b/public/assets/claude/commands/tm/workflows/auto-implement-tasks.md similarity index 100% rename from assets/claude/commands/tm/workflows/auto-implement-tasks.md rename to public/assets/claude/commands/tm/workflows/auto-implement-tasks.md diff --git a/assets/claude/commands/tm/workflows/command-pipeline.md b/public/assets/claude/commands/tm/workflows/command-pipeline.md similarity index 100% rename from assets/claude/commands/tm/workflows/command-pipeline.md rename to public/assets/claude/commands/tm/workflows/command-pipeline.md diff --git a/assets/claude/commands/tm/workflows/smart-workflow.md b/public/assets/claude/commands/tm/workflows/smart-workflow.md similarity index 100% rename from assets/claude/commands/tm/workflows/smart-workflow.md rename to public/assets/claude/commands/tm/workflows/smart-workflow.md diff --git a/assets/config.json b/public/assets/config.json similarity index 100% rename from assets/config.json rename to public/assets/config.json diff --git a/assets/env.example b/public/assets/env.example similarity index 100% rename from assets/env.example rename to public/assets/env.example diff --git a/assets/example_prd.txt b/public/assets/example_prd.txt similarity index 100% rename from assets/example_prd.txt rename to public/assets/example_prd.txt diff --git a/assets/gitignore b/public/assets/gitignore similarity index 100% rename from assets/gitignore rename to public/assets/gitignore diff --git a/assets/kiro-hooks/tm-code-change-task-tracker.kiro.hook b/public/assets/kiro-hooks/tm-code-change-task-tracker.kiro.hook similarity index 100% rename from assets/kiro-hooks/tm-code-change-task-tracker.kiro.hook rename to public/assets/kiro-hooks/tm-code-change-task-tracker.kiro.hook diff --git a/assets/kiro-hooks/tm-complexity-analyzer.kiro.hook b/public/assets/kiro-hooks/tm-complexity-analyzer.kiro.hook similarity index 100% rename from assets/kiro-hooks/tm-complexity-analyzer.kiro.hook rename to public/assets/kiro-hooks/tm-complexity-analyzer.kiro.hook diff --git a/assets/kiro-hooks/tm-daily-standup-assistant.kiro.hook b/public/assets/kiro-hooks/tm-daily-standup-assistant.kiro.hook similarity index 100% rename from assets/kiro-hooks/tm-daily-standup-assistant.kiro.hook rename to public/assets/kiro-hooks/tm-daily-standup-assistant.kiro.hook diff --git a/assets/kiro-hooks/tm-git-commit-task-linker.kiro.hook b/public/assets/kiro-hooks/tm-git-commit-task-linker.kiro.hook similarity index 100% rename from assets/kiro-hooks/tm-git-commit-task-linker.kiro.hook rename to public/assets/kiro-hooks/tm-git-commit-task-linker.kiro.hook diff --git a/assets/kiro-hooks/tm-pr-readiness-checker.kiro.hook b/public/assets/kiro-hooks/tm-pr-readiness-checker.kiro.hook similarity index 100% rename from assets/kiro-hooks/tm-pr-readiness-checker.kiro.hook rename to public/assets/kiro-hooks/tm-pr-readiness-checker.kiro.hook diff --git a/assets/kiro-hooks/tm-task-dependency-auto-progression.kiro.hook b/public/assets/kiro-hooks/tm-task-dependency-auto-progression.kiro.hook similarity index 100% rename from assets/kiro-hooks/tm-task-dependency-auto-progression.kiro.hook rename to public/assets/kiro-hooks/tm-task-dependency-auto-progression.kiro.hook diff --git a/assets/kiro-hooks/tm-test-success-task-completer.kiro.hook b/public/assets/kiro-hooks/tm-test-success-task-completer.kiro.hook similarity index 100% rename from assets/kiro-hooks/tm-test-success-task-completer.kiro.hook rename to public/assets/kiro-hooks/tm-test-success-task-completer.kiro.hook diff --git a/assets/roocode/.roo/rules-architect/architect-rules b/public/assets/roocode/.roo/rules-architect/architect-rules similarity index 100% rename from assets/roocode/.roo/rules-architect/architect-rules rename to public/assets/roocode/.roo/rules-architect/architect-rules diff --git a/assets/roocode/.roo/rules-ask/ask-rules b/public/assets/roocode/.roo/rules-ask/ask-rules similarity index 100% rename from assets/roocode/.roo/rules-ask/ask-rules rename to public/assets/roocode/.roo/rules-ask/ask-rules diff --git a/assets/roocode/.roo/rules-code/code-rules b/public/assets/roocode/.roo/rules-code/code-rules similarity index 100% rename from assets/roocode/.roo/rules-code/code-rules rename to public/assets/roocode/.roo/rules-code/code-rules diff --git a/assets/roocode/.roo/rules-debug/debug-rules b/public/assets/roocode/.roo/rules-debug/debug-rules similarity index 100% rename from assets/roocode/.roo/rules-debug/debug-rules rename to public/assets/roocode/.roo/rules-debug/debug-rules diff --git a/assets/roocode/.roo/rules-orchestrator/orchestrator-rules b/public/assets/roocode/.roo/rules-orchestrator/orchestrator-rules similarity index 100% rename from assets/roocode/.roo/rules-orchestrator/orchestrator-rules rename to public/assets/roocode/.roo/rules-orchestrator/orchestrator-rules diff --git a/assets/roocode/.roo/rules-test/test-rules b/public/assets/roocode/.roo/rules-test/test-rules similarity index 100% rename from assets/roocode/.roo/rules-test/test-rules rename to public/assets/roocode/.roo/rules-test/test-rules diff --git a/assets/roocode/.roomodes b/public/assets/roocode/.roomodes similarity index 100% rename from assets/roocode/.roomodes rename to public/assets/roocode/.roomodes diff --git a/assets/rules/cursor_rules.mdc b/public/assets/rules/cursor_rules.mdc similarity index 100% rename from assets/rules/cursor_rules.mdc rename to public/assets/rules/cursor_rules.mdc diff --git a/assets/rules/dev_workflow.mdc b/public/assets/rules/dev_workflow.mdc similarity index 100% rename from assets/rules/dev_workflow.mdc rename to public/assets/rules/dev_workflow.mdc diff --git a/assets/rules/self_improve.mdc b/public/assets/rules/self_improve.mdc similarity index 100% rename from assets/rules/self_improve.mdc rename to public/assets/rules/self_improve.mdc diff --git a/assets/rules/taskmaster.mdc b/public/assets/rules/taskmaster.mdc similarity index 100% rename from assets/rules/taskmaster.mdc rename to public/assets/rules/taskmaster.mdc diff --git a/assets/rules/taskmaster_hooks_workflow.mdc b/public/assets/rules/taskmaster_hooks_workflow.mdc similarity index 100% rename from assets/rules/taskmaster_hooks_workflow.mdc rename to public/assets/rules/taskmaster_hooks_workflow.mdc diff --git a/assets/scripts_README.md b/public/assets/scripts_README.md similarity index 100% rename from assets/scripts_README.md rename to public/assets/scripts_README.md diff --git a/scripts/init.js b/scripts/init.js index 10ecb200..1223dc01 100755 --- a/scripts/init.js +++ b/scripts/init.js @@ -32,6 +32,9 @@ import { } from '../src/utils/rule-transformer.js'; import { updateConfigMaxTokens } from './modules/update-config-tokens.js'; +// Import asset resolver +import { assetExists, readAsset } from '../src/utils/asset-resolver.js'; + import { execSync } from 'child_process'; import { EXAMPLE_PRD_FILE, @@ -222,32 +225,14 @@ function createInitialStateFile(targetDir) { // Function to copy a file from the package to the target directory function copyTemplateFile(templateName, targetPath, replacements = {}) { // Get the file content from the appropriate source directory - let sourcePath; - - // Map template names to their actual source paths - switch (templateName) { - // case 'scripts_README.md': - // sourcePath = path.join(__dirname, '..', 'assets', 'scripts_README.md'); - // break; - // case 'README-task-master.md': - // sourcePath = path.join(__dirname, '..', 'README-task-master.md'); - // break; - default: - // For other files like env.example, gitignore, etc. that don't have direct equivalents - sourcePath = path.join(__dirname, '..', 'assets', templateName); + // Check if the asset exists + if (!assetExists(templateName)) { + log('error', `Source file not found: ${templateName}`); + return; } - // Check if the source file exists - if (!fs.existsSync(sourcePath)) { - // Fall back to templates directory for files that might not have been moved yet - sourcePath = path.join(__dirname, '..', 'assets', templateName); - if (!fs.existsSync(sourcePath)) { - log('error', `Source file not found: ${sourcePath}`); - return; - } - } - - let content = fs.readFileSync(sourcePath, 'utf8'); + // Read the asset content using the resolver + let content = readAsset(templateName, 'utf8'); // Replace placeholders with actual values Object.entries(replacements).forEach(([key, value]) => { diff --git a/src/utils/asset-resolver.js b/src/utils/asset-resolver.js new file mode 100644 index 00000000..805150b2 --- /dev/null +++ b/src/utils/asset-resolver.js @@ -0,0 +1,84 @@ +/** + * Asset Resolver Module + * Handles resolving paths to asset files in the package + * + * The public/assets folder is copied to dist/assets during build via tsup's publicDir, + * so we can reliably find it relative to the bundled files. + */ +import fs from 'fs'; +import path from 'path'; +import { fileURLToPath } from 'url'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); + +/** + * Get the assets directory path + * When bundled, assets are in dist/assets + * When in development, assets are in public/assets + * @returns {string} Path to the assets directory + */ +export function getAssetsDir() { + // Check multiple possible locations + const possiblePaths = [ + // When running from dist (bundled) - assets are in dist/assets + path.join(__dirname, 'assets'), + path.join(__dirname, '..', 'assets'), + // When running from source in development - now in public/assets + path.join(__dirname, '..', '..', 'public', 'assets'), + // When installed as npm package - assets at package root + path.join(process.cwd(), 'assets'), + // For npx usage - check node_modules + path.join(process.cwd(), 'node_modules', 'task-master-ai', 'dist', 'assets'), + path.join(process.cwd(), 'node_modules', 'task-master-ai', 'assets') + ]; + + // Find the first existing assets directory + for (const assetPath of possiblePaths) { + if (fs.existsSync(assetPath)) { + // Verify it's actually the assets directory by checking for known files + const testFile = path.join(assetPath, 'rules', 'taskmaster.mdc'); + if (fs.existsSync(testFile)) { + return assetPath; + } + } + } + + // If no assets directory found, throw an error + throw new Error('Assets directory not found. This is likely a packaging issue.'); +} + +/** + * Get path to a specific asset file + * @param {string} relativePath - Path relative to assets directory + * @returns {string} Full path to the asset file + */ +export function getAssetPath(relativePath) { + const assetsDir = getAssetsDir(); + return path.join(assetsDir, relativePath); +} + +/** + * Check if an asset file exists + * @param {string} relativePath - Path relative to assets directory + * @returns {boolean} True if the asset exists + */ +export function assetExists(relativePath) { + try { + const assetPath = getAssetPath(relativePath); + return fs.existsSync(assetPath); + } catch (error) { + return false; + } +} + +/** + * Read an asset file + * @param {string} relativePath - Path relative to assets directory + * @param {string} encoding - File encoding (default: 'utf8') + * @returns {string|Buffer} File contents + */ +export function readAsset(relativePath, encoding = 'utf8') { + const assetPath = getAssetPath(relativePath); + return fs.readFileSync(assetPath, encoding); +} \ No newline at end of file diff --git a/src/utils/rule-transformer.js b/src/utils/rule-transformer.js index a66c643a..4f541532 100644 --- a/src/utils/rule-transformer.js +++ b/src/utils/rule-transformer.js @@ -7,9 +7,11 @@ */ import fs from 'fs'; import path from 'path'; -import { fileURLToPath } from 'url'; import { log } from '../../scripts/modules/utils.js'; +// Import asset resolver +import { assetExists, readAsset, getAssetsDir } from './asset-resolver.js'; + // Import the shared MCP configuration helper import { setupMCPConfiguration, @@ -199,11 +201,7 @@ export function convertRuleToProfileRule(sourcePath, targetPath, profile) { * Convert all Cursor rules to profile rules for a specific profile */ export function convertAllRulesToProfileRules(projectRoot, profile) { - const __filename = fileURLToPath(import.meta.url); - const __dirname = path.dirname(__filename); - const sourceDir = path.join(__dirname, '..', '..', 'assets', 'rules'); const targetDir = path.join(projectRoot, profile.rulesDir); - const assetsDir = path.join(__dirname, '..', '..', 'assets'); let success = 0; let failed = 0; @@ -211,6 +209,7 @@ export function convertAllRulesToProfileRules(projectRoot, profile) { // 1. Call onAddRulesProfile first (for pre-processing like copying assets) if (typeof profile.onAddRulesProfile === 'function') { try { + const assetsDir = getAssetsDir(); profile.onAddRulesProfile(projectRoot, assetsDir); log( 'debug', @@ -238,14 +237,11 @@ export function convertAllRulesToProfileRules(projectRoot, profile) { const isAssetFile = !sourceFile.startsWith('rules/'); try { - // Use explicit path from fileMap - assets/ is the base directory - const sourcePath = path.join(assetsDir, sourceFile); - - // Check if source file exists - if (!fs.existsSync(sourcePath)) { + // Check if source file exists using asset resolver + if (!assetExists(sourceFile)) { log( 'warn', - `[Rule Transformer] Source file not found: ${sourcePath}, skipping` + `[Rule Transformer] Source file not found: ${sourceFile}, skipping` ); continue; } @@ -259,8 +255,8 @@ export function convertAllRulesToProfileRules(projectRoot, profile) { fs.mkdirSync(targetFileDir, { recursive: true }); } - // Read source content - let content = fs.readFileSync(sourcePath, 'utf8'); + // Read source content using asset resolver + let content = readAsset(sourceFile, 'utf8'); // Apply transformations (only if this is a rule file, not an asset file) if (!isAssetFile) { @@ -308,6 +304,7 @@ export function convertAllRulesToProfileRules(projectRoot, profile) { // 4. Call post-conversion hook (for finalization) if (typeof profile.onPostConvertRulesProfile === 'function') { try { + const assetsDir = getAssetsDir(); profile.onPostConvertRulesProfile(projectRoot, assetsDir); log( 'debug', @@ -386,11 +383,46 @@ export function removeProfileRules(projectRoot, profile) { ); // Get all files in the rules directory - const allFiles = fs.readdirSync(targetDir, { recursive: true }); + // For root-level directories, we need to be careful to avoid circular symlinks + let allFiles = []; + if (targetDir === projectRoot || profile.rulesDir === '.') { + // For root directory, manually read without recursion into problematic directories + const items = fs.readdirSync(targetDir); + for (const item of items) { + // Skip directories that can cause issues or are irrelevant + if (item === 'node_modules' || item === '.git' || item === 'dist') { + continue; + } + const itemPath = path.join(targetDir, item); + try { + const stats = fs.lstatSync(itemPath); + if (stats.isFile()) { + allFiles.push(item); + } else if (stats.isDirectory() && !stats.isSymbolicLink()) { + // Only recurse into safe directories + const subFiles = fs.readdirSync(itemPath, { recursive: true }); + subFiles.forEach(subFile => { + allFiles.push(path.join(item, subFile.toString())); + }); + } + } catch (err) { + // Silently skip files we can't access + } + } + } else { + // For non-root directories, use normal recursive read + allFiles = fs.readdirSync(targetDir, { recursive: true }); + } + const allFilePaths = allFiles .filter((file) => { const fullPath = path.join(targetDir, file); - return fs.statSync(fullPath).isFile(); + try { + const stats = fs.statSync(fullPath); + return stats.isFile(); + } catch (err) { + return false; + } }) .map((file) => file.toString()); // Ensure it's a string diff --git a/tsup.config.ts b/tsup.config.ts index 7ccf5fec..182a88be 100644 --- a/tsup.config.ts +++ b/tsup.config.ts @@ -12,6 +12,7 @@ export default defineConfig({ clean: true, bundle: true, // Bundle everything into one file outDir: 'dist', + publicDir: 'public', // Handle TypeScript imports transparently loader: { '.js': 'jsx',