@lvce-editor/shared-process 0.77.12 → 0.78.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/shared-process",
3
- "version": "0.77.12",
3
+ "version": "0.78.0",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@lvce-editor/assert": "1.5.1",
21
- "@lvce-editor/extension-host-helper-process": "0.77.12",
21
+ "@lvce-editor/extension-host-helper-process": "0.78.0",
22
22
  "@lvce-editor/ipc": "15.0.0",
23
23
  "@lvce-editor/json-rpc": "8.0.0",
24
24
  "@lvce-editor/jsonc-parser": "1.5.0",
@@ -35,7 +35,7 @@
35
35
  "@lvce-editor/network-process": "5.2.0",
36
36
  "@lvce-editor/preload": "1.5.0",
37
37
  "@lvce-editor/preview-process": "11.0.0",
38
- "@lvce-editor/pty-host": "8.0.0",
38
+ "@lvce-editor/pty-host": "8.1.0",
39
39
  "@lvce-editor/search-process": "13.1.0",
40
40
  "@lvce-editor/typescript-compile-process": "5.0.0",
41
41
  "open": "^11.0.0",
@@ -2,6 +2,6 @@ import { join } from 'path';
2
2
  import { fileURLToPath } from 'url';
3
3
  export const getBuiltinExtensionsPath = () => {
4
4
  const staticServerPath = fileURLToPath(import.meta.resolve('@lvce-editor/static-server'));
5
- const builtinExtensionsPath = join(staticServerPath, '..', '..', 'static', '9d77d9c', 'extensions');
5
+ const builtinExtensionsPath = join(staticServerPath, '..', '..', 'static', '5a230ea', 'extensions');
6
6
  return builtinExtensionsPath;
7
7
  };
@@ -8,7 +8,7 @@ export const launchPtyHost = async (method) => {
8
8
  defaultPath: PtyHostPath.ptyHostPath,
9
9
  isElectron: IsElectron.isElectron,
10
10
  name: 'Terminal Process',
11
- settingName: '',
11
+ settingName: 'develop.ptyHostPath',
12
12
  targetRpcId: IpcId.TerminalProcess,
13
13
  });
14
14
  PtyHostState.state.ipc = ipc;
@@ -3,6 +3,8 @@ import * as Assert from '../Assert/Assert.js';
3
3
  /** @type {Record<string, {
4
4
  server: import('node:http').Server | undefined,
5
5
  portPromise: Promise<number> | undefined,
6
+ successHtml: string,
7
+ errorHtml: string,
6
8
  codeQueue: string[],
7
9
  codePromise: Promise<string> | undefined,
8
10
  resolveCode: ((value: string) => void) | undefined,
@@ -14,6 +16,8 @@ const getOrCreateState = (id) => {
14
16
  states[id] = {
15
17
  server: undefined,
16
18
  portPromise: undefined,
19
+ successHtml: '',
20
+ errorHtml: '',
17
21
  codeQueue: [],
18
22
  codePromise: undefined,
19
23
  resolveCode: undefined,
@@ -52,143 +56,24 @@ const getCodeFromRequest = (request) => {
52
56
  const code = url.searchParams.get('code');
53
57
  return code || undefined;
54
58
  };
55
- const getSuccessPage = () => {
56
- return `<!doctype html>
57
- <html lang="en">
58
- <head>
59
- <meta charset="utf-8">
60
- <meta name="viewport" content="width=device-width, initial-scale=1">
61
- <title>Authentication Complete</title>
62
- <style>
63
- :root {
64
- color-scheme: light;
65
- --background: linear-gradient(180deg, #f4f7fb 0%, #e9eef8 100%);
66
- --panel: rgba(255, 255, 255, 0.92);
67
- --panel-border: rgba(33, 52, 88, 0.08);
68
- --text: #132238;
69
- --muted: #5f6f86;
70
- --accent: #1f7a5a;
71
- --accent-soft: #e7f6ef;
72
- --shadow: 0 24px 60px rgba(44, 65, 98, 0.16);
73
- }
74
-
75
- * {
76
- box-sizing: border-box;
77
- }
78
-
79
- html,
80
- body {
81
- margin: 0;
82
- min-height: 100%;
83
- font-family: Inter, 'Segoe UI', sans-serif;
84
- background: var(--background);
85
- color: var(--text);
86
- }
87
-
88
- body {
89
- display: flex;
90
- align-items: center;
91
- justify-content: center;
92
- padding: 24px;
93
- }
94
-
95
- .card {
96
- width: min(100%, 460px);
97
- padding: 32px 28px;
98
- border: 1px solid var(--panel-border);
99
- border-radius: 20px;
100
- background: var(--panel);
101
- box-shadow: var(--shadow);
102
- text-align: center;
103
- backdrop-filter: blur(12px);
104
- }
105
-
106
- .badge {
107
- display: inline-flex;
108
- align-items: center;
109
- justify-content: center;
110
- width: 64px;
111
- height: 64px;
112
- margin-bottom: 20px;
113
- border-radius: 999px;
114
- background: var(--accent-soft);
115
- color: var(--accent);
116
- }
117
-
118
- h1 {
119
- margin: 0;
120
- font-size: 28px;
121
- line-height: 1.15;
122
- letter-spacing: -0.03em;
123
- }
124
-
125
- p {
126
- margin: 14px 0 0;
127
- font-size: 15px;
128
- line-height: 1.6;
129
- color: var(--muted);
130
- }
131
-
132
- .hint {
133
- margin-top: 22px;
134
- padding: 12px 14px;
135
- border-radius: 12px;
136
- background: rgba(19, 34, 56, 0.04);
137
- font-size: 14px;
138
- }
139
-
140
- .button {
141
- margin-top: 20px;
142
- border: 0;
143
- border-radius: 999px;
144
- background: var(--text);
145
- color: #fff;
146
- padding: 10px 18px;
147
- font: inherit;
148
- cursor: pointer;
149
- }
150
-
151
- .button:hover {
152
- background: #0d182a;
153
- }
154
- </style>
155
- </head>
156
- <body>
157
- <main class="card">
158
- <div class="badge" aria-hidden="true">
159
- <svg width="28" height="28" viewBox="0 0 24 24" fill="none" role="presentation">
160
- <path d="M20 7L10 17L5 12" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"></path>
161
- </svg>
162
- </div>
163
- <h1>Authentication complete</h1>
164
- <p>Your sign-in finished successfully. You can return to the app now.</p>
165
- <p class="hint">This window is no longer needed and can be closed.</p>
166
- <button class="button" type="button" id="close-button">Close Window</button>
167
- </main>
168
- <script>
169
- const closeWindow = () => {
170
- window.close()
171
- }
172
-
173
- document.getElementById('close-button')?.addEventListener('click', closeWindow)
174
- window.setTimeout(closeWindow, 1200)
175
- </script>
176
- </body>
177
- </html>`;
178
- };
179
59
  const handleRequest = (id, request, response) => {
180
60
  const state = states[id];
61
+ let html = '';
181
62
  if (state) {
182
63
  const code = getCodeFromRequest(request);
183
64
  if (code) {
184
65
  resolveCode(state, code);
66
+ html = state.successHtml;
67
+ }
68
+ else {
69
+ html = state.errorHtml;
185
70
  }
186
71
  }
187
72
  response.writeHead(200, {
188
73
  'Content-Type': 'text/html; charset=utf-8',
189
74
  'Cache-Control': 'no-store',
190
75
  });
191
- response.end(getSuccessPage());
76
+ response.end(html);
192
77
  };
193
78
  const listen = (server) => {
194
79
  const { promise, resolve, reject } = Promise.withResolvers();
@@ -219,9 +104,13 @@ const getOrCreateCodePromise = (state) => {
219
104
  }
220
105
  return state.codePromise;
221
106
  };
222
- export const create = async (id) => {
107
+ export const create = async (id, successHtml, errorHtml) => {
223
108
  Assert.string(id);
109
+ Assert.string(successHtml);
110
+ Assert.string(errorHtml);
224
111
  const state = getOrCreateState(id);
112
+ state.successHtml = successHtml;
113
+ state.errorHtml = errorHtml;
225
114
  if (state.portPromise) {
226
115
  return state.portPromise;
227
116
  }
@@ -41,9 +41,9 @@ export const getAppImageName = () => {
41
41
  export const getSetupName = () => {
42
42
  return 'Lvce-Setup';
43
43
  };
44
- export const version = '0.77.12';
45
- export const commit = '9d77d9c';
46
- export const date = '2026-04-07T13:03:24.000Z';
44
+ export const version = '0.78.0';
45
+ export const commit = '5a230ea';
46
+ export const date = '2026-04-09T21:28:44.000Z';
47
47
  export const getVersion = () => {
48
48
  return version;
49
49
  };
@@ -1,5 +1,5 @@
1
1
  import { join } from 'node:path';
2
2
  import * as Root from '../Root/Root.js';
3
3
  export const getPreloadUrl = () => {
4
- return join(Root.root, 'static', '9d77d9c', 'packages', 'preload', 'dist', 'index.js');
4
+ return join(Root.root, 'static', '5a230ea', 'packages', 'preload', 'dist', 'index.js');
5
5
  };