Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(types): Set up type checking #427

Merged
merged 16 commits into from
Jul 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ jobs:
- name: 'Build web app artifacts'
run: |
npm run build
npm run doc

- uses: actions/upload-artifact@v3
with:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/run-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ jobs:

- run: |
PUBLIC_URL='/farmhand' npm run build
npm run doc

# https://github.com/marketplace/actions/deploy-to-github-pages
- name: Deploy to jeremyckahn.github.io/farmhand
Expand Down
16 changes: 0 additions & 16 deletions .jsdoc

This file was deleted.

1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
- Includes native app downloads for Linux, MacOS and Windows.
- All versioned releases available at [unpkg](https://unpkg.com/browse/@jeremyckahn/farmhand/build/)
- [Wiki](https://github.com/jeremyckahn/farmhand/wiki)
- [Data model documentation](https://jeremyckahn.github.io/farmhand/docs/index.html)
- [API deployment logs](https://farmhand.vercel.app/_logs)

Community links:
Expand Down
26 changes: 26 additions & 0 deletions doc/adr/0005-type-system.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# 5. Type system

Date: 2023-07-23

## Status

Accepted

## Context

Farmhand is implemented with JavaScript. Given the size of the codebase, the dynamic nature of JavaScript creates some ambiguity and confusion during development. A type system helps to mitigate these challenges. The ideal type system solution would be a migration to TypeScript, but that is a significant undertaking that would take an outsize amount of effort to complete and get value from. A more approachable solution is to incorporate [Typed JavaScript](https://depth-first.com/articles/2021/11/03/typed-javascript/). Typed JavaScript can be adopted incrementally and does not introduce new syntaxes or tooling needs.

## Decision

Farmhand will transition to using Typed JavaScript. This transition will take a long time and may never be fully completed, but effort should be made to update preexisting code as it modified. Type violations will not be used to break builds until all type violations have been fixed.

## Consequences

- Code will be more clearly and completely documented
- Data type errors will be more obvious
- Improved support for automated refactoring for editors that support such features
- More verbose code
- Many features of TypeScript are unavailable in Typed JavaScript, such as proper enums and interface extension
- Errors will be shown during development in editors that support Typed JavaScript until the code has been updated to be type safe
- The transition may never be complete
- At will be much easier to transition to TypeScript if the transition to Typed JavaScript is ever completed
28 changes: 0 additions & 28 deletions jsdoc-ts.js

This file was deleted.

Loading
Loading