hubot 5.0.2 → 5.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,6 +3,7 @@ on:
3
3
  push:
4
4
  branches:
5
5
  - main
6
+ - next
6
7
  permissions:
7
8
  contents: read
8
9
  jobs:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hubot",
3
- "version": "5.0.2",
3
+ "version": "5.0.4",
4
4
  "author": "hubot",
5
5
  "keywords": [
6
6
  "github",
@@ -50,7 +50,8 @@
50
50
  },
51
51
  "release": {
52
52
  "branches": [
53
- "main"
53
+ "main",
54
+ "next"
54
55
  ],
55
56
  "dryRun": false
56
57
  }
package/src/robot.js CHANGED
@@ -2,6 +2,7 @@
2
2
  const EventEmitter = require('events').EventEmitter
3
3
  const fs = require('fs')
4
4
  const path = require('path')
5
+ const pathToFileURL = require('url').pathToFileURL
5
6
 
6
7
  const async = require('async')
7
8
  const pino = require('pino')
@@ -510,9 +511,9 @@ class Robot {
510
511
  if (Array.from(HUBOT_DEFAULT_ADAPTERS).indexOf(this.adapterName) > -1) {
511
512
  this.adapter = this.requireAdapterFrom(path.resolve(path.join(__dirname, 'adapters', this.adapterName)))
512
513
  } else if (['.js', '.cjs', '.coffee'].includes(ext)) {
513
- this.adapter = this.requireAdapterFrom(path.resolve(adapterPath))
514
+ this.adapter = this.requireAdapterFrom(pathToFileURL(path.resolve(adapterPath)).pathname)
514
515
  } else if (['.mjs'].includes(ext)) {
515
- this.adapter = await this.importAdapterFrom(path.resolve(adapterPath))
516
+ this.adapter = await this.importAdapterFrom(pathToFileURL(path.resolve(adapterPath)).href)
516
517
  } else {
517
518
  this.adapter = this.requireAdapterFrom(`hubot-${this.adapterName}`)
518
519
  }