@superblocksteam/util 0.0.23 → 1.0.0
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/component-configs.js +6 -2
- package/dist/constants.d.ts +4 -0
- package/dist/constants.js +9 -1
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
- package/src/component-configs.ts +10 -3
- package/src/constants.ts +8 -0
- package/src/types.ts +1 -1
|
@@ -60,9 +60,13 @@ async function getFolderPaths() {
|
|
|
60
60
|
withFileTypes: true,
|
|
61
61
|
});
|
|
62
62
|
// filter out any non-directory items
|
|
63
|
-
const directories = folderPaths.filter((dirent) => dirent.isDirectory()
|
|
63
|
+
const directories = folderPaths.filter((dirent) => dirent.isDirectory() ||
|
|
64
|
+
(dirent.isSymbolicLink() &&
|
|
65
|
+
fs
|
|
66
|
+
.statSync(node_path_1.default.join(constants_1.CUSTOM_COMPONENTS_PATH, dirent.name))
|
|
67
|
+
.isDirectory()));
|
|
64
68
|
// map each directory to its path
|
|
65
|
-
const folderPathsArray = directories.map((dirent) =>
|
|
69
|
+
const folderPathsArray = directories.map((dirent) => node_path_1.default.join(constants_1.CUSTOM_COMPONENTS_PATH, dirent.name));
|
|
66
70
|
return folderPathsArray;
|
|
67
71
|
}
|
|
68
72
|
catch {
|
package/dist/constants.d.ts
CHANGED
|
@@ -7,3 +7,7 @@ export declare const ERROR_FILE_ACCESS = "FileAccessError";
|
|
|
7
7
|
export declare class FileAccessError extends Error {
|
|
8
8
|
constructor(message: string);
|
|
9
9
|
}
|
|
10
|
+
export declare const ERROR_FILE_NOT_FOUND = "FileNotFoundError";
|
|
11
|
+
export declare class NotFoundError extends Error {
|
|
12
|
+
constructor(message: string);
|
|
13
|
+
}
|
package/dist/constants.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FileAccessError = exports.ERROR_FILE_ACCESS = exports.CUSTOM_COMPONENTS_PATH = exports.ROOT_CONFIG_RELATIVE_PATH = exports.RESOURCE_CONFIG_PATH = exports.TOKEN_CONFIG_PATH = exports.SUPERBLOCKS_HOME_FOLDER_NAME = void 0;
|
|
3
|
+
exports.NotFoundError = exports.ERROR_FILE_NOT_FOUND = exports.FileAccessError = exports.ERROR_FILE_ACCESS = exports.CUSTOM_COMPONENTS_PATH = exports.ROOT_CONFIG_RELATIVE_PATH = exports.RESOURCE_CONFIG_PATH = exports.TOKEN_CONFIG_PATH = exports.SUPERBLOCKS_HOME_FOLDER_NAME = void 0;
|
|
4
4
|
exports.SUPERBLOCKS_HOME_FOLDER_NAME = ".superblocks";
|
|
5
5
|
exports.TOKEN_CONFIG_PATH = ".superblocks/auth.json";
|
|
6
6
|
exports.RESOURCE_CONFIG_PATH = ".superblocks/superblocks.json";
|
|
@@ -27,3 +27,11 @@ class FileAccessError extends Error {
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
exports.FileAccessError = FileAccessError;
|
|
30
|
+
exports.ERROR_FILE_NOT_FOUND = "FileNotFoundError";
|
|
31
|
+
class NotFoundError extends Error {
|
|
32
|
+
constructor(message) {
|
|
33
|
+
super(message);
|
|
34
|
+
this.name = exports.ERROR_FILE_NOT_FOUND;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.NotFoundError = NotFoundError;
|
package/dist/types.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ interface PropertiesPanelDisplay<T extends DataType> {
|
|
|
7
7
|
*
|
|
8
8
|
* Only booleans are allowed to use the "switch" control
|
|
9
9
|
*/
|
|
10
|
-
controlType
|
|
10
|
+
controlType: T extends "boolean" ? "text" | "js-expr" | "switch" : "text" | "js-expr";
|
|
11
11
|
/**
|
|
12
12
|
* Determines form item label in the Superblocks properties panel.
|
|
13
13
|
*/
|
package/package.json
CHANGED
package/src/component-configs.ts
CHANGED
|
@@ -65,10 +65,17 @@ async function getFolderPaths() {
|
|
|
65
65
|
withFileTypes: true,
|
|
66
66
|
});
|
|
67
67
|
// filter out any non-directory items
|
|
68
|
-
const directories = folderPaths.filter(
|
|
68
|
+
const directories = folderPaths.filter(
|
|
69
|
+
(dirent) =>
|
|
70
|
+
dirent.isDirectory() ||
|
|
71
|
+
(dirent.isSymbolicLink() &&
|
|
72
|
+
fs
|
|
73
|
+
.statSync(path.join(CUSTOM_COMPONENTS_PATH, dirent.name))
|
|
74
|
+
.isDirectory())
|
|
75
|
+
);
|
|
69
76
|
// map each directory to its path
|
|
70
|
-
const folderPathsArray = directories.map(
|
|
71
|
-
(
|
|
77
|
+
const folderPathsArray = directories.map((dirent) =>
|
|
78
|
+
path.join(CUSTOM_COMPONENTS_PATH, dirent.name)
|
|
72
79
|
);
|
|
73
80
|
return folderPathsArray;
|
|
74
81
|
} catch {
|
package/src/constants.ts
CHANGED
|
@@ -26,3 +26,11 @@ export class FileAccessError extends Error {
|
|
|
26
26
|
this.name = ERROR_FILE_ACCESS;
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
+
|
|
30
|
+
export const ERROR_FILE_NOT_FOUND = "FileNotFoundError";
|
|
31
|
+
export class NotFoundError extends Error {
|
|
32
|
+
constructor(message: string) {
|
|
33
|
+
super(message);
|
|
34
|
+
this.name = ERROR_FILE_NOT_FOUND;
|
|
35
|
+
}
|
|
36
|
+
}
|
package/src/types.ts
CHANGED