diff --git a/dev-scripts/build-extension.sh b/dev-scripts/build-extension.sh index 3071029..cbac9a2 100755 --- a/dev-scripts/build-extension.sh +++ b/dev-scripts/build-extension.sh @@ -6,4 +6,8 @@ tsc mkdir -p scripts/altcha cp -r node_modules/altcha/dist_external scripts/altcha/ + +mkdir -p scripts/indexeddb-promise +cp node_modules/@coderundebug/indexeddb-promise/* scripts/indexeddb-promise + zip -r package.zip icons/ pages/ scripts/ styles/ manifest.json diff --git a/package.json b/package.json index 96dd0ea..5e4b1ec 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { "dependencies": { + "@coderundebug/indexeddb-promise": "git+https://github.com/StephenHassall/indexeddb-promise.git", "altcha": "^2.2.4" }, "devDependencies": { @@ -13,5 +14,6 @@ "build": "dev-scripts/build-extension.sh", "pretest": "tsc", "test": "xvfb-run -a jasmine-browser-runner runSpecs" - } + }, + "type": "module" } diff --git a/src/indexed-db.mts b/src/indexed-db.mts index 21c1598..dd68790 100644 --- a/src/indexed-db.mts +++ b/src/indexed-db.mts @@ -1,3 +1,8 @@ +// import { } from "./common.js" +import { Database } from "indexeddb-promise/indexeddb.js" + +const db = new Database("asdf", 1) + export class IDBCursorValueIterator { cursor: IDBCursorWithValue diff --git a/tsconfig.json b/tsconfig.json index a7bd9eb..985cce0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,13 +1,26 @@ { - "include": ["src/**/*"], + "include": [ + "src/**/*", + "node_modules/altcha/*", + "node_modules/@coderundebug/indexeddb-promise/*" + ], + "compilerOptions": { + "allowJs": true, "outDir": "scripts", - "noImplicitAny": true, "lib": ["ES7", "DOM"], + + "noImplicitAny": true, + "noFallthroughCasesInSwitch": true, + "sourceMap": true, + "target": "esnext", - "baseUrl": "src/", - "module": "esnext", - "noFallthroughCasesInSwitch": true + "baseUrl": ".", + "paths": { + "indexeddb-promise/*": ["node_modules/@coderundebug/indexeddb-promise/*"] + }, + "module": "nodenext", + } } \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index ff2cb97..425eb5d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12,6 +12,10 @@ resolved "https://registry.yarnpkg.com/@bazel/runfiles/-/runfiles-6.5.0.tgz#63cf7b77b91b54873e75f7a08fabec215c6888be" integrity sha512-RzahvqTkfpY2jsDxo8YItPX+/iZ6hbiikw1YhE0bA9EKBR5Og8Pa6FHn9PO9M0zaXRVsr0GFQLKbB/0rzy9SzA== +"@coderundebug/indexeddb-promise@git+https://github.com/StephenHassall/indexeddb-promise.git": + version "1.0.4" + resolved "git+https://github.com/StephenHassall/indexeddb-promise.git#5b7427145f60215eaa533fd15218736fc203a068" + "@isaacs/cliui@^8.0.2": version "8.0.2" resolved "https://registry.yarnpkg.com/@isaacs/cliui/-/cliui-8.0.2.tgz#b37667b7bc181c168782259bab42474fbf52b550"