-
-
Notifications
You must be signed in to change notification settings - Fork 446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Organize source files into more directories #137
Conversation
70fcd18
to
2c1b695
Compare
Thanks @hurrymaplelad! Agreed that splitting things into directory will make things clearer, and allow for deduplicating the encryption code which is needed to support webcrypto without it being a pain to maintain (and would be generally nicer). I like the suggestions here. A couple a things come to mind:
So one idea is to:
What do you think? |
Thanks for taking a look! I usually use a separate This is definitely more overhead, so you're approach of keeping index.html at the root works for me if you prefer! |
2c1b695
to
b2139f3
Compare
Alrighty @robinmoisson - 729d8c2 should be pretty close to what you described:
I got rid of the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me, thank you for the quick iteration! I'm merging. 🙂
@@ -1,11 +1,8 @@ | |||
# Usage: `npm run build` | |||
# NPM establishes a reliable working directory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious - what do you mean by that line ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question!
If you've tried using relative paths in bash scripts, then you've probably seen discussions like
https://stackoverflow.com/q/59895 and http://mywiki.wooledge.org/BashFAQ/028.
It's notoriously tricky to get this right. However, npm run
provides some useful extra guarantees - it always executes the script with the working directory set to the directory that contains package.json
, regardless of which subdirectory npm run
was executed from.
That's why I didn't include a #! /bin/bash
or similar, and instead recommended npm run
.
Does that make sense?
Depends on #135.
This one's subjective, feel free to reject.
I noticed 3 things while working on #135:
I believe the directory shuffling in this PR sets us up to improve all three.
Re 1: #135 already removes the duplicate files committed to
cli/
, but it required listing all the copies in bothbuild.sh
and.gitignore
. These changes remove the need for any copies for the cli.Re 2: We should be setup to use the cli's templating to inline the duplicated code into
www
. I'll explore this in another PR.Re 3: I'm optimistic that the
cli/
,www/
andexample/
directories will make the different targets clear and keep them relatively isolated.