@tng-sh/js 0.1.4 → 0.1.5

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/README.md CHANGED
@@ -4,69 +4,79 @@ High-performance test generation and context analysis for JavaScript/TypeScript,
4
4
 
5
5
  ## Installation
6
6
 
7
+ Install the package as a development dependency in your project:
8
+
7
9
  ```bash
8
10
  npm install @tng-sh/js --save-dev
9
11
  ```
10
12
 
11
- ## Quick Start
13
+ ## Usage
12
14
 
13
15
  ### 1. Initialize
14
- Run the init command to create a `tng.config.js` configuration file in your project:
16
+ First, run the init command to create a `tng.config.js` configuration file. This file stores your API keys and project settings.
15
17
 
16
18
  ```bash
17
- npx -p @tng-sh/js tng init
19
+ npx tng init
18
20
  ```
19
21
 
20
- ### 2. Generate Tests
21
- Generate a test for a specific function in a file:
22
+ ### 2. Interactive Mode (TUI)
23
+ The most powerful way to use TNG is via the high-performance terminal interface. It provides a guided experience for all analysis tasks.
22
24
 
23
25
  ```bash
24
- npx -p @tng-sh/js tng -f path/to/file.js -m functionName -t react_component
26
+ npx tng i
27
+ ```
28
+
29
+ **Capabilities in TUI:**
30
+ * **Generate Tests**: Guided test creation for methods, components, and utilities.
31
+ * **Audit Method**: Deep security, performance, and best-practice auditing.
32
+ * **Trace Method**: Symbolic execution and logic flow visualization.
33
+ * **X-Ray Method**: Deep dependency and side-effect analysis.
34
+ * **Check Duplicates**: High-performance clone detection across the codebase.
35
+ * **Dead Code**: Identify unreachable logic and unused variables/parameters.
36
+ * **User Stats**: Review your usage metrics and generation history.
37
+
38
+ ### 3. Command Line Interface (CLI) ⚙️
39
+ For direct execution or integration into scripts.
40
+
41
+ ```bash
42
+ # See file outline and method list
43
+ npx tng -f path/to/file.js --outline
44
+
45
+ # Generate tests for a specific method
46
+ npx tng -f path/to/file.js -m functionName -t react_component
47
+
48
+ # Check for code clones
49
+ npx tng -f path/to/file.js --clones
25
50
  ```
26
51
 
27
52
  **Supported Types (`-t`):**
28
- - `react_component`
29
- - `express_handler`
30
- - `graphql_resolver`
31
- - `nest_js` (Service/Controller)
32
- - `orm_model`
33
- - `background_job`
34
- - `mailer`
35
- - `utility`
36
-
37
- ### 3. Interactive Mode
38
- Launch the interactive UI to explore and generate tests visually:
53
+ `react_component`, `express_handler`, `graphql_resolver`, `nest_js`, `orm_model`, `background_job`, `mailer`, `utility`.
54
+
55
+ ### 4. Machine-Readable Output (`--json`) 🤖
56
+ Add the `--json` flag to any command to receive output as structured JSON events. This is ideal for CI/CD pipelines or custom integrations.
39
57
 
40
58
  ```bash
41
- npx -p @tng-sh/js tng i
59
+ npx tng -f path/to/file.js --clones --json
42
60
  ```
43
61
 
44
62
  ## Features
45
63
 
46
- - ⚡️ **Fast AST Analysis**: Powered by Rust and the `oxc` parser for blazing fast static analysis.
47
- - 🖥️ **Interactive UI**: Rich Go-based terminal UI for managing test generation.
48
- - 🎨 **Prettier Integration**: Automatically formats generated tests to match your project style.
49
- - 📘 **TypeScript Support**: First-class support for TypeScript analysis.
64
+ - **Oxc-Powered**: Blazing fast AST analysis using the industry-leading Rust parser.
65
+ - **Multi-Platform**: Native support for macOS (Intel/ARM) and Linux (x64/ARM64).
66
+ - **Prettier Integration**: Automatically formats generated code to match your existing style.
67
+ - **TypeScript Native**: First-class support for `.ts` and `.tsx` analysis and generation.
50
68
 
51
- ## Configuration
69
+ ## ⚙️ Configuration
52
70
 
53
- The `tng.config.js` file allows you to customize the behavior:
71
+ Your `tng.config.js` allows for full customization:
54
72
 
55
73
  ```javascript
56
74
  module.exports = {
57
- // API Configuration
58
75
  API_KEY: "your-api-key-here",
59
76
  API_URL: "https://app.tng.sh/",
60
-
61
- // Framework Detection
62
- // Options: express, nextjs, nestjs, generic
63
- FRAMEWORK: "express",
64
-
65
- // Testing Configuration
66
- // Options: jest, mocha, vitest
67
- TEST_FRAMEWORK: "jest",
68
-
69
- // Test Directory
70
- TEST_DIRECTORY: "tests"
77
+ FRAMEWORK: "express", // Options: express, nextjs, nestjs, generic
78
+ TESTS_PATH: "tests", // Where to save generated tests
79
+ TEST_FRAMEWORK: "jest" // Options: jest, mocha, vitest
71
80
  };
72
81
  ```
82
+
package/bin/tng.js CHANGED
@@ -27,8 +27,8 @@ process.on('uncaughtException', (err) => {
27
27
 
28
28
  program
29
29
  .name('tng')
30
- .description('TNG - Automated Test Generation, and audit generation for JavaScript')
31
- .version('0.1.4');
30
+ .description('TNG - Automated Test Generation, and Audit generation for JavaScript')
31
+ .version('0.1.5');
32
32
 
33
33
  /**
34
34
  * @command init
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tng-sh/js",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "TNG JavaScript CLI",
5
5
  "repository": {
6
6
  "type": "git",