close

Make WordPress Core

Changeset 61830


Ignore:
Timestamp:
03/04/2026 08:40:32 PM (9 days ago)
Author:
westonruter
Message:

Build/Test Tools: Integrate TypeScript into the core development workflow.

This introduces a new GitHub Action workflow for JavaScript type checking, mirroring the implementation for PHPStan in #61175. It also adds a typecheck:js Grunt task and includes it in the precommit:js task list. Only files related to the code editor are initially checked with TypeScript, with the expectation that additional files will be added to the files list in tsconfig.json as a part of ongoing maintenance work, for example #64238 and #64226.

Developed in https://github.com/WordPress/wordpress-develop/pull/11131

Follow up to r61699, r61800, r61539.

Props westonruter, jonsurrell.
See #61175, #64661, #48456.
Fixes #64662.

Location:
trunk
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/.github/workflows/phpstan-static-analysis.yml

    r61699 r61830  
    8282    steps:
    8383      - name: Dispatch workflow run
    84         uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
     84        uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
    8585        with:
    8686          retries: 2
  • trunk/Gruntfile.js

    r61800 r61830  
    15571557        'webpack:prod',
    15581558        'jshint:corejs',
     1559        'typecheck:js',
    15591560        'uglify:imgareaselect',
    15601561        'uglify:jqueryform',
     
    20102011    grunt.registerTask( 'test', 'Runs all QUnit and PHPUnit tasks.', ['qunit:compiled', 'phpunit'] );
    20112012
     2013    grunt.registerTask( 'typecheck:js', 'Runs TypeScript type checking.', function() {
     2014        var done = this.async();
     2015
     2016        grunt.util.spawn( {
     2017            cmd: 'npm',
     2018            args: [ 'run', 'typecheck:js' ],
     2019            opts: { stdio: 'inherit' }
     2020        }, function( error ) {
     2021            done( ! error );
     2022        } );
     2023    } );
     2024
    20122025    grunt.registerTask( 'phpstan', 'Runs PHPStan on the entire codebase.', function() {
    20132026        var done = this.async();
Note: See TracChangeset for help on using the changeset viewer.