121 lines
3.8 KiB
Plaintext
121 lines
3.8 KiB
Plaintext
-
|
|
if(!npm) {
|
|
var npm = [];
|
|
}
|
|
const componentSet = new Set(components.map(c=>c.type));
|
|
components.map(c => {
|
|
if(c.extensions) {
|
|
c.extensions.forEach(e => componentSet.add(e.type));
|
|
}
|
|
});
|
|
|
|
//- Managing default versions
|
|
if(!npm.find(e => e.package == "@startinblox/core"))
|
|
npm.push({
|
|
"package": "@startinblox/core",
|
|
"version": "0.17"
|
|
})
|
|
|
|
if(!npm.find(e => e.package == "@startinblox/router"))
|
|
npm.push({
|
|
"package": "@startinblox/router",
|
|
"version": "0.11"
|
|
})
|
|
|
|
if(componentSet.has("autoLogin") || componentSet.has("registering"))
|
|
if(!npm.find(e => e.package == "@startinblox/oidc"))
|
|
npm.push({
|
|
"package": "@startinblox/oidc",
|
|
"version": "0.15"
|
|
})
|
|
|
|
if(componentSet.has("chat") || componentSet.has("circles") || componentSet.has("projects"))
|
|
if(!npm.find(e => e.package == "@startinblox/chat"))
|
|
npm.push({
|
|
"package": "@startinblox/component-chat",
|
|
"version": "6.3"
|
|
})
|
|
|
|
if(componentSet.has("communities"))
|
|
if(!npm.find(e => e.package == "@startinblox/core" && e.version == "0.17/dist/components/solid-map.js"))
|
|
npm.push({
|
|
"package": "@startinblox/core",
|
|
"version": "0.17/dist/components/solid-map.js"
|
|
})
|
|
|
|
if(componentSet.has("dashboard"))
|
|
if(!npm.find(e => e.package == "@startinblox/component-dashboard"))
|
|
npm.push({
|
|
"package": "@startinblox/component-dashboard",
|
|
"version": "5.1"
|
|
})
|
|
|
|
if(componentSet.has("events"))
|
|
if(!npm.find(e => e.package == "@startinblox/component-event"))
|
|
npm.push({
|
|
"package": "@startinblox/component-event",
|
|
"version": "4.1"
|
|
})
|
|
|
|
if(componentSet.has("events") || componentSet.has("polls") || componentSet.has("resources"))
|
|
if(!npm.find(e => e.package == "@startinblox/component-conversation"))
|
|
npm.push({
|
|
"package": "@startinblox/component-conversation",
|
|
"version": "0.11"
|
|
})
|
|
|
|
if(componentSet.has('invoices'))
|
|
if(!npm.find(e => e.package == "@startinblox/component-invoicing"))
|
|
npm.push({
|
|
"package": "@startinblox/component-invoicing",
|
|
"version": "1.4"
|
|
})
|
|
|
|
if(componentSet.has("job-board"))
|
|
if(!npm.find(e => e.package == "@startinblox/component-job-board"))
|
|
npm.push({
|
|
"package": "@startinblox/component-job-board",
|
|
"version": "6.2"
|
|
})
|
|
|
|
if(componentSet.has("notification"))
|
|
if(!npm.find(e => e.package == "@startinblox/component-notifications"))
|
|
npm.push({
|
|
"package": "@startinblox/component-notifications",
|
|
"version": "0.13"
|
|
})
|
|
|
|
if(componentSet.has("polls"))
|
|
if(!npm.find(e => e.package == "@startinblox/component-poll"))
|
|
npm.push({
|
|
"package": "@startinblox/component-poll",
|
|
"version": "3.1"
|
|
})
|
|
|
|
if(componentSet.has("directory"))
|
|
if(!npm.find(e => e.package == "@startinblox/component-directory"))
|
|
npm.push({
|
|
"package": "@startinblox/component-directory",
|
|
"version": "6.1"
|
|
})
|
|
|
|
if(componentSet.has("resources"))
|
|
if(!npm.find(e => e.package == "@startinblox/component-resource"))
|
|
npm.push({
|
|
"package": "@startinblox/component-resource",
|
|
"version": "4.0"
|
|
})
|
|
|
|
for dependency of npm
|
|
if dependency.path
|
|
script(type="module" src=dependency.path defer)&attributes(dependency.attributes || {})
|
|
else
|
|
script(type="module" src=`https://cdn.skypack.dev/${dependency.package}@${dependency.version}` defer)&attributes(dependency.attributes || {})
|
|
|
|
if componentSet.has("themeChecker")
|
|
script(src="https://cdn.jsdelivr.net/npm/@simonwep/pickr/dist/pickr.min.js" defer)
|
|
link(rel='stylesheet', href='https://cdn.jsdelivr.net/npm/@simonwep/pickr/dist/themes/nano.min.css')
|
|
|
|
- const orbitVersions = `window.orbit.npm = ${JSON.stringify(npm)};`;
|
|
script!=orbitVersions
|