github.com/GoogleCloudPlatform/testgrid@v0.0.174/web/README.md (about) 1 ## TestGrid UI 2 3 [](https://github.com/open-wc) 4 5 Testgrid frontend code uses Lit elements and is written in Typescript. `tsconfig.json` specifies where and how the Typescript will be compiled to Javascript. 6 More info about Lit and Typescript can be found in [Lit docs](https://lit.dev/) and [TS docs](https://www.typescriptlang.org/) respectively. 7 8 ## Development 9 Local development is done with the help of [Web Dev Server](https://modern-web.dev/docs/dev-server/overview/). Web dev server configurations are defined in `web-dev-server-{env}.config.mjs` file. Depending on the config, frontend will render from the data from either fake or prod API. 10 11 To see fake data, run `npm run start:local`. To see prod data, run `npm run start:k8s`. More info in the [Scripts](#scripts) section below. 12 13 ## Testing 14 Testing relies on [Web Test Runner](https://modern-web.dev/docs/test-runner/overview/) with the configuration defined in `web-test-runner.config.mjs`. Testing is currently happening across the fake data provided by `json-server`. 15 16 To run the tests, run `npm run test`. More info in the [Scripts](#scripts) section below. 17 18 ## Scripts 19 20 Most scripts are in `npm run` commands. 21 22 - `start:k8s` runs your app for development, reloading on file changes. Fetches the data from external k8s Testgrid API instance - actual data. 23 - `start:local` runs your app for development, reloading on file changes. Spins up a local `json-server` which serves the data from `src/fake-api/data.json` file, which is then rendered in frontend. 24 - `start:build` runs your app after it has been built using the build command 25 - `build` builds your app and outputs it in your `dist` directory 26 - `test` runs your test suite with Web Test Runner. Relies on the fake data provided by `json-server`. 27 - `lint` runs the linter for your project 28 29 ## Pulling from upstream 30 31 Upstream proto definitions can be generated by running `pb/bump-protos.sh` 32 33 ## Configs and files 34 - Frontend code is located in `src` dir. 35 - Stories for demoing are located in `stories` dir. 36 - Tests are located in `test` dir. 37 - `package.json` defines all the `npm run ...` commands as well as libraries, dependencies and their versions. 38 - `tsconfig.json` defines how and where will the .ts files compile. 39 - `web-dev-server-*.config.mjs` defines configuration parameters for the web dev server. 40 - `web-test-runner.config.mjs` defined configuration parameters for the web test runner. 41 - `rollup.config.js` defines how the code will be built and bundled.