5c: the build, the freeze audit and the release pipeline
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import { adfToMarkdown, isAdfDocument, markdownToAdf, type AdfDocument, type ConvertErrorCode, type ParseError, type Result } from '@larvit/adf-codec'
|
||||
|
||||
const document: AdfDocument = { content: [{ content: [{ text: 'x', type: 'text' }], type: 'paragraph' }], type: 'doc', version: 1 }
|
||||
|
||||
const emitted: Result<string> = adfToMarkdown(document)
|
||||
const parsed: Result<AdfDocument, ParseError> = markdownToAdf('x\n')
|
||||
const guarded: boolean = isAdfDocument(document)
|
||||
const code: ConvertErrorCode | undefined = emitted.ok ? undefined : emitted.error.code
|
||||
const line: number | undefined = parsed.ok ? undefined : parsed.error.position.line
|
||||
|
||||
export const surface = { code, guarded, line }
|
||||
@@ -0,0 +1,9 @@
|
||||
import assert from 'node:assert/strict'
|
||||
|
||||
import { adfToMarkdown, markdownToAdf } from '@larvit/adf-codec'
|
||||
|
||||
const document = { content: [{ content: [{ marks: [{ type: 'em' }], text: 'x', type: 'text' }], type: 'paragraph' }], type: 'doc', version: 1 }
|
||||
|
||||
const emitted = adfToMarkdown(document)
|
||||
assert.ok(emitted.ok, emitted.ok ? '' : emitted.error.message)
|
||||
assert.deepEqual(markdownToAdf(emitted.value), { ok: true, value: document })
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"lib": ["ES2022"],
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext",
|
||||
"noEmit": true,
|
||||
"strict": true,
|
||||
"target": "ES2022",
|
||||
"types": []
|
||||
},
|
||||
"include": ["consumer.ts"]
|
||||
}
|
||||
Reference in New Issue
Block a user