@jishankai/solid-cli 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jishankai/solid-cli",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "MacOS System & Security Analysis Agent CLI with LLM-powered insights",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -1,5 +1,6 @@
1
1
  import { promises as fs } from 'fs';
2
- import { join } from 'path';
2
+ import { dirname, join } from 'path';
3
+ import { fileURLToPath } from 'url';
3
4
  import puppeteer from 'puppeteer';
4
5
  import handlebars from 'handlebars';
5
6
  import { PDFGenerator } from './generators/PDFGenerator.js';
@@ -7,6 +8,11 @@ import { MarkdownGenerator } from './generators/MarkdownGenerator.js';
7
8
  import { ReportSanitizer } from './utils/sanitizer.js';
8
9
  import { ReportFormatter } from './utils/formatter.js';
9
10
 
11
+ const __filename = fileURLToPath(import.meta.url);
12
+ const __dirname = dirname(__filename);
13
+ const DEFAULT_TEMPLATE_DIR = join(__dirname, 'templates');
14
+ const DEFAULT_STYLE_DIR = join(__dirname, 'styles');
15
+
10
16
  /**
11
17
  * Enhanced Report Manager - Professional report generation with templates
12
18
  */
@@ -21,8 +27,8 @@ export class ReportManager {
21
27
  this.llmAnalysis = llmAnalysis;
22
28
  this.options = {
23
29
  reportsDir: './reports',
24
- templateDir: './src/report/templates',
25
- styleDir: './src/report/styles',
30
+ templateDir: DEFAULT_TEMPLATE_DIR,
31
+ styleDir: DEFAULT_STYLE_DIR,
26
32
  retentionDays: 90,
27
33
  defaultTemplate: 'executive',
28
34
  ...options
@@ -1,15 +1,20 @@
1
1
  import { promises as fs } from 'fs';
2
- import { join } from 'path';
2
+ import { dirname, join } from 'path';
3
+ import { fileURLToPath } from 'url';
3
4
  import { readFileSync } from 'fs';
4
5
  import handlebars from 'handlebars';
5
6
 
7
+ const __filename = fileURLToPath(import.meta.url);
8
+ const __dirname = dirname(__filename);
9
+ const DEFAULT_TEMPLATE_DIR = join(__dirname, '..', 'templates');
10
+
6
11
  /**
7
12
  * Enhanced Markdown Generator with templates
8
13
  */
9
14
  export class MarkdownGenerator {
10
15
  constructor(options = {}) {
11
16
  this.options = {
12
- templateDir: './src/report/templates',
17
+ templateDir: DEFAULT_TEMPLATE_DIR,
13
18
  ...options
14
19
  };
15
20
  }
@@ -1,17 +1,23 @@
1
1
  import puppeteer from 'puppeteer';
2
2
  import { promises as fs } from 'fs';
3
- import { join } from 'path';
3
+ import { dirname, join } from 'path';
4
+ import { fileURLToPath } from 'url';
4
5
  import { readFileSync } from 'fs';
5
6
  import handlebars from 'handlebars';
6
7
 
8
+ const __filename = fileURLToPath(import.meta.url);
9
+ const __dirname = dirname(__filename);
10
+ const DEFAULT_TEMPLATE_DIR = join(__dirname, '..', 'templates');
11
+ const DEFAULT_STYLE_DIR = join(__dirname, '..', 'styles');
12
+
7
13
  /**
8
14
  * Enhanced PDF Generator using Puppeteer
9
15
  */
10
16
  export class PDFGenerator {
11
17
  constructor(options = {}) {
12
18
  this.options = {
13
- styleDir: './src/report/styles',
14
- templateDir: './src/report/templates',
19
+ styleDir: DEFAULT_STYLE_DIR,
20
+ templateDir: DEFAULT_TEMPLATE_DIR,
15
21
  ...options
16
22
  };
17
23
  }