koishi-plugin-memesluna 0.4.0 → 0.4.1

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/index.js +8 -7
  2. package/package.json +2 -3
package/lib/index.js CHANGED
@@ -39,6 +39,7 @@ __export(index_exports, {
39
39
  name: () => name
40
40
  });
41
41
  module.exports = __toCommonJS(index_exports);
42
+ var import_fs = require("fs");
42
43
  var import_path2 = __toESM(require("path"));
43
44
  var import_koishi3 = require("koishi");
44
45
 
@@ -65,7 +66,8 @@ function hashImageBuffer(buffer) {
65
66
  __name(hashImageBuffer, "hashImageBuffer");
66
67
  function loadSharp() {
67
68
  try {
68
- const sharpModule = require("sharp");
69
+ const packageName = "sharp";
70
+ const sharpModule = require(packageName);
69
71
  return sharpModule.default || sharpModule;
70
72
  } catch {
71
73
  return null;
@@ -1413,15 +1415,15 @@ async function updateMemesVariable(ctx, config, service) {
1413
1415
  }
1414
1416
  __name(updateMemesVariable, "updateMemesVariable");
1415
1417
  function applyConsole(ctx, config, service) {
1416
- console.log("[MemesLuna] applyConsole started!");
1417
1418
  if (!ctx.console) {
1418
- console.log("[MemesLuna] ctx.console is missing!");
1419
1419
  return;
1420
1420
  }
1421
1421
  const consoleService = ctx.console;
1422
- const devPath = import_path2.default.resolve(__dirname, "..", "client/index.ts");
1423
- const prodPath = import_path2.default.join(ctx.baseDir, "node_modules", "koishi-plugin-memesluna", "dist");
1424
- console.log("[MemesLuna] Registering console entry:", { dev: devPath, prod: prodPath });
1422
+ const packageBase = import_path2.default.resolve(__dirname, "..");
1423
+ const installedBase = import_path2.default.resolve(ctx.baseDir, "node_modules", "koishi-plugin-memesluna");
1424
+ const consoleBase = (0, import_fs.existsSync)(installedBase) ? installedBase : packageBase;
1425
+ const devPath = import_path2.default.resolve(consoleBase, "client/index.ts");
1426
+ const prodPath = import_path2.default.resolve(consoleBase, "dist");
1425
1427
  const withReady = /* @__PURE__ */ __name((handler) => {
1426
1428
  return async (...args) => {
1427
1429
  await service.ready;
@@ -1914,7 +1916,6 @@ function apply(ctx, config) {
1914
1916
  applyServer(ctx2, config, service);
1915
1917
  });
1916
1918
  ctx.inject(["memesluna", "console"], async (ctx2) => {
1917
- console.log("[MemesLuna] Console inject hook triggered!");
1918
1919
  const service = ctx2.memesluna;
1919
1920
  applyConsole(ctx2, config, service);
1920
1921
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-memesluna",
3
3
  "description": "Image Forward service for Koishi with ChatLuna integration",
4
- "version": "0.4.0",
4
+ "version": "0.4.1",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "types": "lib/index.d.ts",
@@ -42,8 +42,7 @@
42
42
  },
43
43
  "dependencies": {
44
44
  "koishi-plugin-chatluna": "^1.3.0-alpha.49",
45
- "koishi-plugin-chatluna-storage-service": "^1.0.6",
46
- "sharp": "^0.34.5"
45
+ "koishi-plugin-chatluna-storage-service": "^1.0.6"
47
46
  },
48
47
  "devDependencies": {
49
48
  "@koishijs/client": "^5.30.11",