Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
bump: "patch"
type: "remove"
---

Remove dependency on `@appsignal/core`.
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"access": "public"
},
"dependencies": {
"@appsignal/core": "=1.1.21",
"isomorphic-unfetch": "=4.0.0",
"chalk": "^4.1.0",
"commander": "^6.2.1",
"inquirer": "^7.3.3"
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/installers/node/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { existsSync } from "fs"
import { spawnSync } from "child_process"
import chalk from "chalk"
import inquirer from "inquirer"
import { validatePushApiKey } from "@appsignal/core"
import { validatePushApiKey } from "../../utils"
import * as fs from "fs"
import * as path from "path"

Expand Down
22 changes: 22 additions & 0 deletions packages/cli/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { existsSync } from "fs"
import { dirname } from "path"
import fetch from "isomorphic-unfetch"

// Returns the filesystem location at which the root of the
// `@appsignal/nodejs` package was found.
Expand Down Expand Up @@ -46,3 +47,24 @@ export function checkForAppsignalPackage(): string {

process.exit(1)
}

export async function validatePushApiKey({
endpoint = "https://push.appsignal.com",
apiKey
}: {
endpoint?: string
apiKey: string
}) {
const { status } = await fetch(`${endpoint}/1/auth?api_key=${apiKey}`)

switch (status) {
case 200:
return true
case 401:
return false
default:
throw new Error(
`Invalid ${status} response from server when authenticating`
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
bump: "patch"
type: "remove"
---

Remove dependency on `isomorphic-unfetch`. This fixes an issue where
`isomorphic-unfetch` fails to bundle properly with `esbuild` or `webpack`.
1 change: 0 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
},
"dependencies": {
"@appsignal/types": "=3.0.1",
"isomorphic-unfetch": "^4.0.0",
"tslib": "^2.3.0"
}
}
1 change: 0 additions & 1 deletion packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export * from "./utils/error"
export * from "./utils/url"
export * from "./utils/async"
export * from "./utils/environment"
export * from "./utils/push-api"

// Classes
export { Serializable } from "./serializable"
22 changes: 0 additions & 22 deletions packages/core/src/utils/push-api.ts

This file was deleted.