Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Breaking: upgrade to abstract-level 2
Browse files Browse the repository at this point in the history
See `UPGRADING.md` for details.

This also removes the majority of documentation from the README in
favor of just linking to the README of `abstract-level` so that we
don't have to maintain two copies.

Category: change
vweevers committed Dec 1, 2024
1 parent 0056b12 commit e7be471
Showing 6 changed files with 15 additions and 483 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [12, 14, 16]
node: [18, 20, 22]
name: Node ${{ matrix.node }}
steps:
- name: Checkout
@@ -15,14 +15,14 @@ jobs:
with:
node-version: ${{ matrix.node }}
- name: Install
run: npm install
run: npm install --ignore-scripts
- name: Install Playwright
if: matrix.node == 16
if: matrix.node == 18
run: npx playwright install --with-deps
- name: Test
run: npm test
- name: Test browsers
if: matrix.node == 16
if: matrix.node == 18
run: npm run test-browsers-local
- name: Coverage
run: npm run coverage
464 changes: 2 additions & 462 deletions README.md

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,10 @@

This document describes breaking changes and how to upgrade. For a complete list of changes including minor and patch releases, please refer to the [changelog](CHANGELOG.md).

## 9.0.0

This release upgrades to `abstract-level` 2.0.0 which adds [hooks](https://github.com/Level/abstract-level#hooks) and drops callbacks and not-found errors. Please refer to the [upgrade guide of `abstract-level`](https://github.com/Level/abstract-level/blob/v2.0.0/UPGRADING.md) for details. The only thing to add is that this release ends support of Node.js < 18 and Electron < 30.

## 8.0.0

**This release replaces `leveldown` and `level-js` with [`classic-level`](https://github.com/Level/classic-level) and [`browser-level`](https://github.com/Level/browser-level). These modules implement the [`abstract-level`](https://github.com/Level/abstract-level) interface instead of [`abstract-leveldown`](https://github.com/Level/abstract-leveldown). This gives them the same API as `level@7` without having to be wrapped with [`levelup`](https://github.com/Level/levelup) or [`encoding-down`](https://github.com/Level/encoding-down). In addition, you can now choose to use Uint8Array instead of Buffer. Sublevels are built-in.**
12 changes: 0 additions & 12 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -28,33 +28,21 @@ export class Level<KDefault = string, VDefault = string>

open (): Promise<void>
open (options: OpenOptions): Promise<void>
open (callback: AbstractLevel.NodeCallback<void>): void
open (options: OpenOptions, callback: AbstractLevel.NodeCallback<void>): void

get (key: KDefault): Promise<VDefault>
get (key: KDefault, callback: AbstractLevel.NodeCallback<VDefault>): void
get<K = KDefault, V = VDefault> (key: K, options: GetOptions<K, V>): Promise<V>
get<K = KDefault, V = VDefault> (key: K, options: GetOptions<K, V>, callback: AbstractLevel.NodeCallback<V>): void

getMany (keys: KDefault[]): Promise<VDefault[]>
getMany (keys: KDefault[], callback: AbstractLevel.NodeCallback<VDefault[]>): void
getMany<K = KDefault, V = VDefault> (keys: K[], options: GetManyOptions<K, V>): Promise<V[]>
getMany<K = KDefault, V = VDefault> (keys: K[], options: GetManyOptions<K, V>, callback: AbstractLevel.NodeCallback<V[]>): void

put (key: KDefault, value: VDefault): Promise<void>
put (key: KDefault, value: VDefault, callback: AbstractLevel.NodeCallback<void>): void
put<K = KDefault, V = VDefault> (key: K, value: V, options: PutOptions<K, V>): Promise<void>
put<K = KDefault, V = VDefault> (key: K, value: V, options: PutOptions<K, V>, callback: AbstractLevel.NodeCallback<void>): void

del (key: KDefault): Promise<void>
del (key: KDefault, callback: AbstractLevel.NodeCallback<void>): void
del<K = KDefault> (key: K, options: DelOptions<K>): Promise<void>
del<K = KDefault> (key: K, options: DelOptions<K>, callback: AbstractLevel.NodeCallback<void>): void

batch (operations: Array<BatchOperation<typeof this, KDefault, VDefault>>): Promise<void>
batch (operations: Array<BatchOperation<typeof this, KDefault, VDefault>>, callback: AbstractLevel.NodeCallback<void>): void
batch<K = KDefault, V = VDefault> (operations: Array<BatchOperation<typeof this, K, V>>, options: BatchOptions<K, V>): Promise<void>
batch<K = KDefault, V = VDefault> (operations: Array<BatchOperation<typeof this, K, V>>, options: BatchOptions<K, V>, callback: AbstractLevel.NodeCallback<void>): void
batch (): ChainedBatch<typeof this, KDefault, VDefault>

iterator (): Iterator<typeof this, KDefault, VDefault>
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -19,9 +19,9 @@
],
"browser": "browser.js",
"dependencies": {
"abstract-level": "^1.0.4",
"browser-level": "^1.0.1",
"classic-level": "^1.2.0"
"abstract-level": "^2.0.1",
"browser-level": "^2.0.0",
"classic-level": "^2.0.0"
},
"devDependencies": {
"@types/node": "^22.10.1",
@@ -55,6 +55,6 @@
"json"
],
"engines": {
"node": ">=12"
"node": ">=18"
}
}
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "@voxpelli/tsconfig/node16.json",
"extends": "@voxpelli/tsconfig/node18.json",
"compilerOptions": {
"checkJs": false
},

0 comments on commit e7be471

Please sign in to comment.