mirror of
https://github.com/google/blockly.git
synced 2026-01-11 19:07:08 +01:00
chore: merging develop
This commit is contained in:
@@ -122,13 +122,8 @@ function deployToAndClean(demoVersion) {
|
||||
* package.json.
|
||||
*/
|
||||
function getDemosVersion() {
|
||||
const minorVersion = packageJson.version.split('.')[1];
|
||||
const patchVersion = packageJson.version.split('.')[2];
|
||||
let demoVersion = minorVersion;
|
||||
if (patchVersion !== 0) {
|
||||
demoVersion += '-' + patchVersion;
|
||||
}
|
||||
return demoVersion;
|
||||
// Replace all '.' with '-' e.g. 9-3-3-beta-2
|
||||
return packageJson.version.replace(/\./g, '-');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -30,6 +30,13 @@ const {posixPath} = require('../helpers');
|
||||
// Build //
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* Path to the python runtime.
|
||||
* This will normalize the command across platforms (e.g. python3 on Linux and
|
||||
* Mac, python on Windows).
|
||||
*/
|
||||
const PYTHON = process.platform === 'win32' ? 'python' : 'python3';
|
||||
|
||||
/**
|
||||
* Suffix to add to compiled output files.
|
||||
*/
|
||||
@@ -380,7 +387,7 @@ error message above, try running:
|
||||
*/
|
||||
function generateMessages(done) {
|
||||
// Run js_to_json.py
|
||||
const jsToJsonCmd = `python3 scripts/i18n/js_to_json.py \
|
||||
const jsToJsonCmd = `${PYTHON} scripts/i18n/js_to_json.py \
|
||||
--input_file ${path.join('msg', 'messages.js')} \
|
||||
--output_dir ${path.join('msg', 'json')} \
|
||||
--quiet`;
|
||||
@@ -418,7 +425,8 @@ function buildLangfiles(done) {
|
||||
json_files = json_files.filter(file => file.endsWith('json') &&
|
||||
!(new RegExp(/(keys|synonyms|qqq|constants)\.json$/).test(file)));
|
||||
json_files = json_files.map(file => path.join('msg', 'json', file));
|
||||
const createMessagesCmd = `python3 ./scripts/i18n/create_messages.py \
|
||||
|
||||
const createMessagesCmd = `${PYTHON} ./scripts/i18n/create_messages.py \
|
||||
--source_lang_file ${path.join('msg', 'json', 'en.json')} \
|
||||
--source_synonym_file ${path.join('msg', 'json', 'synonyms.json')} \
|
||||
--source_constants_file ${path.join('msg', 'json', 'constants.json')} \
|
||||
@@ -559,7 +567,10 @@ function getChunkOptions() {
|
||||
// Figure out which chunk this is by looking for one of the
|
||||
// known chunk entrypoints in chunkFiles. N.B.: O(n*m). :-(
|
||||
const chunk = chunks.find(
|
||||
chunk => chunkFiles.find(f => f.endsWith(path.sep + chunk.entry)));
|
||||
chunk => chunkFiles.find(f => {
|
||||
return f.endsWith('/' + chunk.entry.replaceAll('\\', '/'));
|
||||
}
|
||||
));
|
||||
if (!chunk) throw new Error('Unable to identify chunk');
|
||||
|
||||
// Replace nicknames with the names we chose.
|
||||
|
||||
@@ -36,9 +36,8 @@ let upstream = null;
|
||||
function getUpstream() {
|
||||
if (upstream) return upstream;
|
||||
for (const line of String(execSync('git remote -v')).split('\n')) {
|
||||
const [remote, url] = line.split('\t');
|
||||
if (url.includes('github.com/google/blockly')) {
|
||||
upstream = remote;
|
||||
if (line.includes('google/blockly')) {
|
||||
upstream = line.split('\t')[0];
|
||||
return upstream;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ function rewriteEnum(code) {
|
||||
// })(names || (names = {}));
|
||||
const enumDefs =
|
||||
code.match(
|
||||
/\s+\(function \((\w+)\) \{\n[^}]*\}\)\(\1 [^)]+\1 = \{\}\)\);/g
|
||||
/\s+\(function \((\w+)\) \{\n[^}]*\}\)\(\1 [^)]+\1 = \{\}\)\);/g,
|
||||
) || [];
|
||||
for (const oldEnumDef of enumDefs) {
|
||||
// enumDef looks like a bunch of lines in one of these two formats:
|
||||
|
||||
Reference in New Issue
Block a user