udacity / frontend-grading-engine

Providing immediate feedback for front-end code
MIT License
132 stars 170 forks source link

Why are source files placed in two places? #2

Closed notetiene closed 8 years ago

notetiene commented 8 years ago

In the repository, there are two places where source files are placed:

Given that we use a building tool, shouldn't we use only one directory to make the extension? It's much easier to maintain.

cameronwp commented 8 years ago

This structure is a relic of the way the extension evolved.

Essentially, when you build the files from src/ alone (with gulp watch), you're left with a JS file (GE.js) and an HTML import (feedback.html) that can be imported into any webpage. These make up the "original" grading engine that I first built for specific quizzes in Responsive Web Design Fundamentals.

The files in ext/src/ (excluding ext/src/js/libs/* and ext/src/templates/feedback.html) are the Chrome extension specific files that are responsible for injecting the aforementioned "original" grading engine into web pages.

When I turned the original grading engine into an extension, I basically converted a template from here into what we've got today. Frankly, I haven't put much thought into the file structure since then. I like that the grading engine specific files and the extension loading files are separated but I know there's room for improvement.

If you have any suggestions, I'm happy to take a look!

cameronwp commented 8 years ago

I feel like a pretty simple clarification would be renaming /ext/src to ext/app. The build tool doesn't touch anything in the ext/ directory anyway (besides depositing some built files there) so nothing should be called src/ in it. Thoughts?

cameronwp commented 8 years ago

Yeah, I like that idea. It's in master now :)

I'm happy to look at any other reorganization ideas!