New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@first-lego-league/clock

Package Overview
Dependencies
Maintainers
5
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@first-lego-league/clock

Clock for

  • 3.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
5
Created
Source

npm codecov Build status GitHub

Clock

Web based application showing the FLL match timer. Works in the latest versions of chrome, firefox and internet explorer

Mhub events

The clock creates to the following mhub messages (on the protected node)

TopicFired OnData
clock:startFired when the countdown is starting to run
clock:stopFired when a countdown have stop in the middle
clock:endFired at the end of the countdown
clock:reloadFired when the clock is reset the time
clock:timeFired each second during the countdownSeconds to end of the countdown

Using the Clock API

In order to use the API, you first need to get an authenticity token. You can get this by sending an authentication request to the Identity Provider module (AKA IdP). It runs on the server computer, typically listening on port 2030.

Send a request: POST idp-endpoint/login?callbackUrl=url with the body { username: admin, password: your-admin-password }

You will receive a 304 Redirect with set-cookie header that contains the auth token. You can use that. Once you have the authenticity token, you send it as a header in each request you make.

The timer API has four actions:

  • POST timer-endpoint/action/start - will start the timer, only if it isn't running already. If the timer is running it will return 400 Bad Request.
  • POST timer-endpoint/action/stop - will stop the timer, only if it's running. If the timer isn't running it will return 400 Bad Request.
  • POST timer-endpoint/action/reload- will set the timer back to 2:30, only if it's done running. If the timer isn't done running it will return 400 Bad Request.

Publishing to NPM

When you want to publish to npm, run the command yarn publish. First you will be asked to enter a new version to publish. Following that the build script will run the packing stage (prepack).

Note: Publish from a version branch (e.g. v2.2.3) so that you can do a PR.

$ yarn publish
yarn publish v1.12.1
[1/4] Bumping version...
info Current version: 2.2.2
question New version: 2.2.3
info New version: 2.2.3
[2/4] Logging in...
[3/4] Publishing...
$ webpack --mode production --config webpack.prod.js
.....
success Published.
[4/4] Revoking token...
info Not revoking login token, specified via config file.
Done in 140.79s.

Adding new version to the launcher

To include your update in the launcher build, update the clock version in launcher/dev-scripts/config-get.js.

Warning: Warning:
Prior to version 1.9.0, Yarn has a bug with using the .npmignore file correctly. Therefore make sure your Yarn version is 1.9.0 or later. If not, either upgrade your yarn or use the command npm publish instead.

FAQs

Package last updated on 19 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc