Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changesets

This directory contains [**Changesets**](https://github.com/changesets/changesets) which are markdown files that describe package changes for the next release.

For guidance on when and how to add changesets, checkout the [Maintainer's Guide](../.github/maintainers_guide.md#-updating-changesets).
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.1.2/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
Copy link
Member

Choose a reason for hiding this comment

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

question: Should we explicitly ignore our legacy packages? I know we currently use private: true in each legacy package to prevent publishing, so ignoring may not be necessary.

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 This is recommended against and instead ignore is meant to be used for stopgap times when we might want to not publish certain packages in the next release:

THIS FEATURE IS DESIGNED FOR TEMPORARY USE TO ALLOW CHANGES TO BE MERGED WITHOUT PUBLISHING THEM

🔗 https://github.com/changesets/changesets/blob/main/docs/config-file-options.md#ignore-array-of-packages

}
183 changes: 75 additions & 108 deletions .github/maintainers_guide.md

Large diffs are not rendered by default.

63 changes: 23 additions & 40 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,48 +41,31 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- run: npm --version
- run: npm install --verbose
working-directory: packages/${{ matrix.package }}
- name: Link dependent packages (*nix)
if: matrix.os == 'ubuntu-latest'
working-directory: packages/${{ matrix.package }}
- name: Install dependencies
run: |
# depending on which package we are testing, also npm link up dependent packages within this monorepo
case "$PWD" in
*/webhook) pushd ../types && npm i && popd && npm link ../types;;
*/web-api) pushd ../types && npm i && popd && npm link ../types && pushd ../logger && npm i && popd && npm link ../logger;;
*/oauth) pushd ../logger && npm i && popd && npm link ../logger && pushd ../web-api && npm i && popd && npm link ../web-api;;
*/socket-mode) pushd ../logger && npm i && popd && npm link ../logger && pushd ../web-api && npm i && popd && npm link ../web-api;;
*) ;; # default
esac
- name: Link dependent packages (Windows)
if: matrix.os == 'windows-latest'
working-directory: packages/${{ matrix.package }}
npm install --verbose
- 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
- name: Run tests
run: |
# depending on which package we are testing, also npm link up dependent packages within this monorepo
# NOTE: the following is PowerShell
echo "$pwd"
switch -Wildcard ( "$pwd" )
{
'*\webhook'
{
pushd ..\types && npm i && popd && npm link ..\types
}
'*\web-api'
{
pushd ..\types && npm i && popd && npm link ..\types && pushd ..\logger && npm i && popd && npm link ..\logger
}
'*\oauth'
{
pushd ..\logger && npm i && popd && npm link ..\logger && pushd ..\web-api && npm i && popd && npm link ..\web-api
}
'*\socket-mode'
{
pushd ..\logger && npm i && popd && npm link ..\logger && pushd ..\web-api && npm i && popd && npm link ..\web-api
}
}
- run: npm test
working-directory: packages/${{ matrix.package }}
npm run lint
npm test --workspace=@slack/${{ matrix.package }}
- name: Check for coverage report existence
id: check_coverage
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Release

on:
push:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Release
runs-on: ubuntu-latest
environment: publish
permissions:
contents: write
id-token: write
Copy link
Member

Choose a reason for hiding this comment

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

suggestion: Sounds like id-token: write is used for npm OIDC trusted publishing? I think a comment would be nice here.

Suggested change
id-token: write
# required for npm OIDC trusted publishing
id-token: write

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 Super appreciate this suggestion and f360a20 was added with similar reference! An "id-token" is otherwise not clear to me now...

pull-requests: write
steps:
- name: Checkout Repo
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: true

- name: Setup Node
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
with:
node-version: 24
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: We're using node@24 for a supported npm version:

Trusted publishing requires npm CLI version 11.5.1 or later.

🔗 https://docs.npmjs.com/trusted-publishers

registry-url: "https://registry.npmjs.org"

- name: Install dependencies
run: npm install

- name: Gather changesets
uses: changesets/action@c48e67d110a68bc90ccf1098e9646092baacaa87 # v1.6.0
with:
createGithubReleases: true
commit: "ci: release"
title: "ci: release"
publish: npm run changeset -- publish
version: npm run changeset -- version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Copy link
Member

Choose a reason for hiding this comment

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

question: Do we need a NPM_TOKEN: ${{ secrets.NPM_TOKEN }}? How will npm run chahgeset -- publish release the packages without the token?

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 AFAICT OIDC is a replacement for the token authentications in most recent changes:

Publish packages without npm tokens

🔗 https://github.blog/changelog/2025-07-31-npm-trusted-publishing-with-oidc-is-generally-available/

35 changes: 34 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
}
}
},
"files": {
"includes": [
"packages/**",
"!!packages/client",
"!!packages/events-api",
"!!packages/interactive-messages"
]
},
"formatter": {
"enabled": true,
"formatWithErrors": false,
Expand Down Expand Up @@ -44,5 +52,30 @@
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
}
},
"overrides": [
{
"includes": ["packages/web-api/src/types/response/**/*.ts"],
"linter": {
"rules": {
"complexity": {
"noBannedTypes": "off"
},
"suspicious": {
"noExplicitAny": "off"
}
}
}
},
{
"includes": ["packages/web-api/src/index.ts"],
"assist": {
"actions": {
"source": {
"organizeImports": "off"
}
}
}
}
]
}
30 changes: 30 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "@slack",
"version": "0.0.0",
"private": true,
"type": "module",
"repository": {
"type": "git",
"url": "git+https://github.com/slackapi/node-slack-sdk.git"
},
"workspaces": [
"packages/cli-hooks",
"packages/cli-test",
"packages/logger",
"packages/oauth",
"packages/rtm-api",
"packages/socket-mode",
"packages/types",
"packages/web-api",
"packages/webhook"
],
"scripts": {
"changeset": "npx @changesets/cli",
"lint": "npx @biomejs/biome check packages",
"lint:fix": "npx @biomejs/biome check --write packages"
},
"devDependencies": {
"@biomejs/biome": "^2.0.5",
"@changesets/cli": "^2.29.8"
Copy link
Member

Choose a reason for hiding this comment

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

question: Do we need @changeset/cli when npm run changeset → npx @changesets/cli runs the package instead of the cli?

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 I understand having this listed with dev dependencies guarantees a certain version will be used for the command:

$ npm run changeset

While npx might install a breaking change in CI. Hoping to keep this for now for confidence in shared tooling 💌

}
}
4 changes: 0 additions & 4 deletions packages/cli-hooks/biome.json

This file was deleted.

6 changes: 1 addition & 5 deletions packages/cli-hooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,9 @@
"url": "https://github.com/slackapi/node-slack-sdk/issues"
},
"scripts": {
"prebuild": "shx rm -rf ./coverage",
"build": "shx chmod +x src/*.js",
"prebuild": "shx rm -rf ./coverage",
"prelint": "tsc --noemit --module es2022 --maxNodeModuleJsDepth 0 --project ./jsconfig.json",
"lint": "npx @biomejs/biome check .",
"lint:fix": "npx @biomejs/biome check --write .",
"pretest": "npm run lint",
"test": "c8 --config ./test/.c8rc.json mocha --config ./test/.mocharc.json src/*.spec.js"
},
"bin": {
Expand All @@ -55,7 +52,6 @@
"semver": "^7.5.4"
},
"devDependencies": {
"@biomejs/biome": "^2.0.5",
"@types/minimist": "^1.2.5",
"@types/mocha": "^10.0.6",
"@types/node": "^25.0.3",
Expand Down
4 changes: 0 additions & 4 deletions packages/cli-test/biome.json

This file was deleted.

7 changes: 2 additions & 5 deletions packages/cli-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,15 @@
"build": "npm run build:clean && tsc",
"build:clean": "shx rm -rf ./dist ./coverage",
"docs": "npx typedoc --plugin typedoc-plugin-markdown",
"lint": "npx @biomejs/biome check .",
"lint:fix": "npx @biomejs/biome check --write .",
"prepare": "npm run build",
"mocha": "cross-env SLACK_CLI_PATH=/doesnt/matter mocha --config ./test/.mocharc.json src/*.spec.ts src/**/*.spec.ts src/**/**/*.spec.ts",
"test": "npm run lint && npm run build && c8 --config ./test/.c8rc.json npm run mocha"
"prepack": "npm run build",
"test": "npm run build && c8 --config ./test/.c8rc.json npm run mocha"
},
"dependencies": {
"tree-kill": "^1.2.2",
"winston": "^3.8.2"
},
"devDependencies": {
"@biomejs/biome": "^2.0.5",
"@tsconfig/recommended": "^1.0.6",
"@types/chai": "^4.3.16",
"@types/mocha": "^10.0.6",
Expand Down
1 change: 1 addition & 0 deletions packages/client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@slack/client",
"version": "5.0.2",
"private": true,
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 package are EOL and shouldn't be published so the private field is used.

Copy link
Member

Choose a reason for hiding this comment

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

question: Should we add rtm-api to the private: true list as well? It's often referred to as legacy but I'm not sure if it's officially EOL.

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 I'm curious about this too, but perhaps we add this to discussion in #2359? IIRC classic apps might still use this but I agree that since it's deprecated we might also mark this package as EOL.

📚 https://docs.slack.dev/changelog/2024-09-legacy-custom-bots-classic-apps-deprecation/

"description": "Legacy wrapper for official Slack Platform's Web API, RTM API, and Incoming Webhook libraries. Use @slack/web-api, @slack/rtm-api, or @slack/webhook instead.",
"author": "Slack Technologies, LLC",
"license": "MIT",
Expand Down
1 change: 1 addition & 0 deletions packages/events-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@slack/events-api",
"version": "3.0.1",
"private": true,
"description": "Official library for using the Slack Platform's Web API",
"author": "Slack Technologies, LLC",
"license": "MIT",
Expand Down
1 change: 1 addition & 0 deletions packages/interactive-messages/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@slack/interactive-messages",
"version": "2.0.2",
"private": true,
"description": "Official library for using the Slack Platform's Interactive Buttons, Menus, Dialogs, Actions, and Block Actions",
"author": "Slack Technologies, LLC",
"license": "MIT",
Expand Down
4 changes: 0 additions & 4 deletions packages/logger/biome.json

This file was deleted.

7 changes: 2 additions & 5 deletions packages/logger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,17 @@
"url": "https://github.com/slackapi/node-slack-sdk/issues"
},
"scripts": {
"prepare": "npm run build",
"build": "npm run build:clean && tsc",
"build:clean": "shx rm -rf ./dist ./coverage",
"docs": "npx typedoc --plugin typedoc-plugin-markdown",
"lint": "npx @biomejs/biome check .",
"lint:fix": "npx @biomejs/biome check --write .",
"test": "npm run lint && npm run test:unit",
"prepack": "npm run build",
"test": "npm run test:unit",
"test:unit": "npm run build && node --import tsx --test src/index.test.ts"
},
"dependencies": {
"@types/node": ">=18.0.0"
},
"devDependencies": {
"@biomejs/biome": "^2.0.5",
"shx": "^0.4.0",
"source-map-support": "^0.5.21",
"tsx": "^4.20.6",
Expand Down
4 changes: 0 additions & 4 deletions packages/oauth/biome.json

This file was deleted.

9 changes: 3 additions & 6 deletions packages/oauth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,12 @@
"url": "https://github.com/slackapi/node-slack-sdk/issues"
},
"scripts": {
"prepare": "npm run build",
"build": "npm run build:clean && tsc",
"build:clean": "shx rm -rf ./dist ./coverage",
"docs": "npx typedoc --plugin typedoc-plugin-markdown",
"lint": "npx @biomejs/biome check .",
"lint:fix": "npx @biomejs/biome check --write .",
"test": "npm run lint && npm run coverage",
"coverage": "npm run build && c8 --config ./test/.c8rc.json npm run test:mocha",
"docs": "npx typedoc --plugin typedoc-plugin-markdown",
"prepack": "npm run build",
"test": "npm run coverage",
"test:mocha": "mocha --config ./test/.mocharc.json src/*.spec.ts src/**/*.spec.ts",
"watch": "npx nodemon --watch 'src' --ext 'ts' --exec npm run build"
},
Expand All @@ -47,7 +45,6 @@
"jsonwebtoken": "^9"
},
"devDependencies": {
"@biomejs/biome": "^2.0.5",
"@types/chai": "^4",
"@types/mocha": "^10",
"@types/sinon": "^21",
Expand Down
4 changes: 0 additions & 4 deletions packages/rtm-api/biome.json

This file was deleted.

7 changes: 2 additions & 5 deletions packages/rtm-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,11 @@
"url": "https://github.com/slackapi/node-slack-sdk/issues"
},
"scripts": {
"prepare": "npm run build",
"build": "npm run build:clean && tsc",
"build:clean": "shx rm -rf ./dist",
"docs": "npx typedoc --plugin typedoc-plugin-markdown",
"lint": "npx @biomejs/biome check .",
"lint:fix": "npx @biomejs/biome check --write .",
"test": "npm run lint && npm run build && npm run test:integration",
"prepack": "npm run build",
"test": "npm run build && npm run test:integration",
"test:integration": "mocha --config .mocharc.json test/integration.spec.js"
},
"dependencies": {
Expand All @@ -54,7 +52,6 @@
"ws": "^8"
},
"devDependencies": {
"@biomejs/biome": "^2.0.5",
"@types/chai": "^4",
"@types/mocha": "^10",
"@types/sinon": "^17",
Expand Down
4 changes: 0 additions & 4 deletions packages/socket-mode/biome.json

This file was deleted.

Loading