{"id":21553176,"url":"https://github.com/davidenke/scriptable-workhours-weekly","last_synced_at":"2026-07-18T18:36:48.839Z","repository":{"id":148021260,"uuid":"571438104","full_name":"davidenke/scriptable-workhours-weekly","owner":"davidenke","description":"Weekly Workhours Widget for Scriptable","archived":false,"fork":false,"pushed_at":"2023-01-02T10:33:15.000Z","size":540,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-11T12:14:01.588Z","etag":null,"topics":["mite","scriptable","typescript","workhours"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidenke.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-28T06:02:10.000Z","updated_at":"2024-07-18T12:02:36.000Z","dependencies_parsed_at":"2023-05-28T06:00:17.028Z","dependency_job_id":null,"html_url":"https://github.com/davidenke/scriptable-workhours-weekly","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/davidenke/scriptable-workhours-weekly","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidenke%2Fscriptable-workhours-weekly","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidenke%2Fscriptable-workhours-weekly/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidenke%2Fscriptable-workhours-weekly/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidenke%2Fscriptable-workhours-weekly/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidenke","download_url":"https://codeload.github.com/davidenke/scriptable-workhours-weekly/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidenke%2Fscriptable-workhours-weekly/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35627692,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-18T02:00:07.223Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mite","scriptable","typescript","workhours"],"created_at":"2024-11-24T07:09:44.252Z","updated_at":"2026-07-18T18:36:48.833Z","avatar_url":"https://github.com/davidenke.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Scriptable Workhours Weekly\n\n![image](https://raw.githubusercontent.com/davidenke/scriptable-workhours-weekly/main/screenshots/homescreen.jpg)\n![image](https://raw.githubusercontent.com/davidenke/scriptable-workhours-weekly/main/screenshots/lockscreen.jpg)\n\nThis package contains some Widgets to be used in the georgeous [Scriptable](https://scriptable.app) app for iOS.\nIt is a simple UI to show **your workhours from [Mite](https://mite.yo.lk)** using [its API](https://mite.yo.lk/en/api/).\n\nTo give the 🦄 some 🍫 this is based on [Typescript](https://www.typescriptlang.org/), is build using [esbuild](https://esbuild.github.io/) and is tested (at least partially) using [jest](https://jestjs.io/).\n\n![image](https://raw.githubusercontent.com/davidenke/scriptable-workhours-weekly/main/screenshots/proudof.jpg)\n\nFor now this package contains these Widgets:\n\n- **Workhours Lockscreen** - Shows the workhours of the current week in a small Widget with the circle as big as possible on the Lockscreen\n- **Workhours Single** - A single Widget to show workhours of the current week with a label on the Homescreen\n- **Workhours Triple** - Shows three stats as medium Widget on the Homescreen, current week, last week and today\n\n![image](https://raw.githubusercontent.com/davidenke/scriptable-workhours-weekly/main/screenshots/available-widgets.jpg)\n\n## Installation\n\n### Prerequisites\n\nUse the correct Node version, as defined in [.nvmrc](.nvmrc). I highly recommend to use Node Version Manager (for Unix it's [nvm](https://github.com/nvm-sh/nvm), on Windows it's [nvm-windows](https://github.com/coreybutler/nvm-windows)).\n\nOn macOS / Linux simply run `nvm use` in the root of this project.\n\nUnfortunatly on Windows reading the `.nvmrc` is [not supported](https://github.com/coreybutler/nvm-windows/wiki/Common-Issues#why-isnt-nvmrc-supported-why-arent-some-nvm-for-macoslinux-features-supported), so you either have to manually type the correct [Node version](.nvmrc) or use the PowerShell with something like `iex \"nvm use $(cat .nvmrc)\"`.\n\n### Install dependencies\n\nJust run `npm install` in the root of this project.\n\n## Build\n\nTo build the Widgets run `npm run build` in the root of this project and have a look at the [dist](dist) folder.\n\nThe [output](dist) then contains the Widgets as `*.scriptable` files, which can be simply opened and used in Scriptable. Additionally the scripts themselves are also available as `*.js` files.\n\n## Configuration\n\nOnce installed and configured as Widget, you have to provide two essential properties, using the \"Parameter\" field in the Widget configuration. The configuration must be provided as **valid JSON** for the time being (until I come up with a better solution).\n\n\u003e All currently available properties can be found as `WidgetParameters` type in the [src/utils/auxiliary.utils.ts](src/utils/auxiliary.utils.ts).\n\n| Property     | Description                                                                                                                                                |          | Default |\n| :----------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------- | :------: | :-----: |\n| `context`    | The Mite context (or subdomain if you will) to be used                                                                                                     | required |         |\n| `token`      | The Mite API token which can be generated in your Mite account                                                                                             | required |         |\n| `hours`      | The number of hours you work per week                                                                                                                      | optional |  `40`   |\n| `collapse`   | Tries to narrow down spacing and remove backgrounds to make the content appear as big as possible within the Widget. Meant to be used for Lockscreen usage | optional | `false` |\n| `hideLabels` | Hides the labels below the stats (not the labels inside the cirlces)                                                                                       | optional | `false` |\n\nSo a sample configuration could look like this:\n\n```json\n{ \"context\": \"mycompany\", \"token\": \"somegeneratedtoken\", \"hours\": 35, \"hideLabels\": true }\n```\n\n![image](https://raw.githubusercontent.com/davidenke/scriptable-workhours-weekly/main/screenshots/configure-widget.jpg)\n\n---\n\n## Some notes about the stack\n\n\u003e First of all a big shoutout to [Simon Støvring](https://github.com/simonbs) for the fantastic (and free!) [Scriptable App](https://scriptable.app).\n\n### Global types for Scriptable\n\nTo gain the benefits of typed JS I needed to provide typings for the [Scriptable API](https://docs.scriptable.app).\n\nAfter manully declaring some of the types, I decided to generate them from this API in some way, and found out that one of the example Widgets already uses the documentation in a JSON form, which is [provided seprately](https://docs.scriptable.app/scriptable.json).\n\nSo I came up with a simple parser for the (I guess) MkDocs format, which I tracked in a [separate repository](https://github.com/davidenke/mkdocs-ts). This CLI tool is run after postinstall and generates the typings in [src/scriptable.d.ts](src/scriptable.d.ts), but could also be run directly with\n\n```bash\nnpx mkdocs-ts https://docs.scriptable.app/scriptable.json src/scriptable.d.ts\n```\n\nor in this package with `npm run generate:types`.\n\n### Colors\n\nFor convenience I derived the official colors available from the [Apple UI guidelines](https://developer.apple.com/design/human-interface-guidelines/foundations/color/#specifications) and added them along with some utility functions to [src/utils/colors.utils.ts](src/utils/colors.utils.ts).\n\nSo dependend of the device theme and platform, the correct color can be used with e.g. `getSystemColor('red')`. The available colors are typed, of cause.\n\n### I18n\n\nA simple translation mechanism is available using a [JSON translations file](src/translations.json) and some tooling in [src/utils/i18n.utils.ts](src/utils/i18n.utils.ts).\n\nDependend on the device language, the correct translation can be used with e.g. `i18n('LABEL.TODAY')`. The available translations keys are typed as well, as they're derived from the JSON.\n\n### Bundling `*.scriptable` package files\n\nFor convenience, the Widgets are additionally packaged into `*.scriptable` files, which can be directly opened in Scriptable.\n\nThis is done with a custom [esbuild plugin](tools/esbuild-plugin-scriptable.ts). This plugin is consumed in the [esbuild.config.ts](esbuild.config.ts) and can be configured with a `scriptfile` path (relative to the root of the project) and a `package` property which can either be a path to a JSON file, or an inline object providing the package meta data.\n\nAs this is typed, the plugin options can be found as `ScriptablePluginOptions` and the package meta data format as `ScriptableMetadata` types in [tools/esbuild-plugin-scriptable.ts](tools/esbuild-plugin-scriptable.ts).\n\n\u003e This plugin may be split out in a separate package in the future. If you're interested in this, please let me know.\n\n### Runtime configuration\n\nSee. [Configuration](#configuration) or [src/utils/auxiliary.utils.ts](src/utils/auxiliary.utils.ts).\n\n### Stats as circles\n\nFor KPIs, as the fancy project owner would call them.\n\nAs the Scriptable API exposes the posibility to paint in a draw context, one has nearly everything we need to draw stuff like in Canvas or SVG.\n\nHave a look on the `createProgressCircle` function at [src/views/progress-circle.view.ts](src/views/progress-circle.view.ts) to see how this is done.\n\n---\n\n\u0026copy; 2022 - _Created at 🌙 with ❤️ and 🍺 by [David Enke](https://github.com/davidenke)._\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidenke%2Fscriptable-workhours-weekly","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidenke%2Fscriptable-workhours-weekly","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidenke%2Fscriptable-workhours-weekly/lists"}