Skip to content

Commit

Permalink
fix: migrate to using sink modules
Browse files Browse the repository at this point in the history
Deprecate the built-ins
  • Loading branch information
wkillerud committed Jul 29, 2024
1 parent f5e26d8 commit 0101d50
Show file tree
Hide file tree
Showing 9 changed files with 75 additions and 1,261 deletions.
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
package-lock=false
save-exact=true
21 changes: 18 additions & 3 deletions lib/main.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import FS from '@eik/sink-file-system';
import MEM from '@eik/sink-memory';

import VersionsGet from './handlers/versions.get.js';
import AliasPost from './handlers/alias.post.js';
import AliasPut from './handlers/alias.put.js';
Expand All @@ -11,8 +14,6 @@ import MapGet from './handlers/map.get.js';
import MapPut from './handlers/map.put.js';

import TEST from './sinks/test.js';
import MEM from './sinks/mem.js';
import FS from './sinks/fs.js';

import HealthCheck from './utils/healthcheck.js';
import globals from './utils/globals.js';
Expand All @@ -31,9 +32,23 @@ const http = {
MapPut,
};

/**
* @deprecated The built-in sinks will be removed in a future version of core.
* Install the sink you want as a dependency and pass it as an option when constructing the Service.
* Ex: sink.MEM is replaced by eik/sink-memory. sink.FS is replaced by eik/sink-file-system.
*/
const sink = {
/**
* @deprecated Import eik/sink-memory or implement your own and pass it to the Service instead.
*/
TEST,
/**
* @deprecated Import eik/sink-memory and pass it to the Service instead
*/
MEM,
/**
* @deprecated Import eik/sink-file-system and pass it to the Service instead
*/
FS,
};

Expand All @@ -49,4 +64,4 @@ export default {
http,
sink,
prop,
}
};
263 changes: 0 additions & 263 deletions lib/sinks/fs.js

This file was deleted.

Loading

0 comments on commit 0101d50

Please sign in to comment.