Repository navigation
Expand file tree
/
Copy pathtsdown.config.ts
More file actions
52 lines (51 loc) · 1.48 KB
/
Copy pathtsdown.config.ts
File metadata and controls
52 lines (51 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import { readFileSync } from 'node:fs'
import { defineConfig } from 'tsdown'
import { standaloneSchema } from './scripts/generate-schemas.ts'
export default defineConfig({
entry: [
'src/index.ts',
'src/github/index.ts',
'src/gitlab/index.ts',
'src/bitbucket/index.ts',
'src/forgejo/index.ts',
'src/gitea/index.ts',
'src/tangled/index.ts',
'src/cursor-origin/index.ts',
'src/gitee/index.ts',
'src/pushin/index.ts',
'src/azure-devops/index.ts',
'src/cloudflare-artifacts/index.ts',
'src/sourcehut/index.ts',
'src/gitbucket/index.ts',
'src/entire/index.ts',
'src/env.ts',
'src/helpers.ts',
'src/kit.ts',
'src/schema/index.ts',
'src/testing/index.ts',
'src/fake/index.ts',
'src/web/index.ts',
],
dts: { generator: 'oxc' },
exports: {
devExports: true,
customExports: { './schema/*.json': './dist/schema/*.json' },
},
/** Writes the schema files with the bundle, so publint and attw pack what npm will ship. */
plugins: [
{
name: 'forges:schema-files',
generateBundle() {
const schemas = JSON.parse(readFileSync(new URL('./src/schema/schemas.json', import.meta.url), 'utf8'))
for (const name of Object.keys(schemas)) {
this.emitFile({ type: 'asset', fileName: `schema/${name}.json`, source: `${JSON.stringify(standaloneSchema(name, schemas), null, 2)}\n` })
}
},
},
],
publint: true,
attw: {
profile: 'esm-only',
level: 'error',
},
})