Skip to content

Commit

Permalink
fix (build): Switch web/ from npm to pnpm (to prepare for buildig web…
Browse files Browse the repository at this point in the history
…/ with Bazel aspect-build/rules_js)
  • Loading branch information
vorburger committed Jan 13, 2025
1 parent 96fcf50 commit 15a7deb
Show file tree
Hide file tree
Showing 7 changed files with 842 additions and 1,200 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ max_line_length = unset
[jbang*]
max_line_length = unset

[pnpm-lock.yaml]
max_line_length = unset

# Note that https://github.com/editorconfig-checker/editorconfig-checker
# which https://github.com/editorconfig-checker/editorconfig-checker.python
# uses does not understand e.g. [{*.yaml,*.yml}] but only single ones.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ repos:
- --use-current-year
- id: insert-license
files: \.(bash|bazel|textproto|ttl|yaml)$
exclude: ^docs/use|test/|.*test.ttl
exclude: ^docs/use|test/|.*test.ttl|pnpm-lock.yaml
args:
- --comment-style
- "#"
Expand Down
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@

# Test expected output should not be formatted
*.expected*

# Leave https://pnpm.io (and our note in NPM for non-use of package-lock.json) alone
web/pnpm-lock.yaml
web/package-lock.json
4 changes: 3 additions & 1 deletion java/dev/enola/web/UI.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ public UI(EnolaServiceBlockingStub service, ThingMetadataProvider metadataProvid
}

public void register(WebHandlers handlers) {
var fixMeToNotBeHardCoded = new File("./web/public/");
// TODO Hard-coding this here like that is non-sense of course... will be fixed later!
// BTW It's ./public/ instead of ./web/public/ only because web/README.md assumes `cd web`.
var fixMeToNotBeHardCoded = new File("./public/");
handlers.register("/wui/", new StaticWebHandler("/wui/", fixMeToNotBeHardCoded));
handlers.register("/ui/static/", new StaticWebHandler("/ui/static/", "static"));
handlers.register("/ui", this);
Expand Down
10 changes: 7 additions & 3 deletions web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,15 @@

## Usage

1. One time `npm install` (TODO: Replace with Bazel...)
1. `cd web/`

1. Regularly `npx tsc && npm run build` (TODO: Integrate better... e.g. using concurrently or npm-run-all?)
1. One time `npm install -g pnpm@latest-10`

1. Start `./enola server --load "models/enola.dev/**.ttl" --httpPort=9090`
1. One time `pnpm install` (TODO: Replace with Bazel...)

1. Regularly `pnpm run tsc && pnpm run build` (TODO: Integrate better... e.g. using concurrently or npm-run-all?)

1. Start `../enola server --load "../models/enola.dev/**.ttl" --httpPort=9090`

1. Open <http://0.0.0.0:9090/wui/index.html>

Expand Down
Loading

0 comments on commit 15a7deb

Please sign in to comment.