mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-20 04:51:16 +00:00
chore: clean up build steps
This commit is contained in:
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user