You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+40Lines changed: 40 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -101,3 +101,43 @@ Install golint. (see https://github.com/golang/lint)
101
101
102
102
The explorer uses Highsoft charts which are not free for commercial and governmental use. If you plan to use the explorer for commercial purposes you currently need to purchase an appropriate HighSoft license.
103
103
We are planning to switch out the Highsoft chart library with a less restrictive charting library (suggestions are welcome).
104
+
105
+
106
+
# TypeScript development
107
+
TypeScript development support is provided via esbuild. The existing build pipeline and project structure is mostly unchanged; TypeScript files are compiled to JavaScript files which are then picked up by the existing build pipeline.
108
+
Bundling is done by esbuild via the Go server (no Node build step required).
109
+
110
+
### Guidelines
111
+
- Place feature code under `static/<feature>/` with a small entry module (e.g., `<feature>.entry.ts`), then reference the emitted JS from the template.
112
+
- You may separate the code in different files, only `.entry.ts` files are compiled.
113
+
- Templates load ESM bundles via `<script type="module" src="/js/.../<feature>.entry.js"></script>`.
114
+
- If you add a new `<feature>.entry.ts`, restart the server so esbuild picks it up.
115
+
116
+
#### Compiling + Watch + sourcemaps
117
+
Install first `npm` dependencies:
118
+
```bash
119
+
npm install
120
+
```
121
+
To compile TS files, run:
122
+
```bash
123
+
go run ./cmd/bundle -compile-ts
124
+
```
125
+
For continuous rebuilding while editing TypeScript:
126
+
```bash
127
+
go run ./cmd/bundle -watch-ts
128
+
```
129
+
to enable sourcemaps during development, run with the `-ts-sourcemap` flag:
130
+
```bash
131
+
go run ./cmd/bundle -watch-ts -ts-sourcemap
132
+
```
133
+
-`-compile-ts` compiles all `.entry.ts` files once.
134
+
-`-watch-ts` enables incremental rebuilds on file change.
135
+
-`-ts-sourcemap` emits sourcemaps so DevTools shows original `.ts` sources. Use external maps for prod-like dev; inline maps are fine for quick local debugging.
- Make sure to run: `npm install` in order to install ambient types so you get IntelliSense on globals: @types/jquery, @types/bootstrap, @types/datatables.net
139
+
- You can use $ / jQuery, bootstrap namespace, and DataTables without imports; the editor knows their types.
140
+
- These libraries are considered to be provided as globals by the templates at runtime; do not import them in TS.
141
+
142
+
### Notes
143
+
- No ESLint for TS yet; Solution for now relies on the editor to provide TypeScript diagnostics.
0 commit comments