Skip to content

Conversation

@zimeg
Copy link
Member

@zimeg zimeg commented Jan 26, 2026

Summary

This PR sets up workspaces for improved package management.

Requirements

@zimeg zimeg self-assigned this Jan 26, 2026
@zimeg zimeg added semver:patch area:performance issues where performance is a meaningful concern pkg:web-api applies to `@slack/web-api` pkg:rtm-api applies to `@slack/rtm-api` pkg:webhook applies to `@slack/webhook` pkg:logger applies to `@slack/logger` pkg:types applies to `@slack/types` pkg:oauth applies to `@slack/oauth` pkg:socket-mode applies to `@slack/socket-mode` pkg:cli-hooks applies to `@slack/cli-hooks` pkg:cli-test applies to `@slack/cli-test` javascript Pull requests that update Javascript code labels Jan 26, 2026
@codecov
Copy link

codecov bot commented Jan 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.09%. Comparing base (a1112e3) to head (37fe12b).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2478      +/-   ##
==========================================
- Coverage   93.09%   93.09%   -0.01%     
==========================================
  Files          40       40              
  Lines       11240    11239       -1     
  Branches      713      713              
==========================================
- Hits        10464    10463       -1     
  Misses        764      764              
  Partials       12       12              
Flag Coverage Δ
cli-hooks 95.23% <ø> (ø)
cli-test 94.79% <ø> (ø)
oauth 77.39% <ø> (ø)
socket-mode 61.87% <ø> (ø)
web-api 98.11% <ø> (-0.01%) ⬇️
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 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.

📬 A few messages for the kind reviewers!

Comment on lines +47 to +64
- name: Build packages
run: |
# Build packages without internal dependencies
npm run build --workspace=@slack/cli-hooks
npm run build --workspace=@slack/cli-test

# Build base dependencies
npm run build --workspace=@slack/logger
npm run build --workspace=@slack/types

# Build packages requiring base dependencies
npm run build --workspace=@slack/web-api
npm run build --workspace=@slack/webhook

# Build packages that depend on the Web API
npm run build --workspace=@slack/oauth
npm run build --workspace=@slack/rtm-api
npm run build --workspace=@slack/socket-mode
Copy link
Member Author

Choose a reason for hiding this comment

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

🗣️ note: #2482 is an example of changing dependencies between packages being resolved as expected!

In that example, changes to @slack/types are required in @slack/web-api which cause tests on matching commit f2ac218 to fail in an unchanged branch. We might hope to include these changes as part of related PRs for confident CI without updates across prereleases 🫡


The script places the reference markdown files in `/docs/english/reference/package-name`.

### 🚀 Releases
Copy link
Member Author

Choose a reason for hiding this comment

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

🔮 note: These steps are verbose now but I'm hoping to fast follow this change with some enhancement to the release process! For now these steps still package as expected, testing with the following:

$ npm pack --workspace=@slack/web-api --dry-run

Copy link
Member Author

Choose a reason for hiding this comment

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

📠 note: Apologies for noise in these changes, but a lot of formatting happened I fear.

"url": "https://github.com/slackapi/node-slack-sdk/issues"
},
"scripts": {
"prepare": "npm run build",
Copy link
Member Author

Choose a reason for hiding this comment

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

🗣️ note: The prepare script is replaced with prepack in all packages!

This helps prevent installation and build errors between packages on an initial install. Otherwise, packages are built when dependencies are installed with the prepare script, and the oauth package requires web-api is built but these are packaged in alphabetical order. Overrides for this aren't obvious to me...

AFAICT this isn't a breaking change since the prepack script is run still when packages are installed from Git. FWIW I cannot figure out how to install packages in a monorepo with that method in both cases either 🤖

Comment on lines +21 to +24
"scripts": {
"lint": "npx @biomejs/biome check packages",
"lint:fix": "npx @biomejs/biome check --write packages"
},
Copy link
Member Author

Choose a reason for hiding this comment

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

🪵 note: Linting becomes a global task with impressive speeds of biome - less than 1 second for all packages.

This is a noticed change to the maintenance tasks I think, but --workspace commands are preferred for package scripts overall, which are run from the root:

$ npm run test --workspace=@slack/webhook

Copy link
Member Author

Choose a reason for hiding this comment

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

🌲 note: I'm so open to adding more scripts here too, but hope to keep this PR scoped to minimal improvements of workspaces to start:

  • Automatic dependent and deduplicated package resolution in development
  • Shared linting scripts
  • Test fixes and simplified linking related to dependencies

@zimeg zimeg marked this pull request as ready for review January 29, 2026 05:07
@zimeg zimeg requested a review from a team as a code owner January 29, 2026 05:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:performance issues where performance is a meaningful concern javascript Pull requests that update Javascript code pkg:cli-hooks applies to `@slack/cli-hooks` pkg:cli-test applies to `@slack/cli-test` pkg:logger applies to `@slack/logger` pkg:oauth applies to `@slack/oauth` pkg:rtm-api applies to `@slack/rtm-api` pkg:socket-mode applies to `@slack/socket-mode` pkg:types applies to `@slack/types` pkg:web-api applies to `@slack/web-api` pkg:webhook applies to `@slack/webhook` semver:patch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants