breejs / bree

Bree is a Node.js and JavaScript job task scheduler with worker threads, cron, Date, and human syntax. Built for @ladjs, @forwardemail, @spamscanner, @cabinjs.
https://jobscheduler.net
MIT License
2.96k stars 80 forks source link

[fix] defaultRootIndex is not working - also not a valid option #203

Open mikevalstar opened 1 year ago

mikevalstar commented 1 year ago

Describe the bug

Node.js version: 16.13.1

OS version: MacOS 12.6

Description: When setting the defaultRootIndex it does not work; specifically setting it to 'index.ts'

Actual behavior

The option on start does not seem to be taken into account. Additionally this variable is not part of the types on the object.

Expected behavior

it should use this option

Code to reproduce

const bree = new Bree({
  root: path.join(__dirname, 'jobsv2'),
  defaultRootIndex: 'index.ts',
  defaultExtension: 'ts',
  acceptedExtensions: ['ts', 'js', 'mjs'],
  outputWorkerMetadata: true,
});

Checklist