Giter VIP home page Giter VIP logo

slack-table-api-sample's Introduction

Note:This project is SAMPLE. Some important parts(e.g. validation) is omitted.

Next-gen Slack platform project template

This repo contains a sample project and embedded lightweight SDK of a Typescript based project for the new Deno runtime.

The main file that brings it all together is the project.ts file. So far only functions and workflows are supported and those should each be created in a file per, under each corresponding directory. functions/dino.ts has a simple sample. After you create a new function or workflow make sure you add it to the Project object in project.ts.

Testing

You can write tests for your function, see functions/dino_test.ts for a sample. Test base filenames should be suffixed with _test. To run tests just run:

slack deno test

Bundling

To bundle to stdout:

deno --unstable bundle .slack/run.ts

To bundle using the "hook", this required a path to a directory to package into that is expected to be used to zip for the deployment package: (note /tmp/some-dir needs to exist!)

.slack/hooks/package /tmp/some-dir

The packaged zip file that is deployed should contain a single file named bundle.js. You might bundle and build that like this:

rm -rf ./package ./dist \
  && mkdir ./package ./dist \
  && deno --unstable bundle .slack/run.ts > ./package/bundle.js \
  && cd ./package \
  && zip -m ../dist/package.zip ./* \
  && cd .. \
  && rm -rf ../package \
  && echo "\n๐Ÿ‘‹ Oh, hi there. The deployment zip is in ./dist/package.zip"

Manifest and Slack.yaml

To generate a manifest:

deno --unstable run .slack/manifest.ts > manifest.json

To generate a slack.yaml file (yaml encoding of manifest):

deno --unstable run .slack/slack_yaml.ts > slack.yaml

To use the manifest hook to create a slack.yaml file in the project root:

.slack/hooks/manifest

slack-table-api-sample's People

Contributors

07jp27 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.