Skip to content

Commit 15444f5

Browse files
committed
renamed ignoreComponents to ignoredComponents
1 parent 8c5de5e commit 15444f5

File tree

9 files changed

+20
-20
lines changed

9 files changed

+20
-20
lines changed

packages/babel-plugin-component-annotate/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pnpm add @sentry/babel-plugin-component-annotate --save-dev
4949

5050
## Options
5151

52-
### `ignoreComponents`
52+
### `ignoredComponents`
5353

5454
Type: `string[]`
5555

@@ -66,7 +66,7 @@ A list of strings representing the names of components to ignore. The plugin wil
6666
plugins: [
6767
// Put this plugin before any other plugins you have that transform JSX code
6868
// The options are set by providing an object as the second element in the array, but not required
69-
['@sentry/babel-plugin-component-annotate', {ignoreComponents: ['Foo', 'Bar']}]
69+
['@sentry/babel-plugin-component-annotate', {ignoredComponents: ['Foo', 'Bar']}]
7070
],
7171
}
7272
```

packages/babel-plugin-component-annotate/src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const nativeSourceFileName = "dataSentrySourceFile";
4848
interface AnnotationOpts {
4949
native?: boolean;
5050
"annotate-fragments"?: boolean;
51-
ignoreComponents?: string[];
51+
ignoredComponents?: string[];
5252
}
5353

5454
interface AnnotationPluginPass extends PluginPass {
@@ -76,7 +76,7 @@ export default function componentNameAnnotatePlugin({ types: t }: typeof Babel):
7676
path.node.id.name,
7777
sourceFileNameFromState(state),
7878
attributeNamesFromState(state),
79-
state.opts.ignoreComponents ?? []
79+
state.opts.ignoredComponents ?? []
8080
);
8181
},
8282
ArrowFunctionExpression(path, state) {
@@ -104,7 +104,7 @@ export default function componentNameAnnotatePlugin({ types: t }: typeof Babel):
104104
parent.id.name,
105105
sourceFileNameFromState(state),
106106
attributeNamesFromState(state),
107-
state.opts.ignoreComponents ?? []
107+
state.opts.ignoredComponents ?? []
108108
);
109109
},
110110
ClassDeclaration(path, state) {
@@ -118,7 +118,7 @@ export default function componentNameAnnotatePlugin({ types: t }: typeof Babel):
118118
return;
119119
}
120120

121-
const ignoredComponents = state.opts.ignoreComponents ?? [];
121+
const ignoredComponents = state.opts.ignoredComponents ?? [];
122122

123123
render.traverse({
124124
ReturnStatement(returnStatement) {

packages/babel-plugin-component-annotate/test/test-plugin.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,11 +1079,11 @@ it("Bananas incompatible plugin @react-navigation source snapshot matches", () =
10791079
`);
10801080
});
10811081

1082-
it("skips components marked in ignoreComponents", () => {
1082+
it("skips components marked in ignoredComponents", () => {
10831083
const result = transform(BananasPizzaAppStandardInput, {
10841084
filename: "/filename-test.js",
10851085
presets: ["@babel/preset-react"],
1086-
plugins: [[plugin, { native: true, ignoreComponents: ["Bananas"] }]],
1086+
plugins: [[plugin, { native: true, ignoredComponents: ["Bananas"] }]],
10871087
});
10881088
expect(result?.code).toMatchInlineSnapshot(`
10891089
"import React, { Component } from 'react';

packages/bundler-plugin-core/src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import { closeSession, DEFAULT_ENVIRONMENT, makeSession } from "@sentry/core";
3030

3131
interface SentryUnpluginFactoryOptions {
3232
releaseInjectionPlugin: (injectionCode: string) => UnpluginOptions;
33-
componentNameAnnotatePlugin?: (ignoreComponents?: string[]) => UnpluginOptions;
33+
componentNameAnnotatePlugin?: (ignoredComponents?: string[]) => UnpluginOptions;
3434
moduleMetadataInjectionPlugin: (injectionCode: string) => UnpluginOptions;
3535
debugIdInjectionPlugin: (logger: Logger) => UnpluginOptions;
3636
debugIdUploadPlugin: (upload: (buildArtifacts: string[]) => Promise<void>) => UnpluginOptions;
@@ -425,7 +425,7 @@ export function sentryUnpluginFactory({
425425
} else {
426426
componentNameAnnotatePlugin &&
427427
plugins.push(
428-
componentNameAnnotatePlugin(options.reactComponentAnnotation.ignoreComponents)
428+
componentNameAnnotatePlugin(options.reactComponentAnnotation.ignoredComponents)
429429
);
430430
}
431431
}
@@ -648,7 +648,7 @@ export function createRollupDebugIdUploadHooks(
648648
};
649649
}
650650

651-
export function createComponentNameAnnotateHooks(ignoreComponents?: string[]) {
651+
export function createComponentNameAnnotateHooks(ignoredComponents?: string[]) {
652652
type ParserPlugins = NonNullable<
653653
NonNullable<Parameters<typeof transformAsync>[1]>["parserOpts"]
654654
>["plugins"];
@@ -676,7 +676,7 @@ export function createComponentNameAnnotateHooks(ignoreComponents?: string[]) {
676676

677677
try {
678678
const result = await transformAsync(code, {
679-
plugins: [[componentNameAnnotatePlugin, { ignoreComponents }]],
679+
plugins: [[componentNameAnnotatePlugin, { ignoredComponents }]],
680680
filename: id,
681681
parserOpts: {
682682
sourceType: "module",

packages/bundler-plugin-core/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ export interface Options {
322322
/**
323323
* A list of strings representing the names of components to ignore. The plugin will not apply `data-sentry` annotations on the DOM element for these components.
324324
*/
325-
ignoreComponents?: string[];
325+
ignoredComponents?: string[];
326326
// TODO: Support this option in the future
327327
/**
328328
* A list of strings representing local paths to files to ignore. The plugin will not apply `data-sentry` annotations on components in these files

packages/dev-utils/src/generate-documentation-table.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ type IncludeEntry = {
391391
supportedBundlers: ["webpack", "vite", "rollup"],
392392
},
393393
{
394-
name: "ignoreComponents",
394+
name: "ignoredComponents",
395395
type: "string[]",
396396
fullDescription:
397397
"A list of strings representing the names of components to ignore. The plugin will not perform apply `data-sentry` annotations on the DOM element for these components.",

packages/rollup-plugin/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ function rollupReleaseInjectionPlugin(injectionCode: string): UnpluginOptions {
1818
};
1919
}
2020

21-
function rollupComponentNameAnnotatePlugin(ignoreComponents?: string[]): UnpluginOptions {
21+
function rollupComponentNameAnnotatePlugin(ignoredComponents?: string[]): UnpluginOptions {
2222
return {
2323
name: "sentry-rollup-component-name-annotate-plugin",
24-
rollup: createComponentNameAnnotateHooks(ignoreComponents),
24+
rollup: createComponentNameAnnotateHooks(ignoredComponents),
2525
};
2626
}
2727

packages/vite-plugin/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ function viteReleaseInjectionPlugin(injectionCode: string): UnpluginOptions {
2121
};
2222
}
2323

24-
function viteComponentNameAnnotatePlugin(ignoreComponents?: string[]): UnpluginOptions {
24+
function viteComponentNameAnnotatePlugin(ignoredComponents?: string[]): UnpluginOptions {
2525
return {
2626
name: "sentry-vite-component-name-annotate-plugin",
2727
enforce: "pre" as const,
28-
vite: createComponentNameAnnotateHooks(ignoreComponents),
28+
vite: createComponentNameAnnotateHooks(ignoredComponents),
2929
};
3030
}
3131

packages/webpack-plugin/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ function webpackReleaseInjectionPlugin(injectionCode: string): UnpluginOptions {
4747
};
4848
}
4949

50-
function webpackComponentNameAnnotatePlugin(ignoreComponents?: string[]): UnpluginOptions {
50+
function webpackComponentNameAnnotatePlugin(ignoredComponents?: string[]): UnpluginOptions {
5151
return {
5252
name: "sentry-webpack-component-name-annotate-plugin",
5353
enforce: "pre",
5454
// Webpack needs this hook for loader logic, so the plugin is not run on unsupported file types
5555
transformInclude(id) {
5656
return id.endsWith(".tsx") || id.endsWith(".jsx");
5757
},
58-
transform: createComponentNameAnnotateHooks(ignoreComponents).transform,
58+
transform: createComponentNameAnnotateHooks(ignoredComponents).transform,
5959
};
6060
}
6161

0 commit comments

Comments
 (0)