Skip to content

feat(remix): Add release / sourcemap upload script. #5312

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 28, 2022

Conversation

onurtemizkan
Copy link
Collaborator

@onurtemizkan onurtemizkan commented Jun 24, 2022

Ref: #4894

Adds a mini CLI tool to create releases and upload Remix sourcemaps with a default path / prefix.

Uses sentry-cli under the hood and requires a valid .sentryclirc to work.

Usage:

$ upload-sourcemaps
Usage: upload-sourcemaps --release RELEASE [--urlPrefix URL_PREFIX] [--buildPath BUILD_PATH]

Options:
  --help       Show help                                               [boolean]
  --version    Show version number                                     [boolean]
  --release    The release number                            [string] [required]
  --urlPrefix  The url prefix for the sourcemaps                        [string]
  --buildPath  The path to the build directory                          [string]

Also removed webpack-related dependencies from Remix SDK, as we don't need them.

@onurtemizkan onurtemizkan added this to the Sentry Remix SDK milestone Jun 24, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Jun 24, 2022

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 19.3 KB (added)
@sentry/browser - ES5 CDN Bundle (minified) 59.72 KB (added)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 17.9 KB (added)
@sentry/browser - ES6 CDN Bundle (minified) 52.67 KB (added)
@sentry/browser - Webpack (gzipped + minified) 19.67 KB (added)
@sentry/browser - Webpack (minified) 64.04 KB (added)
@sentry/react - Webpack (gzipped + minified) 19.69 KB (added)
@sentry/nextjs Client - Webpack (gzipped + minified) 43.85 KB (added)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 25.63 KB (added)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 23.9 KB (added)

@AbhiPrasad AbhiPrasad mentioned this pull request Jun 24, 2022
26 tasks
Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a note that if they need more advanced config to set up sentry-cli themselves?

Also any way we can unit test this script?

.option('buildPath', { type: 'string', describe: 'The path to the build directory' })
.usage('Usage: $0 --release RELEASE [--urlPrefix URL_PREFIX] [--buildPath BUILD_PATH]').argv;

const RELEASE = argv.release;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we default the release to use propose-version? (https://docs.sentry.io/product/cli/releases/#creating-releases)

@onurtemizkan onurtemizkan force-pushed the onur/remix-release-cli branch from f3a6fc4 to 9d87ae7 Compare June 27, 2022 13:54
@onurtemizkan
Copy link
Collaborator Author

@AbhiPrasad,
updated the help output, switched to TS and added unit tests. There are also a few notes around. Could you have another look please?

// This is a workaround for that.
//
// eslint-disable-next-line @typescript-eslint/no-var-requires
const SentryCli = require('@sentry/cli') as typeof SentryCliModule;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, I’d rather just make this a javascript file and not have the workaround for TS. The unit tests should be enough to make sure we are enforcing correct behaviour.

@onurtemizkan onurtemizkan force-pushed the onur/remix-release-cli branch from 3ebf2e7 to 524d4e0 Compare June 28, 2022 13:56
@onurtemizkan onurtemizkan requested a review from AbhiPrasad June 28, 2022 14:13
@onurtemizkan onurtemizkan force-pushed the onur/remix-release-cli branch from 524d4e0 to b710150 Compare June 28, 2022 14:21
Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, great work @onurtemizkan to bring this to the finish line.

I can take care of the release registry work + unprivating the package + cutting an alpha release so we can test. We'll probably release this with 7.4.0-alpha.0.

In the meantime, do you mind getting started on the README/docs?

@AbhiPrasad AbhiPrasad merged commit 7e044b1 into master Jun 28, 2022
@AbhiPrasad AbhiPrasad deleted the onur/remix-release-cli branch June 28, 2022 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants