Quellcode durchsuchen

fix slack package build settings

Yuki Takei vor 5 Jahren
Ursprung
Commit
b3b4cb1949

+ 1 - 1
packages/slack/.eslintignore

@@ -1,2 +1,2 @@
-/dist/**
+/lib/**
 /node_modules/**

+ 1 - 1
packages/slack/.gitignore

@@ -1 +1 @@
-/dist/
+/lib/

+ 2 - 2
packages/slack/package.json

@@ -2,8 +2,8 @@
   "name": "@growi/slack",
   "version": "0.9.0-RC",
   "license": "MIT",
-  "main": "dist/index.js",
-  "files": ["dist"],
+  "main": "lib/index.js",
+  "files": ["lib"],
   "scripts": {
     "build": "yarn tsc",
     "tsc": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",

+ 1 - 1
packages/slack/tsconfig.build.json

@@ -1,7 +1,7 @@
 {
   "extends": "./tsconfig.json",
   "compilerOptions": {
-    "outDir": "dist",
+    "outDir": "lib",
     "declaration": true,
     "noResolve": false,
     "preserveConstEnums": true,

+ 3 - 3
packages/slack/tsconfig.json

@@ -20,10 +20,10 @@
 
     /* Module Resolution Options */
     "moduleResolution": "node",
-    "baseUrl": ".",
+    "baseUrl": "src",
     "paths": {
-      "~/*": ["src/*"],
-      "^/*": ["./*"],
+      "~/*": ["./*"],
+      "^/*": ["../*"],
     },
     "typeRoots": [
       "../../node_modules/@types",

+ 6 - 6
packages/slackbot-proxy/src/services/RecieveService.ts

@@ -1,15 +1,15 @@
 import { Service } from '@tsed/di';
-// import { parse } from '@growi/slack/src/utils/slash-command-parser';
+import { parse } from '@growi/slack/lib/utils/slash-command-parser';
 
 @Service()
 export class ReceiveService {
 
   receiveContentsFromSlack(body:{[key:string]:string}) : string {
-    // const parseBody = parse(body);
-    // if (parseBody.growiCommandType === 'register') {
-    //   console.log('register action occured');
-    //   return 'register action occurd';
-    // }
+    const parseBody = parse(body);
+    if (parseBody.growiCommandType === 'register') {
+      console.log('register action occured');
+      return 'register action occurd';
+    }
     return 'return receiveContentsFromSlack';
   }