@slack/bolt 4.0.0-nextGen.4 → 4.0.0-nextGen.5
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slack/bolt",
|
|
3
|
-
"version": "4.0.0-nextGen.
|
|
3
|
+
"version": "4.0.0-nextGen.5",
|
|
4
4
|
"description": "A framework for building Slack apps, fast.",
|
|
5
5
|
"author": "Slack Technologies, LLC",
|
|
6
6
|
"license": "MIT",
|
|
@@ -39,7 +39,8 @@
|
|
|
39
39
|
"slack-cli-get-hooks": "./src/cli/get-hooks.js",
|
|
40
40
|
"slack-cli-get-manifest": "./src/cli/get-manifest.js",
|
|
41
41
|
"slack-cli-start": "./src/cli/start.js",
|
|
42
|
-
"slack-cli-hook-utils": "./src/cli/hook-utils/manifest.js"
|
|
42
|
+
"slack-cli-hook-utils": "./src/cli/hook-utils/manifest.js",
|
|
43
|
+
"slack-cli-hook-utils-get-manifest-data": "./src/cli/hook-utils/get-manifest-data.js"
|
|
43
44
|
},
|
|
44
45
|
"repository": "slackapi/bolt",
|
|
45
46
|
"homepage": "https://slack.dev/bolt-js",
|
|
@@ -93,7 +94,7 @@
|
|
|
93
94
|
"source-map-support": "^0.5.12",
|
|
94
95
|
"ts-node": "^8.1.0",
|
|
95
96
|
"tsd": "^0.22.0",
|
|
96
|
-
"typescript": "4.
|
|
97
|
+
"typescript": "4.7.4"
|
|
97
98
|
},
|
|
98
99
|
"tsd": {
|
|
99
100
|
"directory": "types-tests"
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const {
|
|
2
|
+
readManifestJSONFile,
|
|
3
|
+
readImportedManifestFile,
|
|
4
|
+
hasManifest,
|
|
5
|
+
unionMerge,
|
|
6
|
+
} = require('./manifest.js');
|
|
7
|
+
const merge = require('deepmerge');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Returns any manifest data, if it exists.
|
|
12
|
+
* Otherwise throws an error
|
|
13
|
+
* @param searchDir path to begin searching at
|
|
14
|
+
*/
|
|
15
|
+
function getManifestData(searchDir) {
|
|
16
|
+
const file = 'manifest';
|
|
17
|
+
let manifest = {};
|
|
18
|
+
|
|
19
|
+
// look for a manifest JSON
|
|
20
|
+
const manifestJSON = readManifestJSONFile(searchDir, `${file}.json`);
|
|
21
|
+
// look for manifest.js
|
|
22
|
+
let manifestJS = readImportedManifestFile(searchDir, `${file}.js`);
|
|
23
|
+
|
|
24
|
+
if (!hasManifest(manifestJS, manifestJSON)) {
|
|
25
|
+
const msg = 'Unable to find a manifest file in this project';
|
|
26
|
+
throw new Error(msg);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// manage manifest merge
|
|
30
|
+
if (manifestJSON) {
|
|
31
|
+
manifest = merge(manifest, manifestJSON, { arrayMerge: unionMerge });
|
|
32
|
+
}
|
|
33
|
+
if (manifestJS) {
|
|
34
|
+
manifest = merge(manifest, manifestJS, { arrayMerge: unionMerge });
|
|
35
|
+
}
|
|
36
|
+
return manifest;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
module.exports = { getManifestData };
|