codify-plugin-lib 1.0.182-beta37 → 1.0.182-beta39
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.
package/dist/plugin/plugin.js
CHANGED
|
@@ -28,9 +28,8 @@ export class Plugin {
|
|
|
28
28
|
const { name, version } = packageJson;
|
|
29
29
|
const resourceLocations = await listAllResources();
|
|
30
30
|
const resources = await Promise.all(resourceLocations.map((l) => {
|
|
31
|
-
return import(l);
|
|
31
|
+
return import(l).then((r) => r.default ?? r);
|
|
32
32
|
}));
|
|
33
|
-
console.log(resources);
|
|
34
33
|
const controllers = resources
|
|
35
34
|
.map((resource) => new ResourceController(resource));
|
|
36
35
|
const controllersMap = new Map(controllers.map((r) => [r.typeId, r]));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from 'node:fs/promises';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import * as url from 'node:url';
|
|
4
|
-
export const listAllResources = async (root = path.join(path.dirname(url.fileURLToPath(import.meta.url)), '..', '..', '..', '..'
|
|
4
|
+
export const listAllResources = async (root = path.join(path.dirname(url.fileURLToPath(import.meta.url)), '..', '..', '..', '..')) => {
|
|
5
5
|
console.log('Dirname', root);
|
|
6
6
|
const resourcesPath = path.join(root, 'src', 'resources');
|
|
7
7
|
const resourceDir = await fs.readdir(resourcesPath);
|
package/package.json
CHANGED
package/src/plugin/plugin.ts
CHANGED
|
@@ -51,10 +51,8 @@ export class Plugin {
|
|
|
51
51
|
|
|
52
52
|
const resourceLocations = await listAllResources();
|
|
53
53
|
const resources = await Promise.all(resourceLocations.map((l) => {
|
|
54
|
-
return import(l);
|
|
54
|
+
return import(l).then((r) => r.default ?? r);
|
|
55
55
|
}))
|
|
56
|
-
console.log(resources);
|
|
57
|
-
|
|
58
56
|
|
|
59
57
|
const controllers = resources
|
|
60
58
|
.map((resource) => new ResourceController(resource))
|
|
@@ -2,7 +2,7 @@ import fs from 'node:fs/promises';
|
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import * as url from 'node:url';
|
|
4
4
|
|
|
5
|
-
export const listAllResources = async (root = path.join(path.dirname(url.fileURLToPath(import.meta.url)), '..', '..', '..', '..'
|
|
5
|
+
export const listAllResources = async (root = path.join(path.dirname(url.fileURLToPath(import.meta.url)), '..', '..', '..', '..')) => {
|
|
6
6
|
console.log('Dirname', root);
|
|
7
7
|
|
|
8
8
|
const resourcesPath = path.join(root, 'src', 'resources')
|