* esm * wip * wip * wip * wip * wip * wip * subscription notice * wip * wip * wip * fix envs * fix: update docker build * fix * esm/types * delete dashboard :D * add patches to dockerfiles * update packages + catalogs + ts * wip * remove native libs * ts * improvements * fix redirects and fetching session * try fix favicon * fixes * fix * order and resize reportds within a dashboard * improvements * wip * added userjot to dashboard * fix * add op * wip * different cache key * improve date picker * fix table * event details loading * redo onboarding completely * fix login * fix * fix * extend session, billing and improve bars * fix * reduce price on 10M
35 lines
995 B
TypeScript
35 lines
995 B
TypeScript
import fs from 'node:fs';
|
|
import path from 'node:path';
|
|
import { dirname } from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
const __filename = fileURLToPath(import.meta.url);
|
|
const __dirname = dirname(__filename);
|
|
import yaml from 'js-yaml';
|
|
|
|
async function main() {
|
|
// Get document, or throw exception on error
|
|
try {
|
|
const data = await fetch(
|
|
'https://raw.githubusercontent.com/matomo-org/device-detector/master/regexes/bots.yml',
|
|
).then((res) => res.text());
|
|
|
|
fs.writeFileSync(
|
|
path.resolve(__dirname, '../src/bots/bots.ts'),
|
|
[
|
|
'// This file is generated by the script get-bots.ts',
|
|
'',
|
|
'// The data is fetch from device-detector https://raw.githubusercontent.com/matomo-org/device-detector/master/regexes/bots.yml',
|
|
'',
|
|
`const bots = ${JSON.stringify(yaml.load(data))} as const;`,
|
|
'export default bots;',
|
|
].join('\n'),
|
|
'utf-8',
|
|
);
|
|
} catch (e) {
|
|
console.log(e);
|
|
}
|
|
}
|
|
|
|
main();
|