├── .DS_Store
├── .vscode
└── launch.json
├── CODE_OF_CONDUCT.md
├── LICENSE.txt
├── Logo-designer-details.rtf
├── README.md
├── images
├── .DS_Store
├── Abstract-Tree.png
├── Component-Tree-Icon-Inspiration.png
├── Component-Tree-Tool.png
├── Cool-looking-use-of-tree.png
├── Grey-scale-color-palette.png
├── Inspiration-along-the-lines-of-tree.png
├── Nextjs-1.png
├── Nextjs-2.png
├── Nextjs-3.png
├── Nextjs-4.png
├── Nexus-idea.PNG
├── Roots-inspiration.png
└── component-tree-example-1.png
└── nexus
├── .DS_Store
├── .babelrc
├── .eslintrc.json
├── .gitignore
├── .vscode
├── extensions.json
├── launch.json
├── settings.json
└── tasks.json
├── .vscodeignore
├── LICENSE.txt
├── README.md
├── babel-plugin-macros.config.js
├── babel.config.js
├── dist
├── sidebar.js
└── sidebar.js.LICENSE.txt
├── media
├── filler.png
├── gif1.gif
├── gif2.gif
├── gif3.gif
├── icon.svg
├── logo.png
├── next-js.png
├── next-js.svg
├── nexus-vscode-icon.png
├── react-brands.png
├── react-brands.svg
├── styles.css
├── twitter-logo.svg
├── typescript.png
├── typescript.svg
├── vscode.png
├── vscode.svg
├── webpack.png
└── webpack.svg
├── out
├── .DS_Store
├── NexusProvider.js
├── NexusProvider.js.map
├── extension.js
├── extension.js.map
└── parser
│ ├── App.jsx
│ ├── Children.jsx
│ ├── Nested.jsx
│ ├── NextParser.js
│ ├── NextParser.js.map
│ ├── ReactParser.js
│ ├── ReactParser.js.map
│ ├── SSRComponent.jsx
│ ├── ScuttleCrab.jsx
│ ├── Silk.jsx
│ ├── newApp.jsx
│ ├── parser.js
│ ├── parser.js.map
│ ├── parserv2.js
│ └── parserv2.js.map
├── package-lock.json
├── package.json
├── src
├── .DS_Store
├── NexusProvider.ts
├── __tests__
│ ├── next-parser-test.js
│ ├── react-parser-test.js
│ ├── test_components
│ │ ├── App.jsx
│ │ ├── Child.jsx
│ │ ├── jams-n-jams-app
│ │ │ ├── components
│ │ │ │ ├── Cards
│ │ │ │ │ ├── Card.module.css
│ │ │ │ │ ├── CardEvent.js
│ │ │ │ │ └── CardItem.js
│ │ │ │ └── Nav
│ │ │ │ │ ├── Nav.js
│ │ │ │ │ └── Splash
│ │ │ │ │ └── Splash.js
│ │ │ └── pages
│ │ │ │ ├── _app.js
│ │ │ │ ├── api
│ │ │ │ ├── instruments
│ │ │ │ │ ├── drums
│ │ │ │ │ │ ├── [id].js
│ │ │ │ │ │ └── index.js
│ │ │ │ │ ├── guitars
│ │ │ │ │ │ ├── [id].js
│ │ │ │ │ │ └── index.js
│ │ │ │ │ └── keyboards
│ │ │ │ │ │ ├── [id].js
│ │ │ │ │ │ └── index.js
│ │ │ │ └── jams
│ │ │ │ │ ├── classic
│ │ │ │ │ ├── [id].js
│ │ │ │ │ └── index.js
│ │ │ │ │ ├── conserve
│ │ │ │ │ ├── [id].js
│ │ │ │ │ └── index.js
│ │ │ │ │ └── marmalades
│ │ │ │ │ ├── [id].js
│ │ │ │ │ └── index.js
│ │ │ │ ├── events
│ │ │ │ ├── calendar
│ │ │ │ │ ├── [id].js
│ │ │ │ │ └── index.js
│ │ │ │ ├── index.js
│ │ │ │ ├── past
│ │ │ │ │ ├── [id].js
│ │ │ │ │ └── index.js
│ │ │ │ └── submit
│ │ │ │ │ └── index.js
│ │ │ │ ├── index.js
│ │ │ │ ├── instruments
│ │ │ │ ├── drums
│ │ │ │ │ ├── [id].js
│ │ │ │ │ └── index.js
│ │ │ │ ├── guitars
│ │ │ │ │ ├── [id].js
│ │ │ │ │ └── index.js
│ │ │ │ ├── index.js
│ │ │ │ └── keyboards
│ │ │ │ │ ├── [id].js
│ │ │ │ │ └── index.js
│ │ │ │ └── jams
│ │ │ │ ├── classic
│ │ │ │ ├── [id].js
│ │ │ │ └── index.js
│ │ │ │ ├── conserves
│ │ │ │ ├── [id].js
│ │ │ │ └── index.js
│ │ │ │ ├── index.js
│ │ │ │ └── marmalades
│ │ │ │ ├── [id].js
│ │ │ │ └── index.js
│ │ └── newApp.jsx
│ └── webview-test.js
├── extension.ts
├── parser
│ ├── NextParser.js
│ ├── NextParser.ts
│ ├── ReactParser.js
│ └── ReactParser.ts
└── webview
│ ├── AddFile.jsx
│ ├── Leaf.jsx
│ ├── NavLeaf.jsx
│ ├── NodeWithChildren.jsx
│ ├── Prop.jsx
│ ├── SidebarContainer.jsx
│ └── renderToDom.js
├── tsconfig.json
└── webpack.config.js
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oslabs-beta/Nexus/98f5dd4062eec3660af79f67affcc715fc1c7022/.DS_Store
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | "version": "0.2.0",
6 | "configurations": []
7 | }
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | We as members, contributors, and leaders pledge to make participation in our
6 | community a harassment-free experience for everyone, regardless of age, body
7 | size, visible or invisible disability, ethnicity, sex characteristics, gender
8 | identity and expression, level of experience, education, socio-economic status,
9 | nationality, personal appearance, race, religion, or sexual identity
10 | and orientation.
11 |
12 | We pledge to act and interact in ways that contribute to an open, welcoming,
13 | diverse, inclusive, and healthy community.
14 |
15 | ## Our Standards
16 |
17 | Examples of behavior that contributes to a positive environment for our
18 | community include:
19 |
20 | * Demonstrating empathy and kindness toward other people
21 | * Being respectful of differing opinions, viewpoints, and experiences
22 | * Giving and gracefully accepting constructive feedback
23 | * Accepting responsibility and apologizing to those affected by our mistakes,
24 | and learning from the experience
25 | * Focusing on what is best not just for us as individuals, but for the
26 | overall community
27 |
28 | Examples of unacceptable behavior include:
29 |
30 | * The use of sexualized language or imagery, and sexual attention or
31 | advances of any kind
32 | * Trolling, insulting or derogatory comments, and personal or political attacks
33 | * Public or private harassment
34 | * Publishing others' private information, such as a physical or email
35 | address, without their explicit permission
36 | * Other conduct which could reasonably be considered inappropriate in a
37 | professional setting
38 |
39 | ## Enforcement Responsibilities
40 |
41 | Community leaders are responsible for clarifying and enforcing our standards of
42 | acceptable behavior and will take appropriate and fair corrective action in
43 | response to any behavior that they deem inappropriate, threatening, offensive,
44 | or harmful.
45 |
46 | Community leaders have the right and responsibility to remove, edit, or reject
47 | comments, commits, code, wiki edits, issues, and other contributions that are
48 | not aligned to this Code of Conduct, and will communicate reasons for moderation
49 | decisions when appropriate.
50 |
51 | ## Scope
52 |
53 | This Code of Conduct applies within all community spaces, and also applies when
54 | an individual is officially representing the community in public spaces.
55 | Examples of representing our community include using an official e-mail address,
56 | posting via an official social media account, or acting as an appointed
57 | representative at an online or offline event.
58 |
59 | ## Enforcement
60 |
61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
62 | reported to the community leaders responsible for enforcement at
63 | dplee123.
64 | All complaints will be reviewed and investigated promptly and fairly.
65 |
66 | All community leaders are obligated to respect the privacy and security of the
67 | reporter of any incident.
68 |
69 | ## Enforcement Guidelines
70 |
71 | Community leaders will follow these Community Impact Guidelines in determining
72 | the consequences for any action they deem in violation of this Code of Conduct:
73 |
74 | ### 1. Correction
75 |
76 | **Community Impact**: Use of inappropriate language or other behavior deemed
77 | unprofessional or unwelcome in the community.
78 |
79 | **Consequence**: A private, written warning from community leaders, providing
80 | clarity around the nature of the violation and an explanation of why the
81 | behavior was inappropriate. A public apology may be requested.
82 |
83 | ### 2. Warning
84 |
85 | **Community Impact**: A violation through a single incident or series
86 | of actions.
87 |
88 | **Consequence**: A warning with consequences for continued behavior. No
89 | interaction with the people involved, including unsolicited interaction with
90 | those enforcing the Code of Conduct, for a specified period of time. This
91 | includes avoiding interactions in community spaces as well as external channels
92 | like social media. Violating these terms may lead to a temporary or
93 | permanent ban.
94 |
95 | ### 3. Temporary Ban
96 |
97 | **Community Impact**: A serious violation of community standards, including
98 | sustained inappropriate behavior.
99 |
100 | **Consequence**: A temporary ban from any sort of interaction or public
101 | communication with the community for a specified period of time. No public or
102 | private interaction with the people involved, including unsolicited interaction
103 | with those enforcing the Code of Conduct, is allowed during this period.
104 | Violating these terms may lead to a permanent ban.
105 |
106 | ### 4. Permanent Ban
107 |
108 | **Community Impact**: Demonstrating a pattern of violation of community
109 | standards, including sustained inappropriate behavior, harassment of an
110 | individual, or aggression toward or disparagement of classes of individuals.
111 |
112 | **Consequence**: A permanent ban from any sort of public interaction within
113 | the community.
114 |
115 | ## Attribution
116 |
117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118 | version 2.0, available at
119 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120 |
121 | Community Impact Guidelines were inspired by [Mozilla's code of conduct
122 | enforcement ladder](https://github.com/mozilla/diversity).
123 |
124 | [homepage]: https://www.contributor-covenant.org
125 |
126 | For answers to common questions about this code of conduct, see the FAQ at
127 | https://www.contributor-covenant.org/faq. Translations are available at
128 | https://www.contributor-covenant.org/translations.
129 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2022 OSLabs Beta
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
4 | associated documentation files (the "Software"), to deal in the Software without restriction, including
5 | without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
6 | copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
7 | following conditions:
8 |
9 | The above copyright notice and this permission notice shall be included in all copies or substantial
10 | portions of the Software.
11 |
12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
13 | LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
14 | EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
15 | ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
16 | DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/Logo-designer-details.rtf:
--------------------------------------------------------------------------------
1 | {\rtf1\ansi\ansicpg1252\cocoartf2636
2 | \cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
3 | {\colortbl;\red255\green255\blue255;}
4 | {\*\expandedcolortbl;;}
5 | \margl1440\margr1440\vieww11520\viewh8400\viewkind0
6 | \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
7 |
8 | \f0\fs24 \cf0 Nexus\
9 | None\
10 | A software development company that provides tools for senior developers to visualize their codebase and make smarter decisions\
11 | No website yet\
12 | \
13 | Tree (abstract, minimalist), roots\
14 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | ## About The Project
70 |
71 | Nexus is a VSCode Extension created for NextJS developers! As codebases scale in size and complexity, developers may feel overwhelmed as they keep track of tens of components and hundreds of props elements per file. Nexus aims to help developers overcome unnecessary mental strain through 3 main methods:
72 |
73 | 1. Displaying file-specific component hierarchy in your VSCode sidebar
74 | 2. Including component-specific state and props objects for parent and child components
75 | 3. Differentiating between server-side rendered and static-site generated components
76 |
77 | We at Team Nexus hope that you enjoy our extension, taking advantage of a time-tested component tree model that integrates the unique features of NextJS!
78 |
79 |
104 |
105 |
106 |
107 | ## Installation
108 |
109 | 1. Install Nexus
110 |
111 | 2. A node tree icon should appear on your sidebar. You've now installed Nexus! Woot Woot! Now on to the "Getting Started" section below.
112 |
113 | Note: If contributing, see the "Installation for Contributors" section below!
114 |
115 |
116 |
117 | ## Getting Started
118 |
119 | Congrats on installing Nexus! Now let's get it started.
120 |
121 |
122 | ### Prerequisites
123 |
124 | Nexus supports OSX, Windows, and WSL
125 |
126 |
127 | ## Usage
128 |
129 | 1. Click the node tree icon on your sidebar. An "Input File Here" button should appear on your side panel!
130 |
131 |
132 |
133 |
134 |
135 | 2. Click the button and your file explorer window will open. Select a file and press "Ok".
136 |
137 |
138 |
139 |
140 |
141 |
142 | 3. Your side panel should now render a component tree that displays SSG or SSR status! Clicking on components will render child components if they exist and hovering over components will display their props objects. Enjoy!
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 | ## Roadmap
152 |
153 | - [ ] Creating a webview to look deeper into structure of individual components
154 | - [ ] Making the parser more dynamic and flexible
155 | - [ ] Handling Link Components
156 | - [ ] Error checking in the frontend to ensure that uploaded files are either NextJS or React
157 | - [ ] Add status bar item for Nexus
158 | - [ ] Store component tree memory in VSCode
159 |
160 | See the [open issues](https://github.com/oslabs-beta/Nexus/issues) for a full list of proposed features (and known issues).
161 |
162 |
163 |
164 |
165 | ## Steps to Contribute
166 |
167 | Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.
168 |
169 | If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
170 | Don't forget to give the project a star! Thanks again!
171 |
172 | 1. Fork & Clone Nexus
173 | 2. Create your Feature Branch (`git checkout -b /`)
174 | 3. Make your Changes (See **Making Changes** below)
175 | 4. Commit your Changes (`git commit -m ''`)
176 | 5. Push to the Branch (`git push origin /`)
177 | 6. Open a Pull Request
178 |
179 |
180 |
181 | ### Making Changes
182 |
183 | 1. Make your changes!
184 | 2. Open /nexus/src/extension.ts and save any changes you made
185 | 3. Re-compile and re-build your extension using the command line: `npm run compile` & `npm run build`
186 | 4. Press F5. A new VSCode window should open. This is your debugging environment!
187 | 5. Repeat step 3 and refresh your debugging environment to test further changes
188 |
189 |
190 |
191 | ## License
192 |
193 | Distributed under the MIT License. See `LICENSE` for more information.
194 |
195 |
196 |
197 |
198 | ## The Nexus Team
199 |
200 | * Mike Hong [LinkedIn](https://www.linkedin.com/in/mykongee/) | [Github](https://github.com/mykongee)
201 | * Brian Chiang [LinkedIn](https://www.linkedin.com/in/brian-chiang-849a181a7/) | [Github](https://github.com/BChiang4)
202 | * David Lee [LinkedIn](https://www.linkedin.com/in/david-lee-39541411a/) | [Github](https://github.com/dplee123)
203 | * Nico Flores [LinkedIn](https://www.linkedin.com/in/nicolasaflores/) | [Github](https://github.com/nicoflrs)
204 | * Alex Hersler [LinkedIn](https://www.linkedin.com/in/alex-hersler/) | [Github](https://github.com/FoxEight)
205 |
206 |
207 | ## Contact Us
208 | Email: nexusjsadm@gmail.com
209 |
210 | Twitter: [@teamnexus_js](https://twitter.com/teamnexus_js)
211 |
212 | Website: [https://nexus-js.com/](https://nexus-js.com/)
213 |
--------------------------------------------------------------------------------
/images/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oslabs-beta/Nexus/98f5dd4062eec3660af79f67affcc715fc1c7022/images/.DS_Store
--------------------------------------------------------------------------------
/images/Abstract-Tree.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oslabs-beta/Nexus/98f5dd4062eec3660af79f67affcc715fc1c7022/images/Abstract-Tree.png
--------------------------------------------------------------------------------
/images/Component-Tree-Icon-Inspiration.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oslabs-beta/Nexus/98f5dd4062eec3660af79f67affcc715fc1c7022/images/Component-Tree-Icon-Inspiration.png
--------------------------------------------------------------------------------
/images/Component-Tree-Tool.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oslabs-beta/Nexus/98f5dd4062eec3660af79f67affcc715fc1c7022/images/Component-Tree-Tool.png
--------------------------------------------------------------------------------
/images/Cool-looking-use-of-tree.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oslabs-beta/Nexus/98f5dd4062eec3660af79f67affcc715fc1c7022/images/Cool-looking-use-of-tree.png
--------------------------------------------------------------------------------
/images/Grey-scale-color-palette.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oslabs-beta/Nexus/98f5dd4062eec3660af79f67affcc715fc1c7022/images/Grey-scale-color-palette.png
--------------------------------------------------------------------------------
/images/Inspiration-along-the-lines-of-tree.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oslabs-beta/Nexus/98f5dd4062eec3660af79f67affcc715fc1c7022/images/Inspiration-along-the-lines-of-tree.png
--------------------------------------------------------------------------------
/images/Nextjs-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oslabs-beta/Nexus/98f5dd4062eec3660af79f67affcc715fc1c7022/images/Nextjs-1.png
--------------------------------------------------------------------------------
/images/Nextjs-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oslabs-beta/Nexus/98f5dd4062eec3660af79f67affcc715fc1c7022/images/Nextjs-2.png
--------------------------------------------------------------------------------
/images/Nextjs-3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oslabs-beta/Nexus/98f5dd4062eec3660af79f67affcc715fc1c7022/images/Nextjs-3.png
--------------------------------------------------------------------------------
/images/Nextjs-4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oslabs-beta/Nexus/98f5dd4062eec3660af79f67affcc715fc1c7022/images/Nextjs-4.png
--------------------------------------------------------------------------------
/images/Nexus-idea.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oslabs-beta/Nexus/98f5dd4062eec3660af79f67affcc715fc1c7022/images/Nexus-idea.PNG
--------------------------------------------------------------------------------
/images/Roots-inspiration.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oslabs-beta/Nexus/98f5dd4062eec3660af79f67affcc715fc1c7022/images/Roots-inspiration.png
--------------------------------------------------------------------------------
/images/component-tree-example-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oslabs-beta/Nexus/98f5dd4062eec3660af79f67affcc715fc1c7022/images/component-tree-example-1.png
--------------------------------------------------------------------------------
/nexus/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oslabs-beta/Nexus/98f5dd4062eec3660af79f67affcc715fc1c7022/nexus/.DS_Store
--------------------------------------------------------------------------------
/nexus/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | presets: ["@babel/preset-env", "@babel/preset-react"]
3 | }
--------------------------------------------------------------------------------
/nexus/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "root": true,
3 | "parser": "@typescript-eslint/parser",
4 | "parserOptions": {
5 | "ecmaVersion": 6,
6 | "sourceType": "module"
7 | },
8 | "plugins": [
9 | "@typescript-eslint"
10 | ],
11 | "rules": {
12 | "@typescript-eslint/naming-convention": "warn",
13 | "@typescript-eslint/semi": "warn",
14 | "curly": "warn",
15 | "eqeqeq": "warn",
16 | "no-throw-literal": "warn",
17 | "semi": "off"
18 | },
19 | "ignorePatterns": [
20 | "out",
21 | "dist",
22 | "**/*.d.ts"
23 | ]
24 | }
25 |
--------------------------------------------------------------------------------
/nexus/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | nexus-extension-0.5.2.vsix
--------------------------------------------------------------------------------
/nexus/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | // See http://go.microsoft.com/fwlink/?LinkId=827846
3 | // for the documentation about the extensions.json format
4 | "recommendations": [
5 | "dbaeumer.vscode-eslint"
6 | ]
7 | }
8 |
--------------------------------------------------------------------------------
/nexus/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | // A launch configuration that compiles the extension and then opens it inside a new window
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | {
6 | "version": "0.2.0",
7 | "configurations": [
8 | {
9 | "name": "Run Extension",
10 | "type": "extensionHost",
11 | "request": "launch",
12 | "args": [
13 | "--extensionDevelopmentPath=${workspaceFolder}"
14 | ],
15 | "outFiles": [
16 | "${workspaceFolder}/out/**/*.js"
17 | ],
18 | "preLaunchTask": "${defaultBuildTask}"
19 | },
20 | {
21 | "name": "Extension Tests",
22 | "type": "extensionHost",
23 | "request": "launch",
24 | "args": [
25 | "--extensionDevelopmentPath=${workspaceFolder}",
26 | "--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
27 | ],
28 | "outFiles": [
29 | "${workspaceFolder}/out/test/**/*.js"
30 | ],
31 | "preLaunchTask": "${defaultBuildTask}"
32 | }
33 | ]
34 | }
35 |
--------------------------------------------------------------------------------
/nexus/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | // Place your settings in this file to overwrite default and user settings.
2 | {
3 | "files.exclude": {
4 | "out": false // set this to true to hide the "out" folder with the compiled JS files
5 | },
6 | "search.exclude": {
7 | "out": true // set this to false to include "out" folder in search results
8 | },
9 | // Turn off tsc task auto detection since we have the necessary tasks as npm scripts
10 | "typescript.tsc.autoDetect": "off"
11 | }
--------------------------------------------------------------------------------
/nexus/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | // See https://go.microsoft.com/fwlink/?LinkId=733558
2 | // for the documentation about the tasks.json format
3 | {
4 | "version": "2.0.0",
5 | "tasks": [
6 | {
7 | "type": "npm",
8 | "script": "watch",
9 | "problemMatcher": "$tsc-watch",
10 | "isBackground": true,
11 | "presentation": {
12 | "reveal": "never"
13 | },
14 | "group": {
15 | "kind": "build",
16 | "isDefault": true
17 | }
18 | }
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/nexus/.vscodeignore:
--------------------------------------------------------------------------------
1 | .vscode/**
2 | .vscode-test/**
3 | src/**
4 | .gitignore
5 | .yarnrc
6 | vsc-extension-quickstart.md
7 | **/tsconfig.json
8 | **/.eslintrc.json
9 | **/*.map
10 | **/*.ts
11 |
--------------------------------------------------------------------------------
/nexus/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2022 OSLabs Beta
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
4 | associated documentation files (the "Software"), to deal in the Software without restriction, including
5 | without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
6 | copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
7 | following conditions:
8 |
9 | The above copyright notice and this permission notice shall be included in all copies or substantial
10 | portions of the Software.
11 |
12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
13 | LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
14 | EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
15 | ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
16 | DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/nexus/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
13 |
14 |
15 |
16 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | ## About The Project
70 |
71 | Nexus is a VSCode Extension created for NextJS developers! As codebases scale in size and complexity, developers may feel overwhelmed as they keep track of tens of components and hundreds of props elements per file. Nexus aims to help developers overcome unnecessary mental strain through 3 main methods:
72 |
73 | 1. Displaying file-specific component hierarchy in your VSCode sidebar
74 | 2. Including component-specific state and props objects for parent and child components
75 | 3. Differentiating between server-side rendered and static-site generated components
76 |
77 | We at Team Nexus hope that you enjoy our extension, taking advantage of a time-tested component tree model that integrates the unique features of NextJS!
78 |
79 |
104 |
105 |
106 |
107 | ## Installation
108 |
109 | 1. Install Nexus
110 |
111 | 2. A node tree icon should appear on your sidebar. You've now installed Nexus! Woot Woot! Now on to the "Getting Started" section below.
112 |
113 | Note: If contributing, see the "Installation for Contributors" section below!
114 |
115 |
116 |
117 | ## Getting Started
118 |
119 | Congrats on installing Nexus! Now let's get it started.
120 |
121 |
122 | ### Prerequisites
123 |
124 | Nexus supports OSX, Windows, and WSL
125 |
126 |
127 | ## Usage
128 |
129 | 1. Click the node tree icon on your sidebar. An "Input File Here" button should appear on your side panel!
130 |
131 |
132 |
133 |
134 |
135 | 2. Click the button and your file explorer window will open. Select a file and press "Ok".
136 |
137 |
138 |
139 |
140 |
141 |
142 | 3. Your side panel should now render a component tree that displays SSG or SSR status! Clicking on components will render child components if they exist and hovering over components will display their props objects. Enjoy!
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 | ## Roadmap
152 |
153 | - [ ] Creating a webview to look deeper into structure of individual components
154 | - [ ] Making the parser more dynamic and flexible
155 | - [ ] Handling Link Components
156 | - [ ] Error checking in the frontend to ensure that uploaded files are either NextJS or React
157 | - [ ] Add status bar item for Nexus
158 | - [ ] Store component tree memory in VSCode
159 |
160 | See the [open issues](https://github.com/oslabs-beta/Nexus/issues) for a full list of proposed features (and known issues).
161 |
162 |
163 |
164 |
165 | ## Steps to Contribute
166 |
167 | Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.
168 |
169 | If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
170 | Don't forget to give the project a star! Thanks again!
171 |
172 | 1. Fork & Clone Nexus
173 | 2. Create your Feature Branch (`git checkout -b /`)
174 | 3. Make your Changes (See **Making Changes** below)
175 | 4. Commit your Changes (`git commit -m ''`)
176 | 5. Push to the Branch (`git push origin /`)
177 | 6. Open a Pull Request
178 |
179 |
180 |
181 | ### Making Changes
182 |
183 | 1. Make your changes!
184 | 2. Open /nexus/src/extension.ts and save any changes you made
185 | 3. Re-compile and re-build your extension using the command line: `npm run compile` & `npm run build`
186 | 4. Press F5. A new VSCode window should open. This is your debugging environment!
187 | 5. Repeat step 3 and refresh your debugging environment to test further changes
188 |
189 |
190 |
191 | ## License
192 |
193 | Distributed under the MIT License. See `LICENSE` for more information.
194 |
195 |
196 |
197 |
198 | ## The Nexus Team
199 |
200 | * Mike Hong [LinkedIn](https://www.linkedin.com/in/mykongee/) | [Github](https://github.com/mykongee)
201 | * Brian Chiang [LinkedIn](https://www.linkedin.com/in/brian-chiang-849a181a7/) | [Github](https://github.com/BChiang4)
202 | * David Lee [LinkedIn](https://www.linkedin.com/in/david-lee-39541411a/) | [Github](https://github.com/dplee123)
203 | * Nico Flores [LinkedIn](https://www.linkedin.com/in/nicolasaflores/) | [Github](https://github.com/nicoflrs)
204 | * Alex Hersler [LinkedIn](https://www.linkedin.com/in/alex-hersler/) | [Github](https://github.com/FoxEight)
205 |
206 |
207 | ## Contact Us
208 | Email: nexusjsadm@gmail.com
209 |
210 | Twitter: [@teamnexus_js](https://twitter.com/teamnexus_js)
211 |
212 | Website: [https://nexus-js.com/](https://nexus-js.com/)
213 |
214 |
--------------------------------------------------------------------------------
/nexus/babel-plugin-macros.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | 'fontawesome-svg-core': {
3 | 'license': 'free'
4 | }
5 | }
--------------------------------------------------------------------------------
/nexus/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = function (api) {
2 | api.cache(true);
3 | return {
4 | plugins: ['macros'],
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/nexus/dist/sidebar.js.LICENSE.txt:
--------------------------------------------------------------------------------
1 | /*
2 | object-assign
3 | (c) Sindre Sorhus
4 | @license MIT
5 | */
6 |
7 | /*!
8 | * Font Awesome Free 6.0.0 by @fontawesome - https://fontawesome.com
9 | * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
10 | * Copyright 2022 Fonticons, Inc.
11 | */
12 |
13 | /** @license React v0.20.2
14 | * scheduler.production.min.js
15 | *
16 | * Copyright (c) Facebook, Inc. and its affiliates.
17 | *
18 | * This source code is licensed under the MIT license found in the
19 | * LICENSE file in the root directory of this source tree.
20 | */
21 |
22 | /** @license React v17.0.2
23 | * react-dom.production.min.js
24 | *
25 | * Copyright (c) Facebook, Inc. and its affiliates.
26 | *
27 | * This source code is licensed under the MIT license found in the
28 | * LICENSE file in the root directory of this source tree.
29 | */
30 |
31 | /** @license React v17.0.2
32 | * react.production.min.js
33 | *
34 | * Copyright (c) Facebook, Inc. and its affiliates.
35 | *
36 | * This source code is licensed under the MIT license found in the
37 | * LICENSE file in the root directory of this source tree.
38 | */
39 |
--------------------------------------------------------------------------------
/nexus/media/filler.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oslabs-beta/Nexus/98f5dd4062eec3660af79f67affcc715fc1c7022/nexus/media/filler.png
--------------------------------------------------------------------------------
/nexus/media/gif1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oslabs-beta/Nexus/98f5dd4062eec3660af79f67affcc715fc1c7022/nexus/media/gif1.gif
--------------------------------------------------------------------------------
/nexus/media/gif2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oslabs-beta/Nexus/98f5dd4062eec3660af79f67affcc715fc1c7022/nexus/media/gif2.gif
--------------------------------------------------------------------------------
/nexus/media/gif3.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oslabs-beta/Nexus/98f5dd4062eec3660af79f67affcc715fc1c7022/nexus/media/gif3.gif
--------------------------------------------------------------------------------
/nexus/media/icon.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/nexus/media/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oslabs-beta/Nexus/98f5dd4062eec3660af79f67affcc715fc1c7022/nexus/media/logo.png
--------------------------------------------------------------------------------
/nexus/media/next-js.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oslabs-beta/Nexus/98f5dd4062eec3660af79f67affcc715fc1c7022/nexus/media/next-js.png
--------------------------------------------------------------------------------
/nexus/media/next-js.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/nexus/media/nexus-vscode-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oslabs-beta/Nexus/98f5dd4062eec3660af79f67affcc715fc1c7022/nexus/media/nexus-vscode-icon.png
--------------------------------------------------------------------------------
/nexus/media/react-brands.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oslabs-beta/Nexus/98f5dd4062eec3660af79f67affcc715fc1c7022/nexus/media/react-brands.png
--------------------------------------------------------------------------------
/nexus/media/react-brands.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/nexus/media/styles.css:
--------------------------------------------------------------------------------
1 | * {
2 | box-sizing: border-box;
3 | padding: 0;
4 | margin: 0;
5 | }
6 |
7 | .tree-container {
8 | position: relative;
9 | background-color: #333;
10 | border: 2px solid #ddd;
11 | padding: 7px;
12 | border-radius: 1px;
13 | /* z-index: -2; */
14 | }
15 |
16 | .comp-with-children-container {
17 | display: block;
18 | position: relative;
19 | left: 20px;
20 | margin-top: 10px;
21 | }
22 |
23 | .comp-with-children-name,
24 | .top-level-component,
25 | .leaf-comp-name {
26 | font-weight: normal;
27 | margin-left: 10px;
28 | margin-right: 8px;
29 | padding: 4px 8px;
30 | /* border: 2px solid purple;
31 | border-radius: 10px; */
32 | }
33 |
34 | .comp-with-children-container::before {
35 | content: '';
36 | position: absolute;
37 | transform: rotate(90deg);
38 | height: 1px;
39 | width: 30px;
40 | background-color: #b08ac5;
41 | left: -8px;
42 | top: -9px;
43 | z-index: 0;
44 | }
45 |
46 | .comp-with-children-name::before {
47 | content: '';
48 | position: absolute;
49 | height: 1px;
50 | width: 11px;
51 | background-color: #b08ac5;
52 | left: 16px;
53 | top: 12px;
54 | z-index: 0;
55 | }
56 |
57 | .comp-with-children-container::before:hover {
58 | color: #7e74fa;
59 | }
60 |
61 | .comp-with-children-name::before:hover {
62 | color: #7e74fa;
63 | }
64 |
65 | .leaf-comp-container::before {
66 | content: '';
67 | position: absolute;
68 | transform: rotate(90deg);
69 | height: 1px;
70 | width: 39px;
71 | background-color: #b08ac5;
72 | left: -33px;
73 | top: -6px;
74 | z-index: 0;
75 | }
76 |
77 | .leaf-comp-name::before {
78 | content: '';
79 | position: absolute;
80 | height: 1px;
81 | width: 23px;
82 | background-color: #b08ac5;
83 | left: -13px;
84 | top: 15px;
85 | z-index: 0;
86 | }
87 |
88 | /* .comp-with-children-container::after {
89 | content: '';
90 | position: absolute;
91 | height: 2px;
92 | width: 10px;
93 | background-color: purple;
94 | left: 30px;
95 | top: 15px;
96 | } */
97 |
98 | /* .info_icon::before {
99 | content: '';
100 | position: absolute;
101 | height: 2px;
102 | width: 10px;
103 | background-color: purple;
104 | left: 80px;
105 | top: 12px;
106 | z-index: 1;
107 | } */
108 |
109 | /* .info_icon-inner::before {
110 | content: '';
111 | position: absolute;
112 | height: 2px;
113 | width: 10px;
114 | background-color: orange;
115 | left: 0px;
116 | top: 12px;
117 | z-index: 1;
118 | } */
119 |
120 | /* .comp-with-children-name::before {
121 | content: 'branch';
122 | transform: rotate(90deg);
123 | height: 3px;
124 | width: 10px;
125 | background-color: purple;
126 | left: 5px;
127 | } */
128 |
129 | .leaf-comp-container {
130 | display: block;
131 | position: relative;
132 | left: 40px;
133 | margin-top: 10px;
134 | margin-right: 5px;
135 | }
136 |
137 | .nav-leaf-comp-container {
138 | /* margin-left: 2px; */
139 | }
140 |
141 | .node-icon {
142 | position: relative;
143 | bottom: -10px;
144 | margin-right: 25px;
145 | color: #b08ac5;
146 | z-index: 2;
147 | }
148 |
149 | .add-file-container {
150 | background-color: #333;
151 | border: 2px solid #ddd;
152 | padding: 10px 15px;
153 | margin-bottom: 10px;
154 | border-radius: 1px;
155 | }
156 |
157 | .add-file-header {
158 | margin-top: 5px;
159 | margin-bottom: 10px;
160 | }
161 |
162 | .add-file-message {
163 | font-size: 14px;
164 | line-height: 1.2;
165 | margin-bottom: 6px;
166 | }
167 |
168 | .add-file-btn-container {
169 | display: flex;
170 | justify-content: center;
171 | }
172 |
173 | .file-input {
174 | margin-top: 10px;
175 | margin-bottom: 3px;
176 | width: 90px;
177 | border-radius: 3px;
178 | }
179 |
180 | .file-input:hover {
181 | cursor: pointer;
182 | }
183 |
184 | .generate-tree-message {
185 | padding: 5px;
186 | font-size: 14px;
187 | }
188 |
189 | .info_icon {
190 | color: #b08ac5;
191 | z-index: 2;
192 |
193 | /* margin-left: 8px; */
194 | }
195 |
196 | #tips {
197 | background-color: #7e74fa;
198 | padding: 10px;
199 | border-radius: 5px;
200 | }
201 |
202 | .leaf-Node h3,
203 | .leaf-Node a {
204 | display: inline;
205 | }
206 |
207 | .data-key {
208 | color: rgb(155, 18, 155);
209 | font-family: monospace;
210 | }
211 |
212 | .node_icon:hover,
213 | .comp-with-children-name:hover,
214 | .fav_icon:hover,
215 | .info_icon:hover,
216 | .top-level-component:hover {
217 | cursor: pointer;
218 | z-index: 2;
219 | }
220 |
221 | .container-intro {
222 | position: relative;
223 | height: 100%;
224 | }
225 |
226 | .container-intro h1,
227 | .container-intro a {
228 | display: inline;
229 | vertical-align: top;
230 | font-family: 'Open Sans', sans-serif;
231 | font-size: 16px;
232 | line-height: 28px;
233 | }
234 |
235 | .fav_icon:hover {
236 | color: #7e74fa;
237 | z-index: 2;
238 | }
239 |
240 | .fav_icon {
241 | /* margin: 3px; */
242 | color: #b08ac5;
243 | z-index: 2;
244 | }
245 |
--------------------------------------------------------------------------------
/nexus/media/twitter-logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
17 |
--------------------------------------------------------------------------------
/nexus/media/typescript.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oslabs-beta/Nexus/98f5dd4062eec3660af79f67affcc715fc1c7022/nexus/media/typescript.png
--------------------------------------------------------------------------------
/nexus/media/typescript.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/nexus/media/vscode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oslabs-beta/Nexus/98f5dd4062eec3660af79f67affcc715fc1c7022/nexus/media/vscode.png
--------------------------------------------------------------------------------
/nexus/media/vscode.svg:
--------------------------------------------------------------------------------
1 |
42 |
--------------------------------------------------------------------------------
/nexus/media/webpack.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oslabs-beta/Nexus/98f5dd4062eec3660af79f67affcc715fc1c7022/nexus/media/webpack.png
--------------------------------------------------------------------------------
/nexus/media/webpack.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/nexus/out/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oslabs-beta/Nexus/98f5dd4062eec3660af79f67affcc715fc1c7022/nexus/out/.DS_Store
--------------------------------------------------------------------------------
/nexus/out/NexusProvider.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4 | return new (P || (P = Promise))(function (resolve, reject) {
5 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8 | step((generator = generator.apply(thisArg, _arguments || [])).next());
9 | });
10 | };
11 | Object.defineProperty(exports, "__esModule", { value: true });
12 | exports.deactivate = exports.NexusProvider = void 0;
13 | const ReactParser_js_1 = require("./parser/ReactParser.js");
14 | const NextParser_js_1 = require("./parser/NextParser.js");
15 | const vscode = require("vscode");
16 | const path = require('path');
17 | const fs = require('fs');
18 | // class object for webviewView content
19 | class NexusProvider {
20 | constructor(_extensionUri) {
21 | this._extensionUri = _extensionUri;
22 | }
23 | // send message to webviewAPI with data using webview.postMessage(data)
24 | parseCodeBaseAndSendMessage(filePath) {
25 | let str = filePath;
26 | // allows for multi-platform compatability (Linux, Mac, etc.)
27 | if (process.platform === 'linux') {
28 | if (/wsl\$/.test(filePath)) {
29 | str = '/home' + filePath.split('home')[1].replace(/\\/g, '/');
30 | }
31 | else {
32 | str = '/mnt/c/' + filePath.slice(3);
33 | str = str.replace(/\\/g, '/');
34 | }
35 | }
36 | let resultObj;
37 | // if file is ending in '.js', send it into the Next.Js parser route
38 | if (str.slice(-3) === '.js') {
39 | resultObj = new NextParser_js_1.NextParser(fs.readFileSync(str), str);
40 | }
41 | // otherwise, send the file through the React parser route
42 | else {
43 | resultObj = new ReactParser_js_1.ReactParser(fs.readFileSync(str));
44 | }
45 | // pull the parsed object from the parser, to be sent to the front-end
46 | const data = resultObj.main();
47 | console.log('Congratulations, your extension "nexus" is now active!');
48 | this._view.webview.postMessage({ name: 'App', children: data });
49 | }
50 | // stage the initial html elements to the VSCode WebviewView
51 | resolveWebviewView(webviewView) {
52 | this._view = webviewView;
53 | webviewView.webview.options = {
54 | enableScripts: true,
55 | localResourceRoots: [this._extensionUri],
56 | };
57 | webviewView.webview.onDidReceiveMessage((data) => __awaiter(this, void 0, void 0, function* () {
58 | switch (data.type) {
59 | case 'addFile': {
60 | this.parseCodeBaseAndSendMessage(data.value);
61 | }
62 | }
63 | }));
64 | webviewView.webview.html = this._getHtmlForWebview(webviewView.webview);
65 | }
66 | _getHtmlForWebview(webview) {
67 | const scriptUri = webview.asWebviewUri(vscode.Uri.joinPath(this._extensionUri, 'dist', 'sidebar.js'));
68 | const styleVSCodeUri = webview.asWebviewUri(vscode.Uri.joinPath(this._extensionUri, 'media', 'styles.css'));
69 | return `
70 |
71 |
72 |
73 |
77 |
78 |
79 |
80 |
81 |
82 |
83 | `;
84 | }
85 | }
86 | exports.NexusProvider = NexusProvider;
87 | NexusProvider.viewType = 'nexus.componentTreeView';
88 | function deactivate() { }
89 | exports.deactivate = deactivate;
90 | //# sourceMappingURL=NexusProvider.js.map
--------------------------------------------------------------------------------
/nexus/out/NexusProvider.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"NexusProvider.js","sourceRoot":"","sources":["../src/NexusProvider.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4DAAsD;AACtD,0DAAoD;AACpD,iCAAiC;AACjC,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAC7B,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAEzB,uCAAuC;AACvC,MAAa,aAAa;IAGxB,YAA6B,aAAyB;QAAzB,kBAAa,GAAb,aAAa,CAAY;IACtD,CAAC;IAED,uEAAuE;IAChE,2BAA2B,CAAC,QAAgB;QACjD,IAAI,GAAG,GAAG,QAAQ,CAAC;QAEvB,6DAA6D;QACzD,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE;YAChC,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;gBAC1B,GAAG,GAAG,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;aAC/D;iBAAM;gBACL,GAAG,GAAG,SAAS,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBAEpC,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;aAC/B;SACF;QAED,IAAI,SAAS,CAAC;QAElB,oEAAoE;QAChE,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK,EAAE;YAC3B,SAAS,GAAG,IAAI,0BAAU,CAAC,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;SACvD;QAEL,0DAA0D;aACjD;YACH,SAAS,GAAG,IAAI,4BAAW,CAAC,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC;SACnD;QAEL,sEAAsE;QAClE,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,EAAE,CAAC;QAC9B,OAAO,CAAC,GAAG,CAAC,wDAAwD,CAAC,CAAC;QACtE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IAClE,CAAC;IAEH,4DAA4D;IACnD,kBAAkB,CAAC,WAA+B;QACvD,IAAI,CAAC,KAAK,GAAG,WAAW,CAAC;QAEzB,WAAW,CAAC,OAAO,CAAC,OAAO,GAAG;YAC5B,aAAa,EAAE,IAAI;YACnB,kBAAkB,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC;SACzC,CAAC;QAEF,WAAW,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAM,IAAI,EAAC,EAAE;YACnD,QAAQ,IAAI,CAAC,IAAI,EAAE;gBACjB,KAAK,SAAS,CAAC,CAAC;oBACd,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;iBAC9C;aACF;QACH,CAAC,CAAA,CAAC,CAAC;QACH,WAAW,CAAC,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,kBAAkB,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAC1E,CAAC;IAED,kBAAkB,CAAC,OAAuB;QACxC,MAAM,SAAS,GAAG,OAAO,CAAC,YAAY,CACpC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,MAAM,EAAE,YAAY,CAAC,CAC9D,CAAC;QACF,MAAM,cAAc,GAAG,OAAO,CAAC,YAAY,CACzC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,EAAE,YAAY,CAAC,CAC/D,CAAC;QAEF,OAAO;;;;;;;;kBAQO,cAAc;;;;uBAIT,SAAS;;gBAEhB,CAAC;IACf,CAAC;;AAjFH,sCAkFC;AAhFwB,sBAAQ,GAAG,yBAAyB,CAAC;AAkF9D,SAAgB,UAAU,KAAI,CAAC;AAA/B,gCAA+B"}
--------------------------------------------------------------------------------
/nexus/out/extension.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Object.defineProperty(exports, "__esModule", { value: true });
3 | exports.activate = void 0;
4 | const vscode = require("vscode");
5 | const path = require("path");
6 | const fs = require("fs");
7 | const NexusProvider_1 = require("./NexusProvider");
8 | // activates the extension upon interaction with the sidebar
9 | function activate(context) {
10 | const provider = new NexusProvider_1.NexusProvider(context.extensionUri);
11 | context.subscriptions.push(vscode.window.registerWebviewViewProvider(NexusProvider_1.NexusProvider.viewType, provider));
12 | }
13 | exports.activate = activate;
14 | ;
15 | //# sourceMappingURL=extension.js.map
--------------------------------------------------------------------------------
/nexus/out/extension.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"extension.js","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":";;;AAAA,iCAAiC;AACjC,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAC7B,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AACzB,mDAAgD;AAEhD,4DAA4D;AAC5D,SAAgB,QAAQ,CAAC,OAAgC;IACvD,MAAM,QAAQ,GAAG,IAAI,6BAAa,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IACzD,OAAO,CAAC,aAAa,CAAC,IAAI,CACxB,MAAM,CAAC,MAAM,CAAC,2BAA2B,CAAC,6BAAa,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAC5E,CAAC;AAEJ,CAAC;AAND,4BAMC;AAAA,CAAC"}
--------------------------------------------------------------------------------
/nexus/out/parser/App.jsx:
--------------------------------------------------------------------------------
1 | // Example React component for testing parser logic.
2 |
3 | import React from 'react';
4 | import { Link } from 'react-router-dom';
5 | import Chatrooms from './components/Chatrooms.jsx';
6 | import Chatroom from './components/Chatroom.jsx';
7 | import styles from './styles.css';
8 | import Children from './Children.jsx';
9 | import ScuttleCrab from './ScuttleCrab.jsx';
10 | import SSRComponent from './SSRComponent.jsx';
11 |
12 | const URL = 'http://google.com';
13 | const NUMBER = 10;
14 | function FUNC() {
15 | console.log('func');
16 | }
17 | const FUNCTWO = () => {
18 | return 2;
19 | };
20 |
21 | export async function getStaticProps() {
22 | const allPostsData = 'function';
23 | return {
24 | props: {
25 | allPostsData,
26 | },
27 | };
28 | }
29 |
30 | const App = props => {
31 | const socket = io();
32 |
33 | return (
34 |
33 | {/* if the file has not been uploaded, render the welcome text. if it has been uploaded, render the success message */}
34 | {!this.state.uploaded ? (
35 |
36 |
Welcome to Nexus!
37 |
38 | If you are working with a Next.js codebase, upload your top level index.js file in the
39 | pages directory.
40 |
41 |
42 | If you are working with a React codebase, upload your top level App component that is
43 | rendered to the DOM.
44 |
45 |
46 | ) : (
47 |
48 |
49 | Tree generated! Feel free to upload another entry file at any time
50 |
} class='box'>
30 |
31 |
32 | }
33 |
34 | >
35 | );
36 | }
37 | }
38 |
39 | export default NavLeaf;
40 |
--------------------------------------------------------------------------------
/nexus/src/webview/NodeWithChildren.jsx:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import Leaf from './Leaf.jsx';
3 | import Prop from './Prop.jsx';
4 |
5 | // imports for icons
6 | import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
7 | import { faCirclePlus, faCircleInfo, faCircleMinus } from '@fortawesome/free-solid-svg-icons';
8 | import Tippy from '@tippyjs/react';
9 |
10 | class NodeWithChildren extends Component {
11 | constructor(props) {
12 | super(props);
13 | this.state = {
14 | children: [],
15 | expanded: false,
16 | };
17 | // bind the function to this context so it can be invoked from any instantiation of the Component
18 | this.handleClick = this.handleClick.bind(this);
19 | }
20 |
21 | // handle click function that renders the children data (aka child components, data fetching methods, props) passed down as props
22 | handleClick() {
23 | // if the component is not expanded (children are not rendered), updated state with children stored in props.node.children
24 | if (!this.state.expanded) {
25 | this.setState(prevState => {
26 | // checking special case in which the children nodes are nested in a subarray within the children array. also short circuiting this conditional if array is empty.
27 | if (this.props.node.children.length === 0 || !Array.isArray(this.props.node.children[0])) {
28 | return {
29 | ...prevState,
30 | children: this.props.node.children,
31 | expanded: true,
32 | };
33 | } else {
34 | return {
35 | ...prevState,
36 | children: this.props.node.children[0],
37 | expanded: true,
38 | };
39 | }
40 | });
41 | // if the children are rendered, update children property in state to be an empty array, effectvely furling the parent back up
42 | } else {
43 | this.setState(prevState => {
44 | return {
45 | ...prevState,
46 | children: [],
47 | expanded: false,
48 | };
49 | });
50 | }
51 | }
52 |
53 | render() {
54 | let propsArray = [];
55 | // iterate through the node's props property, generating Prop components
56 | for (const prop in this.props.node.props) {
57 | propsArray.push();
58 | }
59 |
60 | // initialize array into which we push children components when there are children nodes in state
61 | let childrenComp = [];
62 | // if there are children nodes in state
63 | if (this.state.children.length) {
64 | // generate components and map them to childrenComp
65 | childrenComp = this.state.children.map(child => {
66 | // if the child node itself has children, recursively render a NodeWithChildren component
67 | if (child.children.length) {
68 | return ;
69 | // if the child node itself has no children, render a Leaf component
70 | } else {
71 | return ;
72 | }
73 | });
74 | }
75 |
76 | return (
77 | // inside the NodeWithChildren Components, render the Child Component, data fetching method, props...
78 |
79 |
9 | >
10 | );
11 | }
12 |
--------------------------------------------------------------------------------
/nexus/src/webview/SidebarContainer.jsx:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import NodeWithChildren from './NodeWithChildren.jsx';
3 | import Leaf from './Leaf.jsx';
4 | import AddFile from './AddFile.jsx';
5 | import NavLeaf from './NavLeaf.jsx';
6 |
7 | // imports for icons
8 | import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
9 | import { faCirclePlus, faCircleMinus } from '@fortawesome/free-solid-svg-icons';
10 |
11 | class SidebarContainer extends Component {
12 | constructor() {
13 | super();
14 | this.childrenStore = [];
15 | this.state = {
16 | node: {
17 | name: null,
18 | props: null,
19 | children: [],
20 | dataFetching: null,
21 | gsPaths: null,
22 | fetchDependecy: null,
23 | },
24 | expanded: false,
25 | };
26 | this.handleClick = this.handleClick.bind(this);
27 | }
28 |
29 | componentDidMount() {
30 | // add event listener listening for message from NexusProvider, passing the data returned from the parser to the front end
31 | window.addEventListener('message', event => {
32 | // store the children array as a property in order to update children property in state in handleClick
33 | this.childrenStore = event.data.children;
34 | // update state with data from the parser
35 | this.setState(prevState => ({
36 | ...prevState,
37 | node: {
38 | name: event.data.name,
39 | },
40 | }));
41 | });
42 | }
43 |
44 | // onclick on the icon or the component name, update children property in state
45 | handleClick() {
46 | // if the children are not unfurled, update children property in state with childrenStore property
47 | if (!this.state.expanded) {
48 | this.setState(prevState => {
49 | let newNode = { ...prevState.node };
50 | return {
51 | node: {
52 | ...newNode,
53 | children: this.childrenStore,
54 | },
55 | expanded: true,
56 | };
57 | });
58 | // if the children are unfurled, updated children property in state with an empty array, effectively furling the children back into the parent
59 | } else {
60 | this.setState(prevState => {
61 | let newNode = { ...prevState.node };
62 | return {
63 | node: {
64 | ...newNode,
65 | children: [],
66 | },
67 | expanded: false,
68 | };
69 | });
70 | }
71 | }
72 |
73 | render() {
74 | // initialize array into which we push children components when there are children nodes in state
75 | let childrenComp = [];
76 | // if there are children nodes in state
77 | if (this.state.node.children) {
78 | // generate components and map them to childrenComp
79 | childrenComp = this.state.node.children.map(child => {
80 | // if the child node itself has children, render a NodeWithChildren component
81 | if (child.children.length) {
82 | return ;
83 | // if the node to render is a Nav node, this is a special case for styling, so render a special case NavLeaf component
84 | } else if (child.name === 'Nav') {
85 | return ;
86 | // if the child node itself has no children, render a Leaf component
87 | } else {
88 | return ;
89 | }
90 | });
91 | }
92 |
93 | return (
94 |
95 |
96 | {/* if there is a name property in state, render it, otherwise render the generate tree message */}
97 |
115 | )}
116 | {/* if the childrenComp array has any children, render the children, otherwise render an empty div */}
117 | {childrenComp.length ? childrenComp.reverse() : <>>}
118 |