tree: 170514a1e7d9e14410c252f63024cf029f2fd184 [path history] [tgz]
  1. cmd/
  2. content/
  3. devtools/
  4. internal/
  5. third_party/
  6. .eslintignore
  7. .eslintrc.json
  8. .gitignore
  9. .prettierignore
  10. .prettierrc.json
  11. .stylelintrc.json
  12. content.go
  13. go.mod
  14. go.sum
  15. npm
  16. npx
  17. package-lock.json
  18. package.json
  20. tsconfig.json

TypeScript Support

TypeScript files served from content directories are transformed into JavaScript. Reference .ts files in html templates as module code.

<script type="module" src="/filename.ts">

Linting & Formatting

This repository uses eslint to format TS files, stylelint to format CSS files, and prettier to format TS, CSS, Markdown, and YAML files.

See the style guides:

It is encouraged that all TS and CSS code be run through formatters before submitting a change. However, it is not a strict requirement enforced by CI.

Installing npm Dependencies:

  1. Install docker
  2. Run ./npm install

Run ESLint, Stylelint, & Prettier

./npm run all

Third Party

The third_party directory was generated with go run ./devtools/cmd/npmdeps. It contains JS packages that are served by the web site. To add or upgrade a new dependency use the necessary ./npm command then run go run ./devtools/cmd/npmdeps. Remove unnecessary files from the copy result where appropriate. For example, content/localserver/index.html only depends on files from third_party/d3@7.8.4/dist/ so the directory third_party/d3@7.8.4/src can be deleted.