Skip to content

Commit 75e8b76

Browse files
Merge remote-tracking branch 'src/main' into sync
2 parents 8393501 + 8c034f1 commit 75e8b76

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+34697
-0
lines changed

.gitignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
*.pyc
2+
*.swp
3+
*.sublime-project
4+
*.sublime-workspace
5+
*~
6+
/bazel-*
7+
/_artifacts
8+
/_output
9+
node_modules/
10+
.DS_Store
11+
# Files generated by JetBrains IDEs, e.g. IntelliJ IDEA
12+
.idea/
13+
.ijwb/
14+
*.iml
15+
.vscode/*
16+
/vendor/
17+
# profiling outputs
18+
benchmark.test
19+
mem.out
20+
cpu.out
21+
## terraform output
22+
*.tfvars
23+
*.terraform/
24+
prow/oss/terraform/state.tf
25+
*.terraform.lock.hcl

web/.editorconfig

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# editorconfig.org
4+
5+
root = true
6+
7+
8+
[*]
9+
10+
# Change these settings to your own preference
11+
indent_style = space
12+
indent_size = 2
13+
14+
# We recommend you to keep these unchanged
15+
end_of_line = lf
16+
charset = utf-8
17+
trim_trailing_whitespace = true
18+
insert_final_newline = true
19+
20+
[*.md]
21+
trim_trailing_whitespace = false
22+
23+
[*.json]
24+
indent_size = 2
25+
26+
[*.{html,js,md}]
27+
block_comment_start = /**
28+
block_comment = *
29+
block_comment_end = */

web/.eslintignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
## editors
2+
/.idea
3+
/.vscode
4+
5+
## system files
6+
.DS_Store
7+
8+
## npm
9+
/node_modules/
10+
/npm-debug.log
11+
12+
## testing
13+
/coverage/
14+
15+
## temp folders
16+
/.tmp/
17+
18+
# build
19+
/_site/
20+
/dist/
21+
/out-tsc/
22+
23+
storybook-static
24+
custom-elements.json
25+
26+
# generated files
27+
/src/gen/**

web/.gcloudignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.gcloudignore
2+
.git
3+
.gitignore
4+
/node_modules/
5+
/coverage/
6+
/out-tsc/

web/.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
## editors
2+
/.idea
3+
/.vscode
4+
5+
## system files
6+
.DS_Store
7+
8+
## npm
9+
/node_modules/
10+
/npm-debug.log
11+
12+
## testing
13+
/coverage/
14+
15+
## temp folders
16+
/.tmp/
17+
18+
# build
19+
/_site/
20+
/dist/
21+
/out-tsc/
22+
23+
storybook-static

web/.storybook/main.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
stories: ['../**/out-tsc/stories/*.stories.{js,md,mdx}'],
3+
};

web/.storybook/server.mjs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { storybookPlugin } from '@web/dev-server-storybook';
2+
import baseConfig from '../web-dev-server-local.config.mjs';
3+
4+
export default /** @type {import('@web/dev-server').DevServerConfig} */ ({
5+
...baseConfig,
6+
open: '/',
7+
appIndex: null,
8+
plugins: [
9+
storybookPlugin({ type: 'web-components' }),
10+
...baseConfig.plugins,
11+
],
12+
});

web/README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
## TestGrid UI
2+
3+
[![Built with open-wc recommendations](https://img.shields.io/badge/built%20with-open--wc-blue.svg)](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.

web/WORKSPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# TODO(chases2): Build Typescript with Bazel

web/app.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
runtime: python39
2+
3+
handlers:
4+
- url: /
5+
static_files: dist/index.html
6+
upload: dist/index.html
7+
8+
- url: /(.*)
9+
static_files: dist/\1
10+
upload: dist/(.*)

0 commit comments

Comments
 (0)