2023-05-08 19:28:03 +02:00
|
|
|
import designs from './designs.json' assert { type: 'json' }
|
2022-08-24 09:45:59 +02:00
|
|
|
import packages from './packages.json' assert { type: 'json' }
|
|
|
|
import plugins from './plugins.json' assert { type: 'json' }
|
2022-06-16 17:11:31 +02:00
|
|
|
|
|
|
|
// Helper method to construct summary objects
|
2022-10-13 16:19:36 +02:00
|
|
|
const unpack = (obj, folder) =>
|
|
|
|
Object.fromEntries(
|
|
|
|
Object.keys(obj).map((name) => [
|
|
|
|
name,
|
|
|
|
{ name, folder, type: folder.slice(0, -1), description: obj[name] },
|
|
|
|
])
|
|
|
|
)
|
2022-08-27 13:25:42 +02:00
|
|
|
|
|
|
|
// Helper method to construct summary objects for designs
|
2022-10-13 16:19:36 +02:00
|
|
|
const unpackDesigns = (obj, folder) =>
|
|
|
|
Object.fromEntries(
|
|
|
|
Object.keys(obj).map((name) => [
|
|
|
|
name,
|
|
|
|
{ name, folder, type: folder.slice(0, -1), ...obj[name] },
|
|
|
|
])
|
|
|
|
)
|
2022-06-16 17:11:31 +02:00
|
|
|
|
|
|
|
// Re-Export imported JSON
|
2024-11-18 11:05:16 +01:00
|
|
|
export { designs, packages, plugins }
|
2022-06-16 17:11:31 +02:00
|
|
|
|
|
|
|
// All software
|
|
|
|
export const software = {
|
2022-08-27 13:25:42 +02:00
|
|
|
...unpackDesigns(designs, 'designs'),
|
2022-06-16 17:11:31 +02:00
|
|
|
...unpack(plugins, 'plugins'),
|
|
|
|
...unpack(packages, 'packages'),
|
|
|
|
}
|
|
|
|
|
|
|
|
// All software published on NPM
|
|
|
|
export const publishedSoftware = {
|
2022-08-27 13:25:42 +02:00
|
|
|
...unpackDesigns(designs, 'designs'),
|
2022-06-16 17:11:31 +02:00
|
|
|
...unpack(plugins, 'plugins'),
|
|
|
|
...unpack(packages, 'packages'),
|
|
|
|
}
|
|
|
|
|
2022-10-13 16:19:36 +02:00
|
|
|
export const publishedTypes = ['designs', 'packages', 'plugins']
|
2024-11-18 11:05:16 +01:00
|
|
|
export const types = publishedTypes
|