feat(methods): add chat.postMessage example - #139
Merged
Conversation
Add a methods/ chat.postMessage example verified by tsc --checkJs + Biome lint, with no runtime test. The type-check validates the payload against @slack/web-api's real ChatPostMessageArguments type, catching wrong or misspelled arguments (e.g. chnnel -> TS2561) without a mock server. This is an alternative to the fetch-stub runtime-test approach for side-by-side comparison. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Add methods to the CI matrix and use `npm test --if-present` so the type-check-only methods example (which has no test script) passes CI while still running lint and check. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@slack/web-api v8 is now GA; move off the 8.0.0-rc.2 release candidate to the stable ^8.0.0 range, matching the caret style used by block-kit. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Match the runtime-test branch: add @slack/cli-hooks, a .slack/ workspace, and a chat manifest.json requesting only chat:write. Move scopes out of the README into the manifest and document the `slack install` flow with the method's exact docs description. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Move @slack/cli-hooks to stable ^2.0.0 (get-hooks bin unchanged) and remove skipLibCheck so tsc fully type-checks library declarations by default, matching block-kit. The tsconfig already scopes include to src only (this variant has no tests). Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Move methods/chat/ to methods/src/chat/ and collapse the inner src/ directory so the example sits at methods/src/chat/chat-post-message.js. Repoint the top-level README to the specific chat.postMessage doc and implementation path; the per-family README is dropped in favor of the single methods index. Replace the tsconfig-driven check with an inline tsc invocation (tsc --checkJs --noEmit --types node src/**/*.js) and remove methods/tsconfig.json.
The example reads one variable (SLACK_TOKEN), so 'an environment variable' is more accurate than the plural.
zimeg
marked this pull request as ready for review
August 12, 2026 05:36
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Member
Author
|
⚡ Let's get this merged for now to match adjacent changes of: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
methods/chat.postMessageexample to the Bolt for JavaScript examples — the first entry in a newmethods/showcase of individual Slack Web API method calls with@slack/web-api.src/chat/chat-post-message.jsreads a token from the environment, initializes aWebClient, and callschat.postMessage.manifest.jsonrequesting onlychat:write.methods/README.mddocuments the family and links the implementation; the top-level README lists the new showcase.The example is validated in CI by
tsc --checkJs(payload checked against@slack/web-api's realChatPostMessageArgumentstype) and Biome lint/format.Testing
From
methods/src/chat:Confirm the message posts to the configured channel.
Supersedes the runtime-test / fetch-stub exploration in #138 (closed).
🤖 Generated with Claude Code