* feat: added `tests/typescript` to test supported TS examples
* fix: update the test name, description, and output
* chore: remove unused imports in `test_tasks.js`
* fix: wrap README line at 80 characters
* fix: implemented `different_user_input.ts` feedback
* fix: correct mistaken comments
* chore: rename `./eslintrc.json` to `./eslintrc.js`
* feat: added linting for tests/typescript
* chore: cleanup eslintrc lines over 80 characters
* fix: updated `.eslintrc.js` to provide an override for linting itself
* fix: updated tests to build to the `build` directory
* feat: updated `gulp format` to handle formatting `.eslintrc.js`
* fix: updated `.eslintrc.js` to align with both formatter and linter
* fix: updated config comment wording
* fix: removed quotes for valid identifiers
* Revert "fix: removed quotes for valid identifiers"
This reverts commit 03eff91aea1468e503bc79a90fb139914d3f39d2.
* chore(tests): Remove circular import loading issue kludge
Prior to PR #6818, circular imports resulted in the debug module
loader (in closure/goog/base.js) failing to record the
goog.module ID of most modules that were
involved in the cycle, and in particular of the Blockly.Xml
module. This had secondary fallout that resulted
in library blocks modules being loaded in the wrong order.
A kludge was introduced in PR #6703 that worked around this
problem by making sure that window.Blockly was set, allowing
the modules loaded out-of-order to still work.
Now that we have removed all remaining circular dependencies
there is no need for the kludge, since all module IDs are
properly recorded and modules are loaded in the correct order.
* chore(build): Remove exclude for non-existent core/blockly.js
There was a transitional period where we had both
core/blockly.ts and core/blockly.js, and wished to exclude
the latter from tsc's input, but the latter file was deleted
(and inadvertently restored, then re-deleted) some time ago.
* refactor: Use the field registry to instantiate fields for list blocks.
* refactor: Use the field registry to instantiate fields for procedure blocks.
* refactor: Use the field registry to instantiate fields for text blocks.
* refactor(xml): Move textToDom to core/utils/xml.ts
This function being in core/xml.ts was the cause for the last
remaining circular import in core/ (between variables.ts and
xml.ts).
Moving it to utils/xml.ts makes sense anyway, since there is
nothing Blockly-specific about this function.
Fixes#6817.
* fix(closure): Reenable goog.declareModuleId multiple-call check
Reenable an assertion which check to make sure that
goog.declareModuleId is not called more than once in a module
(and which also catches circular imports amongst ES modules, which
are not detected by closure-make-deps).
* chore(tests,demos): Augo-migrate use of textToDom
Testing the migration file entry by auto-migrating all uses of
Blockly.Xml.textToDom to Blockly.utils.xml.textToDom.
* chore(blocks): Manually migrate remaining use of textToDom
Update the one remaining call to textToDom (in blocks/lists.ts)
to the function's new location - also removing the last use of
the Blockly.Xml / core/xml.ts) module from this file.
* docs(xml): Remove unneeded @alias per comments on PR #6818
* fix(imports): Remove unused import
This change had already been made (by PR #6475 amongst other) to
most of the tests, but there were a couple of stragglers that
still mentioned messages.js.
Fixes#6824.
* chore: Remove uses of AnyDuringMigration in workspace_comment_svg.ts.
* chore: Remove uses of AnyDuringMigration in toolbox.ts.
* chore: Remove uses of AnyDuringMigration in field_colour.ts.
* chore: Remove uses of AnyDuringMigration from field_image.ts.
* chore: Remove uses of AnyDuringMigration from workspace.ts.
* Update core/workspace_comment_svg.ts
Co-authored-by: Christopher Allen <cpcallen+github@gmail.com>
* chore: Remove uses of AnyDuringMigration in collapsible_category.ts.
* chore: Revert unary - change to make clang-format happy.
* chore: Remove unnecessary quotes in toolbox.ts.
* Update core/workspace_comment_svg.ts
Co-authored-by: Christopher Allen <cpcallen+github@gmail.com>
---------
Co-authored-by: Christopher Allen <cpcallen+github@gmail.com>
* fix(tests): Fix errors in event tests
- Fix actual syntax errors in imports in event_marker_move_test.js
and event_selected.test.js, which were preventing those tests from
being run.
- Remove suite.only directives in those tests that would prevent
all the other tests from running.
* refactor(build): Improve buildDeps
- Run closure-make-deps only once, instead of separately for core/
and tests/.
- Specify a larger exec maxBuffer size, to ensure output and
diagnostics are not truncated.
- Change stderr filtering in buildDeps to filter out bounded
generics messages and blank lines.
- Attempt to suppress warnings in stderr output when
closure-make-deps returns a non-zero exit code.
Unfortunately, there seems to be a race condition which usually
the stderr argument to the exec callback not to contain the
complete output, so in that case print a helpful message.
- Have buildDeps just return a Promise instead of using a callback.
* fix(docs): Typo fix in JSDoc for log helper
* fix(node): Don't use global variables for jsdom injection
Introduce a (hopefully generally applicable) mechanism for
injecting dependencies into modules, specifically in this case
to inject required bits of JSDOM's Window and Document
implementations into core/utils/xml.js when running in
node.js or other environments lacking a DOM.
The injectDependencies function uses an options object to
facilitate optionally injecting multiple named dependencies
at the same time.
Rename the xmlDocument local variable back to document (was
renamed in #5461) so that the name used in this module
corresponds to the usual global variable it replaces.
Change the injection in scripts/package/node/core.js to use
injectDependencies instead of setXmlDocument + global variables;
also eliminate apparently-unnecessary creation of a special
Document instance, using the default one supplied by jsdom
instead.
Fixes#6725.
* deprecate(xml): Deprecate getXmlDocument and setXmlDocument
Mark getXmlDocument and setXmlDocument as @deprecated, with
suitable calls to deprecation.warn().
There are no remaining callers to either function within core -
setXmlDocument was only used by the node.js wrapper, and and
apparently getXmlDocument was never used AFAICT - and we do not
anticipate that either were used by external developers.
* fix: Corrections for comments on PR #6764.
(cherry picked from commit cd57e74d1a)
* refactor: Remove unused translate_ and skew_ attributes from workspace_comment_svg.ts.
* refactor: Stop setting skew_ and translate_ attributes on SVGs.
* chore: Run format.
* refactor: Return early if no wobbling block is present.