2f78893ace
* Avoid escaping export identifier when it is a known global * Use a record type instead of a record schema type as the generic parameter for `ListRecord` * Export everything from `@atproto/lex-data` and `@atproto/lex-json` * Add lex-json and lex-data to lex readme * lock * Apply defaults when running `schema.$build()` on objects and records. * changeset * simplify $Typed and $TypedMaybe * tidy * tidy * Add `enumBlobRefs` utility function * Add an `indexFile` option that allows generating an "index.ts" file that re-exports every tld namespaces. * readme * Add `base64ToUtf8` and `utf8ToBase64` utilities * Add service auth authentication method
50 lines
1.3 KiB
JavaScript
50 lines
1.3 KiB
JavaScript
/* eslint-env node */
|
|
|
|
import { dirname, join } from 'node:path'
|
|
import { fileURLToPath } from 'node:url'
|
|
import { build } from '@atproto/lex-builder'
|
|
|
|
const __dirname = dirname(fileURLToPath(import.meta.url))
|
|
|
|
Promise.all([
|
|
// For src
|
|
build({
|
|
lexicons: join(__dirname, '..', '..', '..', '..', 'lexicons'),
|
|
out: join(__dirname, '..', 'src', 'lexicons'),
|
|
clear: true,
|
|
include: [
|
|
'com.atproto.repo.createRecord',
|
|
'com.atproto.repo.deleteRecord',
|
|
'com.atproto.repo.getRecord',
|
|
'com.atproto.repo.putRecord',
|
|
'com.atproto.repo.listRecords',
|
|
'com.atproto.repo.uploadBlob',
|
|
'com.atproto.sync.getBlob',
|
|
],
|
|
lib: '@atproto/lex-schema',
|
|
pretty: true,
|
|
pureAnnotations: true,
|
|
indexFile: true,
|
|
}),
|
|
|
|
// For tests
|
|
build({
|
|
lexicons: join(__dirname, '..', '..', '..', '..', 'lexicons'),
|
|
out: join(__dirname, '..', 'tests', 'lexicons'),
|
|
clear: true,
|
|
include: [
|
|
'app.bsky.*',
|
|
'com.atproto.repo.createRecord',
|
|
'com.atproto.repo.getRecord',
|
|
'com.atproto.repo.uploadBlob',
|
|
'com.atproto.sync.getBlob',
|
|
],
|
|
lib: '@atproto/lex-schema',
|
|
pretty: true,
|
|
indexFile: true,
|
|
}),
|
|
]).catch((err) => {
|
|
console.error('Error building lexicon schemas:', err)
|
|
process.exit(1)
|
|
})
|