@fedify/init 2.0.0-dev.0 → 2.0.0-dev.372
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/action/{configs.mjs → configs.js} +6 -6
- package/dist/action/{deps.mjs → deps.js} +7 -5
- package/dist/action/{env.mjs → env.js} +2 -2
- package/dist/action/{install.mjs → install.js} +1 -1
- package/dist/action/{mod.d.mts → mod.d.ts} +2 -2
- package/dist/action/{mod.mjs → mod.js} +11 -11
- package/dist/action/{notice.mjs → notice.js} +1 -1
- package/dist/action/{patch.mjs → patch.js} +8 -7
- package/dist/action/{precommand.mjs → precommand.js} +1 -1
- package/dist/action/{recommend.mjs → recommend.js} +4 -4
- package/dist/action/{set.mjs → set.js} +3 -3
- package/dist/action/{templates.mjs → templates.js} +3 -3
- package/dist/ask/{dir.mjs → dir.js} +2 -2
- package/dist/ask/{kv.mjs → kv.js} +3 -3
- package/dist/ask/{mod.mjs → mod.js} +5 -5
- package/dist/ask/{mq.mjs → mq.js} +3 -3
- package/dist/ask/{pm.mjs → pm.js} +4 -4
- package/dist/ask/{wf.mjs → wf.js} +2 -2
- package/dist/{command.mjs → command.js} +2 -2
- package/dist/deno.js +38 -0
- package/dist/json/biome.js +18 -0
- package/dist/json/db-to-check.js +24 -0
- package/dist/json/kv.js +50 -0
- package/dist/json/mq.js +69 -0
- package/dist/json/pm.js +41 -0
- package/dist/json/rt.js +36 -0
- package/dist/json/vscode-settings-for-deno.js +50 -0
- package/dist/json/vscode-settings.js +46 -0
- package/dist/{lib.mjs → lib.js} +9 -8
- package/dist/mod.d.ts +3 -0
- package/dist/mod.js +4 -0
- package/dist/test/{action.mjs → action.js} +5 -5
- package/dist/test/{create.mjs → create.js} +14 -10
- package/dist/test/db.js +52 -0
- package/dist/test/{fill.mjs → fill.js} +1 -1
- package/dist/test/{lookup.mjs → lookup.js} +12 -8
- package/dist/test/{mod.mjs → mod.js} +6 -6
- package/dist/test/{run.mjs → run.js} +4 -4
- package/dist/test/{utils.mjs → utils.js} +1 -1
- package/dist/{types.d.mts → types.d.ts} +3 -3
- package/dist/{utils.mjs → utils.js} +2 -2
- package/dist/{webframeworks.mjs → webframeworks.js} +3 -3
- package/package.json +9 -4
- package/dist/deno.mjs +0 -5
- package/dist/json/biome.mjs +0 -14
- package/dist/json/db-to-check.mjs +0 -21
- package/dist/json/kv.mjs +0 -47
- package/dist/json/mq.mjs +0 -65
- package/dist/json/pm.mjs +0 -36
- package/dist/json/rt.mjs +0 -31
- package/dist/json/vscode-settings-for-deno.mjs +0 -39
- package/dist/json/vscode-settings.mjs +0 -37
- package/dist/mod.d.mts +0 -3
- package/dist/mod.mjs +0 -4
- package/dist/test/db.mjs +0 -42
- /package/dist/action/{const.mjs → const.js} +0 -0
- /package/dist/action/{dir.mjs → dir.js} +0 -0
- /package/dist/action/{utils.mjs → utils.js} +0 -0
- /package/dist/{command.d.mts → command.d.ts} +0 -0
- /package/dist/{const.d.mts → const.d.ts} +0 -0
- /package/dist/{const.mjs → const.js} +0 -0
- /package/dist/test/{mod.d.mts → mod.d.ts} +0 -0
- /package/dist/{utils.d.mts → utils.d.ts} +0 -0
package/dist/mod.mjs
DELETED
package/dist/test/db.mjs
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { printErrorMessage, printMessage } from "../utils.mjs";
|
|
2
|
-
import { DB_TO_CHECK } from "../const.mjs";
|
|
3
|
-
import db_to_check_default from "../json/db-to-check.mjs";
|
|
4
|
-
import { concat, filter, pipe, toArray, uniq } from "@fxts/core";
|
|
5
|
-
|
|
6
|
-
//#region src/test/db.ts
|
|
7
|
-
/**
|
|
8
|
-
* This function checks if a given port is open by attempting to fetch from
|
|
9
|
-
* localhost at that port. So, may give false positives if the service does not
|
|
10
|
-
* respond to HTTP requests.
|
|
11
|
-
* @param port The port number to check.
|
|
12
|
-
* @returns A promise that resolves to true if the port is open, else false.
|
|
13
|
-
*/
|
|
14
|
-
async function isPortOpen(port) {
|
|
15
|
-
try {
|
|
16
|
-
await fetch(`http://localhost:${port}`, { signal: AbortSignal.timeout(3e3) });
|
|
17
|
-
return true;
|
|
18
|
-
} catch (error) {
|
|
19
|
-
if (error instanceof TypeError) {
|
|
20
|
-
const msg = error.message.toLowerCase();
|
|
21
|
-
if (msg.includes("refused") || msg.includes("econnrefused")) return false;
|
|
22
|
-
return true;
|
|
23
|
-
}
|
|
24
|
-
if (error instanceof DOMException && error.name === "TimeoutError") return false;
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
const getRequiredDbs = ({ kvStore, messageQueue }) => pipe(kvStore, concat(messageQueue), uniq, filter((db) => DB_TO_CHECK.includes(db)), toArray);
|
|
29
|
-
async function checkRequiredDbs(options) {
|
|
30
|
-
const dbs = Array.from(getRequiredDbs(options));
|
|
31
|
-
if (dbs.length === 0) return;
|
|
32
|
-
printMessage`Checking required databases...`;
|
|
33
|
-
for (const db of dbs) {
|
|
34
|
-
const info = db_to_check_default[db];
|
|
35
|
-
const port = String(info.defaultPort);
|
|
36
|
-
if (await isPortOpen(info.defaultPort)) printMessage` ${info.name} is running on port ${port}.`;
|
|
37
|
-
else printErrorMessage`${info.name} is not running on port ${port}. Tests requiring ${info.name} may fail. Install: ${info.documentation}`;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
//#endregion
|
|
42
|
-
export { checkRequiredDbs };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|