Commit Graph

5 Commits

Author SHA1 Message Date
Matthew Soulanille
83c8282285 pw_web_ui: Upgrade rules_nodejs to 2.2.0
Upgrade rules_nodejs and associated @bazel rules in package.json to
version 2.2.0.

https: //github.com/bazelbuild/rules_nodejs/releases
Change-Id: I254ac42326ca784f98f82cd751683765c831abc0
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/17900
Reviewed-by: Matthew Soulanille <msoulanille@google.com>
Reviewed-by: Paul Mathieu <paulmathieu@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Pigweed-Auto-Submit: Matthew Soulanille <msoulanille@google.com>
2020-11-04 14:54:17 +00:00
Matthew Soulanille
16bde6b17e pw_web_ui: Add linting with eslint and prettier
Uses gts to run eslint and prettier.gts is Google's TypeScript
formatter (https://github.com/google/gts).

Run `yarn run check` or `yarn run fix` to lint or format the code.
A future CL will add running this linter as a presubmit step.

This CL also formats several project files that weren't linted.

Change-Id: Ibfee61efb0d1f18cbd9aae5e6cb32687e8dce8ac
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/12120
Commit-Queue: Matthew Soulanille <msoulanille@google.com>
Reviewed-by: Matthew Soulanille <msoulanille@google.com>
Reviewed-by: Alexei Frolov <frolv@google.com>
Reviewed-by: Max Koopman <koopman@google.com>
2020-06-25 20:51:30 +00:00
Matthew Soulanille
5e78acfd49 pw_web_ui: Write WebSerialTransport, which talks to the device.
WebSerialTransport connects to devices over WebSerial and implements the
DeviceTransport interface. DeviceTransport defines how raw bytes are
sent to and from connected devices.

Change-Id: Ic6c402036f9d2aaea61e05b1f4c42ccc58349b3d
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/11725
Commit-Queue: Matthew Soulanille <msoulanille@google.com>
Reviewed-by: Max Koopman <koopman@google.com>
Reviewed-by: Alexei Frolov <frolv@google.com>
2020-06-22 21:27:34 +00:00
Matthew Soulanille
070339882e pw_web_ui: Create mocks for testing WebSerial
Node and the browser have different stream APIs. This CL creates mocks for testing web_serial_transport, which uses the browser API.

Change-Id: Ice382bb89b10a2fa23fd4a39f9217e1d0c32a9cd
2020-06-18 03:37:53 +00:00
Matthew Soulanille
376d797a03 Setup pw_web_ui with Bazel and Jasmine
Initialize the pw_web_ui package and add Bazel as a build system. Add a single example test in `src/transport/web_serial_transport_test.ts` to verify Bazel can build and run Jasmine tests.

HAS_TO_BE_LARGE=Initializing a new package. Most of this is due to yarn.lock.

Change-Id: Ie3adbdba5a91de9a5f16205be8077bafb3a1fee3
2020-06-05 16:13:19 +00:00