alina sireneva
2ee7166682
Some checks failed
Docs / build (push) Successful in 6m0s
Tests / test-node (node18) (push) Successful in 1m58s
Tests / test-deno (push) Successful in 1m54s
Tests / test-node (node22) (push) Successful in 2m0s
Tests / test-node (node20) (push) Successful in 2m3s
Tests / test-web (chromium) (push) Successful in 1m57s
Tests / test-bun (push) Successful in 2m6s
Tests / test-web (firefox) (push) Successful in 2m2s
Tests / lint (push) Successful in 6m21s
Tests / e2e-deno (push) Successful in 54s
Tests / e2e (push) Failing after 55s
71 lines
2.6 KiB
JavaScript
71 lines
2.6 KiB
JavaScript
/** @type {import('@fuman/build').RootConfig} */
|
|
export default {
|
|
jsr: {
|
|
exclude: ['**/*.{test,bench,test-utils}.ts', '**/__fixtures__/**'],
|
|
sourceDir: 'src',
|
|
transformCode: (path, code) => {
|
|
if (!path.endsWith('.ts')) return code
|
|
if (!code.match('<deno-(insert|remove|tsignore)>')) return code
|
|
|
|
// deno is missing some types, so we have to add them manually
|
|
// i dont want to manually write types for them, so we just declare them as `any` in a comment
|
|
// and un-comment them when building for deno
|
|
//
|
|
// this way we can still have proper types in the code, while also being able to build for deno
|
|
// very much a crutch, but welp, deno sucks
|
|
|
|
let insertContent = code.match(/<deno-insert>(.*?)<\/deno-insert>/s)
|
|
while (insertContent) {
|
|
code = code.slice(0, insertContent.index)
|
|
+ insertContent[1].replace(/\/\/\s*/g, '')
|
|
+ code.slice(insertContent.index + insertContent[0].length)
|
|
|
|
insertContent = code.match(/<deno-insert>(.*?)<\/deno-insert>/s)
|
|
}
|
|
|
|
let removeContent = code.match(/<deno-remove>(.*?)<\/deno-remove>/s)
|
|
while (removeContent) {
|
|
code = code.slice(0, removeContent.index) + code.slice(removeContent.index + removeContent[0].length)
|
|
|
|
removeContent = code.match(/<deno-remove>(.*?)<\/deno-remove>/s)
|
|
}
|
|
|
|
let tsIgnoreContent = code.match(/\/\/\s*<deno-tsignore>/)
|
|
while (tsIgnoreContent) {
|
|
code = `${code.slice(0, tsIgnoreContent.index)}/* @ts-ignore */${code.slice(tsIgnoreContent.index + tsIgnoreContent[0].length)}`
|
|
|
|
tsIgnoreContent = code.match(/\/\/\s*<deno-tsignore>/)
|
|
}
|
|
|
|
return code
|
|
},
|
|
},
|
|
versioning: {
|
|
exclude: [
|
|
'**/*.test.ts',
|
|
'**/*.test-utils.ts',
|
|
'**/__fixtures__/**',
|
|
'**/*.md',
|
|
'typedoc.cjs',
|
|
'{scripts,dist,tests,private}/**',
|
|
],
|
|
},
|
|
typedoc: {
|
|
excludePackages: [
|
|
'@mtcute/tl',
|
|
'@mtcute/create-bot',
|
|
],
|
|
validation: {
|
|
notExported: true,
|
|
invalidLink: false,
|
|
notDocumented: false,
|
|
},
|
|
plugin: [
|
|
'./.config/typedoc/plugin-external-links.js',
|
|
'./.config/typedoc/plugin-umami.js',
|
|
'./.config/typedoc/plugin-fix-cfpages.js',
|
|
],
|
|
gitRemote: 'https://github.com/mtcute/mtcute',
|
|
},
|
|
viteConfig: '.config/vite.build.ts',
|
|
}
|