Skip to content

Commit

Permalink
[[ ssb ]] rename platforms/ssb to platforms/nodejs-ssb
Browse files Browse the repository at this point in the history
refactoring platform from `ssb` to `nodejs-ssb` to prepare the ground for supporting `go-ssb` and `browsers-ssb` as well.

Related to: #104 #105 #106
  • Loading branch information
soapdog committed Jul 14, 2021
1 parent a881f15 commit 39438a7
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
"dev:browserAction": "browserify -d src/core/browserAction/browserAction.js -o dist/browserAction.js",
"dev:background": "browserify -d src/core/background/background.js -o dist/background.js",
"dev:addon": "browserify -d src/main.js -o dist/bundle.js",
"dev:platform-ssb": "browserify -d src/core/platforms/ssb/ssb.js -o dist/ssb.js",
"dev:platform-ssb": "browserify -d src/core/platforms/platforms.js -o dist/ssb.js",
"dev:both": "run-s dev:platform-ssb dev:addon",
"build": "run-s copy:* build:*",
"dev": "run-s copy:* dev:*",
Expand Down
2 changes: 1 addition & 1 deletion src/core/components/ui/Card.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
const MessageDropdown = require("../MessageDropdown.svelte");
const MessageRaw = require("../MessageRaw.svelte");
const AvatarTile = require("../AvatarTile.svelte");
const { isMessageBlured } = require("../../platforms/ssb/abusePrevention.js");
const { isMessageBlured } = require("../../platforms/nodejs-ssb/abusePrevention.js");
export let msg;
export let showRaw = false;
Expand Down
2 changes: 1 addition & 1 deletion src/core/core.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const kernel = require("./kernel/kernel.js")
const runtimes = require("./runtimes/runtimes.js")
const queryString = require("query-string")
const { isMessageHidden } = require("./platforms/ssb/abusePrevention.js")
const { isMessageHidden } = require("./platforms/nodejs-ssb/abusePrevention.js")


if (window) {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* SSB
* NodeJS SSB
*
* Things I don't currently like here:
* - usage of getPref and abuse prevention. This should be pluggable!
Expand Down Expand Up @@ -150,7 +150,7 @@ const setMsgCache = (id, data) => {
sessionStorage.setItem(id, JSON.stringify(data))
}

class SSB {
class NodeJsSSB {
constructor() {
// add basic built-in pipelines
pipelines.thread.use(this.filterHasContent)
Expand Down Expand Up @@ -1853,5 +1853,4 @@ class SSB {
}
}

global.ssb = new SSB()
module.exports.SSB = SSB
module.exports.NodeJsSSB = NodeJsSSB
File renamed without changes.
8 changes: 5 additions & 3 deletions src/core/platforms/platforms.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const { SSB } = require("./ssb/ssb.js");
const { NodeJsSSB } = require("./nodejs-ssb/ssb.js")

module.exports = {
SSB
const platforms = {
"nodejs-ssb": NodeJsSSB,
}
global.ssb = new platforms["nodejs-ssb"]()
module.exports = platforms
2 changes: 1 addition & 1 deletion src/packages/hub/Channel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
isChannelFiltered,
addFilter,
deleteFilter
} = require("../../core/platforms/ssb/abusePrevention.js");
} = require("../../core/platforms/nodejs-ssb/abusePrevention.js");
const { onMount, onDestroy } = require("svelte");
Expand Down
2 changes: 1 addition & 1 deletion src/packages/settings/Filters.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
getFilters,
addFilter,
deleteFilter
} = require("../../core/platforms/ssb/abusePrevention.js");
} = require("../../core/platforms/nodejs-ssb/abusePrevention.js");
// Abuse Prevention - filters
let currentFilters = getFilters();
Expand Down

0 comments on commit 39438a7

Please sign in to comment.