- ✅ Ticket 1.1: Estructura Clean Architecture en backend - ✅ Ticket 1.2: Schemas Zod compartidos - ✅ Ticket 1.3: Refactorización drugs.ts (1362 → 8 archivos modulares) - ✅ Ticket 1.4: Refactorización procedures.ts (3583 → 6 archivos modulares) - ✅ Ticket 1.5: Eliminación de duplicidades (~50 líneas) Cambios principales: - Creada estructura Clean Architecture en backend/src/ - Schemas Zod compartidos en backend/src/shared/schemas/ - Refactorización modular de drugs y procedures - Utilidades genéricas en src/utils/ (filter, validation) - Eliminados scripts obsoletos y documentación antigua - Corregidos errores: QueryClient, import test-error-handling - Build verificado y funcionando correctamente
70 lines
2 KiB
JavaScript
70 lines
2 KiB
JavaScript
/**
|
|
* @typedef {import('micromark-extension-gfm-footnote').HtmlOptions} HtmlOptions
|
|
* @typedef {import('micromark-extension-gfm-strikethrough').Options} Options
|
|
* @typedef {import('micromark-util-types').Extension} Extension
|
|
* @typedef {import('micromark-util-types').HtmlExtension} HtmlExtension
|
|
*/
|
|
|
|
import {
|
|
combineExtensions,
|
|
combineHtmlExtensions
|
|
} from 'micromark-util-combine-extensions'
|
|
import {
|
|
gfmAutolinkLiteral,
|
|
gfmAutolinkLiteralHtml
|
|
} from 'micromark-extension-gfm-autolink-literal'
|
|
import {gfmFootnote, gfmFootnoteHtml} from 'micromark-extension-gfm-footnote'
|
|
import {
|
|
gfmStrikethrough,
|
|
gfmStrikethroughHtml
|
|
} from 'micromark-extension-gfm-strikethrough'
|
|
import {gfmTable, gfmTableHtml} from 'micromark-extension-gfm-table'
|
|
import {gfmTagfilterHtml} from 'micromark-extension-gfm-tagfilter'
|
|
import {
|
|
gfmTaskListItem,
|
|
gfmTaskListItemHtml
|
|
} from 'micromark-extension-gfm-task-list-item'
|
|
|
|
/**
|
|
* Create an extension for `micromark` to enable GFM syntax.
|
|
*
|
|
* @param {Options | null | undefined} [options]
|
|
* Configuration (optional).
|
|
*
|
|
* Passed to `micromark-extens-gfm-strikethrough`.
|
|
* @returns {Extension}
|
|
* Extension for `micromark` that can be passed in `extensions` to enable GFM
|
|
* syntax.
|
|
*/
|
|
export function gfm(options) {
|
|
return combineExtensions([
|
|
gfmAutolinkLiteral(),
|
|
gfmFootnote(),
|
|
gfmStrikethrough(options),
|
|
gfmTable(),
|
|
gfmTaskListItem()
|
|
])
|
|
}
|
|
|
|
/**
|
|
* Create an extension for `micromark` to support GFM when serializing to HTML.
|
|
*
|
|
* @param {HtmlOptions | null | undefined} [options]
|
|
* Configuration (optional).
|
|
*
|
|
* Passed to `micromark-extens-gfm-footnote`.
|
|
* @returns {HtmlExtension}
|
|
* Extension for `micromark` that can be passed in `htmlExtensions` to
|
|
* support GFM when serializing to HTML.
|
|
*/
|
|
export function gfmHtml(options) {
|
|
return combineHtmlExtensions([
|
|
gfmAutolinkLiteralHtml(),
|
|
gfmFootnoteHtml(options),
|
|
gfmStrikethroughHtml(),
|
|
gfmTableHtml(),
|
|
gfmTagfilterHtml(),
|
|
gfmTaskListItemHtml()
|
|
])
|
|
}
|