Skip to content

feat(v8): Rename gcp package to @sentry/google-cloud-serverless #11065

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 4 commits into from
Mar 13, 2024
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
2 changes: 1 addition & 1 deletion .craft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ targets:
id: '@sentry/aws-serverless'
includeNames: /^sentry-aws-serverless-\d.*\.tgz$/
- name: npm
id: '@sentry/google-cloud'
id: '@sentry/google-cloud-serverless'
includeNames: /^sentry-google-cloud-\d.*\.tgz$/
- name: npm
id: '@sentry/bun'
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ body:
- '@sentry/deno'
- '@sentry/ember'
- '@sentry/gatsby'
- '@sentry/google-cloud-serverless'
- '@sentry/nextjs'
- '@sentry/node'
- '@sentry/react'
- '@sentry/remix'
- '@sentry/google-cloud'
- '@sentry/svelte'
- '@sentry/sveltekit'
- '@sentry/vue'
Expand Down
12 changes: 6 additions & 6 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,12 @@ The `Transaction` integration has been removed from `@sentry/integrations`. Ther
#### @sentry/serverless

`@sentry/serverless` has been removed and will no longer be published. The serverless package has been split into two
different packages, `@sentry/aws-serverless` and `@sentry/google-cloud`. These new packages have smaller bundle size
than `@sentry/serverless`, which should improve your serverless cold-start times.
different packages, `@sentry/aws-serverless` and `@sentry/google-cloud-serverless`. These new packages have smaller
bundle size than `@sentry/serverless`, which should improve your serverless cold-start times.

`@sentry/aws-serverless` and `@sentry/google-cloud` has also been changed to only emit CJS builds. The ESM build for the
`@sentry/serverless` package was always broken and we decided to remove it entirely. ESM support will be re-added at a
later date.
`@sentry/aws-serverless` and `@sentry/google-cloud-serverless` has also been changed to only emit CJS builds. The ESM
build for the `@sentry/serverless` package was always broken and we decided to remove it entirely. ESM support will be
re-added at a later date.

In `@sentry/serverless` you had to use a namespace import to initialize the SDK. This has been removed so that you can
directly import from the SDK instead.
Expand Down Expand Up @@ -209,7 +209,7 @@ Sentry.GCPFunction.init({
});

// v8
const Sentry = require('@sentry/google-cloud');
const Sentry = require('@sentry/google-cloud-serverless');

Sentry.init({
dsn: '__DSN__',
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ package. Please refer to the README and instructions of those SDKs for more deta
- [`@sentry/remix`](https://github.com/getsentry/sentry-javascript/tree/master/packages/remix): SDK for Remix
- [`@sentry/aws-serverless`](https://github.com/getsentry/sentry-javascript/tree/master/packages/aws-serverless): SDK
for AWS Lambda Functions
- [`@sentry/google-cloud`](https://github.com/getsentry/sentry-javascript/tree/master/packages/google-cloud): SDK for
Google Cloud Functions
- [`@sentry/google-cloud-serverless`](https://github.com/getsentry/sentry-javascript/tree/master/packages/google-cloud):
SDK for Google Cloud Functions
- [`@sentry/electron`](https://github.com/getsentry/sentry-electron): SDK for Electron with support for native crashes
- [`@sentry/react-native`](https://github.com/getsentry/sentry-react-native): SDK for React Native with support for
native crashes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@sentry/astro": "latest || *",
"@sentry/nextjs": "latest || *",
"@sentry/aws-serverless": "latest || *",
"@sentry/google-cloud": "latest || *",
"@sentry/google-cloud-serverless": "latest || *",
"@sentry/bun": "latest || *",
"@sentry/types": "latest || *",
"@types/node": "18.15.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import * as SentryAstro from '@sentry/astro';
import * as SentryBun from '@sentry/bun';
import * as SentryGoogleCloud from '@sentry/google-cloud';
import * as SentryNextJs from '@sentry/nextjs';
import * as SentryNode from '@sentry/node';
import * as SentryNodeExperimental from '@sentry/node-experimental';
import * as SentryRemix from '@sentry/remix';
import * as SentrySvelteKit from '@sentry/sveltekit';

// SentryAWS is CJS only
// Serverless SDKs are CJS only
const SentryAWS = require('@sentry/aws-serverless');
const SentryGoogleCloud = require('@sentry/google-cloud-serverless');

/* List of exports that are safe to ignore / we don't require in any depending package */
const NODE_EXPERIMENTAL_EXPORTS_IGNORE = [
Expand Down Expand Up @@ -85,7 +85,7 @@ const DEPENDENTS: Dependent[] = [
ignoreExports: ['makeMain'],
},
{
package: '@sentry/google-cloud',
package: '@sentry/google-cloud-serverless',
compareWith: nodeExports,
exports: Object.keys(SentryGoogleCloud),
ignoreExports: ['makeMain'],
Expand Down
2 changes: 1 addition & 1 deletion dev-packages/e2e-tests/verdaccio-config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ packages:
unpublish: $all
# proxy: npmjs # Don't proxy for E2E tests!

'@sentry/google-cloud':
'@sentry/google-cloud-serverless':
access: $all
publish: $all
unpublish: $all
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"packages/eslint-plugin-sdk",
"packages/feedback",
"packages/gatsby",
"packages/google-cloud",
"packages/google-cloud-serverless",
"packages/integration-shims",
"packages/nextjs",
"packages/node",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
## General

This package is a wrapper around `@sentry/node`, with added functionality related to various Serverless solutions. All
methods available in `@sentry/node` can be imported from `@sentry/google-cloud`.
methods available in `@sentry/node` can be imported from `@sentry/google-cloud-serverless`.

To use this SDK, call `Sentry.init(options)` at the very beginning of your JavaScript file.

```javascript
import * as Sentry from '@sentry/google-cloud';
const Sentry = require('@sentry/google-cloud-serverless');

Sentry.init({
dsn: '__DSN__',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@sentry/google-cloud",
"name": "@sentry/google-cloud-serverless",
"version": "8.0.0-alpha.2",
"description": "Official Sentry SDK for Google Cloud Functions",
"repository": "git://github.com/getsentry/sentry-javascript.git",
Expand All @@ -16,15 +16,10 @@
"types-ts3.8"
],
"main": "build/cjs/index.js",
"module": "build/esm/index.js",
"types": "build/types/index.d.ts",
"exports": {
"./package.json": "./package.json",
".": {
"import": {
"types": "./build/types/index.d.ts",
"default": "./build/esm/index.js"
},
"require": {
"types": "./build/types/index.d.ts",
"default": "./build/cjs/index.js"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { captureException, continueTrace, flush, getCurrentScope, startSpanManua
import { isString, logger, stripUrlQueryAndFragment } from '@sentry/utils';

import { DEBUG_BUILD } from '../debug-build';
import { domainify, markEventUnhandled, proxyFunction } from './../utils';
import { domainify, markEventUnhandled, proxyFunction } from '../utils';
import type { HttpFunction, WrapperOptions } from './general';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ export function init(options: NodeOptions = {}): void {
};

opts._metadata.sdk = opts._metadata.sdk || {
name: 'sentry.javascript.google-cloud',
name: 'sentry.javascript.google-cloud-serverless',
packages: [
{
name: 'npm:@sentry/google-cloud',
name: 'npm:@sentry/google-cloud-serverless',
version: SDK_VERSION,
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ describe('init()', () => {
expect.objectContaining({
_metadata: {
sdk: {
name: 'sentry.javascript.google-cloud',
name: 'sentry.javascript.google-cloud-serverless',
packages: [
{
name: 'npm:@sentry/google-cloud',
name: 'npm:@sentry/google-cloud-serverless',
version: expect.any(String),
},
],
Expand Down