@innovatorved/code-lab 0.3.2 → 0.5.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/ARCHITECTURE.md +5 -3
- package/CHANGELOG.md +41 -0
- package/README.md +53 -175
- package/dist/apps/web/src/index.d.ts +34 -0
- package/dist/code-lab-sql.css +482 -0
- package/dist/code-lab-sql.d.ts +179 -0
- package/dist/code-lab-sql.esm.js +542 -0
- package/dist/code-lab-sql.umd.js +531 -0
- package/dist/code-lab.css +1799 -98
- package/dist/code-lab.d.ts +110 -15
- package/dist/code-lab.esm.js +49678 -23253
- package/dist/code-lab.js +49648 -23251
- package/dist/code-lab.umd.js +75766 -0
- package/dist/diagnostics.d.ts +3 -0
- package/dist/extensions/cpp.esm.js +19504 -3788
- package/dist/extensions/cpp.js +19501 -3785
- package/dist/extensions/guided-lab.esm.js +19401 -3725
- package/dist/extensions/guided-lab.js +19400 -3724
- package/dist/extensions/python.d.ts +1 -0
- package/dist/extensions/python.esm.js +19597 -3788
- package/dist/extensions/python.js +19597 -3788
- package/dist/extensions/umbrella.d.ts +5 -0
- package/dist/index.d.ts +1 -1
- package/dist/modular-kernel.d.ts +11 -0
- package/dist/packages/commands/src/index.d.ts +96 -0
- package/dist/packages/core/src/di.d.ts +36 -0
- package/dist/packages/core/src/disposable.d.ts +27 -0
- package/dist/packages/core/src/errors.d.ts +69 -0
- package/dist/packages/core/src/events.d.ts +38 -0
- package/dist/packages/core/src/index.d.ts +6 -0
- package/dist/packages/core/src/path.d.ts +14 -0
- package/dist/packages/core/src/registry.d.ts +23 -0
- package/dist/packages/editor/src/index.d.ts +118 -0
- package/dist/packages/fs/src/backends.d.ts +37 -0
- package/dist/packages/fs/src/index.d.ts +3 -0
- package/dist/packages/fs/src/types.d.ts +40 -0
- package/dist/packages/fs/src/vfs-service.d.ts +33 -0
- package/dist/packages/preview/src/index.d.ts +34 -0
- package/dist/packages/runtime/src/index.d.ts +47 -0
- package/dist/packages/settings/src/builtin-schemas.d.ts +15 -0
- package/dist/packages/settings/src/configuration-service.d.ts +107 -0
- package/dist/packages/settings/src/index.d.ts +4 -0
- package/dist/packages/settings/src/jsonc.d.ts +20 -0
- package/dist/packages/settings/src/schema.d.ts +28 -0
- package/dist/packages/sql/src/completions.d.ts +8 -0
- package/dist/packages/sql/src/diagnostics.d.ts +2 -0
- package/dist/packages/sql/src/formatter.d.ts +2 -0
- package/dist/packages/sql/src/index.d.ts +7 -0
- package/dist/packages/sql/src/sql-editor.d.ts +2 -0
- package/dist/packages/sql/src/styles.d.ts +2 -0
- package/dist/packages/sql/src/tokenizer.d.ts +13 -0
- package/dist/packages/sql/src/types.d.ts +130 -0
- package/dist/packages/terminal/src/index.d.ts +54 -0
- package/dist/packages/ui/src/index.d.ts +4 -0
- package/dist/packages/ui/src/observability.d.ts +22 -0
- package/dist/packages/ui/src/plugin-registry.d.ts +90 -0
- package/dist/packages/ui/src/settings-dialog.d.ts +53 -0
- package/dist/packages/ui/src/themes.d.ts +40 -0
- package/dist/preview-sw.js +53 -12
- package/dist/runtime.d.ts +3 -3
- package/dist/runtime.esm.js +467 -44
- package/dist/runtime.js +465 -44
- package/dist/schemas.d.ts +234 -814
- package/dist/schemas.esm.js +19401 -3725
- package/dist/schemas.js +19404 -3728
- package/dist/scm.d.ts +92 -11
- package/dist/shell.d.ts +1 -1
- package/dist/shell.esm.js +1300 -151
- package/dist/shell.js +1300 -151
- package/dist/storage.d.ts +47 -0
- package/dist/terminal.esm.js +62 -3
- package/dist/terminal.js +62 -3
- package/dist/workbench/diff-editor.d.ts +1 -0
- package/dist/workbench/index.d.ts +1 -1
- package/dist/workbench/styles.d.ts +1 -1
- package/package.json +38 -9
- package/packages/commands/README.md +7 -0
- package/packages/commands/package.json +16 -0
- package/packages/commands/src/index.ts +467 -0
- package/packages/commands/tsconfig.json +22 -0
- package/packages/core/README.md +12 -0
- package/packages/core/package.json +13 -0
- package/packages/core/src/di.ts +147 -0
- package/packages/core/src/disposable.ts +112 -0
- package/packages/core/src/errors.ts +205 -0
- package/packages/core/src/events.ts +157 -0
- package/packages/core/src/index.ts +49 -0
- package/packages/core/src/path.ts +118 -0
- package/packages/core/src/registry.ts +61 -0
- package/packages/core/tsconfig.json +19 -0
- package/packages/editor/README.md +9 -0
- package/packages/editor/package.json +18 -0
- package/packages/editor/src/index.ts +344 -0
- package/packages/editor/tsconfig.json +24 -0
- package/packages/fs/README.md +7 -0
- package/packages/fs/package.json +16 -0
- package/packages/fs/src/backends.ts +301 -0
- package/packages/fs/src/index.ts +18 -0
- package/packages/fs/src/types.ts +44 -0
- package/packages/fs/src/vfs-service.ts +257 -0
- package/packages/fs/tsconfig.json +22 -0
- package/packages/preview/README.md +3 -0
- package/packages/preview/package.json +16 -0
- package/packages/preview/src/index.ts +125 -0
- package/packages/preview/tsconfig.json +22 -0
- package/packages/runtime/README.md +3 -0
- package/packages/runtime/package.json +17 -0
- package/packages/runtime/src/index.ts +134 -0
- package/packages/runtime/tsconfig.json +23 -0
- package/packages/settings/README.md +7 -0
- package/packages/settings/package.json +16 -0
- package/packages/settings/src/builtin-schemas.ts +246 -0
- package/packages/settings/src/configuration-service.ts +609 -0
- package/packages/settings/src/index.ts +38 -0
- package/packages/settings/src/jsonc.ts +189 -0
- package/packages/settings/src/schema.ts +164 -0
- package/packages/settings/tsconfig.json +22 -0
- package/packages/sql/README.md +12 -0
- package/packages/sql/package.json +13 -0
- package/packages/sql/src/completions.ts +359 -0
- package/packages/sql/src/diagnostics.ts +200 -0
- package/packages/sql/src/formatter.ts +271 -0
- package/packages/sql/src/index.ts +54 -0
- package/packages/sql/src/sql-editor.ts +802 -0
- package/packages/sql/src/styles.ts +501 -0
- package/packages/sql/src/tokenizer.ts +457 -0
- package/packages/sql/src/types.ts +148 -0
- package/packages/sql/tsconfig.json +19 -0
- package/packages/terminal/README.md +3 -0
- package/packages/terminal/package.json +16 -0
- package/packages/terminal/src/index.ts +183 -0
- package/packages/terminal/tsconfig.json +22 -0
- package/packages/ui/README.md +8 -0
- package/packages/ui/package.json +18 -0
- package/packages/ui/src/index.ts +40 -0
- package/packages/ui/src/observability.ts +175 -0
- package/packages/ui/src/plugin-registry.ts +289 -0
- package/packages/ui/src/settings-dialog.ts +575 -0
- package/packages/ui/src/themes.ts +267 -0
- package/packages/ui/tsconfig.json +24 -0
- package/src/code-lab.css +1799 -98
- package/src/diagnostics.ts +139 -7
- package/src/extensions/cpp.ts +88 -45
- package/src/extensions/python.ts +186 -53
- package/src/extensions/umbrella.ts +5 -0
- package/src/index.ts +1 -1
- package/src/modular-kernel.ts +11 -0
- package/src/preview-sw.js +52 -11
- package/src/runtime.ts +466 -46
- package/src/schemas.ts +62 -62
- package/src/scm.ts +781 -58
- package/src/shell.ts +1299 -151
- package/src/storage.ts +336 -3
- package/src/terminal.ts +60 -2
- package/src/workbench/diff-editor.ts +66 -6
- package/src/workbench/icons.ts +12 -2
- package/src/workbench/styles.ts +25 -19
- package/src/workbench.ts +17059 -6673
- package/dist/runtime/index.d.ts +0 -4
- package/dist/shell/coreutils/compilers-cli.d.ts +0 -24
- package/dist/shell/index.d.ts +0 -4
- package/src/runtime/index.ts +0 -5
- package/src/shell/coreutils/compilers-cli.ts +0 -103
- package/src/shell/index.ts +0 -5
package/dist/scm.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @innovatorved/code-lab — Interactive Git Source Control (SCM) Engine
|
|
3
3
|
* ============================================================================
|
|
4
|
-
* Pure TypeScript in-browser Git status, staging, unstaging, and
|
|
5
|
-
* backed by workspace VFS state. Powers both the interactive
|
|
6
|
-
* and shell/CLI Git operations.
|
|
4
|
+
* Pure TypeScript in-browser Git status, staging, unstaging, discard, and
|
|
5
|
+
* commit engine backed by workspace VFS state. Powers both the interactive
|
|
6
|
+
* Source Control UI and shell/CLI Git operations with a unified GitState schema.
|
|
7
7
|
*
|
|
8
8
|
* Strict leaf module: fully typed, zero explicit any, zero empty catches.
|
|
9
9
|
*/
|
|
@@ -15,20 +15,50 @@ export interface GitFileStatus {
|
|
|
15
15
|
oldContent?: string;
|
|
16
16
|
newContent?: string;
|
|
17
17
|
}
|
|
18
|
+
export interface GitVfsLike {
|
|
19
|
+
existsSync?(path: string): boolean;
|
|
20
|
+
statSync?(path: string): {
|
|
21
|
+
isDirectory(): boolean;
|
|
22
|
+
};
|
|
23
|
+
readdirSync?(path: string): string[];
|
|
24
|
+
readFileSync?(path: string, encoding?: string): string | Uint8Array;
|
|
25
|
+
writeFileSync?(path: string, data: string): void;
|
|
26
|
+
mkdirSync?(path: string, options?: {
|
|
27
|
+
recursive?: boolean;
|
|
28
|
+
}): unknown;
|
|
29
|
+
unlinkSync?(path: string): void;
|
|
30
|
+
rmSync?(path: string, options?: {
|
|
31
|
+
recursive?: boolean;
|
|
32
|
+
force?: boolean;
|
|
33
|
+
}): void;
|
|
34
|
+
files?: Map<string, unknown>;
|
|
35
|
+
}
|
|
36
|
+
export interface GitShellLike {
|
|
37
|
+
cwd?: string;
|
|
38
|
+
vfs?: GitVfsLike | null;
|
|
39
|
+
gitState?: GitState | null;
|
|
40
|
+
_emitVfsMutation?(type: string, absPath: string): void;
|
|
41
|
+
}
|
|
18
42
|
export interface GitCommitRecord {
|
|
19
43
|
hash: string;
|
|
20
44
|
message: string;
|
|
21
45
|
timestamp: number;
|
|
22
46
|
author?: string;
|
|
23
|
-
|
|
47
|
+
date?: string;
|
|
48
|
+
files?: Record<string, string>;
|
|
24
49
|
}
|
|
25
50
|
export interface GitState {
|
|
51
|
+
initialized?: boolean;
|
|
52
|
+
repoRoot?: string;
|
|
26
53
|
branch: string;
|
|
27
|
-
branches?: string[]
|
|
54
|
+
branches?: string[] | Set<string>;
|
|
55
|
+
remoteUrl?: string | null;
|
|
56
|
+
remotes?: Record<string, string>;
|
|
28
57
|
headCommit: string;
|
|
29
58
|
headFiles: Record<string, string>;
|
|
30
59
|
headSnapshot?: Record<string, string>;
|
|
31
60
|
staged: Map<string, string | null> | Set<string>;
|
|
61
|
+
stagedFiles?: Map<string, string | null>;
|
|
32
62
|
commits: GitCommitRecord[];
|
|
33
63
|
}
|
|
34
64
|
export interface GitStatusEntry {
|
|
@@ -50,14 +80,40 @@ export interface GitStatusResult {
|
|
|
50
80
|
hasChanges: boolean;
|
|
51
81
|
isClean: boolean;
|
|
52
82
|
}
|
|
83
|
+
export interface CreateGitStateOptions {
|
|
84
|
+
initialized?: boolean;
|
|
85
|
+
repoRoot?: string;
|
|
86
|
+
}
|
|
87
|
+
export interface InitRepositoryOptions {
|
|
88
|
+
branch?: string;
|
|
89
|
+
repoRoot?: string;
|
|
90
|
+
snapshotExisting?: boolean;
|
|
91
|
+
initialFiles?: Record<string, string>;
|
|
92
|
+
}
|
|
53
93
|
/**
|
|
54
94
|
* Computes a deterministic 7-character short hash for a commit payload.
|
|
55
95
|
*/
|
|
56
96
|
export declare function computeShortCommitHash(input: string): string;
|
|
97
|
+
export declare function isIgnoredScmPath(relPath: string): boolean;
|
|
98
|
+
export declare function normalizeScmRelPath(rawPath: string, repoRoot?: string): string;
|
|
99
|
+
export declare function isUnbornGitHead(gitState: GitState | null | undefined): boolean;
|
|
100
|
+
export declare function isEffectiveStagedChange(gitState: GitState | null | undefined, relPath: string, stagedVal: string | null | undefined, resolvedHeadFiles?: Record<string, string>): boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Synchronizes `gitState.headFiles` and `gitState.headSnapshot` so both
|
|
103
|
+
* properties reference the exact same clean `Record<string, string>` object.
|
|
104
|
+
*/
|
|
105
|
+
export declare function syncGitHead(gitState: GitState, nextHead?: Record<string, string>): Record<string, string>;
|
|
106
|
+
/**
|
|
107
|
+
* Initializes an in-memory Git repository state from initial VFS files,
|
|
108
|
+
* keeping `headFiles` / `headSnapshot` and `staged` / `stagedFiles` synchronized.
|
|
109
|
+
*/
|
|
110
|
+
export declare function createGitState(initialFiles?: Record<string, string>, branch?: string, options?: CreateGitStateOptions): GitState;
|
|
57
111
|
/**
|
|
58
|
-
* Initializes a
|
|
112
|
+
* Initializes a Git repository on a `PosixShell` (writing `.git/HEAD` & `.git/config`)
|
|
113
|
+
* or directly on a `GitState` object. Defaults `snapshotExisting` to `false` so
|
|
114
|
+
* existing workspace files appear as untracked until staged and committed.
|
|
59
115
|
*/
|
|
60
|
-
export declare function
|
|
116
|
+
export declare function initRepository(target: GitShellLike | GitState, options?: InitRepositoryOptions): GitState;
|
|
61
117
|
/**
|
|
62
118
|
* Computes working-tree and staging-area Git status against `gitState`.
|
|
63
119
|
* Supports both `computeGitStatus(vfsFiles, repoRoot, gitState)` and
|
|
@@ -68,21 +124,46 @@ export declare function computeGitStatus(arg1: Record<string, string> | GitState
|
|
|
68
124
|
* Stages a file addition, modification, or deletion (`currentContent === null`).
|
|
69
125
|
*/
|
|
70
126
|
export declare function stageFile(gitState: GitState, relativePath: string, currentContent: string | null): void;
|
|
127
|
+
/**
|
|
128
|
+
* Stages all modified, untracked (non-ignored), and deleted tracked files.
|
|
129
|
+
*/
|
|
130
|
+
export declare function stageAll(gitState: GitState, vfsFiles: Record<string, string>, repoRoot?: string): void;
|
|
71
131
|
/**
|
|
72
132
|
* Removes a file from the staging index.
|
|
73
133
|
*/
|
|
74
134
|
export declare function unstageFile(gitState: GitState, relativePath: string): void;
|
|
75
135
|
/**
|
|
76
|
-
*
|
|
77
|
-
|
|
136
|
+
* Clears all staged entries from `gitState`.
|
|
137
|
+
*/
|
|
138
|
+
export declare function unstageAll(gitState: GitState): void;
|
|
139
|
+
/**
|
|
140
|
+
* Commits all staged changes to `gitState`, advancing `headCommit` and
|
|
141
|
+
* synchronizing `headFiles` & `headSnapshot`, prepending the new commit record,
|
|
142
|
+
* and clearing the staging area. Throws if message or staging area is empty.
|
|
78
143
|
*/
|
|
79
|
-
export declare function commitChanges(gitState: GitState, message: string): string;
|
|
144
|
+
export declare function commitChanges(gitState: GitState, message: string, author?: string): string;
|
|
145
|
+
/**
|
|
146
|
+
* Discards working-tree (and staged) changes for `filePath`:
|
|
147
|
+
* - If tracked in `HEAD`, restores `headFiles[relPath]` to `shell.vfs` (creating
|
|
148
|
+
* parent directories first) and optional `workspaceFiles`.
|
|
149
|
+
* - If untracked, deletes the file from `shell.vfs` and optional `workspaceFiles`.
|
|
150
|
+
*/
|
|
151
|
+
export declare function discardChanges(shell: GitShellLike, filePath: string, workspaceFiles?: Record<string, string>): boolean;
|
|
80
152
|
declare const _default: {
|
|
153
|
+
computeShortCommitHash: typeof computeShortCommitHash;
|
|
154
|
+
isIgnoredScmPath: typeof isIgnoredScmPath;
|
|
155
|
+
normalizeScmRelPath: typeof normalizeScmRelPath;
|
|
156
|
+
isUnbornGitHead: typeof isUnbornGitHead;
|
|
157
|
+
isEffectiveStagedChange: typeof isEffectiveStagedChange;
|
|
158
|
+
syncGitHead: typeof syncGitHead;
|
|
81
159
|
createGitState: typeof createGitState;
|
|
160
|
+
initRepository: typeof initRepository;
|
|
82
161
|
computeGitStatus: typeof computeGitStatus;
|
|
83
162
|
stageFile: typeof stageFile;
|
|
163
|
+
stageAll: typeof stageAll;
|
|
84
164
|
unstageFile: typeof unstageFile;
|
|
165
|
+
unstageAll: typeof unstageAll;
|
|
85
166
|
commitChanges: typeof commitChanges;
|
|
86
|
-
|
|
167
|
+
discardChanges: typeof discardChanges;
|
|
87
168
|
};
|
|
88
169
|
export default _default;
|
package/dist/shell.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export declare const tokenizeShell: (input: string) => any[];
|
|
|
29
29
|
export declare const PosixShell: any;
|
|
30
30
|
export declare const COREUTILS: Record<string, any>;
|
|
31
31
|
export declare const PosixPath: any;
|
|
32
|
-
export declare const expandGlob: (pattern: string,
|
|
32
|
+
export declare const expandGlob: (pattern: string, cwd: string, vfs: any) => string[];
|
|
33
33
|
export declare const createVirtualPortTable: () => any;
|
|
34
34
|
export declare const parseGitHubRepoUrl: (input: string) => any;
|
|
35
35
|
export declare const cloneGitHubRepository: (repoInput: string, vfs: any, options?: any) => Promise<any>;
|