Skip to content

Commit

Permalink
fix(deps): update dependency isbot to v5 (redwoodjs#10340)
Browse files Browse the repository at this point in the history
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [isbot](https://isbot.js.org)
([source](https://togithub.com/omrilotan/isbot)) | [`3.8.0` ->
`5.1.6`](https://renovatebot.com/diffs/npm/isbot/3.8.0/5.1.6) |
[![age](https://developer.mend.io/api/mc/badges/age/npm/isbot/5.1.6?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/isbot/5.1.6?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/isbot/3.8.0/5.1.6?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/isbot/3.8.0/5.1.6?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>omrilotan/isbot (isbot)</summary>

###
[`v5.1.6`](https://togithub.com/omrilotan/isbot/blob/HEAD/CHANGELOG.md#516)

[Compare
Source](https://togithub.com/omrilotan/isbot/compare/v5.1.5...v5.1.6)

-   \[FIX] Browser files (jsdeliver): UMD is global and ESM is named

###
[`v5.1.5`](https://togithub.com/omrilotan/isbot/blob/HEAD/CHANGELOG.md#515)

[Compare
Source](https://togithub.com/omrilotan/isbot/compare/v5.1.4...v5.1.5)

-   Add substring "watch" to pattern

###
[`v5.1.4`](https://togithub.com/omrilotan/isbot/blob/HEAD/CHANGELOG.md#514)

[Compare
Source](https://togithub.com/omrilotan/isbot/compare/v5.1.3...v5.1.4)

-   Recognise search providers inapp browsers
- Ignore Crosswalk project: An old project that is no longer maintained
and has insignificant usage
-   PDRL Analyzer

###
[`v5.1.3`](https://togithub.com/omrilotan/isbot/blob/HEAD/CHANGELOG.md#513)

[Compare
Source](https://togithub.com/omrilotan/isbot/compare/v5.1.2...v5.1.3)

- Recognise browsers: Ecosia ios in-app browser, Phantom in-app browser

###
[`v5.1.2`](https://togithub.com/omrilotan/isbot/blob/HEAD/CHANGELOG.md#512)

[Compare
Source](https://togithub.com/omrilotan/isbot/compare/v5.1.1...v5.1.2)

-   Add bots: Cypress, Detectify, InternetMeasurement, BuiltWith
- Recognise browser: Zip Recruiter job search app, Ecosia android in-app
browser

###
[`v5.1.1`](https://togithub.com/omrilotan/isbot/blob/HEAD/CHANGELOG.md#511)

[Compare
Source](https://togithub.com/omrilotan/isbot/compare/v5.1.0...v5.1.1)

- Reduce pattern size by introducing the substring ".com" and improve
generic pattern

###
[`v5.1.0`](https://togithub.com/omrilotan/isbot/blob/HEAD/CHANGELOG.md#510)

[Compare
Source](https://togithub.com/omrilotan/isbot/compare/v5.0.0...v5.1.0)

-   Build now compatibile with older Javascript version: es2016

###
[`v5.0.0`](https://togithub.com/omrilotan/isbot/blob/HEAD/CHANGELOG.md#500)

[Compare
Source](https://togithub.com/omrilotan/isbot/compare/v4.4.0...v5.0.0)

- Remove named export "pattern" from the interface, instead use
"getPattern" method
-   Add a couple of bot patterns

###
[`v4.4.0`](https://togithub.com/omrilotan/isbot/blob/HEAD/CHANGELOG.md#440)

[Compare
Source](https://togithub.com/omrilotan/isbot/compare/v4.3.0...v4.4.0)

- Add a naive fallback pattern for engines that do not support
lookbehind in regular expressions
- Add isbotNaive function to identify bots using a naive approach
(simpler and faster)

###
[`v4.3.0`](https://togithub.com/omrilotan/isbot/blob/HEAD/CHANGELOG.md#430)

[Compare
Source](https://togithub.com/omrilotan/isbot/compare/v4.2.0...v4.3.0)

- Accept `undefined` in place of user agent string to allow headers
property to be used "as is" (`request.headers["user-agent"]`)

###
[`v4.2.0`](https://togithub.com/omrilotan/isbot/blob/HEAD/CHANGELOG.md#420)

[Compare
Source](https://togithub.com/omrilotan/isbot/compare/v4.1.2...v4.2.0)

- Accept `null` in place of user agent string to allow header value to
be used "as is" (`request.headers.get("user-agent")`)

###
[`v4.1.2`](https://togithub.com/omrilotan/isbot/compare/v4.1.1...v4.1.2)

[Compare
Source](https://togithub.com/omrilotan/isbot/compare/v4.1.1...v4.1.2)

###
[`v4.1.1`](https://togithub.com/omrilotan/isbot/blob/HEAD/CHANGELOG.md#411)

[Compare
Source](https://togithub.com/omrilotan/isbot/compare/v4.1.0...v4.1.1)

- Recognise browsers with GMS Core ([Google's Play
Services](https://togithub.com/microg/GmsCore/wiki)) as natural non-bot
browsers
-   A slightly neater typescript decleration file
- Adjust "bot" pattern to recognise bot as a standalone word or word
suffix (excluding "Cubot")
-   Recognise "rest-client" as a bot

###
[`v4.1.0`](https://togithub.com/omrilotan/isbot/blob/HEAD/CHANGELOG.md#410)

[Compare
Source](https://togithub.com/omrilotan/isbot/compare/v4.0.0...v4.1.0)

- Add createIsbotFromList: Create a custom isbot function from a list of
string representation patterns
- Recognise browsers with HMS Core (Huawei Mobile Services) as natural
non-bot browsers

###
[`v4.0.0`](https://togithub.com/omrilotan/isbot/blob/HEAD/CHANGELOG.md#400)

[Compare
Source](https://togithub.com/omrilotan/isbot/compare/v3.8.0...v4.0.0)

##### Breaking changes

This change is meant to reduce the size of the package and improve
performance by building the regular expression in build time instead of
runtime.

-   Change interface

- Remove default import. Use named import instead: `import { isbot }
from "isbot";`
- Drop `isbot` attached functions from the interface.
`isbot.<SOMETHING>` is no longer supported

-   Drop support for EOL node versions

##### New features

```ts
import { <SOMETHING> }  from "isbot";
```

| import | Type | Description |
| ------------- | --------------------------------------------------- |
-------------------------------------------------------------------------
|
| pattern | *{RegExp}* | The regular expression used to identify bots |
| list | *{string\[]}* | List of all individual pattern parts |
| isbotMatch | *{(userAgent: string): string | null}* | The substring
matched by the regular expression |
| isbotMatches | *{(userAgent: string): string\[]}* | All substrings
matched by the regular expression |
| isbotPattern | *{(userAgent: string): string | null}* | The regular
expression used to identify bot substring in the user agent |
| isbotPatterns | *{(userAgent: string): string\[]}* | All regular
expressions used to identify bot substrings in the user agent |
| createIsbot | *{(pattern: RegExp): (userAgent: string): boolean}* |
Create a custom isbot function |

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/redwoodjs/redwood).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNjkuMiIsInVwZGF0ZWRJblZlciI6IjM3LjM2My41IiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Josh GM Walker <56300765+Josh-Walker-GM@users.noreply.github.com>
  • Loading branch information
renovate[bot] and Josh-Walker-GM committed May 20, 2024
1 parent 4951bc6 commit 76151f1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"express": "4.19.2",
"find-my-way": "8.2.0",
"http-proxy-middleware": "2.0.6",
"isbot": "3.8.0",
"isbot": "5.1.6",
"react": "19.0.0-beta-04b058868c-20240508",
"react-server-dom-webpack": "19.0.0-beta-04b058868c-20240508",
"vite": "5.2.11",
Expand Down
12 changes: 6 additions & 6 deletions packages/vite/src/streaming/createReactStreamingHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import path from 'path'
import { Response } from '@whatwg-node/fetch'
import type Router from 'find-my-way'
import type { HTTPMethod } from 'find-my-way'
import isbot from 'isbot'
import { createIsbotFromList, list as isbotList } from 'isbot'
import type { ViteDevServer } from 'vite'

import { middlewareDefaultAuthProviderState } from '@redwoodjs/auth'
Expand All @@ -28,8 +28,10 @@ interface CreateReactStreamingHandlerOptions {
getMiddlewareRouter: () => Promise<Router.Instance<any>>
}

const checkUaForSeoCrawler = isbot.spawn()
checkUaForSeoCrawler.exclude(['chrome-lighthouse'])
// Create an isbot instance that ignores the Chrome Lighthouse user agent
const isbot = createIsbotFromList(
isbotList.filter((record) => !record.includes('chrome-lighthouse')),
)

export const createReactStreamingHandler = async (
{
Expand Down Expand Up @@ -167,9 +169,7 @@ export const createReactStreamingHandler = async (
currentRoute.bundle && '/' + currentRoute.bundle,
].filter(Boolean) as string[]

const isSeoCrawler = checkUaForSeoCrawler(
req.headers.get('user-agent') || '',
)
const isSeoCrawler = isbot(req.headers.get('user-agent') || '')

// Using a function to get the CSS links because we need to wait for the
// vite dev server to analyze the module graph
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8695,7 +8695,7 @@ __metadata:
find-my-way: "npm:8.2.0"
glob: "npm:10.3.15"
http-proxy-middleware: "npm:2.0.6"
isbot: "npm:3.8.0"
isbot: "npm:5.1.6"
react: "npm:19.0.0-beta-04b058868c-20240508"
react-server-dom-webpack: "npm:19.0.0-beta-04b058868c-20240508"
rollup: "npm:4.17.2"
Expand Down Expand Up @@ -20635,10 +20635,10 @@ __metadata:
languageName: node
linkType: hard

"isbot@npm:3.8.0":
version: 3.8.0
resolution: "isbot@npm:3.8.0"
checksum: 10c0/3e9daa907212db8e8e339fe0c7eacff7814de0db0aeef9ab379376b245f35058c6bdd2de0849442a791bc3d9587d749071e7d7e90aea00bf9f834f40c69ea16f
"isbot@npm:5.1.6":
version: 5.1.6
resolution: "isbot@npm:5.1.6"
checksum: 10c0/c0883a4f91882abed46be2bedb0e36acf8db74ec9866d752991ebb2982c84faa04a774bd20d36b988701611e2fdf518a977edd640a9b28e668a91d3e2c48a3d7
languageName: node
linkType: hard

Expand Down

0 comments on commit 76151f1

Please sign in to comment.