Skip to content

Commit

Permalink
v5 release (#1112)
Browse files Browse the repository at this point in the history
* v5 release

* upgrading memcache modules to latest

* upgrading mongodb to latest

* mongo - fixing in lint errors

* mysql - updating modules

* offline - updating modules to latest

* postgres - upgrading modules to latest

* redis - updating tests and modules

* serialize - updating modules

* sqlite - upgrading xo

* tiered - upgrading xo to latest

* website - upgrading docula

* updating third party

* simplify the security policy
  • Loading branch information
jaredwray authored Aug 20, 2024
1 parent eb587eb commit 1f035c9
Show file tree
Hide file tree
Showing 43 changed files with 101 additions and 113 deletions.
12 changes: 0 additions & 12 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
# Security Policy

## Supported Versions

All v5 and v4 versions of Keyv receive security updates.

| Version | Supported |
| ------- | ------------------ |
| 5.0 | :white_check_mark: |
| 4.0 | :white_check_mark: |
| < 4.0 | :x: |

## Reporting a Vulnerability

To report a security vulnerability, please send an email to [email protected]. Once the issue has been validated, we will open a [Github Security Advisory](https://docs.github.com/en/code-security/repository-security-advisories/about-github-security-advisories-for-repositories), if necessary.

Once the security advisory has been opened, contributors can collaborate on a private fork to fix the vulnerability. When the issue has been resolved, we will alert users of the past vulnerability by publishing the security advisory.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
"clean": "rm -rf node_modules && rm -rf yarn.lock && yarn workspaces run clean"
},
"devDependencies": {
"@types/node": "^20.14.11",
"@vitest/coverage-v8": "^2.0.4",
"@types/node": "^22.4.1",
"@vitest/coverage-v8": "^2.0.5",
"c8": "^10.1.2",
"ts-node": "^10.9.2",
"typescript": "^5.5.4",
"vitest": "^2.0.4",
"vitest": "^2.0.5",
"webpack": "^5.93.0",
"xo": "^0.59.3"
}
Expand Down
10 changes: 5 additions & 5 deletions packages/compress-brotli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@keyv/compress-brotli",
"version": "1.1.6",
"version": "2.0.0",
"description": "brotli compression for keyv",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
Expand Down Expand Up @@ -52,19 +52,19 @@
"homepage": "https://github.com/jaredwray/keyv",
"dependencies": {
"compress-brotli": "^1.3.12",
"keyv": "^5.0.0-rc.1",
"keyv": "^5.0.0",
"@keyv/serialize": "*"
},
"devDependencies": {
"@keyv/test-suite": "*",
"c8": "^9.1.0",
"xo": "^0.58.0"
"c8": "^10.1.2",
"xo": "^0.59.3"
},
"tsd": {
"directory": "test"
},
"engines": {
"node": ">= 12"
"node": ">= 18"
},
"files": [
"dist",
Expand Down
2 changes: 1 addition & 1 deletion packages/compress-brotli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import compressBrotli from 'compress-brotli';
import {defaultDeserialize, defaultSerialize} from '@keyv/serialize';
import type {
Brotli, CompressResult, Options, SerializeResult, Serialize,
} from './types';
} from './types.js';

class KeyvBrotli {
private readonly brotli: Brotli;
Expand Down
4 changes: 2 additions & 2 deletions packages/compress-brotli/test/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import {constants as zlibConstants} from 'node:zlib';
import v8 from 'node:v8';
import * as test from 'vitest';
import {keyvCompresstionTests} from '@keyv/test-suite';
import KeyvBrotli from '../src/index';
import type {DeserializeResult} from '../src/types';
import KeyvBrotli from '../src/index.js';
import type {DeserializeResult} from '../src/types.js';

// eslint-disable-next-line @typescript-eslint/naming-convention
const {BROTLI_PARAM_MODE, BROTLI_PARAM_QUALITY} = zlibConstants;
Expand Down
2 changes: 1 addition & 1 deletion packages/compress-brotli/test/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import zlib from 'node:zlib';
import v8 from 'node:v8';
import * as test from 'vitest';
import Keyv, {type KeyvStoreAdapter} from 'keyv';
import KeyvBrotli from '../src/index';
import KeyvBrotli from '../src/index.js';

type MyType = {
a?: string;
Expand Down
8 changes: 4 additions & 4 deletions packages/compress-gzip/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@keyv/compress-gzip",
"version": "1.2.4",
"version": "2.0.0",
"description": "gzip compression for keyv",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
Expand Down Expand Up @@ -55,14 +55,14 @@
},
"devDependencies": {
"@keyv/test-suite": "*",
"tsd": "^0.31.0",
"xo": "^0.58.0"
"tsd": "^0.31.1",
"xo": "^0.59.3"
},
"tsd": {
"directory": "test"
},
"engines": {
"node": ">= 12"
"node": ">= 18"
},
"files": [
"dist",
Expand Down
2 changes: 1 addition & 1 deletion packages/compress-gzip/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pako from 'pako';
import {defaultSerialize, defaultDeserialize} from '@keyv/serialize';
import type {Options, Serialize} from './types';
import type {Options, Serialize} from './types.js';

class KeyvGzip {
opts: Options;
Expand Down
2 changes: 1 addition & 1 deletion packages/compress-gzip/test/test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as test from 'vitest';
import {keyvCompresstionTests} from '@keyv/test-suite';
import KeyvGzip from '../src/index';
import KeyvGzip from '../src/index.js';

// @ts-expect-error - KeyvGzip type
keyvCompresstionTests(test, new KeyvGzip());
Expand Down
6 changes: 3 additions & 3 deletions packages/etcd/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@keyv/etcd",
"version": "2.0.0-rc.1",
"version": "2.0.0",
"description": "Etcd storage adapter for Keyv",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
Expand Down Expand Up @@ -71,13 +71,13 @@
"devDependencies": {
"@keyv/test-suite": "*",
"c8": "^10.1.2",
"keyv": "^5.0.0-rc.1",
"keyv": "^5.0.0",
"requirable": "^1.0.5",
"ts-node": "^10.9.2",
"tsd": "^0.31.1",
"typescript": "^5.5.4",
"webpack": "^5.93.0",
"xo": "^0.59.2"
"xo": "^0.59.3"
},
"tsd": {
"directory": "test"
Expand Down
6 changes: 3 additions & 3 deletions packages/keyv/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "keyv",
"version": "5.0.0-rc.1",
"version": "5.0.0",
"description": "Simple key-value storage with support for multiple backends",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
Expand Down Expand Up @@ -79,8 +79,8 @@
"devDependencies": {
"@keyv/test-suite": "*",
"timekeeper": "^2.3.1",
"tsd": "^0.31.0",
"xo": "^0.58.0"
"tsd": "^0.31.1",
"xo": "^0.59.3"
},
"tsd": {
"directory": "test"
Expand Down
2 changes: 1 addition & 1 deletion packages/keyv/src/hooks-manager.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import EventManager from './event-manager';
import EventManager from './event-manager.js';

type HookHandler = (...arguments_: any[]) => void;

Expand Down
6 changes: 3 additions & 3 deletions packages/keyv/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {defaultSerialize, defaultDeserialize} from '@keyv/serialize';
import HooksManager from './hooks-manager';
import EventManager from './event-manager';
import StatsManager from './stats-manager';
import HooksManager from './hooks-manager.js';
import EventManager from './event-manager.js';
import StatsManager from './stats-manager.js';

export type DeserializedData<Value> = {
value?: Value;
Expand Down
2 changes: 1 addition & 1 deletion packages/keyv/src/stats-manager.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import EventManager from './event-manager';
import EventManager from './event-manager.js';

class StatsManager extends EventManager {
public enabled = true;
Expand Down
2 changes: 1 addition & 1 deletion packages/keyv/test/event-manager.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-empty-function */
import * as test from 'vitest';
import EventManager from '../src/event-manager';
import EventManager from '../src/event-manager.js';

test.it('remove event listener', t => {
const emitter = new EventManager();
Expand Down
2 changes: 1 addition & 1 deletion packages/keyv/test/hooks-manager.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as test from 'vitest';
import HooksManager from '../src/hooks-manager';
import HooksManager from '../src/hooks-manager.js';

test.it('add and trigger handler', t => {
const hooksManager = new HooksManager();
Expand Down
2 changes: 1 addition & 1 deletion packages/keyv/test/keyv-hooks.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as test from 'vitest';
import KeyvSqlite from '@keyv/sqlite';
import Keyv, {KeyvHooks} from '../src';
import Keyv, {KeyvHooks} from '../src/index.js';

test.it('PRE_SET hook', async t => {
const keyv = new Keyv();
Expand Down
2 changes: 1 addition & 1 deletion packages/keyv/test/stats-manager.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as test from 'vitest';
import KeyvStatsManager from '../src/stats-manager';
import KeyvStatsManager from '../src/stats-manager.js';

test.it('will initialize with correct stats at zero', () => {
const stats = new KeyvStatsManager();
Expand Down
2 changes: 1 addition & 1 deletion packages/keyv/test/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import KeyvMongo from '@keyv/mongo';
import KeyvBrotli from '@keyv/compress-brotli';
import KeyvGzip from '@keyv/compress-gzip';
import KeyvMemcache from '@keyv/memcache';
import Keyv, {type KeyvStoreAdapter, type StoredDataNoRaw} from '../src';
import Keyv, {type KeyvStoreAdapter, type StoredDataNoRaw} from '../src/index.js';

const keyvMemcache = new KeyvMemcache('localhost:11211');

Expand Down
10 changes: 5 additions & 5 deletions packages/memcache/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@keyv/memcache",
"version": "2.0.0-rc.2",
"version": "2.0.0",
"description": "Memcache storage adapter for Keyv",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
Expand Down Expand Up @@ -64,11 +64,11 @@
"devDependencies": {
"@keyv/test-suite": "*",
"@types/memjs": "^1.3.3",
"keyv": "^5.0.0-rc.1",
"keyv": "^5.0.0",
"ts-node": "^10.9.2",
"tsd": "^0.31.0",
"typescript": "^5.4.5",
"xo": "^0.58.0"
"tsd": "^0.31.1",
"typescript": "^5.5.4",
"xo": "^0.59.3"
},
"tsd": {
"directory": "test"
Expand Down
2 changes: 1 addition & 1 deletion packages/memcache/test/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {EventEmitter} from 'events';
import * as test from 'vitest';
import Keyv from 'keyv';
import {keyvApiTests, keyvValueTests} from '@keyv/test-suite';
import KeyvMemcache from '../src/index';
import KeyvMemcache from '../src/index.js';

const snooze = async (ms: number) => new Promise(resolve => setTimeout(resolve, ms));

Expand Down
10 changes: 5 additions & 5 deletions packages/mongo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@keyv/mongo",
"version": "3.0.0-rc.1",
"version": "3.0.0",
"description": "MongoDB storage adapter for Keyv",
"main": "dist/cjs/index.js",
"type": "module",
Expand Down Expand Up @@ -62,13 +62,13 @@
},
"homepage": "https://github.com/jaredwray/keyv",
"dependencies": {
"mongodb": "^6.6.2"
"mongodb": "^6.8.0"
},
"devDependencies": {
"@keyv/test-suite": "*",
"keyv": "^5.0.0-rc.1",
"tsd": "^0.31.0",
"xo": "^0.58.0"
"keyv": "^5.0.0",
"tsd": "^0.31.1",
"xo": "^0.59.3"
},
"tsd": {
"directory": "test"
Expand Down
5 changes: 3 additions & 2 deletions packages/mongo/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import {
type KeyvMongoConnect,
type KeyvMongoOptions,
type Options,
type PifyFunction,
} from './types';
} from './types.js';

const keyvMongoKeys = new Set(['url', 'collection', 'namespace', 'serialize', 'deserialize', 'uri', 'useGridFS', 'dialect']);
class KeyvMongo extends EventEmitter implements KeyvStoreAdapter {
Expand Down Expand Up @@ -94,6 +93,7 @@ class KeyvMongo extends EventEmitter implements KeyvStoreAdapter {
resolve({store, mongoClient: client});
}
} catch (error) {
/* c8 ignore next 4 */
this.emit('error', error);
// eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
reject(error);
Expand Down Expand Up @@ -258,6 +258,7 @@ class KeyvMongo extends EventEmitter implements KeyvStoreAdapter {
try {
await client.bucket!.drop();
} catch (error: unknown) {
/* c8 ignore next 5 */
// Throw error if not "namespace not found" error
if (!(error instanceof MongoServerError && error.code === 26)) {
throw error;
Expand Down
2 changes: 1 addition & 1 deletion packages/mongo/test/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as test from 'vitest';
import keyvTestSuite, {keyvIteratorTests} from '@keyv/test-suite';
import Keyv from 'keyv';
import {KeyvMongoOptions} from 'types';
import KeyvMongo from '../src/index';
import KeyvMongo from '../src/index.js';

const options = {serverSelectionTimeoutMS: 5000};
const mongoURL = 'mongodb://127.0.0.1:27017';
Expand Down
10 changes: 5 additions & 5 deletions packages/mysql/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@keyv/mysql",
"version": "2.0.0-rc.1",
"version": "2.0.0",
"description": "MySQL/MariaDB storage adapter for Keyv",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
Expand Down Expand Up @@ -61,20 +61,20 @@
},
"homepage": "https://github.com/jaredwray/keyv",
"dependencies": {
"mysql2": "^3.10.3"
"mysql2": "^3.11.0"
},
"devDependencies": {
"@keyv/test-suite": "*",
"keyv": "^5.0.0-rc.1",
"keyv": "^5.0.0",
"ts-node": "^10.9.2",
"tsd": "^0.31.1",
"xo": "^0.59.2"
"xo": "^0.59.3"
},
"tsd": {
"directory": "test"
},
"engines": {
"node": ">= 14"
"node": ">= 18"
},
"files": [
"dist",
Expand Down
1 change: 0 additions & 1 deletion packages/mysql/src/pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ export const pool = (uri: string, options = {}) => {
const connectObject = parseConnectionString(uri);
const poolOptions = {...connectObject, ...options};

// eslint-disable-next-line n/no-unsupported-features/es-syntax
mysqlPool ??= mysql.createPool(poolOptions);
return mysqlPool.promise();
};
Expand Down
Loading

0 comments on commit 1f035c9

Please sign in to comment.