Skip to content

Conversation

@cpcallen
Copy link
Collaborator

@cpcallen cpcallen commented Feb 9, 2023

The basics

  • I branched from develop
  • My pull request is against develop
  • My code follows the style guide
  • I ran npm run format and npm run lint

The details

Proposed Changes

Add a script, js2ts, to automate some of the more trivial but annoying work to be done converting blocks and generators from JavaScript to TypeScript. In particular, it

  • Converts goog.module() to goog.declareModuleId(), and adds the requisite import of goog.js.
  • Converts goog.require() to import
  • Converts exports.foo = foo into export foo (preferably by export to the declaration of foo if possible), rather than as a separate statement).

Reason for Changes

I'm lazy and don't want to do all this fiddly work by hand.

Test Coverage

I ran it on math/blocks.js and the result was vaguely reasonalble-looking.

Documentation

It could use some.

@github-actions github-actions bot added the PR: chore General chores (dependencies, typos, etc) label Feb 9, 2023
@cpcallen cpcallen marked this pull request as ready for review February 9, 2023 21:11
@cpcallen cpcallen requested a review from a team as a code owner February 9, 2023 21:11
@cpcallen cpcallen requested a review from gonfunko February 9, 2023 21:11
@cpcallen cpcallen merged commit ddd38a4 into RaspberryPiFoundation:develop Feb 10, 2023
@cpcallen cpcallen deleted the fix/6828/js2ts branch March 15, 2024 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: chore General chores (dependencies, typos, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants