Skip to content

Commit ce948ac

Browse files
committed
removed comments and minor changes to push to main
1 parent a972745 commit ce948ac

10 files changed

+67
-135
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
node_modules
22
dist/
33
.vscode-test/
4-
out/
4+
out/
5+
coverage/

CHANGELOG.md

+45-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,51 @@
11
# Change Log
22

3-
All notable changes to the "nextFlow" extension will be documented in this file.
3+
All notable changes to the "NextFlow" extension will be documented in this file.
44

5-
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
5+
Check [Keep a Changelog]() for recommendations on how to structure this file.
66

77
## [Unreleased]
88

9-
- Initial release
9+
- Initial release
10+
11+
[0.2.3] - February 5, 2025
12+
13+
Implemented testing with Jest
14+
15+
[0.2.2] - February 1, 2025
16+
17+
Improved efficiency of parsing script
18+
19+
20+
21+
[0.0.2] - November 27, 2024
22+
23+
Switched to webpack configuration
24+
25+
[0.0.3] - November 29, 2024
26+
27+
D3 Tree Hierarchy updates (element, text and etc)
28+
29+
[0.0.4] - December 5, 2024
30+
31+
Switched to VS Code extension configuration
32+
33+
[0.0.5] - December 7, 2024
34+
35+
Bundled D3 with extension rather than using CDN
36+
37+
[0.1.5] - December 11, 2024
38+
39+
Added the parsing script to the extension.ts file
40+
41+
[0.2.0] - December 11, 2024
42+
43+
Fixed formatting issues and receiving issues, extension MVP is working as intended
44+
[0.2.1] - January 18, 2025
45+
46+
Made parsing script more robust
47+
48+
Added mouseover event to nodes
49+
50+
51+

README.md

+7-22
Original file line numberDiff line numberDiff line change
@@ -18,32 +18,16 @@ NextFlow is a Next.js middleware visualizer for VS Code.
1818

1919
Flow Diagram: Visualize middleware execution across different routes.
2020

21-
Performance Metric Panel:
21+
Performance Metric Panel:
2222

2323
VS Code Integration: View middleware behavior directly in the editor.
2424

2525
## 📦 Installation
2626

27-
### Clone this repository:
28-
29-
```bash
30-
git clone https://github.com/oslabs-beta/NextFlow
31-
cd nextflow
32-
```
33-
### Install dependencies:
34-
```bash
35-
npm install
36-
```
37-
### Build the extension:
38-
```bash
39-
npm run build
40-
```
41-
### Load it into VS Code:
42-
```bash
43-
Open VS Code.
44-
Go to Extensions (Ctrl + Shift + X).
45-
```
46-
Click on Load Extension and select the dist folder.
27+
1. Open VS Code.
28+
2. Go to the Extensions view (Ctrl+Shift+X).
29+
3. Search for "Reactive".
30+
4. Click Install.
4731

4832
## 🛠 Usage
4933

@@ -56,6 +40,7 @@ Click on Load Extension and select the dist folder.
5640
### How to contribute
5741
We welcome contributions! Feel free to submit issues and pull requests.
5842

43+
-Go to https://github.com/oslabs-beta/NextFlow/<br>
5944
-Fork the project<br>
6045
-Create your feature branch (git checkout -b feature/AmazingFeature)<br>
6146
-Commit your changes (git commit -m 'Add some AmazingFeature')<br>
@@ -67,7 +52,7 @@ We welcome contributions! Feel free to submit issues and pull requests.
6752
#### Jun Inton - [Github](https://github.com/JunInton)
6853
#### Anthony Noyola - [Github](https://github.com/antwonasn)
6954
#### Sung Jung - [Github](https://github.com/sungguk85)
70-
#### Carolina Robinson - [Github](https://github.com/CaroSaFe)
55+
#### Carolina Robson - [Github](https://github.com/CaroSaFe)
7156
#### Brendan Hoskins - [Github](https://github.com/BrendanHoskins)
7257

7358
## 📬 Contact

package.json

+6-16
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"name": "nextFlow",
3-
"displayName": "nextFlow",
4-
"description": "next.js middleware visualizer",
5-
"version": "0.0.1",
2+
"name": "NextFlow",
3+
"displayName": "NextFlow",
4+
"description": "Next.js middleware visualizer",
5+
"version": "1.0.0",
66
"engines": {
77
"vscode": "^1.92.2"
88
},
@@ -14,19 +14,9 @@
1414
"contributes": {
1515
"commands": [
1616
{
17-
"command": "nextFlow.helloWorld",
18-
"title": "Hello World",
19-
"category": "Testing"
20-
},
21-
{
22-
"command": "catCoding.start",
23-
"title": "Start a new cat coding session",
24-
"category": "Cat Coding"
25-
},
26-
{
27-
"command": "nextFlow.start",
17+
"command": "NextFlow.start",
2818
"title": "Display middleware dendrogram",
29-
"category": "nextFlow"
19+
"category": "NextFlow"
3020
}
3121
]
3222
},

src/extension.ts

+3-41
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,12 @@
1-
// The module 'vscode' contains the VS Code extensibility API
2-
// Import the module and reference it with the alias vscode in your code below
31
import * as vscode from 'vscode';
42
import * as path from 'path';
53
import parsingScript from './webview/parsingScript';
64

7-
// This method is called when your extension is activated
8-
// Your extension is activated the very first time the command is executed
95
export function activate(context: vscode.ExtensionContext) {
10-
// Use the console to output diagnostic information (console.log) and errors (console.error)
11-
// This line of code will only be executed once when your extension is activated
12-
console.log('Congratulations, your extension "nextFlow" is now active!');
136

14-
// The command has been defined in the package.json file
15-
// Now provide the implementation of the command with registerCommand
16-
// The commandId parameter must match the command field in package.json
17-
const d3 = vscode.commands.registerCommand('nextFlow.start', async () => {
7+
const d3 = vscode.commands.registerCommand('NextFlow.start', async () => {
188
const panel = vscode.window.createWebviewPanel(
19-
'nextFlow',
9+
'NextFlow',
2010
'NextFlow',
2111
vscode.ViewColumn.One,
2212
{
@@ -43,26 +33,17 @@ export function activate(context: vscode.ExtensionContext) {
4333
TypeScript: ['ts'],
4434
},
4535
};
46-
// console.log(message.text);
4736
const fileUri = await vscode.window.showOpenDialog(options);
48-
// console.log('fileUri: ', fileUri);
4937
if (fileUri && fileUri[0]) {
5038
const filePath = fileUri[0].fsPath;
51-
// console.log('filePath in extension.ts: ', filePath);
5239
try {
5340
const startCpu = process.cpuUsage();
5441
const startMemory = process.memoryUsage();
55-
// console.log('start', startCpu, startMemory);
5642

5743
const flare = await parsingScript(filePath);
5844

5945
const endCpu = process.cpuUsage(startCpu);
6046
const endMemory = process.memoryUsage();
61-
// console.log(
62-
// 'Difference time from start to end',
63-
// endCpu,
64-
// endMemory
65-
// );
6647

6748
const cpuUsage = {
6849
user: endCpu.user,
@@ -93,24 +74,8 @@ export function activate(context: vscode.ExtensionContext) {
9374
},
9475
};
9576

96-
// const flare = {
97-
// name: "app",
98-
// children: [
99-
// {
100-
// name: "/home",
101-
// children: [{ name: "/about",
102-
// children:[{ name: ":path*", children: [{name: ":/a"}, {name: ":/b"}, {name: ":/c"}] }]
103-
// },
104-
// { name: "/order", children: [{ name: '/order/:id', children: [{ name: ':item'}]}, { name: ':item' }]}]
105-
// },
106-
// { name: "/dashboard",
107-
// children:[{ name: "/dashboard/user", children: [{name: "/dashboard/user/settings"}, {name: "/dashboard/user/config"}] }]
108-
// }
109-
// ],
110-
// };
111-
// console.log('flare in extension.ts: ', flare);
11277
const baseDir = path.dirname(filePath);
113-
// console.log('baseDir: ', baseDir);
78+
11479
const compName = path.parse(filePath).base;
11580
panel.webview.postMessage({
11681
command: 'filePicked',
@@ -126,9 +91,7 @@ export function activate(context: vscode.ExtensionContext) {
12691
break;
12792

12893
case 'openMetricsPanel':
129-
// if (metricsData) {
13094

131-
// }
13295
const metricsPanel = vscode.window.createWebviewPanel(
13396
'metrics',
13497
'NextFlow Metrics',
@@ -283,5 +246,4 @@ function getWebviewContent(uri: vscode.Uri) {
283246
</html>`;
284247
}
285248

286-
// This method is called when your extension is deactivated
287249
export function deactivate() {}

src/test/d3Chart.test.ts

-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
import {createChart} from '../webview/d3Chart.js';
2-
// import * as d3 from 'd3';
3-
// const createChart = require('../webview/d3Chart.js');
4-
// const d3 = require('d3');
52

63
const mockFlareObject = {
74
name: "app",
@@ -19,17 +16,13 @@ const mockFlareObject = {
1916
],
2017
};
2118

22-
// jest.mock('d3');
2319

2420
describe('D3 Tests', () => {
2521
test('creates an SVG element', () => {
2622
const chart = createChart(mockFlareObject);
27-
console.log(chart);
2823
const chartContainer = document.createElement('div');
2924
chartContainer.id = 'chart';
3025

31-
// document.body.appendChild(chart);
32-
3326
expect(chart).toBeDefined();
3427

3528
});

src/test/extension.test.ts

-7
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ describe ('NextFlow Extension Test', () => {
7171
describe('activate', () => {
7272
test('should register the nextFlow.start command', () => {
7373
activate(context);
74-
// console.log(context);
7574
// Check that the 'nextFlow.start' command is registered
7675
expect(vscode.commands.registerCommand).toHaveBeenCalledWith(
7776
'nextFlow.start',
@@ -112,7 +111,6 @@ describe ('NextFlow Extension Test', () => {
112111
);
113112

114113
activate(context);
115-
// console.log(context.subscriptions[1].dispose);
116114

117115
// Mock createWebviewPanel
118116
const createWebviewPanelSpy = jest.spyOn(vscode.window, 'createWebviewPanel');
@@ -127,11 +125,6 @@ describe ('NextFlow Extension Test', () => {
127125
vscode.ViewColumn.Two,
128126
expect.objectContaining({ enableScripts: true, retainContextWhenHidden: true })
129127
);
130-
131-
// test('should call correct file path', () => {
132-
// expect(asWebviewUriMock.mock.calls.length).toBe(1)
133-
// });
134-
135128
});
136129
});
137130
});

src/test/parsingScript.test.ts

-3
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,7 @@ jest.mock('fs', () => {
3434

3535
describe('Parsing script', () => {
3636
test('should return a finalObject in the correct format for D3', async () => {
37-
// const input = mockFilePath;
38-
// console.log('mockFilePath', input);
3937
const result = await parsingScript(mockFilePath);
40-
// console.log('result', result);
4138
expect(result).toEqual(mockFinalObject);
4239
});
4340
});

0 commit comments

Comments
 (0)