@tng-sh/js 0.2.5 → 0.2.7

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.7');
33
33
 
34
34
  /**
35
35
  * Copy text to system clipboard
Binary file
Binary file
Binary file
Binary file
@@ -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.7",
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>