@tng-sh/js 0.2.5 → 0.2.6

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/bin/tng.js CHANGED
@@ -29,7 +29,7 @@ process.on('uncaughtException', (err) => {
29
29
  program
30
30
  .name('tng')
31
31
  .description('TNG - Advanced Code Audit, Test Generation, Visualization, Clone Detection, and Dead Code Analysis for JavaScript/TypeScript')
32
- .version('0.2.5');
32
+ .version('0.2.6');
33
33
 
34
34
  /**
35
35
  * Copy text to system clipboard
Binary file
Binary file
Binary file
Binary file
package/index.d.ts CHANGED
@@ -56,6 +56,8 @@ export declare function applyEditsAtomic(operationsJson: string): string
56
56
  export declare function generateTest(filePath: string, methodName: string, className: string | undefined | null, testType: string | undefined | null, configJson: string, callback: (...args: any[]) => any): string
57
57
  /** Analyzes a method and generates a symbolic execution trace. */
58
58
  export declare function getSymbolicTrace(filePath: string, methodName: string, className?: string | undefined | null): string
59
+ /** Analyzes a method and generates a symbolic execution trace v2. */
60
+ export declare function getSymbolicTraceV2(filePath: string, methodName: string, className?: string | undefined | null, projectRoot?: string | undefined | null): string
59
61
  /**
60
62
  * Analyzes a file for code clones (duplicates).
61
63
  * Returns a JSON string containing the matches found.
package/index.js CHANGED
@@ -310,7 +310,7 @@ if (!nativeBinding) {
310
310
  throw new Error(`Failed to load native binding`)
311
311
  }
312
312
 
313
- const { getFileOutline, getProjectMetadata, findCallSites, ping, submitJob, getUserStats, runAudit, applyEdit, applyEditsAtomic, generateTest, getSymbolicTrace, analyzeClones, detectDeadCode, listDeadcodeFiles, analyzeImpact } = nativeBinding
313
+ const { getFileOutline, getProjectMetadata, findCallSites, ping, submitJob, getUserStats, runAudit, applyEdit, applyEditsAtomic, generateTest, getSymbolicTrace, getSymbolicTraceV2, analyzeClones, detectDeadCode, listDeadcodeFiles, analyzeImpact } = nativeBinding
314
314
 
315
315
  module.exports.getFileOutline = getFileOutline
316
316
  module.exports.getProjectMetadata = getProjectMetadata
@@ -323,6 +323,7 @@ module.exports.applyEdit = applyEdit
323
323
  module.exports.applyEditsAtomic = applyEditsAtomic
324
324
  module.exports.generateTest = generateTest
325
325
  module.exports.getSymbolicTrace = getSymbolicTrace
326
+ module.exports.getSymbolicTraceV2 = getSymbolicTraceV2
326
327
  module.exports.analyzeClones = analyzeClones
327
328
  module.exports.detectDeadCode = detectDeadCode
328
329
  module.exports.listDeadcodeFiles = listDeadcodeFiles
@@ -18,7 +18,6 @@ class GenerateTestsUI {
18
18
  }
19
19
 
20
20
  async show() {
21
- // Check for API key before showing menu
22
21
  const config = loadConfig();
23
22
  if (!config.API_KEY) {
24
23
  this._showConfigMissing();
@@ -95,20 +94,26 @@ class GenerateTestsUI {
95
94
 
96
95
  async _pingApi() {
97
96
  const config = loadConfig();
98
- if (!config.API_KEY) {
97
+ if (!config || !config.API_KEY) {
99
98
  console.log(chalk.red('\nNo API key configured. Run: tng init\n'));
100
- return;
99
+ return false;
101
100
  }
102
101
 
103
- this.goUiSession.showSpinner('Pinging TNG API...', () => {
102
+ if (!config.API_URL) {
103
+ console.log(chalk.red('\nNo API URL configured in tng.config.js.\n'));
104
+ return false;
105
+ }
106
+
107
+ const result = await this.goUiSession.showSpinner('Pinging TNG API...', async () => {
104
108
  try {
105
- const result = ping(config.API_URL, config.API_KEY);
106
- return { success: true, message: `API Response: ${result}` };
109
+ const res = ping(config.API_URL, config.API_KEY);
110
+ return { success: true, message: `API Response: ${res}` };
107
111
  } catch (e) {
108
112
  return { success: false, message: e.message };
109
113
  }
110
114
  });
111
- return false
115
+
116
+ return result || false;
112
117
  }
113
118
 
114
119
  async _showFileSelection(isAudit = false, isXray = false, isTrace = false, isImpact = false) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tng-sh/js",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "TNG JavaScript CLI",
5
5
  "repository": {
6
6
  "type": "git",
Binary file
Binary file
package/.idea/js-pie.iml DELETED
@@ -1,11 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="RUBY_MODULE" version="4">
3
- <component name="ModuleRunConfigurationManager">
4
- <shared />
5
- </component>
6
- <component name="NewModuleRootManager">
7
- <content url="file://$MODULE_DIR$" />
8
- <orderEntry type="inheritedJdk" />
9
- <orderEntry type="sourceFolder" forTests="false" />
10
- </component>
11
- </module>
package/.idea/modules.xml DELETED
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/.idea/js-pie.iml" filepath="$PROJECT_DIR$/.idea/js-pie.iml" />
6
- </modules>
7
- </component>
8
- </project>
package/.idea/vcs.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="" vcs="Git" />
5
- </component>
6
- </project>