@appthreat/atom 2.4.0 → 2.4.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 +1 -1
- package/packages/atom-parsetools/astgen.js +67 -17
- package/plugins/bin/atom +1 -1
- package/plugins/bin/atom.bat +1 -1
- package/plugins/lib/io.appthreat.atom-2.4.2-classpath.jar +0 -0
- package/plugins/lib/{io.appthreat.atom-2.4.0.jar → io.appthreat.atom-2.4.2.jar} +0 -0
- package/plugins/lib/{io.appthreat.c2cpg_3-2.5.1.jar → io.appthreat.c2cpg_3-2.5.4.jar} +0 -0
- package/plugins/lib/{io.appthreat.cpg2-domain-classes_3-1.1.1.jar → io.appthreat.cpg2-domain-classes_3-2.0.1.jar} +0 -0
- package/plugins/lib/io.appthreat.cpg2-protos_3-2.0.1.jar +0 -0
- package/plugins/lib/io.appthreat.cpg2_3-2.0.1.jar +0 -0
- package/plugins/lib/{io.appthreat.dataflowengineoss_3-2.5.1.jar → io.appthreat.dataflowengineoss_3-2.5.4.jar} +0 -0
- package/plugins/lib/{io.appthreat.javasrc2cpg_3-2.5.1.jar → io.appthreat.javasrc2cpg_3-2.5.4.jar} +0 -0
- package/plugins/lib/{io.appthreat.jimple2cpg_3-2.5.1.jar → io.appthreat.jimple2cpg_3-2.5.4.jar} +0 -0
- package/plugins/lib/{io.appthreat.jssrc2cpg_3-2.5.1.jar → io.appthreat.jssrc2cpg_3-2.5.4.jar} +0 -0
- package/plugins/lib/io.appthreat.odb2-core_3-2.0.1.jar +0 -0
- package/plugins/lib/{io.appthreat.odb2-formats_3-1.0.1.jar → io.appthreat.odb2-formats_3-2.0.1.jar} +0 -0
- package/plugins/lib/io.appthreat.odb2-traversal_3-2.0.1.jar +0 -0
- package/plugins/lib/{io.appthreat.php2atom_3-2.5.1.jar → io.appthreat.php2atom_3-2.5.4.jar} +0 -0
- package/plugins/lib/{io.appthreat.pysrc2cpg_3-2.5.1.jar → io.appthreat.pysrc2cpg_3-2.5.4.jar} +0 -0
- package/plugins/lib/{io.appthreat.ruby2atom_3-2.5.1.jar → io.appthreat.ruby2atom_3-2.5.4.jar} +0 -0
- package/plugins/lib/{io.appthreat.semanticcpg_3-2.5.1.jar → io.appthreat.semanticcpg_3-2.5.4.jar} +0 -0
- package/plugins/lib/{io.appthreat.x2cpg_3-2.5.1.jar → io.appthreat.x2cpg_3-2.5.4.jar} +0 -0
- package/plugins/lib/{org.msgpack.msgpack-core-0.9.8.jar → org.msgpack.msgpack-core-0.9.10.jar} +0 -0
- package/plugins/lib/org.scala-lang.modules.scala-xml_3-2.4.0.jar +0 -0
- package/plugins/lib/com.massisframework.j-text-utils-0.3.4.jar +0 -0
- package/plugins/lib/commons-lang.commons-lang-2.6.jar +0 -0
- package/plugins/lib/io.appthreat.atom-2.4.0-classpath.jar +0 -0
- package/plugins/lib/io.appthreat.cpg2-protos_3-1.1.1.jar +0 -0
- package/plugins/lib/io.appthreat.cpg2_3-1.1.1.jar +0 -0
- package/plugins/lib/io.appthreat.odb2-core_3-1.0.1.jar +0 -0
- package/plugins/lib/io.appthreat.odb2-traversal_3-1.0.1.jar +0 -0
- package/plugins/lib/org.scala-lang.modules.scala-xml_3-2.3.0.jar +0 -0
package/package.json
CHANGED
|
@@ -59,17 +59,53 @@ const babelSafeParserOptions = {
|
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
61
|
* Return paths to all (j|tsx?) files.
|
|
62
|
+
* Optionally includes specific bundled files from node_modules if:
|
|
63
|
+
* 1. ASTGEN_INCLUDE_NODE_MODULES_BUNDLES is "true", OR
|
|
64
|
+
* 2. ASTGEN_IGNORE_DIRS is non-empty and doesn't include "node_modules"
|
|
62
65
|
*/
|
|
63
|
-
const getAllSrcJSAndTSFiles = (src) =>
|
|
64
|
-
|
|
66
|
+
const getAllSrcJSAndTSFiles = (src) => {
|
|
67
|
+
const filePattern = "\\.(js|jsx|cjs|mjs|ts|tsx|vue|svelte|xsjs|xsjslib|ejs)$";
|
|
68
|
+
const bundledNodeModulesPattern =
|
|
69
|
+
"node_modules/.*\\.(bundle|dist|index|min|app)\\.(js|cjs|mjs)$";
|
|
70
|
+
|
|
71
|
+
// Step 1: Collect all JS/TS files EXCLUDING node_modules
|
|
72
|
+
const allFilesPromise = Promise.resolve(
|
|
65
73
|
getAllFiles(
|
|
66
74
|
src,
|
|
67
75
|
undefined,
|
|
68
76
|
undefined,
|
|
69
77
|
undefined,
|
|
70
|
-
new RegExp(
|
|
78
|
+
new RegExp(filePattern),
|
|
79
|
+
true // ignore node_modules
|
|
71
80
|
)
|
|
72
|
-
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
// Step 2: Check if we should include node_modules bundles
|
|
84
|
+
const shouldIncludeNodeModulesBundles =
|
|
85
|
+
process.env?.ASTGEN_INCLUDE_NODE_MODULES_BUNDLES === "true" ||
|
|
86
|
+
(process.env?.ASTGEN_IGNORE_DIRS &&
|
|
87
|
+
process.env.ASTGEN_IGNORE_DIRS.length > 0 &&
|
|
88
|
+
!process.env.ASTGEN_IGNORE_DIRS.toLowerCase().includes("node_modules"));
|
|
89
|
+
|
|
90
|
+
let bundledFilesPromise = Promise.resolve([]);
|
|
91
|
+
if (shouldIncludeNodeModulesBundles) {
|
|
92
|
+
bundledFilesPromise = Promise.resolve(
|
|
93
|
+
getAllFiles(
|
|
94
|
+
src,
|
|
95
|
+
undefined,
|
|
96
|
+
undefined,
|
|
97
|
+
undefined,
|
|
98
|
+
new RegExp(bundledNodeModulesPattern),
|
|
99
|
+
false // DO NOT ignore node_modules
|
|
100
|
+
)
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Step 3: Combine both lists
|
|
105
|
+
return Promise.all([allFilesPromise, bundledFilesPromise]).then(
|
|
106
|
+
([allFiles, bundledFiles]) => [...allFiles, ...bundledFiles]
|
|
107
|
+
);
|
|
108
|
+
};
|
|
73
109
|
|
|
74
110
|
/**
|
|
75
111
|
* Convert a single JS/TS file to AST
|
|
@@ -242,30 +278,44 @@ const createJSAst = async (options) => {
|
|
|
242
278
|
try {
|
|
243
279
|
const promiseMap = await getAllSrcJSAndTSFiles(options.src);
|
|
244
280
|
const srcFiles = promiseMap.flatMap((d) => d);
|
|
281
|
+
const CONCURRENCY_LIMIT = 10;
|
|
282
|
+
const chunks = [];
|
|
283
|
+
for (let i = 0; i < srcFiles.length; i += CONCURRENCY_LIMIT) {
|
|
284
|
+
chunks.push(srcFiles.slice(i, i + CONCURRENCY_LIMIT));
|
|
285
|
+
}
|
|
245
286
|
let ts;
|
|
246
287
|
if (options.tsTypes) {
|
|
247
|
-
|
|
288
|
+
const projectFiles = srcFiles.filter(
|
|
289
|
+
(file) => !file.includes("node_modules")
|
|
290
|
+
);
|
|
291
|
+
ts = createTsc(projectFiles);
|
|
248
292
|
}
|
|
249
|
-
for (const
|
|
293
|
+
for (const chunk of chunks) {
|
|
294
|
+
await Promise.all(chunk.map((file) => processFile(file, options, ts)));
|
|
295
|
+
}
|
|
296
|
+
} catch (err) {
|
|
297
|
+
console.error(err);
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
const processFile = (file, options, ts) => {
|
|
302
|
+
try {
|
|
303
|
+
const ast = fileToJsAst(file);
|
|
304
|
+
writeAstFile(file, ast, options);
|
|
305
|
+
if (ts) {
|
|
250
306
|
try {
|
|
251
|
-
const
|
|
252
|
-
|
|
253
|
-
} catch (err) {
|
|
254
|
-
console.error(file, err.message);
|
|
255
|
-
}
|
|
256
|
-
if (ts) {
|
|
257
|
-
try {
|
|
258
|
-
const tsAst = ts.program.getSourceFile(file);
|
|
307
|
+
const tsAst = ts.program.getSourceFile(file);
|
|
308
|
+
if (tsAst) {
|
|
259
309
|
tsc.forEachChild(tsAst, ts.addType);
|
|
260
310
|
writeTypesFile(file, ts.seenTypes, options);
|
|
261
311
|
ts.seenTypes.clear();
|
|
262
|
-
} catch (err) {
|
|
263
|
-
console.warn("Retrieving types", file, ":", err.message);
|
|
264
312
|
}
|
|
313
|
+
} catch (err) {
|
|
314
|
+
console.warn("Retrieving types", file, ":", err.message);
|
|
265
315
|
}
|
|
266
316
|
}
|
|
267
317
|
} catch (err) {
|
|
268
|
-
console.error(err);
|
|
318
|
+
console.error(file, err.message);
|
|
269
319
|
}
|
|
270
320
|
};
|
|
271
321
|
|
package/plugins/bin/atom
CHANGED
|
@@ -360,7 +360,7 @@ declare -r lib_dir="$(realpath "${app_home}/../lib")"
|
|
|
360
360
|
declare -a app_mainclass=('io.appthreat.atom.Atom')
|
|
361
361
|
|
|
362
362
|
declare -r script_conf_file="${app_home}/../conf/application.ini"
|
|
363
|
-
declare -r app_classpath="$lib_dir/io.appthreat.atom-2.4.
|
|
363
|
+
declare -r app_classpath="$lib_dir/io.appthreat.atom-2.4.2-classpath.jar"
|
|
364
364
|
|
|
365
365
|
# java_cmd is overrode in process_args when -java-home is used
|
|
366
366
|
declare java_cmd=$(get_java_cmd)
|
package/plugins/bin/atom.bat
CHANGED
|
@@ -40,7 +40,7 @@ rem "-J" is stripped, "-D" is left as is, and everything is appended to JAVA_OPT
|
|
|
40
40
|
set _JAVA_PARAMS=
|
|
41
41
|
set _APP_ARGS=
|
|
42
42
|
|
|
43
|
-
set "APP_CLASSPATH=%APP_LIB_DIR%\io.appthreat.atom-2.4.
|
|
43
|
+
set "APP_CLASSPATH=%APP_LIB_DIR%\io.appthreat.atom-2.4.2-classpath.jar"
|
|
44
44
|
set "APP_MAIN_CLASS=io.appthreat.atom.Atom"
|
|
45
45
|
set "SCRIPT_CONF_FILE=%APP_HOME%\conf\application.ini"
|
|
46
46
|
|
|
Binary file
|
|
index 7a06df4..ab40301 100644
|
|
|
Binary file
|
|
index f022ed0..4467834 100644
|
|
|
Binary file
|
|
index 27106fd..1a24f2f 100644
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
index b66be13..eb8b53c 100644
|
|
|
Binary file
|
package/plugins/lib/{io.appthreat.javasrc2cpg_3-2.5.1.jar → io.appthreat.javasrc2cpg_3-2.5.4.jar}
RENAMED
|
index cff75ea..cc81172 100644
|
|
|
Binary file
|
package/plugins/lib/{io.appthreat.jimple2cpg_3-2.5.1.jar → io.appthreat.jimple2cpg_3-2.5.4.jar}
RENAMED
|
index 2f923e8..daf511e 100644
|
|
|
Binary file
|
package/plugins/lib/{io.appthreat.jssrc2cpg_3-2.5.1.jar → io.appthreat.jssrc2cpg_3-2.5.4.jar}
RENAMED
|
index a6b271d..92e1ab9 100644
|
|
|
Binary file
|
|
Binary file
|
package/plugins/lib/{io.appthreat.odb2-formats_3-1.0.1.jar → io.appthreat.odb2-formats_3-2.0.1.jar}
RENAMED
|
index 045e818..61d080a 100644
|
|
|
Binary file
|
|
Binary file
|
|
index e1029dc..4e61f84 100644
|
|
|
Binary file
|
package/plugins/lib/{io.appthreat.pysrc2cpg_3-2.5.1.jar → io.appthreat.pysrc2cpg_3-2.5.4.jar}
RENAMED
|
index 5898098..dae0e49 100644
|
|
|
Binary file
|
package/plugins/lib/{io.appthreat.ruby2atom_3-2.5.1.jar → io.appthreat.ruby2atom_3-2.5.4.jar}
RENAMED
|
index f41708a..7b47d93 100644
|
|
|
Binary file
|
package/plugins/lib/{io.appthreat.semanticcpg_3-2.5.1.jar → io.appthreat.semanticcpg_3-2.5.4.jar}
RENAMED
|
index 1e75867..a672632 100644
|
|
|
Binary file
|
|
index 1932476..b2ee790 100644
|
|
|
Binary file
|
package/plugins/lib/{org.msgpack.msgpack-core-0.9.8.jar → org.msgpack.msgpack-core-0.9.10.jar}
RENAMED
|
index c15c7ec..84f7933 100644
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|