@devframes/plugin-code-server 0.9.9 → 0.9.10

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.
@@ -1,4 +1,4 @@
1
- //#region src/types.d.ts
1
+ //#region src/node/types.d.ts
2
2
  /** Lifecycle state of the managed editor process. */
3
3
  type CodeServerStatus = 'stopped' | 'starting' | 'running' | 'error';
4
4
  /**
@@ -1,6 +1,6 @@
1
1
  import { CodeServerOptions } from "./types.mjs";
2
2
  import { DevframeViteBridgeOptions, DevframeVitePlugin } from "@devframes/vite/single";
3
- //#region src/vite.d.ts
3
+ //#region src/node/vite.d.ts
4
4
  interface CodeServerViteOptions extends CodeServerOptions {
5
5
  /** Forwarded to the underlying `devframeViteBridge`/`devframeVitePlugin` (mount base, etc.). */
6
6
  vite?: DevframeViteBridgeOptions;
@@ -1,6 +1,6 @@
1
- import { t as createCodeServerDevframe } from "./src-5dhTkOqj.mjs";
1
+ import { t as createCodeServerDevframe } from "../node-C_wU5QYh.mjs";
2
2
  import { devframeViteBridge, devframeVitePlugin } from "@devframes/vite/single";
3
- //#region src/vite.ts
3
+ //#region src/node/vite.ts
4
4
  /**
5
5
  * Mount the code-server launcher into an existing Vite dev server. Returns two
6
6
  * plugins: a bridge that starts the devframe RPC + WebSocket server (so the
@@ -1,12 +1,12 @@
1
- import { PLUGIN_ID } from "./constants.mjs";
1
+ import { PLUGIN_ID } from "./node/constants.mjs";
2
2
  import { defineDevframe } from "devframe";
3
3
  //#region package.json
4
4
  var name = "@devframes/plugin-code-server";
5
- var version = "0.9.9";
5
+ var version = "0.9.10";
6
6
  var description = "Devframe plugin that runs VS Code in the browser as an embedded editor panel.";
7
7
  var homepage = "https://github.com/devframes/devframe#readme";
8
8
  //#endregion
9
- //#region src/index.ts
9
+ //#region src/node/index.ts
10
10
  const remoteAssets = {
11
11
  package: `${name}--assets`,
12
12
  version
@@ -39,6 +39,12 @@ function createCodeServerDevframe(options = {}) {
39
39
  description,
40
40
  icon: "ph:code-duotone",
41
41
  /**
42
+ * The whole surface proxies a live `code-server` process, so a static
43
+ * build would only produce a dead shell of the tool: `createBuild`
44
+ * refuses and a hub static build skips this dock.
45
+ */
46
+ capabilities: { build: false },
47
+ /**
42
48
  * Leave undefined so `resolveBasePath` picks `/` standalone and
43
49
  * `/__<id>/` when hosted. Authors override via `options.basePath`.
44
50
  */
@@ -57,7 +63,7 @@ function createCodeServerDevframe(options = {}) {
57
63
  auth: options.auth ?? true
58
64
  },
59
65
  async setup(ctx) {
60
- const { setupCodeServer } = await import("./node/index.mjs");
66
+ const { setupCodeServer } = await import("./node/setup.mjs");
61
67
  await setupCodeServer(ctx, options);
62
68
  }
63
69
  });
@@ -44,7 +44,7 @@ function getCodeServerSupervisor(ctx) {
44
44
  return supervisor;
45
45
  }
46
46
  //#endregion
47
- //#region src/rpc/functions/detect.ts
47
+ //#region src/node/rpc/functions/detect.ts
48
48
  const detect = defineRpcFunction({
49
49
  name: "devframes:plugin:code-server:detect",
50
50
  type: "query",
@@ -56,7 +56,7 @@ const detect = defineRpcFunction({
56
56
  setup: (ctx) => ({ handler: () => getCodeServerSupervisor(ctx).detect() })
57
57
  });
58
58
  //#endregion
59
- //#region src/rpc/functions/start.ts
59
+ //#region src/node/rpc/functions/start.ts
60
60
  const start = defineRpcFunction({
61
61
  name: "devframes:plugin:code-server:start",
62
62
  type: "action",
@@ -68,7 +68,7 @@ const start = defineRpcFunction({
68
68
  setup: (ctx) => ({ handler: (req = {}) => getCodeServerSupervisor(ctx).start(req) })
69
69
  });
70
70
  //#endregion
71
- //#region src/rpc/index.ts
71
+ //#region src/node/rpc/index.ts
72
72
  const serverFunctions = [
73
73
  detect,
74
74
  defineRpcFunction({
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@devframes/plugin-code-server",
3
3
  "type": "module",
4
- "version": "0.9.9",
4
+ "version": "0.9.10",
5
5
  "description": "Devframe plugin that runs VS Code in the browser as an embedded editor panel.",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -21,17 +21,16 @@
21
21
  ],
22
22
  "sideEffects": false,
23
23
  "exports": {
24
- ".": "./dist/index.mjs",
25
- "./client": "./dist/client/index.mjs",
26
- "./cli": "./dist/cli.mjs",
27
- "./constants": "./dist/constants.mjs",
28
- "./node": "./dist/node/index.mjs",
29
- "./rpc": "./dist/rpc/index.mjs",
30
- "./types": "./dist/types.mjs",
31
- "./vite": "./dist/vite.mjs",
24
+ ".": "./dist/node/index.mjs",
25
+ "./cli": "./dist/node/cli.mjs",
26
+ "./constants": "./dist/node/constants.mjs",
27
+ "./node": "./dist/node/setup.mjs",
28
+ "./rpc": "./dist/node/rpc/index.mjs",
29
+ "./types": "./dist/node/types.mjs",
30
+ "./vite": "./dist/node/vite.mjs",
32
31
  "./package.json": "./package.json"
33
32
  },
34
- "types": "./dist/index.d.mts",
33
+ "types": "./dist/node/index.d.mts",
35
34
  "bin": {
36
35
  "devframe-code-server": "./bin.mjs"
37
36
  },
@@ -40,8 +39,8 @@
40
39
  "dist"
41
40
  ],
42
41
  "peerDependencies": {
43
- "@devframes/plugin-code-server--assets": "0.9.9",
44
- "devframe": "0.9.9",
42
+ "@devframes/plugin-code-server--assets": "0.9.10",
43
+ "devframe": "0.9.10",
45
44
  "vite": "^8.0.0"
46
45
  },
47
46
  "peerDependenciesMeta": {
@@ -53,19 +52,21 @@
53
52
  }
54
53
  },
55
54
  "dependencies": {
56
- "@devframes/vite": "0.9.9",
55
+ "@devframes/vite": "0.9.10",
57
56
  "cac": "^7.0.0"
58
57
  },
59
58
  "devDependencies": {
60
59
  "@antfu/design": "^0.4.0",
61
- "@devframes/plugin-code-server--assets": "0.9.9",
60
+ "@devframes/plugin-code-server--assets": "0.9.10",
62
61
  "@iconify-json/ph": "^1.2.2",
63
62
  "@storybook/addon-docs": "^10.5.10",
64
63
  "@storybook/vue3-vite": "^10.5.10",
65
64
  "@types/node": "^26.4.0",
66
65
  "@vitejs/plugin-vue": "^6.0.8",
67
66
  "colorjs.io": "^0.7.1",
68
- "devframe": "0.9.9",
67
+ "devframe": "0.9.10",
68
+ "h3": "^2.0.1-rc.29",
69
+ "pathe": "^2.0.3",
69
70
  "storybook": "^10.5.10",
70
71
  "tsdown": "^0.22.14",
71
72
  "unocss": "^66.8.1",
@@ -74,12 +75,15 @@
74
75
  "vue": "^3.5.42"
75
76
  },
76
77
  "scripts": {
77
- "build": "tsdown && vite build --config src/spa/vite.config.ts",
78
+ "build": "tsdown && vite build --config app/vite.config.ts",
79
+ "build:app": "vite build --config app/vite.config.ts",
78
80
  "watch": "tsdown --watch",
79
- "typecheck": "tsc --noEmit",
80
- "dev": "vite --config src/spa/vite.config.ts",
81
+ "dev": "vite --config app/vite.config.ts --host",
82
+ "play": "pnpm run build && node playgrounds/server.mjs",
81
83
  "storybook": "storybook dev -p 6013",
82
84
  "build-storybook": "storybook build",
85
+ "cli:build": "node bin.mjs build --out-dir dist/static",
86
+ "typecheck": "tsc --noEmit",
83
87
  "test": "vitest run"
84
88
  }
85
89
  }
@@ -1,13 +0,0 @@
1
- import { CodeServerBackend, CodeServerConnect, CodeServerDetection, CodeServerLogin, CodeServerMode, CodeServerServerInfo, CodeServerSharedState, CodeServerStartResult, CodeServerStatus, CodeServerStatusResult } from "../types.mjs";
2
- import { o as STATE_KEY } from "../constants-BbInB7V-.mjs";
3
- import { DevframeConnectionStatus, DevframeRpcClient, DevframeRpcClientOptions } from "devframe/client";
4
- import { ConnectionMeta } from "devframe/types";
5
- //#region src/client/index.d.ts
6
- /**
7
- * Connect to the code-server plugin's devframe backend. A thin, typed wrapper
8
- * around devframe's {@link connectDevframe}; the SPA derives its base from
9
- * `document.baseURI`, so no options are required in the common case.
10
- */
11
- declare function connectCodeServer(options?: DevframeRpcClientOptions): Promise<DevframeRpcClient>;
12
- //#endregion
13
- export { type CodeServerBackend, type CodeServerConnect, type CodeServerDetection, type CodeServerLogin, type CodeServerMode, type CodeServerServerInfo, type CodeServerSharedState, type CodeServerStartResult, type CodeServerStatus, type CodeServerStatusResult, type ConnectionMeta, type DevframeConnectionStatus, type DevframeRpcClient, STATE_KEY, connectCodeServer };
@@ -1,21 +0,0 @@
1
- import { connectDevframe } from "devframe/client";
2
- //#region src/constants.ts
3
- /**
4
- * Shared-state key holding the serializable, secret-free server status and
5
- * detection result. Authentication material is never published here; it is
6
- * returned only from the `start` / `status` RPCs to the already-authorized
7
- * client (see {@link import('./types').CodeServerConnect}).
8
- */
9
- const STATE_KEY = "devframes:plugin:code-server:state";
10
- //#endregion
11
- //#region src/client/index.ts
12
- /**
13
- * Connect to the code-server plugin's devframe backend. A thin, typed wrapper
14
- * around devframe's {@link connectDevframe}; the SPA derives its base from
15
- * `document.baseURI`, so no options are required in the common case.
16
- */
17
- function connectCodeServer(options) {
18
- return connectDevframe(options);
19
- }
20
- //#endregion
21
- export { STATE_KEY, connectCodeServer };
package/dist/index.d.mts DELETED
@@ -1,23 +0,0 @@
1
- import { CodeServerBackend, CodeServerConnect, CodeServerDetection, CodeServerLogin, CodeServerMode, CodeServerOptions, CodeServerServerInfo, CodeServerSharedState, CodeServerStartRequest, CodeServerStartResult, CodeServerStatus, CodeServerStatusResult, CodeServerTunnelOptions } from "./types.mjs";
2
- import { i as PLUGIN_ID, l as getCookieSessionName, n as DEFAULT_PORT, o as STATE_KEY, t as DEFAULT_CODE_SERVER_PORT } from "./constants-BbInB7V-.mjs";
3
- import { DevframeDefinition } from "devframe";
4
- //#region src/index.d.ts
5
- /**
6
- * Build a {@link DevframeDefinition} for the code-server panel. The same
7
- * definition runs standalone (`createCac`), mounts into a Vite host
8
- * (`/vite`), or docks inside a hub, since its `setup` only relies on the core
9
- * devframe RPC + shared-state surface.
10
- *
11
- * @experimental This plugin is experimental and may change without a major
12
- * version bump until it stabilizes.
13
- *
14
- * @example
15
- * ```ts
16
- * import { createCodeServerDevframe } from '@devframes/plugin-code-server'
17
- *
18
- * export default createCodeServerDevframe({ serverPort: 8080 })
19
- * ```
20
- */
21
- declare function createCodeServerDevframe(options?: CodeServerOptions): DevframeDefinition;
22
- //#endregion
23
- export { type CodeServerBackend, type CodeServerConnect, type CodeServerDetection, type CodeServerLogin, type CodeServerMode, type CodeServerOptions, type CodeServerServerInfo, type CodeServerSharedState, type CodeServerStartRequest, type CodeServerStartResult, type CodeServerStatus, type CodeServerStatusResult, type CodeServerTunnelOptions, DEFAULT_CODE_SERVER_PORT, DEFAULT_PORT, PLUGIN_ID, STATE_KEY, createCodeServerDevframe, createCodeServerDevframe as default, getCookieSessionName };
package/dist/index.mjs DELETED
@@ -1,3 +0,0 @@
1
- import { t as createCodeServerDevframe } from "./src-5dhTkOqj.mjs";
2
- import { DEFAULT_CODE_SERVER_PORT, DEFAULT_PORT, PLUGIN_ID, STATE_KEY, getCookieSessionName } from "./constants.mjs";
3
- export { DEFAULT_CODE_SERVER_PORT, DEFAULT_PORT, PLUGIN_ID, STATE_KEY, createCodeServerDevframe, createCodeServerDevframe as default, getCookieSessionName };
@@ -1,2 +0,0 @@
1
- import { t as serverFunctions } from "../rpc-EXj5vBYf.mjs";
2
- export { serverFunctions };
File without changes