@innovatorved/code-lab 0.7.1 → 0.7.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/ARCHITECTURE.md +2 -2
- package/CHANGELOG.md +10 -0
- package/README.md +5 -5
- package/dist/code-lab-sql.esm.js +2 -2
- package/dist/code-lab-sql.umd.js +3 -3
- package/dist/code-lab.css +1 -1
- package/dist/code-lab.d.ts +47 -38
- package/dist/code-lab.esm.js +918 -884
- package/dist/code-lab.js +917 -881
- package/dist/extensions/cpp.esm.js +33 -33
- package/dist/extensions/cpp.js +33 -33
- package/dist/extensions/python.esm.js +79 -49
- package/dist/extensions/python.js +79 -49
- package/dist/index.d.ts +1 -1
- package/dist/logger.d.ts +4 -20
- package/dist/modular-kernel.d.ts +0 -1
- package/dist/packages/core/src/errors.d.ts +5 -1
- package/dist/packages/fs/src/backends.d.ts +0 -27
- package/dist/packages/fs/src/index.d.ts +1 -1
- package/dist/packages/ui/src/html.d.ts +1 -0
- package/dist/packages/ui/src/index.d.ts +1 -0
- package/dist/{apps/web/src/index.d.ts → packages/ui/src/kernel.d.ts} +3 -2
- package/dist/packages/ui/src/observability.d.ts +1 -1
- package/dist/packages/ui/src/settings-dialog.d.ts +0 -1
- package/dist/preview-sw.js +1 -1
- package/dist/runtime.d.ts +3 -0
- package/dist/runtime.esm.js +2 -2
- package/dist/runtime.js +2 -2
- package/dist/schemas.d.ts +1 -1
- package/dist/shell.esm.js +277 -285
- package/dist/shell.js +277 -285
- package/dist/terminal.esm.js +2 -2
- package/dist/terminal.js +2 -2
- package/dist/workbench/editor.d.ts +0 -4
- package/dist/workbench/index.d.ts +0 -2
- package/dist/workbench/intellisense.d.ts +0 -1
- package/dist/workbench/xterm-adapter.d.ts +0 -1
- package/package.json +2 -4
- package/src/code-lab.css +0 -8086
- package/src/csp.ts +0 -590
- package/src/diagnostics.ts +0 -287
- package/src/extensions/cpp.ts +0 -2371
- package/src/extensions/guided-lab.ts +0 -68
- package/src/extensions/javascript.ts +0 -54
- package/src/extensions/python.ts +0 -1743
- package/src/extensions/typescript.ts +0 -85
- package/src/extensions/umbrella.ts +0 -5
- package/src/html.ts +0 -88
- package/src/index.ts +0 -129
- package/src/logger.ts +0 -139
- package/src/modular-kernel.ts +0 -7
- package/src/preview-sw.js +0 -296
- package/src/runtime/test-harness.ts +0 -57
- package/src/runtime.ts +0 -10565
- package/src/sample.html +0 -304
- package/src/schemas.ts +0 -366
- package/src/scm.ts +0 -2453
- package/src/search.ts +0 -433
- package/src/shell.ts +0 -10990
- package/src/storage.ts +0 -773
- package/src/terminal.ts +0 -1402
- package/src/workbench/command-palette.ts +0 -101
- package/src/workbench/diff-editor.ts +0 -472
- package/src/workbench/editor.ts +0 -49
- package/src/workbench/icons.ts +0 -255
- package/src/workbench/index.ts +0 -29
- package/src/workbench/intellisense.ts +0 -1884
- package/src/workbench/share.ts +0 -128
- package/src/workbench/xterm-adapter.ts +0 -1571
- package/src/workbench.ts +0 -21825
- package/src/zip.ts +0 -348
package/dist/code-lab.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* TypeScript Definitions for @innovatorved/code-lab v0.7.
|
|
2
|
+
* TypeScript Definitions for @innovatorved/code-lab v0.7.2
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
export interface CodeLabStep {
|
|
@@ -157,54 +157,63 @@ export interface CodeLabCspAPI {
|
|
|
157
157
|
|
|
158
158
|
export declare const CodeLabCsp: CodeLabCspAPI;
|
|
159
159
|
|
|
160
|
-
export type
|
|
160
|
+
export type CodeLabLogLevel = 'debug' | 'info' | 'warn' | 'error';
|
|
161
|
+
export type LogLevel = CodeLabLogLevel;
|
|
162
|
+
|
|
163
|
+
export interface CodeLabLogSink {
|
|
164
|
+
debug?: (...args: unknown[]) => void;
|
|
165
|
+
info?: (...args: unknown[]) => void;
|
|
166
|
+
warn?: (...args: unknown[]) => void;
|
|
167
|
+
error?: (...args: unknown[]) => void;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export interface CodeLabLoggerOptions {
|
|
171
|
+
logger?: CodeLabLogSink | null;
|
|
172
|
+
debug?: boolean;
|
|
173
|
+
prefix?: string;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export type CreateLoggerOptions = CodeLabLoggerOptions;
|
|
177
|
+
|
|
178
|
+
export interface CodeLabLogger {
|
|
179
|
+
debug: (...args: unknown[]) => void;
|
|
180
|
+
info: (...args: unknown[]) => void;
|
|
181
|
+
warn: (...args: unknown[]) => void;
|
|
182
|
+
error: (...args: unknown[]) => void;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export type Logger = CodeLabLogger;
|
|
161
186
|
|
|
162
187
|
export type CodeLabErrorCode =
|
|
188
|
+
| 'E_SAVE'
|
|
163
189
|
| 'E_PERSISTENCE'
|
|
164
|
-
| '
|
|
165
|
-
| '
|
|
166
|
-
| '
|
|
167
|
-
| 'E_CSP_VIOLATION'
|
|
168
|
-
| 'E_PREVIEW_SW'
|
|
169
|
-
| 'E_PREVIEW_RENDER'
|
|
170
|
-
| 'E_NETWORK_BLOCKED'
|
|
171
|
-
| 'E_VFS'
|
|
190
|
+
| 'E_INSTALL'
|
|
191
|
+
| 'E_PREVIEW'
|
|
192
|
+
| 'E_RUNTIME'
|
|
172
193
|
| 'E_SHELL'
|
|
173
|
-
| '
|
|
174
|
-
| '
|
|
175
|
-
| 'E_PACKAGE_FETCH'
|
|
176
|
-
| 'E_CLONE_FAILED'
|
|
177
|
-
| 'E_EXTENSION';
|
|
194
|
+
| 'E_CLONE'
|
|
195
|
+
| 'E_CONFIG';
|
|
178
196
|
|
|
179
197
|
export interface CodeLabErrorOptions {
|
|
180
198
|
cause?: unknown;
|
|
199
|
+
recoverable?: boolean;
|
|
200
|
+
details?: Record<string, unknown>;
|
|
181
201
|
context?: Record<string, unknown>;
|
|
182
202
|
}
|
|
183
203
|
|
|
184
204
|
export declare class CodeLabError extends Error {
|
|
185
205
|
readonly code: CodeLabErrorCode;
|
|
186
|
-
readonly
|
|
206
|
+
readonly options: CodeLabErrorOptions;
|
|
187
207
|
readonly cause?: unknown;
|
|
208
|
+
readonly recoverable: boolean;
|
|
209
|
+
readonly details?: Record<string, unknown>;
|
|
210
|
+
readonly context?: Record<string, unknown>;
|
|
188
211
|
constructor(code: CodeLabErrorCode, message: string, options?: CodeLabErrorOptions);
|
|
189
212
|
}
|
|
190
213
|
|
|
191
|
-
export interface Logger {
|
|
192
|
-
readonly level: LogLevel;
|
|
193
|
-
error(message: string, meta?: unknown): void;
|
|
194
|
-
warn(message: string, meta?: unknown): void;
|
|
195
|
-
info(message: string, meta?: unknown): void;
|
|
196
|
-
debug(message: string, meta?: unknown): void;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
export interface CreateLoggerOptions {
|
|
200
|
-
level?: LogLevel;
|
|
201
|
-
scope?: string;
|
|
202
|
-
sink?: Partial<Record<Exclude<LogLevel, 'silent'>, (line: string, meta?: unknown) => void>>;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
214
|
export declare function isCodeLabError(value: unknown): value is CodeLabError;
|
|
206
|
-
export declare function createLogger(
|
|
207
|
-
export declare const DEFAULT_LOGGER:
|
|
215
|
+
export declare function createLogger(options?: CodeLabLoggerOptions): CodeLabLogger;
|
|
216
|
+
export declare const DEFAULT_LOGGER: CodeLabLogger;
|
|
208
217
|
export declare const LOG_PREFIX = '[code-lab]';
|
|
209
218
|
|
|
210
219
|
export interface SafeHtml {
|
|
@@ -217,10 +226,10 @@ export declare function raw(trustedHtml: string): SafeHtml;
|
|
|
217
226
|
export declare function isSafeHtml(value: unknown): value is SafeHtml;
|
|
218
227
|
export declare function html(strings: TemplateStringsArray, ...values: unknown[]): SafeHtml;
|
|
219
228
|
|
|
220
|
-
export declare function computeCrc32(data: string | Uint8Array): number;
|
|
229
|
+
export declare function computeCrc32(data: string | Uint8Array | ArrayBuffer): number;
|
|
221
230
|
export declare function sanitizeZipPath(rawPath: string): string;
|
|
222
231
|
export declare function createZip(files: Record<string, string | Uint8Array>): Uint8Array;
|
|
223
|
-
export declare function extractZip(
|
|
232
|
+
export declare function extractZip(data: Uint8Array | ArrayBuffer): Record<string, string>;
|
|
224
233
|
export declare const CodeLabZip: {
|
|
225
234
|
computeCrc32: typeof computeCrc32;
|
|
226
235
|
sanitizeZipPath: typeof sanitizeZipPath;
|
|
@@ -372,8 +381,10 @@ export interface CodeLabOptions {
|
|
|
372
381
|
editorEngine?: 'sql' | 'monaco';
|
|
373
382
|
/** Set to false to disable localStorage persistence and use in-memory state only */
|
|
374
383
|
persistState?: boolean;
|
|
375
|
-
/**
|
|
376
|
-
logger?:
|
|
384
|
+
/** Custom log sink or logger instance */
|
|
385
|
+
logger?: CodeLabLogSink | CodeLabLogger | null;
|
|
386
|
+
/** Enable verbose debug logging */
|
|
387
|
+
debug?: boolean;
|
|
377
388
|
/** Shortcut for setting logger level */
|
|
378
389
|
logLevel?: LogLevel;
|
|
379
390
|
/** Public GitHub repository URL or owner/repo shorthand to automatically clone on mount */
|
|
@@ -755,8 +766,6 @@ export declare const ThemeService: any;
|
|
|
755
766
|
export declare const PluginRegistry: any;
|
|
756
767
|
export declare const FileSystemService: any;
|
|
757
768
|
export declare const MemoryBackend: any;
|
|
758
|
-
export declare const IndexedDbBackend: any;
|
|
759
|
-
export declare const OpfsBackend: any;
|
|
760
769
|
export declare const parseJsonc: <T = unknown>(raw: string) => { value: T | undefined; errors: readonly any[] };
|
|
761
770
|
export declare const validateJsonSchema: (value: unknown, schema: any, path?: string) => any[];
|
|
762
771
|
|