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
1 change: 0 additions & 1 deletion packages/playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"start:proxyLogger": "ts-node scripts/request-logger-proxy.ts"
},
"dependencies": {
"@sentry/cli": "1.74.5",
"@sentry/integrations": "^7.11.1",
"@sentry/node": "^7.11.1",
"@sentry/unplugin": "*",
Expand Down
1 change: 0 additions & 1 deletion packages/unplugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"lint": "eslint ./src ./test"
},
"dependencies": {
"@sentry/cli": "1.74.5",
"axios": "^0.27.2",
"form-data": "^4.0.0",
"magic-string": "0.26.2",
Expand Down
52 changes: 0 additions & 52 deletions packages/unplugin/src/sentry/cli.ts

This file was deleted.

24 changes: 6 additions & 18 deletions packages/unplugin/src/sentry/facade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
// - huge download
// - unnecessary functionality

import { makeSentryCli } from "./cli";
import { Options } from "../types";
import SentryCli from "@sentry/cli";
import { createRelease, deleteAllReleaseArtifacts, uploadReleaseFile, updateRelease } from "./api";
import { getFiles } from "./sourcemaps";

Expand All @@ -26,14 +24,12 @@ export type SentryFacade = {
* a release on Sentry. This includes uploading source maps and finalizing the release
*/
export function makeSentryFacade(release: string, options: Options): SentryFacade {
const cli = makeSentryCli(options);

return {
createNewRelease: () => createNewRelease(release, options),
cleanArtifacts: () => cleanArtifacts(cli, release, options),
uploadSourceMaps: () => uploadSourceMaps(cli, release, options),
cleanArtifacts: () => cleanArtifacts(release, options),
uploadSourceMaps: () => uploadSourceMaps(release, options),
setCommits: () => setCommits(/* release */),
finalizeRelease: () => finalizeRelease(cli, release, options),
finalizeRelease: () => finalizeRelease(release, options),
addDeploy: () => addDeploy(/* release */),
};
}
Expand Down Expand Up @@ -72,11 +68,7 @@ async function createNewRelease(release: string, options: Options): Promise<stri
return Promise.resolve("nothing to do here");
}

async function uploadSourceMaps(
cli: SentryCli,
release: string,
options: Options
): Promise<string> {
async function uploadSourceMaps(release: string, options: Options): Promise<string> {
// This is what Sentry CLI does:
// TODO: 0. Preprocess source maps
// - (Out of scope for now)
Expand Down Expand Up @@ -159,11 +151,7 @@ async function uploadSourceMaps(
});
}

async function finalizeRelease(
_cli: SentryCli,
release: string,
options: Options
): Promise<string> {
async function finalizeRelease(release: string, options: Options): Promise<string> {
if (options.finalize) {
const { authToken, org, url, project } = options;
if (!authToken || !org || !url || !project) {
Expand All @@ -189,7 +177,7 @@ async function finalizeRelease(
return Promise.resolve("nothing to do here");
}

async function cleanArtifacts(_cli: SentryCli, release: string, options: Options): Promise<string> {
async function cleanArtifacts(release: string, options: Options): Promise<string> {
if (options.cleanArtifacts) {
// TODO: pull these checks out of here and simplify them
if (options.authToken === undefined) {
Expand Down
2 changes: 1 addition & 1 deletion packages/unplugin/src/sentry/sourcemaps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function getAllIncludedFileNames(
.map((file) => path.join(dirPath, "/", file))
.forEach((file) => {
if (fs.statSync(file).isDirectory()) {
accFiles.concat(getAllIncludedFileNames(file, allowedExtensions, accFiles));
accFiles = accFiles.concat(getAllIncludedFileNames(file, allowedExtensions, accFiles));
} else {
if (allowedExtensions.some((e) => file.endsWith(e))) {
accFiles.push(file);
Expand Down
25 changes: 1 addition & 24 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2112,19 +2112,6 @@
estree-walker "^1.0.1"
picomatch "^2.2.2"

"@sentry/cli@1.74.5":
version "1.74.5"
resolved "https://registry.yarnpkg.com/@sentry/cli/-/cli-1.74.5.tgz#4a5c622913087c9ab6f82994da9a7526423779b8"
integrity sha512-Ze1ec306ZWHtrxKypOJ8nhtFqkrx2f/6bRH+DcJzEQ3bBePQ0ZnqJTTe4BBHADYBtxFIaUWzCZ6DquLz2Zv/sw==
dependencies:
https-proxy-agent "^5.0.0"
mkdirp "^0.5.5"
node-fetch "^2.6.7"
npmlog "^4.1.2"
progress "^2.0.3"
proxy-from-env "^1.1.0"
which "^2.0.2"

"@sentry/core@7.11.1":
version "7.11.1"
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.11.1.tgz#d68e796f3b6428aefd6086a1db00118df7a9a9e4"
Expand Down Expand Up @@ -8926,11 +8913,6 @@ process@^0.11.10:
resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182"
integrity sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==

progress@^2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8"
integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==

promise-inflight@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3"
Expand Down Expand Up @@ -8998,11 +8980,6 @@ proxy-addr@~2.0.7:
forwarded "0.2.0"
ipaddr.js "1.9.1"

proxy-from-env@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2"
integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==

prr@~1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476"
Expand Down Expand Up @@ -11046,7 +11023,7 @@ which@1, which@^1.2.9, which@^1.3.1:
dependencies:
isexe "^2.0.0"

which@^2.0.1, which@^2.0.2:
which@^2.0.1:
version "2.0.2"
resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1"
integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==
Expand Down