-
Notifications
You must be signed in to change notification settings - Fork 281
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
Watch and warn on rename or delete events for the root index.html file #564
Conversation
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.
Code looks good to me. Going to test it now.
@@ -0,0 +1,68 @@ | |||
/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50 */ | |||
/*global define, brackets, clearTimeout, setTimeout */ |
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.
don't need the last two
|
||
# extensions/extra/bramble-watch-index.html | ||
|
||
INDEX_HTML_FILE_MISSING_DIALOG_TITLE=Warning - Missing index.html file |
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.
Before this lands, we should remove these changes from the commit and add them into Thimble so that it will show up on Pontoon to be localized and when Brackets syncs this file, there won't be merge conflicts.
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.
Ah, OK, I misunderstood how to do this properly. The docs made me think I was supposed to do it here in Bramble. I'll do a PR against Thimble to add them there and remove these once you r+.
# extensions/extra/bramble-watch-index.html | ||
|
||
INDEX_HTML_FILE_MISSING_DIALOG_TITLE=Warning - Missing index.html file | ||
INDEX_HTML_FILE_MISSING_DIALOG_MESSAGE=Your project has no index.html file. Web servers look for index.html when URLs omit the filename, for example: google.com/ actually refers to google.com/index.html. Consider adding an index.html. |
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.
We also should simplify the wording for this a bit since when I was trying to explain this during a session, a lot of them were confused by "web servers".
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.
Yeah, I don't love the current text. Suggestions welcome, cc @flukeout
If you get a chance, can you copy and paste a screenshot of how this dialog looks? Don't have my env up and running at the moment. I'll work on some copy ideas and paste them here in a bit. |
I'm thinking of something along the lines of... You need an index.html page! Projects that don't contain an index.html page will appear broken to viewers, it's the first page that the browser tries to load. Question: when does this dialog pop-up? As soon as you right click and delete / rename? Are there an |
@gideonthomas I've updated this PR, and also split out the Thimble bits into mozilla/thimble.mozilla.org#1580 |
Ok looks like this works! @humphd could you also add these three lines above this one: https://github.com/mozilla/brackets/blob/master/scripts/properties2js.js#L174 var DSStoreIndex = folders.indexOf(".DS_Store");
if(DSStoreIndex > -1) {
folders.splice(DSStoreIndex, 1);
} I was constantly blocked from proper l10n running on Macs. After that I think this code is good to merge with @flukeout's copy/UI recommendations |
@flukeout here's the screenshot: |
I'm confused about strings again. Are you saying I need the strings here (Bramble) and in Thimble? Or just in Thimble? Also, I updated the strings to a version of what Luke wrote already. |
@humphd no sorry, the strings are fine in Thimble, you don't need them in Bramble. The code that I provide above (unrelated to your patch) just ignores |
@gideonthomas can you just take one last look at this? I made your change, but also remembered that I had to manually add the new extension to the service worker precache list. Also, remind me how you want this landed. Do I squash, then land the PR in GitHub? I can't remember your preference. |
r=me |
@gideonthomas reasking..."Also, remind me how you want this landed. Do I squash, then land the PR in GitHub? I can't remember your preference." |
@humphd you can use the "squash and merge" button in this pr to merge it in. |
This is part of https://github.com/mozilla/thimble.mozilla.org/issues/1569#issuecomment-258889724. It adds an extra extension (not loaded by default--it will need to be enabled in Thimble) to watch and warn on any delete or rename to the project's root
index.html
file.To test this, do the following:
npm run build
npm start
index.html
file, then try right-clicking andRename
andDelete
. Both should show a modal dialog with info.I'm not sure if the text I've got in the dialog is right. I want to do another patch in Thimble that offers to create an
index.html
on publish, but decided to only warn about the issue here.I've also added jshint excludes for
src/nls
to stop jshint complaining about strings as if they are code, and breaking the build.r? @gideonthomas, @flukeout