From 87118a61505cb780845d250ffdb3e6e84afd7844 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Mon, 26 Jan 2026 14:54:54 -0800 Subject: [PATCH 01/15] build: setup monorepo workspace for dependent packagings --- .github/workflows/ci-build.yml | 60 ++++++++++--------------------- package.json | 21 +++++++++++ packages/oauth/package.json | 4 +-- packages/rtm-api/package.json | 8 ++--- packages/socket-mode/package.json | 4 +-- packages/web-api/package.json | 2 +- packages/webhook/package.json | 2 +- 7 files changed, 50 insertions(+), 51 deletions(-) create mode 100644 package.json diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 66d4d9644..18e263f27 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -41,48 +41,26 @@ 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 workspace dependencies + run: npm install --verbose + - name: Build dependency packages 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 }} - 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 }} + # Requires no internal dependencies + npm run build --workspace=@slack/cli-hooks + npm run build --workspace=@slack/cli-test + npm run build --workspace=@slack/logger + npm run build --workspace=@slack/types + + # Some internal dependencies + npm run build --workspace=@slack/web-api + npm run build --workspace=@slack/webhook + + # Requires the Web API package + npm run build --workspace=@slack/oauth + npm run build --workspace=@slack/rtm-api + npm run build --workspace=@slack/socket-mode + - name: Run tests + run: npm test --workspace=@slack/${{ matrix.package }} - name: Check for coverage report existence id: check_coverage uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0 diff --git a/package.json b/package.json new file mode 100644 index 000000000..34d5a4420 --- /dev/null +++ b/package.json @@ -0,0 +1,21 @@ +{ + "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" + ] +} diff --git a/packages/oauth/package.json b/packages/oauth/package.json index 1ac424ca8..83a7b944f 100644 --- a/packages/oauth/package.json +++ b/packages/oauth/package.json @@ -40,8 +40,8 @@ "watch": "npx nodemon --watch 'src' --ext 'ts' --exec npm run build" }, "dependencies": { - "@slack/logger": "^4", - "@slack/web-api": "^7.10.0", + "@slack/logger": "^4.0.0", + "@slack/web-api": "^7.13.0", "@types/jsonwebtoken": "^9", "@types/node": ">=18", "jsonwebtoken": "^9" diff --git a/packages/rtm-api/package.json b/packages/rtm-api/package.json index 11c58d7ec..8d3fdd620 100644 --- a/packages/rtm-api/package.json +++ b/packages/rtm-api/package.json @@ -34,18 +34,18 @@ "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", - "test:integration": "mocha --config .mocharc.json test/integration.spec.js" + "test:integration": "mocha --config .mocharc.json test/integration.spec.js", + "prepare": "npm run build" }, "dependencies": { - "@slack/logger": "^4", - "@slack/web-api": "^7.10.0", + "@slack/logger": "^4.0.0", + "@slack/web-api": "^7.13.0", "@types/node": ">=18", "eventemitter3": "^5", "finity": "^0.5.4", diff --git a/packages/socket-mode/package.json b/packages/socket-mode/package.json index 068d2cb3a..f57fd9f79 100644 --- a/packages/socket-mode/package.json +++ b/packages/socket-mode/package.json @@ -49,8 +49,8 @@ "watch": "npx nodemon --watch 'src' --ext 'ts' --exec npm test" }, "dependencies": { - "@slack/logger": "^4", - "@slack/web-api": "^7.10.0", + "@slack/logger": "^4.0.0", + "@slack/web-api": "^7.13.0", "@types/node": ">=18", "@types/ws": "^8", "eventemitter3": "^5", diff --git a/packages/web-api/package.json b/packages/web-api/package.json index 36ffc23bf..c41da4903 100644 --- a/packages/web-api/package.json +++ b/packages/web-api/package.json @@ -49,7 +49,7 @@ }, "dependencies": { "@slack/logger": "^4.0.0", - "@slack/types": "^2.18.0", + "@slack/types": "^2.19.0", "@types/node": ">=18.0.0", "@types/retry": "0.12.0", "axios": "^1.11.0", diff --git a/packages/webhook/package.json b/packages/webhook/package.json index 98ab5065c..99e2186f7 100644 --- a/packages/webhook/package.json +++ b/packages/webhook/package.json @@ -41,7 +41,7 @@ "test:unit": "npm run build && c8 --config ./test/.c8rc.json npm run mocha" }, "dependencies": { - "@slack/types": "^2.9.0", + "@slack/types": "^2.19.0", "@types/node": ">=18.0.0", "axios": "^1.11.0" }, From aaab8b4d0eb5e459e726fef0b1109f73cba867f2 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Mon, 26 Jan 2026 14:58:27 -0800 Subject: [PATCH 02/15] revert: undo package bumps --- packages/oauth/package.json | 4 ++-- packages/rtm-api/package.json | 8 ++++---- packages/socket-mode/package.json | 4 ++-- packages/web-api/package.json | 2 +- packages/webhook/package.json | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/oauth/package.json b/packages/oauth/package.json index 83a7b944f..1ac424ca8 100644 --- a/packages/oauth/package.json +++ b/packages/oauth/package.json @@ -40,8 +40,8 @@ "watch": "npx nodemon --watch 'src' --ext 'ts' --exec npm run build" }, "dependencies": { - "@slack/logger": "^4.0.0", - "@slack/web-api": "^7.13.0", + "@slack/logger": "^4", + "@slack/web-api": "^7.10.0", "@types/jsonwebtoken": "^9", "@types/node": ">=18", "jsonwebtoken": "^9" diff --git a/packages/rtm-api/package.json b/packages/rtm-api/package.json index 8d3fdd620..11c58d7ec 100644 --- a/packages/rtm-api/package.json +++ b/packages/rtm-api/package.json @@ -34,18 +34,18 @@ "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", - "test:integration": "mocha --config .mocharc.json test/integration.spec.js", - "prepare": "npm run build" + "test:integration": "mocha --config .mocharc.json test/integration.spec.js" }, "dependencies": { - "@slack/logger": "^4.0.0", - "@slack/web-api": "^7.13.0", + "@slack/logger": "^4", + "@slack/web-api": "^7.10.0", "@types/node": ">=18", "eventemitter3": "^5", "finity": "^0.5.4", diff --git a/packages/socket-mode/package.json b/packages/socket-mode/package.json index f57fd9f79..068d2cb3a 100644 --- a/packages/socket-mode/package.json +++ b/packages/socket-mode/package.json @@ -49,8 +49,8 @@ "watch": "npx nodemon --watch 'src' --ext 'ts' --exec npm test" }, "dependencies": { - "@slack/logger": "^4.0.0", - "@slack/web-api": "^7.13.0", + "@slack/logger": "^4", + "@slack/web-api": "^7.10.0", "@types/node": ">=18", "@types/ws": "^8", "eventemitter3": "^5", diff --git a/packages/web-api/package.json b/packages/web-api/package.json index c41da4903..36ffc23bf 100644 --- a/packages/web-api/package.json +++ b/packages/web-api/package.json @@ -49,7 +49,7 @@ }, "dependencies": { "@slack/logger": "^4.0.0", - "@slack/types": "^2.19.0", + "@slack/types": "^2.18.0", "@types/node": ">=18.0.0", "@types/retry": "0.12.0", "axios": "^1.11.0", diff --git a/packages/webhook/package.json b/packages/webhook/package.json index 99e2186f7..98ab5065c 100644 --- a/packages/webhook/package.json +++ b/packages/webhook/package.json @@ -41,7 +41,7 @@ "test:unit": "npm run build && c8 --config ./test/.c8rc.json npm run mocha" }, "dependencies": { - "@slack/types": "^2.19.0", + "@slack/types": "^2.9.0", "@types/node": ">=18.0.0", "axios": "^1.11.0" }, From 560145326baff01db1099d766cd87f85a200983a Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Mon, 26 Jan 2026 15:08:12 -0800 Subject: [PATCH 03/15] ci: ignore prepare script when installing packagse --- .github/workflows/ci-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 18e263f27..0b0f32cf6 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -42,7 +42,7 @@ jobs: node-version: ${{ matrix.node-version }} - run: npm --version - name: Install workspace dependencies - run: npm install --verbose + run: npm install --ignore-scripts --verbose - name: Build dependency packages run: | # Requires no internal dependencies From d85e8ce2d5f6e565faf1457e83a079a2c1dbc2c2 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Mon, 26 Jan 2026 15:44:18 -0800 Subject: [PATCH 04/15] build: replace prepare script with prepublish only --- .github/workflows/ci-build.yml | 12 +++++++----- packages/cli-hooks/package.json | 4 ++-- packages/cli-test/package.json | 2 +- packages/logger/package.json | 2 +- packages/oauth/package.json | 4 ++-- packages/rtm-api/package.json | 2 +- packages/socket-mode/package.json | 6 +++--- packages/types/package.json | 2 +- packages/web-api/package.json | 4 ++-- packages/webhook/package.json | 2 +- 10 files changed, 21 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 0b0f32cf6..468283f85 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -42,20 +42,22 @@ jobs: node-version: ${{ matrix.node-version }} - run: npm --version - name: Install workspace dependencies - run: npm install --ignore-scripts --verbose - - name: Build dependency packages + run: npm install --verbose + - name: Build packages run: | - # Requires no internal dependencies + # 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 - # Some internal dependencies + # Build packages requiring base dependencies npm run build --workspace=@slack/web-api npm run build --workspace=@slack/webhook - # Requires the Web API package + # 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 diff --git a/packages/cli-hooks/package.json b/packages/cli-hooks/package.json index 928f6acc9..ba3434394 100644 --- a/packages/cli-hooks/package.json +++ b/packages/cli-hooks/package.json @@ -35,11 +35,11 @@ "url": "https://github.com/slackapi/node-slack-sdk/issues" }, "scripts": { - "prebuild": "shx rm -rf ./coverage", "build": "shx chmod +x src/*.js", - "prelint": "tsc --noemit --module es2022 --maxNodeModuleJsDepth 0 --project ./jsconfig.json", "lint": "npx @biomejs/biome check .", "lint:fix": "npx @biomejs/biome check --write .", + "prebuild": "shx rm -rf ./coverage", + "prelint": "tsc --noemit --module es2022 --maxNodeModuleJsDepth 0 --project ./jsconfig.json", "pretest": "npm run lint", "test": "c8 --config ./test/.c8rc.json mocha --config ./test/.mocharc.json src/*.spec.js" }, diff --git a/packages/cli-test/package.json b/packages/cli-test/package.json index 2cb752a67..3469778a3 100644 --- a/packages/cli-test/package.json +++ b/packages/cli-test/package.json @@ -30,8 +30,8 @@ "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", + "prepublishOnly": "npm run build", "test": "npm run lint && npm run build && c8 --config ./test/.c8rc.json npm run mocha" }, "dependencies": { diff --git a/packages/logger/package.json b/packages/logger/package.json index 14b36b2e4..058e6c926 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -26,12 +26,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 .", + "prepublishOnly": "npm run build", "test": "npm run lint && npm run test:unit", "test:unit": "npm run build && node --import tsx --test src/index.test.ts" }, diff --git a/packages/oauth/package.json b/packages/oauth/package.json index 1ac424ca8..b22ecaedf 100644 --- a/packages/oauth/package.json +++ b/packages/oauth/package.json @@ -28,14 +28,14 @@ "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", + "coverage": "npm run build && c8 --config ./test/.c8rc.json npm run test:mocha", "docs": "npx typedoc --plugin typedoc-plugin-markdown", "lint": "npx @biomejs/biome check .", "lint:fix": "npx @biomejs/biome check --write .", + "prepublishOnly": "npm run build", "test": "npm run lint && npm run coverage", - "coverage": "npm run build && c8 --config ./test/.c8rc.json npm run test:mocha", "test:mocha": "mocha --config ./test/.mocharc.json src/*.spec.ts src/**/*.spec.ts", "watch": "npx nodemon --watch 'src' --ext 'ts' --exec npm run build" }, diff --git a/packages/rtm-api/package.json b/packages/rtm-api/package.json index 11c58d7ec..c40ad66f7 100644 --- a/packages/rtm-api/package.json +++ b/packages/rtm-api/package.json @@ -34,12 +34,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", "docs": "npx typedoc --plugin typedoc-plugin-markdown", "lint": "npx @biomejs/biome check .", "lint:fix": "npx @biomejs/biome check --write .", + "prepublishOnly": "npm run build", "test": "npm run lint && npm run build && npm run test:integration", "test:integration": "mocha --config .mocharc.json test/integration.spec.js" }, diff --git a/packages/socket-mode/package.json b/packages/socket-mode/package.json index 068d2cb3a..ef1e0a71d 100644 --- a/packages/socket-mode/package.json +++ b/packages/socket-mode/package.json @@ -36,16 +36,16 @@ "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:unit": "mocha --config ./test/.mocharc.json src/**/*.spec.ts", + "prepublishOnly": "npm run build", + "test": "npm run lint && npm run build && npm run test:coverage && npm run test:integration", "test:coverage": "c8 --config ./test/.c8rc.json npm run test:unit", "test:integration": "mocha --config ./test/.mocharc.json test/integration.spec.js", - "test": "npm run lint && npm run build && npm run test:coverage && npm run test:integration", + "test:unit": "mocha --config ./test/.mocharc.json src/**/*.spec.ts", "watch": "npx nodemon --watch 'src' --ext 'ts' --exec npm test" }, "dependencies": { diff --git a/packages/types/package.json b/packages/types/package.json index 59af1faee..d1d6c22ba 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -28,12 +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", "docs": "npx typedoc --plugin typedoc-plugin-markdown", "lint": "npx @biomejs/biome check .", "lint:fix": "npx @biomejs/biome check --write .", + "prepublishOnly": "npm run build", "test": "npm run lint && npm run build && npm run test:types", "test:types": "tsd" }, diff --git a/packages/web-api/package.json b/packages/web-api/package.json index 36ffc23bf..389d73240 100644 --- a/packages/web-api/package.json +++ b/packages/web-api/package.json @@ -33,18 +33,18 @@ "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 .", "mocha": "mocha --config ./test/.mocharc.json \"./src/**/*.spec.ts\"", + "prepublishOnly": "npm run build", "test": "npm run lint && npm run test:types && npm run test:integration && npm run test:unit", "test:integration": "npm run build && node test/integration/commonjs-project/index.js && node test/integration/esm-project/index.mjs && npm run test:integration:ts", "test:integration:ts": "cd test/integration/ts-4.7-project && npm i && npm run build", - "test:unit": "npm run build && c8 --config ./test/.c8rc.json npm run mocha", "test:types": "tsd", + "test:unit": "npm run build && c8 --config ./test/.c8rc.json npm run mocha", "watch": "npx nodemon --watch 'src' --ext 'ts' --exec npm run build" }, "dependencies": { diff --git a/packages/webhook/package.json b/packages/webhook/package.json index 98ab5065c..4e9e8ecf8 100644 --- a/packages/webhook/package.json +++ b/packages/webhook/package.json @@ -30,13 +30,13 @@ "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 .", "mocha": "mocha --config ./test/.mocharc.json src/*.spec.ts", + "prepublishOnly": "npm run build", "test": "npm run lint && npm run test:unit", "test:unit": "npm run build && c8 --config ./test/.c8rc.json npm run mocha" }, From 3fdec0e352831575ab7407e2c66c8054daa6b204 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Mon, 26 Jan 2026 16:30:59 -0800 Subject: [PATCH 05/15] build: lint the repo instead of packages --- .github/maintainers_guide.md | 136 ++++++++++++++---------------- .github/workflows/ci-build.yml | 9 +- biome.json | 35 +++++++- package.json | 9 +- packages/cli-hooks/biome.json | 4 - packages/cli-hooks/package.json | 4 - packages/cli-test/biome.json | 4 - packages/cli-test/package.json | 5 +- packages/logger/biome.json | 4 - packages/logger/package.json | 5 +- packages/oauth/biome.json | 4 - packages/oauth/package.json | 5 +- packages/rtm-api/biome.json | 4 - packages/rtm-api/package.json | 5 +- packages/socket-mode/biome.json | 4 - packages/socket-mode/package.json | 5 +- packages/types/biome.json | 4 - packages/types/package.json | 5 +- packages/web-api/biome.json | 29 ------- packages/web-api/package.json | 5 +- packages/web-api/src/WebClient.ts | 1 - packages/webhook/biome.json | 4 - packages/webhook/package.json | 5 +- 23 files changed, 121 insertions(+), 174 deletions(-) delete mode 100644 packages/cli-hooks/biome.json delete mode 100644 packages/cli-test/biome.json delete mode 100644 packages/logger/biome.json delete mode 100644 packages/oauth/biome.json delete mode 100644 packages/rtm-api/biome.json delete mode 100644 packages/socket-mode/biome.json delete mode 100644 packages/types/biome.json delete mode 100644 packages/web-api/biome.json delete mode 100644 packages/webhook/biome.json diff --git a/.github/maintainers_guide.md b/.github/maintainers_guide.md index 177c26ea9..72ba09ea7 100644 --- a/.github/maintainers_guide.md +++ b/.github/maintainers_guide.md @@ -3,22 +3,24 @@ This document describes tools, tasks and workflow that one needs to be familiar with in order to effectively maintain this project. If you use this package within your own software but don't plan on modifying it, this guide is **not** for you. Please refer to the [Contributor's Guide](https://github.com/slackapi/node-slack-sdk/blob/main/.github/contributing.md). ## 🛠 Tools + Maintaining this project requires installing [Node.js](https://nodejs.org). All of the remaining tools are downloaded as `devDependencies`, which means you'll have them available once you run `npm install` in a working copy of this repository. ## ✅ Tasks ### ⚗ Testing and Linting -The Node SDK is made up of multiple, individual packages, each with their own tests. As such, tests are run on a per-package basis. However, the top-level directory contains some development dependencies applicable to all packages. As a result, to run tests for any package, first ensure you run `npm install` from the top-level directory. Then, for a given package, navigate to the package's directory (ie, `packages/web-api`) and run `npm install` to install that package's required dependencies. Finally, run `npm test` to run that package's tests. To run just the linting and not the entire test suite, run `npm run lint`. + +The Node SDK is made up of multiple, individual packages, each with their own tests. As such, tests are run on a per-package basis. However, the top-level directory contains some development dependencies applicable to all packages. As a result, to run tests for any package, first ensure you run `npm install` from the top-level directory. Then, for a given package, navigate to the package's directory (ie, `packages/web-api`) and run `npm test` to run that package's tests. To run just the linting and not the entire test suite, run `npm run lint` from the root directory. This project has tests for individual packages as `*.spec.js` files and inside of each's package's `src` directory. Also, for verifying the behavior with the real Slack server-side and developer experience with installed packages, you can run the tests amd scripts under `prod-server-integration-tests`. Refer to the README file in the directory for details. These tests are supposed to be run in the project maintainers' manual execution. They are not part of CI builds for now. Upon opening a PR, tests are executed by GitHub Actions, our continuous integration system. GitHub Actions runs several, more granular builds in order to report on success and failure in a more targeted way. - - There is one build for each package on each supported version of Node, as well as one for the integration tests on each supported version of Node. +- There is one build for each package on each supported version of Node, as well as one for the integration tests on each supported version of Node. - - GitHub Actions runs linting in each package, which is separate from tests so you can run tests locally frequently without having to block for fixing styling problems. +- GitHub Actions runs linting in each package, which is separate from tests so you can run tests locally frequently without having to block for fixing styling problems. - - GitHub Actions uploads the coverage report for the tests ran within the build to Codecov, our coverage reporting system. GitHub reports status on each PR. Codecov aggregates all the coverage reports, and separate reports status on each PR. The configuration is stored in `.github/workflows/ci-build.yml`. +- GitHub Actions uploads the coverage report for the tests ran within the build to Codecov, our coverage reporting system. GitHub reports status on each PR. Codecov aggregates all the coverage reports, and separate reports status on each PR. The configuration is stored in `.github/workflows/ci-build.yml`. Test code should be written in syntax that runs on the oldest supported Node.js version. This ensures that backwards compatibility is tested and the APIs look reasonable in versions of Node.js that do not support the most modern syntax. @@ -57,168 +59,160 @@ npm run docs The script places the reference markdown files in `/docs/english/reference/package-name`. ### 🚀 Releases + _For beta releases, see [**Beta Releases**](https://github.com/slackapi/node-slack-sdk/blob/main/.github/maintainers_guide.md#-beta-releases) section below_ Releasing can feel intimidating at first, but rest assured: if you make a mistake, don't fret! npm allows you to unpublish a release within the first 72 hours of publishing (you just won’t be able to use the same version number again). Venture on! 1. Check the status of the package's GitHub Milestone for issues that should be shipped with the release. + - If all issues have been closed, continue with the release. - - If all issues have been closed, continue with the release. + - If issues are still open, discuss with the team about whether the open issues should be moved to a future release or if the release should be held off until the issues are resolved. - - If issues are still open, discuss with the team about whether the open issues should be moved to a future release or if the release should be held off until the issues are resolved. - - - Take a look at all issues under the Milestone to make sure that the type of issues included aligns with the Milestone name based on [semantic versioning](https://semver.org/). If the issues do not align with the naming of the Milestone (ex: if the issues are all bug fixes, but the Milestone is labeled as a minor release), then you can tweak the Milestone name to reflect the correct versioning. + - Take a look at all issues under the Milestone to make sure that the type of issues included aligns with the Milestone name based on [semantic versioning](https://semver.org/). If the issues do not align with the naming of the Milestone (ex: if the issues are all bug fixes, but the Milestone is labeled as a minor release), then you can tweak the Milestone name to reflect the correct versioning. 2. Make sure your local `main` branch has the latest changes (i.e. `git checkout main && git pull --tags origin main`). Then, open a new branch off of your local `main` branch for the release (i.e. `git checkout -b -`). 3. Navigate to the specific package(s) you're releasing in the `packages/` directory. -4. For each package to be released, run `npm run test` to verify that tests are passing and code is free of linting errors. +4. For each package to be released, run `npm run test` to verify that tests are passing. 5. On our new branch, bump the version(s) in `package.json` (see [Versioning and Tags](https://github.com/slackapi/node-slack-sdk/blob/main/.github/maintainers_guide.md#-versioning-and-tags)) + - Generate the reference docs for that package by running `npm run docs`. - - Generate the reference docs for that package by running `npm run docs`. - - - Make a single commit for the version(s) bump, following the format in: ([Example](https://github.com/slackapi/node-slack-sdk/commit/ff03f7812c678bdc5cea5eace75db34631a88dda)) + - Make a single commit for the version(s) bump, following the format in: ([Example](https://github.com/slackapi/node-slack-sdk/commit/ff03f7812c678bdc5cea5eace75db34631a88dda)) - - Create a pull request for the version change ([Example](https://github.com/slackapi/node-slack-sdk/pull/2402)) + - Create a pull request for the version change ([Example](https://github.com/slackapi/node-slack-sdk/pull/2402)) - - Add appropriate labels on the PR, including `release`, `pkg:*`, and `semver:*` + - Add appropriate labels on the PR, including `release`, `pkg:*`, and `semver:*` - - Add appropriate milestone on the PR + - Add appropriate milestone on the PR 6. Once the PR has been approved and tests have passed, merge it into the main repository. + - Check out your local `main` branch and update it to get the latest changes: `git checkout main && git pull origin main` - - Check out your local `main` branch and update it to get the latest changes: `git checkout main && git pull origin main` - - - Add a version tag (ie, `git tag @slack/web-api@5.6.0`) + - Add a version tag (ie, `git tag @slack/web-api@5.6.0`) - - Push the new tag up to origin: `git push origin @slack/web-api@5.6.0` + - Push the new tag up to origin: `git push origin @slack/web-api@5.6.0` 7. Publish the release to npm - - To publish, you need to be a member of the `slack Org` on npm and set up 2-Factor Auth with your password generator of choice. Before you can publish with npm, you must run `npm login` from the command line. + - To publish, you need to be a member of the `slack Org` on npm and set up 2-Factor Auth with your password generator of choice. Before you can publish with npm, you must run `npm login` from the command line. - - As the final validation, within the package directory (ex: `packages/types`), run `mv package-lock.json package-lock.json.bk && rm -rf node_modules/ dist/ && npm i && npm test && npm pack` and confirm if there are `*.js`, `*.d.ts` files under the `dist` directory. + - As the final validation, within the package directory (ex: `packages/types`), run `mv package-lock.json package-lock.json.bk && rm -rf node_modules/ dist/ && npm i && npm test && npm pack` and confirm if there are `*.js`, `*.d.ts` files under the `dist` directory. - - Run `npm publish . --otp YOUR_OTP_CODE`. To generate an OTP (One Time Password), use your password generator of choice (Duo, 1Password) + - Run `npm publish . --otp YOUR_OTP_CODE`. To generate an OTP (One Time Password), use your password generator of choice (Duo, 1Password) 8. Close GitHub Milestone + - Close the relevant GitHub Milestone for the release - - Close the relevant GitHub Milestone for the release + - Check the existing GitHub Milestones to see if the next minor version exists. If it doesn't, then create a GitHub Milestone for new issues to live in. Typically, you'll create a new minor version - however, if there are any bugs that need to be carried over from the current GitHub Milestone, you could make a Milestone for a patch version to reflect those issues - - Check the existing GitHub Milestones to see if the next minor version exists. If it doesn't, then create a GitHub Milestone for new issues to live in. Typically, you'll create a new minor version - however, if there are any bugs that need to be carried over from the current GitHub Milestone, you could make a Milestone for a patch version to reflect those issues - - - Move any unfinished, open issues to the next GitHub Milestone + - Move any unfinished, open issues to the next GitHub Milestone 9. Create GitHub Release with release notes + - From the repository, navigate to the **Releases** section and select [Draft a new release](https://github.com/slackapi/node-slack-sdk/releases/new) - - From the repository, navigate to the **Releases** section and select [Draft a new release](https://github.com/slackapi/node-slack-sdk/releases/new) - - - When creating the release notes, select the tag you generated earlier for your release and title the release the same name as the tag + - When creating the release notes, select the tag you generated earlier for your release and title the release the same name as the tag - - To see a list of changes between the last tag for the specific package, you can use this `git` command: `git log --oneline --full-history @slack/types@2.8.0..@slack/types@2.9.0 -- packages/types`. Sub in the correct tags and the last argument should be the path to the sub-package you are releasing (in order to filter commits just to the specific path). + - To see a list of changes between the last tag for the specific package, you can use this `git` command: `git log --oneline --full-history @slack/types@2.8.0..@slack/types@2.9.0 -- packages/types`. Sub in the correct tags and the last argument should be the path to the sub-package you are releasing (in order to filter commits just to the specific path). - - Release notes should mention contributors, issues, PRs, milestone, and link to npm package ([Example](https://github.com/slackapi/node-slack-sdk/releases/tag/%40slack%2Ftypes%402.17.0)) + - Release notes should mention contributors, issues, PRs, milestone, and link to npm package ([Example](https://github.com/slackapi/node-slack-sdk/releases/tag/%40slack%2Ftypes%402.17.0)) - - Once the release notes are ready, click the "Publish Release" button to make them public + - Once the release notes are ready, click the "Publish Release" button to make them public 10. Communicate the release (as appropriate) - - **Internal** - - Include a brief description and link to the GitHub release - **External** - - **Slack Community Hangout** (`community.slack.com/`) in **#lang-javascript**. Include a link to the package on `npmjs.com/package/@slack/` as well as the release notes. ([Example](https://community.slack.com/archives/CHF1FKX4J/p1657293144932579)) - **Twitter**: Primarily for major updates. Coordinate with Developer Marketing. ### 🚧 Beta Releases -1. Make sure your local `main` branch has the latest changes - - Run `git rebase main` from your feature branch (this will rebase your feature branch from `main`). You can opt for `git merge main` if you are not comfortable with rebasing. +1. Make sure your local `main` branch has the latest changes + - Run `git rebase main` from your feature branch (this will rebase your feature branch from `main`). You can opt for `git merge main` if you are not comfortable with rebasing. - - If you do not have a feature branch, you can also use generic release candidate branch name like `rc`, i.e. `2.5.0rc`. + - If you do not have a feature branch, you can also use generic release candidate branch name like `rc`, i.e. `2.5.0rc`. 2. Navigate to the specific package(s) you're releasing in the `packages/` directory. -3. For each package to be released, run `npm it` to install the latest dependencies and verify that everything is working and free of linting errors. +3. For each package to be released, run `npm it` to install the latest dependencies and verify that everything is working and free of errors. 4. Bump the version(s) in `package.json` + - The version must be in the format of `Major.Minor.Patch-BetaNamespace.BetaVersion` (ex: `5.10.0-workflowStepsBeta.1`, `2.5.0-rc.1`) - - The version must be in the format of `Major.Minor.Patch-BetaNamespace.BetaVersion` (ex: `5.10.0-workflowStepsBeta.1`, `2.5.0-rc.1`) - - - Make a single commit for the version bump ([Example](https://github.com/slackapi/node-slack-sdk/commit/1503609d79abf035e9e21bad7360e124e4211594)) + - Make a single commit for the version bump ([Example](https://github.com/slackapi/node-slack-sdk/commit/1503609d79abf035e9e21bad7360e124e4211594)) - - Create a pull request for the version change against the corresponding feature branch in the main repository ([Example](https://github.com/slackapi/node-slack-sdk/pull/1244)) + - Create a pull request for the version change against the corresponding feature branch in the main repository ([Example](https://github.com/slackapi/node-slack-sdk/pull/1244)) - - Add appropriate labels, including `release` + - Add appropriate labels, including `release` 5. Once the PR's checks and tests have passed, merge it into the corresponding feature branch on the main repository. If you would like a review on the pull request or feel that the specific release you're doing requires extra attention, you can wait for an approval, but it is optional for this type of PR. + - Update your local main branch: `git pull origin ` - - Update your local main branch: `git pull origin ` - - - Add a version tag (ie, `git tag @slack/web-api@5.10.0-workflowStepsBeta.1`) + - Add a version tag (ie, `git tag @slack/web-api@5.10.0-workflowStepsBeta.1`) - - Push the new tag up to origin: `git push --tags origin` + - Push the new tag up to origin: `git push --tags origin` 6. Publish the release to npm + - Run `npm publish --tag . --otp YOUR_OTP_CODE` + - `` should be a label representative of the beta release. It could be feature-specific (i.e. `feat-token-rotation`) or it can be a generic release candidate (i.e. `2.5.0rc`). Whatever you decide: it must _not_ be `latest`, as that is reserved for non-beta releases. - - Run `npm publish --tag . --otp YOUR_OTP_CODE` - - - `` should be a label representative of the beta release. It could be feature-specific (i.e. `feat-token-rotation`) or it can be a generic release candidate (i.e. `2.5.0rc`). Whatever you decide: it must _not_ be `latest`, as that is reserved for non-beta releases. - - - To generate an OTP (One Time Password), use your password generator of choice (Duo, 1Password) + - To generate an OTP (One Time Password), use your password generator of choice (Duo, 1Password) 7. Test that the publish was successful - - - Run `npm info dist-tags` + - Run `npm info dist-tags` 8. Create GitHub Release(s) with release notes + - From the repository, navigate to the **Releases** section and draft a new release - - From the repository, navigate to the **Releases** section and draft a new release + - Release notes should mention the beta feature (if applicable), contributors, issues and PRs ([Example](https://github.com/slackapi/node-slack-sdk/releases/tag/%40slack%2Ftypes%401.8.0-workflowStepsBeta.2)) - - Release notes should mention the beta feature (if applicable), contributors, issues and PRs ([Example](https://github.com/slackapi/node-slack-sdk/releases/tag/%40slack%2Ftypes%401.8.0-workflowStepsBeta.2)) - - - Select the **This is a pre-release** checkbox + - Select the **This is a pre-release** checkbox ## đŸ“„ Workflow ### 🔖 Versioning and Tags + This project is versioned using [Semantic Versioning](http://semver.org/), particularly in the [npm flavor](https://docs.npmjs.com/getting-started/semantic-versioning). Each release is tagged using git. The naming convention for tags is `{package_name}@{version}`. For example, the tag `@slack/web-api@v5.0.0` marks the v5.0.0 release of the `@slack/web-api` package. A single commit will have multiple tags when multiple packages are released simultaneously. One package that expands upon the standard major.minor.patch version schema typically associated with Semantic Versioning is the `@slack/cli-test` package. This package employs standard major.minor.patch version, in addition to a [build metadata suffix](https://semver.org/#spec-item-10) suffix of the form `+cli.X.Y.Z`, e.g. `0.1.0+cli.2.24.0`. The version after `+cli.` communicates compatibility between the `@slack/cli-test` package and the [Slack CLI](https://docs.slack.dev/tools/slack-cli/) itself. ### đŸȘ” Branches + `main` is where active development occurs. Long running named feature branches are occasionally created for collaboration on a feature that has a large scope (because everyone cannot push commits to another person's open Pull Request). After a major version increment, a maintenance branch for the older major version is left open (e.g. `v3`, `v4`, etc). When resolving issues or implementing features into the repository, you will almost always work off of a dedicated branch that lives on your forked copy of the repository. ## đŸ‘©đŸ»â€đŸ”§ Issue Management + ### đŸ· Labels + Labels are used to run issues through an organized workflow. Here are the basic definitions: -* `bug`: A confirmed bug report. A bug is considered confirmed when reproduction steps have been documented and the +- `bug`: A confirmed bug report. A bug is considered confirmed when reproduction steps have been documented and the issue has been reproduced by a maintainer. -* `enhancement`: A feature request for something this package might not already do. -* `docs`: An issue that is purely about documentation work. -* `tests`: An issue that is purely about testing work. -* `needs feedback`: An issue that may have claimed to be a bug but was not reproducible, or was otherwise missing some +- `enhancement`: A feature request for something this package might not already do. +- `docs`: An issue that is purely about documentation work. +- `tests`: An issue that is purely about testing work. +- `needs feedback`: An issue that may have claimed to be a bug but was not reproducible, or was otherwise missing some information. -* `discussion`: An issue that is purely meant to hold a discussion. Typically the maintainers are looking for feedback +- `discussion`: An issue that is purely meant to hold a discussion. Typically the maintainers are looking for feedback in these issues. -* `question`: An issue that is like a support request where the user needed more information or their usage was not +- `question`: An issue that is like a support request where the user needed more information or their usage was not correct. -* `security`: An issue that has special consideration for security reasons. -* `good first contribution`: An issue that has a well-defined relatively-small scope, with clear expectations. It helps +- `security`: An issue that has special consideration for security reasons. +- `good first contribution`: An issue that has a well-defined relatively-small scope, with clear expectations. It helps when the testing approach is also known. -* `duplicate`: An issue that is functionally the same as another issue. Apply this only if you've linked the other issue +- `duplicate`: An issue that is functionally the same as another issue. Apply this only if you've linked the other issue by number. -* `semver:major|minor|patch`: Metadata about how resolving this issue would affect the version number. -* `pkg:*`: Metadata about which package(s) this issue affects. +- `semver:major|minor|patch`: Metadata about how resolving this issue would affect the version number. +- `pkg:*`: Metadata about which package(s) this issue affects. ### 📬 Triage + Triaging is the process of investigating new issues, assigning them an appropriate label, and responding to the submitting developer. An issue should have **one** of the following labels applied: `bug`, `enhancement`, `question`, `needs feedback`, `docs`, `tests`, or `discussion`. Issues are closed when a resolution has been reached. If for any reason a closed issue seems relevant once again, reopening the issue is preferable over creating a duplicate issue. diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 468283f85..fa8b830f6 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -41,8 +41,9 @@ jobs: with: node-version: ${{ matrix.node-version }} - run: npm --version - - name: Install workspace dependencies - run: npm install --verbose + - name: Install dependencies + run: | + npm install --verbose - name: Build packages run: | # Build packages without internal dependencies @@ -62,7 +63,9 @@ jobs: npm run build --workspace=@slack/rtm-api npm run build --workspace=@slack/socket-mode - name: Run tests - run: npm test --workspace=@slack/${{ matrix.package }} + run: | + 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 diff --git a/biome.json b/biome.json index 7329e5f82..ff88fccd0 100644 --- a/biome.json +++ b/biome.json @@ -7,6 +7,14 @@ } } }, + "files": { + "includes": [ + "packages/**", + "!!packages/client", + "!!packages/events-api", + "!!packages/interactive-messages" + ] + }, "formatter": { "enabled": true, "formatWithErrors": false, @@ -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" + } + } + } + } + ] } diff --git a/package.json b/package.json index 34d5a4420..56f3c87da 100644 --- a/package.json +++ b/package.json @@ -17,5 +17,12 @@ "packages/types", "packages/web-api", "packages/webhook" - ] + ], + "scripts": { + "lint": "npx @biomejs/biome check packages", + "lint:fix": "npx @biomejs/biome check --write packages" + }, + "devDependencies": { + "@biomejs/biome": "^2.0.5" + } } diff --git a/packages/cli-hooks/biome.json b/packages/cli-hooks/biome.json deleted file mode 100644 index 48cac642f..000000000 --- a/packages/cli-hooks/biome.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "$schema": "https://biomejs.dev/schemas/latest/schema.json", - "extends": ["../../biome.json"] -} diff --git a/packages/cli-hooks/package.json b/packages/cli-hooks/package.json index ba3434394..f3bc22cc0 100644 --- a/packages/cli-hooks/package.json +++ b/packages/cli-hooks/package.json @@ -36,11 +36,8 @@ }, "scripts": { "build": "shx chmod +x src/*.js", - "lint": "npx @biomejs/biome check .", - "lint:fix": "npx @biomejs/biome check --write .", "prebuild": "shx rm -rf ./coverage", "prelint": "tsc --noemit --module es2022 --maxNodeModuleJsDepth 0 --project ./jsconfig.json", - "pretest": "npm run lint", "test": "c8 --config ./test/.c8rc.json mocha --config ./test/.mocharc.json src/*.spec.js" }, "bin": { @@ -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", diff --git a/packages/cli-test/biome.json b/packages/cli-test/biome.json deleted file mode 100644 index 48cac642f..000000000 --- a/packages/cli-test/biome.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "$schema": "https://biomejs.dev/schemas/latest/schema.json", - "extends": ["../../biome.json"] -} diff --git a/packages/cli-test/package.json b/packages/cli-test/package.json index 3469778a3..09cba7fd2 100644 --- a/packages/cli-test/package.json +++ b/packages/cli-test/package.json @@ -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 .", "mocha": "cross-env SLACK_CLI_PATH=/doesnt/matter mocha --config ./test/.mocharc.json src/*.spec.ts src/**/*.spec.ts src/**/**/*.spec.ts", "prepublishOnly": "npm run build", - "test": "npm run lint && npm run build && c8 --config ./test/.c8rc.json npm run mocha" + "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", diff --git a/packages/logger/biome.json b/packages/logger/biome.json deleted file mode 100644 index 48cac642f..000000000 --- a/packages/logger/biome.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "$schema": "https://biomejs.dev/schemas/latest/schema.json", - "extends": ["../../biome.json"] -} diff --git a/packages/logger/package.json b/packages/logger/package.json index 058e6c926..1cc3d5c83 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -29,17 +29,14 @@ "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 .", "prepublishOnly": "npm run build", - "test": "npm run lint && npm run test:unit", + "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", diff --git a/packages/oauth/biome.json b/packages/oauth/biome.json deleted file mode 100644 index 48cac642f..000000000 --- a/packages/oauth/biome.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "$schema": "https://biomejs.dev/schemas/latest/schema.json", - "extends": ["../../biome.json"] -} diff --git a/packages/oauth/package.json b/packages/oauth/package.json index b22ecaedf..9dc11f55d 100644 --- a/packages/oauth/package.json +++ b/packages/oauth/package.json @@ -32,10 +32,8 @@ "build:clean": "shx rm -rf ./dist ./coverage", "coverage": "npm run build && c8 --config ./test/.c8rc.json npm run test:mocha", "docs": "npx typedoc --plugin typedoc-plugin-markdown", - "lint": "npx @biomejs/biome check .", - "lint:fix": "npx @biomejs/biome check --write .", "prepublishOnly": "npm run build", - "test": "npm run lint && npm run coverage", + "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" }, @@ -47,7 +45,6 @@ "jsonwebtoken": "^9" }, "devDependencies": { - "@biomejs/biome": "^2.0.5", "@types/chai": "^4", "@types/mocha": "^10", "@types/sinon": "^21", diff --git a/packages/rtm-api/biome.json b/packages/rtm-api/biome.json deleted file mode 100644 index 48cac642f..000000000 --- a/packages/rtm-api/biome.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "$schema": "https://biomejs.dev/schemas/latest/schema.json", - "extends": ["../../biome.json"] -} diff --git a/packages/rtm-api/package.json b/packages/rtm-api/package.json index c40ad66f7..a3ab39cdf 100644 --- a/packages/rtm-api/package.json +++ b/packages/rtm-api/package.json @@ -37,10 +37,8 @@ "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 .", "prepublishOnly": "npm run build", - "test": "npm run lint && npm run build && npm run test:integration", + "test": "npm run build && npm run test:integration", "test:integration": "mocha --config .mocharc.json test/integration.spec.js" }, "dependencies": { @@ -54,7 +52,6 @@ "ws": "^8" }, "devDependencies": { - "@biomejs/biome": "^2.0.5", "@types/chai": "^4", "@types/mocha": "^10", "@types/sinon": "^17", diff --git a/packages/socket-mode/biome.json b/packages/socket-mode/biome.json deleted file mode 100644 index 48cac642f..000000000 --- a/packages/socket-mode/biome.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "$schema": "https://biomejs.dev/schemas/latest/schema.json", - "extends": ["../../biome.json"] -} diff --git a/packages/socket-mode/package.json b/packages/socket-mode/package.json index ef1e0a71d..fa560f7e4 100644 --- a/packages/socket-mode/package.json +++ b/packages/socket-mode/package.json @@ -39,10 +39,8 @@ "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 .", "prepublishOnly": "npm run build", - "test": "npm run lint && npm run build && npm run test:coverage && npm run test:integration", + "test": "npm run build && npm run test:coverage && npm run test:integration", "test:coverage": "c8 --config ./test/.c8rc.json npm run test:unit", "test:integration": "mocha --config ./test/.mocharc.json test/integration.spec.js", "test:unit": "mocha --config ./test/.mocharc.json src/**/*.spec.ts", @@ -57,7 +55,6 @@ "ws": "^8" }, "devDependencies": { - "@biomejs/biome": "^2.0.5", "@tsconfig/recommended": "^1.0.7", "@types/chai": "^4", "@types/mocha": "^10", diff --git a/packages/types/biome.json b/packages/types/biome.json deleted file mode 100644 index 48cac642f..000000000 --- a/packages/types/biome.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "$schema": "https://biomejs.dev/schemas/latest/schema.json", - "extends": ["../../biome.json"] -} diff --git a/packages/types/package.json b/packages/types/package.json index d1d6c22ba..4a11fcd38 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -31,14 +31,11 @@ "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 .", "prepublishOnly": "npm run build", - "test": "npm run lint && npm run build && npm run test:types", + "test": "npm run build && npm run test:types", "test:types": "tsd" }, "devDependencies": { - "@biomejs/biome": "^2.0.5", "shx": "^0.4.0", "tsd": "^0.33.0", "typedoc": "^0.28.7", diff --git a/packages/web-api/biome.json b/packages/web-api/biome.json deleted file mode 100644 index fdfe04be5..000000000 --- a/packages/web-api/biome.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "$schema": "https://biomejs.dev/schemas/latest/schema.json", - "extends": ["../../biome.json"], - "overrides": [ - { - "includes": ["**/src/types/response/**/*.ts"], - "linter": { - "rules": { - "complexity": { - "noBannedTypes": "off" - }, - "suspicious": { - "noExplicitAny": "off" - } - } - } - }, - { - "includes": ["src/index.ts"], - "assist": { - "actions": { - "source": { - "organizeImports": "off" - } - } - } - } - ] -} diff --git a/packages/web-api/package.json b/packages/web-api/package.json index 389d73240..bbfeef239 100644 --- a/packages/web-api/package.json +++ b/packages/web-api/package.json @@ -36,11 +36,9 @@ "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 .", "mocha": "mocha --config ./test/.mocharc.json \"./src/**/*.spec.ts\"", "prepublishOnly": "npm run build", - "test": "npm run lint && npm run test:types && npm run test:integration && npm run test:unit", + "test": "npm run test:types && npm run test:integration && npm run test:unit", "test:integration": "npm run build && node test/integration/commonjs-project/index.js && node test/integration/esm-project/index.mjs && npm run test:integration:ts", "test:integration:ts": "cd test/integration/ts-4.7-project && npm i && npm run build", "test:types": "tsd", @@ -62,7 +60,6 @@ "retry": "^0.13.1" }, "devDependencies": { - "@biomejs/biome": "^2.0.5", "@tsconfig/recommended": "^1", "@types/busboy": "^1.5.4", "@types/chai": "^4", diff --git a/packages/web-api/src/WebClient.ts b/packages/web-api/src/WebClient.ts index 4ee3bccbb..3a5185a33 100644 --- a/packages/web-api/src/WebClient.ts +++ b/packages/web-api/src/WebClient.ts @@ -159,7 +159,6 @@ export type PageAccumulator = R extends ( accumulator: infer A | undefined, page: WebAPICallResult, index: number, - // biome-ignore lint/suspicious/noRedeclare: TODO: what is being redeclared here? ) => infer A ? A : never; diff --git a/packages/webhook/biome.json b/packages/webhook/biome.json deleted file mode 100644 index 48cac642f..000000000 --- a/packages/webhook/biome.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "$schema": "https://biomejs.dev/schemas/latest/schema.json", - "extends": ["../../biome.json"] -} diff --git a/packages/webhook/package.json b/packages/webhook/package.json index 4e9e8ecf8..4b6116129 100644 --- a/packages/webhook/package.json +++ b/packages/webhook/package.json @@ -33,11 +33,9 @@ "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 .", "mocha": "mocha --config ./test/.mocharc.json src/*.spec.ts", "prepublishOnly": "npm run build", - "test": "npm run lint && npm run test:unit", + "test": "npm run test:unit", "test:unit": "npm run build && c8 --config ./test/.c8rc.json npm run mocha" }, "dependencies": { @@ -46,7 +44,6 @@ "axios": "^1.11.0" }, "devDependencies": { - "@biomejs/biome": "^2.0.5", "@types/chai": "^4.3.5", "@types/mocha": "^10.0.1", "c8": "^10.1.3", From 0a444a537dcab64135e86507e80ed29624b68261 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Wed, 28 Jan 2026 20:27:44 -0800 Subject: [PATCH 06/15] build: replace prepublishOnly script with prepack https://docs.npmjs.com/cli/v6/commands/npm-pack --- packages/cli-test/package.json | 2 +- packages/logger/package.json | 2 +- packages/oauth/package.json | 2 +- packages/rtm-api/package.json | 2 +- packages/socket-mode/package.json | 2 +- packages/types/package.json | 2 +- packages/web-api/package.json | 2 +- packages/webhook/package.json | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/cli-test/package.json b/packages/cli-test/package.json index 09cba7fd2..798f6e159 100644 --- a/packages/cli-test/package.json +++ b/packages/cli-test/package.json @@ -29,7 +29,7 @@ "build:clean": "shx rm -rf ./dist ./coverage", "docs": "npx typedoc --plugin typedoc-plugin-markdown", "mocha": "cross-env SLACK_CLI_PATH=/doesnt/matter mocha --config ./test/.mocharc.json src/*.spec.ts src/**/*.spec.ts src/**/**/*.spec.ts", - "prepublishOnly": "npm run build", + "prepack": "npm run build", "test": "npm run build && c8 --config ./test/.c8rc.json npm run mocha" }, "dependencies": { diff --git a/packages/logger/package.json b/packages/logger/package.json index 1cc3d5c83..2dec307ce 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -29,7 +29,7 @@ "build": "npm run build:clean && tsc", "build:clean": "shx rm -rf ./dist ./coverage", "docs": "npx typedoc --plugin typedoc-plugin-markdown", - "prepublishOnly": "npm run build", + "prepack": "npm run build", "test": "npm run test:unit", "test:unit": "npm run build && node --import tsx --test src/index.test.ts" }, diff --git a/packages/oauth/package.json b/packages/oauth/package.json index 9dc11f55d..3542d4083 100644 --- a/packages/oauth/package.json +++ b/packages/oauth/package.json @@ -32,7 +32,7 @@ "build:clean": "shx rm -rf ./dist ./coverage", "coverage": "npm run build && c8 --config ./test/.c8rc.json npm run test:mocha", "docs": "npx typedoc --plugin typedoc-plugin-markdown", - "prepublishOnly": "npm run build", + "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" diff --git a/packages/rtm-api/package.json b/packages/rtm-api/package.json index a3ab39cdf..3c4606bfe 100644 --- a/packages/rtm-api/package.json +++ b/packages/rtm-api/package.json @@ -37,7 +37,7 @@ "build": "npm run build:clean && tsc", "build:clean": "shx rm -rf ./dist", "docs": "npx typedoc --plugin typedoc-plugin-markdown", - "prepublishOnly": "npm run build", + "prepack": "npm run build", "test": "npm run build && npm run test:integration", "test:integration": "mocha --config .mocharc.json test/integration.spec.js" }, diff --git a/packages/socket-mode/package.json b/packages/socket-mode/package.json index fa560f7e4..70495c886 100644 --- a/packages/socket-mode/package.json +++ b/packages/socket-mode/package.json @@ -39,7 +39,7 @@ "build": "npm run build:clean && tsc", "build:clean": "shx rm -rf ./dist ./coverage", "docs": "npx typedoc --plugin typedoc-plugin-markdown", - "prepublishOnly": "npm run build", + "prepack": "npm run build", "test": "npm run build && npm run test:coverage && npm run test:integration", "test:coverage": "c8 --config ./test/.c8rc.json npm run test:unit", "test:integration": "mocha --config ./test/.mocharc.json test/integration.spec.js", diff --git a/packages/types/package.json b/packages/types/package.json index 4a11fcd38..d6341536b 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -31,7 +31,7 @@ "build": "npm run build:clean && tsc", "build:clean": "shx rm -rf ./dist", "docs": "npx typedoc --plugin typedoc-plugin-markdown", - "prepublishOnly": "npm run build", + "prepack": "npm run build", "test": "npm run build && npm run test:types", "test:types": "tsd" }, diff --git a/packages/web-api/package.json b/packages/web-api/package.json index bbfeef239..155fdb061 100644 --- a/packages/web-api/package.json +++ b/packages/web-api/package.json @@ -37,7 +37,7 @@ "build:clean": "shx rm -rf ./dist ./coverage", "docs": "npx typedoc --plugin typedoc-plugin-markdown", "mocha": "mocha --config ./test/.mocharc.json \"./src/**/*.spec.ts\"", - "prepublishOnly": "npm run build", + "prepack": "npm run build", "test": "npm run test:types && npm run test:integration && npm run test:unit", "test:integration": "npm run build && node test/integration/commonjs-project/index.js && node test/integration/esm-project/index.mjs && npm run test:integration:ts", "test:integration:ts": "cd test/integration/ts-4.7-project && npm i && npm run build", diff --git a/packages/webhook/package.json b/packages/webhook/package.json index 4b6116129..876f04bbe 100644 --- a/packages/webhook/package.json +++ b/packages/webhook/package.json @@ -34,7 +34,7 @@ "build:clean": "shx rm -rf ./dist ./coverage", "docs": "npx typedoc --plugin typedoc-plugin-markdown", "mocha": "mocha --config ./test/.mocharc.json src/*.spec.ts", - "prepublishOnly": "npm run build", + "prepack": "npm run build", "test": "npm run test:unit", "test:unit": "npm run build && c8 --config ./test/.c8rc.json npm run mocha" }, From 37fe12b5104c5e2a20de6de4a8b8e2b9624e90f2 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Wed, 28 Jan 2026 20:42:15 -0800 Subject: [PATCH 07/15] docs: update runbooks and maintainers guide with workspace command --- .github/maintainers_guide.md | 66 ++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/.github/maintainers_guide.md b/.github/maintainers_guide.md index 72ba09ea7..446a50341 100644 --- a/.github/maintainers_guide.md +++ b/.github/maintainers_guide.md @@ -10,9 +10,15 @@ Maintaining this project requires installing [Node.js](https://nodejs.org). All ### ⚗ Testing and Linting -The Node SDK is made up of multiple, individual packages, each with their own tests. As such, tests are run on a per-package basis. However, the top-level directory contains some development dependencies applicable to all packages. As a result, to run tests for any package, first ensure you run `npm install` from the top-level directory. Then, for a given package, navigate to the package's directory (ie, `packages/web-api`) and run `npm test` to run that package's tests. To run just the linting and not the entire test suite, run `npm run lint` from the root directory. +The Node SDK is made up of multiple, individual packages, each with their own tests. As such, tests are run on a per-package basis. However, the top-level directory contains some development dependencies applicable to all packages. As a result, to run tests for any package, first run `npm install` from the top-level directory. Then run `npm test --workspace packages/` to run that package's tests. To run linting across all packages, run `npm run lint` from the root directory. -This project has tests for individual packages as `*.spec.js` files and inside of each's package's `src` directory. Also, for verifying the behavior with the real Slack server-side and developer experience with installed packages, you can run the tests amd scripts under `prod-server-integration-tests`. Refer to the README file in the directory for details. These tests are supposed to be run in the project maintainers' manual execution. They are not part of CI builds for now. +```sh +npm install +npm run lint +npm test --workspace packages/web-api +``` + +This project has tests for individual packages as `*.spec.js` files and inside of each package's `src` directory. Also, for verifying the behavior with the real Slack server-side and developer experience with installed packages, you can run the tests amd scripts under `prod-server-integration-tests`. Refer to the README file in the directory for details. These tests are supposed to be run in the project maintainers' manual execution. They are not part of CI builds for now. Upon opening a PR, tests are executed by GitHub Actions, our continuous integration system. GitHub Actions runs several, more granular builds in order to report on success and failure in a more targeted way. @@ -31,14 +37,13 @@ We have included `launch.json` files that store configuration for `vscode` debug Using in progress changes made to this package in an app can be useful for development. Use the pack command to package a particular SDK package. For example: ```sh -cd packages/web-api -npm pack +npm pack --workspace packages/web-api ``` Install the `slack-web-api-*.tgz` to an app to use your changes: ```sh -npm install path/to/node-slack-sdk/packages/slack-web-api-*.tgz +npm install path/to/node-slack-sdk/slack-web-api-*.tgz ``` The packaged build includes dependencies published with each package, including required peer dependencies but not devDependencies, to imitate actual installations. @@ -52,8 +57,7 @@ The reference docs for each package is independent of the others. They're genera Each package has a script to these generate reference docs. For example: ```sh -cd packages/web-api -npm run docs +npm run docs --workspace packages/web-api ``` The script places the reference markdown files in `/docs/english/reference/package-name`. @@ -73,12 +77,10 @@ Releasing can feel intimidating at first, but rest assured: if you make a mistak 2. Make sure your local `main` branch has the latest changes (i.e. `git checkout main && git pull --tags origin main`). Then, open a new branch off of your local `main` branch for the release (i.e. `git checkout -b -`). -3. Navigate to the specific package(s) you're releasing in the `packages/` directory. - -4. For each package to be released, run `npm run test` to verify that tests are passing. +3. For each package to be released, run `npm test --workspace packages/` to verify that tests are passing. -5. On our new branch, bump the version(s) in `package.json` (see [Versioning and Tags](https://github.com/slackapi/node-slack-sdk/blob/main/.github/maintainers_guide.md#-versioning-and-tags)) - - Generate the reference docs for that package by running `npm run docs`. +4. On our new branch, bump the version(s) in `package.json` (see [Versioning and Tags](https://github.com/slackapi/node-slack-sdk/blob/main/.github/maintainers_guide.md#-versioning-and-tags)) + - Generate the reference docs for that package by running `npm run docs --workspace packages/`. - Make a single commit for the version(s) bump, following the format in: ([Example](https://github.com/slackapi/node-slack-sdk/commit/ff03f7812c678bdc5cea5eace75db34631a88dda)) @@ -88,28 +90,28 @@ Releasing can feel intimidating at first, but rest assured: if you make a mistak - Add appropriate milestone on the PR -6. Once the PR has been approved and tests have passed, merge it into the main repository. +5. Once the PR has been approved and tests have passed, merge it into the main repository. - Check out your local `main` branch and update it to get the latest changes: `git checkout main && git pull origin main` - Add a version tag (ie, `git tag @slack/web-api@5.6.0`) - Push the new tag up to origin: `git push origin @slack/web-api@5.6.0` -7. Publish the release to npm +6. Publish the release to npm - To publish, you need to be a member of the `slack Org` on npm and set up 2-Factor Auth with your password generator of choice. Before you can publish with npm, you must run `npm login` from the command line. - - As the final validation, within the package directory (ex: `packages/types`), run `mv package-lock.json package-lock.json.bk && rm -rf node_modules/ dist/ && npm i && npm test && npm pack` and confirm if there are `*.js`, `*.d.ts` files under the `dist` directory. + - As the final validation, run `rm -rf packages/types/dist && npm test --workspace packages/types && npm pack --workspace packages/types` and confirm if there are `*.js`, `*.d.ts` files under the `dist` directory. - - Run `npm publish . --otp YOUR_OTP_CODE`. To generate an OTP (One Time Password), use your password generator of choice (Duo, 1Password) + - Run `npm publish --workspace packages/types --otp YOUR_OTP_CODE`. To generate an OTP (One Time Password), use your password generator of choice (Duo, 1Password) -8. Close GitHub Milestone +7. Close GitHub Milestone - Close the relevant GitHub Milestone for the release - Check the existing GitHub Milestones to see if the next minor version exists. If it doesn't, then create a GitHub Milestone for new issues to live in. Typically, you'll create a new minor version - however, if there are any bugs that need to be carried over from the current GitHub Milestone, you could make a Milestone for a patch version to reflect those issues - Move any unfinished, open issues to the next GitHub Milestone -9. Create GitHub Release with release notes +8. Create GitHub Release with release notes - From the repository, navigate to the **Releases** section and select [Draft a new release](https://github.com/slackapi/node-slack-sdk/releases/new) - When creating the release notes, select the tag you generated earlier for your release and title the release the same name as the tag @@ -120,14 +122,14 @@ Releasing can feel intimidating at first, but rest assured: if you make a mistak - Once the release notes are ready, click the "Publish Release" button to make them public -10. Communicate the release (as appropriate) - - **Internal** - - Include a brief description and link to the GitHub release +9. Communicate the release (as appropriate) + - **Internal** + - Include a brief description and link to the GitHub release - - **External** - - **Slack Community Hangout** (`community.slack.com/`) in **#lang-javascript**. Include a link to the package on `npmjs.com/package/@slack/` as well as the release notes. ([Example](https://community.slack.com/archives/CHF1FKX4J/p1657293144932579)) + - **External** + - **Slack Community Hangout** (`community.slack.com/`) in **#lang-javascript**. Include a link to the package on `npmjs.com/package/@slack/` as well as the release notes. ([Example](https://community.slack.com/archives/CHF1FKX4J/p1657293144932579)) - - **Twitter**: Primarily for major updates. Coordinate with Developer Marketing. + - **Twitter**: Primarily for major updates. Coordinate with Developer Marketing. ### 🚧 Beta Releases @@ -136,11 +138,9 @@ Releasing can feel intimidating at first, but rest assured: if you make a mistak - If you do not have a feature branch, you can also use generic release candidate branch name like `rc`, i.e. `2.5.0rc`. -2. Navigate to the specific package(s) you're releasing in the `packages/` directory. - -3. For each package to be released, run `npm it` to install the latest dependencies and verify that everything is working and free of errors. +2. For each package to be released, run `npm test --workspace packages/` to verify that tests are passing. -4. Bump the version(s) in `package.json` +3. Bump the version(s) in `package.json` - The version must be in the format of `Major.Minor.Patch-BetaNamespace.BetaVersion` (ex: `5.10.0-workflowStepsBeta.1`, `2.5.0-rc.1`) - Make a single commit for the version bump ([Example](https://github.com/slackapi/node-slack-sdk/commit/1503609d79abf035e9e21bad7360e124e4211594)) @@ -149,23 +149,23 @@ Releasing can feel intimidating at first, but rest assured: if you make a mistak - Add appropriate labels, including `release` -5. Once the PR's checks and tests have passed, merge it into the corresponding feature branch on the main repository. If you would like a review on the pull request or feel that the specific release you're doing requires extra attention, you can wait for an approval, but it is optional for this type of PR. +4. Once the PR's checks and tests have passed, merge it into the corresponding feature branch on the main repository. If you would like a review on the pull request or feel that the specific release you're doing requires extra attention, you can wait for an approval, but it is optional for this type of PR. - Update your local main branch: `git pull origin ` - Add a version tag (ie, `git tag @slack/web-api@5.10.0-workflowStepsBeta.1`) - Push the new tag up to origin: `git push --tags origin` -6. Publish the release to npm - - Run `npm publish --tag . --otp YOUR_OTP_CODE` +5. Publish the release to npm + - Run `npm publish --workspace packages/ --tag --otp YOUR_OTP_CODE` - `` should be a label representative of the beta release. It could be feature-specific (i.e. `feat-token-rotation`) or it can be a generic release candidate (i.e. `2.5.0rc`). Whatever you decide: it must _not_ be `latest`, as that is reserved for non-beta releases. - To generate an OTP (One Time Password), use your password generator of choice (Duo, 1Password) -7. Test that the publish was successful +6. Test that the publish was successful - Run `npm info dist-tags` -8. Create GitHub Release(s) with release notes +7. Create GitHub Release(s) with release notes - From the repository, navigate to the **Releases** section and draft a new release - Release notes should mention the beta feature (if applicable), contributors, issues and PRs ([Example](https://github.com/slackapi/node-slack-sdk/releases/tag/%40slack%2Ftypes%401.8.0-workflowStepsBeta.2)) From b08d49017441ef64dccd240c4c0d324e8454ce84 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Wed, 28 Jan 2026 21:40:43 -0800 Subject: [PATCH 08/15] build: changeset init --- .changeset/README.md | 8 ++++++++ .changeset/config.json | 11 +++++++++++ package.json | 4 +++- 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 .changeset/README.md create mode 100644 .changeset/config.json diff --git a/.changeset/README.md b/.changeset/README.md new file mode 100644 index 000000000..e5b6d8d6a --- /dev/null +++ b/.changeset/README.md @@ -0,0 +1,8 @@ +# Changesets + +Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works +with multi-package repos, or single-package repos to help you version and publish your code. You can +find the full documentation for it [in our repository](https://github.com/changesets/changesets) + +We have a quick list of common questions to get you started engaging with this project in +[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) diff --git a/.changeset/config.json b/.changeset/config.json new file mode 100644 index 000000000..ad6f18a14 --- /dev/null +++ b/.changeset/config.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://unpkg.com/@changesets/config@3.1.2/schema.json", + "changelog": "@changesets/cli/changelog", + "commit": false, + "fixed": [], + "linked": [], + "access": "restricted", + "baseBranch": "main", + "updateInternalDependencies": "patch", + "ignore": [] +} diff --git a/package.json b/package.json index 56f3c87da..1fb88edbe 100644 --- a/package.json +++ b/package.json @@ -19,10 +19,12 @@ "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" + "@biomejs/biome": "^2.0.5", + "@changesets/cli": "^2.29.8" } } From cb8fa87d9657b77bca3dcb9b7b5390d3a0498539 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Wed, 28 Jan 2026 23:38:59 -0800 Subject: [PATCH 09/15] chore: add release workflow and steps for contributors and maintainers --- .changeset/README.md | 7 +- .changeset/config.json | 2 +- .github/maintainers_guide.md | 79 +++++++--------------- .github/workflows/release.yml | 43 ++++++++++++ packages/client/package.json | 1 + packages/events-api/package.json | 1 + packages/interactive-messages/package.json | 1 + 7 files changed, 75 insertions(+), 59 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.changeset/README.md b/.changeset/README.md index e5b6d8d6a..3d987d5ec 100644 --- a/.changeset/README.md +++ b/.changeset/README.md @@ -1,8 +1,5 @@ # Changesets -Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works -with multi-package repos, or single-package repos to help you version and publish your code. You can -find the full documentation for it [in our repository](https://github.com/changesets/changesets) +This directory contains [**changesets**](https://github.com/changesets/changesets) which are markdown files that describe package changes for the next release. -We have a quick list of common questions to get you started engaging with this project in -[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) +For guidance on when and how to add changesets, checkout the [Maintainer's Guide](../.github/maintainers_guide.md#-updating-changesets). diff --git a/.changeset/config.json b/.changeset/config.json index ad6f18a14..b8213321c 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -4,7 +4,7 @@ "commit": false, "fixed": [], "linked": [], - "access": "restricted", + "access": "public", "baseBranch": "main", "updateInternalDependencies": "patch", "ignore": [] diff --git a/.github/maintainers_guide.md b/.github/maintainers_guide.md index 446a50341..3b14e8a3a 100644 --- a/.github/maintainers_guide.md +++ b/.github/maintainers_guide.md @@ -62,78 +62,45 @@ npm run docs --workspace packages/web-api The script places the reference markdown files in `/docs/english/reference/package-name`. -### 🚀 Releases - -_For beta releases, see [**Beta Releases**](https://github.com/slackapi/node-slack-sdk/blob/main/.github/maintainers_guide.md#-beta-releases) section below_ - -Releasing can feel intimidating at first, but rest assured: if you make a mistake, don't fret! npm allows you to unpublish a release within the first 72 hours of publishing (you just won’t be able to use the same version number again). Venture on! - -1. Check the status of the package's GitHub Milestone for issues that should be shipped with the release. - - If all issues have been closed, continue with the release. - - - If issues are still open, discuss with the team about whether the open issues should be moved to a future release or if the release should be held off until the issues are resolved. - - - Take a look at all issues under the Milestone to make sure that the type of issues included aligns with the Milestone name based on [semantic versioning](https://semver.org/). If the issues do not align with the naming of the Milestone (ex: if the issues are all bug fixes, but the Milestone is labeled as a minor release), then you can tweak the Milestone name to reflect the correct versioning. - -2. Make sure your local `main` branch has the latest changes (i.e. `git checkout main && git pull --tags origin main`). Then, open a new branch off of your local `main` branch for the release (i.e. `git checkout -b -`). - -3. For each package to be released, run `npm test --workspace packages/` to verify that tests are passing. - -4. On our new branch, bump the version(s) in `package.json` (see [Versioning and Tags](https://github.com/slackapi/node-slack-sdk/blob/main/.github/maintainers_guide.md#-versioning-and-tags)) - - Generate the reference docs for that package by running `npm run docs --workspace packages/`. - - - Make a single commit for the version(s) bump, following the format in: ([Example](https://github.com/slackapi/node-slack-sdk/commit/ff03f7812c678bdc5cea5eace75db34631a88dda)) - - - Create a pull request for the version change ([Example](https://github.com/slackapi/node-slack-sdk/pull/2402)) - - - Add appropriate labels on the PR, including `release`, `pkg:*`, and `semver:*` - - - Add appropriate milestone on the PR +### 🎁 Updating Changesets -5. Once the PR has been approved and tests have passed, merge it into the main repository. - - Check out your local `main` branch and update it to get the latest changes: `git checkout main && git pull origin main` +This project uses [Changesets](https://github.com/changesets/changesets) to track changes and automate releases. - - Add a version tag (ie, `git tag @slack/web-api@5.6.0`) +Each changeset describes a change to a package and its [semver](https://semver.org/) impact, and a new changeset should be added when updating a published package with some change that affects consumers of the package: - - Push the new tag up to origin: `git push origin @slack/web-api@5.6.0` - -6. Publish the release to npm - - To publish, you need to be a member of the `slack Org` on npm and set up 2-Factor Auth with your password generator of choice. Before you can publish with npm, you must run `npm login` from the command line. - - - As the final validation, run `rm -rf packages/types/dist && npm test --workspace packages/types && npm pack --workspace packages/types` and confirm if there are `*.js`, `*.d.ts` files under the `dist` directory. +```sh +npm run changeset +``` - - Run `npm publish --workspace packages/types --otp YOUR_OTP_CODE`. To generate an OTP (One Time Password), use your password generator of choice (Duo, 1Password) +Updates to documentation, tests, or CI might not require new entries. -7. Close GitHub Milestone - - Close the relevant GitHub Milestone for the release +When a PR containing changesets is merged to `main`, a different PR is opened or updating using [changesets/action](https://github.com/changesets/action) which consumes the pending changesets, bumps relevant package versions, and updates various `CHANGELOG` files in preparation to release. - - Check the existing GitHub Milestones to see if the next minor version exists. If it doesn't, then create a GitHub Milestone for new issues to live in. Typically, you'll create a new minor version - however, if there are any bugs that need to be carried over from the current GitHub Milestone, you could make a Milestone for a patch version to reflect those issues +### 🚀 Releases - - Move any unfinished, open issues to the next GitHub Milestone +Releasing can feel intimidating at first, but don't fret! If you make a mistake, npm allows you to unpublish within the first 72 hours (you just won't be able to reuse that version number). Venture on! -8. Create GitHub Release with release notes - - From the repository, navigate to the **Releases** section and select [Draft a new release](https://github.com/slackapi/node-slack-sdk/releases/new) +> For beta releases, read the [**Beta Releases**](https://github.com/slackapi/node-slack-sdk/blob/main/.github/maintainers_guide.md#-beta-releases) section below. - - When creating the release notes, select the tag you generated earlier for your release and title the release the same name as the tag +New official package versions are published when the release PR created from changesets is merged and the publish workflow is approved. Follow these steps to build confidence: - - To see a list of changes between the last tag for the specific package, you can use this `git` command: `git log --oneline --full-history @slack/types@2.8.0..@slack/types@2.9.0 -- packages/types`. Sub in the correct tags and the last argument should be the path to the sub-package you are releasing (in order to filter commits just to the specific path). +1. **Check GitHub Milestones**: Before merging the release PR please check the relevant [Milestones](https://github.com/slackapi/node-slack-sdk/milestones). If issues or pull requests are still open, either decide to postpone the release or save those changes for a future update. - - Release notes should mention contributors, issues, PRs, milestone, and link to npm package ([Example](https://github.com/slackapi/node-slack-sdk/releases/tag/%40slack%2Ftypes%402.17.0)) +2. **Review the release PR**: Verify that version bumps match expectations, CHANGELOG entries are clear, and CI checks pass. - - Once the release notes are ready, click the "Publish Release" button to make them public +3. **Merge and approve**: Merge the release PR, then approve the publish workflow to release packages to npm. -9. Communicate the release (as appropriate) - - **Internal** - - Include a brief description and link to the GitHub release +4. **Update Milestones**: Close the relevant [Milestones](https://github.com/slackapi/node-slack-sdk/milestones) and rename these to match the released package versions. Open a new Milestone for the next version, e.g. `@slack/web-api@next`. - - **External** - - **Slack Community Hangout** (`community.slack.com/`) in **#lang-javascript**. Include a link to the package on `npmjs.com/package/@slack/` as well as the release notes. ([Example](https://community.slack.com/archives/CHF1FKX4J/p1657293144932579)) +5. **Communicate the release**: - - **Twitter**: Primarily for major updates. Coordinate with Developer Marketing. + - **Internal**: Post a brief description and link to the GitHub release. + - **External**: Post in **#lang-javascript** on [Slack Community](https://community.slack.com/). Include a link to the package on `npmjs.com/package/@slack/` as well as the release notes. ### 🚧 Beta Releases 1. Make sure your local `main` branch has the latest changes + - Run `git rebase main` from your feature branch (this will rebase your feature branch from `main`). You can opt for `git merge main` if you are not comfortable with rebasing. - If you do not have a feature branch, you can also use generic release candidate branch name like `rc`, i.e. `2.5.0rc`. @@ -141,6 +108,7 @@ Releasing can feel intimidating at first, but rest assured: if you make a mistak 2. For each package to be released, run `npm test --workspace packages/` to verify that tests are passing. 3. Bump the version(s) in `package.json` + - The version must be in the format of `Major.Minor.Patch-BetaNamespace.BetaVersion` (ex: `5.10.0-workflowStepsBeta.1`, `2.5.0-rc.1`) - Make a single commit for the version bump ([Example](https://github.com/slackapi/node-slack-sdk/commit/1503609d79abf035e9e21bad7360e124e4211594)) @@ -150,6 +118,7 @@ Releasing can feel intimidating at first, but rest assured: if you make a mistak - Add appropriate labels, including `release` 4. Once the PR's checks and tests have passed, merge it into the corresponding feature branch on the main repository. If you would like a review on the pull request or feel that the specific release you're doing requires extra attention, you can wait for an approval, but it is optional for this type of PR. + - Update your local main branch: `git pull origin ` - Add a version tag (ie, `git tag @slack/web-api@5.10.0-workflowStepsBeta.1`) @@ -157,15 +126,19 @@ Releasing can feel intimidating at first, but rest assured: if you make a mistak - Push the new tag up to origin: `git push --tags origin` 5. Publish the release to npm + - Run `npm publish --workspace packages/ --tag --otp YOUR_OTP_CODE` + - `` should be a label representative of the beta release. It could be feature-specific (i.e. `feat-token-rotation`) or it can be a generic release candidate (i.e. `2.5.0rc`). Whatever you decide: it must _not_ be `latest`, as that is reserved for non-beta releases. - To generate an OTP (One Time Password), use your password generator of choice (Duo, 1Password) 6. Test that the publish was successful + - Run `npm info dist-tags` 7. Create GitHub Release(s) with release notes + - From the repository, navigate to the **Releases** section and draft a new release - Release notes should mention the beta feature (if applicable), contributors, issues and PRs ([Example](https://github.com/slackapi/node-slack-sdk/releases/tag/%40slack%2Ftypes%401.8.0-workflowStepsBeta.2)) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..d87701dec --- /dev/null +++ b/.github/workflows/release.yml @@ -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 + 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 + 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 }} diff --git a/packages/client/package.json b/packages/client/package.json index fe7e9be84..711ce04ff 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,7 @@ { "name": "@slack/client", "version": "5.0.2", + "private": true, "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", diff --git a/packages/events-api/package.json b/packages/events-api/package.json index 89f2357d8..23c4a7714 100644 --- a/packages/events-api/package.json +++ b/packages/events-api/package.json @@ -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", diff --git a/packages/interactive-messages/package.json b/packages/interactive-messages/package.json index 25fa07118..a8a87dd1c 100644 --- a/packages/interactive-messages/package.json +++ b/packages/interactive-messages/package.json @@ -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", From 381af9c2319ad35694723424f52294ff53358055 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Wed, 28 Jan 2026 23:44:09 -0800 Subject: [PATCH 10/15] docs: formalize changesets in documentation --- .changeset/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/README.md b/.changeset/README.md index 3d987d5ec..54ce920e7 100644 --- a/.changeset/README.md +++ b/.changeset/README.md @@ -1,5 +1,5 @@ # Changesets -This directory contains [**changesets**](https://github.com/changesets/changesets) which are markdown files that describe package changes for the next release. +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). From 17724b558b3a8728afa5f28cb64182757ac45a84 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Wed, 28 Jan 2026 23:49:24 -0800 Subject: [PATCH 11/15] docs: reword a few lines --- .github/maintainers_guide.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/maintainers_guide.md b/.github/maintainers_guide.md index 3b14e8a3a..ff169bbf9 100644 --- a/.github/maintainers_guide.md +++ b/.github/maintainers_guide.md @@ -78,13 +78,13 @@ When a PR containing changesets is merged to `main`, a different PR is opened or ### 🚀 Releases -Releasing can feel intimidating at first, but don't fret! If you make a mistake, npm allows you to unpublish within the first 72 hours (you just won't be able to reuse that version number). Venture on! +Releasing can feel intimidating at first, but don't fret! If you make a mistake, npm allows you to unpublish within the first 72 hours. The one catch is that you can't reuse the same version number. Venture on! -> For beta releases, read the [**Beta Releases**](https://github.com/slackapi/node-slack-sdk/blob/main/.github/maintainers_guide.md#-beta-releases) section below. +> For beta releases, read the [**Beta Releases**](#-beta-releases) section below. New official package versions are published when the release PR created from changesets is merged and the publish workflow is approved. Follow these steps to build confidence: -1. **Check GitHub Milestones**: Before merging the release PR please check the relevant [Milestones](https://github.com/slackapi/node-slack-sdk/milestones). If issues or pull requests are still open, either decide to postpone the release or save those changes for a future update. +1. **Check GitHub Milestones**: Before merging the release PR please check the relevant [Milestones](https://github.com/slackapi/node-slack-sdk/milestones). If issues or pull requests are still open either decide to postpone the release or save those changes for a future update. 2. **Review the release PR**: Verify that version bumps match expectations, CHANGELOG entries are clear, and CI checks pass. From 6476161b37c8533798e13d2677e54881a72bd4d3 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Thu, 29 Jan 2026 00:23:22 -0800 Subject: [PATCH 12/15] docs: codeword changelog --- .github/maintainers_guide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/maintainers_guide.md b/.github/maintainers_guide.md index ff169bbf9..974930e4b 100644 --- a/.github/maintainers_guide.md +++ b/.github/maintainers_guide.md @@ -86,7 +86,7 @@ New official package versions are published when the release PR created from cha 1. **Check GitHub Milestones**: Before merging the release PR please check the relevant [Milestones](https://github.com/slackapi/node-slack-sdk/milestones). If issues or pull requests are still open either decide to postpone the release or save those changes for a future update. -2. **Review the release PR**: Verify that version bumps match expectations, CHANGELOG entries are clear, and CI checks pass. +2. **Review the release PR**: Verify that version bumps match expectations, `CHANGELOG` entries are clear, and CI checks pass. 3. **Merge and approve**: Merge the release PR, then approve the publish workflow to release packages to npm. From 1180916defefdedc1f4165f0e611e3f371fbde29 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Thu, 29 Jan 2026 09:51:49 -0800 Subject: [PATCH 13/15] ci: add workflow_dispatch event for when retries and testing more is required --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d87701dec..fb889b844 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,7 @@ on: push: branches: - main + workflow_dispatch: concurrency: ${{ github.workflow }}-${{ github.ref }} From 51199df8943b6b01df4d62f2aee34e4db7e384ea Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Thu, 29 Jan 2026 09:52:04 -0800 Subject: [PATCH 14/15] style: prefix releases with a chore conventional commit --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fb889b844..f6c4620a7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,8 +36,8 @@ jobs: uses: changesets/action@c48e67d110a68bc90ccf1098e9646092baacaa87 # v1.6.0 with: createGithubReleases: true - commit: "ci: release" - title: "ci: release" + commit: "chore: release" + title: "chore: release" publish: npm run changeset -- publish version: npm run changeset -- version env: From f360a200c24c9fbeb776554709cc8bbba8a36112 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Thu, 29 Jan 2026 16:27:38 -0800 Subject: [PATCH 15/15] docs: note oidc requirement for package publishing Co-authored-by: Michael Brooks --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f6c4620a7..553d5539f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,7 +15,7 @@ jobs: environment: publish permissions: contents: write - id-token: write + id-token: write # OIDC: https://docs.npmjs.com/trusted-publishers pull-requests: write steps: - name: Checkout Repo