chore: clean up build steps

This commit is contained in:
LuanRT
2022-07-20 16:28:51 -03:00
parent fb68e6bcfe
commit 6a5ebeb8ee
287 changed files with 40 additions and 40 deletions

View File

@@ -5,18 +5,18 @@ const path = require('path');
const import_list = [];
const json = [];
glob.sync('../lib/parser/classes/**/*.{js,ts}', { cwd: __dirname })
glob.sync('../src/parser/classes/**/*.{js,ts}', { cwd: __dirname })
.forEach((file) => {
if (file.includes('/misc/')) return;
// Trim path
file = file.replace('../lib/parser/classes/', '').replace('.js', '').replace('.ts', '');
file = file.replace('../src/parser/classes/', '').replace('.js', '').replace('.ts', '');
const import_name = file.split('/').pop();
import_list.push(`import { default as ${import_name} } from './classes/${file}';`);
json.push(import_name);
});
fs.writeFileSync(
path.resolve(__dirname, '../lib/parser/map.ts'),
path.resolve(__dirname, '../src/parser/map.ts'),
`// This file was auto generated, do not edit.
// See ./scripts/build-parser-json.js
import { YTNodeConstructor } from './helpers';