Commit 4234fdb 1 parent c2130db commit 4234fdb Copy full SHA for 4234fdb
File tree 14 files changed +77
-49
lines changed
14 files changed +77
-49
lines changed File renamed without changes.
Original file line number Diff line number Diff line change @@ -7,11 +7,11 @@ import { createCache } from 'cache-manager'
7
7
import { CacheableMemory } from 'cacheable'
8
8
9
9
import { getFromDb } from './helpers.js'
10
- import { BentoCache } from '../src/bento_cache.js'
11
- import { bentostore } from '../src/bento_store.js'
12
- import { redisDriver } from '../src/drivers/redis.js'
13
- import { memoryDriver } from '../src/drivers/memory.js'
14
- import { REDIS_CREDENTIALS } from '../tests/helpers/index.js'
10
+ import { BentoCache } from '../packages/bentocache/ src/bento_cache.js'
11
+ import { bentostore } from '../packages/bentocache/ src/bento_store.js'
12
+ import { redisDriver } from '../packages/bentocache/ src/drivers/redis.js'
13
+ import { memoryDriver } from '../packages/bentocache/ src/drivers/memory.js'
14
+ import { REDIS_CREDENTIALS } from '../packages/bentocache/ tests/helpers/index.js'
15
15
16
16
/**
17
17
* Init providers
Original file line number Diff line number Diff line change @@ -4,17 +4,21 @@ import { createCache } from 'cache-manager'
4
4
import { CacheableMemory } from 'cacheable'
5
5
import { setTimeout } from 'node:timers/promises'
6
6
7
- import { BentoCache } from '../src/bento_cache.js'
8
- import { bentostore } from '../src/bento_store.js'
9
- import { redisDriver } from '../src/drivers/redis.js'
10
- import { memoryDriver } from '../src/drivers/memory.js'
11
- import { REDIS_CREDENTIALS } from '../tests/helpers/index.js'
7
+ import { BentoCache } from '../packages/bentocache/src/bento_cache.js'
8
+ import { bentostore } from '../packages/bentocache/src/bento_store.js'
9
+ import { redisDriver } from '../packages/bentocache/src/drivers/redis.js'
10
+ import { memoryDriver } from '../packages/bentocache/src/drivers/memory.js'
11
+
12
+ export const REDIS_CREDENTIALS = {
13
+ host : process . env . REDIS_HOST ! ,
14
+ port : Number ( process . env . REDIS_PORT ) ,
15
+ }
12
16
13
17
export function createProviders ( options : {
14
18
withMemory : boolean
15
19
withRedis : boolean
16
20
serializeL1 : boolean
17
- } ) {
21
+ } ) : any {
18
22
const store = bentostore ( )
19
23
if ( options . withMemory ) {
20
24
store . useL1Layer ( memoryDriver ( { serialize : options . serializeL1 } ) )
File renamed without changes.
Original file line number Diff line number Diff line change @@ -8,12 +8,11 @@ import { Bench } from 'tinybench'
8
8
import KeyvRedis from '@keyv/redis'
9
9
import { createCache } from 'cache-manager'
10
10
import { CacheableMemory } from 'cacheable'
11
+ import { BentoCache , bentostore } from 'bentocache'
12
+ import { redisDriver } from 'bentocache/drivers/redis'
13
+ import { memoryDriver } from 'bentocache/drivers/memory'
11
14
12
- import { BentoCache } from '../index.js'
13
- import { bentostore } from '../src/bento_store.js'
14
- import { redisDriver } from '../src/drivers/redis.js'
15
- import { memoryDriver } from '../src/drivers/memory.js'
16
- import { REDIS_CREDENTIALS } from '../tests/helpers/index.js'
15
+ import { REDIS_CREDENTIALS } from './helpers.js'
17
16
18
17
const bench = new Bench ( )
19
18
File renamed without changes.
Original file line number Diff line number Diff line change @@ -8,12 +8,11 @@ import { Bench } from 'tinybench'
8
8
import KeyvRedis from '@keyv/redis'
9
9
import { createCache } from 'cache-manager'
10
10
import { CacheableMemory } from 'cacheable'
11
+ import { BentoCache , bentostore } from 'bentocache'
12
+ import { redisDriver } from 'bentocache/drivers/redis'
13
+ import { memoryDriver } from 'bentocache/drivers/memory'
11
14
12
- import { BentoCache } from '../index.js'
13
- import { bentostore } from '../src/bento_store.js'
14
- import { redisDriver } from '../src/drivers/redis.js'
15
- import { memoryDriver } from '../src/drivers/memory.js'
16
- import { REDIS_CREDENTIALS } from '../tests/helpers/index.js'
15
+ import { REDIS_CREDENTIALS } from './helpers.js'
17
16
18
17
const bench = new Bench ( )
19
18
Original file line number Diff line number Diff line change @@ -8,11 +8,10 @@ import { Redis } from 'ioredis'
8
8
import { Bench } from 'tinybench'
9
9
import KeyvRedis from '@keyv/redis'
10
10
import { createCache } from 'cache-manager'
11
+ import { BentoCache , bentostore } from 'bentocache'
12
+ import { redisDriver } from 'bentocache/drivers/redis'
11
13
12
- import { BentoCache } from '../index.js'
13
- import { bentostore } from '../src/bento_store.js'
14
- import { redisDriver } from '../src/drivers/redis.js'
15
- import { REDIS_CREDENTIALS } from '../tests/helpers/index.js'
14
+ import { REDIS_CREDENTIALS } from './helpers.js'
16
15
17
16
const bench = new Bench ( )
18
17
Original file line number Diff line number Diff line change @@ -7,11 +7,10 @@ import Keyv from 'keyv'
7
7
import { Bench } from 'tinybench'
8
8
import KeyvRedis from '@keyv/redis'
9
9
import { createCache } from 'cache-manager'
10
+ import { BentoCache , bentostore } from 'bentocache'
11
+ import { redisDriver } from 'bentocache/drivers/redis'
10
12
11
- import { BentoCache } from '../index.js'
12
- import { bentostore } from '../src/bento_store.js'
13
- import { redisDriver } from '../src/drivers/redis.js'
14
- import { REDIS_CREDENTIALS } from '../tests/helpers/index.js'
13
+ import { REDIS_CREDENTIALS } from './helpers.js'
15
14
16
15
const bench = new Bench ( )
17
16
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " @bentocache/benchmarks" ,
3
+ "type" : " module" ,
4
+ "version" : " 0.0.0" ,
5
+ "private" : true ,
6
+ "description" : " " ,
7
+ "author" :
" Julien Ripouteau <[email protected] >" ,
8
+ "license" : " ISC" ,
9
+ "keywords" : [],
10
+ "main" : " index.js" ,
11
+ "scripts" : {
12
+ "test" : " echo \" Error: no test specified\" && exit 1"
13
+ },
14
+ "devDependencies" : {
15
+ "@keyv/redis" : " ^4.2.0" ,
16
+ "bentocache" : " workspace:*" ,
17
+ "cache-manager" : " ^6.4.0" ,
18
+ "cacheable" : " ^1.8.8" ,
19
+ "ioredis" : " ^5.4.2" ,
20
+ "keyv" : " ^5.2.3" ,
21
+ "tinybench" : " ^3.1.1"
22
+ }
23
+ }
Original file line number Diff line number Diff line change 36
36
"prettier" : " ^3.4.2" ,
37
37
"release-it" : " ^18.1.2" ,
38
38
"testcontainers" : " ^10.17.2" ,
39
- "tinybench" : " ^3.1.1" ,
40
39
"ts-node" : " ^10.9.2" ,
41
40
"tsup" : " ^8.3.6" ,
42
41
"typescript" : " ~5.7.3"
Original file line number Diff line number Diff line change 82
82
},
83
83
"devDependencies" : {
84
84
"@aws-sdk/client-dynamodb" : " ^3.741.0" ,
85
- "@keyv/redis" : " ^4.2.0" ,
86
85
"@types/better-sqlite3" : " ^7.6.12" ,
87
86
"@types/pg" : " ^8.11.11" ,
88
87
"better-sqlite3" : " ^11.8.1" ,
89
- "cache-manager" : " ^6.4.0" ,
90
- "cacheable" : " ^1.8.8" ,
91
88
"dayjs" : " ^1.11.13" ,
92
89
"defu" : " ^6.1.4" ,
93
90
"emittery" : " ^1.1.0" ,
94
91
"ioredis" : " ^5.4.2" ,
95
- "keyv" : " ^5.2.3" ,
96
92
"knex" : " ^3.1.0" ,
97
93
"kysely" : " ^0.27.5" ,
98
94
"mysql2" : " ^3.12.0" ,
Original file line number Diff line number Diff line change 1
1
packages :
2
2
- packages/*
3
3
- playground
4
+ - benchmarks
4
5
- examples/*
5
6
- apps/*
6
7
- docs
You can’t perform that action at this time.
0 commit comments