From 6ccff4431dd34d66ed9be7ddd8fcc272749fed73 Mon Sep 17 00:00:00 2001 From: Christopher Allen Date: Sat, 10 Jul 2021 12:54:49 +0100 Subject: [PATCH] Fix line lengths Including by using the node_modules/.bin/closure2ts wrapper provided by typescript-closure-tools instead of running the source .js directly. --- scripts/gulpfiles/typings.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/gulpfiles/typings.js b/scripts/gulpfiles/typings.js index 8d5cbb96d..1a40d53b2 100644 --- a/scripts/gulpfiles/typings.js +++ b/scripts/gulpfiles/typings.js @@ -82,7 +82,7 @@ function typings() { if (file.indexOf('core/msg.js') > -1) { return; } - const cmd = `node ./node_modules/typescript-closure-tools/definition-generator/src/main.js ${file} ${typescriptFileName}`; + const cmd = `closure2ts ${file} ${typescriptFileName}`; console.log(`Generating typings for ${file}`); execSync(cmd, { stdio: 'inherit' }); }); @@ -106,7 +106,8 @@ function typings() { // Generates the TypeScript definition files (d.ts) for Blockly locales. function msgTypings(cb) { - const template = fs.readFileSync(path.join('typings/templates/msg.template'), 'utf-8'); + const template = + fs.readFileSync(path.join('typings/templates/msg.template'), 'utf-8'); const msgFiles = fs.readdirSync(path.join('msg', 'json')); const msgDir = path.join(TYPINGS_BUILD_DIR, 'msg'); if (!fs.existsSync(msgDir)) { @@ -115,8 +116,9 @@ function msgTypings(cb) { msgFiles.forEach(msg => { const localeName = msg.substring(0, msg.indexOf('.json')); const msgTypings = template.slice().replace(/<%= locale %>/gi, localeName); - fs.writeFileSync(path.join(TYPINGS_BUILD_DIR, 'msg', localeName + '.d.ts'), msgTypings, 'utf-8'); - }) + fs.writeFileSync(path.join(TYPINGS_BUILD_DIR, 'msg', localeName + '.d.ts'), + msgTypings, 'utf-8'); + }); cb(); }