diff --git a/packages/playground/package.json b/packages/playground/package.json index 2fb5f73e..7cdba0dd 100644 --- a/packages/playground/package.json +++ b/packages/playground/package.json @@ -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": "*", diff --git a/packages/unplugin/package.json b/packages/unplugin/package.json index b46dc6ad..27cf7cc1 100644 --- a/packages/unplugin/package.json +++ b/packages/unplugin/package.json @@ -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", diff --git a/packages/unplugin/src/sentry/cli.ts b/packages/unplugin/src/sentry/cli.ts deleted file mode 100644 index 480adb78..00000000 --- a/packages/unplugin/src/sentry/cli.ts +++ /dev/null @@ -1,52 +0,0 @@ -import SentryCli from "@sentry/cli"; -import { Options } from "../types"; - -/** Creates a new Sentry CLI instance. */ -export function makeSentryCli(options: Options) { - //TODO: pass config file instead of null - const cli = new SentryCli(options.configFile, { - silent: false, //TODO read from options - org: options.org, - project: options.project, - authToken: options.authToken, - url: options.url, - vcsRemote: "origin", //TODO set from options, - }); - - // Let's not worry about dry run for now - // if (this.isDryRun()) { - // this.outputDebug("DRY Run Mode"); - - // return { - // releases: { - // proposeVersion: () => - // cli.releases.proposeVersion().then((version) => { - // this.outputDebug("Proposed version:\n", version); - // return version; - // }), - // new: (release) => { - // this.outputDebug("Creating new release:\n", release); - // return Promise.resolve(release); - // }, - // uploadSourceMaps: (release, config) => { - // this.outputDebug("Calling upload-sourcemaps with:\n", config); - // return Promise.resolve(release, config); - // }, - // finalize: (release) => { - // this.outputDebug("Finalizing release:\n", release); - // return Promise.resolve(release); - // }, - // setCommits: (release, config) => { - // this.outputDebug("Calling set-commits with:\n", config); - // return Promise.resolve(release, config); - // }, - // newDeploy: (release, config) => { - // this.outputDebug("Calling deploy with:\n", config); - // return Promise.resolve(release, config); - // }, - // }, - // }; - // } - - return cli; -} diff --git a/packages/unplugin/src/sentry/facade.ts b/packages/unplugin/src/sentry/facade.ts index 26bebb37..46551a1e 100644 --- a/packages/unplugin/src/sentry/facade.ts +++ b/packages/unplugin/src/sentry/facade.ts @@ -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"; @@ -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 */), }; } @@ -72,11 +68,7 @@ async function createNewRelease(release: string, options: Options): Promise { +async function uploadSourceMaps(release: string, options: Options): Promise { // This is what Sentry CLI does: // TODO: 0. Preprocess source maps // - (Out of scope for now) @@ -159,11 +151,7 @@ async function uploadSourceMaps( }); } -async function finalizeRelease( - _cli: SentryCli, - release: string, - options: Options -): Promise { +async function finalizeRelease(release: string, options: Options): Promise { if (options.finalize) { const { authToken, org, url, project } = options; if (!authToken || !org || !url || !project) { @@ -189,7 +177,7 @@ async function finalizeRelease( return Promise.resolve("nothing to do here"); } -async function cleanArtifacts(_cli: SentryCli, release: string, options: Options): Promise { +async function cleanArtifacts(release: string, options: Options): Promise { if (options.cleanArtifacts) { // TODO: pull these checks out of here and simplify them if (options.authToken === undefined) { diff --git a/packages/unplugin/src/sentry/sourcemaps.ts b/packages/unplugin/src/sentry/sourcemaps.ts index 5738e606..fc726019 100644 --- a/packages/unplugin/src/sentry/sourcemaps.ts +++ b/packages/unplugin/src/sentry/sourcemaps.ts @@ -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); diff --git a/yarn.lock b/yarn.lock index be8641fe..5e5b54f6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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" @@ -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" @@ -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" @@ -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==