+
+ >
+ );
+};
diff --git a/plugins/code-climate/src/components/CodeClimateTable/index.ts b/plugins/code-climate/src/components/CodeClimateTable/index.ts
new file mode 100644
index 0000000000..bdf79bb94b
--- /dev/null
+++ b/plugins/code-climate/src/components/CodeClimateTable/index.ts
@@ -0,0 +1,17 @@
+/*
+ * 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.
+ */
+
+export { CodeClimateTable } from './CodeClimateTable';
diff --git a/plugins/code-climate/src/index.ts b/plugins/code-climate/src/index.ts
new file mode 100644
index 0000000000..b6ef174b8f
--- /dev/null
+++ b/plugins/code-climate/src/index.ts
@@ -0,0 +1,24 @@
+/*
+ * 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.
+ */
+
+/**
+ * A Backstage plugin that integrates towards Code Climate
+ *
+ * @packageDocumentation
+ */
+
+export * from './api';
+export { codeClimatePlugin, EntityCodeClimateCard } from './plugin';
diff --git a/plugins/code-climate/src/plugin.test.ts b/plugins/code-climate/src/plugin.test.ts
new file mode 100644
index 0000000000..ea791f2c87
--- /dev/null
+++ b/plugins/code-climate/src/plugin.test.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 { codeClimatePlugin } from './plugin';
+
+describe('codeclimate', () => {
+ it('should export plugin', () => {
+ expect(codeClimatePlugin).toBeDefined();
+ });
+});
diff --git a/plugins/code-climate/src/plugin.ts b/plugins/code-climate/src/plugin.ts
new file mode 100644
index 0000000000..dcf86f1e19
--- /dev/null
+++ b/plugins/code-climate/src/plugin.ts
@@ -0,0 +1,58 @@
+/*
+ * 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 { ProductionCodeClimateApi, codeClimateApiRef } from './api';
+import {
+ createApiFactory,
+ createPlugin,
+ createRouteRef,
+ discoveryApiRef,
+ identityApiRef,
+ createComponentExtension,
+} from '@backstage/core-plugin-api';
+
+export const CODECLIMATE_REPO_ID_ANNOTATION = 'codeclimate.com/repo-id';
+
+export const rootRouteRef = createRouteRef({
+ id: 'code-climate',
+});
+
+export const codeClimatePlugin = createPlugin({
+ id: 'code-climate',
+ apis: [
+ createApiFactory({
+ api: codeClimateApiRef,
+ deps: {
+ discoveryApi: discoveryApiRef,
+ identityApi: identityApiRef,
+ },
+ factory: ({ discoveryApi }) => new ProductionCodeClimateApi(discoveryApi),
+ }),
+ ],
+ routes: {
+ root: rootRouteRef,
+ },
+});
+
+export const EntityCodeClimateCard = codeClimatePlugin.provide(
+ createComponentExtension({
+ name: 'EntityCodeClimateCard',
+ component: {
+ lazy: () =>
+ import('./components/CodeClimateCard').then(m => m.CodeClimateCard),
+ },
+ }),
+);
diff --git a/plugins/code-climate/src/setupTests.ts b/plugins/code-climate/src/setupTests.ts
new file mode 100644
index 0000000000..43d9e09713
--- /dev/null
+++ b/plugins/code-climate/src/setupTests.ts
@@ -0,0 +1,20 @@
+/*
+ * 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.
+ */
+
+/* eslint-disable import/no-extraneous-dependencies */
+
+import '@testing-library/jest-dom';
+import 'cross-fetch/polyfill';
diff --git a/yarn.lock b/yarn.lock
index bbd75035ce..a3adc4d7bf 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -5785,6 +5785,11 @@
resolved "https://registry.npmjs.org/@types/humanize-duration/-/humanize-duration-3.25.1.tgz#b6140d5fc00ff3917b3f521784abef4bc0387ccc"
integrity sha512-WZU/4bb+lvzyDmZzjJtp++9mfKy6B3lH6gGISgkcz6SU8hMILKRM0vi08TxIsb0dQB4Gzo68MWLmctu6xqUi9g==
+"@types/humanize-duration@^3.27.1":
+ version "3.27.1"
+ resolved "https://registry.npmjs.org/@types/humanize-duration/-/humanize-duration-3.27.1.tgz#f14740d1f585a0a8e3f46359b62fda8b0eaa31e7"
+ integrity sha512-K3e+NZlpCKd6Bd/EIdqjFJRFHbrq5TzPPLwREk5Iv/YoIjQrs6ljdAUCo+Lb2xFlGNOjGSE0dqsVD19cZL137w==
+
"@types/inquirer@^7.3.3":
version "7.3.3"
resolved "https://registry.npmjs.org/@types/inquirer/-/inquirer-7.3.3.tgz#92e6676efb67fa6925c69a2ee638f67a822952ac"
@@ -5954,6 +5959,11 @@
resolved "https://registry.npmjs.org/@types/luxon/-/luxon-2.0.9.tgz#782a0edfa6d699191292c13168bd496cd66b87c6"
integrity sha512-ZuzIc7aN+i2ZDMWIiSmMdubR9EMMSTdEzF6R+FckP4p6xdnOYKqknTo/k+xXQvciSXlNGIwA4OPU5X7JIFzYdA==
+"@types/luxon@^2.0.9":
+ version "2.0.9"
+ resolved "https://registry.npmjs.org/@types/luxon/-/luxon-2.0.9.tgz#782a0edfa6d699191292c13168bd496cd66b87c6"
+ integrity sha512-ZuzIc7aN+i2ZDMWIiSmMdubR9EMMSTdEzF6R+FckP4p6xdnOYKqknTo/k+xXQvciSXlNGIwA4OPU5X7JIFzYdA==
+
"@types/mdast@^3.0.0", "@types/mdast@^3.0.3":
version "3.0.3"
resolved "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.3.tgz#2d7d671b1cd1ea3deb306ea75036c2a0407d2deb"
@@ -13948,7 +13958,7 @@ human-signals@^2.1.0:
resolved "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0"
integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==
-humanize-duration@^3.25.1, humanize-duration@^3.26.0, humanize-duration@^3.27.0:
+humanize-duration@^3.25.1, humanize-duration@^3.26.0, humanize-duration@^3.27.0, humanize-duration@^3.27.1:
version "3.27.1"
resolved "https://registry.npmjs.org/humanize-duration/-/humanize-duration-3.27.1.tgz#2cd4ea4b03bd92184aee6d90d77a8f3d7628df69"
integrity sha512-jCVkMl+EaM80rrMrAPl96SGG4NRac53UyI1o/yAzebDntEY6K6/Fj2HOjdPg8omTqIe5Y0wPBai2q5xXrIbarA==