-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #113 from bugsnag/release/v48.0.0
- Loading branch information
Showing
27 changed files
with
343 additions
and
327 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,14 @@ | ||
const { spawn } = require('child_process') | ||
|
||
function resolveCommand (options) { | ||
const command = ['install', '@bugsnag/plugin-expo-eas-sourcemaps', '@bugsnag/source-maps'] | ||
|
||
if (options.npm) { | ||
command.push('--npm') | ||
command.push('--') | ||
command.push('--save-dev') | ||
} | ||
|
||
if (options.yarn) { | ||
command.push('--yarn') | ||
command.push('--') | ||
command.push('--dev') | ||
} | ||
|
||
return command | ||
} | ||
|
||
module.exports = (projectRoot, options) => { | ||
return new Promise((resolve, reject) => { | ||
const command = resolveCommand(options) | ||
const proc = spawn('expo', command, { cwd: projectRoot }) | ||
|
||
// buffer output in case of an error | ||
let stdout = '' | ||
let stderr = '' | ||
proc.stdout.on('data', d => { stdout += d }) | ||
proc.stderr.on('data', d => { stderr += d }) | ||
|
||
proc.on('error', err => { reject(err) }) | ||
|
||
proc.on('close', code => { | ||
if (code === 0) { | ||
return resolve() | ||
} | ||
|
||
reject( | ||
new Error( | ||
`Command exited with non-zero exit code (${code}) "expo ${command.join(' ')}"\nstdout:\n${stdout}\n\nstderr:\n${stderr}` | ||
) | ||
) | ||
}) | ||
const { createForProject } = require('@expo/package-manager') | ||
const { resolvePackageName } = require('./utils') | ||
|
||
module.exports = (version, projectRoot, options) => { | ||
const packages = [resolvePackageName('@bugsnag/plugin-expo-eas-sourcemaps', version), '@bugsnag/source-maps'] | ||
|
||
// Expo's package manager will reject with an error if the child process exits with a non-zero code | ||
// it also buffers the output and attaches it to any errors - https://github.com/expo/spawn-async/blob/main/src/spawnAsync.ts | ||
const packageManager = createForProject(projectRoot, options) | ||
return packageManager.addDevAsync(packages).catch(error => { | ||
error.message += `\nstdout:\n${error.stdout}\n\nstderr:\n${error.stderr}` | ||
throw error | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
This project has no app.json or App.js | ||
This project has no app.json, App.js or package.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This project has no app.json or App.js |
Oops, something went wrong.