Skip to content
This repository has been archived by the owner on Oct 13, 2020. It is now read-only.

Commit

Permalink
fix(repo): fix build issues
Browse files Browse the repository at this point in the history
fix build issues where dependencies where causing failures at runtime,
add a navigator object to global scope so `@octokit/request` does not
fail, as this is not available in node

[ch8743]
  • Loading branch information
blake-newman committed Feb 18, 2020
1 parent d17667a commit 2927f53
Show file tree
Hide file tree
Showing 6 changed files with 342 additions and 439 deletions.
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ inputs:
description: 'The actions title'
runs:
using: 'node12'
main: 'dist/index.js'
main: 'index.js'
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require('./patch')
require('./dist')
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"private": true,
"description": "GitHub action for creating annotations from JSON file",
"main": "./dist/index.js",
"main": "./index.js",
"files": [
"dist"
],
Expand Down Expand Up @@ -47,7 +47,7 @@
},
"dependencies": {
"@actions/core": "^1.2.2",
"@actions/github": "^2.1.0",
"@actions/github": "^1.1.0",
"@octokit/core": "^2.4.0",
"@octokit/rest": "^16.43.1"
},
Expand Down
3 changes: 3 additions & 0 deletions patch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
;(function patchNavigatorIssue() {
global.navigator = {}
})()
12 changes: 11 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,17 @@ const { dependencies: dependenciesOptions } = require('./package.json')

const dependencies = Object.keys(dependenciesOptions)

module.exports = config().map(configuration => {
module.exports = config({
builds(options) {
return [
{
...options,
output: 'dist/index.js',
format: 'cjs',
},
]
},
}).map(configuration => {
const { external = [] } = configuration

return {
Expand Down
Loading

0 comments on commit 2927f53

Please sign in to comment.