-
Notifications
You must be signed in to change notification settings - Fork 308
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
Localization of metadata blocks #717
Conversation
Second attempt... needed the other boogs fixed first plus found one and missed UI metas * Use *pegjs* synchronously... I do have a portion of the routine for asynchronous *(done first)* but *(sync)* seems safer in the event of a production failure * Establish the `OpenUserJS` metadata block and migrate all collaboration there * Store localized `@name` and `@description`... not currently in use but available * Some, but not all, line lengths in affected files wrapped according to STYLEGUIDE.md * If no script description don't create the `p` tag on script lists * Some stray trailing commas removed * Some string constants shortened for error messages.. type 400 is Bad Request by standards and we shouldn't need to say that again. * Some DOC/UI changes to match **NOTE**: Still needs *mongoose* DB migration otherwise all the meta values used don't show up * Bumping project version... e.g. once the *mongoose* *(DB data)* migration occurs there is no going back to a prior project version otherwise there will be possible DB corruption/failures *(most notably the meta.js route)* in older commit HEADS Applies to OpenUserJS#285
Localization of metadata blocks Auto-merge... dry run with migration on local pro and seems good to go... already did my account... taking production down to do this.
if (supportURL) { | ||
script.hasSupport = true; |
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.
Btw this was the boog I found...
Here is the asynchronous routine I did about two months ago for loading pegjs so I can delete this branch locally: var parsers = null;
async.parallel([
// Read in the UserScript pegjs grammar file and parse the content
function (aCallback) {
var filename = './public/pegjs/blockUserScript.pegjs';
fs.readFile(filename, { encoding: 'utf8' }, function (aErr, aGrammar) {
var parserUserScript = null;
if (aErr) {
return aCallback(aErr);
}
try {
parserUserScript = PEG.buildParser(aGrammar, { allowedStartRules: ['line'] });
} catch (aE) {
return aCallback(aE);
}
aCallback(null, { UserScript: parserUserScript });
});
},
// Read in the OpenUserJS pegjs grammar file and parse the content
function (aCallback) {
var filename = './public/pegjs/blockOpenUserJS.pegjs';
fs.readFile(filename, { encoding: 'utf8' }, function (aErr, aGrammar) {
var parserOpenUserJS = null;
if (aErr) {
return aCallback(aErr);
}
try {
parserOpenUserJS = PEG.buildParser(aGrammar, { allowedStartRules: ['line'] });
} catch (aE) {
return aCallback(aE);
}
aCallback(null, { OpenUserJS : parserOpenUserJS });
});
}
], function (aErr, aParsers) {
if (aErr) {
throw aErr;
}
parsers = aParsers;
exports.parsers = aParsers;
}); ... this uses async to establish the parsers... I'm still a bit leery about doing that especially since it only helps startup time on VPS and gives the potential of |
* End focusing on peg and restore half/half viewing * Stop simulating the OpenUserJS metadata block since OUJS has support natively from OpenUserJS/OpenUserJS.org#285 via OpenUserJS/OpenUserJS.org#717 **NOTE** This will need some tweaking to dynamically handle any other blocks we may add for other sites should they choose to evolve this route just like OUJS is set up to do.
Second attempt... needed the other boogs fixed first plus found one and missed UI metas
OpenUserJS
metadata block and migrate all (future) collaboration there@name
and@description
... not currently in use but availablep
tag on script listsSome stray trailing commas removedWill mitigate this laterSome string constants shortened for error messages.. type 400 is Bad Request by standards and we shouldn't need to say that again.Will mitigate this laterNOTE: Still needs mongoose DB migration otherwise all the meta values used don't show up
Applies to #285
After some slumber and rechecks the modified migration routine should be able to knock things out on production... however I will need to take it offline later this evening to do this.