johankit 0.0.8 → 0.1.0

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.
@@ -8,6 +8,7 @@ const createAsciiTree_1 = __importDefault(require("../utils/createAsciiTree"));
8
8
  const copy_1 = require("../cli/commands/copy");
9
9
  const paste_1 = require("../cli/commands/paste");
10
10
  const prompt_1 = require("../cli/commands/prompt");
11
+ const tree_1 = require("../cli/commands/tree");
11
12
  const scan_1 = require("../core/scan");
12
13
  const diff_1 = require("../core/diff");
13
14
  const validation_1 = require("../core/validation");
@@ -51,8 +52,8 @@ class JohankitService {
51
52
  return { before: snapshotBefore, after: snapshotAfter };
52
53
  }
53
54
  async tree(dir = ".") {
54
- const tree = await tree(dir);
55
- return (0, createAsciiTree_1.default)(tree);
55
+ const _tree = await (0, tree_1.tree)(dir);
56
+ return (0, createAsciiTree_1.default)(_tree);
56
57
  }
57
58
  }
58
59
  exports.JohankitService = JohankitService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "johankit",
3
- "version": "0.0.8",
3
+ "version": "0.1.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -35,6 +35,8 @@ export async function tree(dir: string): Promise<FileTree[]> {
35
35
  const absolutePath = file.getFilePath();
36
36
  const filePath = path.relative(dir, absolutePath);
37
37
 
38
+ console.log(filePath);
39
+
38
40
  if (filePath.includes("node_modules") || filePath.includes("/dist/")) {
39
41
  continue;
40
42
  }
@@ -2,11 +2,11 @@ import createAsciiTree from "../utils/createAsciiTree";
2
2
  import { copy } from "../cli/commands/copy";
3
3
  import { paste } from "../cli/commands/paste";
4
4
  import { prompt } from "../cli/commands/prompt";
5
+ import { tree as treeCommand } from "../cli/commands/tree";
5
6
  import { scanDir } from "../core/scan";
6
7
  import { applyDiff, DiffPatch } from "../core/diff";
7
8
  import { validatePatches } from "../core/validation";
8
9
  import { writeFiles } from "../core/write";
9
- import { tree } from "cli/commands/tree";
10
10
 
11
11
  interface JohankitServiceOptions {
12
12
  isolated?: boolean;
@@ -63,8 +63,8 @@ export class JohankitService {
63
63
  return { before: snapshotBefore, after: snapshotAfter };
64
64
  }
65
65
 
66
- async createTree(dir: string = ".") {
67
- const tree = await tree(dir);
68
- return createAsciiTree(tree);
66
+ async tree(dir: string = ".") {
67
+ const _tree = await treeCommand(dir);
68
+ return createAsciiTree(_tree);
69
69
  }
70
70
  }