browser-git-ops 0.0.2 → 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 +291 -92
- package/dist/git/abstractAdapter.d.ts +167 -0
- package/dist/git/abstractAdapter.d.ts.map +1 -0
- package/dist/git/adapter.d.ts +23 -1
- package/dist/git/adapter.d.ts.map +1 -1
- package/dist/git/githubAdapter.d.ts +282 -35
- package/dist/git/githubAdapter.d.ts.map +1 -1
- package/dist/git/gitlabAdapter.d.ts +220 -34
- package/dist/git/gitlabAdapter.d.ts.map +1 -1
- package/dist/index.d.ts +7 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6199 -792
- package/dist/index.js.map +4 -4
- package/dist/index.mjs +6199 -792
- package/dist/index.mjs.map +4 -4
- package/dist/virtualfs/changeTracker.d.ts +66 -0
- package/dist/virtualfs/changeTracker.d.ts.map +1 -0
- package/dist/virtualfs/conflictManager.d.ts +69 -0
- package/dist/virtualfs/conflictManager.d.ts.map +1 -0
- package/dist/virtualfs/hashUtils.d.ts +13 -0
- package/dist/virtualfs/hashUtils.d.ts.map +1 -0
- package/dist/virtualfs/indexManager.d.ts +57 -0
- package/dist/virtualfs/indexManager.d.ts.map +1 -0
- package/dist/virtualfs/indexedDatabaseStorage.d.ts +7 -0
- package/dist/virtualfs/indexedDatabaseStorage.d.ts.map +1 -0
- package/dist/virtualfs/inmemoryStorage.d.ts +8 -0
- package/dist/virtualfs/inmemoryStorage.d.ts.map +1 -0
- package/dist/virtualfs/localChangeApplier.d.ts +21 -0
- package/dist/virtualfs/localChangeApplier.d.ts.map +1 -0
- package/dist/virtualfs/localFileManager.d.ts +58 -0
- package/dist/virtualfs/localFileManager.d.ts.map +1 -0
- package/dist/virtualfs/metadataManager.d.ts +14 -0
- package/dist/virtualfs/metadataManager.d.ts.map +1 -0
- package/dist/virtualfs/opfsStorage.d.ts +2 -63
- package/dist/virtualfs/opfsStorage.d.ts.map +1 -1
- package/dist/virtualfs/remoteSynchronizer.d.ts +192 -0
- package/dist/virtualfs/remoteSynchronizer.d.ts.map +1 -0
- package/dist/virtualfs/storageBackend.d.ts +57 -4
- package/dist/virtualfs/storageBackend.d.ts.map +1 -1
- package/dist/virtualfs/types.d.ts +37 -0
- package/dist/virtualfs/types.d.ts.map +1 -1
- package/dist/virtualfs/virtualfs.d.ts +454 -87
- package/dist/virtualfs/virtualfs.d.ts.map +1 -1
- package/package.json +30 -13
- package/dist/virtualfs/indexedDbStorage.d.ts +0 -62
- package/dist/virtualfs/indexedDbStorage.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "browser-git-ops",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"type": "
|
|
3
|
+
"version": "0.0.5",
|
|
4
|
+
"type": "module",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -14,7 +14,14 @@
|
|
|
14
14
|
"url": "https://github.com/nojaja/browser-git-ops/issues"
|
|
15
15
|
},
|
|
16
16
|
"homepage": "https://github.com/nojaja/browser-git-ops#readme",
|
|
17
|
-
"keywords": [
|
|
17
|
+
"keywords": [
|
|
18
|
+
"virtualfs",
|
|
19
|
+
"git",
|
|
20
|
+
"github",
|
|
21
|
+
"gitlab",
|
|
22
|
+
"vfs",
|
|
23
|
+
"apigit"
|
|
24
|
+
],
|
|
18
25
|
"author": "nojaja <free.riccia@gmail.com> (https://github.com/nojaja)",
|
|
19
26
|
"license": "MIT",
|
|
20
27
|
"files": [
|
|
@@ -30,31 +37,41 @@
|
|
|
30
37
|
}
|
|
31
38
|
},
|
|
32
39
|
"scripts": {
|
|
33
|
-
"test": "node --experimental-vm-modules ./node_modules/jest/bin/jest.js --runInBand",
|
|
40
|
+
"test": "node --experimental-vm-modules ./node_modules/jest/bin/jest.js --coverage --coverageReporters=json --runInBand --config jest.config.cjs",
|
|
41
|
+
"test:spec": "node --experimental-vm-modules ./node_modules/jest/bin/jest.js -c jest.spec.config.cjs",
|
|
42
|
+
"test:coverage": "node --experimental-vm-modules ./node_modules/jest/bin/jest.js -c jest.coverage.config.cjs",
|
|
34
43
|
"pretest:e2e": "npm run build",
|
|
35
44
|
"test:e2e": "playwright test --config=playwright.config.cjs",
|
|
36
45
|
"test:ci": "node --experimental-vm-modules ./node_modules/jest/bin/jest.js --coverage --runInBand",
|
|
37
|
-
"
|
|
46
|
+
"migrate:tests": "node ./scripts/migrate-tests.js",
|
|
47
|
+
"lint": "eslint \"src/**/*.{ts,js}\"",
|
|
48
|
+
"lint2": "eslint \"src/**/*.{ts,js}\" --config .eslintrc.cjs --rule \"unicorn/prevent-abbreviations:off\" --rule \"unicorn/filename-case:off\" --rule \"unicorn/prefer-early-return:off\" --rule \"unicorn/no-duplicated-branches:off\"",
|
|
38
49
|
"depcruise": "depcruise --config .dependency-cruiser.cjs src || exit 0",
|
|
39
50
|
"build:types": "tsc -p tsconfig.json --emitDeclarationOnly",
|
|
40
51
|
"build:browser": "esbuild ./src/index.ts --bundle --outfile=dist/index.js --format=iife --global-name=APIGitLib --platform=browser --sourcemap",
|
|
41
52
|
"build:browser:esm": "esbuild ./src/index.ts --bundle --outfile=dist/index.mjs --format=esm --platform=browser --sourcemap",
|
|
42
|
-
"build": "npm run build:
|
|
53
|
+
"build": "npm run build:browser && npm run build:browser:esm && npm run build:types",
|
|
54
|
+
"docs": "typedoc --options typedoc.json && npx depcruise --config .dependency-cruiser.cjs src --output-type dot > ./docs/dependency-cruiser.dot"
|
|
43
55
|
},
|
|
44
56
|
"devDependencies": {
|
|
45
57
|
"@playwright/test": "^1.40.0",
|
|
58
|
+
"@regru/eslint-plugin-prefer-early-return": "^1.0.0",
|
|
46
59
|
"@types/jest": "^29.5.2",
|
|
47
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
48
|
-
"@typescript-eslint/parser": "^
|
|
60
|
+
"@typescript-eslint/eslint-plugin": "^7.0.0",
|
|
61
|
+
"@typescript-eslint/parser": "^7.0.0",
|
|
49
62
|
"dependency-cruiser": "^17.3.6",
|
|
50
|
-
"
|
|
63
|
+
"esbuild": "^0.18.17",
|
|
64
|
+
"eslint": "^8.56.0",
|
|
51
65
|
"eslint-plugin-jsdoc": "^62.1.0",
|
|
52
66
|
"eslint-plugin-sonarjs": "^0.16.0",
|
|
67
|
+
"eslint-plugin-unicorn": "^47.0.0",
|
|
68
|
+
"fake-indexeddb": "^3.1.7",
|
|
69
|
+
"http-server": "^14.1.1",
|
|
53
70
|
"jest": "^29.6.1",
|
|
71
|
+
"opfs-mock": "^2.5.1",
|
|
54
72
|
"ts-jest": "^29.1.0",
|
|
55
|
-
"typedoc": "
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"http-server": "^14.1.1"
|
|
73
|
+
"typedoc": "0.25.13",
|
|
74
|
+
"typedoc-plugin-markdown": "^3.17.1",
|
|
75
|
+
"typescript": "5.3.3"
|
|
59
76
|
}
|
|
60
77
|
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { IndexFile } from './types';
|
|
2
|
-
import { StorageBackend } from './storageBackend';
|
|
3
|
-
/**
|
|
4
|
-
* IndexedDB を用いた永続化実装
|
|
5
|
-
*/
|
|
6
|
-
export declare class IndexedDbStorage implements StorageBackend {
|
|
7
|
-
/**
|
|
8
|
-
* 環境に IndexedDB が存在するかを同期検査します。
|
|
9
|
-
* @returns {boolean} 利用可能なら true
|
|
10
|
-
*/
|
|
11
|
-
static canUse(): boolean;
|
|
12
|
-
private dbName;
|
|
13
|
-
private dbPromise;
|
|
14
|
-
/** コンストラクタ */
|
|
15
|
-
constructor();
|
|
16
|
-
/**
|
|
17
|
-
* 初期化: DB をオープンするまで待つ
|
|
18
|
-
* @returns {Promise<void>} 初期化完了時に解決
|
|
19
|
-
*/
|
|
20
|
-
init(): Promise<void>;
|
|
21
|
-
/**
|
|
22
|
-
* DB を開いて objectStore を初期化する
|
|
23
|
-
* @returns {Promise<IDBDatabase>} Opened IDBDatabase
|
|
24
|
-
*/
|
|
25
|
-
private openDb;
|
|
26
|
-
/**
|
|
27
|
-
* トランザクションラッパー。cb 内の処理をトランザクションで実行し、
|
|
28
|
-
* 必要なら再試行します。
|
|
29
|
-
*/
|
|
30
|
-
/**
|
|
31
|
-
* トランザクションラッパー。cb 内の処理をトランザクションで実行し、必要なら再試行します。
|
|
32
|
-
* @returns {Promise<void>} トランザクション処理完了時に解決
|
|
33
|
-
*/
|
|
34
|
-
private tx;
|
|
35
|
-
/**
|
|
36
|
-
* index を読み出す
|
|
37
|
-
* @returns {Promise<IndexFile|null>} 読み出した IndexFile、存在しなければ null
|
|
38
|
-
*/
|
|
39
|
-
readIndex(): Promise<IndexFile | null>;
|
|
40
|
-
/**
|
|
41
|
-
* index を書き込む
|
|
42
|
-
* @returns {Promise<void>} 書込完了時に解決
|
|
43
|
-
*/
|
|
44
|
-
writeIndex(index: IndexFile): Promise<void>;
|
|
45
|
-
/**
|
|
46
|
-
* blob を書き込む
|
|
47
|
-
* @returns {Promise<void>} 書込完了時に解決
|
|
48
|
-
*/
|
|
49
|
-
writeBlob(filepath: string, content: string): Promise<void>;
|
|
50
|
-
/**
|
|
51
|
-
* blob を読み出す
|
|
52
|
-
* @returns {Promise<string|null>} ファイル内容、存在しなければ null
|
|
53
|
-
*/
|
|
54
|
-
readBlob(filepath: string): Promise<string | null>;
|
|
55
|
-
/**
|
|
56
|
-
* blob を削除する
|
|
57
|
-
* @returns {Promise<void>} 削除完了時に解決
|
|
58
|
-
*/
|
|
59
|
-
deleteBlob(filepath: string): Promise<void>;
|
|
60
|
-
}
|
|
61
|
-
export default IndexedDbStorage;
|
|
62
|
-
//# sourceMappingURL=indexedDbStorage.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"indexedDbStorage.d.ts","sourceRoot":"","sources":["../../src/virtualfs/indexedDbStorage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEjD;;GAEG;AACH,qBAAa,gBAAiB,YAAW,cAAc;IACrD;;;OAGG;IACH,MAAM,CAAC,MAAM,IAAI,OAAO;IAOxB,OAAO,CAAC,MAAM,CAAmB;IACjC,OAAO,CAAC,SAAS,CAAsB;IAEvC,cAAc;;IAKd;;;OAGG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3B;;;OAGG;IACH,OAAO,CAAC,MAAM;IAkDd;;;OAGG;IACH;;;OAGG;YACW,EAAE;IAkChB;;;OAGG;IACG,SAAS,IAAI,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;IAkB5C;;;OAGG;IACG,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjD;;;OAGG;IACG,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjE;;;OAGG;IACG,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAkBxD;;;OAGG;IACG,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGlD;AAED,eAAe,gBAAgB,CAAA"}
|