All files / lib index.ts

0% Statements 0/13
0% Branches 0/7
0% Functions 0/2
0% Lines 0/13

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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                                                                                     
import * as cdnClient from '@youwol/cdn-client'
import { setup } from '../auto-generated'
import { logFactory } from './log-factory.conf'
export * as Common from './common'
 
export type TsCodeEditorModule = typeof import('./typescript')
 
export function TypescriptModule({
    installParameters,
}: { installParameters? } = {}): Promise<TsCodeEditorModule> {
    const log = logFactory().getChildLogger('index.ts')
 
    log.info('function TypescriptModule => install required')
 
    const parameters = installParameters || {}
    const scripts = [
        ...(parameters.scripts || []),
        '' + 'codemirror#5.52.0~mode/javascript.min.js',
        'codemirror#5.52.0~addons/lint/lint.js',
    ]
    const css = [
        ...(parameters.css || []),
        'codemirror#5.52.0~codemirror.min.css',
        'codemirror#5.52.0~addons/lint/lint.css',
        'codemirror#5.52.0~theme/blackboard.min.css', // default theme
    ]
 
    return setup
        .installAuxiliaryModule({
            name: 'typescript-addon',
            cdnClient,
            installParameters: {
                ...parameters,
                scripts,
                css,
            },
        })
        .then((m) => {
            log.info('function TypescriptModule => install done')
            return m
        })
}