diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index fbb99eec31..f956ca4dca 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -4,5 +4,6 @@
# The last matching pattern takes precedence.
# https://help.github.com/articles/about-codeowners/
-* @spotify/backstage-core
-/plugins/techdocs @spotify/techdocs-core
+* @spotify/backstage-core
+/plugins/techdocs @spotify/techdocs-core
+/plugins/techdocs-cli @spotify/techdocs-core
diff --git a/packages/app/package.json b/packages/app/package.json
index 6b872156d6..ad2a8988b2 100644
--- a/packages/app/package.json
+++ b/packages/app/package.json
@@ -15,6 +15,7 @@
"@backstage/plugin-sentry": "^0.1.1-alpha.9",
"@backstage/plugin-tech-radar": "^0.1.1-alpha.9",
"@backstage/plugin-techdocs": "^0.1.1-alpha.9",
+ "@backstage/plugin-techdocs-cli": "^0.1.1-alpha.9",
"@backstage/plugin-welcome": "^0.1.1-alpha.9",
"@backstage/test-utils": "^0.1.1-alpha.9",
"@backstage/theme": "^0.1.1-alpha.9",
diff --git a/packages/app/src/plugins.ts b/packages/app/src/plugins.ts
index 05373d7d96..93935a92b9 100644
--- a/packages/app/src/plugins.ts
+++ b/packages/app/src/plugins.ts
@@ -24,3 +24,4 @@ export { plugin as RegisterComponent } from '@backstage/plugin-register-componen
export { plugin as Sentry } from '@backstage/plugin-sentry';
export { plugin as GitopsProfiles } from '@backstage/plugin-gitops-profiles';
export { plugin as TechDocs } from '@backstage/plugin-techdocs';
+export { plugin as TechdocsCli } from '@backstage/plugin-techdocs-cli';
diff --git a/plugins/techdocs-cli/.eslintrc.js b/plugins/techdocs-cli/.eslintrc.js
new file mode 100644
index 0000000000..13573efa9c
--- /dev/null
+++ b/plugins/techdocs-cli/.eslintrc.js
@@ -0,0 +1,3 @@
+module.exports = {
+ extends: [require.resolve('@backstage/cli/config/eslint')],
+};
diff --git a/plugins/techdocs-cli/README.md b/plugins/techdocs-cli/README.md
new file mode 100644
index 0000000000..f4b9534bfa
--- /dev/null
+++ b/plugins/techdocs-cli/README.md
@@ -0,0 +1,13 @@
+# techdocs-cli
+
+Welcome to the techdocs-cli plugin!
+
+_This plugin was created through the Backstage CLI_
+
+## Getting started
+
+Your plugin has been added to the example app in this repository, meaning you'll be able to access it by running `yarn start` in the root directory, and then navigating to [/techdocs-cli](http://localhost:3000/techdocs-cli).
+
+You can also serve the plugin in isolation by running `yarn start` in the plugin directory.
+This method of serving the plugin provides quicker iteration speed and a faster startup and hot reloads.
+It is only meant for local development, and the setup for it can be found inside the [/dev](/dev) directory.
diff --git a/plugins/techdocs-cli/dev/index.tsx b/plugins/techdocs-cli/dev/index.tsx
new file mode 100644
index 0000000000..812a5585d4
--- /dev/null
+++ b/plugins/techdocs-cli/dev/index.tsx
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2020 Spotify AB
+ *
+ * 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 { createDevApp } from '@backstage/dev-utils';
+import { plugin } from '../src/plugin';
+
+createDevApp().registerPlugin(plugin).render();
diff --git a/plugins/techdocs-cli/package.json b/plugins/techdocs-cli/package.json
new file mode 100644
index 0000000000..e4f9b198e0
--- /dev/null
+++ b/plugins/techdocs-cli/package.json
@@ -0,0 +1,47 @@
+{
+ "name": "@backstage/plugin-techdocs-cli",
+ "version": "0.1.1-alpha.9",
+ "main": "src/index.ts",
+ "types": "src/index.ts",
+ "license": "Apache-2.0",
+ "private": true,
+ "publishConfig": {
+ "access": "public",
+ "main": "dist/index.esm.js",
+ "types": "dist/index.d.ts"
+ },
+ "scripts": {
+ "build": "backstage-cli plugin:build",
+ "start": "backstage-cli plugin:serve",
+ "lint": "backstage-cli lint",
+ "test": "backstage-cli test",
+ "diff": "backstage-cli plugin:diff",
+ "prepack": "backstage-cli prepack",
+ "postpack": "backstage-cli postpack",
+ "clean": "backstage-cli clean"
+ },
+ "dependencies": {
+ "@backstage/core": "^0.1.1-alpha.9",
+ "@backstage/theme": "^0.1.1-alpha.9",
+ "@material-ui/core": "^4.9.1",
+ "@material-ui/icons": "^4.9.1",
+ "@material-ui/lab": "4.0.0-alpha.45",
+ "react": "^16.13.1",
+ "react-dom": "^16.13.1",
+ "react-use": "^14.2.0"
+ },
+ "devDependencies": {
+ "@backstage/cli": "^0.1.1-alpha.9",
+ "@backstage/dev-utils": "^0.1.1-alpha.9",
+ "@testing-library/jest-dom": "^5.7.0",
+ "@testing-library/react": "^9.3.2",
+ "@testing-library/user-event": "^10.2.4",
+ "@types/jest": "^25.2.2",
+ "@types/node": "^12.0.0",
+ "@types/testing-library__jest-dom": "^5.0.4",
+ "jest-fetch-mock": "^3.0.3"
+ },
+ "files": [
+ "dist/**/*.{js,d.ts}"
+ ]
+}
diff --git a/plugins/techdocs-cli/src/components/ExampleComponent/ExampleComponent.test.tsx b/plugins/techdocs-cli/src/components/ExampleComponent/ExampleComponent.test.tsx
new file mode 100644
index 0000000000..8a565efcff
--- /dev/null
+++ b/plugins/techdocs-cli/src/components/ExampleComponent/ExampleComponent.test.tsx
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2020 Spotify AB
+ *
+ * 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 React from 'react';
+import { render } from '@testing-library/react';
+import mockFetch from 'jest-fetch-mock';
+import ExampleComponent from './ExampleComponent';
+import { ThemeProvider } from '@material-ui/core';
+import { lightTheme } from '@backstage/theme';
+
+describe('ExampleComponent', () => {
+ it('should render', () => {
+ mockFetch.mockResponse(() => new Promise(() => {}));
+ const rendered = render(
+
+
+ ,
+ );
+ expect(rendered.getByText('Welcome to techdocs-cli!')).toBeInTheDocument();
+ });
+});
diff --git a/plugins/techdocs-cli/src/components/ExampleComponent/ExampleComponent.tsx b/plugins/techdocs-cli/src/components/ExampleComponent/ExampleComponent.tsx
new file mode 100644
index 0000000000..7aca7453d6
--- /dev/null
+++ b/plugins/techdocs-cli/src/components/ExampleComponent/ExampleComponent.tsx
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2020 Spotify AB
+ *
+ * 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 React, { FC } from 'react';
+import { Typography, Grid } from '@material-ui/core';
+import {
+ InfoCard,
+ Header,
+ Page,
+ pageTheme,
+ Content,
+ ContentHeader,
+ HeaderLabel,
+ SupportButton,
+} from '@backstage/core';
+import ExampleFetchComponent from '../ExampleFetchComponent';
+
+const ExampleComponent: FC<{}> = () => (
+
+
+
+
+ A description of your plugin goes here.
+
+
+
+
+
+ All content should be wrapped in a card like this.
+
+
+
+
+
+
+
+
+
+);
+
+export default ExampleComponent;
diff --git a/plugins/techdocs-cli/src/components/ExampleComponent/index.ts b/plugins/techdocs-cli/src/components/ExampleComponent/index.ts
new file mode 100644
index 0000000000..e785d45082
--- /dev/null
+++ b/plugins/techdocs-cli/src/components/ExampleComponent/index.ts
@@ -0,0 +1,17 @@
+/*
+ * Copyright 2020 Spotify AB
+ *
+ * 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 { default } from './ExampleComponent';
diff --git a/plugins/techdocs-cli/src/components/ExampleFetchComponent/ExampleFetchComponent.test.tsx b/plugins/techdocs-cli/src/components/ExampleFetchComponent/ExampleFetchComponent.test.tsx
new file mode 100644
index 0000000000..7fecdc6f11
--- /dev/null
+++ b/plugins/techdocs-cli/src/components/ExampleFetchComponent/ExampleFetchComponent.test.tsx
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2020 Spotify AB
+ *
+ * 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 React from 'react';
+import { render } from '@testing-library/react';
+import mockFetch from 'jest-fetch-mock';
+import ExampleFetchComponent from './ExampleFetchComponent';
+
+describe('ExampleFetchComponent', () => {
+ it('should render', async () => {
+ mockFetch.mockResponse(() => new Promise(() => {}));
+ const rendered = render();
+ expect(await rendered.findByTestId('progress')).toBeInTheDocument();
+ });
+});
diff --git a/plugins/techdocs-cli/src/components/ExampleFetchComponent/ExampleFetchComponent.tsx b/plugins/techdocs-cli/src/components/ExampleFetchComponent/ExampleFetchComponent.tsx
new file mode 100644
index 0000000000..c2139befec
--- /dev/null
+++ b/plugins/techdocs-cli/src/components/ExampleFetchComponent/ExampleFetchComponent.tsx
@@ -0,0 +1,108 @@
+/*
+ * Copyright 2020 Spotify AB
+ *
+ * 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 React, { FC } from 'react';
+import { makeStyles } from '@material-ui/core/styles';
+import { Table, TableColumn, Progress } from '@backstage/core';
+import Alert from '@material-ui/lab/Alert';
+import { useAsync } from 'react-use';
+
+const useStyles = makeStyles({
+ avatar: {
+ height: 32,
+ width: 32,
+ borderRadius: '50%',
+ },
+});
+
+type User = {
+ gender: string; // "male"
+ name: {
+ title: string; // "Mr",
+ first: string; // "Duane",
+ last: string; // "Reed"
+ };
+ location: object; // {street: {number: 5060, name: "Hickory Creek Dr"}, city: "Albany", state: "New South Wales",…}
+ email: string; // "duane.reed@example.com"
+ login: object; // {uuid: "4b785022-9a23-4ab9-8a23-cb3fb43969a9", username: "blackdog796", password: "patch",…}
+ dob: object; // {date: "1983-06-22T12:30:23.016Z", age: 37}
+ registered: object; // {date: "2006-06-13T18:48:28.037Z", age: 14}
+ phone: string; // "07-2154-5651"
+ cell: string; // "0405-592-879"
+ id: {
+ name: string; // "TFN",
+ value: string; // "796260432"
+ };
+ picture: { medium: string }; // {medium: "https://randomuser.me/api/portraits/men/95.jpg",…}
+ nat: string; // "AU"
+};
+
+type DenseTableProps = {
+ users: User[];
+};
+
+export const DenseTable: FC = ({ users }) => {
+ const classes = useStyles();
+
+ const columns: TableColumn[] = [
+ { title: 'Avatar', field: 'avatar' },
+ { title: 'Name', field: 'name' },
+ { title: 'Email', field: 'email' },
+ { title: 'Nationality', field: 'nationality' },
+ ];
+
+ const data = users.map(user => {
+ return {
+ avatar: (
+
+ ),
+ name: `${user.name.first} ${user.name.last}`,
+ email: user.email,
+ nationality: user.nat,
+ };
+ });
+
+ return (
+
+ );
+};
+
+const ExampleFetchComponent: FC<{}> = () => {
+ const { value, loading, error } = useAsync(async (): Promise => {
+ const response = await fetch('https://randomuser.me/api/?results=20');
+ const data = await response.json();
+ return data.results;
+ }, []);
+
+ if (loading) {
+ return ;
+ } else if (error) {
+ return {error.message};
+ }
+
+ return ;
+};
+
+export default ExampleFetchComponent;
diff --git a/plugins/techdocs-cli/src/components/ExampleFetchComponent/index.ts b/plugins/techdocs-cli/src/components/ExampleFetchComponent/index.ts
new file mode 100644
index 0000000000..28482f9fe1
--- /dev/null
+++ b/plugins/techdocs-cli/src/components/ExampleFetchComponent/index.ts
@@ -0,0 +1,17 @@
+/*
+ * Copyright 2020 Spotify AB
+ *
+ * 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 { default } from './ExampleFetchComponent';
diff --git a/plugins/techdocs-cli/src/index.ts b/plugins/techdocs-cli/src/index.ts
new file mode 100644
index 0000000000..3a0a0fe2d3
--- /dev/null
+++ b/plugins/techdocs-cli/src/index.ts
@@ -0,0 +1,17 @@
+/*
+ * Copyright 2020 Spotify AB
+ *
+ * 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 { plugin } from './plugin';
diff --git a/plugins/techdocs-cli/src/plugin.test.ts b/plugins/techdocs-cli/src/plugin.test.ts
new file mode 100644
index 0000000000..6f385bbe53
--- /dev/null
+++ b/plugins/techdocs-cli/src/plugin.test.ts
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2020 Spotify AB
+ *
+ * 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 { plugin } from './plugin';
+
+describe('techdocs-cli', () => {
+ it('should export plugin', () => {
+ expect(plugin).toBeDefined();
+ });
+});
diff --git a/plugins/techdocs-cli/src/plugin.ts b/plugins/techdocs-cli/src/plugin.ts
new file mode 100644
index 0000000000..fcba712d9f
--- /dev/null
+++ b/plugins/techdocs-cli/src/plugin.ts
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2020 Spotify AB
+ *
+ * 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.
+ */
+/*
+ * Copyright 2020 Spotify AB
+ *
+ * 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 { createPlugin, createRouteRef } from '@backstage/core';
+import ExampleComponent from './components/ExampleComponent';
+
+export const rootRouteRef = createRouteRef({
+ path: '/techdocs-cli',
+ title: 'techdocs-cli',
+});
+
+export const plugin = createPlugin({
+ id: 'techdocs-cli',
+ register({ router }) {
+ router.addRoute(rootRouteRef, ExampleComponent);
+ },
+});
diff --git a/plugins/techdocs-cli/src/setupTests.ts b/plugins/techdocs-cli/src/setupTests.ts
new file mode 100644
index 0000000000..e34bc46f4b
--- /dev/null
+++ b/plugins/techdocs-cli/src/setupTests.ts
@@ -0,0 +1,18 @@
+/*
+ * Copyright 2020 Spotify AB
+ *
+ * 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 '@testing-library/jest-dom';
+require('jest-fetch-mock').enableMocks();