Skip to main content

Getting Started

Before committing your code, please run the following checks locally in order to give ourselves better confidence that the code will pass the automated checks online:

  1. Prettier our code:

    npx prettier --write .
  2. Check code style using ESLint:

    npx eslint .
    caution

    ESLint currently does not run on documentation source codes, i.e. /docs

  3. Run all tests

    npm test

Available Scripts

Install Dependencies

cd Messier-61
npm install

Start Messier-61 Locally

npm start

Runs the app in the development mode. Open http://localhost:8080 to view it in the browser.

The page will reload if you make edits. You will also see any lint errors in the console.

Running Tests

npm test

Build Production Bundle

npm run build

Builds the app for production to the build folder. It correctly bundles React in production mode and optimizes the build for the best performance. The build is minified and the filenames include the hashes.

Writing TypeDoc

The Messier-61 API page was automatically generated by TypeDoc, which parses the inline documentation of Messier-61 source code. To generated them locally

cd docs
yarn typedoc
info

TypeDoc processes all source files under Messier-61/packages/ except for the following

  • Test files (*.test.*)
  • Messier-61/packages/messier-61-app/messier-61-env.d.ts
  • Messier-61/packages/messier-61-app/setupTests.ts

We can have TypeDoc watch for changes from the command line by using

yarn typedoc-watch

Troubleshooting

CI check for Markdown link (markdown-link-check) is turned on and it's not smart enough to detect relative linking by Docusaurus. The workaround is to disable the link check at the relevant line. For example:

<!-- markdown-link-check-disable -->
known. Additionally, this process makes it easy to implement a [blue-green deployment](continuous-delivery) or
<!-- markdown-link-check-enable -->

ESLint Reports False-Negative

Suppose we have the following TypeScript code

node.radius + 25;

but ESLint complains that

error  Operands of '+' operation with any is possible only with string, number, bigint or any  @typescript-eslint/restrict-plus-operands

And we are sure that node.radius by definition is a number. This could happend due to the incorrect import, which results node type not properly imported. As a result, TypeScript sees node.radius as to type any because it doesn't know what type node is