const runTimeDependencies = { "externals": { "rxjs": "^6.5.5", "@youwol/flux-view": "^1.0.3" }, "includedInBundle": {} } const externals = { "rxjs": { "commonjs": "rxjs", "commonjs2": "rxjs", "root": "rxjs_APIv6" }, "@youwol/flux-view": { "commonjs": "@youwol/flux-view", "commonjs2": "@youwol/flux-view", "root": "@youwol/flux-view_APIv1" }, "rxjs/operators": { "commonjs": "rxjs/operators", "commonjs2": "rxjs/operators", "root": [ "rxjs_APIv6", "operators" ] } } const exportedSymbols = { "rxjs": { "apiKey": "6", "exportedSymbol": "rxjs" }, "@youwol/flux-view": { "apiKey": "1", "exportedSymbol": "@youwol/flux-view" } } const mainEntry : {entryFile: string,loadDependencies:string[]} = { "entryFile": "index.ts", "loadDependencies": [ "rxjs", "@youwol/flux-view" ] } const secondaryEntries : {[k:string]:{entryFile: string, name: string, loadDependencies:string[]}}= {} const entries = { '@youwol/fv-group': 'index.ts', ...Object.values(secondaryEntries).reduce( (acc,e) => ({...acc, [`@youwol/fv-group/${e.name}`]:e.entryFile}), {}) } export const setup = { name:'@youwol/fv-group', assetId:'QHlvdXdvbC9mdi1ncm91cA==', version:'0.2.5', shortDescription:"Grouping widgets using flux-view", developerDocumentation:'https://platform.youwol.com/applications/@youwol/cdn-explorer/latest?package=@youwol/fv-group&tab=doc', npmPackage:'https://www.npmjs.com/package/@youwol/fv-group', sourceGithub:'https://github.com/youwol/fv-group', userGuide:'https://l.youwol.com/doc/@youwol/fv-group', apiVersion:'02', 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/fv-group_APIv02`] }) }, 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/fv-group#0.2.5~dist/@youwol/fv-group/${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/fv-group/${entry.name}_APIv02`] }) }, 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]}`) } }