diff --git a/build/utils.js b/build/utils.js index fe9278b3..b23cece6 100644 --- a/build/utils.js +++ b/build/utils.js @@ -77,7 +77,7 @@ exports.removeDir = removeDir; /** * Launch the typescript compiler synchronously over a project. * - * @param {string} projectPath + * @param {string} _projectPath */ function tsc(_projectPath) { const projectPath = path.join(REPO_ROOT, _projectPath); @@ -87,6 +87,19 @@ function tsc(_projectPath) { } exports.tsc = tsc; +/** + * Launch prettier on a specific file. + * + * @param {string} _filePath + */ +function prettier(_filePath) { + const filePath = path.join(REPO_ROOT, _filePath); + cp.spawnSync(process.execPath, [path.join(__dirname, '../node_modules/prettier/bin-prettier.js'), '--write', filePath], { stdio: 'inherit', stderr: 'inherit' }); + + console.log(`Ran prettier over ${_filePath}`); +} +exports.prettier = prettier; + /** * Transform an external .d.ts file to an internal .d.ts file * @@ -128,5 +141,7 @@ function dts(_source, _destination, namespace) { result.push(``); fs.writeFileSync(destination, result.join('\n')); + + prettier(_destination); } exports.dts = dts; diff --git a/monaco-css/scripts/build.js b/monaco-css/scripts/build.js index 35b41695..4fd66a20 100644 --- a/monaco-css/scripts/build.js +++ b/monaco-css/scripts/build.js @@ -16,8 +16,6 @@ tsc(`monaco-css/src/tsconfig.json`); dts(`monaco-css/out/amd/monaco.contribution.d.ts`, `monaco-css/monaco.d.ts`, 'monaco.languages.css'); -cp.spawnSync(process.execPath, [path.join(__dirname, '../../node_modules/prettier/bin-prettier.js'), '--write', path.join(__dirname, '../monaco.d.ts')], { stdio: 'inherit', stderr: 'inherit' }); - esbuild.build({ entryPoints: ['src/cssMode.ts', 'src/css.worker.ts', 'src/monaco.contribution.ts'], bundle: true,