@koishi-ce/plugin-explorer 1.1.1 → 1.1.2

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/lib/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { mkdir, readdir, readlink, rename, rm } from "node:fs/promises";
2
2
  import { join, relative, resolve } from "node:path";
3
- import { DataService } from "@koishi-ce/console";
3
+ import { DataService, clientEntry } from "@koishi-ce/console";
4
4
  import { Schema } from "@koishi-ce/koishi";
5
5
  import * as anymatchModule from "anymatch";
6
6
  import { detect } from "chardet";
@@ -53,10 +53,7 @@ var Explorer = class extends DataService {
53
53
  root;
54
54
  constructor(ctx, config) {
55
55
  super(ctx, "explorer", { authority: 4 });
56
- ctx.console.addEntry(process.env["KOISHI_BASE"] ? [`${process.env["KOISHI_BASE"]}/dist/index.js`, `${process.env["KOISHI_BASE"]}/dist/style.css`] : process.env["KOISHI_ENV"] === "browser" ? [import.meta.url.replace(/\/src\/[^/]+$/, "/client/index.ts")] : {
57
- dev: resolve(import.meta.dir, "../client/index.ts"),
58
- prod: resolve(import.meta.dir, "../dist")
59
- });
56
+ ctx.console.addEntry(clientEntry(import.meta.url));
60
57
  this.globFilter = anymatch(config.ignored ?? []);
61
58
  this.root = resolve(ctx.baseDir, config.root ?? "");
62
59
  ctx.console.addListener("explorer/read", async (filename) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@koishi-ce/plugin-explorer",
3
3
  "description": "File explorer and editor for Koishi",
4
- "version": "1.1.1",
4
+ "version": "1.1.2",
5
5
  "type": "module",
6
6
  "main": "lib/index.mjs",
7
7
  "types": "lib/index.d.ts",
@@ -63,16 +63,16 @@
63
63
  "@koishi-ce/koishi": "^1.0.0"
64
64
  },
65
65
  "devDependencies": {
66
- "@koishi-ce/client": "^1.2.4",
67
- "@koishi-ce/plugin-console": "^1.3.3",
68
- "@koishi-ce/koishi": "^1.0.15",
66
+ "@koishi-ce/client": "^1.3.0",
67
+ "@koishi-ce/plugin-console": "^1.3.4",
68
+ "@koishi-ce/koishi": "^1.0.16",
69
69
  "@vueuse/core": "^14.4.0",
70
70
  "monaco-editor": "~0.56.0",
71
71
  "vue": "^3.5.12",
72
72
  "vue-router": "^5.2.0"
73
73
  },
74
74
  "dependencies": {
75
- "@koishi-ce/console": "^1.0.1",
75
+ "@koishi-ce/console": "^1.1.0",
76
76
  "anymatch": "^3.1.3",
77
77
  "chardet": "^2.2.0",
78
78
  "file-type": "^22.0.2"
package/src/index.ts CHANGED
@@ -19,7 +19,10 @@ import {
19
19
  rm,
20
20
  } from "node:fs/promises";
21
21
  import { join, relative, resolve } from "node:path";
22
- import { DataService } from "@koishi-ce/console";
22
+ import {
23
+ clientEntry,
24
+ DataService,
25
+ } from "@koishi-ce/console";
23
26
  import { type Context, Schema } from "@koishi-ce/koishi";
24
27
  import type { Tester } from "anymatch";
25
28
  import * as anymatchModule from "anymatch";
@@ -131,27 +134,7 @@ class Explorer extends DataService<Entry[]> {
131
134
  constructor(ctx: Context, config: Explorer.Config) {
132
135
  super(ctx, "explorer", { authority: 4 });
133
136
 
134
- ctx.console.addEntry(
135
- process.env["KOISHI_BASE"]
136
- ? [
137
- `${process.env["KOISHI_BASE"]}/dist/index.js`,
138
- `${process.env["KOISHI_BASE"]}/dist/style.css`,
139
- ]
140
- : process.env["KOISHI_ENV"] === "browser"
141
- ? [
142
- import.meta.url.replace(
143
- /\/src\/[^/]+$/,
144
- "/client/index.ts",
145
- ),
146
- ]
147
- : {
148
- dev: resolve(
149
- import.meta.dir,
150
- "../client/index.ts",
151
- ),
152
- prod: resolve(import.meta.dir, "../dist"),
153
- },
154
- );
137
+ ctx.console.addEntry(clientEntry(import.meta.url));
155
138
 
156
139
  this.globFilter = anymatch(config.ignored ?? []);
157
140
  this.root = resolve(ctx.baseDir, config.root ?? "");