Skip to content

Commit 5efe1ad

Browse files
committed
linting and PR comment changes
1 parent f71e413 commit 5efe1ad

File tree

14 files changed

+31
-187
lines changed

14 files changed

+31
-187
lines changed

packages/feedback/.eslintignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
11
node_modules/
22
build/
3-
demo/build/
4-
# TODO: Check if we can re-introduce linting in demo
5-
demo
6-
metrics

packages/feedback/.eslintrc.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@
66
module.exports = {
77
extends: ['../../.eslintrc.js'],
88
overrides: [
9-
{
10-
files: ['src/**/*.ts'],
11-
rules: {
12-
'@sentry-internal/sdk/no-unsupported-es6-methods': 'off',
13-
},
14-
},
159
{
1610
files: ['jest.setup.ts', 'jest.config.ts'],
1711
parserOptions: {

packages/feedback/CONTRIBUTING.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

packages/feedback/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2022 Sentry (https://sentry.io) and individual contributors. All rights reserved.
1+
Copyright (c) 2023 Sentry (https://sentry.io) and individual contributors. All rights reserved.
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
44
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the

packages/feedback/MIGRATION.md

Lines changed: 0 additions & 149 deletions
This file was deleted.

packages/feedback/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
[![npm dm](https://img.shields.io/npm/dm/@sentry/feedback.svg)](https://www.npmjs.com/package/@sentry/feedback)
1111
[![npm dt](https://img.shields.io/npm/dt/@sentry/feedback.svg)](https://www.npmjs.com/package/@sentry/feedback)
1212

13+
This SDK is **considered experimental and in an alpha state**. It may experience breaking changes, and may be discontinued at any time. Please reach out on
14+
[GitHub](https://github.com/getsentry/sentry-javascript/issues/new/choose) if you have any feedback/concerns.
15+
1316
## Pre-requisites
1417

1518
`@sentry/feedback` requires Node 12+, and browsers newer than IE11.

packages/feedback/rollup.bundle.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ const baseBundleConfig = makeBaseBundleConfig({
44
bundleType: 'addon',
55
entrypoints: ['src/index.ts'],
66
jsVersion: 'es6',
7-
licenseTitle: '@sentry/replay',
8-
outputFileBase: () => 'bundles/replay',
7+
licenseTitle: '@sentry-internal/feedback',
8+
outputFileBase: () => 'bundles/feedback',
99
});
1010

1111
const builds = makeBundleConfigVariants(baseBundleConfig);

packages/feedback/rollup.npm.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default makeNPMConfigVariants(
77
output: {
88
// set exports to 'named' or 'auto' so that rollup doesn't warn
99
exports: 'named',
10-
// set preserveModules to false because for Replay we actually want
10+
// set preserveModules to false because for feedback we actually want
1111
// to bundle everything into one file.
1212
preserveModules: false,
1313
},

packages/feedback/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
export type { SendFeedbackData } from './types'
1+
export type { SendFeedbackData } from './types';
2+
export { sendFeedbackRequest } from './util/sendFeedbackRequest';

packages/feedback/src/types/feedback.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type {Event} from '@sentry/types';
1+
import type { Event, Primitive } from '@sentry/types';
22

33
/**
44
* NOTE: These types are still considered Beta and subject to change.
@@ -16,8 +16,12 @@ export interface FeedbackEvent extends Event {
1616
}
1717

1818
export interface SendFeedbackData {
19-
message: string,
20-
email: string,
21-
replay_id: string,
22-
url: string,
19+
feedback: {
20+
message: string;
21+
email: string;
22+
replay_id: string | undefined;
23+
name: string;
24+
url: string;
25+
};
26+
tags: { [key: string]: Primitive } | undefined;
2327
}

packages/feedback/src/util/prepareFeedbackEvent.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type {Scope} from '@sentry/core';
2-
import {prepareEvent} from '@sentry/core';
1+
import type { Scope } from '@sentry/core';
2+
import { prepareEvent } from '@sentry/core';
33
import type { Client } from '@sentry/types';
44

55
import type { FeedbackEvent } from '../types';
@@ -16,11 +16,16 @@ export async function prepareFeedbackEvent({
1616
event: FeedbackEvent;
1717
scope: Scope;
1818
}): Promise<FeedbackEvent | null> {
19+
const eventHint = { integrations: undefined };
20+
if (client.emit) {
21+
client.emit('preprocessEvent', event, eventHint);
22+
}
23+
1924
const preparedEvent = (await prepareEvent(
2025
client.getOptions(),
2126
event,
22-
{integrations: []},
23-
scope
27+
{ integrations: undefined },
28+
scope,
2429
)) as FeedbackEvent | null;
2530

2631
// If e.g. a global event processor returned null
@@ -35,7 +40,7 @@ export async function prepareFeedbackEvent({
3540

3641
// extract the SDK name because `client._prepareEvent` doesn't add it to the event
3742
const metadata = client.getSdkMetadata && client.getSdkMetadata();
38-
const {name, version} = (metadata && metadata.sdk) || {};
43+
const { name, version } = (metadata && metadata.sdk) || {};
3944

4045
preparedEvent.sdk = {
4146
...preparedEvent.sdk,

packages/feedback/src/util/sendFeedbackRequest.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@ import { prepareFeedbackEvent } from './prepareFeedbackEvent';
88
* Send feedback using `fetch()`
99
*/
1010
export async function sendFeedbackRequest({
11-
message,
12-
email,
13-
replay_id,
14-
url,
11+
feedback: { message, email, name, replay_id, url },
12+
tags,
1513
}: SendFeedbackData): Promise<Response | null> {
1614
const hub = getCurrentHub();
1715

packages/replay/.eslintignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
11
node_modules/
22
build/
3-
demo/build/
4-
# TODO: Check if we can re-introduce linting in demo
5-
demo
6-
metrics

packages/types/src/feedback.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type {Event} from './event';
1+
import type { Event } from './event';
22

33
/**
44
* NOTE: These types are still considered Beta and subject to change.

0 commit comments

Comments
 (0)