@arkstack/cache 0.13.2 → 0.14.1
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/dist/{CacheManager-DfAiI5Ft.js → CacheManager-Do82q7KO.js} +3 -2
- package/dist/commands/CacheClearCommand.js +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +1 -1
- package/dist/setup.d.ts +1 -0
- package/dist/setup.js +21 -0
- package/package.json +7 -5
- package/stubs/migrations/20260601000000_create_cache_table.ts.stub +21 -0
|
@@ -20,8 +20,9 @@ var Store = class {};
|
|
|
20
20
|
* `@arkstack/database`.
|
|
21
21
|
*
|
|
22
22
|
* The table is expected to have `key` (string, primary), `value` (text), and
|
|
23
|
-
* `expiration` (nullable integer epoch seconds) columns.
|
|
24
|
-
*
|
|
23
|
+
* `expiration` (nullable integer epoch seconds) columns. Run
|
|
24
|
+
* `ark publish --tag cache-migrations` to add the migration that creates it.
|
|
25
|
+
* `@arkstack/database` is an optional peer dependency and is imported lazily.
|
|
25
26
|
*/
|
|
26
27
|
var DatabaseStore = class extends Store {
|
|
27
28
|
databaseConfig;
|
package/dist/index.d.ts
CHANGED
|
@@ -501,8 +501,9 @@ declare class RedisStore extends Store {
|
|
|
501
501
|
* `@arkstack/database`.
|
|
502
502
|
*
|
|
503
503
|
* The table is expected to have `key` (string, primary), `value` (text), and
|
|
504
|
-
* `expiration` (nullable integer epoch seconds) columns.
|
|
505
|
-
*
|
|
504
|
+
* `expiration` (nullable integer epoch seconds) columns. Run
|
|
505
|
+
* `ark publish --tag cache-migrations` to add the migration that creates it.
|
|
506
|
+
* `@arkstack/database` is an optional peer dependency and is imported lazily.
|
|
506
507
|
*/
|
|
507
508
|
declare class DatabaseStore extends Store {
|
|
508
509
|
private readonly databaseConfig;
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as RedisStore, c as DatabaseStore, i as ttlToSeconds, l as Store, n as configure, o as MemoryStore, r as Repository, s as FileStore, t as Cache } from "./CacheManager-
|
|
1
|
+
import { a as RedisStore, c as DatabaseStore, i as ttlToSeconds, l as Store, n as configure, o as MemoryStore, r as Repository, s as FileStore, t as Cache } from "./CacheManager-Do82q7KO.js";
|
|
2
2
|
export { Cache, DatabaseStore, FileStore, MemoryStore, RedisStore, Repository, Store, configure, ttlToSeconds };
|
package/dist/setup.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/dist/setup.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { dirname, join } from "node:path";
|
|
2
|
+
import { Publisher } from "@arkstack/common";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
//#region src/setup.ts
|
|
5
|
+
const root = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
6
|
+
/**
|
|
7
|
+
* Register the artifacts `@arkstack/cache` publishes into the application.
|
|
8
|
+
*
|
|
9
|
+
* Run `ark publish --package @arkstack/cache` (or `--tag cache-migrations`) to
|
|
10
|
+
* copy the migration for the `database` cache store into the app.
|
|
11
|
+
*/
|
|
12
|
+
Publisher.publishes({
|
|
13
|
+
package: "@arkstack/cache",
|
|
14
|
+
tag: "cache-migrations",
|
|
15
|
+
entries: [{
|
|
16
|
+
from: join(root, "stubs/migrations/20260601000000_create_cache_table.ts.stub"),
|
|
17
|
+
to: "src/database/migrations/20260601000000_create_cache_table.ts"
|
|
18
|
+
}]
|
|
19
|
+
});
|
|
20
|
+
//#endregion
|
|
21
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arkstack/cache",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Cache module for Arkstack, providing a unified, driver based caching layer for the framework.",
|
|
6
6
|
"homepage": "https://arkstack.toneflix.net/guide/cache",
|
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
"arkstack"
|
|
21
21
|
],
|
|
22
22
|
"files": [
|
|
23
|
-
"dist"
|
|
23
|
+
"dist",
|
|
24
|
+
"stubs"
|
|
24
25
|
],
|
|
25
26
|
"publishConfig": {
|
|
26
27
|
"access": "public"
|
|
@@ -28,16 +29,17 @@
|
|
|
28
29
|
"exports": {
|
|
29
30
|
".": "./dist/index.js",
|
|
30
31
|
"./commands/CacheClearCommand": "./dist/commands/CacheClearCommand.js",
|
|
32
|
+
"./setup": "./dist/setup.js",
|
|
31
33
|
"./package.json": "./package.json"
|
|
32
34
|
},
|
|
33
35
|
"dependencies": {
|
|
34
|
-
"@arkstack/common": "^0.
|
|
36
|
+
"@arkstack/common": "^0.14.1"
|
|
35
37
|
},
|
|
36
38
|
"peerDependencies": {
|
|
37
39
|
"@h3ravel/musket": "^2.2.0",
|
|
38
40
|
"ioredis": "^5.4.1",
|
|
39
|
-
"@arkstack/contract": "^0.
|
|
40
|
-
"@arkstack/database": "^0.
|
|
41
|
+
"@arkstack/contract": "^0.14.1",
|
|
42
|
+
"@arkstack/database": "^0.14.1"
|
|
41
43
|
},
|
|
42
44
|
"peerDependenciesMeta": {
|
|
43
45
|
"@arkstack/database": {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Migration, SchemaBuilder } from 'arkormx'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Backing table for the `database` cache store (`@arkstack/cache`).
|
|
5
|
+
*
|
|
6
|
+
* Columns: `key` (string primary), `value` (text), `expiration` (nullable
|
|
7
|
+
* epoch seconds). Adjust the table name to match `cache.stores.database.table`.
|
|
8
|
+
*/
|
|
9
|
+
export default class CreateCacheTableMigration extends Migration {
|
|
10
|
+
public async up (schema: SchemaBuilder): Promise<void> {
|
|
11
|
+
schema.createTable('cache', (table) => {
|
|
12
|
+
table.string('key').primary()
|
|
13
|
+
table.text('value')
|
|
14
|
+
table.integer('expiration').nullable()
|
|
15
|
+
})
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
public async down (schema: SchemaBuilder): Promise<void> {
|
|
19
|
+
schema.dropTable('cache')
|
|
20
|
+
}
|
|
21
|
+
}
|