@tachybase/utils 1.2.16-alpha.2 → 1.2.16-alpha.3

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.
@@ -57,37 +57,14 @@ async function getStoragePluginNames(target) {
57
57
  }
58
58
  __name(getStoragePluginNames, "getStoragePluginNames");
59
59
  async function createStoragePluginSymLink(pluginName) {
60
- const storagePluginsPath = (0, import_node_path.resolve)(process.cwd(), "storage/plugins");
61
- const nodeModulesPath = (0, import_node_path.resolve)(process.cwd(), "storage", ".plugins");
62
- try {
63
- if (pluginName.startsWith("@")) {
64
- const [orgName] = pluginName.split("/");
65
- if (!await (0, import_fs_exists.fsExists)((0, import_node_path.resolve)(nodeModulesPath, orgName))) {
66
- await (0, import_promises.mkdir)((0, import_node_path.resolve)(nodeModulesPath, orgName), { recursive: true });
67
- }
68
- }
69
- const link = (0, import_node_path.resolve)(nodeModulesPath, pluginName);
70
- if (await (0, import_fs_exists.fsExists)(link)) {
71
- await (0, import_promises.unlink)(link);
72
- }
73
- await (0, import_promises.symlink)((0, import_node_path.resolve)(storagePluginsPath, pluginName), link, "dir");
74
- } catch (error) {
75
- console.error(error);
76
- }
77
60
  }
78
61
  __name(createStoragePluginSymLink, "createStoragePluginSymLink");
79
62
  async function createStoragePluginsSymlink() {
80
- const storagePluginsPath = (0, import_node_path.resolve)(process.cwd(), "storage/plugins");
81
- if (!await (0, import_fs_exists.fsExists)(storagePluginsPath)) {
82
- return;
83
- }
84
- const pluginNames = await getStoragePluginNames(storagePluginsPath);
85
- await Promise.all(pluginNames.map((pluginName) => createStoragePluginSymLink(pluginName)));
86
63
  }
87
64
  __name(createStoragePluginsSymlink, "createStoragePluginsSymlink");
88
65
  async function createDevPluginSymLink(pluginName) {
89
66
  const packagePluginsPath = (0, import_node_path.resolve)(process.cwd(), "packages");
90
- const nodeModulesPath = (0, import_node_path.resolve)(process.cwd(), "storage", ".packages");
67
+ const nodeModulesPath = (0, import_node_path.resolve)(process.cwd(), "storage", "packages");
91
68
  try {
92
69
  const packageJson = JSON.parse(
93
70
  (0, import_node_fs.readFileSync)((0, import_node_path.join)(packagePluginsPath, pluginName, "package.json"), { encoding: "utf-8" })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tachybase/utils",
3
- "version": "1.2.16-alpha.2",
3
+ "version": "1.2.16-alpha.3",
4
4
  "license": "Apache-2.0",
5
5
  "exports": {
6
6
  ".": {