Commit Graph

6 Commits

Author SHA1 Message Date
Christopher Allen
b0a7c004a9 refactor(build): Delete Closure Library (#7415)
* 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
2023-08-31 00:24:47 +01:00
dependabot[bot]
2546b01d70 chore(deps): Bump prettier from 2.8.8 to 3.0.0 (#7322)
* chore(deps): Bump prettier from 2.8.8 to 3.0.0

Bumps [prettier](https://github.com/prettier/prettier) from 2.8.8 to 3.0.0.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.8.8...3.0.0)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore: Reformat using Prettier v3.0 defaults

The main change is to add trailing commas to the last line of
block-formatted function calls.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Christopher Allen <cpcallen+git@google.com>
2023-07-25 14:56:10 +00:00
Beka Westberg
42b8c6e3ab fix: return annotations (#7118)
* chore: remove suppress annotations

* chore: remove fileoverview annotation

* chore: remove other unused annotations

* chore: change return to returns

* chore: enable tag linting
2023-05-24 13:01:33 -07:00
Maribeth Bottorff
88ff901a72 chore: use prettier instead of clang-format (#7014)
* chore: add and configure prettier

* chore: remove clang-format

* chore: remove clang-format config

* chore: lint additional ts files

* chore: fix lint errors in blocks

* chore: add prettier-ignore where needed

* chore: ignore js blocks when formatting

* chore: fix playground html syntax

* chore: fix yaml spacing from merge

* chore: convert text blocks to use arrow functions

* chore: format everything with prettier

* chore: fix lint unused imports in blocks
2023-05-10 16:01:39 -07:00
Beka Westberg
3a9a9bd24e feat: break input types into separate classes (#7019)
* 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
2023-05-04 08:50:45 -07:00
Christopher Allen
bb9f31853d refactor(blocks): Migrate blocks/math.js to TypeScript (#6900)
* 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.
2023-03-17 20:24:09 +00:00