Skip to content

Commit

Permalink
build: fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
elevatebart committed Oct 12, 2020
1 parent 318ef37 commit cd10b5e
Show file tree
Hide file tree
Showing 4 changed files with 3,931 additions and 127 deletions.
6 changes: 3 additions & 3 deletions packages/vue-docgen-api/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
export { cleanName, getDefaultExample } from 'vue-inbrowser-compiler-utils'

import Documentation, {
ComponentDoc,
PropDescriptor,
Expand All @@ -15,10 +13,12 @@ import Documentation, {
import { DocGenOptions as DCOptions, parseFile, ParseOptions, parseSource as _parseSource } from './parse'
import * as ScriptHandlers from './script-handlers'
import * as TemplateHandlers from './template-handlers'
import mergeTranslations from './mergeTranslations'

export { ScriptHandlers }
export { TemplateHandlers }
import mergeTranslations from './mergeTranslations'

export { cleanName, getDefaultExample } from 'vue-inbrowser-compiler-utils'

export interface DocGenOptions extends DCOptions {
translation?: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ describe('slotHandler', () => {
)
traverse(ast.children[0], doc, [slotHandler], ast.children, { functional: false })
const slots = doc.toObject().slots || []
expect(slots.filter(s => s.name === 'bound')[0].bindings).toMatchObject([
expect(slots.filter((s: any) => s.name === 'bound')[0].bindings).toMatchObject([
{
name: 'v-bind'
}
Expand All @@ -113,7 +113,7 @@ describe('slotHandler', () => {
)
traverse(ast.children[0], doc, [slotHandler], ast.children, { functional: false })
const slots = doc.toObject().slots || []
expect(slots.filter(s => s.name === 'bound')[0].bindings).toMatchObject([
expect(slots.filter((s: any) => s.name === 'bound')[0].bindings).toMatchObject([
{
name: 'item'
},
Expand All @@ -138,7 +138,7 @@ describe('slotHandler', () => {
)
traverse(ast.children[0], doc, [slotHandler], ast.children, { functional: false })
const slots = doc.toObject().slots || []
expect(slots.filter(s => s.name === 'bound')[0].bindings).toMatchObject([
expect(slots.filter((s: any) => s.name === 'bound')[0].bindings).toMatchObject([
{
name: 'item',
description: 'menu item'
Expand Down
6 changes: 3 additions & 3 deletions packages/vue-docgen-i18n/src/generateTrans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ export function generateTranslation(originalDocs: ComponentDoc[]): string {
const ast = toAst(trans)
// Add leading coments (original description) before
// each description member
walk(ast as any, {
enter: node => {
walk(ast, {
enter: (node:any) => {
if (
node.type === 'Property' &&
isLiteral(node.key) &&
Expand All @@ -64,6 +64,6 @@ export function generateTranslation(originalDocs: ComponentDoc[]): string {

export default function genFile(originalDocs: ComponentDoc[], fileName: string) {
writeFile(fileName, format(generateTranslation(originalDocs), { parser: 'babel' }), err => {
if (err) throw err
if (err) {throw err}
})
}
Loading

0 comments on commit cd10b5e

Please sign in to comment.