mirror of
https://github.com/google/blockly.git
synced 2026-03-06 13:20:11 +01:00
chore: miscellaneous fixes to docs, style, and tests (#6705)
* docs(icon): Better description for Icon.prototype.setVisible Also tweak description of getBlock. * docs(blocks): Fix typo in description of BlockDefinition * chore(tests): Factor out common goog:chromeOptions * chore(build): Minor style fixes
This commit is contained in:
committed by
GitHub
parent
fccf8e436e
commit
3be3d4a6ff
@@ -14,7 +14,7 @@ goog.declareModuleId('Blockly.blocks');
|
||||
|
||||
|
||||
/**
|
||||
* A block definition. For now this very lose, but it can potentially
|
||||
* A block definition. For now this very loose, but it can potentially
|
||||
* be refined e.g. by replacing this typedef with a class definition.
|
||||
*/
|
||||
export type BlockDefinition = AnyDuringMigration;
|
||||
|
||||
@@ -179,14 +179,14 @@ export abstract class Icon {
|
||||
// No-op on base class.
|
||||
|
||||
/**
|
||||
* Show or hide the icon.
|
||||
* Show or hide the bubble.
|
||||
*
|
||||
* @param _visible True if the icon should be visible.
|
||||
* @param _visible True if the bubble should be visible.
|
||||
*/
|
||||
setVisible(_visible: boolean) {}
|
||||
|
||||
/**
|
||||
* Returns the block this icon is attached to.
|
||||
* @returns The block this icon is attached to.
|
||||
*/
|
||||
protected getBlock(): BlockSvg {
|
||||
if (!this.block_) {
|
||||
|
||||
@@ -168,7 +168,7 @@ function stripApacheLicense() {
|
||||
// Closure Compiler preserves dozens of Apache licences in the Blockly code.
|
||||
// Remove these if they belong to Google or MIT.
|
||||
// MIT's permission to do this is logged in Blockly issue #2412.
|
||||
return gulp.replace(new RegExp(licenseRegex, "g"), '\n\n\n\n');
|
||||
return gulp.replace(new RegExp(licenseRegex, 'g'), '\n\n\n\n');
|
||||
// Replace with the same number of lines so that source-maps are not affected.
|
||||
}
|
||||
|
||||
@@ -387,7 +387,7 @@ function generateMessages(done) {
|
||||
--input_file ${path.join('msg', 'messages.js')} \
|
||||
--output_dir ${path.join('msg', 'json')} \
|
||||
--quiet`;
|
||||
execSync(jsToJsonCmd, { stdio: 'inherit' });
|
||||
execSync(jsToJsonCmd, {stdio: 'inherit'});
|
||||
|
||||
console.log(`
|
||||
Regenerated several flies in msg/json/. Now run
|
||||
@@ -591,7 +591,7 @@ function getChunkOptions() {
|
||||
/**
|
||||
* RegExp that globally matches path.sep (i.e., "/" or "\").
|
||||
*/
|
||||
const pathSepRegExp = new RegExp(path.sep.replace(/\\/, '\\\\'), "g");
|
||||
const pathSepRegExp = new RegExp(path.sep.replace(/\\/, '\\\\'), 'g');
|
||||
|
||||
/**
|
||||
* Helper method for calling the Closure Compiler, establishing
|
||||
|
||||
@@ -42,22 +42,23 @@ async function runGeneratorsInBrowser(outputDir) {
|
||||
var options = {
|
||||
capabilities: {
|
||||
browserName: 'chrome',
|
||||
'goog:chromeOptions': {
|
||||
args: ['--allow-file-access-from-files'],
|
||||
},
|
||||
},
|
||||
logLevel: 'warn',
|
||||
services: ['selenium-standalone']
|
||||
};
|
||||
|
||||
// Run in headless mode on Github Actions.
|
||||
if (process.env.CI) {
|
||||
options.capabilities['goog:chromeOptions'] = {
|
||||
args: ['--headless', '--no-sandbox', '--disable-dev-shm-usage', '--allow-file-access-from-files']
|
||||
};
|
||||
options.capabilities['goog:chromeOptions'].args.push(
|
||||
'--headless', '--no-sandbox', '--disable-dev-shm-usage',);
|
||||
} else {
|
||||
// --disable-gpu is needed to prevent Chrome from hanging on Linux with
|
||||
// NVIDIA drivers older than v295.20. See
|
||||
// https://github.com/google/blockly/issues/5345 for details.
|
||||
options.capabilities['goog:chromeOptions'] = {
|
||||
args: ['--allow-file-access-from-files', '--disable-gpu']
|
||||
};
|
||||
options.capabilities['goog:chromeOptions'].args.push('--disable-gpu');
|
||||
}
|
||||
|
||||
var url = 'file://' + __dirname + '/index.html';
|
||||
|
||||
@@ -21,27 +21,25 @@ async function runMochaTestsInBrowser() {
|
||||
const options = {
|
||||
capabilities: {
|
||||
browserName: 'chrome',
|
||||
'goog:chromeOptions': {
|
||||
args: ['--allow-file-access-from-files'],
|
||||
},
|
||||
},
|
||||
services: [
|
||||
['selenium-standalone'],
|
||||
],
|
||||
logLevel: 'warn',
|
||||
};
|
||||
|
||||
// Run in headless mode on Github Actions.
|
||||
if (process.env.CI) {
|
||||
options.capabilities['goog:chromeOptions'] = {
|
||||
args: [
|
||||
'--headless', '--no-sandbox', '--disable-dev-shm-usage',
|
||||
'--allow-file-access-from-files',
|
||||
],
|
||||
};
|
||||
options.capabilities['goog:chromeOptions'].args.push(
|
||||
'--headless', '--no-sandbox', '--disable-dev-shm-usage',);
|
||||
} else {
|
||||
// --disable-gpu is needed to prevent Chrome from hanging on Linux with
|
||||
// NVIDIA drivers older than v295.20. See
|
||||
// https://github.com/google/blockly/issues/5345 for details.
|
||||
options.capabilities['goog:chromeOptions'] = {
|
||||
args: ['--allow-file-access-from-files', '--disable-gpu'],
|
||||
};
|
||||
options.capabilities['goog:chromeOptions'].args.push('--disable-gpu');
|
||||
}
|
||||
|
||||
const url = 'file://' + posixPath(__dirname) + '/index.html';
|
||||
|
||||
Reference in New Issue
Block a user