diff --git a/.github/dependabot.yml b/.github/dependabot.yml index fed7663a0..7113f0589 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -206,3 +206,11 @@ updates: - "github_actions" schedule: interval: "monthly" + + - package-ecosystem: "npm" + directory: "/" + labels: + - "dependencies" + - "javascript" + schedule: + interval: "weekly" diff --git a/.github/maintainers_guide.md b/.github/maintainers_guide.md index 177c26ea9..446a50341 100644 --- a/.github/maintainers_guide.md +++ b/.github/maintainers_guide.md @@ -3,22 +3,30 @@ 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`. -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. +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. + +```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. - - 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. @@ -29,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. @@ -50,175 +57,162 @@ 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`. ### 🚀 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. +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)) +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/`. - - 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 +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` -6. Once the PR has been approved and tests have passed, merge it into the main repository. + - Add a version tag (ie, `git tag @slack/web-api@5.6.0`) - - Check out your local `main` branch and update it to get the latest changes: `git checkout main && git pull origin main` + - Push the new tag up to origin: `git push origin @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` - -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. - - - 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) - -8. 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 +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. - - Move any unfinished, open issues to the next GitHub Milestone + - 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. -9. Create GitHub Release with release notes + - 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) - - From the repository, navigate to the **Releases** section and select [Draft a new release](https://github.com/slackapi/node-slack-sdk/releases/new) +7. Close GitHub Milestone + - Close the relevant GitHub Milestone for the release - - When creating the release notes, select the tag you generated earlier for your release and title the release the same name as the tag + - 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 - - 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). + - Move any unfinished, open issues to the next GitHub Milestone - - 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)) +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) - - Once the release notes are ready, click the "Publish Release" button to make them public + - When creating the release notes, select the tag you generated earlier for your release and title the release the same name as the tag -10. Communicate the release (as appropriate) + - 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). - - **Internal** + - 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)) - - Include a brief description and link to the GitHub release + - Once the release notes are ready, click the "Publish Release" button to make them public - - **External** +9. Communicate the release (as appropriate) + - **Internal** + - Include a brief description and link to the GitHub release - - **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 -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`. - -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. - -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`) - - - 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)) +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. - - Add appropriate labels, including `release` + - If you do not have a feature branch, you can also use generic release candidate branch name like `rc`, i.e. `2.5.0rc`. -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. +2. For each package to be released, run `npm test --workspace packages/` to verify that tests are passing. - - Update your local main branch: `git pull origin ` +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`) - - Add a version tag (ie, `git tag @slack/web-api@5.10.0-workflowStepsBeta.1`) + - Make a single commit for the version bump ([Example](https://github.com/slackapi/node-slack-sdk/commit/1503609d79abf035e9e21bad7360e124e4211594)) - - Push the new tag up to origin: `git push --tags origin` + - 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)) -6. Publish the release to npm + - Add appropriate labels, including `release` - - Run `npm publish --tag . --otp YOUR_OTP_CODE` +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 ` - - `` 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. + - Add a version tag (ie, `git tag @slack/web-api@5.10.0-workflowStepsBeta.1`) - - To generate an OTP (One Time Password), use your password generator of choice (Duo, 1Password) + - Push the new tag up to origin: `git push --tags origin` -7. Test that the publish was successful +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. - - Run `npm info dist-tags` + - To generate an OTP (One Time Password), use your password generator of choice (Duo, 1Password) -8. Create GitHub Release(s) with release notes +6. Test that the publish was successful + - Run `npm info dist-tags` - - From the repository, navigate to the **Releases** section and draft a new release +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)) + - 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 66d4d9644..fa8b830f6 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -41,48 +41,31 @@ jobs: with: node-version: ${{ matrix.node-version }} - run: npm --version - - run: npm install --verbose - working-directory: packages/${{ matrix.package }} - - name: Link dependent packages (*nix) - if: matrix.os == 'ubuntu-latest' - working-directory: packages/${{ matrix.package }} + - name: Install dependencies run: | - # depending on which package we are testing, also npm link up dependent packages within this monorepo - case "$PWD" in - */webhook) pushd ../types && npm i && popd && npm link ../types;; - */web-api) pushd ../types && npm i && popd && npm link ../types && pushd ../logger && npm i && popd && npm link ../logger;; - */oauth) pushd ../logger && npm i && popd && npm link ../logger && pushd ../web-api && npm i && popd && npm link ../web-api;; - */socket-mode) pushd ../logger && npm i && popd && npm link ../logger && pushd ../web-api && npm i && popd && npm link ../web-api;; - *) ;; # default - esac - - name: Link dependent packages (Windows) - if: matrix.os == 'windows-latest' - working-directory: packages/${{ matrix.package }} + npm install --verbose + - name: Build packages + run: | + # Build packages without internal dependencies + npm run build --workspace=@slack/cli-hooks + npm run build --workspace=@slack/cli-test + + # Build base dependencies + npm run build --workspace=@slack/logger + npm run build --workspace=@slack/types + + # Build packages requiring base dependencies + npm run build --workspace=@slack/web-api + npm run build --workspace=@slack/webhook + + # Build packages that depend on the Web API + npm run build --workspace=@slack/oauth + npm run build --workspace=@slack/rtm-api + npm run build --workspace=@slack/socket-mode + - name: Run tests run: | - # depending on which package we are testing, also npm link up dependent packages within this monorepo - # NOTE: the following is PowerShell - echo "$pwd" - switch -Wildcard ( "$pwd" ) - { - '*\webhook' - { - pushd ..\types && npm i && popd && npm link ..\types - } - '*\web-api' - { - pushd ..\types && npm i && popd && npm link ..\types && pushd ..\logger && npm i && popd && npm link ..\logger - } - '*\oauth' - { - pushd ..\logger && npm i && popd && npm link ..\logger && pushd ..\web-api && npm i && popd && npm link ..\web-api - } - '*\socket-mode' - { - pushd ..\logger && npm i && popd && npm link ..\logger && pushd ..\web-api && npm i && popd && npm link ..\web-api - } - } - - run: npm test - working-directory: packages/${{ matrix.package }} + npm run lint + npm test --workspace=@slack/${{ matrix.package }} - name: Check for coverage report existence id: check_coverage uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0 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 new file mode 100644 index 000000000..56f3c87da --- /dev/null +++ b/package.json @@ -0,0 +1,28 @@ +{ + "name": "@slack", + "version": "0.0.0", + "private": true, + "type": "module", + "repository": { + "type": "git", + "url": "git+https://github.com/slackapi/node-slack-sdk.git" + }, + "workspaces": [ + "packages/cli-hooks", + "packages/cli-test", + "packages/logger", + "packages/oauth", + "packages/rtm-api", + "packages/socket-mode", + "packages/types", + "packages/web-api", + "packages/webhook" + ], + "scripts": { + "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 928f6acc9..f3bc22cc0 100644 --- a/packages/cli-hooks/package.json +++ b/packages/cli-hooks/package.json @@ -35,12 +35,9 @@ "url": "https://github.com/slackapi/node-slack-sdk/issues" }, "scripts": { - "prebuild": "shx rm -rf ./coverage", "build": "shx chmod +x src/*.js", + "prebuild": "shx rm -rf ./coverage", "prelint": "tsc --noemit --module es2022 --maxNodeModuleJsDepth 0 --project ./jsconfig.json", - "lint": "npx @biomejs/biome check .", - "lint:fix": "npx @biomejs/biome check --write .", - "pretest": "npm run lint", "test": "c8 --config ./test/.c8rc.json mocha --config ./test/.mocharc.json src/*.spec.js" }, "bin": { @@ -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 2cb752a67..798f6e159 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 .", - "prepare": "npm run build", "mocha": "cross-env SLACK_CLI_PATH=/doesnt/matter mocha --config ./test/.mocharc.json src/*.spec.ts src/**/*.spec.ts src/**/**/*.spec.ts", - "test": "npm run lint && npm run build && c8 --config ./test/.c8rc.json npm run mocha" + "prepack": "npm run build", + "test": "npm run build && c8 --config ./test/.c8rc.json npm run mocha" }, "dependencies": { "tree-kill": "^1.2.2", "winston": "^3.8.2" }, "devDependencies": { - "@biomejs/biome": "^2.0.5", "@tsconfig/recommended": "^1.0.6", "@types/chai": "^4.3.16", "@types/mocha": "^10.0.6", 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 14b36b2e4..2dec307ce 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -26,20 +26,17 @@ "url": "https://github.com/slackapi/node-slack-sdk/issues" }, "scripts": { - "prepare": "npm run build", "build": "npm run build:clean && tsc", "build:clean": "shx rm -rf ./dist ./coverage", "docs": "npx typedoc --plugin typedoc-plugin-markdown", - "lint": "npx @biomejs/biome check .", - "lint:fix": "npx @biomejs/biome check --write .", - "test": "npm run lint && npm run test:unit", + "prepack": "npm run build", + "test": "npm run test:unit", "test:unit": "npm run build && node --import tsx --test src/index.test.ts" }, "dependencies": { "@types/node": ">=18.0.0" }, "devDependencies": { - "@biomejs/biome": "^2.0.5", "shx": "^0.4.0", "source-map-support": "^0.5.21", "tsx": "^4.20.6", 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 1ac424ca8..3542d4083 100644 --- a/packages/oauth/package.json +++ b/packages/oauth/package.json @@ -28,14 +28,12 @@ "url": "https://github.com/slackapi/node-slack-sdk/issues" }, "scripts": { - "prepare": "npm run build", "build": "npm run build:clean && tsc", "build:clean": "shx rm -rf ./dist ./coverage", - "docs": "npx typedoc --plugin typedoc-plugin-markdown", - "lint": "npx @biomejs/biome check .", - "lint:fix": "npx @biomejs/biome check --write .", - "test": "npm run lint && npm run coverage", "coverage": "npm run build && c8 --config ./test/.c8rc.json npm run test:mocha", + "docs": "npx typedoc --plugin typedoc-plugin-markdown", + "prepack": "npm run build", + "test": "npm run coverage", "test:mocha": "mocha --config ./test/.mocharc.json src/*.spec.ts src/**/*.spec.ts", "watch": "npx nodemon --watch 'src' --ext 'ts' --exec npm run build" }, @@ -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 11c58d7ec..3c4606bfe 100644 --- a/packages/rtm-api/package.json +++ b/packages/rtm-api/package.json @@ -34,13 +34,11 @@ "url": "https://github.com/slackapi/node-slack-sdk/issues" }, "scripts": { - "prepare": "npm run build", "build": "npm run build:clean && tsc", "build:clean": "shx rm -rf ./dist", "docs": "npx typedoc --plugin typedoc-plugin-markdown", - "lint": "npx @biomejs/biome check .", - "lint:fix": "npx @biomejs/biome check --write .", - "test": "npm run lint && npm run build && npm run test:integration", + "prepack": "npm run build", + "test": "npm run build && npm run test:integration", "test:integration": "mocha --config .mocharc.json test/integration.spec.js" }, "dependencies": { @@ -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 068d2cb3a..70495c886 100644 --- a/packages/socket-mode/package.json +++ b/packages/socket-mode/package.json @@ -36,16 +36,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", "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", + "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", - "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": { @@ -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 59af1faee..d6341536b 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -28,17 +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", "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:types", + "prepack": "npm run build", + "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 36ffc23bf..155fdb061 100644 --- a/packages/web-api/package.json +++ b/packages/web-api/package.json @@ -33,18 +33,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 .", "mocha": "mocha --config ./test/.mocharc.json \"./src/**/*.spec.ts\"", - "test": "npm run lint && npm run test:types && npm run test:integration && npm run test:unit", + "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", - "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": { @@ -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 98ab5065c..876f04bbe 100644 --- a/packages/webhook/package.json +++ b/packages/webhook/package.json @@ -30,14 +30,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 .", "mocha": "mocha --config ./test/.mocharc.json src/*.spec.ts", - "test": "npm run lint && npm run test:unit", + "prepack": "npm run build", + "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",