Skip to content

feat(methods): add chat.postMessage example (typecheck-only) - #139

Draft
zimeg wants to merge 5 commits into
mainfrom
methods-typecheck-only
Draft

feat(methods): add chat.postMessage example (typecheck-only)#139
zimeg wants to merge 5 commits into
mainfrom
methods-typecheck-only

Conversation

@zimeg

@zimeg zimeg commented Jul 14, 2026

Copy link
Copy Markdown
Member

Summary

This pull request adds a methods/ chat.postMessage example verified by type-check + lint only — no runtime test.

  • tsc --checkJs validates the payload against @slack/web-api's real ChatPostMessageArguments type, catching wrong or misspelled arguments (e.g. chnnel → TS2561) at check time.
  • Biome handles lint/format.
  • No tests/ directory, no fetch-stub mock server.

Comparison PR. This is an alternative to the fetch-stub runtime-test approach (see the other methods-examples branch / PR #138) for side-by-side evaluation of testing strategy across the example repos.

Testing

  • Run the example end-to-end: export SLACK_TOKEN="xoxb-..." then node chat/src/chat-post-message.js from methods/; confirm the message posts.

🤖 Generated with Claude Code

zimeg and others added 5 commits July 14, 2026 16:44
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant