@innovatorved/code-lab 0.4.0 → 0.6.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.
Files changed (82) hide show
  1. package/ARCHITECTURE.md +4 -4
  2. package/CHANGELOG.md +36 -0
  3. package/README.md +6 -30
  4. package/dist/code-lab-sql.esm.js +1 -1
  5. package/dist/code-lab-sql.umd.js +2 -2
  6. package/dist/code-lab.css +32 -5818
  7. package/dist/code-lab.d.ts +1 -1
  8. package/dist/code-lab.esm.js +4655 -64400
  9. package/dist/code-lab.js +4540 -64286
  10. package/dist/code-lab.umd.js +4540 -64286
  11. package/dist/diagnostics.d.ts +3 -0
  12. package/dist/extensions/cpp.d.ts +2 -2
  13. package/dist/extensions/cpp.esm.js +1804 -14725
  14. package/dist/extensions/cpp.js +1804 -14725
  15. package/dist/extensions/guided-lab.esm.js +2938 -16127
  16. package/dist/extensions/guided-lab.js +2938 -16127
  17. package/dist/extensions/python.d.ts +2 -2
  18. package/dist/extensions/python.esm.js +1765 -14698
  19. package/dist/extensions/python.js +1765 -14698
  20. package/dist/index.d.ts +1 -1
  21. package/dist/packages/settings/src/configuration-service.d.ts +7 -0
  22. package/dist/packages/settings/src/index.d.ts +1 -1
  23. package/dist/packages/ui/src/index.d.ts +2 -2
  24. package/dist/packages/ui/src/plugin-registry.d.ts +1 -0
  25. package/dist/packages/ui/src/settings-dialog.d.ts +31 -3
  26. package/dist/packages/ui/src/themes.d.ts +5 -0
  27. package/dist/preview-sw.js +4 -188
  28. package/dist/runtime.esm.js +109 -10284
  29. package/dist/runtime.js +107 -10284
  30. package/dist/schemas.d.ts +2 -2
  31. package/dist/schemas.esm.js +2938 -16127
  32. package/dist/schemas.js +2941 -16130
  33. package/dist/scm.d.ts +296 -14
  34. package/dist/shell.esm.js +811 -9178
  35. package/dist/shell.js +811 -9178
  36. package/dist/storage.d.ts +56 -0
  37. package/dist/terminal.esm.js +20 -1347
  38. package/dist/terminal.js +20 -1347
  39. package/dist/workbench/command-palette.d.ts +16 -1
  40. package/dist/workbench/diff-editor.d.ts +27 -1
  41. package/dist/workbench/icons.d.ts +6 -2
  42. package/dist/workbench/index.d.ts +33 -1
  43. package/dist/workbench/intellisense.d.ts +194 -0
  44. package/dist/workbench/styles.d.ts +1 -1
  45. package/dist/workbench/xterm-adapter.d.ts +122 -0
  46. package/package.json +8 -2
  47. package/packages/commands/package.json +1 -1
  48. package/packages/core/package.json +1 -1
  49. package/packages/editor/package.json +1 -1
  50. package/packages/fs/package.json +1 -1
  51. package/packages/preview/package.json +1 -1
  52. package/packages/runtime/package.json +1 -1
  53. package/packages/settings/package.json +1 -1
  54. package/packages/settings/src/builtin-schemas.ts +17 -6
  55. package/packages/settings/src/configuration-service.ts +72 -6
  56. package/packages/settings/src/index.ts +1 -0
  57. package/packages/sql/package.json +1 -1
  58. package/packages/terminal/package.json +1 -1
  59. package/packages/ui/package.json +1 -1
  60. package/packages/ui/src/index.ts +4 -0
  61. package/packages/ui/src/plugin-registry.ts +17 -2
  62. package/packages/ui/src/settings-dialog.ts +393 -99
  63. package/packages/ui/src/themes.ts +183 -24
  64. package/src/code-lab.css +2763 -444
  65. package/src/diagnostics.ts +139 -7
  66. package/src/extensions/cpp.ts +337 -71
  67. package/src/extensions/python.ts +375 -75
  68. package/src/index.ts +1 -1
  69. package/src/runtime.ts +272 -43
  70. package/src/schemas.ts +2 -2
  71. package/src/scm.ts +2172 -74
  72. package/src/shell.ts +1999 -193
  73. package/src/storage.ts +401 -5
  74. package/src/terminal.ts +148 -12
  75. package/src/workbench/command-palette.ts +289 -48
  76. package/src/workbench/diff-editor.ts +240 -78
  77. package/src/workbench/icons.ts +250 -46
  78. package/src/workbench/index.ts +7 -1
  79. package/src/workbench/intellisense.ts +1859 -0
  80. package/src/workbench/styles.ts +25 -19
  81. package/src/workbench/xterm-adapter.ts +1566 -0
  82. package/src/workbench.ts +13446 -3881
@@ -17,6 +17,8 @@ import { type JsonSchema, validateJsonSchema } from './schema';
17
17
 
18
18
  export type ConfigurationTarget = 'default' | 'user' | 'workspace' | 'override';
19
19
 
20
+ export type ConfigurationResetScope = 'user' | 'workspace' | 'all';
21
+
20
22
  export interface SettingDiagnostic {
21
23
  readonly file: string;
22
24
  readonly key?: string;
@@ -66,8 +68,11 @@ export interface IConfigurationService extends IDisposable {
66
68
  get<T = unknown>(key: string, fallback?: T): T;
67
69
  inspect<T = unknown>(key: string): SettingInspection<T>;
68
70
  getDiagnostics(): readonly SettingDiagnostic[];
71
+ getWorkspaceSettings(): Record<string, unknown>;
69
72
  setUserSetting(key: string, value: unknown): boolean;
70
73
  resetSetting(key: string): void;
74
+ resetScopedSetting(key: string, scope: ConfigurationResetScope): Promise<void>;
75
+ resetAllSettings(scope?: ConfigurationResetScope): Promise<void>;
71
76
  setWorkspaceSetting(key: string, value: unknown): boolean;
72
77
  loadWorkspaceSettingsJson(rawJsonc: string, filePath?: string): readonly SettingDiagnostic[];
73
78
  setOverrides(overrides: Readonly<Record<string, unknown>>): void;
@@ -225,6 +230,72 @@ export class ConfigurationService implements IConfigurationService {
225
230
  }
226
231
  }
227
232
 
233
+ public getWorkspaceSettings(): Record<string, unknown> {
234
+ const out: Record<string, unknown> = {};
235
+ const keys = Array.from(this.workspaceValues.keys()).sort();
236
+ for (const k of keys) {
237
+ out[k] = this.workspaceValues.get(k);
238
+ }
239
+ return out;
240
+ }
241
+
242
+ public async resetScopedSetting(key: string, scope: ConfigurationResetScope): Promise<void> {
243
+ if (scope === 'user') {
244
+ if (this.userValues.delete(key)) {
245
+ this.fireChange([key], 'user');
246
+ }
247
+ return;
248
+ }
249
+ if (scope === 'workspace') {
250
+ if (this.workspaceValues.delete(key)) {
251
+ this.fireChange([key], 'workspace');
252
+ }
253
+ return;
254
+ }
255
+ const hadUser = this.userValues.delete(key);
256
+ const hadWs = this.workspaceValues.delete(key);
257
+ const hadOv = this.overrideValues.delete(key);
258
+ if (hadUser || hadWs || hadOv) {
259
+ this.fireChange([key], 'user');
260
+ }
261
+ }
262
+
263
+ public async resetAllSettings(scope: ConfigurationResetScope = 'all'): Promise<void> {
264
+ if (scope === 'user') {
265
+ const affected = new Set<string>(this.userValues.keys());
266
+ this.userValues.clear();
267
+ if (affected.size > 0) {
268
+ this.fireChange(affected, 'user');
269
+ }
270
+ return;
271
+ }
272
+ if (scope === 'workspace') {
273
+ const affected = new Set<string>(this.workspaceValues.keys());
274
+ this.workspaceValues.clear();
275
+ if (this.diagnostics.length > 0) {
276
+ this.updateDiagnostics([]);
277
+ }
278
+ if (affected.size > 0) {
279
+ this.fireChange(affected, 'workspace');
280
+ }
281
+ return;
282
+ }
283
+ const affected = new Set<string>([
284
+ ...this.userValues.keys(),
285
+ ...this.workspaceValues.keys(),
286
+ ...this.overrideValues.keys()
287
+ ]);
288
+ this.userValues.clear();
289
+ this.workspaceValues.clear();
290
+ this.overrideValues.clear();
291
+ if (this.diagnostics.length > 0) {
292
+ this.updateDiagnostics([]);
293
+ }
294
+ if (affected.size > 0) {
295
+ this.fireChange(affected, 'user');
296
+ }
297
+ }
298
+
228
299
  public loadWorkspaceSettingsJson(
229
300
  rawJsonc: string,
230
301
  filePath = '.codelab/settings.json'
@@ -310,12 +381,7 @@ export class ConfigurationService implements IConfigurationService {
310
381
  }
311
382
 
312
383
  public toWorkspaceJsonString(): string {
313
- const out: Record<string, unknown> = {};
314
- const keys = Array.from(this.workspaceValues.keys()).sort();
315
- for (const k of keys) {
316
- out[k] = this.workspaceValues.get(k);
317
- }
318
- return JSON.stringify(out, null, 2) + '\n';
384
+ return JSON.stringify(this.getWorkspaceSettings(), null, 2) + '\n';
319
385
  }
320
386
 
321
387
  public exportProfile(): string {
@@ -24,6 +24,7 @@ export {
24
24
 
25
25
  export {
26
26
  type ConfigurationTarget,
27
+ type ConfigurationResetScope,
27
28
  type SettingDiagnostic,
28
29
  type ConfigurationChangeEvent,
29
30
  type SettingInspection,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code-lab/sql",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "description": "Zero-dependency lightweight SQL editor & PostgreSQL 18 / SQLite 3 language pack (<35 KB gzipped) with schema-aware alias autocomplete, formatter, and inline error diagnostics.",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code-lab/terminal",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "description": "Typed multi-session terminal service & ANSI stream parser for CodeLab.",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code-lab/ui",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "description": "Workbench UI services and components for CodeLab: ThemeService (dark/light/high-contrast/custom), Searchable Settings Dialog, Quick Open, PluginRegistry, ErrorBoundary, and Dev Observability Inspector.",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -6,6 +6,7 @@ export {
6
6
  LIGHT_THEME,
7
7
  HIGH_CONTRAST_THEME,
8
8
  IThemeServiceId,
9
+ pickContrastingFg,
9
10
  parseCustomTheme,
10
11
  ThemeService
11
12
  } from './themes';
@@ -23,6 +24,9 @@ export {
23
24
  } from './plugin-registry';
24
25
 
25
26
  export {
27
+ type SettingsScope,
28
+ type SettingsInlineMountOptions,
29
+ type SettingsOpenOptions,
26
30
  type SettingsDialogOptions,
27
31
  SettingsDialogController
28
32
  } from './settings-dialog';
@@ -48,6 +48,7 @@ export interface PluginActivationContext {
48
48
  readonly keybindings: IKeybindingService;
49
49
  readonly themes: IThemeService;
50
50
  readonly logger: ILogger;
51
+ readonly registerPanel?: (panel: PanelContribution) => IDisposable;
51
52
  }
52
53
 
53
54
  export interface CodeLabPluginManifest {
@@ -184,7 +185,15 @@ export class PluginRegistry implements IPluginRegistry {
184
185
 
185
186
  return {
186
187
  dispose: (): void => {
187
- void this.deactivatePlugin(manifest.id);
188
+ if (record.active) {
189
+ record.active = false;
190
+ try {
191
+ record.manifest.deactivate?.();
192
+ } catch (err) {
193
+ this.logger.warn(`Plugin "${manifest.id}" threw during deactivate`, err);
194
+ }
195
+ record.runtimeDisposables.dispose();
196
+ }
188
197
  record.manifestDisposables.dispose();
189
198
  this.records.delete(manifest.id);
190
199
  this.changeEmitter.fire(manifest.id);
@@ -205,7 +214,13 @@ export class PluginRegistry implements IPluginRegistry {
205
214
  configuration: this.configuration,
206
215
  keybindings: this.keybindings,
207
216
  themes: this.themes,
208
- logger: this.logger.child(id)
217
+ logger: this.logger.child(id),
218
+ registerPanel: (panel: PanelContribution): IDisposable => {
219
+ const d = this.panels.register(panel.id, panel);
220
+ record.runtimeDisposables.add(d);
221
+ this.changeEmitter.fire(id);
222
+ return d;
223
+ }
209
224
  });
210
225
  if (ret && typeof ret.dispose === 'function') {
211
226
  record.runtimeDisposables.add(ret);