@saltcorn/plugins-loader 1.3.0-beta.13 → 1.3.0-beta.14
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_installer.js +6 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@saltcorn/plugins-loader",
|
|
3
|
-
"version": "1.3.0-beta.
|
|
3
|
+
"version": "1.3.0-beta.14",
|
|
4
4
|
"description": "Saltcorn plugin loader",
|
|
5
5
|
"homepage": "https://saltcorn.com",
|
|
6
6
|
"scripts": {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"clean": "echo 'No TypeScript build'"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@saltcorn/data": "1.3.0-beta.
|
|
12
|
+
"@saltcorn/data": "1.3.0-beta.14",
|
|
13
13
|
"env-paths": "^2.2.1",
|
|
14
14
|
"npm-registry-fetch": "17.1.0",
|
|
15
15
|
"https-proxy-agent": "^7.0.6"
|
package/plugin_installer.js
CHANGED
|
@@ -62,7 +62,8 @@ class PluginInstaller {
|
|
|
62
62
|
this.pluginDir = join(
|
|
63
63
|
this.rootFolder,
|
|
64
64
|
plugin.source === "git" ? "git_plugins" : "plugins_folder",
|
|
65
|
-
...tokens
|
|
65
|
+
...tokens,
|
|
66
|
+
plugin.version || "unknownversion"
|
|
66
67
|
);
|
|
67
68
|
this.pckJsonPath = join(this.pluginDir, "package.json");
|
|
68
69
|
this.tempDir = join(this.tempRootFolder, "temp_install", ...tokens);
|
|
@@ -267,11 +268,10 @@ class PluginInstaller {
|
|
|
267
268
|
// in jest, downgrad to require
|
|
268
269
|
return require(normalize(join(this.pluginDir, pckJSON.main)));
|
|
269
270
|
} else {
|
|
270
|
-
const
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
);
|
|
271
|
+
const url = `${isWindows ? `file://` : ""}${normalize(
|
|
272
|
+
join(this.pluginDir, pckJSON.main + (reload ? "?reload=true" : ""))
|
|
273
|
+
)}`;
|
|
274
|
+
const res = await import(url);
|
|
275
275
|
return res.default;
|
|
276
276
|
}
|
|
277
277
|
}
|