@nocobase/utils 0.19.0-alpha.2 → 0.19.0-alpha.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.
- package/package.json +2 -2
- package/plugin-symlink.d.ts +1 -0
- package/plugin-symlink.js +12 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/utils",
|
|
3
|
-
"version": "0.19.0-alpha.
|
|
3
|
+
"version": "0.19.0-alpha.4",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"types": "./lib/index.d.ts",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -15,5 +15,5 @@
|
|
|
15
15
|
"multer": "^1.4.5-lts.1",
|
|
16
16
|
"object-path": "^0.11.8"
|
|
17
17
|
},
|
|
18
|
-
"gitHead": "
|
|
18
|
+
"gitHead": "9583023f7bea828da5192384a5c002782c341b65"
|
|
19
19
|
}
|
package/plugin-symlink.d.ts
CHANGED
|
@@ -3,3 +3,4 @@ export declare function fsExists(path: any): Promise<boolean>;
|
|
|
3
3
|
export declare function createStoragePluginSymLink(pluginName: any): Promise<void>;
|
|
4
4
|
export declare function createStoragePluginsSymlink(): Promise<void>;
|
|
5
5
|
export declare function createDevPluginSymLink(pluginName: any): Promise<void>;
|
|
6
|
+
export declare function createDevPluginsSymlink(): Promise<void>;
|
package/plugin-symlink.js
CHANGED
|
@@ -78,10 +78,21 @@ async function createDevPluginSymLink(pluginName) {
|
|
|
78
78
|
if (await fsExists(link)) {
|
|
79
79
|
await unlink(link);
|
|
80
80
|
}
|
|
81
|
-
await symlink(resolve(packagePluginsPath, pluginName), link);
|
|
81
|
+
await symlink(resolve(packagePluginsPath, pluginName), link, 'dir');
|
|
82
82
|
} catch (error) {
|
|
83
83
|
console.error(error);
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
exports.createDevPluginSymLink = createDevPluginSymLink;
|
|
88
|
+
|
|
89
|
+
async function createDevPluginsSymlink() {
|
|
90
|
+
const storagePluginsPath = resolve(process.cwd(), 'packages/plugins');
|
|
91
|
+
if (!(await fsExists(storagePluginsPath))) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
const pluginNames = await getStoragePluginNames(storagePluginsPath);
|
|
95
|
+
await Promise.all(pluginNames.map((pluginName) => createDevPluginSymLink(pluginName)));
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
exports.createDevPluginsSymlink = createDevPluginsSymlink;
|