review-assets.ts 571 B

123456789101112
  1. import { dirname, resolve } from 'node:path';
  2. import { fileURLToPath } from 'node:url';
  3. declare const __IS_NPM_BUILD__: boolean | undefined;
  4. /** Source and dist both retain the runtime hierarchy; the npm bundle's module URL is fixed to the package entry point. */
  5. export function resolveTuiReviewPromptDir(): string {
  6. const here = dirname(fileURLToPath(import.meta.url));
  7. return typeof __IS_NPM_BUILD__ !== 'undefined' && __IS_NPM_BUILD__
  8. ? resolve(here, 'assets/prompts/code-review')
  9. : resolve(here, '../../../local-runtime/assets/prompts/code-review');
  10. }