local-slack 0.1.0
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/bin.js +44 -0
- package/package.json +33 -0
package/bin.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
const { spawnSync } = require("node:child_process");
|
|
5
|
+
const { dirname, join } = require("node:path");
|
|
6
|
+
|
|
7
|
+
const PLATFORM_PACKAGES = {
|
|
8
|
+
"darwin-arm64": "local-slack-darwin-arm64",
|
|
9
|
+
"darwin-x64": "local-slack-darwin-x64",
|
|
10
|
+
"linux-arm64": "local-slack-linux-arm64",
|
|
11
|
+
"linux-x64": "local-slack-linux-x64",
|
|
12
|
+
"win32-x64": "local-slack-windows-x64",
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const key = `${process.platform}-${process.arch}`;
|
|
16
|
+
const pkgName = PLATFORM_PACKAGES[key];
|
|
17
|
+
|
|
18
|
+
if (!pkgName) {
|
|
19
|
+
console.error(
|
|
20
|
+
`local-slack: no prebuilt binary for ${key}.\n` +
|
|
21
|
+
`Supported platforms: ${Object.keys(PLATFORM_PACKAGES).join(", ")}`,
|
|
22
|
+
);
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
let binPath;
|
|
27
|
+
try {
|
|
28
|
+
const pkgJsonPath = require.resolve(`${pkgName}/package.json`);
|
|
29
|
+
const binName = process.platform === "win32" ? "local-slack.exe" : "local-slack";
|
|
30
|
+
binPath = join(dirname(pkgJsonPath), "bin", binName);
|
|
31
|
+
} catch {
|
|
32
|
+
console.error(
|
|
33
|
+
`local-slack: couldn't find the ${pkgName} package.\n` +
|
|
34
|
+
`This usually means its optional dependency failed to install - try reinstalling.`,
|
|
35
|
+
);
|
|
36
|
+
process.exit(1);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const result = spawnSync(binPath, process.argv.slice(2), { stdio: "inherit" });
|
|
40
|
+
if (result.error) {
|
|
41
|
+
console.error(`local-slack: failed to run ${binPath}: ${result.error.message}`);
|
|
42
|
+
process.exit(1);
|
|
43
|
+
}
|
|
44
|
+
process.exit(result.status ?? 1);
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "local-slack",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A local Slack mock (Web API + Socket Mode + Events API) with a web UI, for testing Slack apps/bots.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"slack",
|
|
7
|
+
"mock",
|
|
8
|
+
"testing",
|
|
9
|
+
"bolt",
|
|
10
|
+
"socket-mode",
|
|
11
|
+
"cli"
|
|
12
|
+
],
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"homepage": "https://github.com/parvalabs/local-slack",
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/parvalabs/local-slack.git",
|
|
18
|
+
"directory": "npm/local-slack"
|
|
19
|
+
},
|
|
20
|
+
"bin": {
|
|
21
|
+
"local-slack": "./bin.js"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"bin.js"
|
|
25
|
+
],
|
|
26
|
+
"optionalDependencies": {
|
|
27
|
+
"local-slack-darwin-arm64": "0.1.0",
|
|
28
|
+
"local-slack-darwin-x64": "0.1.0",
|
|
29
|
+
"local-slack-linux-arm64": "0.1.0",
|
|
30
|
+
"local-slack-linux-x64": "0.1.0",
|
|
31
|
+
"local-slack-windows-x64": "0.1.0"
|
|
32
|
+
}
|
|
33
|
+
}
|