mirror of
https://github.com/google/blockly.git
synced 2026-01-06 00:20:37 +01:00
chore(build): Use chunked compilation (#5721)
* chore(build): Add "all" modules for blocks & generators
These modules (Blockly.blocks.all and Blockly.<Generator>.all) will
be the entry points for the corresponding chunks.
They also make it easier to pull in all the modules in each package
(e.g. for playground and tests).
It is necessary to set the Closure Compiler dependency_mode to
SORT_ONLY as otherwise it tries to compile the "all" modules before
their dependencies, which fails.
The only impact on the _compressed.js files is the addition of a short
string to the very end of each file, e.g.:
var module$exports$Blockly$JavaScript$all={};
* chore(deps): Add devDependency on closure-calculate-chunks
* feat(build): First pass at chunked complation
Add a new buildCompiled gulp target (npm run build:compiled) that
uses closure-calculate-chunks to do chunked compliation of core/,
blocks/ and generators/ all in a single pass.
This work is incomplete: the resulting *_compressed.js files don't
(yet) have UMD wrappers.
* chore(build): Generate chunk wrappers
A first pass; this does not have support for a namespace object yet.
* refactor(build): Use chunked compilation by default
Remove old "compressed" gulp tasks in favour of new "compiled" task.
* chore(build): Remove cruft from buildCompiled
Remove unneeded `done` parameter and commented-out options that had
been cargo-culted from the old build pipeline.
* fix(build): Fix test failures caused by new build pipeline
- Exclude closure/goog/base.js from compiler input; use
externs/goog-externs.js instead.
- Have the build:debug and build:strict targets only build the first
chunk (blockly_compressed.js).
- Fix namespace entries for blocks and generators.
* fix(build): Fix build failures on node v12
closure-calculate-chunks requires node.js v14 or later.
When running on node.js v14 or later have getChunkOptions save
the output of closure-calculate-chunks to
scripts/gulpfiles/chunks.json. When running on older versions of
node.js have it use this checked-in, cached output instead of
attempting to run closure-calculate-chunks.
* chore(build): enable --rename_prefix_namespace
This will allow modules in blocks/ and generators/ to use
goog.require to obtain the exports object of goog.modules from
core/.
* fix(build): Always build all chunks
The previous commit enabled --rename_prefix_namespace option to
Closure Compiler, and this causes the buildCompressed target to
work fine when run without --debug or --strict, but adding either
of those flags (as for example when `npm test` runs
`npm run build:debug`) causes an issue:
- Because of many compiler errors in blocks/ and generators/,
a previous commit added a hack to only build the first chunk
when doing debug/strict builds.
- When asked to build only one chunk, Closure Compiler ignores the
--rename_prefix_namespace flag, because it 'correctly' infers
that there are no later chunks that will need to access global
variables from the first chunk.
- This causes a test failure, because `npm test` first runs
`npm run build`, which generates a valid blockly_compressed.js,
but this is then overrwritten by an invalid one when it next runs
`npm run build:debug`.
(The invalid one is missing all `$.` prefixes on 'global' variables,
including on Blockly, so the wrapper's last two lines -
"$.Blockly.internal_ = $;" and "return $.Blockly" - fail.)
The fix is to add appropriate @suppress annotations to blocks/*.js and
generators/**/*.js and then remove the first-chunk-only hack.
* refactor(build): Just build once
Since the previous commit caused `npm run build:debug` to do
everything that `... build:compressed` does - and to produce
byte-for-byte identical output - it doesn't make sense to run
both when testing. To that end:
- Replace the build:debug and build:strict package scripts that
did `gulp buildCompressed --...` with new scripts build-debug
and build-strict that do `gulp build --...` instead.
(The target names are changed so as to extend our existing naming
convention as follows: a target named "foo:bar" does some sub-part
of the job done by target "foo", but a target named "foo-bar" does
all the work of the target "foo" with some extra options.)
- build:debug:log and build:strict:log are similarly replaced with
build-debug-log and build-strict-log.
- Modify run_all_tests.js to just do `npm run build-debug` instead of
doing both `npm run build` and `npm run build:debug`.
- Also remove the 'build:blocks' script that should have been removed
when the buildBlocks gulp task was deleted previously.
* refactor(build): Compile with base_minimal.js instead of base.js
Introduce a (very!) cut-down version of closure/goog/base.js named
base_minimal.js that is used as input to the compiler as an
alternative to using externs/goog-externs.js (which will be deleted
once the buildAdvancedCompilationTest target has been updated).
This will allow use of goog.setTestOnly since it will now exist in
compiled mode, and allows the changes made in 5b112db to filter
base.js out of the files for the first chunk to be reverted.
(It also obliges a change to the compiled-mode check in blockly.js.)
* fix(build): Fix buildAdvanceCompilationTest
- In build_tasks.js:
- Replace the old compile() function with a new one factored out of
buildCompiled().
- Update buildAdvancedCompilationTest to use the new compile()
and other helpers created in the meantime.
- Remove no-longer-used maybeAddClosureLibrary().
- Remove externs/{block,generator,goog}-externs.js, which are no longer
used by any compile pipeline.
- Update core/blockly.js to fix issue with detection of compiled mode
when using ADVANCED_OPTIMISATIONS.
- Update only other use of globalThis, in core/utils/xml.js, to
consistently treat it as a dictionary object.
- Update instructions in tests/compile/index.html.
This commit is sort-of-a-prerequisite to #5602; test:compile:advanced
was previously working but the generated `main_compresed.js` would
throw errors upon loading.
This commit is contained in:
committed by
GitHub
parent
ef0fa8331c
commit
985af10f6e
23
blocks/all.js
Normal file
23
blocks/all.js
Normal file
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @fileoverview All the blocks. (Entry point for blocks_compressed.js.)
|
||||
* @suppress {extraRequire}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
goog.module('Blockly.blocks.all');
|
||||
|
||||
goog.require('Blockly.blocks.colour');
|
||||
goog.require('Blockly.blocks.lists');
|
||||
goog.require('Blockly.blocks.logic');
|
||||
goog.require('Blockly.blocks.loops');
|
||||
goog.require('Blockly.blocks.math');
|
||||
goog.require('Blockly.blocks.procedures');
|
||||
goog.require('Blockly.blocks.texts');
|
||||
goog.require('Blockly.blocks.variables');
|
||||
goog.require('Blockly.blocks.variablesDynamic');
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Colour blocks for Blockly.
|
||||
* @suppress {extraRequire|missingRequire}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview List blocks for Blockly.
|
||||
* @suppress {extraRequire|missingRequire|checkTypes}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Logic blocks for Blockly.
|
||||
* @suppress {extraRequire|missingRequire|checkTypes}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Loop blocks for Blockly.
|
||||
* @suppress {extraRequire|missingRequire|checkTypes}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Math blocks for Blockly.
|
||||
* @suppress {extraRequire|missingRequire|checkTypes}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Procedure blocks for Blockly.
|
||||
* @suppress {extraRequire|missingRequire|checkTypes|globalThis|visibility}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Text blocks for Blockly.
|
||||
* @suppress {extraRequire|missingRequire|checkTypes}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Variable blocks for Blockly.
|
||||
* @suppress {extraRequire|missingRequire|checkTypes}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Variable blocks for Blockly.
|
||||
* @suppress {extraRequire|missingRequire|checkTypes}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
112
closure/goog/base_minimal.js
Normal file
112
closure/goog/base_minimal.js
Normal file
@@ -0,0 +1,112 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright The Closure Library Authors.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @fileoverview A minimal implementation of base.js.
|
||||
*
|
||||
* This file is used in place of base.js (Closure library bootstrap
|
||||
* code) when building Blockly using the Closure Compiler. Refer to
|
||||
* base.js for more information about items defined here.
|
||||
*
|
||||
* @provideGoog
|
||||
*/
|
||||
|
||||
/** @define {boolean} Overridden to true by the compiler. */
|
||||
var COMPILED = false;
|
||||
|
||||
/** @const */
|
||||
var goog = goog || {};
|
||||
|
||||
/**
|
||||
* Reference to the global object. This is provided as 'root' by the
|
||||
* UMD wrapper, but prefer globalThis if it is defined.
|
||||
*
|
||||
* https://www.ecma-international.org/ecma-262/9.0/index.html#sec-global-object
|
||||
*
|
||||
* @const
|
||||
* @type {!Global}
|
||||
* @suppress {undefinedVars}
|
||||
*/
|
||||
goog.global = globalThis || root;
|
||||
|
||||
/** @type {Object<string, (string|number|boolean)>|undefined} */
|
||||
goog.global.CLOSURE_DEFINES;
|
||||
|
||||
/**
|
||||
* Defines a named value.
|
||||
* When compiled the default can be overridden using the compiler options or the
|
||||
* value set in the CLOSURE_DEFINES object. Returns the defined value so that it
|
||||
* can be used safely in modules. Note that the value type MUST be either
|
||||
* boolean, number, or string.
|
||||
*
|
||||
* @param {string} name
|
||||
* @param {T} defaultValue
|
||||
* @return {T}
|
||||
* @template T
|
||||
*/
|
||||
goog.define = function(name, defaultValue) {
|
||||
return defaultValue;
|
||||
};
|
||||
|
||||
/** @define {boolean} */
|
||||
goog.DEBUG = goog.define('goog.DEBUG', false);
|
||||
|
||||
/** @define {boolean} */
|
||||
goog.DISALLOW_TEST_ONLY_CODE =
|
||||
goog.define('goog.DISALLOW_TEST_ONLY_CODE', COMPILED && !goog.DEBUG);
|
||||
|
||||
/**
|
||||
* @param {string} name
|
||||
*/
|
||||
goog.provide = function(name) {};
|
||||
|
||||
/**
|
||||
* @param {string} name
|
||||
* @return {void}
|
||||
*/
|
||||
goog.module = function(name) {};
|
||||
|
||||
/**
|
||||
* @param {string} name
|
||||
* @return {?}
|
||||
* @suppress {missingProvide}
|
||||
*/
|
||||
goog.module.get = function(name) {};
|
||||
|
||||
/** @suppress {missingProvide} */
|
||||
goog.module.declareLegacyNamespace = function() {};
|
||||
|
||||
/**
|
||||
* Marks that the current file should only be used for testing, and never for
|
||||
* live code in production.
|
||||
*
|
||||
* In the case of unit tests, the message may optionally be an exact namespace
|
||||
* for the test (e.g. 'goog.stringTest'). The linter will then ignore the extra
|
||||
* provide (if not explicitly defined in the code).
|
||||
*
|
||||
* @param {string=} opt_message Optional message to add to the error that's
|
||||
* raised when used in production code.
|
||||
*/
|
||||
goog.setTestOnly = function(opt_message) {
|
||||
if (goog.DISALLOW_TEST_ONLY_CODE) {
|
||||
opt_message = opt_message || '';
|
||||
throw new Error(
|
||||
'Importing test-only code into non-debug environment' +
|
||||
(opt_message ? ': ' + opt_message : '.'));
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {string} namespace
|
||||
* @return {?}
|
||||
*/
|
||||
goog.require = function(namespace) {};
|
||||
|
||||
/**
|
||||
* @param {string} namespace
|
||||
* @return {?}
|
||||
*/
|
||||
goog.requireType = function(namespace) {};
|
||||
@@ -184,6 +184,11 @@ goog.require('Blockly.Events.VarCreate');
|
||||
*/
|
||||
exports.VERSION = 'uncompiled';
|
||||
|
||||
/**
|
||||
* @define {boolean} Overridden to true by the compiler.
|
||||
*/
|
||||
const COMPILED = false;
|
||||
|
||||
// Add a getter and setter pair for Blockly.alert, Blockly.confirm,
|
||||
// Blockly.mainWorkspace, Blockly.prompt and Blockly.selected for backwards
|
||||
// compatibility.
|
||||
@@ -700,11 +705,7 @@ exports.zelos = zelos;
|
||||
//
|
||||
// This is only needed in uncompiled mode (see
|
||||
// google/blockly-samples#902); in compiled mode the exports object is
|
||||
// already the value of globalThis.Blockly. Because
|
||||
// closure/goog/base.js is not included in the compiler input, we
|
||||
// can't use goog.global['COMPILED'] to check if we are running in
|
||||
// compiled mode. Instead, use existence of globalThis.goog itself
|
||||
// for this purpose.
|
||||
// already the value of globalThis['Blockly'].
|
||||
//
|
||||
// Note that this code will still attempt to redefine accessors on a
|
||||
// previously-imported copy of the Blockly library if both are
|
||||
@@ -712,8 +713,8 @@ exports.zelos = zelos;
|
||||
// accessors are nonconfigurable (which is good, as otherwise one
|
||||
// accessors on one copy would call get/set functions on the other
|
||||
// copy!)
|
||||
if (globalThis.goog && globalThis.Blockly &&
|
||||
typeof globalThis.Blockly === 'object' && globalThis.Blockly !== exports) {
|
||||
if (!COMPILED && typeof globalThis['Blockly'] === 'object' &&
|
||||
globalThis['Blockly'] !== exports) {
|
||||
const descriptors = Object.getOwnPropertyDescriptors(exports);
|
||||
const accessors = {};
|
||||
for (const key in descriptors) {
|
||||
@@ -721,5 +722,5 @@ if (globalThis.goog && globalThis.Blockly &&
|
||||
accessors[key] = descriptors[key];
|
||||
}
|
||||
}
|
||||
Object.defineProperties(globalThis.Blockly, accessors);
|
||||
Object.defineProperties(globalThis['Blockly'], accessors);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ exports.NAME_SPACE = NAME_SPACE;
|
||||
* jsdom package instead.
|
||||
* @type {!Document}
|
||||
*/
|
||||
let xmlDocument = globalThis.document;
|
||||
let xmlDocument = globalThis['document'];
|
||||
|
||||
/**
|
||||
* Get the document object to use for XML serialization.
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @fileoverview Externs for Blockly blocks.
|
||||
* @externs
|
||||
*/
|
||||
|
||||
goog.provide('Blockly');
|
||||
goog.provide('Blockly.Blocks');
|
||||
goog.provide('Blockly.Comment');
|
||||
goog.provide('Blockly.FieldCheckbox');
|
||||
goog.provide('Blockly.FieldColour');
|
||||
goog.provide('Blockly.FieldDropdown');
|
||||
goog.provide('Blockly.FieldImage');
|
||||
goog.provide('Blockly.FieldLabel');
|
||||
goog.provide('Blockly.FieldMultilineInput');
|
||||
goog.provide('Blockly.FieldNumber');
|
||||
goog.provide('Blockly.FieldTextInput');
|
||||
goog.provide('Blockly.FieldVariable');
|
||||
goog.provide('Blockly.Mutator');
|
||||
goog.provide('Blockly.Warning');
|
||||
goog.provide('Blockly.loopMixin');
|
||||
|
||||
var Blockly;
|
||||
@@ -1,20 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @fileoverview Externs for Blockly generators.
|
||||
* @externs
|
||||
*/
|
||||
|
||||
goog.provide('Blockly');
|
||||
goog.provide('Blockly.Generator');
|
||||
goog.provide('Blockly.inputTypes');
|
||||
goog.provide('Blockly.loopMixin');
|
||||
goog.provide('Blockly.utils.global');
|
||||
goog.provide('Blockly.utils.object');
|
||||
goog.provide('Blockly.utils.string');
|
||||
|
||||
var Blockly;
|
||||
@@ -1,66 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @fileoverview Externs for goog.*
|
||||
*
|
||||
* These are needed because we use goog.module, goog.require etc. to
|
||||
* define our modules, but we don't actually include
|
||||
* closure/goog/base.js as input to the compiler. Originally we only
|
||||
* needed the extern for goog, but some time between Closure Compiler
|
||||
* versions 20210601.0.0 and 20211006.0.0 we started getting
|
||||
* JSC_POSSIBLE_INEXISTENT_PROPERTY errors for goog.module /
|
||||
* goog.require / goog.requireType declarations involving modules
|
||||
* which used goog.module.declareLegacyNamespace.
|
||||
*
|
||||
* @externs
|
||||
*/
|
||||
|
||||
/**
|
||||
* @type {!Object}
|
||||
*/
|
||||
var goog = {};
|
||||
|
||||
/**
|
||||
* @param {string} name
|
||||
* @return {void}
|
||||
*/
|
||||
goog.module = function(name) {};
|
||||
|
||||
/**
|
||||
* @return{void}
|
||||
*/
|
||||
goog.module.declareLegacyNamespace = function() {};
|
||||
|
||||
/**
|
||||
* @param {string} name
|
||||
* @return {?}
|
||||
*/
|
||||
goog.module.get = function(name) {};
|
||||
|
||||
/**
|
||||
* @param {string} name
|
||||
* @return {void}
|
||||
*/
|
||||
goog.provide = function(name) {};
|
||||
|
||||
/**
|
||||
* @param {string} namespace
|
||||
* @return {?}
|
||||
*/
|
||||
goog.require = function(namespace) {};
|
||||
|
||||
/**
|
||||
* @param {string} namespace
|
||||
* @return {?}
|
||||
*/
|
||||
goog.requireType = function(namespace) {};
|
||||
|
||||
/**
|
||||
* @param {string=} opt_message
|
||||
* @return{void}
|
||||
*/
|
||||
goog.setTestOnly = function(opt_message) {};
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Helper functions for generating Dart for blocks.
|
||||
* @suppress {missingRequire|checkTypes|globalThis}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
25
generators/dart/all.js
Normal file
25
generators/dart/all.js
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @fileoverview Complete helper functions for generating Dart for
|
||||
* blocks. This is the entrypoint for dart_compressed.js.
|
||||
* @suppress {extraRequire}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
goog.module('Blockly.Dart.all');
|
||||
|
||||
goog.require('Blockly.Dart.colour');
|
||||
goog.require('Blockly.Dart.lists');
|
||||
goog.require('Blockly.Dart.logic');
|
||||
goog.require('Blockly.Dart.loops');
|
||||
goog.require('Blockly.Dart.math');
|
||||
goog.require('Blockly.Dart.procedures');
|
||||
goog.require('Blockly.Dart.texts');
|
||||
goog.require('Blockly.Dart.variables');
|
||||
goog.require('Blockly.Dart.variablesDynamic');
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Generating Dart for list blocks.
|
||||
* @suppress {missingRequire}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Generating Dart for loop blocks.
|
||||
* @suppress {missingRequire}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Generating Dart for math blocks.
|
||||
* @suppress {missingRequire}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Generating Dart for procedure blocks.
|
||||
* @suppress {missingRequire}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Generating Dart for text blocks.
|
||||
* @suppress {missingRequire}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Generating Dart for variable blocks.
|
||||
* @suppress {missingRequire}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Generating Dart for dynamic variable blocks.
|
||||
* @suppress {extraRequire|missingRequire}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Helper functions for generating JavaScript for blocks.
|
||||
* @suppress {missingRequire|checkTypes|globalThis}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
25
generators/javascript/all.js
Normal file
25
generators/javascript/all.js
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @fileoverview Complete helper functions for generating JavaScript for
|
||||
* blocks. This is the entrypoint for javascript_compressed.js.
|
||||
* @suppress {extraRequire}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
goog.module('Blockly.JavaScript.all');
|
||||
|
||||
goog.require('Blockly.JavaScript.colour');
|
||||
goog.require('Blockly.JavaScript.lists');
|
||||
goog.require('Blockly.JavaScript.logic');
|
||||
goog.require('Blockly.JavaScript.loops');
|
||||
goog.require('Blockly.JavaScript.math');
|
||||
goog.require('Blockly.JavaScript.procedures');
|
||||
goog.require('Blockly.JavaScript.texts');
|
||||
goog.require('Blockly.JavaScript.variables');
|
||||
goog.require('Blockly.JavaScript.variablesDynamic');
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Generating JavaScript for list blocks.
|
||||
* @suppress {missingRequire}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Generating JavaScript for loop blocks.
|
||||
* @suppress {missingRequire}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Generating JavaScript for math blocks.
|
||||
* @suppress {missingRequire}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Generating JavaScript for procedure blocks.
|
||||
* @suppress {missingRequire}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Generating JavaScript for text blocks.
|
||||
* @suppress {missingRequire}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Generating JavaScript for variable blocks.
|
||||
* @suppress {missingRequire}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Generating JavaScript for dynamic variable blocks.
|
||||
* @suppress {extraRequire}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
/**
|
||||
* @fileoverview Helper functions for generating Lua for blocks.
|
||||
* Based on Ellen Spertus's blocky-lua project.
|
||||
* @suppress {missingRequire|checkTypes|globalThis}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
25
generators/lua/all.js
Normal file
25
generators/lua/all.js
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @fileoverview Complete helper functions for generating Lua for
|
||||
* blocks. This is the entrypoint for lua_compressed.js.
|
||||
* @suppress {extraRequire}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
goog.module('Blockly.Lua.all');
|
||||
|
||||
goog.require('Blockly.Lua.colour');
|
||||
goog.require('Blockly.Lua.lists');
|
||||
goog.require('Blockly.Lua.logic');
|
||||
goog.require('Blockly.Lua.loops');
|
||||
goog.require('Blockly.Lua.math');
|
||||
goog.require('Blockly.Lua.procedures');
|
||||
goog.require('Blockly.Lua.texts');
|
||||
goog.require('Blockly.Lua.variables');
|
||||
goog.require('Blockly.Lua.variablesDynamic');
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Generating Lua for list blocks.
|
||||
* @suppress {missingRequire}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Generating Lua for loop blocks.
|
||||
* @suppress {missingRequire}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Generating Lua for math blocks.
|
||||
* @suppress {missingRequire}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Generating Lua for procedure blocks.
|
||||
* @suppress {missingRequire}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Generating Lua for text blocks.
|
||||
* @suppress {missingRequire}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Generating Lua for variable blocks.
|
||||
* @suppress {missingRequire}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Generating Lua for dynamic variable blocks.
|
||||
* @suppress {extraRequire}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Helper functions for generating PHP for blocks.
|
||||
* @suppress {missingRequire|checkTypes|globalThis}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
25
generators/php/all.js
Normal file
25
generators/php/all.js
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @fileoverview Complete helper functions for generating PHP for
|
||||
* blocks. This is the entrypoint for php_compressed.js.
|
||||
* @suppress {extraRequire}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
goog.module('Blockly.PHP.all');
|
||||
|
||||
goog.require('Blockly.PHP.colour');
|
||||
goog.require('Blockly.PHP.lists');
|
||||
goog.require('Blockly.PHP.logic');
|
||||
goog.require('Blockly.PHP.loops');
|
||||
goog.require('Blockly.PHP.math');
|
||||
goog.require('Blockly.PHP.procedures');
|
||||
goog.require('Blockly.PHP.texts');
|
||||
goog.require('Blockly.PHP.variables');
|
||||
goog.require('Blockly.PHP.variablesDynamic');
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Generating PHP for list blocks.
|
||||
* @suppress {missingRequire}
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Generating PHP for loop blocks.
|
||||
* @suppress {missingRequire}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Generating PHP for math blocks.
|
||||
* @suppress {missingRequire}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Generating PHP for procedure blocks.
|
||||
* @suppress {missingRequire}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Generating PHP for text blocks.
|
||||
* @suppress {missingRequire}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Generating PHP for variable blocks.
|
||||
* @suppress {missingRequire}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Generating PHP for dynamic variable blocks.
|
||||
* @suppress {extraRequire}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Helper functions for generating Python for blocks.
|
||||
* @suppress {missingRequire|checkTypes|globalThis}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
25
generators/python/all.js
Normal file
25
generators/python/all.js
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @fileoverview Complete helper functions for generating Python for
|
||||
* blocks. This is the entrypoint for python_compressed.js.
|
||||
* @suppress {extraRequire}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
goog.module('Blockly.Python.all');
|
||||
|
||||
goog.require('Blockly.Python.colour');
|
||||
goog.require('Blockly.Python.lists');
|
||||
goog.require('Blockly.Python.logic');
|
||||
goog.require('Blockly.Python.loops');
|
||||
goog.require('Blockly.Python.math');
|
||||
goog.require('Blockly.Python.procedures');
|
||||
goog.require('Blockly.Python.texts');
|
||||
goog.require('Blockly.Python.variables');
|
||||
goog.require('Blockly.Python.variablesDynamic');
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Generating Python for list blocks.
|
||||
* @suppress {missingRequire}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Generating Python for loop blocks.
|
||||
* @suppress {missingRequire}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Generating Python for math blocks.
|
||||
* @suppress {missingRequire}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Generating Python for procedure blocks.
|
||||
* @suppress {missingRequire}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Generating Python for text blocks.
|
||||
* @suppress {missingRequire}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Generating Python for variable blocks.
|
||||
* @suppress {missingRequire}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Generating Python for dynamic variable blocks.
|
||||
* @suppress {extraRequire}
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -27,11 +27,8 @@ module.exports = {
|
||||
generateLangfiles: buildTasks.generateLangfiles,
|
||||
build: buildTasks.build,
|
||||
buildDeps: buildTasks.deps,
|
||||
buildCore: buildTasks.core,
|
||||
buildBlocks: buildTasks.blocks,
|
||||
buildLangfiles: buildTasks.langfiles,
|
||||
buildCompressed: buildTasks.compressed,
|
||||
buildGenerators: buildTasks.generators,
|
||||
buildCompiled: buildTasks.compiled,
|
||||
buildAdvancedCompilationTest: buildTasks.advancedCompilationTest,
|
||||
checkin: gulp.parallel(buildTasks.checkinBuilt, typings.checkinTypings),
|
||||
checkinBuilt: buildTasks.checkinBuilt,
|
||||
|
||||
245
package-lock.json
generated
245
package-lock.json
generated
@@ -19,6 +19,7 @@
|
||||
"babel-eslint": "^10.1.0",
|
||||
"chai": "^4.2.0",
|
||||
"clang-format": "^1.6.0",
|
||||
"closure-calculate-chunks": "^3.0.2",
|
||||
"concurrently": "^6.0.0",
|
||||
"eslint": "^7.28.0",
|
||||
"eslint-config-google": "^0.14.0",
|
||||
@@ -2407,6 +2408,76 @@
|
||||
"readable-stream": "^2.3.5"
|
||||
}
|
||||
},
|
||||
"node_modules/closure-calculate-chunks": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/closure-calculate-chunks/-/closure-calculate-chunks-3.0.2.tgz",
|
||||
"integrity": "sha512-nCpUyKcCF+Izk1CzobGu2HdHrlXAVguiM2gpmwW2UX+JAAJyPKyyYJPnIIifZ2wVuxZBG4FlVWjV69y8TOa5Bg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"acorn": "8.x",
|
||||
"acorn-walk": "8.x",
|
||||
"graphlib": "2.x",
|
||||
"open": "7.x",
|
||||
"resolve": "1.x",
|
||||
"sigma": "1.x",
|
||||
"temp": "0.x",
|
||||
"yargs": "16.x"
|
||||
},
|
||||
"bin": {
|
||||
"closure-calculate-chunks": "cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/closure-calculate-chunks/node_modules/acorn": {
|
||||
"version": "8.6.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.6.0.tgz",
|
||||
"integrity": "sha512-U1riIR+lBSNi3IbxtaHOIKdH8sLFv3NYfNv8sg7ZsNhcfl4HF2++BfqqrNAxoCLQW1iiylOj76ecnaUxz+z9yw==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"acorn": "bin/acorn"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/closure-calculate-chunks/node_modules/acorn-walk": {
|
||||
"version": "8.2.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz",
|
||||
"integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/closure-calculate-chunks/node_modules/get-caller-file": {
|
||||
"version": "2.0.5",
|
||||
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
|
||||
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": "6.* || 8.* || >= 10.*"
|
||||
}
|
||||
},
|
||||
"node_modules/closure-calculate-chunks/node_modules/yargs": {
|
||||
"version": "16.2.0",
|
||||
"resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz",
|
||||
"integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"cliui": "^7.0.2",
|
||||
"escalade": "^3.1.1",
|
||||
"get-caller-file": "^2.0.5",
|
||||
"require-directory": "^2.1.1",
|
||||
"string-width": "^4.2.0",
|
||||
"y18n": "^5.0.5",
|
||||
"yargs-parser": "^20.2.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/code-point-at": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
|
||||
@@ -5046,6 +5117,15 @@
|
||||
"integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/graphlib": {
|
||||
"version": "2.1.8",
|
||||
"resolved": "https://registry.npmjs.org/graphlib/-/graphlib-2.1.8.tgz",
|
||||
"integrity": "sha512-jcLLfkpoVGmH7/InMC/1hIvOPSUh38oJtGhvrOFGzioE1DZ+0YW16RgmOJhHiuWTvGiJQ9Z1Ik43JvkRPRvE+A==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"lodash": "^4.17.15"
|
||||
}
|
||||
},
|
||||
"node_modules/growl": {
|
||||
"version": "1.10.5",
|
||||
"resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz",
|
||||
@@ -8411,6 +8491,22 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/open": {
|
||||
"version": "7.4.2",
|
||||
"resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz",
|
||||
"integrity": "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"is-docker": "^2.0.0",
|
||||
"is-wsl": "^2.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/opener": {
|
||||
"version": "1.5.2",
|
||||
"resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz",
|
||||
@@ -10243,6 +10339,12 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/sigma": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/sigma/-/sigma-1.2.1.tgz",
|
||||
"integrity": "sha512-9Z0m1pssXv6sndPMvOzXnM1mVO73YCWDE6X5bKxJyG+9J0B9zJkgtgoBM7cnxEaJMzmrbxPceKTVpwF7cS/xqA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/signal-exit": {
|
||||
"version": "3.0.5",
|
||||
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.5.tgz",
|
||||
@@ -11033,6 +11135,43 @@
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/temp": {
|
||||
"version": "0.9.4",
|
||||
"resolved": "https://registry.npmjs.org/temp/-/temp-0.9.4.tgz",
|
||||
"integrity": "sha512-yYrrsWnrXMcdsnu/7YMYAofM1ktpL5By7vZhf15CrXijWWrEYZks5AXBudalfSWJLlnen/QUJUB5aoB0kqZUGA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"mkdirp": "^0.5.1",
|
||||
"rimraf": "~2.6.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/temp/node_modules/mkdirp": {
|
||||
"version": "0.5.5",
|
||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
|
||||
"integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"minimist": "^1.2.5"
|
||||
},
|
||||
"bin": {
|
||||
"mkdirp": "bin/cmd.js"
|
||||
}
|
||||
},
|
||||
"node_modules/temp/node_modules/rimraf": {
|
||||
"version": "2.6.3",
|
||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz",
|
||||
"integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"glob": "^7.1.3"
|
||||
},
|
||||
"bin": {
|
||||
"rimraf": "bin.js"
|
||||
}
|
||||
},
|
||||
"node_modules/text-table": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
|
||||
@@ -14183,6 +14322,57 @@
|
||||
"readable-stream": "^2.3.5"
|
||||
}
|
||||
},
|
||||
"closure-calculate-chunks": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/closure-calculate-chunks/-/closure-calculate-chunks-3.0.2.tgz",
|
||||
"integrity": "sha512-nCpUyKcCF+Izk1CzobGu2HdHrlXAVguiM2gpmwW2UX+JAAJyPKyyYJPnIIifZ2wVuxZBG4FlVWjV69y8TOa5Bg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"acorn": "8.x",
|
||||
"acorn-walk": "8.x",
|
||||
"graphlib": "2.x",
|
||||
"open": "7.x",
|
||||
"resolve": "1.x",
|
||||
"sigma": "1.x",
|
||||
"temp": "0.x",
|
||||
"yargs": "16.x"
|
||||
},
|
||||
"dependencies": {
|
||||
"acorn": {
|
||||
"version": "8.6.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.6.0.tgz",
|
||||
"integrity": "sha512-U1riIR+lBSNi3IbxtaHOIKdH8sLFv3NYfNv8sg7ZsNhcfl4HF2++BfqqrNAxoCLQW1iiylOj76ecnaUxz+z9yw==",
|
||||
"dev": true
|
||||
},
|
||||
"acorn-walk": {
|
||||
"version": "8.2.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz",
|
||||
"integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==",
|
||||
"dev": true
|
||||
},
|
||||
"get-caller-file": {
|
||||
"version": "2.0.5",
|
||||
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
|
||||
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
|
||||
"dev": true
|
||||
},
|
||||
"yargs": {
|
||||
"version": "16.2.0",
|
||||
"resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz",
|
||||
"integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"cliui": "^7.0.2",
|
||||
"escalade": "^3.1.1",
|
||||
"get-caller-file": "^2.0.5",
|
||||
"require-directory": "^2.1.1",
|
||||
"string-width": "^4.2.0",
|
||||
"y18n": "^5.0.5",
|
||||
"yargs-parser": "^20.2.2"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"code-point-at": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
|
||||
@@ -16285,6 +16475,15 @@
|
||||
"integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==",
|
||||
"dev": true
|
||||
},
|
||||
"graphlib": {
|
||||
"version": "2.1.8",
|
||||
"resolved": "https://registry.npmjs.org/graphlib/-/graphlib-2.1.8.tgz",
|
||||
"integrity": "sha512-jcLLfkpoVGmH7/InMC/1hIvOPSUh38oJtGhvrOFGzioE1DZ+0YW16RgmOJhHiuWTvGiJQ9Z1Ik43JvkRPRvE+A==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"lodash": "^4.17.15"
|
||||
}
|
||||
},
|
||||
"growl": {
|
||||
"version": "1.10.5",
|
||||
"resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz",
|
||||
@@ -19025,6 +19224,16 @@
|
||||
"mimic-fn": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"open": {
|
||||
"version": "7.4.2",
|
||||
"resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz",
|
||||
"integrity": "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"is-docker": "^2.0.0",
|
||||
"is-wsl": "^2.1.1"
|
||||
}
|
||||
},
|
||||
"opener": {
|
||||
"version": "1.5.2",
|
||||
"resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz",
|
||||
@@ -20478,6 +20687,12 @@
|
||||
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
|
||||
"dev": true
|
||||
},
|
||||
"sigma": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/sigma/-/sigma-1.2.1.tgz",
|
||||
"integrity": "sha512-9Z0m1pssXv6sndPMvOzXnM1mVO73YCWDE6X5bKxJyG+9J0B9zJkgtgoBM7cnxEaJMzmrbxPceKTVpwF7cS/xqA==",
|
||||
"dev": true
|
||||
},
|
||||
"signal-exit": {
|
||||
"version": "3.0.5",
|
||||
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.5.tgz",
|
||||
@@ -21151,6 +21366,36 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"temp": {
|
||||
"version": "0.9.4",
|
||||
"resolved": "https://registry.npmjs.org/temp/-/temp-0.9.4.tgz",
|
||||
"integrity": "sha512-yYrrsWnrXMcdsnu/7YMYAofM1ktpL5By7vZhf15CrXijWWrEYZks5AXBudalfSWJLlnen/QUJUB5aoB0kqZUGA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"mkdirp": "^0.5.1",
|
||||
"rimraf": "~2.6.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"mkdirp": {
|
||||
"version": "0.5.5",
|
||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
|
||||
"integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"minimist": "^1.2.5"
|
||||
}
|
||||
},
|
||||
"rimraf": {
|
||||
"version": "2.6.3",
|
||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz",
|
||||
"integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"glob": "^7.1.3"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"text-table": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
|
||||
|
||||
15
package.json
15
package.json
@@ -18,15 +18,13 @@
|
||||
},
|
||||
"scripts": {
|
||||
"build": "gulp build",
|
||||
"build:blocks": "gulp buildBlocks",
|
||||
"build:compressed": "gulp buildCompressed",
|
||||
"build:core": "gulp buildCore",
|
||||
"build:debug": "gulp buildCompressed --verbose --debug",
|
||||
"build:debug:log": "npm run build:debug > build-debug.log 2>&1 && tail -3 build-debug.log",
|
||||
"build-debug": "gulp build --verbose --debug",
|
||||
"build-debug-log": "npm run build:debug > build-debug.log 2>&1 && tail -3 build-debug.log",
|
||||
"build-strict": "gulp build --verbose --strict",
|
||||
"build-strict-log": "npm run build:strict > build-debug.log 2>&1 && tail -3 build-debug.log",
|
||||
"build:compiled": "gulp buildCompiled",
|
||||
"build:compressed": "npm run build:compiled",
|
||||
"build:deps": "gulp buildDeps",
|
||||
"build:strict": "gulp buildCompressed --verbose --strict",
|
||||
"build:strict:log": "npm run build:strict > build-debug.log 2>&1 && tail -3 build-debug.log",
|
||||
"build:generators": "gulp buildGenerators",
|
||||
"build:langfiles": "gulp buildLangfiles",
|
||||
"bump": "npm --no-git-tag-version version 4.$(date +'%Y%m%d').0",
|
||||
"clean": "gulp clean",
|
||||
@@ -74,6 +72,7 @@
|
||||
"babel-eslint": "^10.1.0",
|
||||
"chai": "^4.2.0",
|
||||
"clang-format": "^1.6.0",
|
||||
"closure-calculate-chunks": "^3.0.2",
|
||||
"concurrently": "^6.0.0",
|
||||
"eslint": "^7.28.0",
|
||||
"eslint-config-google": "^0.14.0",
|
||||
|
||||
@@ -32,6 +32,86 @@ var {getPackageJson} = require('./helper_tasks');
|
||||
// Build //
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* Suffix to add to compiled output files.
|
||||
*/
|
||||
const COMPILED_SUFFIX = '_compressed';
|
||||
|
||||
/**
|
||||
* Checked-in file to cache output of closure-calculate-chunks, to
|
||||
* allow for testing on node.js v12 (or earlier) which is not
|
||||
* compatible with closure-calculate-chunks.
|
||||
*/
|
||||
const CHUNK_CACHE_FILE = 'scripts/gulpfiles/chunks.json'
|
||||
|
||||
/**
|
||||
* Name of an object to be used as a shared "global" namespace by
|
||||
* chunks generated by the Closure Compiler with the
|
||||
* --rename_prefix_namespace option (see
|
||||
* https://github.com/google/closure-compiler/wiki/Chunk-output-for-dynamic-loading#using-global_namespace-as-the-chunk-output-type
|
||||
* for more information.) The wrapper for the first chunk will create
|
||||
* an object with this name and save it; wrappers for other chunks
|
||||
* will ensure that the same object is available with this same name.
|
||||
* The --rename_prefix_namespace option will then cause the compiled
|
||||
* chunks to create properties on this object instead of creating
|
||||
* "global" (really chunk-local) variables. This allows later chunks
|
||||
* to depend upon modules from earlier chunks.
|
||||
*
|
||||
* It can be any value that doesn't clash with a global variable or
|
||||
* wrapper argument, but as it will appear many times in the compiled
|
||||
* output it is preferable that it be short.
|
||||
*/
|
||||
const NAMESPACE_OBJECT = '$';
|
||||
|
||||
/**
|
||||
* A list of chunks. Order matters: later chunks can depend on
|
||||
* earlier ones, but not vice-versa. All chunks are assumed to depend
|
||||
* on the first chunk.
|
||||
*
|
||||
* The function getChunkOptions will, after running
|
||||
* closure-calculate-chunks, update each chunk to add the following
|
||||
* properties:
|
||||
*
|
||||
* - .dependencies: a list of the chunks the chunk depends upon.
|
||||
* - .wrapper: the chunk wrapper.
|
||||
*
|
||||
* Output files will be named <chunk.name><COMPILED_SUFFIX>.js.
|
||||
*/
|
||||
const chunks = [
|
||||
{
|
||||
name: 'blockly',
|
||||
entry: 'core/requires.js',
|
||||
namespace: 'Blockly',
|
||||
wrapperSetup: `const ${NAMESPACE_OBJECT}={};`,
|
||||
wrapperCleanup:
|
||||
`${NAMESPACE_OBJECT}.Blockly.internal_=${NAMESPACE_OBJECT};`,
|
||||
}, {
|
||||
name: 'blocks',
|
||||
entry: 'blocks/all.js',
|
||||
namespace: 'Blockly.blocks',
|
||||
}, {
|
||||
name: 'javascript',
|
||||
entry: 'generators/javascript/all.js',
|
||||
namespace: 'Blockly.JavaScript',
|
||||
}, {
|
||||
name: 'python',
|
||||
entry: 'generators/python/all.js',
|
||||
namespace: 'Blockly.Python',
|
||||
}, {
|
||||
name: 'php',
|
||||
entry: 'generators/php/all.js',
|
||||
namespace: 'Blockly.PHP',
|
||||
}, {
|
||||
name: 'lua',
|
||||
entry: 'generators/lua/all.js',
|
||||
namespace: 'Blockly.Lua',
|
||||
}, {
|
||||
name: 'dart',
|
||||
entry: 'generators/dart/all.js',
|
||||
namespace: 'Blockly.Dart',
|
||||
}
|
||||
];
|
||||
|
||||
const licenseRegex = `\\/\\*\\*
|
||||
\\* @license
|
||||
\\* (Copyright \\d+ (Google LLC|Massachusetts Institute of Technology))
|
||||
@@ -103,232 +183,6 @@ var JSCOMP_ERROR = [
|
||||
'visibility'
|
||||
];
|
||||
|
||||
/**
|
||||
* Helper method for calling the Closure compiler.
|
||||
* @param {*} compilerOptions
|
||||
* @param {boolean=} opt_verbose Optional option for verbose logging
|
||||
* @param {boolean=} opt_warnings_as_error Optional option for treating warnings
|
||||
* as errors.
|
||||
* @param {boolean=} opt_strict_typechecker Optional option for enabling strict
|
||||
* type checking.
|
||||
*/
|
||||
function compile(compilerOptions, opt_verbose, opt_warnings_as_error,
|
||||
opt_strict_typechecker) {
|
||||
const options = {};
|
||||
options.compilation_level = 'SIMPLE_OPTIMIZATIONS';
|
||||
options.warning_level = opt_verbose ? 'VERBOSE' : 'DEFAULT';
|
||||
options.language_in = 'ECMASCRIPT6_STRICT',
|
||||
options.language_out = 'ECMASCRIPT5_STRICT';
|
||||
options.rewrite_polyfills = true;
|
||||
options.hide_warnings_for = 'node_modules';
|
||||
if (opt_warnings_as_error || opt_strict_typechecker) {
|
||||
options.jscomp_error = JSCOMP_ERROR;
|
||||
if (opt_strict_typechecker) {
|
||||
options.jscomp_error.push('strictCheckTypes');
|
||||
}
|
||||
}
|
||||
|
||||
const platform = ['native', 'java', 'javascript'];
|
||||
|
||||
return closureCompiler({...options, ...compilerOptions}, { platform });
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method for possibly adding the Closure library into a sources array.
|
||||
* @param {Array<string>} srcs
|
||||
*/
|
||||
function maybeAddClosureLibrary(srcs) {
|
||||
if (argv.closureLibrary) {
|
||||
// If you require Google's Closure library, you can include it in your
|
||||
// build by adding the --closure-library flag.
|
||||
// You will also need to include the "google-closure-library" in your list
|
||||
// of devDependencies.
|
||||
console.log('Including the google-closure-library in your build.');
|
||||
if (!fs.existsSync('./node_modules/google-closure-library')) {
|
||||
throw Error('You must add the google-closure-library to your ' +
|
||||
'devDependencies in package.json, and run `npm install`.');
|
||||
}
|
||||
srcs.push('./node_modules/google-closure-library/closure/goog/**/**/*.js');
|
||||
}
|
||||
return srcs;
|
||||
}
|
||||
|
||||
/**
|
||||
* A helper method to return an closure compiler output wrapper that wraps the
|
||||
* body in a Universal Module Definition.
|
||||
* @param {string} namespace The export namespace.
|
||||
* @param {Array<Object>} dependencies An array of dependencies to inject.
|
||||
*/
|
||||
function outputWrapperUMD(namespace, dependencies) {
|
||||
const amdDeps = dependencies.map(d => '\'' + d.amd + '\'' ).join(', ');
|
||||
const cjsDeps = dependencies.map(d => `require('${d.cjs}')`).join(', ');
|
||||
const browserDeps = dependencies.map(d => 'root.' + d.name).join(', ');
|
||||
const imports = dependencies.map(d => d.name).join(', ');
|
||||
return `// Do not edit this file; automatically generated by gulp.
|
||||
|
||||
/* eslint-disable */
|
||||
;(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) { // AMD
|
||||
define([${amdDeps}], factory);
|
||||
} else if (typeof exports === 'object') { // Node.js
|
||||
module.exports = factory(${cjsDeps});
|
||||
} else { // Browser
|
||||
root.${namespace} = factory(${browserDeps});
|
||||
}
|
||||
}(this, function(${imports}) {
|
||||
%output%
|
||||
return ${namespace};
|
||||
}));
|
||||
`;
|
||||
};
|
||||
|
||||
/**
|
||||
* This task builds Blockly's core files.
|
||||
* blockly_compressed.js
|
||||
*/
|
||||
function buildCompressed() {
|
||||
var packageJson = getPackageJson();
|
||||
const defines = 'Blockly.VERSION="' + packageJson.version + '"';
|
||||
return gulp.src(maybeAddClosureLibrary(['core/**/**/*.js']), {base: './'})
|
||||
.pipe(stripApacheLicense())
|
||||
.pipe(gulp.sourcemaps.init())
|
||||
// Directories in Blockly are used to group similar files together
|
||||
// but are not used to limit access with @package, instead the
|
||||
// method means something is internal to Blockly and not a public
|
||||
// API.
|
||||
// Flatten all files so they're in the same directory, but ensure that
|
||||
// files with the same name don't conflict.
|
||||
.pipe(gulp.rename(function(p) {
|
||||
var dirname = p.dirname.replace(
|
||||
new RegExp(path.sep.replace(/\\/, '\\\\'), "g"), "-");
|
||||
p.dirname = "";
|
||||
p.basename = dirname + "-" + p.basename;
|
||||
}))
|
||||
.pipe(compile(
|
||||
{
|
||||
dependency_mode: 'PRUNE',
|
||||
entry_point: './core-requires.js',
|
||||
js_output_file: 'blockly_compressed.js',
|
||||
externs: ['./externs/svg-externs.js', './externs/goog-externs.js'],
|
||||
define: defines,
|
||||
output_wrapper: outputWrapperUMD('Blockly', [])
|
||||
},
|
||||
argv.verbose, argv.debug, argv.strict))
|
||||
.pipe(gulp.sourcemaps.mapSources(function(sourcePath, file) {
|
||||
return sourcePath.replace(/-/g, '/');
|
||||
}))
|
||||
.pipe(
|
||||
gulp.sourcemaps.write('.', {includeContent: false, sourceRoot: './'}))
|
||||
.pipe(gulp.dest(BUILD_DIR));
|
||||
};
|
||||
|
||||
/**
|
||||
* This task builds the Blockly's built in blocks.
|
||||
* blocks_compressed.js
|
||||
*/
|
||||
function buildBlocks() {
|
||||
return gulp.src(['blocks/*.js'], {base: './'})
|
||||
.pipe(stripApacheLicense())
|
||||
.pipe(gulp.sourcemaps.init())
|
||||
.pipe(compile({
|
||||
dependency_mode: 'NONE',
|
||||
externs: ['./externs/goog-externs.js', './externs/block-externs.js'],
|
||||
js_output_file: 'blocks_compressed.js',
|
||||
output_wrapper: outputWrapperUMD('Blockly.Blocks', [{
|
||||
name: 'Blockly',
|
||||
amd: './blockly_compressed.js',
|
||||
cjs: './blockly_compressed.js'
|
||||
}])
|
||||
}, argv.verbose, argv.debug, argv.strict))
|
||||
.pipe(gulp.sourcemaps.write('.', {
|
||||
includeContent: false,
|
||||
sourceRoot: './'
|
||||
}))
|
||||
.pipe(gulp.dest(BUILD_DIR));
|
||||
};
|
||||
|
||||
/**
|
||||
* A helper method for building a Blockly code generator.
|
||||
* @param {string} language Generator language.
|
||||
* @param {string} namespace Language namespace.
|
||||
*/
|
||||
function buildGenerator(language, namespace) {
|
||||
return gulp.src([`generators/${language}.js`, `generators/${language}/*.js`], {base: './'})
|
||||
.pipe(stripApacheLicense())
|
||||
.pipe(gulp.sourcemaps.init())
|
||||
.pipe(compile({
|
||||
dependency_mode: 'NONE',
|
||||
externs: ['./externs/goog-externs.js', './externs/generator-externs.js'],
|
||||
js_output_file: `${language}_compressed.js`,
|
||||
output_wrapper: outputWrapperUMD(`Blockly.${namespace}`, [{
|
||||
name: 'Blockly',
|
||||
amd: './blockly_compressed.js',
|
||||
cjs: './blockly_compressed.js'
|
||||
}])
|
||||
}, argv.verbose, argv.debug, argv.strict))
|
||||
.pipe(gulp.sourcemaps.write('.', {
|
||||
includeContent: false,
|
||||
sourceRoot: './'
|
||||
}))
|
||||
.pipe(gulp.dest(BUILD_DIR));
|
||||
};
|
||||
|
||||
/**
|
||||
* This task builds the javascript generator.
|
||||
* javascript_compressed.js
|
||||
*/
|
||||
function buildJavascript() {
|
||||
return buildGenerator('javascript', 'JavaScript');
|
||||
};
|
||||
|
||||
/**
|
||||
* This task builds the python generator.
|
||||
* python_compressed.js
|
||||
*/
|
||||
function buildPython() {
|
||||
return buildGenerator('python', 'Python');
|
||||
};
|
||||
|
||||
/**
|
||||
* This task builds the php generator.
|
||||
* php_compressed.js
|
||||
*/
|
||||
function buildPHP() {
|
||||
return buildGenerator('php', 'PHP');
|
||||
};
|
||||
|
||||
/**
|
||||
* This task builds the lua generator.
|
||||
* lua_compressed.js
|
||||
*/
|
||||
function buildLua() {
|
||||
return buildGenerator('lua', 'Lua');
|
||||
};
|
||||
|
||||
/**
|
||||
* This task builds the dart generator:
|
||||
* dart_compressed.js
|
||||
*/
|
||||
function buildDart() {
|
||||
return buildGenerator('dart', 'Dart');
|
||||
};
|
||||
|
||||
/**
|
||||
* This tasks builds all the generators:
|
||||
* javascript_compressed.js
|
||||
* python_compressed.js
|
||||
* php_compressed.js
|
||||
* lua_compressed.js
|
||||
* dart_compressed.js
|
||||
*/
|
||||
const buildGenerators = gulp.parallel(
|
||||
buildJavascript,
|
||||
buildPython,
|
||||
buildPHP,
|
||||
buildLua,
|
||||
buildDart
|
||||
);
|
||||
|
||||
/**
|
||||
* This task updates tests/deps.js, used by blockly_uncompressed.js
|
||||
* when loading Blockly in uncompiled mode.
|
||||
@@ -418,61 +272,267 @@ function buildLangfiles(done) {
|
||||
done();
|
||||
};
|
||||
|
||||
/**
|
||||
* A helper method to return an closure compiler chunk wrapper that
|
||||
* wraps the compiler output for the given chunk in a Universal Module
|
||||
* Definition.
|
||||
*/
|
||||
function chunkWrapper(chunk) {
|
||||
const fileNames = chunk.dependencies.map(
|
||||
d => JSON.stringify(`./${d.name}${COMPILED_SUFFIX}.js`));
|
||||
const amdDeps = fileNames.join(', ');
|
||||
const cjsDeps = fileNames.map(f => `require(${f})`).join(', ');
|
||||
const browserDeps =
|
||||
chunk.dependencies.map(d => `root.${d.namespace}`).join(', ');
|
||||
const imports = chunk.dependencies.map(d => d.namespace).join(', ');
|
||||
return `// Do not edit this file; automatically generated.
|
||||
|
||||
/* eslint-disable */
|
||||
;(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) { // AMD
|
||||
define([${amdDeps}], factory);
|
||||
} else if (typeof exports === 'object') { // Node.js
|
||||
module.exports = factory(${cjsDeps});
|
||||
} else { // Browser
|
||||
root.${chunk.namespace} = factory(${browserDeps});
|
||||
}
|
||||
}(this, function(${imports}) {
|
||||
${chunk.wrapperSetup || `const ${NAMESPACE_OBJECT}=Blockly.internal_;`}
|
||||
%output%
|
||||
${chunk.wrapperCleanup || ''}
|
||||
return ${NAMESPACE_OBJECT}.${chunk.namespace};
|
||||
}));
|
||||
`;
|
||||
};
|
||||
|
||||
/**
|
||||
* Get chunking options to pass to Closure Compiler by using
|
||||
* closure-calculate-chunks (hereafter "ccc") to generate them based
|
||||
* on the deps.js file (which must be up to date!).
|
||||
*
|
||||
* The generated options are modified to use the original chunk names
|
||||
* given in chunks instead of the entry-point based names used by ccc.
|
||||
*
|
||||
* @return {{chunk: !Array<string>, js: !Array<string>}} The chunking
|
||||
* information, in the same form as emitted by
|
||||
* closure-calculate-chunks.
|
||||
*
|
||||
* TODO(cpcallen): maybeAddClosureLibrary? Or maybe remove base.js?
|
||||
*/
|
||||
function getChunkOptions() {
|
||||
const cccArgs = [
|
||||
'--closure-library-base-js-path ./closure/goog/base_minimal.js',
|
||||
'--deps-file ./tests/deps.js',
|
||||
...(chunks.map(chunk => `--entrypoint '${chunk.entry}'`)),
|
||||
];
|
||||
const cccCommand = `closure-calculate-chunks ${cccArgs.join(' ')}`;
|
||||
|
||||
// Because (as of 2021-11-25) closure-calculate-chunks v3.0.2
|
||||
// requries node.js v14 or later, we save the output of cccCommand
|
||||
// in a checked-in .json file, so we can use the contents of that
|
||||
// file when building on older versions of node.
|
||||
//
|
||||
// When this is no longer necessary the following section can be
|
||||
// replaced with:
|
||||
//
|
||||
// const rawOptions = JSON.parse(execSync(cccCommand));
|
||||
const nodeMajorVersion = /v(\d+)\./.exec(process.version)[1];
|
||||
let rawOptions;
|
||||
if (nodeMajorVersion >= 14) {
|
||||
rawOptions = JSON.parse(String(execSync(cccCommand)));
|
||||
// Replace absolute paths with relative ones, so they will be
|
||||
// valid on other machines. Only needed because we're saving this
|
||||
// output to use later on another machine.
|
||||
rawOptions.js = rawOptions.js.map(p => p.replace(process.cwd(), '.'));
|
||||
fs.writeFileSync(CHUNK_CACHE_FILE,
|
||||
JSON.stringify(rawOptions, null, 2) + '\n');
|
||||
} else {
|
||||
console.log(`Warning: using pre-computed chunks from ${CHUNK_CACHE_FILE}`);
|
||||
rawOptions = JSON.parse(String(fs.readFileSync(CHUNK_CACHE_FILE)));
|
||||
}
|
||||
|
||||
// rawOptions should now be of the form:
|
||||
//
|
||||
// {
|
||||
// chunk: [
|
||||
// 'requires:258',
|
||||
// 'all:10:requires',
|
||||
// 'all1:11:requires',
|
||||
// 'all2:11:requires',
|
||||
// /* ... remaining handful of chunks */
|
||||
// ],
|
||||
// js: [
|
||||
// './core/serialization/workspaces.js',
|
||||
// './core/serialization/variables.js',
|
||||
// /* ... remaining several hundred files */
|
||||
// ],
|
||||
// }
|
||||
//
|
||||
// This is designed to be passed directly as-is as the options
|
||||
// object to the Closure Compiler node API, but we want to replace
|
||||
// the unhelpful entry-point based chunk names (let's call these
|
||||
// "nicknames") with the ones from chunks. Luckily they will be in
|
||||
// the same order that the entry points were supplied in - i.e.,
|
||||
// they correspond 1:1 with the entries in chunks.
|
||||
const chunkByNickname = Object.create(null);
|
||||
let jsFiles = rawOptions.js;
|
||||
const chunkList = rawOptions.chunk.map((element, index) => {
|
||||
const [nickname, numJsFiles, dependencyNicks] = element.split(':');
|
||||
const chunk = chunks[index];
|
||||
|
||||
// Replace nicknames with our names.
|
||||
chunkByNickname[nickname] = chunk;
|
||||
if (!dependencyNicks) { // Chunk has no dependencies.
|
||||
chunk.dependencies = [];
|
||||
return `${chunk.name}:${numJsFiles}`;
|
||||
}
|
||||
chunk.dependencies =
|
||||
dependencyNicks.split(',').map(nick => chunkByNickname[nick]);
|
||||
const dependencyNames =
|
||||
chunk.dependencies.map(dependency => dependency.name).join(',');
|
||||
return `${chunk.name}:${numJsFiles}:${dependencyNames}`;
|
||||
});
|
||||
|
||||
// Generate a chunk wrapper for each chunk.
|
||||
for (const chunk of chunks) {
|
||||
chunk.wrapper = chunkWrapper(chunk);
|
||||
}
|
||||
const chunkWrappers = chunks.map(chunk => `${chunk.name}:${chunk.wrapper}`);
|
||||
|
||||
return {chunk: chunkList, js: rawOptions.js, chunk_wrapper: chunkWrappers};
|
||||
}
|
||||
|
||||
/**
|
||||
* RegExp that globally matches path.sep (i.e., "/" or "\").
|
||||
*/
|
||||
const pathSepRegExp = new RegExp(path.sep.replace(/\\/, '\\\\'), "g");
|
||||
|
||||
/**
|
||||
* Modify the supplied gulp.rename path object to relax @package
|
||||
* restrictions in core/.
|
||||
*
|
||||
* Background: subdirectories of core/ are used to group similar files
|
||||
* together but are not intended to limit access to names
|
||||
* marked @package; instead, that annotation is intended to mean only
|
||||
* that the annotated name not part of the public API.
|
||||
*
|
||||
* To make @package behave less strictly in core/, this function can
|
||||
* be used to as a gulp.rename filter, modifying the path object to
|
||||
* flatten all files in core/** so that they're in the same directory,
|
||||
* while ensuring that files with the same base name don't conflict.
|
||||
*
|
||||
* @param {{dirname: string, basename: string, extname: string}}
|
||||
* pathObject The path argument supplied by gulp.rename to its
|
||||
* callback. Modified in place.
|
||||
*/
|
||||
function flattenCorePaths(pathObject) {
|
||||
const dirs = pathObject.dirname.split(path.sep);
|
||||
if (dirs[0] === 'core') {
|
||||
pathObject.dirname = dirs[0];
|
||||
pathObject.basename =
|
||||
dirs.slice(1).concat(pathObject.basename).join('-slash-');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Undo the effects of flattenCorePaths on a single path string.
|
||||
* @param string pathString The flattened path.
|
||||
* @return string The path after unflattening.
|
||||
*/
|
||||
function unflattenCorePaths(pathString) {
|
||||
return pathString.replace(/-slash-/g, path.sep);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method for calling the Closure compiler, establishing
|
||||
* default options (that can be overridden by the caller).
|
||||
* @param {*} options Caller-supplied options that will override the
|
||||
* defaultOptions.
|
||||
*/
|
||||
function compile(options) {
|
||||
const defaultOptions = {
|
||||
compilation_level: 'SIMPLE_OPTIMIZATIONS',
|
||||
warning_level: argv.verbose ? 'VERBOSE' : 'DEFAULT',
|
||||
language_in: 'ECMASCRIPT6_STRICT',
|
||||
language_out: 'ECMASCRIPT5_STRICT',
|
||||
rewrite_polyfills: true,
|
||||
hide_warnings_for: 'node_modules',
|
||||
externs: ['./externs/svg-externs.js'],
|
||||
};
|
||||
if (argv.debug || argv.strict) {
|
||||
defaultOptions.jscomp_error = [...JSCOMP_ERROR];
|
||||
if (argv.strict) {
|
||||
defaultOptions.jscomp_error.push('strictCheckTypes');
|
||||
}
|
||||
}
|
||||
// Extra options for Closure Compiler gulp plugin.
|
||||
const platform = ['native', 'java', 'javascript'];
|
||||
|
||||
return closureCompiler({...defaultOptions, ...options}, {platform});
|
||||
}
|
||||
|
||||
/**
|
||||
* This task compiles the core library, blocks and generators, creating
|
||||
* blockly_compressed.js, blocks_compressed.js, etc.
|
||||
*
|
||||
* The deps.js file must be up-to-date.
|
||||
*/
|
||||
function buildCompiled() {
|
||||
// Get chunking.
|
||||
const chunkOptions = getChunkOptions();
|
||||
// Closure Compiler options.
|
||||
const packageJson = getPackageJson(); // For version number.
|
||||
const options = {
|
||||
define: 'Blockly.VERSION="' + packageJson.version + '"',
|
||||
chunk: chunkOptions.chunk,
|
||||
chunk_wrapper: chunkOptions.chunk_wrapper,
|
||||
rename_prefix_namespace: NAMESPACE_OBJECT,
|
||||
// Don't supply the list of source files in chunkOptions.js as an
|
||||
// option to Closure Compiler; instead feed them as input via gulp.src.
|
||||
};
|
||||
|
||||
// Fire up compilation pipline.
|
||||
return gulp.src(chunkOptions.js, {base: './'})
|
||||
.pipe(stripApacheLicense())
|
||||
.pipe(gulp.sourcemaps.init())
|
||||
.pipe(gulp.rename(flattenCorePaths))
|
||||
.pipe(compile(options))
|
||||
.pipe(gulp.rename({suffix: COMPILED_SUFFIX}))
|
||||
.pipe(gulp.sourcemaps.mapSources(unflattenCorePaths))
|
||||
.pipe(
|
||||
gulp.sourcemaps.write('.', {includeContent: false, sourceRoot: './'}))
|
||||
.pipe(gulp.dest(BUILD_DIR));
|
||||
};
|
||||
|
||||
/**
|
||||
* This task builds Blockly core, blocks and generators together and uses
|
||||
* closure compiler's ADVANCED_COMPILATION mode.
|
||||
*/
|
||||
function buildAdvancedCompilationTest() {
|
||||
const srcs = [
|
||||
'tests/compile/main.js', 'tests/compile/test_blocks.js', 'core/**/**/*.js',
|
||||
'blocks/*.js', 'generators/**/*.js'
|
||||
'closure/goog/base_minimal.js',
|
||||
'core/**/*.js', 'blocks/**/*.js', 'generators/**/*.js',
|
||||
'tests/compile/main.js', 'tests/compile/test_blocks.js',
|
||||
];
|
||||
return gulp.src(maybeAddClosureLibrary(srcs), {base: './'})
|
||||
|
||||
// Closure Compiler options.
|
||||
const options = {
|
||||
dependency_mode: 'PRUNE',
|
||||
compilation_level: 'ADVANCED_OPTIMIZATIONS',
|
||||
entry_point: './tests/compile/main.js',
|
||||
js_output_file: 'main_compressed.js',
|
||||
};
|
||||
return gulp.src(srcs, {base: './'})
|
||||
.pipe(stripApacheLicense())
|
||||
.pipe(gulp.sourcemaps.init())
|
||||
// Directories in Blockly are used to group similar files together
|
||||
// but are not used to limit access with @package, instead the
|
||||
// method means something is internal to Blockly and not a public
|
||||
// API.
|
||||
// Flatten all files so they're in the same directory, but ensure that
|
||||
// files with the same name don't conflict.
|
||||
.pipe(gulp.rename(function(p) {
|
||||
if (p.dirname.indexOf('core') === 0) {
|
||||
var dirname = p.dirname.replace(
|
||||
new RegExp(path.sep.replace(/\\/, '\\\\'), "g"), "-");
|
||||
p.dirname = "";
|
||||
p.basename = dirname + "-" + p.basename;
|
||||
}
|
||||
}))
|
||||
.pipe(compile(
|
||||
{
|
||||
dependency_mode: 'PRUNE',
|
||||
compilation_level: 'ADVANCED_OPTIMIZATIONS',
|
||||
entry_point: './tests/compile/main.js',
|
||||
js_output_file: 'main_compressed.js',
|
||||
externs: ['./externs/svg-externs.js', './externs/goog-externs.js'],
|
||||
},
|
||||
argv.verbose, argv.strict))
|
||||
.pipe(gulp.sourcemaps.mapSources(function(sourcePath, file) {
|
||||
return sourcePath.replace(/-/g, '/');
|
||||
}))
|
||||
.pipe(gulp.rename(flattenCorePaths))
|
||||
.pipe(compile(options))
|
||||
.pipe(gulp.sourcemaps.mapSources(unflattenCorePaths))
|
||||
.pipe(gulp.sourcemaps.write(
|
||||
'.', {includeContent: false, sourceRoot: '../../'}))
|
||||
.pipe(gulp.dest('./tests/compile/'));
|
||||
}
|
||||
|
||||
/**
|
||||
* This tasks builds Blockly's core files:
|
||||
* blockly_compressed.js
|
||||
* blocks_compressed.js
|
||||
* blockly_uncompressed.js
|
||||
*/
|
||||
const buildCore = gulp.parallel(
|
||||
buildDeps,
|
||||
buildCompressed,
|
||||
buildBlocks,
|
||||
);
|
||||
|
||||
/**
|
||||
* This task builds all of Blockly:
|
||||
* blockly_compressed.js
|
||||
@@ -484,10 +544,10 @@ const buildCore = gulp.parallel(
|
||||
* dart_compressed.js
|
||||
* blockly_uncompressed.js
|
||||
* msg/json/*.js
|
||||
* test/deps*.js
|
||||
*/
|
||||
const build = gulp.parallel(
|
||||
buildCore,
|
||||
buildGenerators,
|
||||
gulp.series(buildDeps, buildCompiled),
|
||||
buildLangfiles,
|
||||
);
|
||||
|
||||
@@ -527,13 +587,10 @@ function format() {
|
||||
module.exports = {
|
||||
build: build,
|
||||
deps: buildDeps,
|
||||
core: buildCore,
|
||||
blocks: buildBlocks,
|
||||
generateLangfiles: generateLangfiles,
|
||||
langfiles: buildLangfiles,
|
||||
compressed: buildCompressed,
|
||||
compiled: buildCompiled,
|
||||
format: format,
|
||||
generators: buildGenerators,
|
||||
checkinBuilt: checkinBuilt,
|
||||
cleanBuildDir: cleanBuildDir,
|
||||
advancedCompilationTest: buildAdvancedCompilationTest,
|
||||
|
||||
337
scripts/gulpfiles/chunks.json
Normal file
337
scripts/gulpfiles/chunks.json
Normal file
@@ -0,0 +1,337 @@
|
||||
{
|
||||
"chunk": [
|
||||
"requires:259",
|
||||
"all:10:requires",
|
||||
"all1:11:requires",
|
||||
"all2:11:requires",
|
||||
"all3:11:requires",
|
||||
"all4:11:requires",
|
||||
"all5:11:requires"
|
||||
],
|
||||
"js": [
|
||||
"./core/serialization/workspaces.js",
|
||||
"./core/serialization/variables.js",
|
||||
"./core/utils/global.js",
|
||||
"./core/msg.js",
|
||||
"./core/blocks.js",
|
||||
"./core/utils/useragent.js",
|
||||
"./core/utils/svg.js",
|
||||
"./core/utils/dom.js",
|
||||
"./core/utils/array.js",
|
||||
"./core/utils/idgenerator.js",
|
||||
"./core/utils/math.js",
|
||||
"./core/utils/object.js",
|
||||
"./core/connection_type.js",
|
||||
"./core/internal_constants.js",
|
||||
"./core/utils/colour.js",
|
||||
"./core/utils/string.js",
|
||||
"./core/utils/parsing.js",
|
||||
"./core/serialization/priorities.js",
|
||||
"./core/interfaces/i_serializer.js",
|
||||
"./core/serialization/registry.js",
|
||||
"./core/serialization/exceptions.js",
|
||||
"./core/utils/size.js",
|
||||
"./core/input_types.js",
|
||||
"./core/serialization/blocks.js",
|
||||
"./core/utils/deprecation.js",
|
||||
"./core/css.js",
|
||||
"./core/utils/aria.js",
|
||||
"./core/interfaces/i_toolbox_item.js",
|
||||
"./core/interfaces/i_selectable_toolbox_item.js",
|
||||
"./core/interfaces/i_collapsible_toolbox_item.js",
|
||||
"./core/block_animations.js",
|
||||
"./core/utils/coordinate.js",
|
||||
"./core/utils/style.js",
|
||||
"./core/utils/rect.js",
|
||||
"./core/dialog.js",
|
||||
"./core/utils/xml.js",
|
||||
"./core/events/events_var_base.js",
|
||||
"./core/events/events_var_create.js",
|
||||
"./core/variable_model.js",
|
||||
"./core/variables.js",
|
||||
"./core/utils/svg_paths.js",
|
||||
"./core/interfaces/i_connection_checker.js",
|
||||
"./core/constants.js",
|
||||
"./core/connection_db.js",
|
||||
"./core/rendered_connection.js",
|
||||
"./core/theme.js",
|
||||
"./core/renderers/common/constants.js",
|
||||
"./core/dropdowndiv.js",
|
||||
"./core/interfaces/i_ast_node_location.js",
|
||||
"./core/interfaces/i_ast_node_location_svg.js",
|
||||
"./core/interfaces/i_ast_node_location_with_block.js",
|
||||
"./core/utils/keycodes.js",
|
||||
"./core/shortcut_registry.js",
|
||||
"./core/interfaces/i_keyboard_accessible.js",
|
||||
"./core/interfaces/i_registrable.js",
|
||||
"./core/interfaces/i_registrable_field.js",
|
||||
"./core/field_registry.js",
|
||||
"./core/field_label.js",
|
||||
"./core/input.js",
|
||||
"./core/events/events_ui_base.js",
|
||||
"./core/events/events_marker_move.js",
|
||||
"./core/renderers/common/marker_svg.js",
|
||||
"./core/keyboard_nav/marker.js",
|
||||
"./core/marker_manager.js",
|
||||
"./core/events/events_block_base.js",
|
||||
"./core/events/events_block_change.js",
|
||||
"./core/field.js",
|
||||
"./core/events/events_var_delete.js",
|
||||
"./core/events/events_var_rename.js",
|
||||
"./core/variable_map.js",
|
||||
"./core/names.js",
|
||||
"./core/procedures.js",
|
||||
"./core/variables_dynamic.js",
|
||||
"./core/renderers/common/debug.js",
|
||||
"./core/renderers/measurables/in_row_spacer.js",
|
||||
"./core/renderers/measurables/input_connection.js",
|
||||
"./core/renderers/measurables/row.js",
|
||||
"./core/renderers/measurables/types.js",
|
||||
"./core/renderers/measurables/base.js",
|
||||
"./core/renderers/measurables/connection.js",
|
||||
"./core/renderers/measurables/next_connection.js",
|
||||
"./core/renderers/measurables/bottom_row.js",
|
||||
"./core/renderers/measurables/external_value_input.js",
|
||||
"./core/renderers/measurables/field.js",
|
||||
"./core/renderers/measurables/hat.js",
|
||||
"./core/block_drag_surface.js",
|
||||
"./core/interfaces/i_contextmenu.js",
|
||||
"./core/interfaces/i_deletable.js",
|
||||
"./core/interfaces/i_draggable.js",
|
||||
"./core/interfaces/i_bubble.js",
|
||||
"./core/utils/metrics.js",
|
||||
"./core/interfaces/i_metrics_manager.js",
|
||||
"./core/metrics_manager.js",
|
||||
"./core/scrollbar.js",
|
||||
"./core/bubble.js",
|
||||
"./core/icon.js",
|
||||
"./core/renderers/measurables/icon.js",
|
||||
"./core/renderers/measurables/inline_input.js",
|
||||
"./core/renderers/measurables/input_row.js",
|
||||
"./core/renderers/measurables/jagged_edge.js",
|
||||
"./core/renderers/measurables/output_connection.js",
|
||||
"./core/renderers/measurables/previous_connection.js",
|
||||
"./core/renderers/common/drawer.js",
|
||||
"./core/renderers/common/i_path_object.js",
|
||||
"./core/interfaces/i_component.js",
|
||||
"./core/interfaces/i_autohideable.js",
|
||||
"./core/interfaces/i_drag_target.js",
|
||||
"./core/interfaces/i_delete_area.js",
|
||||
"./core/interfaces/i_positionable.js",
|
||||
"./core/component_manager.js",
|
||||
"./core/insertion_marker_manager.js",
|
||||
"./core/renderers/common/path_object.js",
|
||||
"./core/renderers/common/renderer.js",
|
||||
"./core/renderers/measurables/round_corner.js",
|
||||
"./core/renderers/measurables/spacer_row.js",
|
||||
"./core/renderers/measurables/square_corner.js",
|
||||
"./core/renderers/measurables/statement_input.js",
|
||||
"./core/renderers/measurables/top_row.js",
|
||||
"./core/renderers/common/info.js",
|
||||
"./core/renderers/common/debugger.js",
|
||||
"./core/renderers/common/block_rendering.js",
|
||||
"./core/utils.js",
|
||||
"./core/blockly_options.js",
|
||||
"./core/theme/classic.js",
|
||||
"./core/contextmenu_registry.js",
|
||||
"./core/flyout_button.js",
|
||||
"./core/grid.js",
|
||||
"./core/interfaces/i_bounded_element.js",
|
||||
"./core/options.js",
|
||||
"./core/scrollbar_pair.js",
|
||||
"./core/theme_manager.js",
|
||||
"./core/touch_gesture.js",
|
||||
"./core/positionable_helpers.js",
|
||||
"./core/drag_target.js",
|
||||
"./core/delete_area.js",
|
||||
"./core/events/events_trashcan_open.js",
|
||||
"./core/trashcan.js",
|
||||
"./core/workspace_audio.js",
|
||||
"./core/interfaces/i_movable.js",
|
||||
"./core/interfaces/i_selectable.js",
|
||||
"./core/interfaces/i_copyable.js",
|
||||
"./core/events/events_comment_create.js",
|
||||
"./core/events/events_comment_delete.js",
|
||||
"./core/events/events_comment_base.js",
|
||||
"./core/events/events_comment_change.js",
|
||||
"./core/events/events_comment_move.js",
|
||||
"./core/workspace_comment.js",
|
||||
"./core/events/events_selected.js",
|
||||
"./core/workspace_comment_svg.js",
|
||||
"./core/workspace_drag_surface_svg.js",
|
||||
"./core/events/events_click.js",
|
||||
"./core/zoom_controls.js",
|
||||
"./core/events/events_block_create.js",
|
||||
"./core/events/events_theme_change.js",
|
||||
"./core/events/events_viewport.js",
|
||||
"./core/workspace_svg.js",
|
||||
"./core/utils/svg_math.js",
|
||||
"./core/bubble_dragger.js",
|
||||
"./core/interfaces/i_block_dragger.js",
|
||||
"./core/workspace_dragger.js",
|
||||
"./core/bump_objects.js",
|
||||
"./core/events/events_block_drag.js",
|
||||
"./core/events/events_block_move.js",
|
||||
"./core/block_dragger.js",
|
||||
"./core/gesture.js",
|
||||
"./core/touch.js",
|
||||
"./core/browser_events.js",
|
||||
"./core/tooltip.js",
|
||||
"./core/events/events_bubble_open.js",
|
||||
"./core/warning.js",
|
||||
"./core/comment.js",
|
||||
"./core/keyboard_nav/basic_cursor.js",
|
||||
"./core/keyboard_nav/tab_navigate_cursor.js",
|
||||
"./core/block_svg.js",
|
||||
"./core/interfaces/i_flyout.js",
|
||||
"./core/interfaces/i_toolbox.js",
|
||||
"./core/toolbox/toolbox_item.js",
|
||||
"./core/toolbox/category.js",
|
||||
"./core/toolbox/separator.js",
|
||||
"./core/utils/toolbox.js",
|
||||
"./core/mutator.js",
|
||||
"./core/extensions.js",
|
||||
"./core/events/events_block_delete.js",
|
||||
"./core/block.js",
|
||||
"./core/keyboard_nav/ast_node.js",
|
||||
"./core/keyboard_nav/cursor.js",
|
||||
"./core/registry.js",
|
||||
"./core/connection_checker.js",
|
||||
"./core/workspace.js",
|
||||
"./core/events/events_abstract.js",
|
||||
"./core/events/utils.js",
|
||||
"./core/xml.js",
|
||||
"./core/connection.js",
|
||||
"./core/common.js",
|
||||
"./core/widgetdiv.js",
|
||||
"./core/clipboard.js",
|
||||
"./core/menuitem.js",
|
||||
"./core/menu.js",
|
||||
"./core/contextmenu.js",
|
||||
"./core/events/workspace_events.js",
|
||||
"./core/events/events_toolbox_item_select.js",
|
||||
"./core/events/events_ui.js",
|
||||
"./core/events/events.js",
|
||||
"./core/contextmenu_items.js",
|
||||
"./core/shortcut_items.js",
|
||||
"./core/theme/zelos.js",
|
||||
"./core/theme/themes.js",
|
||||
"./core/renderers/geras/constants.js",
|
||||
"./core/renderers/geras/highlight_constants.js",
|
||||
"./core/renderers/geras/measurables/inline_input.js",
|
||||
"./core/renderers/geras/path_object.js",
|
||||
"./core/renderers/geras/renderer.js",
|
||||
"./core/renderers/geras/measurables/statement_input.js",
|
||||
"./core/renderers/geras/info.js",
|
||||
"./core/renderers/geras/highlighter.js",
|
||||
"./core/renderers/geras/drawer.js",
|
||||
"./core/renderers/geras/geras.js",
|
||||
"./core/loop_mixin.js",
|
||||
"./core/renderers/minimalist/constants.js",
|
||||
"./core/renderers/minimalist/renderer.js",
|
||||
"./core/renderers/minimalist/info.js",
|
||||
"./core/renderers/minimalist/drawer.js",
|
||||
"./core/renderers/minimalist/minimalist.js",
|
||||
"./core/renderers/thrasos/renderer.js",
|
||||
"./core/renderers/thrasos/info.js",
|
||||
"./core/renderers/thrasos/thrasos.js",
|
||||
"./core/renderers/zelos/measurables/bottom_row.js",
|
||||
"./core/renderers/zelos/constants.js",
|
||||
"./core/renderers/zelos/path_object.js",
|
||||
"./core/field_image.js",
|
||||
"./core/field_textinput.js",
|
||||
"./core/renderers/zelos/marker_svg.js",
|
||||
"./core/renderers/zelos/renderer.js",
|
||||
"./core/renderers/zelos/measurables/row_elements.js",
|
||||
"./core/renderers/zelos/measurables/inputs.js",
|
||||
"./core/renderers/zelos/measurables/top_row.js",
|
||||
"./core/renderers/zelos/info.js",
|
||||
"./core/renderers/zelos/drawer.js",
|
||||
"./core/renderers/zelos/zelos.js",
|
||||
"./core/toolbox/collapsible_category.js",
|
||||
"./core/field_angle.js",
|
||||
"./core/field_checkbox.js",
|
||||
"./core/field_colour.js",
|
||||
"./core/field_dropdown.js",
|
||||
"./core/field_label_serializable.js",
|
||||
"./core/field_multilineinput.js",
|
||||
"./core/field_number.js",
|
||||
"./core/field_variable.js",
|
||||
"./core/flyout_metrics_manager.js",
|
||||
"./core/flyout_base.js",
|
||||
"./core/generator.js",
|
||||
"./core/flyout_horizontal.js",
|
||||
"./core/interfaces/i_styleable.js",
|
||||
"./core/toolbox/toolbox.js",
|
||||
"./core/flyout_vertical.js",
|
||||
"./core/inject.js",
|
||||
"./core/blockly.js",
|
||||
"./closure/goog/base_minimal.js",
|
||||
"./core/requires.js",
|
||||
"./blocks/variables_dynamic.js",
|
||||
"./blocks/variables.js",
|
||||
"./blocks/text.js",
|
||||
"./blocks/procedures.js",
|
||||
"./blocks/math.js",
|
||||
"./blocks/loops.js",
|
||||
"./blocks/logic.js",
|
||||
"./blocks/lists.js",
|
||||
"./blocks/colour.js",
|
||||
"./blocks/all.js",
|
||||
"./generators/javascript/variables_dynamic.js",
|
||||
"./generators/javascript/variables.js",
|
||||
"./generators/javascript/text.js",
|
||||
"./generators/javascript/procedures.js",
|
||||
"./generators/javascript/math.js",
|
||||
"./generators/javascript/loops.js",
|
||||
"./generators/javascript/logic.js",
|
||||
"./generators/javascript/lists.js",
|
||||
"./generators/javascript.js",
|
||||
"./generators/javascript/colour.js",
|
||||
"./generators/javascript/all.js",
|
||||
"./generators/python/variables_dynamic.js",
|
||||
"./generators/python/variables.js",
|
||||
"./generators/python/text.js",
|
||||
"./generators/python/procedures.js",
|
||||
"./generators/python/math.js",
|
||||
"./generators/python/loops.js",
|
||||
"./generators/python/logic.js",
|
||||
"./generators/python/lists.js",
|
||||
"./generators/python.js",
|
||||
"./generators/python/colour.js",
|
||||
"./generators/python/all.js",
|
||||
"./generators/php/variables_dynamic.js",
|
||||
"./generators/php/variables.js",
|
||||
"./generators/php/text.js",
|
||||
"./generators/php/procedures.js",
|
||||
"./generators/php/math.js",
|
||||
"./generators/php/loops.js",
|
||||
"./generators/php/logic.js",
|
||||
"./generators/php/lists.js",
|
||||
"./generators/php.js",
|
||||
"./generators/php/colour.js",
|
||||
"./generators/php/all.js",
|
||||
"./generators/lua/variables_dynamic.js",
|
||||
"./generators/lua/variables.js",
|
||||
"./generators/lua/text.js",
|
||||
"./generators/lua/procedures.js",
|
||||
"./generators/lua/math.js",
|
||||
"./generators/lua/loops.js",
|
||||
"./generators/lua/logic.js",
|
||||
"./generators/lua/lists.js",
|
||||
"./generators/lua.js",
|
||||
"./generators/lua/colour.js",
|
||||
"./generators/lua/all.js",
|
||||
"./generators/dart/variables_dynamic.js",
|
||||
"./generators/dart/variables.js",
|
||||
"./generators/dart/text.js",
|
||||
"./generators/dart/procedures.js",
|
||||
"./generators/dart/math.js",
|
||||
"./generators/dart/loops.js",
|
||||
"./generators/dart/logic.js",
|
||||
"./generators/dart/lists.js",
|
||||
"./generators/dart.js",
|
||||
"./generators/dart/colour.js",
|
||||
"./generators/dart/all.js"
|
||||
]
|
||||
}
|
||||
@@ -22,9 +22,8 @@
|
||||
<body>
|
||||
<h1>Blockly: Advanced Compilation Test</h1>
|
||||
|
||||
<p>To run this test manually, download
|
||||
<a href="https://dl.google.com/closure-compiler/compiler-latest.zip">closure-compiler-vxxxxxxxx.jar</a>,
|
||||
place it in this directory, then run `npm run test:compile:advanced` from the command line.</p>
|
||||
<p>To run this test manually, run `npm run test:compile:advanced`
|
||||
from the command line, then open this file in your web browser.</p>
|
||||
|
||||
<p>Measure the size of main_compressed.js (295kb as of October 2017), then reload
|
||||
this page and see if Blockly works.</p>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
goog.addDependency('../../blocks/all.js', ['Blockly.blocks.all'], ['Blockly.blocks.colour', 'Blockly.blocks.lists', 'Blockly.blocks.logic', 'Blockly.blocks.loops', 'Blockly.blocks.math', 'Blockly.blocks.procedures', 'Blockly.blocks.texts', 'Blockly.blocks.variables', 'Blockly.blocks.variablesDynamic'], {'module': 'goog'});
|
||||
goog.addDependency('../../blocks/colour.js', ['Blockly.Constants.Colour', 'Blockly.blocks.colour'], ['Blockly', 'Blockly.FieldColour', 'Blockly.FieldLabel'], {'lang': 'es5'});
|
||||
goog.addDependency('../../blocks/lists.js', ['Blockly.Constants.Lists', 'Blockly.blocks.lists'], ['Blockly', 'Blockly.FieldDropdown', 'Blockly.FieldLabel', 'Blockly.Mutator'], {'lang': 'es6'});
|
||||
goog.addDependency('../../blocks/logic.js', ['Blockly.Constants.Logic', 'Blockly.blocks.logic'], ['Blockly', 'Blockly.FieldDropdown', 'Blockly.FieldLabel', 'Blockly.Mutator'], {'lang': 'es6'});
|
||||
@@ -127,7 +128,7 @@ goog.addDependency('../../core/keyboard_nav/basic_cursor.js', ['Blockly.BasicCur
|
||||
goog.addDependency('../../core/keyboard_nav/cursor.js', ['Blockly.Cursor'], ['Blockly.ASTNode', 'Blockly.Marker', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'});
|
||||
goog.addDependency('../../core/keyboard_nav/marker.js', ['Blockly.Marker'], [], {'lang': 'es6', 'module': 'goog'});
|
||||
goog.addDependency('../../core/keyboard_nav/tab_navigate_cursor.js', ['Blockly.TabNavigateCursor'], ['Blockly.ASTNode', 'Blockly.BasicCursor', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'});
|
||||
goog.addDependency('../../core/loop_mixin.js', ['Blockly.loopMixin'], ['Blockly.Extensions'], {'lang': 'es6', 'module': 'goog'});
|
||||
goog.addDependency('../../core/loop_mixin.js', ['Blockly.loopMixin'], ['Blockly.Events', 'Blockly.Extensions', 'Blockly.Msg'], {'lang': 'es6', 'module': 'goog'});
|
||||
goog.addDependency('../../core/marker_manager.js', ['Blockly.MarkerManager'], [], {'lang': 'es6', 'module': 'goog'});
|
||||
goog.addDependency('../../core/menu.js', ['Blockly.Menu'], ['Blockly.browserEvents', 'Blockly.utils.Coordinate', 'Blockly.utils.KeyCodes', 'Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.style'], {'lang': 'es6', 'module': 'goog'});
|
||||
goog.addDependency('../../core/menuitem.js', ['Blockly.MenuItem'], ['Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.idGenerator'], {'lang': 'es6', 'module': 'goog'});
|
||||
@@ -266,6 +267,7 @@ goog.addDependency('../../core/workspace_svg.js', ['Blockly.WorkspaceSvg'], ['Bl
|
||||
goog.addDependency('../../core/xml.js', ['Blockly.Xml'], ['Blockly.Events.utils', 'Blockly.inputTypes', 'Blockly.utils.Size', 'Blockly.utils.dom', 'Blockly.utils.xml'], {'lang': 'es6', 'module': 'goog'});
|
||||
goog.addDependency('../../core/zoom_controls.js', ['Blockly.ZoomControls'], ['Blockly.ComponentManager', 'Blockly.Css', 'Blockly.Events.Click', 'Blockly.Events.utils', 'Blockly.IPositionable', 'Blockly.Touch', 'Blockly.browserEvents', 'Blockly.internalConstants', 'Blockly.uiPosition', 'Blockly.utils.Rect', 'Blockly.utils.Size', 'Blockly.utils.Svg', 'Blockly.utils.dom'], {'lang': 'es6', 'module': 'goog'});
|
||||
goog.addDependency('../../generators/dart.js', ['Blockly.Dart'], ['Blockly.Generator', 'Blockly.inputTypes', 'Blockly.utils.string'], {'lang': 'es6'});
|
||||
goog.addDependency('../../generators/dart/all.js', ['Blockly.Dart.all'], ['Blockly.Dart.colour', 'Blockly.Dart.lists', 'Blockly.Dart.logic', 'Blockly.Dart.loops', 'Blockly.Dart.math', 'Blockly.Dart.procedures', 'Blockly.Dart.texts', 'Blockly.Dart.variables', 'Blockly.Dart.variablesDynamic'], {'module': 'goog'});
|
||||
goog.addDependency('../../generators/dart/colour.js', ['Blockly.Dart.colour'], ['Blockly.Dart'], {'lang': 'es6'});
|
||||
goog.addDependency('../../generators/dart/lists.js', ['Blockly.Dart.lists'], ['Blockly.Dart'], {'lang': 'es6'});
|
||||
goog.addDependency('../../generators/dart/logic.js', ['Blockly.Dart.logic'], ['Blockly.Dart'], {'lang': 'es6'});
|
||||
@@ -276,6 +278,7 @@ goog.addDependency('../../generators/dart/text.js', ['Blockly.Dart.texts'], ['Bl
|
||||
goog.addDependency('../../generators/dart/variables.js', ['Blockly.Dart.variables'], ['Blockly.Dart'], {'lang': 'es6'});
|
||||
goog.addDependency('../../generators/dart/variables_dynamic.js', ['Blockly.Dart.variablesDynamic'], ['Blockly.Dart', 'Blockly.Dart.variables']);
|
||||
goog.addDependency('../../generators/javascript.js', ['Blockly.JavaScript'], ['Blockly.Generator', 'Blockly.inputTypes', 'Blockly.utils.global', 'Blockly.utils.object', 'Blockly.utils.string'], {'lang': 'es6'});
|
||||
goog.addDependency('../../generators/javascript/all.js', ['Blockly.JavaScript.all'], ['Blockly.JavaScript.colour', 'Blockly.JavaScript.lists', 'Blockly.JavaScript.logic', 'Blockly.JavaScript.loops', 'Blockly.JavaScript.math', 'Blockly.JavaScript.procedures', 'Blockly.JavaScript.texts', 'Blockly.JavaScript.variables', 'Blockly.JavaScript.variablesDynamic'], {'module': 'goog'});
|
||||
goog.addDependency('../../generators/javascript/colour.js', ['Blockly.JavaScript.colour'], ['Blockly.JavaScript'], {'lang': 'es6'});
|
||||
goog.addDependency('../../generators/javascript/lists.js', ['Blockly.JavaScript.lists'], ['Blockly.JavaScript'], {'lang': 'es6'});
|
||||
goog.addDependency('../../generators/javascript/logic.js', ['Blockly.JavaScript.logic'], ['Blockly.JavaScript'], {'lang': 'es6'});
|
||||
@@ -286,6 +289,7 @@ goog.addDependency('../../generators/javascript/text.js', ['Blockly.JavaScript.t
|
||||
goog.addDependency('../../generators/javascript/variables.js', ['Blockly.JavaScript.variables'], ['Blockly.JavaScript'], {'lang': 'es6'});
|
||||
goog.addDependency('../../generators/javascript/variables_dynamic.js', ['Blockly.JavaScript.variablesDynamic'], ['Blockly.JavaScript', 'Blockly.JavaScript.variables']);
|
||||
goog.addDependency('../../generators/lua.js', ['Blockly.Lua'], ['Blockly.Generator', 'Blockly.inputTypes', 'Blockly.utils.object', 'Blockly.utils.string'], {'lang': 'es6'});
|
||||
goog.addDependency('../../generators/lua/all.js', ['Blockly.Lua.all'], ['Blockly.Lua.colour', 'Blockly.Lua.lists', 'Blockly.Lua.logic', 'Blockly.Lua.loops', 'Blockly.Lua.math', 'Blockly.Lua.procedures', 'Blockly.Lua.texts', 'Blockly.Lua.variables', 'Blockly.Lua.variablesDynamic'], {'module': 'goog'});
|
||||
goog.addDependency('../../generators/lua/colour.js', ['Blockly.Lua.colour'], ['Blockly.Lua'], {'lang': 'es6'});
|
||||
goog.addDependency('../../generators/lua/lists.js', ['Blockly.Lua.lists'], ['Blockly.Lua'], {'lang': 'es6'});
|
||||
goog.addDependency('../../generators/lua/logic.js', ['Blockly.Lua.logic'], ['Blockly.Lua'], {'lang': 'es6'});
|
||||
@@ -296,6 +300,7 @@ goog.addDependency('../../generators/lua/text.js', ['Blockly.Lua.texts'], ['Bloc
|
||||
goog.addDependency('../../generators/lua/variables.js', ['Blockly.Lua.variables'], ['Blockly.Lua'], {'lang': 'es6'});
|
||||
goog.addDependency('../../generators/lua/variables_dynamic.js', ['Blockly.Lua.variablesDynamic'], ['Blockly.Lua', 'Blockly.Lua.variables']);
|
||||
goog.addDependency('../../generators/php.js', ['Blockly.PHP'], ['Blockly.Generator', 'Blockly.inputTypes', 'Blockly.utils.object', 'Blockly.utils.string'], {'lang': 'es6'});
|
||||
goog.addDependency('../../generators/php/all.js', ['Blockly.PHP.all'], ['Blockly.PHP.colour', 'Blockly.PHP.lists', 'Blockly.PHP.logic', 'Blockly.PHP.loops', 'Blockly.PHP.math', 'Blockly.PHP.procedures', 'Blockly.PHP.texts', 'Blockly.PHP.variables', 'Blockly.PHP.variablesDynamic'], {'module': 'goog'});
|
||||
goog.addDependency('../../generators/php/colour.js', ['Blockly.PHP.colour'], ['Blockly.PHP'], {'lang': 'es6'});
|
||||
goog.addDependency('../../generators/php/lists.js', ['Blockly.PHP.lists'], ['Blockly.PHP'], {'lang': 'es6'});
|
||||
goog.addDependency('../../generators/php/logic.js', ['Blockly.PHP.logic'], ['Blockly.PHP'], {'lang': 'es6'});
|
||||
@@ -306,6 +311,7 @@ goog.addDependency('../../generators/php/text.js', ['Blockly.PHP.texts'], ['Bloc
|
||||
goog.addDependency('../../generators/php/variables.js', ['Blockly.PHP.variables'], ['Blockly.PHP'], {'lang': 'es6'});
|
||||
goog.addDependency('../../generators/php/variables_dynamic.js', ['Blockly.PHP.variablesDynamic'], ['Blockly.PHP', 'Blockly.PHP.variables']);
|
||||
goog.addDependency('../../generators/python.js', ['Blockly.Python'], ['Blockly.Generator', 'Blockly.inputTypes', 'Blockly.utils.string'], {'lang': 'es6'});
|
||||
goog.addDependency('../../generators/python/all.js', ['Blockly.Python.all'], ['Blockly.Python.colour', 'Blockly.Python.lists', 'Blockly.Python.logic', 'Blockly.Python.loops', 'Blockly.Python.math', 'Blockly.Python.procedures', 'Blockly.Python.texts', 'Blockly.Python.variables', 'Blockly.Python.variablesDynamic'], {'module': 'goog'});
|
||||
goog.addDependency('../../generators/python/colour.js', ['Blockly.Python.colour'], ['Blockly.Python'], {'lang': 'es6'});
|
||||
goog.addDependency('../../generators/python/lists.js', ['Blockly.Python.lists'], ['Blockly.Python'], {'lang': 'es6'});
|
||||
goog.addDependency('../../generators/python/logic.js', ['Blockly.Python.logic'], ['Blockly.Python'], {'lang': 'es6'});
|
||||
@@ -316,4 +322,5 @@ goog.addDependency('../../generators/python/text.js', ['Blockly.Python.texts'],
|
||||
goog.addDependency('../../generators/python/variables.js', ['Blockly.Python.variables'], ['Blockly.Python'], {'lang': 'es6'});
|
||||
goog.addDependency('../../generators/python/variables_dynamic.js', ['Blockly.Python.variablesDynamic'], ['Blockly.Python', 'Blockly.Python.variables']);
|
||||
goog.addDependency('base.js', [], []);
|
||||
goog.addDependency('base_minimal.js', [], []);
|
||||
|
||||
|
||||
@@ -8,65 +8,12 @@
|
||||
|
||||
<script>
|
||||
// Require optional modules needed by tests.
|
||||
goog.require('Blockly.Dart');
|
||||
goog.require('Blockly.Dart.colour');
|
||||
goog.require('Blockly.Dart.lists');
|
||||
goog.require('Blockly.Dart.logic');
|
||||
goog.require('Blockly.Dart.loops');
|
||||
goog.require('Blockly.Dart.math');
|
||||
goog.require('Blockly.Dart.procedures');
|
||||
goog.require('Blockly.Dart.texts');
|
||||
goog.require('Blockly.Dart.variables');
|
||||
goog.require('Blockly.Dart.variablesDynamic');
|
||||
goog.require('Blockly.JavaScript');
|
||||
goog.require('Blockly.JavaScript.colour');
|
||||
goog.require('Blockly.JavaScript.lists');
|
||||
goog.require('Blockly.JavaScript.logic');
|
||||
goog.require('Blockly.JavaScript.loops');
|
||||
goog.require('Blockly.JavaScript.math');
|
||||
goog.require('Blockly.JavaScript.procedures');
|
||||
goog.require('Blockly.JavaScript.texts');
|
||||
goog.require('Blockly.JavaScript.variables');
|
||||
goog.require('Blockly.JavaScript.variablesDynamic');
|
||||
goog.require('Blockly.Lua');
|
||||
goog.require('Blockly.Lua.colour');
|
||||
goog.require('Blockly.Lua.lists');
|
||||
goog.require('Blockly.Lua.logic');
|
||||
goog.require('Blockly.Lua.loops');
|
||||
goog.require('Blockly.Lua.math');
|
||||
goog.require('Blockly.Lua.procedures');
|
||||
goog.require('Blockly.Lua.texts');
|
||||
goog.require('Blockly.Lua.variables');
|
||||
goog.require('Blockly.Lua.variablesDynamic');
|
||||
goog.require('Blockly.PHP');
|
||||
goog.require('Blockly.PHP.colour');
|
||||
goog.require('Blockly.PHP.lists');
|
||||
goog.require('Blockly.PHP.logic');
|
||||
goog.require('Blockly.PHP.loops');
|
||||
goog.require('Blockly.PHP.math');
|
||||
goog.require('Blockly.PHP.procedures');
|
||||
goog.require('Blockly.PHP.texts');
|
||||
goog.require('Blockly.PHP.variables');
|
||||
goog.require('Blockly.PHP.variablesDynamic');
|
||||
goog.require('Blockly.Python');
|
||||
goog.require('Blockly.Python.colour');
|
||||
goog.require('Blockly.Python.lists');
|
||||
goog.require('Blockly.Python.logic');
|
||||
goog.require('Blockly.Python.loops');
|
||||
goog.require('Blockly.Python.math');
|
||||
goog.require('Blockly.Python.procedures');
|
||||
goog.require('Blockly.Python.texts');
|
||||
goog.require('Blockly.Python.variables');
|
||||
goog.require('Blockly.Python.variablesDynamic');
|
||||
goog.require('Blockly.blocks.colour');
|
||||
goog.require('Blockly.blocks.lists');
|
||||
goog.require('Blockly.blocks.logic');
|
||||
goog.require('Blockly.blocks.loops');
|
||||
goog.require('Blockly.blocks.math');
|
||||
goog.require('Blockly.blocks.procedures');
|
||||
goog.require('Blockly.blocks.texts');
|
||||
goog.require('Blockly.blocks.variables');
|
||||
goog.require('Blockly.blocks.variablesDynamic');
|
||||
goog.require('Blockly.Dart.all');
|
||||
goog.require('Blockly.JavaScript.all');
|
||||
goog.require('Blockly.Lua.all');
|
||||
goog.require('Blockly.PHP.all');
|
||||
goog.require('Blockly.Python.all');
|
||||
goog.require('Blockly.blocks.all');
|
||||
</script>
|
||||
<script src="unittest_javascript.js"></script>
|
||||
<script src="unittest_python.js"></script>
|
||||
|
||||
@@ -11,66 +11,13 @@
|
||||
|
||||
<script>
|
||||
// Custom requires for the playground.
|
||||
goog.require('Blockly.Dart');
|
||||
goog.require('Blockly.Dart.colour');
|
||||
goog.require('Blockly.Dart.lists');
|
||||
goog.require('Blockly.Dart.logic');
|
||||
goog.require('Blockly.Dart.loops');
|
||||
goog.require('Blockly.Dart.math');
|
||||
goog.require('Blockly.Dart.procedures');
|
||||
goog.require('Blockly.Dart.texts');
|
||||
goog.require('Blockly.Dart.variables');
|
||||
goog.require('Blockly.Dart.variablesDynamic');
|
||||
goog.require('Blockly.JavaScript');
|
||||
goog.require('Blockly.JavaScript.colour');
|
||||
goog.require('Blockly.JavaScript.lists');
|
||||
goog.require('Blockly.JavaScript.logic');
|
||||
goog.require('Blockly.JavaScript.loops');
|
||||
goog.require('Blockly.JavaScript.math');
|
||||
goog.require('Blockly.JavaScript.procedures');
|
||||
goog.require('Blockly.JavaScript.texts');
|
||||
goog.require('Blockly.JavaScript.variables');
|
||||
goog.require('Blockly.JavaScript.variablesDynamic');
|
||||
goog.require('Blockly.Lua');
|
||||
goog.require('Blockly.Lua.colour');
|
||||
goog.require('Blockly.Lua.lists');
|
||||
goog.require('Blockly.Lua.logic');
|
||||
goog.require('Blockly.Lua.loops');
|
||||
goog.require('Blockly.Lua.math');
|
||||
goog.require('Blockly.Lua.procedures');
|
||||
goog.require('Blockly.Lua.texts');
|
||||
goog.require('Blockly.Lua.variables');
|
||||
goog.require('Blockly.Lua.variablesDynamic');
|
||||
goog.require('Blockly.PHP');
|
||||
goog.require('Blockly.PHP.colour');
|
||||
goog.require('Blockly.PHP.lists');
|
||||
goog.require('Blockly.PHP.logic');
|
||||
goog.require('Blockly.PHP.loops');
|
||||
goog.require('Blockly.PHP.math');
|
||||
goog.require('Blockly.PHP.procedures');
|
||||
goog.require('Blockly.PHP.texts');
|
||||
goog.require('Blockly.PHP.variables');
|
||||
goog.require('Blockly.PHP.variablesDynamic');
|
||||
goog.require('Blockly.Python');
|
||||
goog.require('Blockly.Python.colour');
|
||||
goog.require('Blockly.Python.lists');
|
||||
goog.require('Blockly.Python.logic');
|
||||
goog.require('Blockly.Python.loops');
|
||||
goog.require('Blockly.Python.math');
|
||||
goog.require('Blockly.Python.procedures');
|
||||
goog.require('Blockly.Python.texts');
|
||||
goog.require('Blockly.Python.variables');
|
||||
goog.require('Blockly.Python.variablesDynamic');
|
||||
goog.require('Blockly.Dart.all');
|
||||
goog.require('Blockly.JavaScript.all');
|
||||
goog.require('Blockly.Lua.all');
|
||||
goog.require('Blockly.PHP.all');
|
||||
goog.require('Blockly.Python.all');
|
||||
goog.require('Blockly.WorkspaceCommentSvg');
|
||||
goog.require('Blockly.blocks.colour');
|
||||
goog.require('Blockly.blocks.lists');
|
||||
goog.require('Blockly.blocks.logic');
|
||||
goog.require('Blockly.blocks.loops');
|
||||
goog.require('Blockly.blocks.math');
|
||||
goog.require('Blockly.blocks.procedures');
|
||||
goog.require('Blockly.blocks.texts');
|
||||
goog.require('Blockly.blocks.variables');
|
||||
goog.require('Blockly.blocks.variablesDynamic');
|
||||
goog.require('Blockly.blocks.all');
|
||||
</script>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
@@ -54,12 +54,9 @@ if [ -z $CI ]; then
|
||||
run_test_command "eslint" "eslint ."
|
||||
fi
|
||||
|
||||
# Run the full usual build process.
|
||||
run_test_command "build" "npm run build"
|
||||
|
||||
# Run the debug build, to ensure there are no closure compiler
|
||||
# warnings / errors.
|
||||
run_test_command "build:debug" "npm run build:debug"
|
||||
# Run the full usual build process, checking to ensure there are no
|
||||
# closure compiler warnings / errors.
|
||||
run_test_command "build-debug" "npm run build-debug"
|
||||
|
||||
# Generate TypeScript typings and ensure there are no errors.
|
||||
run_test_command "typings" "npm run typings"
|
||||
|
||||
Reference in New Issue
Block a user