Skip to content

feat(cli-hooks): add default app and manifest watch config#2480

Merged
zimeg merged 13 commits intomainfrom
zimeg-feat-hooks-watch
Feb 4, 2026
Merged

feat(cli-hooks): add default app and manifest watch config#2480
zimeg merged 13 commits intomainfrom
zimeg-feat-hooks-watch

Conversation

@zimeg
Copy link
Member

@zimeg zimeg commented Jan 27, 2026

Summary

This PR adds a default app and manifest option to file watching for server restarts and app reinstalls.

Requirements

@zimeg zimeg self-assigned this Jan 27, 2026
@zimeg zimeg added semver:minor enhancement M-T: A feature request for new functionality pkg:cli-hooks applies to `@slack/cli-hooks` labels Jan 27, 2026
@codecov
Copy link

codecov bot commented Jan 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.11%. Comparing base (f34cdba) to head (7c7927d).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2480      +/-   ##
==========================================
+ Coverage   93.10%   93.11%   +0.01%     
==========================================
  Files          40       40              
  Lines       11250    11269      +19     
  Branches      713      713              
==========================================
+ Hits        10474    10493      +19     
  Misses        764      764              
  Partials       12       12              
Flag Coverage Δ
cli-hooks 95.42% <100.00%> (+0.12%) ⬆️
cli-test 94.79% <ø> (ø)
oauth 77.39% <ø> (ø)
socket-mode 61.87% <ø> (ø)
web-api 98.11% <ø> (ø)
webhook 96.66% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@mwbrooks mwbrooks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exciting times!

paths: ['.'],
app: {
paths: ['.'],
'filter-regex': '.js$',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: I think we should also support .ts for TypeScript developers using Bolt JS?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mwbrooks We might use the built changes from tsc for now, though these changes might be good to document as well!

A note on this is mentioned now in the CHANGELOG and also updates to the sample app:

TypeScript developers should run `tsc --watch` in a separate terminal during development. This compiles `.ts` files to `.js` on changes, and the default watch configuration will detect changes to the compiled `dist/*.js` files and restart the app server. This approach works best with the default settings.

👾 slack-samples/bolt-ts-starter-template#178

@changeset-bot
Copy link

changeset-bot bot commented Jan 30, 2026

🦋 Changeset detected

Latest commit: 7c7927d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@slack/cli-hooks Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@zimeg zimeg marked this pull request as ready for review January 30, 2026 06:43
@zimeg zimeg requested a review from a team as a code owner January 30, 2026 06:43
@zimeg
Copy link
Member Author

zimeg commented Jan 30, 2026

🏷️ Follows: slackapi/slack-cli#310

@zimeg zimeg requested a review from mwbrooks January 30, 2026 07:30
@zimeg zimeg added this to the cli-hooks@1.3.0 milestone Jan 30, 2026
Copy link
Contributor

@srtaalej srtaalej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and its working for me! ⭐ ⭐ ⭐


### Custom Configurations

You can override these defaults in your `.slack/hooks.json` file to reduce the paths searched or change the file patterns. Read [Watch Configurations](https://docs.slack.dev/tools/slack-cli/reference/hooks/#watch-configurations) for more options.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤩

Comment on lines +25 to +37
it('should return watch config for app files', async () => {
const { config } = getHooks();
assert(config.watch);
assert(config.watch.app);
assert.equal(config.watch.app['filter-regex'], '\\.js$');
assert.deepEqual(config.watch.app.paths, ['.']);
});

it('should return watch config for manifest files', async () => {
const { config } = getHooks();
assert(config.watch);
assert(config.watch.manifest);
assert.deepEqual(config.watch.manifest.paths, ['manifest.json']);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ty for good tests 👾!

Base automatically changed from zimeg-fix-hooks-daemon to main February 4, 2026 05:19
Copy link
Member

@mwbrooks mwbrooks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Love this improvement @zimeg! It's so exciting to see this land!

🧪 Local testing works great on my end! 👾

🛠️ I left a few minor, non-blocking suggestions.

✏️ Love the very detailed changeset! This is what I'd like to see in more of our PRs for developers!

'filter-regex': '^manifest\\.json$',
paths: ['.'],
app: {
'filter-regex': '\\.js$',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Non-blocker. Not sure if we want to include, this but we could ignore node_modules to avoid restarting the server when the developer runs npm install.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mwbrooks Our current CLI implementations don't support "not" paths AFAICT. We might want to follow up with this, since changes to the test directories might also be odd to cause restarts! 🤖

Co-authored-by: Michael Brooks <mbrooks@slack-corp.com>
Copy link
Member Author

@zimeg zimeg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@srtaalej @mwbrooks Thanks both so much for the kind reviews and catches 👾 ✨

I'm excited to merge this for an upcoming release, and hope we can continue to support good defaults for most developers!

'filter-regex': '^manifest\\.json$',
paths: ['.'],
app: {
'filter-regex': '\\.js$',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mwbrooks Our current CLI implementations don't support "not" paths AFAICT. We might want to follow up with this, since changes to the test directories might also be odd to cause restarts! 🤖

@zimeg zimeg merged commit 0abdc91 into main Feb 4, 2026
58 checks passed
@zimeg zimeg deleted the zimeg-feat-hooks-watch branch February 4, 2026 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement M-T: A feature request for new functionality pkg:cli-hooks applies to `@slack/cli-hooks` semver:minor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants