@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
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
GuidedLabExtensionOptions,
|
|
3
|
-
GuidedLabExtensionOptionsSchema
|
|
4
|
-
} from '../schemas';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Guided Lab Extension for CodeLab
|
|
8
|
-
*
|
|
9
|
-
* Provides TutorialKit / Codedamn-style interactive curriculum challenges:
|
|
10
|
-
* - Step-by-step instructions pane with architectural notes & hints
|
|
11
|
-
* - 'Guided Challenge' vs 'Reference Sandbox' mode switcher
|
|
12
|
-
* - 'Verify Step' test runner for targeted validation
|
|
13
|
-
* - Reference solution diff viewer
|
|
14
|
-
* - Multi-language (JS/TS) curriculum switching
|
|
15
|
-
*/
|
|
16
|
-
export function guidedLabExtension(workbench: any, options: Partial<GuidedLabExtensionOptions> = {}) {
|
|
17
|
-
const parsed = GuidedLabExtensionOptionsSchema.partial().parse(options);
|
|
18
|
-
|
|
19
|
-
workbench.hasGuidedLab = true;
|
|
20
|
-
if (parsed.steps && parsed.steps.length > 0) {
|
|
21
|
-
workbench.steps = parsed.steps;
|
|
22
|
-
}
|
|
23
|
-
if (parsed.mode) {
|
|
24
|
-
workbench.mode = parsed.mode;
|
|
25
|
-
}
|
|
26
|
-
if (typeof parsed.stepIndex === 'number') {
|
|
27
|
-
workbench.activeStepIndex = parsed.stepIndex;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
workbench.guidedConfig = {
|
|
31
|
-
...workbench.guidedConfig,
|
|
32
|
-
...parsed,
|
|
33
|
-
steps: workbench.steps
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
if (!workbench.enabledLanguages || !(workbench.enabledLanguages instanceof Set)) {
|
|
37
|
-
workbench.enabledLanguages = new Set(['js']);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
if (parsed.tsStarterFiles || parsed.tsSolutionFiles || parsed.tsFiles) {
|
|
41
|
-
workbench.enabledLanguages.add('ts');
|
|
42
|
-
workbench.hasMultipleLanguages = true;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
if (parsed.cppStarterFiles || parsed.cppSolutionFiles || parsed.cppFiles) {
|
|
46
|
-
workbench.enabledLanguages.add('cpp');
|
|
47
|
-
workbench.hasMultipleLanguages = true;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
if (parsed.pyStarterFiles || parsed.pySolutionFiles || parsed.pyFiles) {
|
|
51
|
-
workbench.enabledLanguages.add('py');
|
|
52
|
-
workbench.hasMultipleLanguages = true;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
if (typeof workbench._renderShell === 'function' && workbench.container) {
|
|
56
|
-
workbench._renderShell();
|
|
57
|
-
if (typeof workbench._bindEvents === 'function') {
|
|
58
|
-
workbench._bindEvents();
|
|
59
|
-
}
|
|
60
|
-
if (typeof workbench._renderFileLists === 'function') {
|
|
61
|
-
workbench._renderFileLists();
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return workbench;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export default guidedLabExtension;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* JavaScript Language Extension for CodeLab
|
|
3
|
-
*
|
|
4
|
-
* Enabled by default in CodeLab. Uses the browser's built-in JavaScript engine
|
|
5
|
-
* and CodeLab's zero-dependency virtual Node.js + Bun runtime (`node`, `bun`, `npm`).
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
export interface JavaScriptExtensionOptions {
|
|
9
|
-
/**
|
|
10
|
-
* Optional starter files to seed when JavaScript is selected.
|
|
11
|
-
*/
|
|
12
|
-
files?: Record<string, string>;
|
|
13
|
-
/**
|
|
14
|
-
* Default entry file for JavaScript runs (e.g. 'src/demo.js' or 'index.js').
|
|
15
|
-
*/
|
|
16
|
-
entry?: string;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function javascriptExtension(workbench: any, options: JavaScriptExtensionOptions = {}) {
|
|
20
|
-
if (!workbench) return workbench;
|
|
21
|
-
|
|
22
|
-
if (!workbench.enabledLanguages || !(workbench.enabledLanguages instanceof Set)) {
|
|
23
|
-
workbench.enabledLanguages = new Set(['js']);
|
|
24
|
-
} else {
|
|
25
|
-
workbench.enabledLanguages.add('js');
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
if (options.files && typeof options.files === 'object') {
|
|
29
|
-
workbench.jsFiles = { ...(workbench.jsFiles || {}), ...options.files };
|
|
30
|
-
}
|
|
31
|
-
if (options.entry && !workbench.entry) {
|
|
32
|
-
workbench.entry = options.entry;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
workbench.hasMultipleLanguages = workbench.enabledLanguages.size > 1;
|
|
36
|
-
|
|
37
|
-
if (typeof workbench._renderShell === 'function' && workbench.container) {
|
|
38
|
-
workbench._renderShell();
|
|
39
|
-
if (typeof workbench._bindEvents === 'function') workbench._bindEvents();
|
|
40
|
-
if (typeof workbench._renderFileLists === 'function') workbench._renderFileLists();
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return workbench;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export function createJavaScriptExtension(options: JavaScriptExtensionOptions = {}) {
|
|
47
|
-
const plugin = (workbench: any) => javascriptExtension(workbench, options);
|
|
48
|
-
plugin.extensionName = 'javascript';
|
|
49
|
-
plugin.languageId = 'js' as const;
|
|
50
|
-
return plugin;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export const jsExtension = javascriptExtension;
|
|
54
|
-
export default javascriptExtension;
|