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(); }