Description
I have a simple data source, whos config is loaded via injection:
export class MainDataSource extends juggler.DataSource
implements LifeCycleObserver {
static dataSourceName = 'Main';
constructor(
@config()
dsConfig: object,
) {
super(dsConfig);
}
}
Application.ts:
this.configure('datasources.Main').to(options.datasources?.Main || {});
When running the repository scaffolding tool the following error occurs:
(node:24064) UnhandledPromiseRejectionWarning: Error: Cannot load C:\lb4\src\datasources\main.datasource.config.json: ENOENT: no such file or directory, open 'C:\lb4\src\datasources\main.datasource.config.json'
I am temporarily suppressing the error by adding a main.datasource.config.json
file in the source directory.
However, this scaffolding tool should not require a fully configured data source to generate simple repositories. If the configuration cannot be found, it should just emit a warning, but still allow the tool to run and generate a non-customized class using the basic boilerplate.