From ee5f49b7a24607e88be3b75ed3209016c185db4e Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Fri, 7 Feb 2020 11:55:26 +0100 Subject: [PATCH 1/4] added Makefile --- Makefile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000..74d4b0ac8e --- /dev/null +++ b/Makefile @@ -0,0 +1,18 @@ +### +# All-in-one build command. +### +build: build-protocol-definitions + +### +# Protobuf Definitions. +# This will generate Protobuf definitions from ./proto to both Go and JS/TypeScript. +### +build-protocol-definitions: + prototool generate ${PWD}/proto + +### +# Create new frontend plugin. +# This will run Cookiecutter to generate a new Backstage frontend plugin. +### +scaffold-new-frontend-plugin: + ${PWD}/tools/cookiecutter/init.sh frontend/packages/plugins/_template --output-dir frontend/packages/plugins \ No newline at end of file From 707264a9b11799af0caa6a7c48af78fef1fc6392 Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Fri, 7 Feb 2020 11:55:37 +0100 Subject: [PATCH 2/4] Updated root README docs --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7a8c78ecf4..6852f90d3e 100644 --- a/README.md +++ b/README.md @@ -10,10 +10,10 @@ Backstage is an open platform for building developer portals. ### Protobuf Definitions -To generate the Protobuf definitions in Go and TypeScript, run the following command from the root with [Prototool](https://github.com/uber/prototool): +To generate the Protobuf definitions in Go and TypeScript, run the following command from the root to run [Prototool](https://github.com/uber/prototool): ```bash -$ prototool generate ./proto +$ make build-protocol-definitions ``` See [proto/README.md](proto/README.md) for more information. @@ -25,13 +25,13 @@ See [proto/README.md](proto/README.md) for more information. Run the following: ```bash -$ ./tools/cookiecutter/init.sh frontend/packages/plugins/_template --output-dir frontend/packages/plugins +$ make scaffold-new-frontend-plugin ``` This will generate a plugin in the `frontend/packages/plugins` folder. It is important to note you will still need to include the plugin in your `frontend/packages/app` in the `package.json`. You will then be able to import it as follows: ```bash -$ ./tools/cookiecutter/init.sh frontend/packages/plugins/_template --output-dir frontend/packages/plugins +$ make scaffold-new-frontend-plugin plugin_name [example-plugin]: github-api $ vim frontend/packages/app/package.json From 1c094efd25d739c0cf14254469beeea0e474c7e0 Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Fri, 7 Feb 2020 11:57:30 +0100 Subject: [PATCH 3/4] Added yarn install to make build --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 74d4b0ac8e..d57844d601 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,13 @@ ### # All-in-one build command. ### -build: build-protocol-definitions +build: build-yarn-dependencies build-protocol-definitions + +### +# Download dependencies from the Frontend using Yarn. +### +build-yarn-dependencies: + yarn --cwd ${PWD}/frontend install ### # Protobuf Definitions. From 61ef0d341efdc15ecd12e8872248395d8ab9570a Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Fri, 7 Feb 2020 12:00:26 +0100 Subject: [PATCH 4/4] insert final newline --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d57844d601..cee6d132cf 100644 --- a/Makefile +++ b/Makefile @@ -21,4 +21,4 @@ build-protocol-definitions: # This will run Cookiecutter to generate a new Backstage frontend plugin. ### scaffold-new-frontend-plugin: - ${PWD}/tools/cookiecutter/init.sh frontend/packages/plugins/_template --output-dir frontend/packages/plugins \ No newline at end of file + ${PWD}/tools/cookiecutter/init.sh frontend/packages/plugins/_template --output-dir frontend/packages/plugins