2024-08-14 04:33:02 -06:00
|
|
|
/* eslint-disable @typescript-eslint/no-require-imports */
|
|
|
|
// we need `require` for dynamic runtime imports
|
2021-12-22 09:01:28 -07:00
|
|
|
// https://stackoverflow.com/a/46745166/10109857
|
|
|
|
|
|
|
|
/**
|
|
|
|
* returns renovates package.json
|
|
|
|
*/
|
2024-07-17 12:33:36 -06:00
|
|
|
const path = (() => require('path'))();
|
|
|
|
// need to use dynamic strings so that typescript does not include package.json in dist folder after compilation
|
|
|
|
const filePath = path.join(__dirname, '..', 'package.json');
|
|
|
|
const pkg = (() => require(filePath))();
|
2021-12-22 09:01:28 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* return's re2
|
|
|
|
* @returns {RegExpConstructor}
|
|
|
|
*/
|
|
|
|
function re2() {
|
|
|
|
return require('re2');
|
|
|
|
}
|
|
|
|
|
2023-01-20 09:22:30 -07:00
|
|
|
/**
|
|
|
|
* return's prettier
|
|
|
|
* @returns {typeof import('prettier')}
|
|
|
|
*/
|
|
|
|
function prettier() {
|
|
|
|
return require('prettier');
|
|
|
|
}
|
|
|
|
|
2024-04-22 05:35:15 -06:00
|
|
|
/**
|
|
|
|
* return's openpgp
|
|
|
|
* @returns {typeof import('openpgp')}
|
|
|
|
*/
|
|
|
|
function openpgp() {
|
|
|
|
return require('openpgp');
|
|
|
|
}
|
|
|
|
|
2024-05-02 02:06:55 -06:00
|
|
|
/**
|
|
|
|
* return's sqlite
|
|
|
|
* @returns {typeof import('better-sqlite3')}
|
|
|
|
*/
|
|
|
|
function sqlite() {
|
|
|
|
return require('better-sqlite3');
|
|
|
|
}
|
|
|
|
|
2024-04-22 05:35:15 -06:00
|
|
|
module.exports = {
|
|
|
|
re2,
|
|
|
|
pkg,
|
|
|
|
openpgp,
|
|
|
|
prettier,
|
2024-05-02 02:06:55 -06:00
|
|
|
sqlite,
|
2024-04-22 05:35:15 -06:00
|
|
|
};
|