Skip to content

Commit 253f9aa

Browse files
committed
godev: move static css and typescript tooling config
Currently, the css and typescript files from cmd/gotelemetry/view are out of scope for formatters and linters installed by npm. Moving the css and typescript config to the root of the repo fixes this issue. Change-Id: I1ddc40050c494a3c7c59707304fa7bf707531bee Reviewed-on: https://go-review.googlesource.com/c/telemetry/+/524195 TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Hyang-Ah Hana Kim <[email protected]> Run-TryBot: Jamal Carvalho <[email protected]>
1 parent 70a3bd2 commit 253f9aa

15 files changed

+42
-47
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

README.md

+41
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,47 @@
22

33
This repository holds the Go Telemetry server code and libraries.
44

5+
## TypeScript Support
6+
7+
TypeScript files served from content directories are transformed into
8+
JavaScript. Reference .ts files in html templates as module code.
9+
10+
`<script type="module" src="/filename.ts">`
11+
12+
## Linting & Formatting
13+
14+
This repository uses [eslint](https://eslint.org/) to format TS files,
15+
[stylelint](https://stylelint.io/) to format CSS files, and
16+
[prettier](https://prettier.io/) to format TS, CSS, Markdown, and YAML files.
17+
18+
See the style guides:
19+
20+
- [TypeScript](https://google.github.io/styleguide/tsguide.html)
21+
- [CSS](https://go.dev/wiki/CSSStyleGuide)
22+
23+
It is encouraged that all TS and CSS code be run through formatters before
24+
submitting a change. However, it is not a strict requirement enforced by CI.
25+
26+
### Installing npm Dependencies:
27+
28+
1. Install [docker](https://docs.docker.com/get-docker/)
29+
2. Run `./npm install`
30+
31+
### Run ESLint, Stylelint, & Prettier
32+
33+
./npm run all
34+
35+
## Third Party
36+
37+
The `third_party` directory was generated with `go run ./devtools/cmd/npmdeps`.
38+
It contains JS packages that are served by the web site. To add or upgrade a new
39+
dependency use the necessary `./npm` command then run
40+
`go run ./devtools/cmd/npmdeps`. Remove unnecessary files from the copy result
41+
where appropriate. For example, `content/localserver/index.html` only depends on
42+
files from `third_party/[email protected]/dist/` so the directory
43+
`third_party/[email protected]/src` can be deleted.
44+
45+
546
## Report Issues / Send Patches
647

748
This repository uses Gerrit for code changes. To learn how to submit changes to

cmd/gotelemetry/internal/view/static/index.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/gotelemetry/internal/view/tsconfig.json

-6
This file was deleted.

godev/README.md

-39
This file was deleted.

godev/npm renamed to npm

File renamed without changes.

godev/npx renamed to npx

File renamed without changes.

godev/package-lock.json renamed to package-lock.json

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)