From a44fc6dd5928610dd9335c22e9d75fb370fbf8e9 Mon Sep 17 00:00:00 2001 From: Samantha Dawley Date: Thu, 20 Oct 2022 14:13:36 -0700 Subject: [PATCH] feat: Moving the commands from the devfile to the vscode tasks.json and updating the document accordingly Signed-off-by: Samantha Dawley --- .vscode/tasks.json | 47 ++++++++++++++++++++++++++++++++++++++++++---- CONTRIBUTING.md | 22 +++++++++++----------- devfile.yaml | 37 ------------------------------------ 3 files changed, 54 insertions(+), 52 deletions(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index b86723d48..e17ea055d 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -106,8 +106,8 @@ "group": "build" }, { - "label": "Fix ts lint", - "command": "yarn run lint:fix", + "label": "[Chectl] Build", + "command": "yarn", "type": "shell", "args": [], "problemMatcher": [ @@ -119,8 +119,47 @@ "group": "build" }, { - "label": "Pack binaries", - "command": "yarn run pack-binaries", + "label": "[Chectl] Test", + "command": "yarn test", + "type": "shell", + "args": [], + "problemMatcher": [ + "$tsc" + ], + "presentation": { + "reveal": "always" + }, + "group": "test" + }, + { + "label": "[Chectl] Run", + "command": "./bin/run --help", + "type": "shell", + "args": [], + "problemMatcher": [ + "$tsc" + ], + "presentation": { + "reveal": "always" + }, + "group": "test" + }, + { + "label": "[Chectl] Format Sources", + "command": "yarn lint:fix", + "type": "shell", + "args": [], + "problemMatcher": [ + "$tsc" + ], + "presentation": { + "reveal": "always" + }, + "group": "build" + }, + { + "label": "[Chectl] Pack Binaries", + "command": "yarn pack-binaries", "type": "shell", "args": [], "problemMatcher": [ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 67974f9b0..6b75e115b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -26,14 +26,14 @@ After starting the workspace, Che will clone sources of `chectl` to the `/projec `chectl` is written in TypeScript. For its development, there is a dedicated `dev` container that has preinstalled software for comfortable development. This allows the developer to build, test, and launch `chectl` inside the container. -Your workspace will be initialized with a list of commands described in the [devfile](devfile.yaml) `commands` section. The commands are: -- build -- test -- run -- package-binaries -- format-sources +Your workspace will be initialized with a list of commands described in the [tasks.json](.vscode/tasks.json) file. The commands are: +- Build +- Test +- Run +- Package Binaries +- Format Sources -You can run commands through the **Terminal** menu by clicking **Terminal => Run Task... => che** and selecting the desired task. +You can run commands through the **Terminal** menu by clicking **Terminal => Run Task... ** and selecting the desired task. ## Build @@ -41,7 +41,7 @@ You can run commands through the **Terminal** menu by clicking **Terminal => Run yarn ``` -Running the `che: build` command will run `yarn` in the `/projects/chectl` directory inside `dev` container. The command will install all necessary dependencies and compile the project. Upon successful assembly, a new `bin` directory will appear in the project directory and will have two files: `run` and `run.cmd`. +Running the `[Chectl] Build` command will run `yarn` in the `/projects/chectl` directory inside `dev` container. The command will install all necessary dependencies and compile the project. Upon successful assembly, a new `bin` directory will appear in the project directory and will have two files: `run` and `run.cmd`. ## Run tests @@ -51,7 +51,7 @@ yarn test ``` Tests for `chectl` are written by using the [jest](https://jestjs.io/docs/getting-started) framework. -To run tests, find and launch the `che: test` command. The command will run `yarn test` inside `dev` container. +To run tests, find and launch the `[Chectl] Test` command. The command will run `yarn test` inside `dev` container. Testing summary will be printed to the output. @@ -61,11 +61,11 @@ Testing summary will be printed to the output. ./bin/run --help ``` -To test ensure `chectl` is built successfully, launch the `che: run` command. It wil run `chectl` with `--help` directive. +To test ensure `chectl` is built successfully, launch the `[Chectl] Run` command. It wil run `chectl` with `--help` directive. ## Package binaries For packaging binaries, [oclif](https://github.com/oclif/dev-cli) is used. It generates packages for Linux, Windows, and MacOS operating systems and puts the result in the `dist/channels/stable` directory. -To start packaging, just run the `che: package-binaries` command. It will run the following in the `/projects/chectl` directory: +To start packaging, just run the `[Chectl] Package Binaries` command. It will run the following in the `/projects/chectl` directory: ```bash yarn oclif-dev pack diff --git a/devfile.yaml b/devfile.yaml index f371c33ad..95b26705a 100644 --- a/devfile.yaml +++ b/devfile.yaml @@ -24,40 +24,3 @@ components: memoryLimit: 5G memoryRequest: 1G -commands: - - id: build - exec: - label: "Install depenedencies and build the app" - component: dev - commandLine: "yarn" - group: - kind: build - - id: test - exec: - label: "Run jest tests" - component: dev - commandLine: "yarn test" - group: - kind: test - - id: run - exec: - label: "Test that the app is working correctly by running with the --help command" - component: dev - commandLine: "./run --help" - workingDir: ${PROJECT_SOURCE}/bin - group: - kind: test - - id: package-binaries - exec: - label: "Package binaries into tarballs" - component: dev - commandLine: "yarn pack-binaries" - group: - kind: build - - id: format-sources - exec: - label: "Run 'yarn lint:fix'" - component: dev - commandLine: "yarn lint:fix" - group: - kind: build