@microlight/core 0.9.2 → 0.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28,7 +28,7 @@ const generateImportSwitch = async tasks => {
28
28
  const task = await import(filePath);
29
29
  // console.log(task);
30
30
  const taskName = path.basename(file, '.task.js');
31
- const taskSlug = task?.default?.slug;
31
+ const taskSlug = task?.slug;
32
32
  // const taskName = path.basename(filePath, '.task.js');
33
33
  // return [taskName, task.default];
34
34
  // return [task?.default?.slug, {...task?.default,...{file_name:taskName}}];
@@ -19,8 +19,8 @@ function generateBreadcrumbs({
19
19
  }];
20
20
 
21
21
  // Add task path segments to breadcrumbs if available
22
- if (task._folderPath) {
23
- const f_path = task._folderPath.split('/');
22
+ if (task.__folder) {
23
+ const f_path = task.__folder.split('/');
24
24
  let folderPath = '/library';
25
25
  f_path.forEach((folder, index) => {
26
26
  folderPath += '/' + folder;
@@ -88,7 +88,6 @@ export default function ViewTask({
88
88
  backgroundColor: 'transparent',
89
89
  maxWidth: 400
90
90
  }}>
91
- {/* {Object.keys(task.inputs)} */}
92
91
  <form onSubmit={handleSubmit}>
93
92
  {Object.keys(task.inputs).map(slug => <>
94
93
  <MLInput key={slug} slug={slug} def={task.inputs[slug]} searchParams={searchParams} />
@@ -15,8 +15,8 @@ function generateBreadcrumbs({
15
15
  href: "/library"
16
16
  }];
17
17
  // Add task path segments to breadcrumbs if available
18
- if (task._folderPath) {
19
- const f_path = task._folderPath.split('/');
18
+ if (task.__folder) {
19
+ const f_path = task.__folder.split('/');
20
20
  let folderPath = '/library';
21
21
  f_path.forEach((folder, index) => {
22
22
  folderPath += '/' + folder;
@@ -1,14 +1,15 @@
1
1
  import { notFound } from 'next/navigation';
2
2
  import { importTaskModule } from "../../importTaskModule";
3
+ import taskMap from "../../taskMap";
3
4
  export default async function getTaskDetails({
4
5
  params
5
6
  }) {
6
7
  try {
7
8
  let taskConfig = await importTaskModule(params.slug);
8
9
  return {
9
- ...taskConfig.default,
10
- // _folderPath: folderPath
11
- _folderPath: '1.intro'
10
+ ...taskMap[params.slug],
11
+ // get folders path etc from here
12
+ ...taskConfig.default // get function to be executed from here.
12
13
  };
13
14
  } catch (e) {
14
15
  if (e.code === 'MODULE_NOT_FOUND') notFound();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microlight/core",
3
- "version": "0.9.2",
3
+ "version": "0.9.4",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "scripts": {