@flisk/analyze-tracking 0.4.0 → 0.4.1

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": "@flisk/analyze-tracking",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Analyzes tracking code in a project and generates data schemas",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -6,11 +6,11 @@ const { analyzeTsFile } = require('./analyzeTsFile');
6
6
  const { analyzeRubyFile } = require('./analyzeRubyFile');
7
7
 
8
8
  async function analyzeDirectory(dirPath, customFunction) {
9
- const files = getAllFiles(dirPath);
10
9
  const allEvents = {};
11
10
 
11
+ const files = getAllFiles(dirPath);
12
12
  const tsFiles = files.filter(file => /\.(tsx?)$/.test(file));
13
- const program = ts.createProgram(tsFiles, {
13
+ const tsProgram = ts.createProgram(tsFiles, {
14
14
  target: ts.ScriptTarget.ESNext,
15
15
  module: ts.ModuleKind.CommonJS,
16
16
  });
@@ -20,12 +20,12 @@ async function analyzeDirectory(dirPath, customFunction) {
20
20
 
21
21
  const isJsFile = /\.(jsx?)$/.test(file);
22
22
  const isTsFile = /\.(tsx?)$/.test(file);
23
- const isRubyFile = /\.(rb|ru|rake|gemspec)$/.test(file);
23
+ const isRubyFile = /\.(rb)$/.test(file);
24
24
 
25
25
  if (isJsFile) {
26
26
  events = analyzeJsFile(file, customFunction);
27
27
  } else if (isTsFile) {
28
- events = analyzeTsFile(file, program, customFunction);
28
+ events = analyzeTsFile(file, tsProgram, customFunction);
29
29
  } else if (isRubyFile) {
30
30
  events = await analyzeRubyFile(file);
31
31
  } else {
@@ -26,6 +26,7 @@ function getAllFiles(dirPath, arrayOfFiles = []) {
26
26
  if (file === 'coverage') return
27
27
  if (file === 'temp') return
28
28
  if (file === 'tmp') return
29
+ if (file === 'log') return
29
30
 
30
31
  if (stats.isDirectory()) {
31
32
  arrayOfFiles = getAllFiles(fullPath, arrayOfFiles);