From 1416e69de9f73601094bf0a84631036f7ee04a46 Mon Sep 17 00:00:00 2001 From: Nikolas Skoufis Date: Mon, 10 Oct 2022 16:32:19 +1100 Subject: [PATCH 01/19] Add a config field to configure entity validation This adds a new config field that can be used to configure entity validation. It defaults to false to ensure backwards compatibility. It is not permitted when catalog paths contain wildcards, due to limitations with how the GraphQL query will work. Signed-off-by: Nikolas Skoufis --- .../GitHubEntityProviderConfig.test.ts | 37 +++++++++++++++++++ .../providers/GitHubEntityProviderConfig.ts | 12 ++++++ 2 files changed, 49 insertions(+) diff --git a/plugins/catalog-backend-module-github/src/providers/GitHubEntityProviderConfig.test.ts b/plugins/catalog-backend-module-github/src/providers/GitHubEntityProviderConfig.test.ts index 66a5463bf5..16f9d96010 100644 --- a/plugins/catalog-backend-module-github/src/providers/GitHubEntityProviderConfig.test.ts +++ b/plugins/catalog-backend-module-github/src/providers/GitHubEntityProviderConfig.test.ts @@ -101,6 +101,7 @@ describe('readProviderConfigs', () => { exclude: undefined, }, }, + validateLocationsExist: false, }); expect(providerConfigs[1]).toEqual({ id: 'providerCustomCatalogPath', @@ -115,6 +116,7 @@ describe('readProviderConfigs', () => { exclude: undefined, }, }, + validateLocationsExist: false, }); expect(providerConfigs[2]).toEqual({ id: 'providerWithRepositoryFilter', @@ -129,6 +131,7 @@ describe('readProviderConfigs', () => { exclude: undefined, }, }, + validateLocationsExist: false, }); expect(providerConfigs[3]).toEqual({ id: 'providerWithBranchFilter', @@ -143,6 +146,7 @@ describe('readProviderConfigs', () => { exclude: undefined, }, }, + validateLocationsExist: false, }); expect(providerConfigs[4]).toEqual({ id: 'providerWithTopicFilter', @@ -157,6 +161,7 @@ describe('readProviderConfigs', () => { exclude: ['backstage-exclude'], }, }, + validateLocationsExist: false, }); expect(providerConfigs[5]).toEqual({ id: 'providerWithHost', @@ -171,6 +176,38 @@ describe('readProviderConfigs', () => { exclude: undefined, }, }, + validateLocationsExist: false, }); }); + + it('defaults validateLocationsExist to false', () => { + const config = new ConfigReader({ + catalog: { + providers: { + github: { + organization: 'test-org', + }, + }, + }, + }); + const providerConfigs = readProviderConfigs(config); + + expect(providerConfigs[0].validateLocationsExist).toEqual(false); + }); + + it('throws an error when a wildcard catalog path is configured with validation of locations', () => { + const config = new ConfigReader({ + catalog: { + providers: { + github: { + organization: 'test-org', + validateLocationsExist: true, + catalogPath: '/*/catalog-info.yaml', + }, + }, + }, + }); + + expect(() => readProviderConfigs(config)).toThrow(); + }); }); diff --git a/plugins/catalog-backend-module-github/src/providers/GitHubEntityProviderConfig.ts b/plugins/catalog-backend-module-github/src/providers/GitHubEntityProviderConfig.ts index d40b206751..fd5482d1b6 100644 --- a/plugins/catalog-backend-module-github/src/providers/GitHubEntityProviderConfig.ts +++ b/plugins/catalog-backend-module-github/src/providers/GitHubEntityProviderConfig.ts @@ -29,6 +29,7 @@ export type GitHubEntityProviderConfig = { branch?: string; topic?: GithubTopicFilters; }; + validateLocationsExist: boolean; }; export type GithubTopicFilters = { @@ -72,6 +73,16 @@ function readProviderConfig( const topicFilterExclude = config?.getOptionalStringArray( 'filters.topic.exclude', ); + const validateLocationsExist = + config?.getOptionalBoolean('validateLocationsExist') ?? false; + + const catalogPathContainsWildcard = catalogPath.includes('*'); + + if (validateLocationsExist && catalogPathContainsWildcard) { + throw Error( + `Error while processing GitHub provider config. The catalog path ${catalogPath} contains a wildcard, which is incompatible with validation of locations existing before emitting them. Ensure that validateLocationsExist is set to false.`, + ); + } return { id, @@ -88,6 +99,7 @@ function readProviderConfig( exclude: topicFilterExclude, }, }, + validateLocationsExist, }; } /** From 143cae25da50e978cff03053c9e0f3ce1f7797af Mon Sep 17 00:00:00 2001 From: Nikolas Skoufis Date: Mon, 10 Oct 2022 17:15:40 +1100 Subject: [PATCH 02/19] Implement filtering of github entities based on presence This implements the config from the previous commit. The getRepositories graphql query is updated to include information about the specified catalog info file. When validation is turned on, if the file is not present or empty, the location will not be emitted. Signed-off-by: Nikolas Skoufis --- .../src/lib/github.test.ts | 18 ++- .../src/lib/github.ts | 17 ++- .../providers/GitHubEntityProvider.test.ts | 134 ++++++++++++++++++ .../src/providers/GitHubEntityProvider.ts | 11 ++ 4 files changed, 175 insertions(+), 5 deletions(-) diff --git a/plugins/catalog-backend-module-github/src/lib/github.test.ts b/plugins/catalog-backend-module-github/src/lib/github.test.ts index e2303c16e6..25878c2005 100644 --- a/plugins/catalog-backend-module-github/src/lib/github.test.ts +++ b/plugins/catalog-backend-module-github/src/lib/github.test.ts @@ -213,6 +213,7 @@ describe('github', () => { defaultBranchRef: { name: 'main', }, + catalogInfoFile: null, }, { name: 'demo', @@ -222,6 +223,11 @@ describe('github', () => { defaultBranchRef: { name: 'main', }, + catalogInfoFile: { + __typename: 'Blob', + id: 'acb123', + text: 'some yaml', + }, }, ], pageInfo: { @@ -243,6 +249,7 @@ describe('github', () => { defaultBranchRef: { name: 'main', }, + catalogInfoFile: null, }, { name: 'demo', @@ -252,6 +259,11 @@ describe('github', () => { defaultBranchRef: { name: 'main', }, + catalogInfoFile: { + __typename: 'Blob', + id: 'acb123', + text: 'some yaml', + }, }, ], }; @@ -262,9 +274,9 @@ describe('github', () => { ), ); - await expect(getOrganizationRepositories(graphql, 'a')).resolves.toEqual( - output, - ); + await expect( + getOrganizationRepositories(graphql, 'a', 'catalog-info.yaml'), + ).resolves.toEqual(output); }); }); }); diff --git a/plugins/catalog-backend-module-github/src/lib/github.ts b/plugins/catalog-backend-module-github/src/lib/github.ts index 6a944af330..d854cc9043 100644 --- a/plugins/catalog-backend-module-github/src/lib/github.ts +++ b/plugins/catalog-backend-module-github/src/lib/github.ts @@ -65,6 +65,11 @@ export type Repository = { defaultBranchRef: { name: string; } | null; + catalogInfoFile: { + __typename: string; + id: string; + text: string; + } | null; }; type RepositoryTopics = { @@ -266,14 +271,22 @@ export async function getOrganizationTeams( export async function getOrganizationRepositories( client: typeof graphql, org: string, + catalogPath: string, ): Promise<{ repositories: Repository[] }> { + const catalogPathRef = `HEAD:${catalogPath}`; const query = ` - query repositories($org: String!, $cursor: String) { + query repositories($org: String!, $catalogPathRef: String!, $cursor: String) { repositoryOwner(login: $org) { login repositories(first: 100, after: $cursor) { nodes { name + catalogInfoFile: object(expression: $catalogPathRef) { + __typename + ... on Blob { + id + } + } url isArchived repositoryTopics(first: 100) { @@ -302,7 +315,7 @@ export async function getOrganizationRepositories( query, r => r.repositoryOwner?.repositories, x => x, - { org }, + { org, catalogPathRef }, ); return { repositories }; diff --git a/plugins/catalog-backend-module-github/src/providers/GitHubEntityProvider.test.ts b/plugins/catalog-backend-module-github/src/providers/GitHubEntityProvider.test.ts index 63fb77288b..8b315a8a1e 100644 --- a/plugins/catalog-backend-module-github/src/providers/GitHubEntityProvider.test.ts +++ b/plugins/catalog-backend-module-github/src/providers/GitHubEntityProvider.test.ts @@ -170,6 +170,11 @@ describe('GitHubEntityProvider', () => { defaultBranchRef: { name: 'main', }, + catalogInfoFile: { + __typename: 'Blob', + id: 'abc123', + text: 'some yaml', + }, }, ], }), @@ -267,6 +272,11 @@ describe('GitHubEntityProvider', () => { defaultBranchRef: { name: 'main', }, + catalogInfoFile: { + __typename: 'Blob', + id: 'abc123', + text: 'some yaml', + }, }, ], }), @@ -341,6 +351,11 @@ describe('GitHubEntityProvider', () => { defaultBranchRef: { name: 'main', }, + catalogInfoFile: { + __typename: 'Blob', + id: 'abc123', + text: 'some yaml', + }, }, ], }), @@ -381,6 +396,110 @@ describe('GitHubEntityProvider', () => { entities: expectedEntities, }); }); + + it('should filter out invalid locations when validateLocationsExist is set to true', async () => { + const config = new ConfigReader({ + catalog: { + providers: { + github: { + myProvider: { + organization: 'test-org', + catalogPath: 'catalog-custom.yaml', + filters: { + branch: 'main', + }, + validateLocationsExist: true, + }, + }, + }, + }, + }); + const schedule = new PersistingTaskRunner(); + const entityProviderConnection: EntityProviderConnection = { + applyMutation: jest.fn(), + refresh: jest.fn(), + }; + + const provider = GitHubEntityProvider.fromConfig(config, { + logger, + schedule, + })[0]; + + const mockGetOrganizationRepositories = jest.spyOn( + helpers, + 'getOrganizationRepositories', + ); + + mockGetOrganizationRepositories.mockReturnValue( + Promise.resolve({ + repositories: [ + { + name: 'test-repo', + url: 'https://github.com/test-org/test-repo', + repositoryTopics: { + nodes: [], + }, + isArchived: false, + defaultBranchRef: { + name: 'main', + }, + catalogInfoFile: null, + }, + { + name: 'another-repo', + url: 'https://github.com/test-org/another-repo', + repositoryTopics: { + nodes: [], + }, + isArchived: false, + defaultBranchRef: { + name: 'main', + }, + catalogInfoFile: { + __typename: 'Blob', + id: 'abc123', + text: 'some yaml', + }, + }, + ], + }), + ); + + await provider.connect(entityProviderConnection); + + const taskDef = schedule.getTasks()[0]; + expect(taskDef.id).toEqual('github-provider:myProvider:refresh'); + await (taskDef.fn as () => Promise)(); + + const url = `https://github.com/test-org/another-repo/blob/main/catalog-custom.yaml`; + const expectedEntities = [ + { + entity: { + apiVersion: 'backstage.io/v1alpha1', + kind: 'Location', + metadata: { + annotations: { + 'backstage.io/managed-by-location': `url:${url}`, + 'backstage.io/managed-by-origin-location': `url:${url}`, + }, + name: 'generated-934f500db2ba2e8ea3524567926f45a73bb0b532', + }, + spec: { + presence: 'optional', + target: `${url}`, + type: 'url', + }, + }, + locationKey: 'github-provider:myProvider', + }, + ]; + + expect(entityProviderConnection.applyMutation).toHaveBeenCalledTimes(1); + expect(entityProviderConnection.applyMutation).toHaveBeenCalledWith({ + type: 'full', + entities: expectedEntities, + }); + }); }); it('apply full update on scheduled execution with topic exclusion taking priority over topic inclusion', async () => { @@ -437,6 +556,11 @@ it('apply full update on scheduled execution with topic exclusion taking priorit defaultBranchRef: { name: 'main', }, + catalogInfoFile: { + __typename: 'Blob', + id: 'abc123', + text: 'some yaml', + }, }, { name: 'test-repo-2', @@ -455,6 +579,11 @@ it('apply full update on scheduled execution with topic exclusion taking priorit defaultBranchRef: { name: 'main', }, + catalogInfoFile: { + __typename: 'Blob', + id: 'abc123', + text: 'some yaml', + }, }, { name: 'test-repo-3', @@ -470,6 +599,11 @@ it('apply full update on scheduled execution with topic exclusion taking priorit defaultBranchRef: { name: 'main', }, + catalogInfoFile: { + __typename: 'Blob', + id: 'abc123', + text: 'some yaml', + }, }, ], }), diff --git a/plugins/catalog-backend-module-github/src/providers/GitHubEntityProvider.ts b/plugins/catalog-backend-module-github/src/providers/GitHubEntityProvider.ts index 3909b5a3c2..42dd6afa5d 100644 --- a/plugins/catalog-backend-module-github/src/providers/GitHubEntityProvider.ts +++ b/plugins/catalog-backend-module-github/src/providers/GitHubEntityProvider.ts @@ -163,6 +163,7 @@ export class GitHubEntityProvider implements EntityProvider { private async findCatalogFiles(): Promise { const organization = this.config.organization; const host = this.integration.host; + const catalogPath = this.config.catalogPath; const orgUrl = `https://${host}/${organization}`; const { headers } = await this.githubCredentialsProvider.getCredentials({ @@ -177,8 +178,18 @@ export class GitHubEntityProvider implements EntityProvider { const { repositories } = await getOrganizationRepositories( client, organization, + catalogPath, ); + if (this.config.validateLocationsExist) { + return repositories.filter(repository => { + return ( + repository.catalogInfoFile?.__typename === 'Blob' && + repository.catalogInfoFile.text !== '' + ); + }); + } + return repositories; } From abab3ce38de8f4f2ed3ff09709a87c7b43a9a17a Mon Sep 17 00:00:00 2001 From: Nikolas Skoufis Date: Mon, 10 Oct 2022 17:23:00 +1100 Subject: [PATCH 03/19] Add docs for the new validateLocationsExist option Signed-off-by: Nikolas Skoufis --- docs/integrations/github/discovery.md | 16 +++++++++++++++- .../processors/GithubDiscoveryProcessor.test.ts | 13 +++++++++++++ .../src/processors/GithubDiscoveryProcessor.ts | 6 +++++- 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/docs/integrations/github/discovery.md b/docs/integrations/github/discovery.md index 9b60b41682..49ee712c6e 100644 --- a/docs/integrations/github/discovery.md +++ b/docs/integrations/github/discovery.md @@ -96,6 +96,13 @@ catalog: topic: include: ['backstage-include'] # optional array of strings exclude: ['experiments'] # optional array of strings + validateLocationsExist: + organization: 'backstage' # string + catalogPath: '/catalog-info.yaml' # string + filters: + branch: 'main' # string + repository: '.*' # Regex + validateLocationsExist: true # optional boolean enterpriseProviderId: host: ghe.example.net organization: 'backstage' # string @@ -110,7 +117,8 @@ This provider supports multiple organizations via unique provider IDs. - **`catalogPath`** _(optional)_: Default: `/catalog-info.yaml`. Path where to look for `catalog-info.yaml` files. - You can use wildcards - `*` or `**` - to search the path and/or the filename + You can use wildcards - `*` or `**` - to search the path and/or the filename. + Wildcards cannot be used if the `validateLocationsExist` option is set to `true`. - **filters** _(optional)_: - **branch** _(optional)_: String used to filter results based on the branch name. @@ -131,6 +139,12 @@ This provider supports multiple organizations via unique provider IDs. If you want to add multiple organizations, you need to add one provider config each. - **host** _(optional)_: The hostname of your GitHub Enterprise instance. It must match a host defined in [integrations.github](locations.md). +- **validateLocationsExist** _(optional)_: + Whether to validate locations that exist before emitting them. + This option avoids generating locations for catalog info files that do not exist in the source repository. + Defaults to `false`. + Due to limitations in the GitHub API's ability to query for repository objects, this option cannot be used in + conjunction with wildcards in the `catalogPath`. ## GitHub API Rate Limits diff --git a/plugins/catalog-backend-module-github/src/processors/GithubDiscoveryProcessor.test.ts b/plugins/catalog-backend-module-github/src/processors/GithubDiscoveryProcessor.test.ts index c915e8b136..b69728cc62 100644 --- a/plugins/catalog-backend-module-github/src/processors/GithubDiscoveryProcessor.test.ts +++ b/plugins/catalog-backend-module-github/src/processors/GithubDiscoveryProcessor.test.ts @@ -153,6 +153,7 @@ describe('GithubDiscoveryProcessor', () => { defaultBranchRef: { name: 'master', }, + catalogInfoFile: null, }, { name: 'demo', @@ -162,6 +163,7 @@ describe('GithubDiscoveryProcessor', () => { defaultBranchRef: { name: 'main', }, + catalogInfoFile: null, }, ], }); @@ -203,6 +205,7 @@ describe('GithubDiscoveryProcessor', () => { defaultBranchRef: { name: 'main', }, + catalogInfoFile: null, }, ], }); @@ -234,6 +237,7 @@ describe('GithubDiscoveryProcessor', () => { repositoryTopics: { nodes: [] }, isArchived: false, defaultBranchRef: null, + catalogInfoFile: null, }, ], }); @@ -259,6 +263,7 @@ describe('GithubDiscoveryProcessor', () => { defaultBranchRef: { name: 'master', }, + catalogInfoFile: null, }, ], }); @@ -293,6 +298,7 @@ describe('GithubDiscoveryProcessor', () => { defaultBranchRef: { name: 'main', }, + catalogInfoFile: null, }, { name: 'techdocs-cli', @@ -302,6 +308,7 @@ describe('GithubDiscoveryProcessor', () => { defaultBranchRef: { name: 'main', }, + catalogInfoFile: null, }, { name: 'techdocs-container', @@ -311,6 +318,7 @@ describe('GithubDiscoveryProcessor', () => { defaultBranchRef: { name: 'main', }, + catalogInfoFile: null, }, { name: 'techdocs-durp', @@ -318,6 +326,7 @@ describe('GithubDiscoveryProcessor', () => { repositoryTopics: { nodes: [] }, isArchived: false, defaultBranchRef: null, + catalogInfoFile: null, }, ], }); @@ -360,6 +369,7 @@ describe('GithubDiscoveryProcessor', () => { defaultBranchRef: { name: 'main', }, + catalogInfoFile: null, }, { name: 'test', @@ -369,6 +379,7 @@ describe('GithubDiscoveryProcessor', () => { defaultBranchRef: { name: 'main', }, + catalogInfoFile: null, }, { name: 'test-archived', @@ -378,6 +389,7 @@ describe('GithubDiscoveryProcessor', () => { defaultBranchRef: { name: 'main', }, + catalogInfoFile: null, }, { name: 'testxyz', @@ -387,6 +399,7 @@ describe('GithubDiscoveryProcessor', () => { defaultBranchRef: { name: 'main', }, + catalogInfoFile: null, }, ], }); diff --git a/plugins/catalog-backend-module-github/src/processors/GithubDiscoveryProcessor.ts b/plugins/catalog-backend-module-github/src/processors/GithubDiscoveryProcessor.ts index 97c77bf033..593f5f72f1 100644 --- a/plugins/catalog-backend-module-github/src/processors/GithubDiscoveryProcessor.ts +++ b/plugins/catalog-backend-module-github/src/processors/GithubDiscoveryProcessor.ts @@ -121,7 +121,11 @@ export class GithubDiscoveryProcessor implements CatalogProcessor { const startTimestamp = Date.now(); this.logger.info(`Reading GitHub repositories from ${location.target}`); - const { repositories } = await getOrganizationRepositories(client, org); + const { repositories } = await getOrganizationRepositories( + client, + org, + catalogPath, + ); const matching = repositories.filter( r => !r.isArchived && repoSearchPath.test(r.name), ); From f64d66a45c2ffa9c29b4e161aecc6cc9c6a81c81 Mon Sep 17 00:00:00 2001 From: Nikolas Skoufis Date: Mon, 10 Oct 2022 17:32:39 +1100 Subject: [PATCH 04/19] Add a changeset for my changes Signed-off-by: Nikolas Skoufis --- .changeset/three-poems-think.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .changeset/three-poems-think.md diff --git a/.changeset/three-poems-think.md b/.changeset/three-poems-think.md new file mode 100644 index 0000000000..13fc9cd328 --- /dev/null +++ b/.changeset/three-poems-think.md @@ -0,0 +1,14 @@ +--- +'@backstage/plugin-catalog-backend-module-github': minor +--- + +Added the ability for the GitHub discovery processor to validate that catalog files exist before emitting them. + +Users can now set the `validateLocationsExist` property to `true` in their GitHub discovery configuration to opt in to this feature. +This feature only works with `catalogPath`s that do not contain wildcards. + +When `validateLocationsExist` is set to `true`, the GitHub discovery processor will retrieve the object from the +repository at the provided `catalogPath`. +If this file exists and is non-empty, then it will be emitted as a location for further processing. +If this file does not exist or is empty, then it will not be emitted. +Not emitting locations that do not exist allows for far fewer calls to the GitHub API to validate locations that do not exist. From f9f2bcaa121d84bf02b7357480b86e3fcd1ac58d Mon Sep 17 00:00:00 2001 From: Nikolas Skoufis Date: Mon, 10 Oct 2022 18:00:13 +1100 Subject: [PATCH 05/19] Fix referring to the processor when I meant provider Signed-off-by: Nikolas Skoufis --- .changeset/three-poems-think.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.changeset/three-poems-think.md b/.changeset/three-poems-think.md index 13fc9cd328..aad3cae117 100644 --- a/.changeset/three-poems-think.md +++ b/.changeset/three-poems-think.md @@ -2,12 +2,12 @@ '@backstage/plugin-catalog-backend-module-github': minor --- -Added the ability for the GitHub discovery processor to validate that catalog files exist before emitting them. +Added the ability for the GitHub discovery provider to validate that catalog files exist before emitting them. Users can now set the `validateLocationsExist` property to `true` in their GitHub discovery configuration to opt in to this feature. This feature only works with `catalogPath`s that do not contain wildcards. -When `validateLocationsExist` is set to `true`, the GitHub discovery processor will retrieve the object from the +When `validateLocationsExist` is set to `true`, the GitHub discovery provider will retrieve the object from the repository at the provided `catalogPath`. If this file exists and is non-empty, then it will be emitted as a location for further processing. If this file does not exist or is empty, then it will not be emitted. From 0f0bbd70fe5898e9453ee8080ee6faca4598ae3e Mon Sep 17 00:00:00 2001 From: Nikolas Skoufis Date: Mon, 10 Oct 2022 18:19:05 +1100 Subject: [PATCH 06/19] Add back text field to query Signed-off-by: Nikolas Skoufis --- plugins/catalog-backend-module-github/src/lib/github.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/catalog-backend-module-github/src/lib/github.ts b/plugins/catalog-backend-module-github/src/lib/github.ts index d854cc9043..7fc69d0f86 100644 --- a/plugins/catalog-backend-module-github/src/lib/github.ts +++ b/plugins/catalog-backend-module-github/src/lib/github.ts @@ -285,6 +285,7 @@ export async function getOrganizationRepositories( __typename ... on Blob { id + text } } url From 4a5fd284ee536ecde94967f24596b99a0b965945 Mon Sep 17 00:00:00 2001 From: Nikolas Skoufis Date: Mon, 10 Oct 2022 18:31:00 +1100 Subject: [PATCH 07/19] Strip leading slash if present in catalog path ref Without this, the graphql query fails to return matching catalog paths Signed-off-by: Nikolas Skoufis --- plugins/catalog-backend-module-github/src/lib/github.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/catalog-backend-module-github/src/lib/github.ts b/plugins/catalog-backend-module-github/src/lib/github.ts index 7fc69d0f86..ef6a7f817a 100644 --- a/plugins/catalog-backend-module-github/src/lib/github.ts +++ b/plugins/catalog-backend-module-github/src/lib/github.ts @@ -273,7 +273,14 @@ export async function getOrganizationRepositories( org: string, catalogPath: string, ): Promise<{ repositories: Repository[] }> { - const catalogPathRef = `HEAD:${catalogPath}`; + let relativeCatalogPathRef: string; + // We must strip the leading slash or the query for objects does not work + if (catalogPath.startsWith('/')) { + relativeCatalogPathRef = catalogPath.substring(1); + } else { + relativeCatalogPathRef = catalogPath; + } + const catalogPathRef = `HEAD:${relativeCatalogPathRef}`; const query = ` query repositories($org: String!, $catalogPathRef: String!, $cursor: String) { repositoryOwner(login: $org) { From 334dd9042c47a66442c044e2d4184eb45cce1520 Mon Sep 17 00:00:00 2001 From: Nikolas Skoufis Date: Mon, 10 Oct 2022 18:33:50 +1100 Subject: [PATCH 08/19] Fix linting issue in docs Signed-off-by: Nikolas Skoufis --- docs/integrations/github/discovery.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/integrations/github/discovery.md b/docs/integrations/github/discovery.md index 49ee712c6e..742f40f8af 100644 --- a/docs/integrations/github/discovery.md +++ b/docs/integrations/github/discovery.md @@ -143,7 +143,7 @@ This provider supports multiple organizations via unique provider IDs. Whether to validate locations that exist before emitting them. This option avoids generating locations for catalog info files that do not exist in the source repository. Defaults to `false`. - Due to limitations in the GitHub API's ability to query for repository objects, this option cannot be used in + Due to limitations in the GitHub API's ability to query for repository objects, this option cannot be used in conjunction with wildcards in the `catalogPath`. ## GitHub API Rate Limits From e2d088426bddfdd1b733f80f068631583e1a69a3 Mon Sep 17 00:00:00 2001 From: Nikolas Skoufis Date: Thu, 20 Oct 2022 11:13:07 +1100 Subject: [PATCH 09/19] Fix failing tests from merge Signed-off-by: Nikolas Skoufis --- .../providers/GithubEntityProvider.test.ts | 126 +++++++++--------- .../GithubEntityProviderConfig.test.ts | 1 + 2 files changed, 64 insertions(+), 63 deletions(-) diff --git a/plugins/catalog-backend-module-github/src/providers/GithubEntityProvider.test.ts b/plugins/catalog-backend-module-github/src/providers/GithubEntityProvider.test.ts index 3dfea8ed67..cc9a9bfee3 100644 --- a/plugins/catalog-backend-module-github/src/providers/GithubEntityProvider.test.ts +++ b/plugins/catalog-backend-module-github/src/providers/GithubEntityProvider.test.ts @@ -424,7 +424,7 @@ describe('GithubEntityProvider', () => { refresh: jest.fn(), }; - const provider = GitHubEntityProvider.fromConfig(config, { + const provider = GithubEntityProvider.fromConfig(config, { logger, schedule, })[0]; @@ -542,70 +542,70 @@ describe('GithubEntityProvider', () => { 'getOrganizationRepositories', ); - mockGetOrganizationRepositories.mockReturnValue( - Promise.resolve({ - repositories: [ - { - name: 'test-repo', - url: 'https://github.com/test-org/test-repo', - repositoryTopics: { - nodes: [ - { - topic: { name: 'backstage-include' }, - }, - ], + mockGetOrganizationRepositories.mockReturnValue( + Promise.resolve({ + repositories: [ + { + name: 'test-repo', + url: 'https://github.com/test-org/test-repo', + repositoryTopics: { + nodes: [ + { + topic: { name: 'backstage-include' }, + }, + ], + }, + isArchived: false, + defaultBranchRef: { + name: 'main', + }, + catalogInfoFile: { + __typename: 'Blob', + id: 'abc123', + text: 'some yaml', + }, }, - isArchived: false, - defaultBranchRef: { - name: 'main', + { + name: 'test-repo-2', + url: 'https://github.com/test-org/test-repo-2', + repositoryTopics: { + nodes: [ + { + topic: { name: 'backstage-include' }, + }, + { + topic: { name: 'backstage-exclude' }, + }, + ], + }, + isArchived: false, + defaultBranchRef: { + name: 'main', + }, + catalogInfoFile: { + __typename: 'Blob', + id: 'abc123', + text: 'some yaml', + }, }, - catalogInfoFile: { - __typename: 'Blob', - id: 'abc123', - text: 'some yaml', - }, - }, - { - name: 'test-repo-2', - url: 'https://github.com/test-org/test-repo-2', - repositoryTopics: { - nodes: [ - { - topic: { name: 'backstage-include' }, - }, - { - topic: { name: 'backstage-exclude' }, - }, - ], - }, - isArchived: false, - defaultBranchRef: { - name: 'main', - }, - catalogInfoFile: { - __typename: 'Blob', - id: 'abc123', - text: 'some yaml', - }, - }, - { - name: 'test-repo-3', - url: 'https://github.com/test-org/test-repo-3', - repositoryTopics: { - nodes: [ - { - topic: { name: 'backstage-exclude' }, - }, - ], - }, - isArchived: false, - defaultBranchRef: { - name: 'main', - }, - catalogInfoFile: { - __typename: 'Blob', - id: 'abc123', - text: 'some yaml', + { + name: 'test-repo-3', + url: 'https://github.com/test-org/test-repo-3', + repositoryTopics: { + nodes: [ + { + topic: { name: 'backstage-exclude' }, + }, + ], + }, + isArchived: false, + defaultBranchRef: { + name: 'main', + }, + catalogInfoFile: { + __typename: 'Blob', + id: 'abc123', + text: 'some yaml', }, }, ], diff --git a/plugins/catalog-backend-module-github/src/providers/GithubEntityProviderConfig.test.ts b/plugins/catalog-backend-module-github/src/providers/GithubEntityProviderConfig.test.ts index 8ca9e76aca..0d9b5ce65b 100644 --- a/plugins/catalog-backend-module-github/src/providers/GithubEntityProviderConfig.test.ts +++ b/plugins/catalog-backend-module-github/src/providers/GithubEntityProviderConfig.test.ts @@ -191,6 +191,7 @@ describe('readProviderConfigs', () => { exclude: undefined, }, }, + validateLocationsExist: false, schedule: undefined, }); expect(providerConfigs[6]).toEqual({ From 0b5ed3f68d4e6c8a20fb3d3d663555de7d7ca673 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 20 Oct 2022 10:58:23 +0000 Subject: [PATCH 10/19] Update dependency cypress to v10.10.0 Signed-off-by: Renovate Bot --- cypress/yarn.lock | 6 +++--- yarn.lock | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cypress/yarn.lock b/cypress/yarn.lock index d55c96a984..3b1358156e 100644 --- a/cypress/yarn.lock +++ b/cypress/yarn.lock @@ -414,8 +414,8 @@ __metadata: linkType: hard "cypress@npm:^10.0.0": - version: 10.8.0 - resolution: "cypress@npm:10.8.0" + version: 10.10.0 + resolution: "cypress@npm:10.10.0" dependencies: "@cypress/request": ^2.88.10 "@cypress/xvfb": ^1.2.4 @@ -461,7 +461,7 @@ __metadata: yauzl: ^2.10.0 bin: cypress: bin/cypress - checksum: c052690049980e7721e6fca563b724fde839d87d83c1478dfe26ce7d230992717c2c4028e7157bfb39ec274473e51929f49e5aab6a23c2b25cde2a439b1c3cf9 + checksum: 668a32534a527dba79754abbf98af176b80c539a12ec00058932ba2a19c794c7888323e59e738c30f726ad740c5451c31d02548a0cb7c1b1c8ad01c55a984ca2 languageName: node linkType: hard diff --git a/yarn.lock b/yarn.lock index 06c2864ecf..df8a47b2e8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -19399,8 +19399,8 @@ __metadata: linkType: hard "cypress@npm:^10.0.0": - version: 10.8.0 - resolution: "cypress@npm:10.8.0" + version: 10.10.0 + resolution: "cypress@npm:10.10.0" dependencies: "@cypress/request": ^2.88.10 "@cypress/xvfb": ^1.2.4 @@ -19446,7 +19446,7 @@ __metadata: yauzl: ^2.10.0 bin: cypress: bin/cypress - checksum: c052690049980e7721e6fca563b724fde839d87d83c1478dfe26ce7d230992717c2c4028e7157bfb39ec274473e51929f49e5aab6a23c2b25cde2a439b1c3cf9 + checksum: 668a32534a527dba79754abbf98af176b80c539a12ec00058932ba2a19c794c7888323e59e738c30f726ad740c5451c31d02548a0cb7c1b1c8ad01c55a984ca2 languageName: node linkType: hard From 43afded227a72bf0cb6fbd0dcb54b22f4797d04d Mon Sep 17 00:00:00 2001 From: Leonardo Maier Date: Sat, 3 Sep 2022 11:28:24 -0300 Subject: [PATCH 11/19] Update recharts dependency to v2.0.0 and fix breaking changes Signed-off-by: Leonardo Maier Signed-off-by: Leonardo Maier --- .changeset/short-balloons-work.md | 9 + plugins/bitrise/package.json | 2 +- plugins/code-coverage/package.json | 2 +- plugins/cost-insights/api-report.md | 19 +- plugins/cost-insights/package.json | 2 +- .../src/components/BarChart/BarChart.tsx | 21 +- .../BarChart/BarChartTooltipItem.tsx | 4 +- .../CostOverviewBreakdownChart.tsx | 17 +- .../CostOverviewCard.test.tsx | 16 + .../CostOverviewCard/CostOverviewChart.tsx | 16 +- .../ProductInsightsChart.tsx | 14 +- plugins/cost-insights/src/types/Tooltip.ts | 23 ++ plugins/cost-insights/src/types/index.ts | 1 + plugins/cost-insights/src/utils/graphs.ts | 17 +- plugins/git-release-manager/package.json | 2 +- plugins/xcmetrics/package.json | 2 +- .../BuildTimeline/BuildTimeline.test.tsx | 18 + yarn.lock | 307 ++++++++---------- 18 files changed, 249 insertions(+), 243 deletions(-) create mode 100644 .changeset/short-balloons-work.md create mode 100644 plugins/cost-insights/src/types/Tooltip.ts diff --git a/.changeset/short-balloons-work.md b/.changeset/short-balloons-work.md new file mode 100644 index 0000000000..5d0f66851d --- /dev/null +++ b/.changeset/short-balloons-work.md @@ -0,0 +1,9 @@ +--- +'@backstage/plugin-bitrise': patch +'@backstage/plugin-code-coverage': patch +'@backstage/plugin-cost-insights': minor +'@backstage/plugin-git-release-manager': patch +'@backstage/plugin-xcmetrics': patch +--- + +Updated recharts to v2.0.0 and fixed typing issues diff --git a/plugins/bitrise/package.json b/plugins/bitrise/package.json index 4240262c07..21dc188246 100644 --- a/plugins/bitrise/package.json +++ b/plugins/bitrise/package.json @@ -36,7 +36,7 @@ "luxon": "^3.0.0", "qs": "^6.9.6", "react-use": "^17.2.4", - "recharts": "^1.8.5" + "recharts": "^2.0.0" }, "peerDependencies": { "react": "^16.13.1 || ^17.0.0" diff --git a/plugins/code-coverage/package.json b/plugins/code-coverage/package.json index f8507e60a4..d9e68a5f62 100644 --- a/plugins/code-coverage/package.json +++ b/plugins/code-coverage/package.json @@ -37,7 +37,7 @@ "highlight.js": "^10.6.0", "luxon": "^3.0.0", "react-use": "^17.2.4", - "recharts": "^1.8.5" + "recharts": "^2.0.0" }, "peerDependencies": { "react": "^16.13.1 || ^17.0.0", diff --git a/plugins/cost-insights/api-report.md b/plugins/cost-insights/api-report.md index f4c8c9bd6f..f50f0b0c81 100644 --- a/plugins/cost-insights/api-report.md +++ b/plugins/cost-insights/api-report.md @@ -11,14 +11,12 @@ import { BackstagePlugin } from '@backstage/core-plugin-api'; import { BackstageTheme } from '@backstage/theme'; import { ChangeStatistic as ChangeStatistic_2 } from '@backstage/plugin-cost-insights-common'; import * as common from '@backstage/plugin-cost-insights-common'; -import { ContentRenderer } from 'recharts'; import { Dispatch } from 'react'; import { ForwardRefExoticComponent } from 'react'; import { Maybe as Maybe_2 } from '@backstage/plugin-cost-insights-common'; import { PaletteOptions } from '@material-ui/core/styles/createPalette'; import { PropsWithChildren } from 'react'; import { ReactNode } from 'react'; -import { RechartsFunction } from 'recharts'; import { RefAttributes } from 'react'; import { RouteRef } from '@backstage/core-plugin-api'; import { SetStateAction } from 'react'; @@ -178,10 +176,10 @@ export type BarChartProps = { resources: ResourceData[]; responsive?: boolean; displayAmount?: number; - options?: Partial; - tooltip?: ContentRenderer; - onClick?: RechartsFunction; - onMouseMove?: RechartsFunction; + options?: Partial; + tooltip?: TooltipRenderer; + onClick?: (...args: any[]) => void; + onMouseMove?: (...args: any[]) => void; }; // @public (undocumented) @@ -586,10 +584,15 @@ export interface ResourceData { // @public (undocumented) export type TooltipItem = { fill: string; - label: string; - value: string; + label?: string; + value?: string; }; +// @public (undocumented) +export type TooltipRenderer = ( + props: TooltipProps, +) => ReactNode; + // @public @deprecated (undocumented) export type Trendline = common.Trendline; diff --git a/plugins/cost-insights/package.json b/plugins/cost-insights/package.json index e325f75e0a..a1ec810a64 100644 --- a/plugins/cost-insights/package.json +++ b/plugins/cost-insights/package.json @@ -49,7 +49,7 @@ "pluralize": "^8.0.0", "qs": "^6.9.4", "react-use": "^17.2.4", - "recharts": "^1.8.5", + "recharts": "^2.0.0", "regression": "^2.0.1", "yup": "^0.32.9" }, diff --git a/plugins/cost-insights/src/components/BarChart/BarChart.tsx b/plugins/cost-insights/src/components/BarChart/BarChart.tsx index 145819db08..4f4dea8ddd 100644 --- a/plugins/cost-insights/src/components/BarChart/BarChart.tsx +++ b/plugins/cost-insights/src/components/BarChart/BarChart.tsx @@ -19,11 +19,8 @@ import { Bar, BarChart as RechartsBarChart, CartesianGrid, - ContentRenderer, - TooltipProps as RechartsTooltipProps, - RechartsFunction, - ResponsiveContainer, Tooltip as RechartsTooltip, + ResponsiveContainer, XAxis, YAxis, } from 'recharts'; @@ -34,20 +31,18 @@ import { BarChartTooltip } from './BarChartTooltip'; import { BarChartTooltipItem } from './BarChartTooltipItem'; import { currencyFormatter } from '../../utils/formatters'; import { - BarChartData, ResourceData, DataKey, CostInsightsTheme, + BarChartOptions, } from '../../types'; import { notEmpty } from '../../utils/assert'; import { useBarChartStyles } from '../../utils/styles'; import { resourceSort } from '../../utils/sort'; import { isInvalid, titleOf, tooltipItemOf } from '../../utils/graphs'; +import { TooltipRenderer } from '../../types/Tooltip'; -export const defaultTooltip: ContentRenderer = ({ - label, - payload = [], -}) => { +export const defaultTooltip: TooltipRenderer = ({ label, payload = [] }) => { if (isInvalid({ label, payload })) return null; const title = titleOf(label); @@ -66,10 +61,10 @@ export type BarChartProps = { resources: ResourceData[]; responsive?: boolean; displayAmount?: number; - options?: Partial; - tooltip?: ContentRenderer; - onClick?: RechartsFunction; - onMouseMove?: RechartsFunction; + options?: Partial; + tooltip?: TooltipRenderer; + onClick?: (...args: any[]) => void; + onMouseMove?: (...args: any[]) => void; }; /** @public */ diff --git a/plugins/cost-insights/src/components/BarChart/BarChartTooltipItem.tsx b/plugins/cost-insights/src/components/BarChart/BarChartTooltipItem.tsx index fc50ab979a..123720cbc0 100644 --- a/plugins/cost-insights/src/components/BarChart/BarChartTooltipItem.tsx +++ b/plugins/cost-insights/src/components/BarChart/BarChartTooltipItem.tsx @@ -22,8 +22,8 @@ import { useTooltipStyles as useStyles } from '../../utils/styles'; /** @public */ export type TooltipItem = { fill: string; - label: string; - value: string; + label?: string; + value?: string; }; /** @public */ diff --git a/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewBreakdownChart.tsx b/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewBreakdownChart.tsx index 5b912c09a6..f6463b65ed 100644 --- a/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewBreakdownChart.tsx +++ b/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewBreakdownChart.tsx @@ -25,8 +25,6 @@ import { import { default as FullScreenIcon } from '@material-ui/icons/Fullscreen'; import { AreaChart, - ContentRenderer, - TooltipProps, XAxis, YAxis, Tooltip as RechartsTooltip, @@ -52,6 +50,7 @@ import { getPreviousPeriodTotalCost } from '../../utils/change'; import { formatPeriod } from '../../utils/formatters'; import { aggregationSum } from '../../utils/sum'; import { BarChartLegendOptions } from '../BarChart/BarChartLegend'; +import { TooltipRenderer } from '../../types/Tooltip'; export type CostOverviewBreakdownChartProps = { costBreakdown: Cost[]; @@ -168,17 +167,15 @@ export const CostOverviewBreakdownChart = ({ fill={color} onClick={() => setExpanded(true)} style={{ - cursor: breakdown === 'Other' && !isExpanded ? 'pointer' : null, + cursor: + breakdown === 'Other' && !isExpanded ? 'pointer' : undefined, }} /> ); }); }; - const tooltipRenderer: ContentRenderer = ({ - label, - payload = [], - }) => { + const tooltipRenderer: TooltipRenderer = ({ label, payload = [] }) => { if (isInvalid({ label, payload })) return null; const date = @@ -186,10 +183,10 @@ export const CostOverviewBreakdownChart = ({ ? DateTime.fromMillis(label) : DateTime.fromISO(label!); const dateTitle = date.toUTC().toFormat(DEFAULT_DATE_FORMAT); - const items = payload.map(p => ({ + const items = payload.map((p, i) => ({ label: p.dataKey as string, - value: formatGraphValue(p.value as number), - fill: p.fill!, + value: formatGraphValue(Number(p.value), i), + fill: p.color!, })); const expandText = ( diff --git a/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewCard.test.tsx b/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewCard.test.tsx index 084c9bb92f..e3de9593d9 100644 --- a/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewCard.test.tsx +++ b/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewCard.test.tsx @@ -53,6 +53,22 @@ function renderInContext(children: JSX.Element) { } describe('', () => { + beforeEach(() => { + // @ts-expect-error: Since we have strictNullChecks enabled, this will throw an error as window.ResizeObserver + // it's not an optional operand + delete window.ResizeObserver; + window.ResizeObserver = jest.fn().mockImplementation(() => ({ + observe: jest.fn(), + unobserve: jest.fn(), + disconnect: jest.fn(), + })); + }); + + afterEach(() => { + window.ResizeObserver = ResizeObserver; + jest.restoreAllMocks(); + }); + it('Renders without exploding', async () => { const { getByText } = await renderInContext( , diff --git a/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewChart.tsx b/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewChart.tsx index e7b478ba07..1c58bf58e6 100644 --- a/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewChart.tsx +++ b/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewChart.tsx @@ -18,8 +18,6 @@ import { DateTime } from 'luxon'; import { useTheme, Box } from '@material-ui/core'; import { ComposedChart, - ContentRenderer, - TooltipProps, XAxis, YAxis, Tooltip as RechartsTooltip, @@ -50,6 +48,7 @@ import { useCostOverviewStyles as useStyles } from '../../utils/styles'; import { groupByDate, toDataMax, trendFrom } from '../../utils/charts'; import { aggregationSort } from '../../utils/sort'; import { CostOverviewLegend } from './CostOverviewLegend'; +import { TooltipRenderer } from '../../types/Tooltip'; type CostOverviewChartProps = { metric: Maybe; @@ -98,10 +97,7 @@ export const CostOverviewChart = ({ : {}), })); - const tooltipRenderer: ContentRenderer = ({ - label, - payload = [], - }) => { + const tooltipRenderer: TooltipRenderer = ({ label, payload = [] }) => { if (isInvalid({ label, payload })) return null; const dataKeys = [data.dailyCost.dataKey, data.metric.dataKey]; @@ -112,15 +108,15 @@ export const CostOverviewChart = ({ const title = date.toUTC().toFormat(DEFAULT_DATE_FORMAT); const items = payload .filter(p => dataKeys.includes(p.dataKey as string)) - .map(p => ({ + .map((p, i) => ({ label: p.dataKey === data.dailyCost.dataKey ? data.dailyCost.name : data.metric.name, value: p.dataKey === data.dailyCost.dataKey - ? formatGraphValue(p.value as number, data.dailyCost.format) - : formatGraphValue(p.value as number, data.metric.format), + ? formatGraphValue(Number(p.value), i, data.dailyCost.format) + : formatGraphValue(Number(p.value), i, data.metric.format), fill: p.dataKey === data.dailyCost.dataKey ? theme.palette.blue @@ -186,7 +182,6 @@ export const CostOverviewChart = ({ dataKey="trend" dot={false} isAnimationActive={false} - label={false} strokeWidth={2} stroke={theme.palette.blue} yAxisId={data.dailyCost.dataKey} @@ -196,7 +191,6 @@ export const CostOverviewChart = ({ dataKey={data.metric.dataKey} dot={false} isAnimationActive={false} - label={false} strokeWidth={2} stroke={theme.palette.magenta} yAxisId={data.metric.dataKey} diff --git a/plugins/cost-insights/src/components/ProductInsightsCard/ProductInsightsChart.tsx b/plugins/cost-insights/src/components/ProductInsightsCard/ProductInsightsChart.tsx index d33f65bb83..b77b415e1e 100644 --- a/plugins/cost-insights/src/components/ProductInsightsCard/ProductInsightsChart.tsx +++ b/plugins/cost-insights/src/components/ProductInsightsCard/ProductInsightsChart.tsx @@ -15,11 +15,6 @@ */ import React, { useMemo, useState } from 'react'; -import { - ContentRenderer, - TooltipProps as RechartsTooltipProps, - RechartsFunction, -} from 'recharts'; import pluralize from 'pluralize'; import { Box, Typography } from '@material-ui/core'; import { default as FullScreenIcon } from '@material-ui/icons/Fullscreen'; @@ -55,6 +50,7 @@ import { } from '../../utils/styles'; import { Duration, Entity, Maybe } from '../../types'; import { choose } from '../../utils/change'; +import { TooltipRenderer } from '../../types/Tooltip'; export type ProductInsightsChartProps = { billingDate: string; @@ -96,7 +92,7 @@ export const ProductInsightsChart = ({ currentName: formatPeriod(duration, billingDate, true), }; - const onMouseMove: RechartsFunction = ( + const onMouseMove: (...args: any[]) => void = ( data: Record<'activeLabel', string | undefined>, ) => { if (isLabeled(data)) { @@ -108,7 +104,9 @@ export const ProductInsightsChart = ({ } }; - const onClick: RechartsFunction = (data: Record<'activeLabel', string>) => { + const onClick: (...args: any[]) => void = ( + data: Record<'activeLabel', string>, + ) => { if (isLabeled(data)) { setSelected(data.activeLabel); } else if (isUnlabeled(data)) { @@ -118,7 +116,7 @@ export const ProductInsightsChart = ({ } }; - const renderProductInsightsTooltip: ContentRenderer = ({ + const renderProductInsightsTooltip: TooltipRenderer = ({ label, payload = [], }) => { diff --git a/plugins/cost-insights/src/types/Tooltip.ts b/plugins/cost-insights/src/types/Tooltip.ts new file mode 100644 index 0000000000..d94803d2d8 --- /dev/null +++ b/plugins/cost-insights/src/types/Tooltip.ts @@ -0,0 +1,23 @@ +/* + * Copyright 2020 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ReactNode } from 'react'; +import { TooltipProps } from 'recharts'; + +/** @public */ +export type TooltipRenderer = ( + props: TooltipProps, +) => ReactNode; diff --git a/plugins/cost-insights/src/types/index.ts b/plugins/cost-insights/src/types/index.ts index 750114d3ec..a3a2ba0fae 100644 --- a/plugins/cost-insights/src/types/index.ts +++ b/plugins/cost-insights/src/types/index.ts @@ -27,6 +27,7 @@ export * from './Filters'; export * from './Icon'; export * from './Loading'; export * from './Theme'; +export * from './Tooltip'; /** * Deprecated types moved to `@backstage/plugin-cost-insights-common` diff --git a/plugins/cost-insights/src/utils/graphs.ts b/plugins/cost-insights/src/utils/graphs.ts index 31d8e6bc51..172f6cd7e3 100644 --- a/plugins/cost-insights/src/utils/graphs.ts +++ b/plugins/cost-insights/src/utils/graphs.ts @@ -14,7 +14,8 @@ * limitations under the License. */ -import { TooltipPayload, TooltipProps } from 'recharts'; +import { TooltipProps } from 'recharts'; +import { Payload } from 'recharts/types/component/DefaultTooltipContent'; import { AlertCost, DataKey, Entity, ResourceData } from '../types'; import { currencyFormatter, @@ -22,7 +23,11 @@ import { lengthyCurrencyFormatter, } from './formatters'; -export function formatGraphValue(value: number, format?: string) { +export function formatGraphValue( + value: number, + _index: number, + format?: string, +) { if (format === 'number') { return value.toLocaleString(); } @@ -37,12 +42,12 @@ export function formatGraphValue(value: number, format?: string) { export const overviewGraphTickFormatter = (millis: string | number) => typeof millis === 'number' ? dateFormatter.format(millis) : millis; -export const tooltipItemOf = (payload: TooltipPayload) => { +export const tooltipItemOf = (payload: Payload) => { const value = typeof payload.value === 'number' ? currencyFormatter.format(payload.value) - : (payload.value as string); - const fill = payload.fill as string; + : payload.value; + const fill = payload.color as string; switch (payload.dataKey) { case DataKey.Current: @@ -67,7 +72,7 @@ export const titleOf = (label?: string | number) => { return label ? String(label) : 'Unlabeled'; }; -export const isInvalid = ({ label, payload }: TooltipProps) => { +export const isInvalid = ({ label, payload }: TooltipProps) => { // null labels are empty strings, which are valid return label === undefined || !payload || !payload.length; }; diff --git a/plugins/git-release-manager/package.json b/plugins/git-release-manager/package.json index dee542a967..de4b23cac3 100644 --- a/plugins/git-release-manager/package.json +++ b/plugins/git-release-manager/package.json @@ -34,7 +34,7 @@ "luxon": "^3.0.0", "qs": "^6.10.1", "react-use": "^17.2.4", - "recharts": "^1.8.5" + "recharts": "^2.0.0" }, "peerDependencies": { "@types/react": "^16.13.1 || ^17.0.0", diff --git a/plugins/xcmetrics/package.json b/plugins/xcmetrics/package.json index c9082c9802..c890de6e86 100644 --- a/plugins/xcmetrics/package.json +++ b/plugins/xcmetrics/package.json @@ -33,7 +33,7 @@ "lodash": "^4.17.21", "luxon": "^3.0.0", "react-use": "^17.2.4", - "recharts": "^1.8.5" + "recharts": "^2.0.0" }, "peerDependencies": { "react": "^16.13.1 || ^17.0.0" diff --git a/plugins/xcmetrics/src/components/BuildTimeline/BuildTimeline.test.tsx b/plugins/xcmetrics/src/components/BuildTimeline/BuildTimeline.test.tsx index bb7e43a43c..29adbffd0a 100644 --- a/plugins/xcmetrics/src/components/BuildTimeline/BuildTimeline.test.tsx +++ b/plugins/xcmetrics/src/components/BuildTimeline/BuildTimeline.test.tsx @@ -21,6 +21,24 @@ jest.mock('../../api/XcmetricsClient'); const client = require('../../api/XcmetricsClient'); describe('BuildTimeline', () => { + const { ResizeObserver } = window; + + beforeEach(() => { + // @ts-expect-error: Since we have strictNullChecks enabled, this will throw an error as window.ResizeObserver + // it's not an optional operand + delete window.ResizeObserver; + window.ResizeObserver = jest.fn().mockImplementation(() => ({ + observe: jest.fn(), + unobserve: jest.fn(), + disconnect: jest.fn(), + })); + }); + + afterEach(() => { + window.ResizeObserver = ResizeObserver; + jest.restoreAllMocks(); + }); + it('should render', async () => { const rendered = await renderInTestApp( , diff --git a/yarn.lock b/yarn.lock index 06c2864ecf..e7d1c80a1d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4445,7 +4445,7 @@ __metadata: msw: ^0.47.0 qs: ^6.9.6 react-use: ^17.2.4 - recharts: ^1.8.5 + recharts: ^2.0.0 peerDependencies: react: ^16.13.1 || ^17.0.0 languageName: unknown @@ -5182,7 +5182,7 @@ __metadata: luxon: ^3.0.0 msw: ^0.47.0 react-use: ^17.2.4 - recharts: ^1.8.5 + recharts: ^2.0.0 peerDependencies: react: ^16.13.1 || ^17.0.0 react-router: 6.0.0-beta.0 || ^6.3.0 @@ -5294,7 +5294,7 @@ __metadata: pluralize: ^8.0.0 qs: ^6.9.4 react-use: ^17.2.4 - recharts: ^1.8.5 + recharts: ^2.0.0 regression: ^2.0.1 yup: ^0.32.9 peerDependencies: @@ -5532,7 +5532,7 @@ __metadata: msw: ^0.47.0 qs: ^6.10.1 react-use: ^17.2.4 - recharts: ^1.8.5 + recharts: ^2.0.0 peerDependencies: "@types/react": ^16.13.1 || ^17.0.0 react: ^16.13.1 || ^17.0.0 @@ -7626,7 +7626,7 @@ __metadata: luxon: ^3.0.0 msw: ^0.47.0 react-use: ^17.2.4 - recharts: ^1.8.5 + recharts: ^2.0.0 peerDependencies: react: ^16.13.1 || ^17.0.0 languageName: unknown @@ -13251,7 +13251,7 @@ __metadata: languageName: node linkType: hard -"@types/d3-interpolate@npm:*": +"@types/d3-interpolate@npm:*, @types/d3-interpolate@npm:^3.0.1": version: 3.0.1 resolution: "@types/d3-interpolate@npm:3.0.1" dependencies: @@ -13299,6 +13299,15 @@ __metadata: languageName: node linkType: hard +"@types/d3-scale@npm:^4.0.2": + version: 4.0.2 + resolution: "@types/d3-scale@npm:4.0.2" + dependencies: + "@types/d3-time": "*" + checksum: 6b3c0337f38f82b582d9f3190fde82edfce7ffafb371e5b2464c443137c2660bac644099d259f1f5cc829085eb5688bed0bea2b336a957d0845433bd07bf2ddd + languageName: node + linkType: hard + "@types/d3-selection@npm:*, @types/d3-selection@npm:^3.0.1": version: 3.0.3 resolution: "@types/d3-selection@npm:3.0.3" @@ -13324,7 +13333,7 @@ __metadata: languageName: node linkType: hard -"@types/d3-shape@npm:^3.0.1": +"@types/d3-shape@npm:^3.0.1, @types/d3-shape@npm:^3.1.0": version: 3.1.0 resolution: "@types/d3-shape@npm:3.1.0" dependencies: @@ -13333,6 +13342,13 @@ __metadata: languageName: node linkType: hard +"@types/d3-time@npm:*": + version: 3.0.0 + resolution: "@types/d3-time@npm:3.0.0" + checksum: e76adb056daccf80107f4db190ac6deb77e8774f00362bb6c76f178e67f2f217422fe502b654edbc9ac6451f6619045b9f6f5fe0db1ec5520e2ada377af7c72e + languageName: node + linkType: hard + "@types/d3-time@npm:^2": version: 2.1.1 resolution: "@types/d3-time@npm:2.1.1" @@ -16747,13 +16763,6 @@ __metadata: languageName: node linkType: hard -"balanced-match@npm:^0.4.2": - version: 0.4.2 - resolution: "balanced-match@npm:0.4.2" - checksum: 205ebb42ce8529fa8e043a808b41bfb9818d5f98a8eb76a1cd5483f8a98dd0baefc8a9d940f36b591b1316a04f56b35c32b60ac9b1f848e41e4698672cec6c1e - languageName: node - linkType: hard - "balanced-match@npm:^1.0.0": version: 1.0.2 resolution: "balanced-match@npm:1.0.2" @@ -19450,6 +19459,15 @@ __metadata: languageName: node linkType: hard +"d3-array@npm:2 - 3, d3-array@npm:2.10.0 - 3": + version: 3.2.0 + resolution: "d3-array@npm:3.2.0" + dependencies: + internmap: 1 - 2 + checksum: e236f6670b60b64abb6c435da25b5cbbdc2c7c0decdbf9355bc4cf6803d6da4fa820b7b78b9cbd127edb493555934a9788d45084c2f39d7c2e1a2b7aa48264a4 + languageName: node + linkType: hard + "d3-array@npm:2, d3-array@npm:^2.3.0": version: 2.12.1 resolution: "d3-array@npm:2.12.1" @@ -19459,27 +19477,6 @@ __metadata: languageName: node linkType: hard -"d3-array@npm:^1.2.0": - version: 1.2.4 - resolution: "d3-array@npm:1.2.4" - checksum: d0be1fa7d72dbfac8a3bcffbb669d42bcb9128d8818d84d2b1df0c60bbe4c8e54a798be0457c55a219b399e2c2fabcbd581cbb130eb638b5436b0618d7e56000 - languageName: node - linkType: hard - -"d3-collection@npm:1": - version: 1.0.7 - resolution: "d3-collection@npm:1.0.7" - checksum: 9c6b910a9da0efb021e294509f98263ca4f62d10b997bb30ccfb6edd582b703da36e176b968b5bac815fbb0f328e49643c38cf93b5edf8572a179ba55cf4a09d - languageName: node - linkType: hard - -"d3-color@npm:1": - version: 1.4.1 - resolution: "d3-color@npm:1.4.1" - checksum: a214b61458b5fcb7ad1a84faed0e02918037bab6be37f2d437bf0e2915cbd854d89fbf93754f17b0781c89e39d46704633d05a2bfae77e6209f0f4b140f9894b - languageName: node - linkType: hard - "d3-color@npm:1 - 2": version: 2.0.0 resolution: "d3-color@npm:2.0.0" @@ -19529,13 +19526,6 @@ __metadata: languageName: node linkType: hard -"d3-format@npm:1": - version: 1.4.5 - resolution: "d3-format@npm:1.4.5" - checksum: 1b8b2c0bca182173bccd290a43e8b635a83fc8cfe52ec878c7bdabb997d47daac11f2b175cebbe73f807f782ad655f542bdfe18180ca5eb3498a3a82da1e06ab - languageName: node - linkType: hard - "d3-format@npm:1 - 2": version: 2.0.0 resolution: "d3-format@npm:2.0.0" @@ -19543,7 +19533,14 @@ __metadata: languageName: node linkType: hard -"d3-interpolate@npm:1 - 3": +"d3-format@npm:1 - 3": + version: 3.1.0 + resolution: "d3-format@npm:3.1.0" + checksum: f345ec3b8ad3cab19bff5dead395bd9f5590628eb97a389b1dd89f0b204c7c4fc1d9520f13231c2c7cf14b7c9a8cf10f8ef15bde2befbab41454a569bd706ca2 + languageName: node + linkType: hard + +"d3-interpolate@npm:1 - 3, d3-interpolate@npm:1.2.0 - 3, d3-interpolate@npm:^3.0.1": version: 3.0.1 resolution: "d3-interpolate@npm:3.0.1" dependencies: @@ -19552,15 +19549,6 @@ __metadata: languageName: node linkType: hard -"d3-interpolate@npm:1, d3-interpolate@npm:^1.3.0": - version: 1.4.0 - resolution: "d3-interpolate@npm:1.4.0" - dependencies: - d3-color: 1 - checksum: d98988bd1e2f59d01f100d0a19315ad8f82ef022aa09a65aff76f747a44f9b52f2d64c6578b8f47e01f2b14a8f0ef88f5460d11173c0dd2d58238c217ac0ec03 - languageName: node - linkType: hard - "d3-interpolate@npm:1.2.0 - 2, d3-interpolate@npm:^2.0.0": version: 2.0.1 resolution: "d3-interpolate@npm:2.0.1" @@ -19570,13 +19558,6 @@ __metadata: languageName: node linkType: hard -"d3-path@npm:1": - version: 1.0.9 - resolution: "d3-path@npm:1.0.9" - checksum: d4382573baf9509a143f40944baeff9fead136926aed6872f7ead5b3555d68925f8a37935841dd51f1d70b65a294fe35c065b0906fb6e42109295f6598fc16d0 - languageName: node - linkType: hard - "d3-path@npm:1 - 2": version: 2.0.0 resolution: "d3-path@npm:2.0.0" @@ -19598,20 +19579,6 @@ __metadata: languageName: node linkType: hard -"d3-scale@npm:^2.1.0": - version: 2.2.2 - resolution: "d3-scale@npm:2.2.2" - dependencies: - d3-array: ^1.2.0 - d3-collection: 1 - d3-format: 1 - d3-interpolate: 1 - d3-time: 1 - d3-time-format: 2 - checksum: 42086d4b9db9f8492a99dbbdacf546983faef1bb6260fe875c0c1884f1ca9cf5fd233de3702c2f9e24145b1c5383945e929c8682d80fa57ab515ef2c4f2c61f6 - languageName: node - linkType: hard - "d3-scale@npm:^3.0.0": version: 3.3.0 resolution: "d3-scale@npm:3.3.0" @@ -19625,6 +19592,19 @@ __metadata: languageName: node linkType: hard +"d3-scale@npm:^4.0.2": + version: 4.0.2 + resolution: "d3-scale@npm:4.0.2" + dependencies: + d3-array: 2.10.0 - 3 + d3-format: 1 - 3 + d3-interpolate: 1.2.0 - 3 + d3-time: 2.1.1 - 3 + d3-time-format: 2 - 4 + checksum: a9c770d283162c3bd11477c3d9d485d07f8db2071665f1a4ad23eec3e515e2cefbd369059ec677c9ac849877d1a765494e90e92051d4f21111aa56791c98729e + languageName: node + linkType: hard + "d3-selection@npm:2 - 3, d3-selection@npm:3, d3-selection@npm:^3.0.0": version: 3.0.0 resolution: "d3-selection@npm:3.0.0" @@ -19632,15 +19612,6 @@ __metadata: languageName: node linkType: hard -"d3-shape@npm:^1.2.0": - version: 1.3.7 - resolution: "d3-shape@npm:1.3.7" - dependencies: - d3-path: 1 - checksum: 46566a3ab64a25023653bf59d64e81e9e6c987e95be985d81c5cedabae5838bd55f4a201a6b69069ca862eb63594cd263cac9034afc2b0e5664dfe286c866129 - languageName: node - linkType: hard - "d3-shape@npm:^2.0.0": version: 2.1.0 resolution: "d3-shape@npm:2.1.0" @@ -19650,7 +19621,7 @@ __metadata: languageName: node linkType: hard -"d3-shape@npm:^3.0.0": +"d3-shape@npm:^3.0.0, d3-shape@npm:^3.1.0": version: 3.1.0 resolution: "d3-shape@npm:3.1.0" dependencies: @@ -19659,15 +19630,6 @@ __metadata: languageName: node linkType: hard -"d3-time-format@npm:2": - version: 2.3.0 - resolution: "d3-time-format@npm:2.3.0" - dependencies: - d3-time: 1 - checksum: 5445eaaf2b3b2095cdc1fa75dfd2f361a61c39b677dcc1c2ba4cb6bc0442953de0fbaaa397d7d7a9325ad99c63d869f162a713e150e826ff8af482615664cb3f - languageName: node - linkType: hard - "d3-time-format@npm:2 - 3": version: 3.0.0 resolution: "d3-time-format@npm:3.0.0" @@ -19677,10 +19639,12 @@ __metadata: languageName: node linkType: hard -"d3-time@npm:1": - version: 1.1.0 - resolution: "d3-time@npm:1.1.0" - checksum: 33fcfff94ff093dde2048c190ecca8b39fe0ec8b3c61e9fc39c5f6072ce5b86dd2b91823f086366995422bbbac7f74fd9abdb7efe4f292a73b1c6197c699cc78 +"d3-time-format@npm:2 - 4": + version: 4.1.0 + resolution: "d3-time-format@npm:4.1.0" + dependencies: + d3-time: 1 - 3 + checksum: 7342bce28355378152bbd4db4e275405439cabba082d9cd01946d40581140481c8328456d91740b0fe513c51ec4a467f4471ffa390c7e0e30ea30e9ec98fcdf4 languageName: node linkType: hard @@ -19693,6 +19657,15 @@ __metadata: languageName: node linkType: hard +"d3-time@npm:1 - 3, d3-time@npm:2.1.1 - 3": + version: 3.0.0 + resolution: "d3-time@npm:3.0.0" + dependencies: + d3-array: 2 - 3 + checksum: 01646568ef01682550b7ee9f32394e4eb116a29515564861958871ed8de8fff02a25cd50dd8c4413921e6d9ecb8c8ce39be3266f655c8c18599fe58bcb253d60 + languageName: node + linkType: hard + "d3-timer@npm:1 - 3": version: 3.0.1 resolution: "d3-timer@npm:3.0.1" @@ -25173,6 +25146,13 @@ __metadata: languageName: node linkType: hard +"internmap@npm:1 - 2": + version: 2.0.3 + resolution: "internmap@npm:2.0.3" + checksum: 7ca41ec6aba8f0072fc32fa8a023450a9f44503e2d8e403583c55714b25efd6390c38a87161ec456bf42d7bc83aab62eb28f5aef34876b1ac4e60693d5e1d241 + languageName: node + linkType: hard + "internmap@npm:^1.0.0": version: 1.0.1 resolution: "internmap@npm:1.0.1" @@ -28334,13 +28314,6 @@ __metadata: languageName: node linkType: hard -"lodash.throttle@npm:^4.1.1": - version: 4.1.1 - resolution: "lodash.throttle@npm:4.1.1" - checksum: 129c0a28cee48b348aef146f638ef8a8b197944d4e9ec26c1890c19d9bf5a5690fe11b655c77a4551268819b32d27f4206343e30c78961f60b561b8608c8c805 - languageName: node - linkType: hard - "lodash.union@npm:^4.6.0": version: 4.6.0 resolution: "lodash.union@npm:4.6.0" @@ -28355,7 +28328,7 @@ __metadata: languageName: node linkType: hard -"lodash@npm:4.17.21, lodash@npm:^4.17.10, lodash@npm:^4.17.11, lodash@npm:^4.17.13, lodash@npm:^4.17.14, lodash@npm:^4.17.15, lodash@npm:^4.17.19, lodash@npm:^4.17.20, lodash@npm:^4.17.21, lodash@npm:^4.17.4, lodash@npm:^4.17.5, lodash@npm:^4.7.0, lodash@npm:~4.17.0, lodash@npm:~4.17.15, lodash@npm:~4.17.4": +"lodash@npm:4.17.21, lodash@npm:^4.17.10, lodash@npm:^4.17.11, lodash@npm:^4.17.13, lodash@npm:^4.17.14, lodash@npm:^4.17.15, lodash@npm:^4.17.19, lodash@npm:^4.17.20, lodash@npm:^4.17.21, lodash@npm:^4.17.4, lodash@npm:^4.7.0, lodash@npm:~4.17.0, lodash@npm:~4.17.15": version: 4.17.21 resolution: "lodash@npm:4.17.21" checksum: eb835a2e51d381e561e508ce932ea50a8e5a68f4ebdd771ea240d3048244a8d13658acbd502cd4829768c56f2e16bdd4340b9ea141297d472517b83868e677f7 @@ -28793,13 +28766,6 @@ __metadata: languageName: node linkType: hard -"math-expression-evaluator@npm:^1.2.14": - version: 1.2.22 - resolution: "math-expression-evaluator@npm:1.2.22" - checksum: 97b46e3311025699209d5178ea197e4df8286ac378075f105ab0cbc467f55a926a522a7e5a5ce8fc2d88881b6d32f1e3eacd81f34f265e7907cc5715e0f61a38 - languageName: node - linkType: hard - "md5.js@npm:^1.3.4": version: 1.3.5 resolution: "md5.js@npm:1.3.5" @@ -32853,7 +32819,7 @@ __metadata: languageName: node linkType: hard -"prop-types@npm:^15.0.0, prop-types@npm:^15.5.10, prop-types@npm:^15.5.7, prop-types@npm:^15.5.8, prop-types@npm:^15.6.0, prop-types@npm:^15.6.2, prop-types@npm:^15.7.2, prop-types@npm:^15.8.1": +"prop-types@npm:^15.0.0, prop-types@npm:^15.5.10, prop-types@npm:^15.5.7, prop-types@npm:^15.5.8, prop-types@npm:^15.6.2, prop-types@npm:^15.7.2, prop-types@npm:^15.8.1": version: 15.8.1 resolution: "prop-types@npm:15.8.1" dependencies: @@ -33695,20 +33661,6 @@ __metadata: languageName: node linkType: hard -"react-resize-detector@npm:^2.3.0": - version: 2.3.0 - resolution: "react-resize-detector@npm:2.3.0" - dependencies: - lodash.debounce: ^4.0.8 - lodash.throttle: ^4.1.1 - prop-types: ^15.6.0 - resize-observer-polyfill: ^1.5.0 - peerDependencies: - react: ^0.14.7 || ^15.0.0 || ^16.0.0 - checksum: c409cc31edaa6bb943aa1098c5830f1c430b448ebc7d2a1c4c14b1ad0eb4ea0d0bd1f48e4315569692af52270f7dc8d7fb0862c1b6121411589c4d5cd39fc1e4 - languageName: node - linkType: hard - "react-resize-detector@npm:^6.6.3": version: 6.7.8 resolution: "react-resize-detector@npm:6.7.8" @@ -33723,6 +33675,18 @@ __metadata: languageName: node linkType: hard +"react-resize-detector@npm:^7.1.2": + version: 7.1.2 + resolution: "react-resize-detector@npm:7.1.2" + dependencies: + lodash: ^4.17.21 + peerDependencies: + react: ^16.0.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.0.0 || ^17.0.0 || ^18.0.0 + checksum: 55f4abad7f7523d16b081b5ab20f75c539a54a08253ce7e9df473d48386f42ceca6c31584ba9fa26e3528b498ef6685ec77fb9a22cffc97df05fb326d0bf1b26 + languageName: node + linkType: hard + "react-router-beta@npm:react-router@6.0.0-beta.0, react-router@npm:6.0.0-beta.0": version: 6.0.0-beta.0 resolution: "react-router@npm:6.0.0-beta.0" @@ -33782,21 +33746,6 @@ __metadata: languageName: node linkType: hard -"react-smooth@npm:^1.0.5": - version: 1.0.5 - resolution: "react-smooth@npm:1.0.5" - dependencies: - lodash: ~4.17.4 - prop-types: ^15.6.0 - raf: ^3.4.0 - react-transition-group: ^2.5.0 - peerDependencies: - react: ^15.0.0 || ^16.0.0 - react-dom: ^15.0.0 || ^16.0.0 - checksum: 29a2a00e09e0f5d4dea4424f945dc7dab9b611184c60b01bd24082b6293f9e5e4bafe0e4386d4c52a2c9c651caff3eeb5ce0966917a0bd06ba1165306853c822 - languageName: node - linkType: hard - "react-smooth@npm:^2.0.0": version: 2.0.0 resolution: "react-smooth@npm:2.0.0" @@ -33812,6 +33761,20 @@ __metadata: languageName: node linkType: hard +"react-smooth@npm:^2.0.1": + version: 2.0.1 + resolution: "react-smooth@npm:2.0.1" + dependencies: + fast-equals: ^2.0.0 + react-transition-group: 2.9.0 + peerDependencies: + prop-types: ^15.6.0 + react: ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 + react-dom: ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 + checksum: 65678491cbd506573f2dba82778ebf8259714d68dd227e0ee7c0e204bcbc7839cf97401620b4223814066581f1dce0493f97162a03dc2a68058b5a7ad2b41085 + languageName: node + linkType: hard + "react-sparklines@npm:^1.7.0": version: 1.7.0 resolution: "react-sparklines@npm:1.7.0" @@ -33865,7 +33828,7 @@ __metadata: languageName: node linkType: hard -"react-transition-group@npm:2.9.0, react-transition-group@npm:^2.5.0": +"react-transition-group@npm:2.9.0": version: 2.9.0 resolution: "react-transition-group@npm:2.9.0" dependencies: @@ -34113,7 +34076,7 @@ __metadata: languageName: node linkType: hard -"recharts-scale@npm:^0.4.2, recharts-scale@npm:^0.4.4": +"recharts-scale@npm:^0.4.4": version: 0.4.5 resolution: "recharts-scale@npm:0.4.5" dependencies: @@ -34122,25 +34085,29 @@ __metadata: languageName: node linkType: hard -"recharts@npm:^1.8.5": - version: 1.8.5 - resolution: "recharts@npm:1.8.5" +"recharts@npm:^2.0.0": + version: 2.1.14 + resolution: "recharts@npm:2.1.14" dependencies: + "@types/d3-interpolate": ^3.0.1 + "@types/d3-scale": ^4.0.2 + "@types/d3-shape": ^3.1.0 classnames: ^2.2.5 - core-js: ^2.6.10 - d3-interpolate: ^1.3.0 - d3-scale: ^2.1.0 - d3-shape: ^1.2.0 - lodash: ^4.17.5 - prop-types: ^15.6.0 - react-resize-detector: ^2.3.0 - react-smooth: ^1.0.5 - recharts-scale: ^0.4.2 - reduce-css-calc: ^1.3.0 + d3-interpolate: ^3.0.1 + d3-scale: ^4.0.2 + d3-shape: ^3.1.0 + eventemitter3: ^4.0.1 + lodash: ^4.17.19 + react-is: ^16.10.2 + react-resize-detector: ^7.1.2 + react-smooth: ^2.0.1 + recharts-scale: ^0.4.4 + reduce-css-calc: ^2.1.8 peerDependencies: - react: ^15.0.0 || ^16.0.0 - react-dom: ^15.0.0 || ^16.0.0 - checksum: bdc1b712b90a3e5f5fcc1bbb7755dde8666c056f67cad90f4e4a2dd726ed45f9fcc82fce4a679ae168c2ed2e243a4c1acffb3e1f45ad4d96c47bcf9e764b5c8f + prop-types: ^15.6.0 + react: ^16.0.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.0.0 || ^17.0.0 || ^18.0.0 + checksum: 58f11fe8c9c4c36ddfe464ed896a7fd61b3c6cedeeab07cd86f286604dc11e96d2dc9288c55bb9c4e3c083ee325ffcccb5d0e6bc43a747c72110d25300624b22 languageName: node linkType: hard @@ -34222,17 +34189,6 @@ __metadata: languageName: node linkType: hard -"reduce-css-calc@npm:^1.3.0": - version: 1.3.0 - resolution: "reduce-css-calc@npm:1.3.0" - dependencies: - balanced-match: ^0.4.2 - math-expression-evaluator: ^1.2.14 - reduce-function-call: ^1.0.1 - checksum: 72696db02ede8772fe5ba9c47c6d451557bea0d11525f4e54b6adfcc4e540558755bb0ad454824cb6b998f0bd940eb2ef594f35b3d509dfa37934d93ece0f707 - languageName: node - linkType: hard - "reduce-css-calc@npm:^2.1.8": version: 2.1.8 resolution: "reduce-css-calc@npm:2.1.8" @@ -34243,15 +34199,6 @@ __metadata: languageName: node linkType: hard -"reduce-function-call@npm:^1.0.1": - version: 1.0.3 - resolution: "reduce-function-call@npm:1.0.3" - dependencies: - balanced-match: ^1.0.0 - checksum: d0169016ea22b59d55fa3206507c8f2d009574abd0f9b86552035a8405d52f6d7d5b60d084c5950d6f2884df7de42f87a6260b1b386b79ede63bfc87ea0c3ce8 - languageName: node - linkType: hard - "redux-immutable@npm:^4.0.0": version: 4.0.0 resolution: "redux-immutable@npm:4.0.0" @@ -34670,7 +34617,7 @@ __metadata: languageName: node linkType: hard -"resize-observer-polyfill@npm:^1.5.0, resize-observer-polyfill@npm:^1.5.1": +"resize-observer-polyfill@npm:^1.5.1": version: 1.5.1 resolution: "resize-observer-polyfill@npm:1.5.1" checksum: 57e7f79489867b00ba43c9c051524a5c8f162a61d5547e99333549afc23e15c44fd43f2f318ea0261ea98c0eb3158cca261e6f48d66e1ed1cd1f340a43977094 From 96c550945f8bcc7e8015a86f42c68a840f096173 Mon Sep 17 00:00:00 2001 From: Leonardo Maier Date: Tue, 6 Sep 2022 17:38:28 -0300 Subject: [PATCH 12/19] Adds d3-* in moduleNameMapper option on jest.js Signed-off-by: Leonardo Maier --- packages/cli/config/jest.js | 1 + .../src/alerts/ProjectGrowthAlert.test.tsx | 17 +++++++++++++++++ .../src/alerts/UnlabeledDataflowAlert.test.tsx | 16 ++++++++++++++++ .../src/components/BarChart/BarChart.test.tsx | 16 ++++++++++++++++ .../ProductInsightsCard.test.tsx | 16 ++++++++++++++++ .../ProjectGrowthAlertCard.test.tsx | 16 ++++++++++++++++ .../UnlabeledDataflowAlertCard.test.tsx | 15 +++++++++++++++ .../BuildTimeline/BuildTimeline.test.tsx | 3 +-- 8 files changed, 98 insertions(+), 2 deletions(-) diff --git a/packages/cli/config/jest.js b/packages/cli/config/jest.js index 18f563a3a3..59bc55f136 100644 --- a/packages/cli/config/jest.js +++ b/packages/cli/config/jest.js @@ -132,6 +132,7 @@ async function getProjectConfig(targetPath, displayName) { collectCoverageFrom: ['**/*.{js,jsx,ts,tsx,mjs,cjs}', '!**/*.d.ts'], moduleNameMapper: { '\\.(css|less|scss|sss|styl)$': require.resolve('jest-css-modules'), + '^d3-(.*)$': 'd3-$1/dist/d3-$1', }, transform: { diff --git a/plugins/cost-insights/src/alerts/ProjectGrowthAlert.test.tsx b/plugins/cost-insights/src/alerts/ProjectGrowthAlert.test.tsx index 4e52fd6f02..c1a674a813 100644 --- a/plugins/cost-insights/src/alerts/ProjectGrowthAlert.test.tsx +++ b/plugins/cost-insights/src/alerts/ProjectGrowthAlert.test.tsx @@ -69,6 +69,23 @@ class CustomProjectGrowthAlert extends ProjectGrowthAlert { } describe('ProjectGrowthAlert', () => { + const { ResizeObserver } = window; + + beforeEach(() => { + // @ts-expect-error + delete window.ResizeObserver; + window.ResizeObserver = jest.fn().mockImplementation(() => ({ + observe: jest.fn(), + unobserve: jest.fn(), + disconnect: jest.fn(), + })); + }); + + afterEach(() => { + window.ResizeObserver = ResizeObserver; + jest.restoreAllMocks(); + }); + describe('constructor', () => { it('should create a project growth alert', async () => { const alert = new ProjectGrowthAlert(mockData); diff --git a/plugins/cost-insights/src/alerts/UnlabeledDataflowAlert.test.tsx b/plugins/cost-insights/src/alerts/UnlabeledDataflowAlert.test.tsx index bcd6c335a5..a4f78ae8f5 100644 --- a/plugins/cost-insights/src/alerts/UnlabeledDataflowAlert.test.tsx +++ b/plugins/cost-insights/src/alerts/UnlabeledDataflowAlert.test.tsx @@ -66,6 +66,22 @@ class CustomUnlabeledDataflowAlert extends UnlabeledDataflowAlert { } describe('UnlabeledDataflowAlert', () => { + const { ResizeObserver } = window; + beforeEach(() => { + // @ts-expect-error + delete window.ResizeObserver; + window.ResizeObserver = jest.fn().mockImplementation(() => ({ + observe: jest.fn(), + unobserve: jest.fn(), + disconnect: jest.fn(), + })); + }); + + afterEach(() => { + window.ResizeObserver = ResizeObserver; + jest.restoreAllMocks(); + }); + describe('constructor', () => { it('should create an unlabeled dataflow alert', async () => { const alert = new UnlabeledDataflowAlert(mockData); diff --git a/plugins/cost-insights/src/components/BarChart/BarChart.test.tsx b/plugins/cost-insights/src/components/BarChart/BarChart.test.tsx index 2ab4b7ebc5..4e3ca9d78c 100644 --- a/plugins/cost-insights/src/components/BarChart/BarChart.test.tsx +++ b/plugins/cost-insights/src/components/BarChart/BarChart.test.tsx @@ -55,6 +55,22 @@ const renderWithProps = ({ }; describe('', () => { + const { ResizeObserver } = window; + beforeEach(() => { + // @ts-expect-error + delete window.ResizeObserver; + window.ResizeObserver = jest.fn().mockImplementation(() => ({ + observe: jest.fn(), + unobserve: jest.fn(), + disconnect: jest.fn(), + })); + }); + + afterEach(() => { + window.ResizeObserver = ResizeObserver; + jest.restoreAllMocks(); + }); + it('Renders without exploding', async () => { const rendered = await renderWithProps({} as BarChartProps); expect(rendered.getByText('test-id-10')).toBeInTheDocument(); diff --git a/plugins/cost-insights/src/components/ProductInsightsCard/ProductInsightsCard.test.tsx b/plugins/cost-insights/src/components/ProductInsightsCard/ProductInsightsCard.test.tsx index 9fc816bbbf..737019e77a 100644 --- a/plugins/cost-insights/src/components/ProductInsightsCard/ProductInsightsCard.test.tsx +++ b/plugins/cost-insights/src/components/ProductInsightsCard/ProductInsightsCard.test.tsx @@ -74,6 +74,22 @@ const renderProductInsightsCardInTestApp = async ( ); describe('', () => { + const { ResizeObserver } = window; + beforeEach(() => { + // @ts-expect-error + delete window.ResizeObserver; + window.ResizeObserver = jest.fn().mockImplementation(() => ({ + observe: jest.fn(), + unobserve: jest.fn(), + disconnect: jest.fn(), + })); + }); + + afterEach(() => { + window.ResizeObserver = ResizeObserver; + jest.restoreAllMocks(); + }); + it('Should render the right subheader for products with cost data', async () => { const entity = { ...mockProductCost, diff --git a/plugins/cost-insights/src/components/ProjectGrowthAlertCard/ProjectGrowthAlertCard.test.tsx b/plugins/cost-insights/src/components/ProjectGrowthAlertCard/ProjectGrowthAlertCard.test.tsx index 5c4d56ae62..5541bf3d24 100644 --- a/plugins/cost-insights/src/components/ProjectGrowthAlertCard/ProjectGrowthAlertCard.test.tsx +++ b/plugins/cost-insights/src/components/ProjectGrowthAlertCard/ProjectGrowthAlertCard.test.tsx @@ -45,6 +45,22 @@ const MockProjectGrowthAlert = createMockProjectGrowthData(data => ({ })); describe('', () => { + const { ResizeObserver } = window; + beforeEach(() => { + // @ts-expect-error + delete window.ResizeObserver; + window.ResizeObserver = jest.fn().mockImplementation(() => ({ + observe: jest.fn(), + unobserve: jest.fn(), + disconnect: jest.fn(), + })); + }); + + afterEach(() => { + window.ResizeObserver = ResizeObserver; + jest.restoreAllMocks(); + }); + it('renders the correct title and subheader for multiple services', async () => { const subheader = new RegExp( `${MockAlertCosts.length} products, sorted by cost`, diff --git a/plugins/cost-insights/src/components/UnlabeledDataflowAlertCard/UnlabeledDataflowAlertCard.test.tsx b/plugins/cost-insights/src/components/UnlabeledDataflowAlertCard/UnlabeledDataflowAlertCard.test.tsx index 5c226d4cb3..06353535a5 100644 --- a/plugins/cost-insights/src/components/UnlabeledDataflowAlertCard/UnlabeledDataflowAlertCard.test.tsx +++ b/plugins/cost-insights/src/components/UnlabeledDataflowAlertCard/UnlabeledDataflowAlertCard.test.tsx @@ -40,6 +40,21 @@ const MockUnlabeledDataflowAlertSingleProject = createMockUnlabeledDataflowData( ); describe('', () => { + const { ResizeObserver } = window; + beforeEach(() => { + // @ts-expect-error + delete window.ResizeObserver; + window.ResizeObserver = jest.fn().mockImplementation(() => ({ + observe: jest.fn(), + unobserve: jest.fn(), + disconnect: jest.fn(), + })); + }); + + afterEach(() => { + window.ResizeObserver = ResizeObserver; + jest.restoreAllMocks(); + }); it('renders the correct subheader for multiple projects', async () => { const subheader = new RegExp( `Showing costs from ${MockUnlabeledDataflowAlertMultipleProjects.projects.length} ` + diff --git a/plugins/xcmetrics/src/components/BuildTimeline/BuildTimeline.test.tsx b/plugins/xcmetrics/src/components/BuildTimeline/BuildTimeline.test.tsx index 29adbffd0a..cf53b2d73c 100644 --- a/plugins/xcmetrics/src/components/BuildTimeline/BuildTimeline.test.tsx +++ b/plugins/xcmetrics/src/components/BuildTimeline/BuildTimeline.test.tsx @@ -24,8 +24,7 @@ describe('BuildTimeline', () => { const { ResizeObserver } = window; beforeEach(() => { - // @ts-expect-error: Since we have strictNullChecks enabled, this will throw an error as window.ResizeObserver - // it's not an optional operand + // @ts-expect-error delete window.ResizeObserver; window.ResizeObserver = jest.fn().mockImplementation(() => ({ observe: jest.fn(), From da46f91eff8bf165cf6d6de0653fde6eedb01c66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 23 Sep 2022 10:12:32 +0200 Subject: [PATCH 13/19] try without the mapping MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- packages/cli/config/jest.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/cli/config/jest.js b/packages/cli/config/jest.js index 59bc55f136..18f563a3a3 100644 --- a/packages/cli/config/jest.js +++ b/packages/cli/config/jest.js @@ -132,7 +132,6 @@ async function getProjectConfig(targetPath, displayName) { collectCoverageFrom: ['**/*.{js,jsx,ts,tsx,mjs,cjs}', '!**/*.d.ts'], moduleNameMapper: { '\\.(css|less|scss|sss|styl)$': require.resolve('jest-css-modules'), - '^d3-(.*)$': 'd3-$1/dist/d3-$1', }, transform: { From b06d9220d2a7bcb0cd3438009b1851cf3d2ed87b Mon Sep 17 00:00:00 2001 From: Leonardo Maier Date: Fri, 30 Sep 2022 16:08:11 -0300 Subject: [PATCH 14/19] removes parser config for tsx files on jest config Signed-off-by: Leonardo Maier --- packages/cli/config/jest.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/packages/cli/config/jest.js b/packages/cli/config/jest.js index 18f563a3a3..44a47e13dd 100644 --- a/packages/cli/config/jest.js +++ b/packages/cli/config/jest.js @@ -179,10 +179,6 @@ async function getProjectConfig(targetPath, displayName) { { sourceMaps: envOptions.enableSourceMaps || envOptions.nextTests, jsc: { - parser: { - syntax: 'typescript', - tsx: true, - }, transform: { react: { runtime: 'automatic', From 8fb1600680aa538f16b7c56a68ac5a8540ac3883 Mon Sep 17 00:00:00 2001 From: Leonardo Maier Date: Sat, 1 Oct 2022 10:25:19 -0300 Subject: [PATCH 15/19] converts LogoIcon component to tsx and fixes BuildTimeline tests Signed-off-by: Leonardo Maier --- .../Root/{LogoIcon.jsx => LogoIcon.tsx} | 0 .../BuildTimeline/BuildTimeline.test.tsx | 20 ++++++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) rename packages/app/src/components/Root/{LogoIcon.jsx => LogoIcon.tsx} (100%) diff --git a/packages/app/src/components/Root/LogoIcon.jsx b/packages/app/src/components/Root/LogoIcon.tsx similarity index 100% rename from packages/app/src/components/Root/LogoIcon.jsx rename to packages/app/src/components/Root/LogoIcon.tsx diff --git a/plugins/xcmetrics/src/components/BuildTimeline/BuildTimeline.test.tsx b/plugins/xcmetrics/src/components/BuildTimeline/BuildTimeline.test.tsx index cf53b2d73c..17731e8d42 100644 --- a/plugins/xcmetrics/src/components/BuildTimeline/BuildTimeline.test.tsx +++ b/plugins/xcmetrics/src/components/BuildTimeline/BuildTimeline.test.tsx @@ -20,6 +20,19 @@ import { BuildTimeline } from './BuildTimeline'; jest.mock('../../api/XcmetricsClient'); const client = require('../../api/XcmetricsClient'); +jest.mock('recharts', () => { + const OriginalModule = jest.requireActual('recharts'); + + return { + ...OriginalModule, + ResponsiveContainer: ({ children }: any) => ( + + {children} + + ), + }; +}); + describe('BuildTimeline', () => { const { ResizeObserver } = window; @@ -42,9 +55,10 @@ describe('BuildTimeline', () => { const rendered = await renderInTestApp( , ); - expect( - await rendered.findByText(client.mockTarget.name), - ).toBeInTheDocument(); + + const [element] = await rendered.findAllByText(client.mockTarget.name); + + expect(element).toBeInTheDocument(); }); it('should render a message if no targets are provided', async () => { From a230bf2a9626f840325015e404e04b231a339e58 Mon Sep 17 00:00:00 2001 From: Leonardo Maier Date: Sat, 1 Oct 2022 10:52:29 -0300 Subject: [PATCH 16/19] fix formatting issues Signed-off-by: Leonardo Maier --- .../components/BuildTimeline/BuildTimeline.test.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/xcmetrics/src/components/BuildTimeline/BuildTimeline.test.tsx b/plugins/xcmetrics/src/components/BuildTimeline/BuildTimeline.test.tsx index 17731e8d42..4a5aff2f04 100644 --- a/plugins/xcmetrics/src/components/BuildTimeline/BuildTimeline.test.tsx +++ b/plugins/xcmetrics/src/components/BuildTimeline/BuildTimeline.test.tsx @@ -24,12 +24,12 @@ jest.mock('recharts', () => { const OriginalModule = jest.requireActual('recharts'); return { - ...OriginalModule, - ResponsiveContainer: ({ children }: any) => ( - - {children} - - ), + ...OriginalModule, + ResponsiveContainer: ({ children }: any) => ( + + {children} + + ), }; }); From 752f3cd93a08f3679154638cc589b679557b3b43 Mon Sep 17 00:00:00 2001 From: Leonardo Maier Date: Mon, 17 Oct 2022 10:59:41 -0300 Subject: [PATCH 17/19] revert changes and update swc to 1.3.9 Signed-off-by: Leonardo Maier --- .../Root/{LogoIcon.tsx => LogoIcon.jsx} | 0 packages/cli/config/jest.js | 4 + packages/cli/package.json | 2 +- yarn.lock | 212 ++++++------------ 4 files changed, 76 insertions(+), 142 deletions(-) rename packages/app/src/components/Root/{LogoIcon.tsx => LogoIcon.jsx} (100%) diff --git a/packages/app/src/components/Root/LogoIcon.tsx b/packages/app/src/components/Root/LogoIcon.jsx similarity index 100% rename from packages/app/src/components/Root/LogoIcon.tsx rename to packages/app/src/components/Root/LogoIcon.jsx diff --git a/packages/cli/config/jest.js b/packages/cli/config/jest.js index 44a47e13dd..18f563a3a3 100644 --- a/packages/cli/config/jest.js +++ b/packages/cli/config/jest.js @@ -179,6 +179,10 @@ async function getProjectConfig(targetPath, displayName) { { sourceMaps: envOptions.enableSourceMaps || envOptions.nextTests, jsc: { + parser: { + syntax: 'typescript', + tsx: true, + }, transform: { react: { runtime: 'automatic', diff --git a/packages/cli/package.json b/packages/cli/package.json index a377bad909..20cf2d35cf 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -52,7 +52,7 @@ "@svgr/plugin-svgo": "6.5.x", "@svgr/rollup": "6.5.x", "@svgr/webpack": "6.5.x", - "@swc/core": "^1.2.239", + "@swc/core": "^1.3.9", "@swc/helpers": "^0.4.7", "@swc/jest": "^0.2.22", "@types/jest": "^29.0.0", diff --git a/yarn.lock b/yarn.lock index e7d1c80a1d..905fa91ca3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3361,7 +3361,7 @@ __metadata: "@svgr/plugin-svgo": 6.5.x "@svgr/rollup": 6.5.x "@svgr/webpack": 6.5.x - "@swc/core": ^1.2.239 + "@swc/core": ^1.3.9 "@swc/helpers": ^0.4.7 "@swc/jest": ^0.2.22 "@types/diff": ^5.0.0 @@ -12507,126 +12507,126 @@ __metadata: languageName: node linkType: hard -"@swc/core-android-arm-eabi@npm:1.3.5": - version: 1.3.5 - resolution: "@swc/core-android-arm-eabi@npm:1.3.5" +"@swc/core-android-arm-eabi@npm:1.3.9": + version: 1.3.9 + resolution: "@swc/core-android-arm-eabi@npm:1.3.9" dependencies: "@swc/wasm": 1.2.122 conditions: os=android & cpu=arm languageName: node linkType: hard -"@swc/core-android-arm64@npm:1.3.5": - version: 1.3.5 - resolution: "@swc/core-android-arm64@npm:1.3.5" +"@swc/core-android-arm64@npm:1.3.9": + version: 1.3.9 + resolution: "@swc/core-android-arm64@npm:1.3.9" dependencies: "@swc/wasm": 1.2.130 conditions: os=android & cpu=arm64 languageName: node linkType: hard -"@swc/core-darwin-arm64@npm:1.3.5": - version: 1.3.5 - resolution: "@swc/core-darwin-arm64@npm:1.3.5" +"@swc/core-darwin-arm64@npm:1.3.9": + version: 1.3.9 + resolution: "@swc/core-darwin-arm64@npm:1.3.9" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@swc/core-darwin-x64@npm:1.3.5": - version: 1.3.5 - resolution: "@swc/core-darwin-x64@npm:1.3.5" +"@swc/core-darwin-x64@npm:1.3.9": + version: 1.3.9 + resolution: "@swc/core-darwin-x64@npm:1.3.9" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@swc/core-freebsd-x64@npm:1.3.5": - version: 1.3.5 - resolution: "@swc/core-freebsd-x64@npm:1.3.5" +"@swc/core-freebsd-x64@npm:1.3.9": + version: 1.3.9 + resolution: "@swc/core-freebsd-x64@npm:1.3.9" dependencies: "@swc/wasm": 1.2.130 conditions: os=freebsd & cpu=x64 languageName: node linkType: hard -"@swc/core-linux-arm-gnueabihf@npm:1.3.5": - version: 1.3.5 - resolution: "@swc/core-linux-arm-gnueabihf@npm:1.3.5" +"@swc/core-linux-arm-gnueabihf@npm:1.3.9": + version: 1.3.9 + resolution: "@swc/core-linux-arm-gnueabihf@npm:1.3.9" dependencies: "@swc/wasm": 1.2.130 conditions: os=linux & cpu=arm languageName: node linkType: hard -"@swc/core-linux-arm64-gnu@npm:1.3.5": - version: 1.3.5 - resolution: "@swc/core-linux-arm64-gnu@npm:1.3.5" +"@swc/core-linux-arm64-gnu@npm:1.3.9": + version: 1.3.9 + resolution: "@swc/core-linux-arm64-gnu@npm:1.3.9" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@swc/core-linux-arm64-musl@npm:1.3.5": - version: 1.3.5 - resolution: "@swc/core-linux-arm64-musl@npm:1.3.5" +"@swc/core-linux-arm64-musl@npm:1.3.9": + version: 1.3.9 + resolution: "@swc/core-linux-arm64-musl@npm:1.3.9" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@swc/core-linux-x64-gnu@npm:1.3.5": - version: 1.3.5 - resolution: "@swc/core-linux-x64-gnu@npm:1.3.5" +"@swc/core-linux-x64-gnu@npm:1.3.9": + version: 1.3.9 + resolution: "@swc/core-linux-x64-gnu@npm:1.3.9" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@swc/core-linux-x64-musl@npm:1.3.5": - version: 1.3.5 - resolution: "@swc/core-linux-x64-musl@npm:1.3.5" +"@swc/core-linux-x64-musl@npm:1.3.9": + version: 1.3.9 + resolution: "@swc/core-linux-x64-musl@npm:1.3.9" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@swc/core-win32-arm64-msvc@npm:1.3.5": - version: 1.3.5 - resolution: "@swc/core-win32-arm64-msvc@npm:1.3.5" +"@swc/core-win32-arm64-msvc@npm:1.3.9": + version: 1.3.9 + resolution: "@swc/core-win32-arm64-msvc@npm:1.3.9" dependencies: "@swc/wasm": 1.2.130 conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@swc/core-win32-ia32-msvc@npm:1.3.5": - version: 1.3.5 - resolution: "@swc/core-win32-ia32-msvc@npm:1.3.5" +"@swc/core-win32-ia32-msvc@npm:1.3.9": + version: 1.3.9 + resolution: "@swc/core-win32-ia32-msvc@npm:1.3.9" dependencies: "@swc/wasm": 1.2.130 conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@swc/core-win32-x64-msvc@npm:1.3.5": - version: 1.3.5 - resolution: "@swc/core-win32-x64-msvc@npm:1.3.5" +"@swc/core-win32-x64-msvc@npm:1.3.9": + version: 1.3.9 + resolution: "@swc/core-win32-x64-msvc@npm:1.3.9" conditions: os=win32 & cpu=x64 languageName: node linkType: hard -"@swc/core@npm:^1.2.239": - version: 1.3.5 - resolution: "@swc/core@npm:1.3.5" +"@swc/core@npm:^1.3.9": + version: 1.3.9 + resolution: "@swc/core@npm:1.3.9" dependencies: - "@swc/core-android-arm-eabi": 1.3.5 - "@swc/core-android-arm64": 1.3.5 - "@swc/core-darwin-arm64": 1.3.5 - "@swc/core-darwin-x64": 1.3.5 - "@swc/core-freebsd-x64": 1.3.5 - "@swc/core-linux-arm-gnueabihf": 1.3.5 - "@swc/core-linux-arm64-gnu": 1.3.5 - "@swc/core-linux-arm64-musl": 1.3.5 - "@swc/core-linux-x64-gnu": 1.3.5 - "@swc/core-linux-x64-musl": 1.3.5 - "@swc/core-win32-arm64-msvc": 1.3.5 - "@swc/core-win32-ia32-msvc": 1.3.5 - "@swc/core-win32-x64-msvc": 1.3.5 + "@swc/core-android-arm-eabi": 1.3.9 + "@swc/core-android-arm64": 1.3.9 + "@swc/core-darwin-arm64": 1.3.9 + "@swc/core-darwin-x64": 1.3.9 + "@swc/core-freebsd-x64": 1.3.9 + "@swc/core-linux-arm-gnueabihf": 1.3.9 + "@swc/core-linux-arm64-gnu": 1.3.9 + "@swc/core-linux-arm64-musl": 1.3.9 + "@swc/core-linux-x64-gnu": 1.3.9 + "@swc/core-linux-x64-musl": 1.3.9 + "@swc/core-win32-arm64-msvc": 1.3.9 + "@swc/core-win32-ia32-msvc": 1.3.9 + "@swc/core-win32-x64-msvc": 1.3.9 dependenciesMeta: "@swc/core-android-arm-eabi": optional: true @@ -12656,7 +12656,7 @@ __metadata: optional: true bin: swcx: run_swcx.js - checksum: f0bcd0aa1d1a0b7d48ee5c416f8a384e19e4c0eed1e0be940d8893bf3981d98bf00f27d03bebf9cdedd34bf316d68c2db68e7bb7d1940d7b6062541e6e4cc738 + checksum: 761918f1bca5d494eaaafd49720717e3b3071df5bc6ef8b298a778ba4e4d20bc5a78c939a0b1c98623f9fe23e535a16a359179b72390cd1f5cbc891ea53c22fa languageName: node linkType: hard @@ -13251,7 +13251,7 @@ __metadata: languageName: node linkType: hard -"@types/d3-interpolate@npm:*, @types/d3-interpolate@npm:^3.0.1": +"@types/d3-interpolate@npm:*": version: 3.0.1 resolution: "@types/d3-interpolate@npm:3.0.1" dependencies: @@ -13299,15 +13299,6 @@ __metadata: languageName: node linkType: hard -"@types/d3-scale@npm:^4.0.2": - version: 4.0.2 - resolution: "@types/d3-scale@npm:4.0.2" - dependencies: - "@types/d3-time": "*" - checksum: 6b3c0337f38f82b582d9f3190fde82edfce7ffafb371e5b2464c443137c2660bac644099d259f1f5cc829085eb5688bed0bea2b336a957d0845433bd07bf2ddd - languageName: node - linkType: hard - "@types/d3-selection@npm:*, @types/d3-selection@npm:^3.0.1": version: 3.0.3 resolution: "@types/d3-selection@npm:3.0.3" @@ -13333,7 +13324,7 @@ __metadata: languageName: node linkType: hard -"@types/d3-shape@npm:^3.0.1, @types/d3-shape@npm:^3.1.0": +"@types/d3-shape@npm:^3.0.1": version: 3.1.0 resolution: "@types/d3-shape@npm:3.1.0" dependencies: @@ -13342,13 +13333,6 @@ __metadata: languageName: node linkType: hard -"@types/d3-time@npm:*": - version: 3.0.0 - resolution: "@types/d3-time@npm:3.0.0" - checksum: e76adb056daccf80107f4db190ac6deb77e8774f00362bb6c76f178e67f2f217422fe502b654edbc9ac6451f6619045b9f6f5fe0db1ec5520e2ada377af7c72e - languageName: node - linkType: hard - "@types/d3-time@npm:^2": version: 2.1.1 resolution: "@types/d3-time@npm:2.1.1" @@ -18814,7 +18798,7 @@ __metadata: languageName: node linkType: hard -"core-js@npm:^2.4.0, core-js@npm:^2.5.0, core-js@npm:^2.6.10": +"core-js@npm:^2.4.0, core-js@npm:^2.5.0": version: 2.6.12 resolution: "core-js@npm:2.6.12" checksum: 44fa9934a85f8c78d61e0c8b7b22436330471ffe59ec5076fe7f324d6e8cf7f824b14b1c81ca73608b13bdb0fef035bd820989bf059767ad6fa13123bb8bd016 @@ -19459,15 +19443,6 @@ __metadata: languageName: node linkType: hard -"d3-array@npm:2 - 3, d3-array@npm:2.10.0 - 3": - version: 3.2.0 - resolution: "d3-array@npm:3.2.0" - dependencies: - internmap: 1 - 2 - checksum: e236f6670b60b64abb6c435da25b5cbbdc2c7c0decdbf9355bc4cf6803d6da4fa820b7b78b9cbd127edb493555934a9788d45084c2f39d7c2e1a2b7aa48264a4 - languageName: node - linkType: hard - "d3-array@npm:2, d3-array@npm:^2.3.0": version: 2.12.1 resolution: "d3-array@npm:2.12.1" @@ -19533,14 +19508,7 @@ __metadata: languageName: node linkType: hard -"d3-format@npm:1 - 3": - version: 3.1.0 - resolution: "d3-format@npm:3.1.0" - checksum: f345ec3b8ad3cab19bff5dead395bd9f5590628eb97a389b1dd89f0b204c7c4fc1d9520f13231c2c7cf14b7c9a8cf10f8ef15bde2befbab41454a569bd706ca2 - languageName: node - linkType: hard - -"d3-interpolate@npm:1 - 3, d3-interpolate@npm:1.2.0 - 3, d3-interpolate@npm:^3.0.1": +"d3-interpolate@npm:1 - 3": version: 3.0.1 resolution: "d3-interpolate@npm:3.0.1" dependencies: @@ -19592,19 +19560,6 @@ __metadata: languageName: node linkType: hard -"d3-scale@npm:^4.0.2": - version: 4.0.2 - resolution: "d3-scale@npm:4.0.2" - dependencies: - d3-array: 2.10.0 - 3 - d3-format: 1 - 3 - d3-interpolate: 1.2.0 - 3 - d3-time: 2.1.1 - 3 - d3-time-format: 2 - 4 - checksum: a9c770d283162c3bd11477c3d9d485d07f8db2071665f1a4ad23eec3e515e2cefbd369059ec677c9ac849877d1a765494e90e92051d4f21111aa56791c98729e - languageName: node - linkType: hard - "d3-selection@npm:2 - 3, d3-selection@npm:3, d3-selection@npm:^3.0.0": version: 3.0.0 resolution: "d3-selection@npm:3.0.0" @@ -19621,7 +19576,7 @@ __metadata: languageName: node linkType: hard -"d3-shape@npm:^3.0.0, d3-shape@npm:^3.1.0": +"d3-shape@npm:^3.0.0": version: 3.1.0 resolution: "d3-shape@npm:3.1.0" dependencies: @@ -19639,15 +19594,6 @@ __metadata: languageName: node linkType: hard -"d3-time-format@npm:2 - 4": - version: 4.1.0 - resolution: "d3-time-format@npm:4.1.0" - dependencies: - d3-time: 1 - 3 - checksum: 7342bce28355378152bbd4db4e275405439cabba082d9cd01946d40581140481c8328456d91740b0fe513c51ec4a467f4471ffa390c7e0e30ea30e9ec98fcdf4 - languageName: node - linkType: hard - "d3-time@npm:1 - 2, d3-time@npm:^2.1.1": version: 2.1.1 resolution: "d3-time@npm:2.1.1" @@ -19657,15 +19603,6 @@ __metadata: languageName: node linkType: hard -"d3-time@npm:1 - 3, d3-time@npm:2.1.1 - 3": - version: 3.0.0 - resolution: "d3-time@npm:3.0.0" - dependencies: - d3-array: 2 - 3 - checksum: 01646568ef01682550b7ee9f32394e4eb116a29515564861958871ed8de8fff02a25cd50dd8c4413921e6d9ecb8c8ce39be3266f655c8c18599fe58bcb253d60 - languageName: node - linkType: hard - "d3-timer@npm:1 - 3": version: 3.0.1 resolution: "d3-timer@npm:3.0.1" @@ -25146,13 +25083,6 @@ __metadata: languageName: node linkType: hard -"internmap@npm:1 - 2": - version: 2.0.3 - resolution: "internmap@npm:2.0.3" - checksum: 7ca41ec6aba8f0072fc32fa8a023450a9f44503e2d8e403583c55714b25efd6390c38a87161ec456bf42d7bc83aab62eb28f5aef34876b1ac4e60693d5e1d241 - languageName: node - linkType: hard - "internmap@npm:^1.0.0": version: 1.0.1 resolution: "internmap@npm:1.0.1" @@ -34086,16 +34016,16 @@ __metadata: linkType: hard "recharts@npm:^2.0.0": - version: 2.1.14 - resolution: "recharts@npm:2.1.14" + version: 2.1.15 + resolution: "recharts@npm:2.1.15" dependencies: - "@types/d3-interpolate": ^3.0.1 - "@types/d3-scale": ^4.0.2 - "@types/d3-shape": ^3.1.0 + "@types/d3-interpolate": ^2.0.0 + "@types/d3-scale": ^3.0.0 + "@types/d3-shape": ^2.0.0 classnames: ^2.2.5 - d3-interpolate: ^3.0.1 - d3-scale: ^4.0.2 - d3-shape: ^3.1.0 + d3-interpolate: ^2.0.0 + d3-scale: ^3.0.0 + d3-shape: ^2.0.0 eventemitter3: ^4.0.1 lodash: ^4.17.19 react-is: ^16.10.2 @@ -34107,7 +34037,7 @@ __metadata: prop-types: ^15.6.0 react: ^16.0.0 || ^17.0.0 || ^18.0.0 react-dom: ^16.0.0 || ^17.0.0 || ^18.0.0 - checksum: 58f11fe8c9c4c36ddfe464ed896a7fd61b3c6cedeeab07cd86f286604dc11e96d2dc9288c55bb9c4e3c083ee325ffcccb5d0e6bc43a747c72110d25300624b22 + checksum: 2f0be89eca6da8a6d899dac8676de145001353b6072b7853d3f04091c38604f80b241b4ef04d4b28268a95df4a8134b565a192077cb6a2903048fc90f19a5def languageName: node linkType: hard From 4091c73e684d7c91ab6f2ef1940871fde865a886 Mon Sep 17 00:00:00 2001 From: Leonardo Maier Date: Tue, 18 Oct 2022 17:54:32 -0300 Subject: [PATCH 18/19] creates new changesets and updates swc package for storybook Signed-off-by: Leonardo Maier --- .changeset/lucky-spoons-hide.md | 5 ++ .changeset/selfish-kiwis-matter.md | 5 ++ storybook/package.json | 2 +- storybook/yarn.lock | 114 ++++++++++++++--------------- 4 files changed, 68 insertions(+), 58 deletions(-) create mode 100644 .changeset/lucky-spoons-hide.md create mode 100644 .changeset/selfish-kiwis-matter.md diff --git a/.changeset/lucky-spoons-hide.md b/.changeset/lucky-spoons-hide.md new file mode 100644 index 0000000000..c481941f6a --- /dev/null +++ b/.changeset/lucky-spoons-hide.md @@ -0,0 +1,5 @@ +--- +'@backstage/cli': patch +--- + +Updated `@swc/core` to version 1.3.9 which fixes a `.tsx` parser bug diff --git a/.changeset/selfish-kiwis-matter.md b/.changeset/selfish-kiwis-matter.md new file mode 100644 index 0000000000..e258af0e97 --- /dev/null +++ b/.changeset/selfish-kiwis-matter.md @@ -0,0 +1,5 @@ +--- +'@backstage/create-app': patch +--- + +Updated `@swc/core` to `v1.3.9` which fixes a `.tsx` parser bug. You may want to run `yarn backstage-cli versions:bump` to get on latest version including the CLI itself. diff --git a/storybook/package.json b/storybook/package.json index 4a994eedfe..d7cb2bda98 100644 --- a/storybook/package.json +++ b/storybook/package.json @@ -8,7 +8,7 @@ "build-storybook": "build-storybook --output-dir dist" }, "dependencies": { - "@swc/core": "^1.2.239", + "@swc/core": "^1.3.9", "react": "^17.0.2", "react-dom": "^17.0.2", "react-hot-loader": "^4.13.0", diff --git a/storybook/yarn.lock b/storybook/yarn.lock index 1567968127..0852807334 100644 --- a/storybook/yarn.lock +++ b/storybook/yarn.lock @@ -2977,126 +2977,126 @@ __metadata: languageName: node linkType: hard -"@swc/core-android-arm-eabi@npm:1.3.5": - version: 1.3.5 - resolution: "@swc/core-android-arm-eabi@npm:1.3.5" +"@swc/core-android-arm-eabi@npm:1.3.9": + version: 1.3.9 + resolution: "@swc/core-android-arm-eabi@npm:1.3.9" dependencies: "@swc/wasm": 1.2.122 conditions: os=android & cpu=arm languageName: node linkType: hard -"@swc/core-android-arm64@npm:1.3.5": - version: 1.3.5 - resolution: "@swc/core-android-arm64@npm:1.3.5" +"@swc/core-android-arm64@npm:1.3.9": + version: 1.3.9 + resolution: "@swc/core-android-arm64@npm:1.3.9" dependencies: "@swc/wasm": 1.2.130 conditions: os=android & cpu=arm64 languageName: node linkType: hard -"@swc/core-darwin-arm64@npm:1.3.5": - version: 1.3.5 - resolution: "@swc/core-darwin-arm64@npm:1.3.5" +"@swc/core-darwin-arm64@npm:1.3.9": + version: 1.3.9 + resolution: "@swc/core-darwin-arm64@npm:1.3.9" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@swc/core-darwin-x64@npm:1.3.5": - version: 1.3.5 - resolution: "@swc/core-darwin-x64@npm:1.3.5" +"@swc/core-darwin-x64@npm:1.3.9": + version: 1.3.9 + resolution: "@swc/core-darwin-x64@npm:1.3.9" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@swc/core-freebsd-x64@npm:1.3.5": - version: 1.3.5 - resolution: "@swc/core-freebsd-x64@npm:1.3.5" +"@swc/core-freebsd-x64@npm:1.3.9": + version: 1.3.9 + resolution: "@swc/core-freebsd-x64@npm:1.3.9" dependencies: "@swc/wasm": 1.2.130 conditions: os=freebsd & cpu=x64 languageName: node linkType: hard -"@swc/core-linux-arm-gnueabihf@npm:1.3.5": - version: 1.3.5 - resolution: "@swc/core-linux-arm-gnueabihf@npm:1.3.5" +"@swc/core-linux-arm-gnueabihf@npm:1.3.9": + version: 1.3.9 + resolution: "@swc/core-linux-arm-gnueabihf@npm:1.3.9" dependencies: "@swc/wasm": 1.2.130 conditions: os=linux & cpu=arm languageName: node linkType: hard -"@swc/core-linux-arm64-gnu@npm:1.3.5": - version: 1.3.5 - resolution: "@swc/core-linux-arm64-gnu@npm:1.3.5" +"@swc/core-linux-arm64-gnu@npm:1.3.9": + version: 1.3.9 + resolution: "@swc/core-linux-arm64-gnu@npm:1.3.9" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@swc/core-linux-arm64-musl@npm:1.3.5": - version: 1.3.5 - resolution: "@swc/core-linux-arm64-musl@npm:1.3.5" +"@swc/core-linux-arm64-musl@npm:1.3.9": + version: 1.3.9 + resolution: "@swc/core-linux-arm64-musl@npm:1.3.9" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@swc/core-linux-x64-gnu@npm:1.3.5": - version: 1.3.5 - resolution: "@swc/core-linux-x64-gnu@npm:1.3.5" +"@swc/core-linux-x64-gnu@npm:1.3.9": + version: 1.3.9 + resolution: "@swc/core-linux-x64-gnu@npm:1.3.9" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@swc/core-linux-x64-musl@npm:1.3.5": - version: 1.3.5 - resolution: "@swc/core-linux-x64-musl@npm:1.3.5" +"@swc/core-linux-x64-musl@npm:1.3.9": + version: 1.3.9 + resolution: "@swc/core-linux-x64-musl@npm:1.3.9" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@swc/core-win32-arm64-msvc@npm:1.3.5": - version: 1.3.5 - resolution: "@swc/core-win32-arm64-msvc@npm:1.3.5" +"@swc/core-win32-arm64-msvc@npm:1.3.9": + version: 1.3.9 + resolution: "@swc/core-win32-arm64-msvc@npm:1.3.9" dependencies: "@swc/wasm": 1.2.130 conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@swc/core-win32-ia32-msvc@npm:1.3.5": - version: 1.3.5 - resolution: "@swc/core-win32-ia32-msvc@npm:1.3.5" +"@swc/core-win32-ia32-msvc@npm:1.3.9": + version: 1.3.9 + resolution: "@swc/core-win32-ia32-msvc@npm:1.3.9" dependencies: "@swc/wasm": 1.2.130 conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@swc/core-win32-x64-msvc@npm:1.3.5": - version: 1.3.5 - resolution: "@swc/core-win32-x64-msvc@npm:1.3.5" +"@swc/core-win32-x64-msvc@npm:1.3.9": + version: 1.3.9 + resolution: "@swc/core-win32-x64-msvc@npm:1.3.9" conditions: os=win32 & cpu=x64 languageName: node linkType: hard -"@swc/core@npm:^1.2.239": - version: 1.3.5 - resolution: "@swc/core@npm:1.3.5" +"@swc/core@npm:^1.3.9": + version: 1.3.9 + resolution: "@swc/core@npm:1.3.9" dependencies: - "@swc/core-android-arm-eabi": 1.3.5 - "@swc/core-android-arm64": 1.3.5 - "@swc/core-darwin-arm64": 1.3.5 - "@swc/core-darwin-x64": 1.3.5 - "@swc/core-freebsd-x64": 1.3.5 - "@swc/core-linux-arm-gnueabihf": 1.3.5 - "@swc/core-linux-arm64-gnu": 1.3.5 - "@swc/core-linux-arm64-musl": 1.3.5 - "@swc/core-linux-x64-gnu": 1.3.5 - "@swc/core-linux-x64-musl": 1.3.5 - "@swc/core-win32-arm64-msvc": 1.3.5 - "@swc/core-win32-ia32-msvc": 1.3.5 - "@swc/core-win32-x64-msvc": 1.3.5 + "@swc/core-android-arm-eabi": 1.3.9 + "@swc/core-android-arm64": 1.3.9 + "@swc/core-darwin-arm64": 1.3.9 + "@swc/core-darwin-x64": 1.3.9 + "@swc/core-freebsd-x64": 1.3.9 + "@swc/core-linux-arm-gnueabihf": 1.3.9 + "@swc/core-linux-arm64-gnu": 1.3.9 + "@swc/core-linux-arm64-musl": 1.3.9 + "@swc/core-linux-x64-gnu": 1.3.9 + "@swc/core-linux-x64-musl": 1.3.9 + "@swc/core-win32-arm64-msvc": 1.3.9 + "@swc/core-win32-ia32-msvc": 1.3.9 + "@swc/core-win32-x64-msvc": 1.3.9 dependenciesMeta: "@swc/core-android-arm-eabi": optional: true @@ -3126,7 +3126,7 @@ __metadata: optional: true bin: swcx: run_swcx.js - checksum: f0bcd0aa1d1a0b7d48ee5c416f8a384e19e4c0eed1e0be940d8893bf3981d98bf00f27d03bebf9cdedd34bf316d68c2db68e7bb7d1940d7b6062541e6e4cc738 + checksum: 761918f1bca5d494eaaafd49720717e3b3071df5bc6ef8b298a778ba4e4d20bc5a78c939a0b1c98623f9fe23e535a16a359179b72390cd1f5cbc891ea53c22fa languageName: node linkType: hard @@ -10734,7 +10734,7 @@ __metadata: "@storybook/node-logger": ^6.5.9 "@storybook/react": ^6.5.9 "@storybook/testing-library": ^0.0.13 - "@swc/core": ^1.2.239 + "@swc/core": ^1.3.9 react: ^17.0.2 react-dom: ^17.0.2 react-hot-loader: ^4.13.0 From ac90b0f51ae5dec2592f4e05f536aba455130b83 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 18 Oct 2022 08:13:35 +0000 Subject: [PATCH 19/19] Update dependency util to v0.12.5 Signed-off-by: Renovate Bot --- yarn.lock | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/yarn.lock b/yarn.lock index 05d79d90b3..f8a2b6a808 100644 --- a/yarn.lock +++ b/yarn.lock @@ -38816,16 +38816,15 @@ __metadata: linkType: hard "util@npm:^0.12.3, util@npm:^0.12.4": - version: 0.12.4 - resolution: "util@npm:0.12.4" + version: 0.12.5 + resolution: "util@npm:0.12.5" dependencies: inherits: ^2.0.3 is-arguments: ^1.0.4 is-generator-function: ^1.0.7 is-typed-array: ^1.1.3 - safe-buffer: ^5.1.2 which-typed-array: ^1.1.2 - checksum: 8eac7a6e6b341c0f1b3eb73bbe5dfcae31a7e9699c8fc3266789f3e95f7637946a7700dcf1904dbd3749a58a36760ebf7acf4bb5b717f7468532a8a79f44eff0 + checksum: 705e51f0de5b446f4edec10739752ac25856541e0254ea1e7e45e5b9f9b0cb105bc4bd415736a6210edc68245a7f903bf085ffb08dd7deb8a0e847f60538a38a languageName: node linkType: hard