const runTimeDependencies = { "externals": {}, "includedInBundle": { "@ungap/custom-elements": "1.2.0" } } const externals = {} const exportedSymbols = {} const mainEntry : {entryFile: string,loadDependencies:string[]} = { "entryFile": "index.ts", "loadDependencies": [] } const secondaryEntries : {[k:string]:{entryFile: string, name: string, loadDependencies:string[]}}= {} const entries = { '@youwol/flux-view': 'index.ts', ...Object.values(secondaryEntries).reduce( (acc,e) => ({...acc, [`@youwol/flux-view/${e.name}`]:e.entryFile}), {}) } export const setup = { name:'@youwol/flux-view', assetId:'QHlvdXdvbC9mbHV4LXZpZXc=', version:'1.2.2', shortDescription:"Tiny library to render HTML documents using reactive programing primitives.", developerDocumentation:'https://platform.youwol.com/applications/@youwol/cdn-explorer/latest?package=@youwol/flux-view&tab=doc', npmPackage:'https://www.npmjs.com/package/@youwol/flux-view', sourceGithub:'https://github.com/youwol/flux-view', userGuide:'https://l.youwol.com/doc/@youwol/flux-view', apiVersion:'1', runTimeDependencies, externals, exportedSymbols, entries, secondaryEntries, getDependencySymbolExported: (module:string) => { return `${exportedSymbols[module].exportedSymbol}_APIv${exportedSymbols[module].apiKey}` }, installMainModule: ({cdnClient, installParameters}:{ cdnClient:{install:(unknown) => Promise}, installParameters? }) => { const parameters = installParameters || {} const scripts = parameters.scripts || [] const modules = [ ...(parameters.modules || []), ...mainEntry.loadDependencies.map( d => `${d}#${runTimeDependencies.externals[d]}`) ] return cdnClient.install({ ...parameters, modules, scripts, }).then(() => { return window[`@youwol/flux-view_APIv1`] }) }, installAuxiliaryModule: ({name, cdnClient, installParameters}:{ name: string, cdnClient:{install:(unknown) => Promise}, installParameters? }) => { const entry = secondaryEntries[name] if(!entry){ throw Error(`Can not find the secondary entry '${name}'. Referenced in template.py?`) } const parameters = installParameters || {} const scripts = [ ...(parameters.scripts || []), `@youwol/flux-view#1.2.2~dist/@youwol/flux-view/${entry.name}.js` ] const modules = [ ...(parameters.modules || []), ...entry.loadDependencies.map( d => `${d}#${runTimeDependencies.externals[d]}`) ] return cdnClient.install({ ...parameters, modules, scripts, }).then(() => { return window[`@youwol/flux-view/${entry.name}_APIv1`] }) }, getCdnDependencies(name?: string){ if(name && !secondaryEntries[name]){ throw Error(`Can not find the secondary entry '${name}'. Referenced in template.py?`) } const deps = name ? secondaryEntries[name].loadDependencies : mainEntry.loadDependencies return deps.map( d => `${d}#${runTimeDependencies.externals[d]}`) } }