Skip to content

Commit

Permalink
Remove grunt-ts (gpuweb#3249)
Browse files Browse the repository at this point in the history
* Remove grunt-ts

IIUC, grunt-ts is only used to run typescript to do typechecking
which can be done more simply by just spawning typescript.

This removes 146 packages and most of the npm warnings

* make it work on windows
  • Loading branch information
greggman authored Jan 8, 2024
1 parent f64bdd2 commit 1cc4ab0
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 3,148 deletions.
27 changes: 15 additions & 12 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
/* eslint-disable no-console */

const timer = require('grunt-timer');
const { spawnSync } = require('child_process');
const path = require('path');

const kAllSuites = ['webgpu', 'stress', 'manual', 'unittests', 'demo'];

Expand Down Expand Up @@ -181,15 +183,6 @@ module.exports = function (grunt) {
},
},

ts: {
check: {
tsconfig: {
tsconfig: 'tsconfig.json',
passThrough: true,
},
},
},

concurrent: {
'write-out-wpt-cts-html-all': {
tasks: [
Expand All @@ -206,7 +199,7 @@ module.exports = function (grunt) {
},
'all-checks': {
tasks: [
'ts:check',
'ts-check',
'run:validate',
'run:validate-cache',
'run:unittest',
Expand All @@ -227,7 +220,6 @@ module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-concurrent');
grunt.loadNpmTasks('grunt-run');
grunt.loadNpmTasks('grunt-ts');

const helpMessageTasks = [];
function registerTaskAndAddToHelp(name, desc, deps) {
Expand All @@ -238,6 +230,17 @@ module.exports = function (grunt) {
helpMessageTasks.push({ name, desc });
}

grunt.registerTask('ts-check', function() {
spawnSync(path.join('node_modules', '.bin', 'tsc'), [
'--project',
'tsconfig.json',
'--noEmit',
], {
shell: true,
stdio: 'inherit',
});
});

grunt.registerTask('generate-common', 'Generate files into gen/ and src/', [
'run:generate-version',
'run:generate-listings',
Expand Down Expand Up @@ -301,7 +304,7 @@ module.exports = function (grunt) {
'run:unittest',
]);
registerTaskAndAddToHelp('typecheck', 'Just typecheck', [
'ts:check',
'ts-check',
]);
registerTaskAndAddToHelp('tsdoc', 'Just build tsdoc', [
'run:tsdoc',
Expand Down
Loading

0 comments on commit 1cc4ab0

Please sign in to comment.