* fix(build): Restore erroneously-deleted filter function
This was deleted in PR #7406 as it was mainly being used to
filter core/ vs. test/mocha/ deps into separate deps files -
but it turns out also to be used for filtering error
messages too. Oops.
* refactor(tests): Migrate advanced compilation test to ES Modules
* refactor(build): Migrate main.js to TypeScript
This turns out to be pretty straight forward, even if it would
cause crashing if one actually tried to import this module
instead of just feeding it to Closure Compiler.
* chore(build): Remove goog.declareModuleId calls
Replace goog.declareModuleId calls with a comment recording the
former module ID for posterity (or at least until we decide
how to reformat the renamings file.
* chore(tests): Delete closure/goog/*
For the moment we still need something to serve as base.js for
the benefit of closure-make-deps, so we keep a vestigial
base.js around, containing only the @provideGoog declaration.
* refactor(build): Remove vestigial base.js
By changing slightly the command line arguments to
closure-make-deps and closure-calculate-chunks the need to have
any base.js is eliminated.
* chore: Typo fix for PR #7415
* chore: move input and input types into new directory
* feat: define and export new input types
* feat: modify blocks to construct individual inputs
* chore: transition code to use actual type checks
* chore: fixup input type type
* chore: format
* chore: fixup PR comments
* chore: fix build
* refactor(blocks): Auto-migration of blocks/math.js to ts
This is just the result of running js2ts on this file.
* fix(blocks): Manually migrate & fix types in math.ts
* chore(blocks): clang-format math.ts
* fix(blocks): Corrections for comments on PR #6900
* refactor(blocks): Define types for mixin-ed blocks, etc.
Define types to represent the union of Block and each of the
*_MIXINs, and use these types for the type of this in mixin
methods.
* refactor(blocks): Misc minor changes
Make sure validator functions explicitly return undefined.
Field.prototype.setValidator takes a FieldValidator<T>, which
must be a non-void function. I'm not sure why tsc was not
objecting to the void implementation here, but it does in
other very similar situations so for consistency explicitly
return undefined to signal the value should be used unchanged.
Also undo previous change of !. to ?.: I think it wisest to
try to preserve the existing behaviour as exactly as possible
for now, and make behaviour changes (i.e., ones that affect
the generated code) separately.
* fix(blocks): Fix erroneous typing of mixins
It turns out that the previous types for these were completely
wrong, for two reasons:
- They should be intersection types (which have the union of the
properties), not union types (which have the interseciton of the
properties).
- The *_MIXIN types were already declared as having type
BlockDefinition, which is ultimately an alias for any.
TypeScript doesn't like (some) kinds of circularly defined types,
so fixing the above necessitates declaring a few auxiliary types
just to make the type checker happy - but the end result is
excellent and caught an actual type error in the code.