browser-git-ops 0.0.4 → 0.0.5
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/README.md +292 -67
- package/dist/git/abstractAdapter.d.ts +0 -16
- package/dist/git/abstractAdapter.d.ts.map +1 -1
- package/dist/git/githubAdapter.d.ts +2 -74
- package/dist/git/githubAdapter.d.ts.map +1 -1
- package/dist/git/gitlabAdapter.d.ts +3 -94
- package/dist/git/gitlabAdapter.d.ts.map +1 -1
- package/dist/index.js +658 -420
- package/dist/index.js.map +2 -2
- package/dist/index.mjs +658 -420
- package/dist/index.mjs.map +2 -2
- package/dist/virtualfs/indexedDatabaseStorage.d.ts.map +1 -1
- package/dist/virtualfs/inmemoryStorage.d.ts.map +1 -1
- package/dist/virtualfs/metadataManager.d.ts +0 -4
- package/dist/virtualfs/metadataManager.d.ts.map +1 -1
- package/dist/virtualfs/opfsStorage.d.ts.map +1 -1
- package/dist/virtualfs/remoteSynchronizer.d.ts +3 -3
- package/dist/virtualfs/storageBackend.d.ts +2 -2
- package/dist/virtualfs/storageBackend.d.ts.map +1 -1
- package/dist/virtualfs/virtualfs.d.ts +190 -27
- package/dist/virtualfs/virtualfs.d.ts.map +1 -1
- package/package.json +5 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indexedDatabaseStorage.d.ts","sourceRoot":"","sources":["../../src/virtualfs/indexedDatabaseStorage.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,yBAAyB,EAAW,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"indexedDatabaseStorage.d.ts","sourceRoot":"","sources":["../../src/virtualfs/indexedDatabaseStorage.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,yBAAyB,EAAW,MAAM,qBAAqB,CAAA;AAExF;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,yBAy8BpC,CAAA;AAED,eAAe,sBAAsB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inmemoryStorage.d.ts","sourceRoot":"","sources":["../../src/virtualfs/inmemoryStorage.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAQ/E;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"inmemoryStorage.d.ts","sourceRoot":"","sources":["../../src/virtualfs/inmemoryStorage.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAQ/E;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,yBAynB7B,CAAA;AAED,eAAe,eAAe,CAAA"}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Update in-memory info metadata when a blob is written to a segment.
|
|
3
|
-
* This is a best-effort helper used by `InMemoryStorage` for tests.
|
|
4
|
-
*/
|
|
5
1
|
/**
|
|
6
2
|
* Update in-memory info metadata when a blob is written to a segment.
|
|
7
3
|
* @param store in-memory store object
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadataManager.d.ts","sourceRoot":"","sources":["../../src/virtualfs/metadataManager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"metadataManager.d.ts","sourceRoot":"","sources":["../../src/virtualfs/metadataManager.ts"],"names":[],"mappings":"AAuLA;;;;;;;GAOG;AACH,wBAAsB,kBAAkB,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAqBlH;;;;AAgBD,wBAAqC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"opfsStorage.d.ts","sourceRoot":"","sources":["../../src/virtualfs/opfsStorage.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAW/E,mDAAmD;AACnD,eAAO,MAAM,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"opfsStorage.d.ts","sourceRoot":"","sources":["../../src/virtualfs/opfsStorage.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAW/E,mDAAmD;AACnD,eAAO,MAAM,WAAW,EAAE,yBA64BzB,CAAA;AAED,eAAe,WAAW,CAAA"}
|
|
@@ -140,13 +140,13 @@ export declare class RemoteSynchronizer {
|
|
|
140
140
|
/**
|
|
141
141
|
* Read and parse the stored info entry for `path`.
|
|
142
142
|
* Returns parsed object or null when missing/invalid.
|
|
143
|
-
|
|
143
|
+
* @returns {Promise<any|null>} parsed object or null
|
|
144
144
|
*/
|
|
145
145
|
private _readInfoEntry;
|
|
146
146
|
/**
|
|
147
147
|
* Attempt to fetch base content using adapterInstance.getBlob.
|
|
148
148
|
* Returns string when fetched, null when fetch attempted but failed, or undefined when adapter not supported.
|
|
149
|
-
|
|
149
|
+
* @returns {Promise<string|null|undefined>} fetched content, null, or undefined
|
|
150
150
|
*/
|
|
151
151
|
private _tryFetchBaseWithAdapter;
|
|
152
152
|
/**
|
|
@@ -158,7 +158,7 @@ export declare class RemoteSynchronizer {
|
|
|
158
158
|
/**
|
|
159
159
|
* Attempt to fetch raw file using adapterInstance._fetchFileRaw if available.
|
|
160
160
|
* Returns string when fetched, null when attempted but failed, or undefined when adapter not supported.
|
|
161
|
-
|
|
161
|
+
* @returns {Promise<string|null|undefined>} fetched content, null, or undefined
|
|
162
162
|
*/
|
|
163
163
|
private _tryFetchRawFile;
|
|
164
164
|
/**
|
|
@@ -82,7 +82,7 @@ export interface StorageBackendConstructor {
|
|
|
82
82
|
* コンストラクタ。ルートパスやDB名などのオプション引数を受け取れるようにする。
|
|
83
83
|
* 実装側はこの引数を利用して初期化を行うことができます。
|
|
84
84
|
*/
|
|
85
|
-
new (_root?: string): StorageBackend;
|
|
85
|
+
new (_namespace: string, _root?: string): StorageBackend;
|
|
86
86
|
/**
|
|
87
87
|
* このストレージ実装が利用可能かどうかを返す(例: 環境依存のチェック)。
|
|
88
88
|
*/
|
|
@@ -91,7 +91,7 @@ export interface StorageBackendConstructor {
|
|
|
91
91
|
* このストレージ実装で利用可能なルートパスあるいはDB名の一覧を返す。
|
|
92
92
|
* 例えばローカルFS実装ならベースディレクトリ名、IndexedDB実装ならDB名候補を返す等。
|
|
93
93
|
*/
|
|
94
|
-
availableRoots(): string[] | Promise<string[]>;
|
|
94
|
+
availableRoots(_namespace: string): string[] | Promise<string[]>;
|
|
95
95
|
}
|
|
96
96
|
export default StorageBackend;
|
|
97
97
|
//# sourceMappingURL=storageBackend.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storageBackend.d.ts","sourceRoot":"","sources":["../../src/virtualfs/storageBackend.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAEtC;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,WAAW,GAAG,MAAM,GAAG,UAAU,GAAG,cAAc,GAAG,MAAM,GAAG,gBAAgB,GAAG,UAAU,CAAA;AAEjH;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"storageBackend.d.ts","sourceRoot":"","sources":["../../src/virtualfs/storageBackend.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAEtC;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,WAAW,GAAG,MAAM,GAAG,UAAU,GAAG,cAAc,GAAG,MAAM,GAAG,gBAAgB,GAAG,UAAU,CAAA;AAEjH;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IAErB;;;OAGG;IACH,SAAS,IAAI,OAAO,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E,MAAM,GAAG,cAAc,CAAA;IAEvD;;OAEG;IACH,MAAM,IAAI,OAAO,CAAA;IAEjB;;;OAGG;IACH,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA;CACjE;AAED,eAAe,cAAc,CAAA"}
|
|
@@ -51,18 +51,6 @@ export declare class VirtualFS {
|
|
|
51
51
|
* @returns {void}
|
|
52
52
|
*/
|
|
53
53
|
set lastCommitKey(k: string | undefined);
|
|
54
|
-
/**
|
|
55
|
-
* SHA-1 helper wrapper (delegates to ./hashUtils)
|
|
56
|
-
* @param {string} content - ハッシュ対象の文字列
|
|
57
|
-
* @returns {Promise<string>} SHA-1 ハッシュの16進表現
|
|
58
|
-
*/
|
|
59
|
-
shaOf(content: string): Promise<string>;
|
|
60
|
-
/**
|
|
61
|
-
* SHA helper for Git blob formatting
|
|
62
|
-
* @param {string} content - blob コンテンツ
|
|
63
|
-
* @returns {Promise<string>} SHA-1 ハッシュの16進表現(git blob 用)
|
|
64
|
-
*/
|
|
65
|
-
shaOfGitBlob(content: string): Promise<string>;
|
|
66
54
|
/**
|
|
67
55
|
* VirtualFS の初期化を行います(バックエンド初期化と index 読み込み)。
|
|
68
56
|
* @returns {Promise<void>}
|
|
@@ -114,6 +102,134 @@ export declare class VirtualFS {
|
|
|
114
102
|
* @returns {any|null}
|
|
115
103
|
*/
|
|
116
104
|
private _instantiateAdapter;
|
|
105
|
+
/**
|
|
106
|
+
* Helper: obtain backend listFilesRaw in a safe manner.
|
|
107
|
+
* @returns {Promise<any[]>}
|
|
108
|
+
*/
|
|
109
|
+
private _getBackendFilesRaw;
|
|
110
|
+
/**
|
|
111
|
+
* Helper: apply parsed info text into stats object when possible.
|
|
112
|
+
* @param infoTxt raw info text
|
|
113
|
+
* @param stats stats object to mutate
|
|
114
|
+
* @returns {void}
|
|
115
|
+
*/
|
|
116
|
+
private _applyInfoTxtToStats;
|
|
117
|
+
/**
|
|
118
|
+
* Find a matched backend entry for the given filepath.
|
|
119
|
+
* @param filepath target filepath
|
|
120
|
+
* @param filesRaw backend raw listing
|
|
121
|
+
* @returns {any|null}
|
|
122
|
+
*/
|
|
123
|
+
private _findMatchedFile;
|
|
124
|
+
/**
|
|
125
|
+
* Create default stats object with consistent shape.
|
|
126
|
+
* @param now current Date
|
|
127
|
+
* @returns {any}
|
|
128
|
+
*/
|
|
129
|
+
private _createDefaultStats;
|
|
130
|
+
/**
|
|
131
|
+
* Populate stats.gitCommitSha from adapterMeta if available.
|
|
132
|
+
* @param stats stats object to mutate
|
|
133
|
+
* @returns {void}
|
|
134
|
+
*/
|
|
135
|
+
private _populateCommitShaFromMeta;
|
|
136
|
+
/**
|
|
137
|
+
* Try to resolve commit SHA from an instantiated adapter when needed.
|
|
138
|
+
* @param stats stats object to mutate
|
|
139
|
+
* @returns {Promise<void>}
|
|
140
|
+
*/
|
|
141
|
+
private _resolveCommitShaFromAdapter;
|
|
142
|
+
/**
|
|
143
|
+
* Safely get adapter instance, returning null on error.
|
|
144
|
+
* @returns {Promise<any|null>}
|
|
145
|
+
*/
|
|
146
|
+
private _safeGetAdapterInstance;
|
|
147
|
+
/**
|
|
148
|
+
* Helper: populate stats.gitCommitSha using adapterMeta or adapter.resolveRef when available.
|
|
149
|
+
* @param stats stats object to mutate
|
|
150
|
+
* @returns {Promise<void>}
|
|
151
|
+
*/
|
|
152
|
+
private _resolveAdapterCommitShaIfNeeded;
|
|
153
|
+
/**
|
|
154
|
+
* Determine whether a normalized path is an exact file entry in the provided entries.
|
|
155
|
+
* @param normalizedDirectory normalized directory string
|
|
156
|
+
* @param keys index keys array
|
|
157
|
+
* @param entries index entries object
|
|
158
|
+
* @returns {boolean}
|
|
159
|
+
*/
|
|
160
|
+
private _isExactFile;
|
|
161
|
+
/**
|
|
162
|
+
* Collect immediate child names from index entries for given directory.
|
|
163
|
+
* @param normalizedDirectory normalized directory string
|
|
164
|
+
* @param entries index entries object
|
|
165
|
+
* @returns {Set<string>} set of immediate child names
|
|
166
|
+
*/
|
|
167
|
+
private _collectNamesFromIndex;
|
|
168
|
+
/**
|
|
169
|
+
* Process a single index key for a non-root directory and add immediate child when applicable.
|
|
170
|
+
* @param key index key
|
|
171
|
+
* @param normalizedDirectory normalized directory string
|
|
172
|
+
* @param outNames set to mutate
|
|
173
|
+
* @returns {void}
|
|
174
|
+
*/
|
|
175
|
+
private _processIndexKeyForDirectory;
|
|
176
|
+
/**
|
|
177
|
+
* Safe wrapper for backend.listFiles returning [] on failure.
|
|
178
|
+
* @param normalizedDirectory directory path
|
|
179
|
+
* @returns {Promise<any[]>}
|
|
180
|
+
*/
|
|
181
|
+
private _getBackendList;
|
|
182
|
+
/**
|
|
183
|
+
* Helper for collecting names when scanning root directory entries.
|
|
184
|
+
* @param key index key
|
|
185
|
+
* @param outNames set to mutate
|
|
186
|
+
* @returns {void}
|
|
187
|
+
*/
|
|
188
|
+
private _collectNamesFromIndexRoot;
|
|
189
|
+
/**
|
|
190
|
+
* Check whether normalizedDirectory corresponds to an exact file entry.
|
|
191
|
+
* @param normalizedDirectory normalized directory string
|
|
192
|
+
* @param entries index entries object
|
|
193
|
+
* @returns {boolean}
|
|
194
|
+
*/
|
|
195
|
+
private _hasExactEntry;
|
|
196
|
+
/**
|
|
197
|
+
* Consult backend.listFiles to collect immediate child names for given directory.
|
|
198
|
+
* Best-effort: logs and returns empty set on failure.
|
|
199
|
+
* @param normalizedDirectory normalized directory string
|
|
200
|
+
* @returns {Promise<Set<string>>}
|
|
201
|
+
*/
|
|
202
|
+
private _collectNamesFromBackend;
|
|
203
|
+
/**
|
|
204
|
+
* Return true when backend supports listFiles
|
|
205
|
+
* @returns {boolean}
|
|
206
|
+
*/
|
|
207
|
+
private _backendSupportsListFiles;
|
|
208
|
+
/**
|
|
209
|
+
* Process a single backend listFiles entry and add immediate child name to outNames when applicable.
|
|
210
|
+
* @param it backend entry
|
|
211
|
+
* @param normalizedDirectory normalized directory string
|
|
212
|
+
* @param outNames set to mutate
|
|
213
|
+
* @returns {void}
|
|
214
|
+
*/
|
|
215
|
+
private _processBackendEntry;
|
|
216
|
+
/**
|
|
217
|
+
* Build Dirent-like lightweight objects for given names.
|
|
218
|
+
* @param names array of names
|
|
219
|
+
* @param keys array of index keys
|
|
220
|
+
* @param entries index entries object
|
|
221
|
+
* @param normalizedDirectory normalized directory string
|
|
222
|
+
* @returns {Array<any>} array of Dirent-like objects
|
|
223
|
+
*/
|
|
224
|
+
private _buildDirentTypes;
|
|
225
|
+
/**
|
|
226
|
+
* Determine whether a childPath corresponds to a file, directory, or both.
|
|
227
|
+
* @param childPath path of child
|
|
228
|
+
* @param keys index keys
|
|
229
|
+
* @param entries index entries
|
|
230
|
+
* @returns {{isFile:boolean,isDirectory:boolean}}
|
|
231
|
+
*/
|
|
232
|
+
private _determineChildType;
|
|
117
233
|
/**
|
|
118
234
|
* Return persisted adapter metadata (if any).
|
|
119
235
|
* @returns {any|null}
|
|
@@ -126,12 +242,6 @@ export declare class VirtualFS {
|
|
|
126
242
|
* @returns {Promise<void>}
|
|
127
243
|
*/
|
|
128
244
|
writeFile(filepath: string, content: string): Promise<void>;
|
|
129
|
-
/**
|
|
130
|
-
* ファイルを削除します(トゥームストーン作成を含む)。
|
|
131
|
-
* @param {string} filepath ファイルパス
|
|
132
|
-
* @returns {Promise<void>}
|
|
133
|
-
*/
|
|
134
|
-
deleteFile(filepath: string): Promise<void>;
|
|
135
245
|
/**
|
|
136
246
|
* rename を delete + create の合成で行うヘルパ
|
|
137
247
|
* @param from 元パス
|
|
@@ -150,6 +260,64 @@ export declare class VirtualFS {
|
|
|
150
260
|
* @returns {Promise<string|null>} ファイル内容または null
|
|
151
261
|
*/
|
|
152
262
|
readConflict(filepath: string): Promise<string | null>;
|
|
263
|
+
/**
|
|
264
|
+
* fs.stat 互換: 指定ファイルのメタ情報を返す
|
|
265
|
+
* ワークスペース上の情報を優先し、未取得時は Git のメタ情報で補完する。
|
|
266
|
+
* @returns {Promise<any>} stats オブジェクト
|
|
267
|
+
*/
|
|
268
|
+
stat(filepath: string): Promise<any>;
|
|
269
|
+
/**
|
|
270
|
+
* fs.unlink 互換: ファイルを削除する
|
|
271
|
+
*/
|
|
272
|
+
unlink(filepath: string): Promise<void>;
|
|
273
|
+
/**
|
|
274
|
+
* fs.mkdir 互換 (簡易実装): workspace 側にディレクトリ情報を書き込む
|
|
275
|
+
*/
|
|
276
|
+
mkdir(dirpath: string, _options?: {
|
|
277
|
+
recursive?: boolean;
|
|
278
|
+
mode?: number;
|
|
279
|
+
}): Promise<void>;
|
|
280
|
+
/**
|
|
281
|
+
* fs.rmdir 互換 (簡易実装)
|
|
282
|
+
*/
|
|
283
|
+
rmdir(dirpath: string, options?: {
|
|
284
|
+
recursive?: boolean;
|
|
285
|
+
}): Promise<void>;
|
|
286
|
+
/**
|
|
287
|
+
* Return list of child paths for given dirpath based on index entries.
|
|
288
|
+
* @param dirpath directory path
|
|
289
|
+
* @returns {Promise<string[]>}
|
|
290
|
+
*/
|
|
291
|
+
private _listChildrenOfDir;
|
|
292
|
+
/**
|
|
293
|
+
* Delete array of children using localFileManager, logging failures per-child.
|
|
294
|
+
* @param children array of paths
|
|
295
|
+
* @returns {Promise<void>}
|
|
296
|
+
*/
|
|
297
|
+
private _deleteChildrenRecursive;
|
|
298
|
+
/**
|
|
299
|
+
* fs.readdir 互換 (簡易実装)
|
|
300
|
+
* @returns {Promise<string[]|Array<any>>}
|
|
301
|
+
*/
|
|
302
|
+
readdir(dirpath: string, options?: {
|
|
303
|
+
withFileTypes?: boolean;
|
|
304
|
+
}): Promise<any[]>;
|
|
305
|
+
/**
|
|
306
|
+
* Return an empty array when names is empty according to options, else null to continue.
|
|
307
|
+
* @param names array of names
|
|
308
|
+
* @param options readdir options
|
|
309
|
+
* @returns {Array<any>|null}
|
|
310
|
+
*/
|
|
311
|
+
private _returnIfNoNames;
|
|
312
|
+
/**
|
|
313
|
+
* Gather immediate child names for a directory using index and backend as fallback.
|
|
314
|
+
* Throws ENOTDIR when the path represents a file.
|
|
315
|
+
* @param dirpath original directory path
|
|
316
|
+
* @param entries index entries object
|
|
317
|
+
* @param keys array of index keys
|
|
318
|
+
* @returns {Promise<string[]>} immediate child names
|
|
319
|
+
*/
|
|
320
|
+
private _gatherDirectoryNames;
|
|
153
321
|
/**
|
|
154
322
|
* 指定パスのリモート衝突ファイル (.git-conflict/) を削除して
|
|
155
323
|
* 競合を解消済とマークします。
|
|
@@ -163,7 +331,7 @@ export declare class VirtualFS {
|
|
|
163
331
|
* @param {string} headSha リモート HEAD
|
|
164
332
|
* @returns {Promise<void>}
|
|
165
333
|
*/
|
|
166
|
-
applyBaseSnapshot
|
|
334
|
+
private applyBaseSnapshot;
|
|
167
335
|
/**
|
|
168
336
|
* 指定エラーが non-fast-forward を示すか判定します。
|
|
169
337
|
* @param {any} err 例外オブジェクト
|
|
@@ -179,7 +347,7 @@ export declare class VirtualFS {
|
|
|
179
347
|
* 登録されているパス一覧を返します。
|
|
180
348
|
* @returns {string[]}
|
|
181
349
|
*/
|
|
182
|
-
listPaths
|
|
350
|
+
private listPaths;
|
|
183
351
|
/**
|
|
184
352
|
* ワークスペースとインデックスから変更セットを生成します。
|
|
185
353
|
* @returns {Promise<Array<{type:string,path:string,content?:string,baseSha?:string}>>} 変更リスト
|
|
@@ -251,7 +419,7 @@ export declare class VirtualFS {
|
|
|
251
419
|
/**
|
|
252
420
|
* Persist the requested branch into adapter metadata (best-effort).
|
|
253
421
|
* @param {string} branch branch name to persist
|
|
254
|
-
|
|
422
|
+
* @returns {Promise<void>}
|
|
255
423
|
*/
|
|
256
424
|
private _persistAdapterBranchMeta;
|
|
257
425
|
/**
|
|
@@ -328,7 +496,7 @@ export declare class VirtualFS {
|
|
|
328
496
|
/**
|
|
329
497
|
* Convenience to get default branch name from adapter repository metadata.
|
|
330
498
|
* Returns null when adapter not available.
|
|
331
|
-
|
|
499
|
+
* @returns {Promise<string|null>}
|
|
332
500
|
*/
|
|
333
501
|
getDefaultBranch(): Promise<string | null>;
|
|
334
502
|
/**
|
|
@@ -337,11 +505,6 @@ export declare class VirtualFS {
|
|
|
337
505
|
* @returns {Promise<void>}
|
|
338
506
|
*/
|
|
339
507
|
private _persistRepositoryMetadata;
|
|
340
|
-
/**
|
|
341
|
-
* Normalize a resolved descriptor (string headSha or object) into a
|
|
342
|
-
* RemoteSnapshotDescriptor or null. Helper to reduce cognitive complexity.
|
|
343
|
-
* @returns {Promise<RemoteSnapshotDescriptor|null>} 正規化された descriptor または null
|
|
344
|
-
*/
|
|
345
508
|
/**
|
|
346
509
|
* Try persisting repository metadata when available. Best-effort.
|
|
347
510
|
* @param instAdapter adapter instance or null
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtualfs.d.ts","sourceRoot":"","sources":["../../src/virtualfs/virtualfs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAIpD,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAClD,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAC9E,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAsB,MAAM,YAAY,CAAA;AASrF,KAAK,wBAAwB,GAAG;IAC9B,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC5B,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CACpE,CAAA;AAED,sDAAsD;AACtD,qBAAa,SAAS;IAEpB,OAAO,CAAC,OAAO,CAAmB;IAElC,OAAO,CAAC,MAAM,CAAC,CAAQ;IAEvB,OAAO,CAAC,WAAW,CAAmB;IAGtC,OAAO,CAAC,YAAY,CAAc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C;QAAC,KAAK,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAwB5G;;;;;OAKG;IACG,WAAW,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAQxE;;;;OAIG;IACG,YAAY,CAAC,KAAK,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC;IAapE;;;;OAIG;IACG,YAAY,CAAC,KAAK,EAAE,OAAO,YAAY,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,YAAY,EAAE,kBAAkB,CAAC;IAgBnH;;;;;;;OAOG;YACW,wBAAwB;IAoBtC;;;;OAIG;YACW,4BAA4B;IAc1C;;;;OAIG;IACG,gBAAgB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAahD;;;;OAIG;YACW,0BAA0B;IAexC;;;;;OAKG;YACW,+BAA+B;IAa7C;;;;OAIG;YACW,8BAA8B;IAW5C;;;;;OAKG;YACW,uBAAuB;IAWrC;;;;;;;OAOG;YACW,kBAAkB;IAsBhC;;;OAGG;YACW,iCAAiC;IAW/C;;;;OAIG;IACG,IAAI,CAAC,KAAK,EAAE,OAAO,YAAY,EAAE,WAAW;;;IAyBlD;;;OAGG;YACW,gBAAgB;CAY/B;AAED,eAAe,SAAS,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "browser-git-ops",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"virtualfs",
|
|
19
19
|
"git",
|
|
20
20
|
"github",
|
|
21
|
+
"gitlab",
|
|
21
22
|
"vfs",
|
|
22
23
|
"apigit"
|
|
23
24
|
],
|
|
@@ -50,7 +51,7 @@
|
|
|
50
51
|
"build:browser": "esbuild ./src/index.ts --bundle --outfile=dist/index.js --format=iife --global-name=APIGitLib --platform=browser --sourcemap",
|
|
51
52
|
"build:browser:esm": "esbuild ./src/index.ts --bundle --outfile=dist/index.mjs --format=esm --platform=browser --sourcemap",
|
|
52
53
|
"build": "npm run build:browser && npm run build:browser:esm && npm run build:types",
|
|
53
|
-
"docs": "typedoc --options typedoc.json && npx depcruise src --output-type dot > ./docs/dependency-cruiser.dot"
|
|
54
|
+
"docs": "typedoc --options typedoc.json && npx depcruise --config .dependency-cruiser.cjs src --output-type dot > ./docs/dependency-cruiser.dot"
|
|
54
55
|
},
|
|
55
56
|
"devDependencies": {
|
|
56
57
|
"@playwright/test": "^1.40.0",
|
|
@@ -69,8 +70,8 @@
|
|
|
69
70
|
"jest": "^29.6.1",
|
|
70
71
|
"opfs-mock": "^2.5.1",
|
|
71
72
|
"ts-jest": "^29.1.0",
|
|
72
|
-
"typedoc": "
|
|
73
|
-
"typedoc-plugin-markdown": "^
|
|
73
|
+
"typedoc": "0.25.13",
|
|
74
|
+
"typedoc-plugin-markdown": "^3.17.1",
|
|
74
75
|
"typescript": "5.3.3"
|
|
75
76
|
}
|
|
76
77
|
}
|