@tego/core 1.3.54-alpha.5 → 1.3.54-alpha.7

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.
Files changed (2) hide show
  1. package/lib/plugin.js +34 -13
  2. package/package.json +13 -13
package/lib/plugin.js CHANGED
@@ -185,23 +185,41 @@ const _Plugin = class _Plugin {
185
185
  */
186
186
  async loadCollections() {
187
187
  if (!this.options.packageName) {
188
- this.app.logger.debug(`[Plugin.loadCollections] packageName not set for plugin ${this.getName()}`, {
189
- submodule: "Plugin",
190
- method: "loadCollections"
191
- });
188
+ this.app.logger.warn(
189
+ `[Plugin.loadCollections] packageName not set for plugin ${this.getName()}, skipping loadCollections`,
190
+ {
191
+ submodule: "Plugin",
192
+ method: "loadCollections"
193
+ }
194
+ );
192
195
  return;
193
196
  }
194
197
  const resolvedPath = (0, import_helper.resolveRequest)(this.options.packageName);
195
- const directory = (0, import_node_path.resolve)(resolvedPath, "../../server/collections");
198
+ const possiblePaths = [
199
+ (0, import_node_path.resolve)(resolvedPath, "../server/collections"),
200
+ // src/index.ts -> src/server/collections
201
+ (0, import_node_path.resolve)(resolvedPath, "../../server/collections"),
202
+ // dist/index.js -> dist/../server/collections
203
+ (0, import_node_path.resolve)(resolvedPath, "../../src/server/collections")
204
+ // dist/index.js -> dist/../src/server/collections
205
+ ];
206
+ let directory = null;
207
+ for (const path of possiblePaths) {
208
+ if (await (0, import_utils.fsExists)(path)) {
209
+ directory = path;
210
+ break;
211
+ }
212
+ }
196
213
  this.app.logger.debug(`[Plugin.loadCollections] Loading collections for ${this.getName()}`, {
197
214
  submodule: "Plugin",
198
215
  method: "loadCollections",
199
216
  packageName: this.options.packageName,
200
217
  resolvedPath,
201
218
  collectionsDirectory: directory,
202
- directoryExists: await (0, import_utils.fsExists)(directory)
219
+ directoryExists: !!directory,
220
+ triedPaths: possiblePaths
203
221
  });
204
- if (await (0, import_utils.fsExists)(directory)) {
222
+ if (directory) {
205
223
  await this.db.import({
206
224
  directory,
207
225
  from: this.options.packageName
@@ -211,12 +229,15 @@ const _Plugin = class _Plugin {
211
229
  method: "loadCollections"
212
230
  });
213
231
  } else {
214
- this.app.logger.warn(`[Plugin.loadCollections] Collections directory not found: ${directory}`, {
215
- submodule: "Plugin",
216
- method: "loadCollections",
217
- packageName: this.options.packageName,
218
- resolvedPath
219
- });
232
+ this.app.logger.warn(
233
+ `[Plugin.loadCollections] Collections directory not found. Tried paths: ${possiblePaths.join(", ")}`,
234
+ {
235
+ submodule: "Plugin",
236
+ method: "loadCollections",
237
+ packageName: this.options.packageName,
238
+ resolvedPath
239
+ }
240
+ );
220
241
  }
221
242
  }
222
243
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tego/core",
3
- "version": "1.3.54-alpha.5",
3
+ "version": "1.3.54-alpha.7",
4
4
  "license": "Apache-2.0",
5
5
  "main": "lib/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -31,18 +31,18 @@
31
31
  "winston": "^3.17.0",
32
32
  "ws": "^8.18.3",
33
33
  "xpipe": "^1.0.8",
34
- "@tachybase/acl": "1.3.54-alpha.5",
35
- "@tachybase/cache": "1.3.54-alpha.5",
36
- "@tachybase/auth": "1.3.54-alpha.5",
37
- "@tachybase/data-source": "1.3.54-alpha.5",
38
- "@tachybase/database": "1.3.54-alpha.5",
39
- "@tachybase/di": "1.3.54-alpha.5",
40
- "@tachybase/globals": "1.3.54-alpha.5",
41
- "@tachybase/loader": "1.3.54-alpha.5",
42
- "@tachybase/actions": "1.3.54-alpha.5",
43
- "@tachybase/logger": "1.3.54-alpha.5",
44
- "@tachybase/resourcer": "1.3.54-alpha.5",
45
- "@tachybase/utils": "1.3.54-alpha.5"
34
+ "@tachybase/actions": "1.3.54-alpha.7",
35
+ "@tachybase/acl": "1.3.54-alpha.7",
36
+ "@tachybase/auth": "1.3.54-alpha.7",
37
+ "@tachybase/data-source": "1.3.54-alpha.7",
38
+ "@tachybase/cache": "1.3.54-alpha.7",
39
+ "@tachybase/database": "1.3.54-alpha.7",
40
+ "@tachybase/globals": "1.3.54-alpha.7",
41
+ "@tachybase/di": "1.3.54-alpha.7",
42
+ "@tachybase/loader": "1.3.54-alpha.7",
43
+ "@tachybase/resourcer": "1.3.54-alpha.7",
44
+ "@tachybase/logger": "1.3.54-alpha.7",
45
+ "@tachybase/utils": "1.3.54-alpha.7"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/fs-extra": "11.0.4",