2020-09-23 20:32:13 +03:00
|
|
|
|
[![Build Status](https://dev.azure.com/aasworldwidetelescope/WWT/_apis/build/status/WorldWideTelescope.wwt-webgl-engine?branchName=cranko)](https://dev.azure.com/aasworldwidetelescope/WWT/_build/latest?definitionId=21&branchName=cranko)
|
2020-10-09 20:23:37 +03:00
|
|
|
|
[![npm](https://img.shields.io/npm/v/@wwtelescope/astro?label=@wwtelescope/astro)](https://www.npmjs.com/package/@wwtelescope/astro)
|
|
|
|
|
[![npm](https://img.shields.io/npm/v/@wwtelescope/embed?label=@wwtelescope/embed)](https://www.npmjs.com/package/@wwtelescope/embed)
|
|
|
|
|
[![npm](https://img.shields.io/npm/v/@wwtelescope/embed-common?label=@wwtelescope/embed-common)](https://www.npmjs.com/package/@wwtelescope/embed-common)
|
|
|
|
|
[![npm](https://img.shields.io/npm/v/@wwtelescope/embed-creator?label=@wwtelescope/embed-creator)](https://www.npmjs.com/package/@wwtelescope/embed-creator)
|
|
|
|
|
[![npm](https://img.shields.io/npm/v/@wwtelescope/engine?label=@wwtelescope/engine)](https://www.npmjs.com/package/@wwtelescope/engine)
|
|
|
|
|
[![npm](https://img.shields.io/npm/v/@wwtelescope/engine-helpers?label=@wwtelescope/engine-helpers)](https://www.npmjs.com/package/@wwtelescope/engine-helpers)
|
|
|
|
|
[![npm](https://img.shields.io/npm/v/@wwtelescope/engine-types?label=@wwtelescope/engine-types)](https://www.npmjs.com/package/@wwtelescope/engine-types)
|
2022-11-10 22:34:31 +03:00
|
|
|
|
[![npm](https://img.shields.io/npm/v/@wwtelescope/engine-pinia?label=@wwtelescope/engine-pinia)](https://www.npmjs.com/package/@wwtelescope/engine-pinia)
|
2021-02-16 00:10:42 +03:00
|
|
|
|
[![npm](https://img.shields.io/npm/v/@wwtelescope/research-app?label=@wwtelescope/research-app)](https://www.npmjs.com/package/@wwtelescope/research-app)
|
|
|
|
|
[![npm](https://img.shields.io/npm/v/@wwtelescope/research-app-messages?label=@wwtelescope/research-app-messages)](https://www.npmjs.com/package/@wwtelescope/research-app-messages)
|
2023-06-06 04:49:41 +03:00
|
|
|
|
[![Powered by NumFOCUS](https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A)](http://numfocus.org)
|
2020-04-01 23:12:55 +03:00
|
|
|
|
|
2023-06-06 04:52:01 +03:00
|
|
|
|
# The WorldWide Telescope WebGL engine
|
2019-12-31 03:54:54 +03:00
|
|
|
|
|
2023-06-06 04:52:01 +03:00
|
|
|
|
The “WebGL engine” of the [WorldWide Telescope][wwt-home] (WWT) is a
|
2020-05-03 22:48:47 +03:00
|
|
|
|
JavaScript/[TypeScript] framework that powers the Web-based versions of the WWT
|
|
|
|
|
visualization software, as exemplified by the [WWT web client][webclient].
|
2019-12-31 03:54:54 +03:00
|
|
|
|
|
2020-04-26 23:11:53 +03:00
|
|
|
|
Learn more about WWT [here][wwt-home].
|
2019-12-31 03:54:54 +03:00
|
|
|
|
|
2020-04-26 23:11:53 +03:00
|
|
|
|
[TypeScript]: https://www.typescriptlang.org/
|
|
|
|
|
[wwt-home]: https://worldwidetelescope.org/home/
|
|
|
|
|
[webclient]: https://worldwidetelescope.org/webclient/
|
2019-12-31 03:54:54 +03:00
|
|
|
|
|
2023-06-06 04:49:41 +03:00
|
|
|
|
[//]: # (numfocus-fiscal-sponsor-attribution)
|
|
|
|
|
|
|
|
|
|
The WorldWide Telescope project uses an [open governance
|
|
|
|
|
model](https://worldwidetelescope.org/about/governance/) and is fiscally
|
|
|
|
|
sponsored by [NumFOCUS](https://numfocus.org/). Consider making a
|
|
|
|
|
[tax-deductible donation](https://numfocus.org/donate-for-worldwide-telescope)
|
|
|
|
|
to help the project pay for developer time, professional services, travel,
|
|
|
|
|
workshops, and a variety of other needs.
|
|
|
|
|
|
|
|
|
|
<div align="center">
|
|
|
|
|
<a href="https://numfocus.org/donate-for-worldwide-telescope">
|
|
|
|
|
<img height="60px"
|
|
|
|
|
src="https://raw.githubusercontent.com/numfocus/templates/master/images/numfocus-logo.png">
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
2019-12-31 03:54:54 +03:00
|
|
|
|
|
2020-05-03 22:48:47 +03:00
|
|
|
|
## Developers’ quick start
|
|
|
|
|
|
2022-11-29 21:56:50 +03:00
|
|
|
|
1. Check out this repository to a machine with [Node.js] and [Yarn].
|
2023-09-15 18:43:52 +03:00
|
|
|
|
1. Builds with versions of Node.js around 18.17 may fail with [an Invalid URL
|
|
|
|
|
error](https://github.com/nodejs/node/issues/48855).
|
|
|
|
|
1. There have also been reports of builds that hang on Linux with Node 20.x.
|
2020-05-03 22:48:47 +03:00
|
|
|
|
1. `git submodule update --init`
|
2022-11-29 21:56:50 +03:00
|
|
|
|
1. `yarn install`
|
|
|
|
|
1. `yarn lint` (uses [ESLint])
|
|
|
|
|
1. `yarn build` creates:
|
2020-05-03 22:48:47 +03:00
|
|
|
|
1. The core engine package in the `engine/` package.
|
2022-11-10 22:05:10 +03:00
|
|
|
|
1. The engine tidied up into a [Vue]/[Pinia] module in `engine-pinia/`
|
2020-05-03 22:48:47 +03:00
|
|
|
|
1. The WWT embed app intended for iframe inclusion in `embed/`
|
2021-02-16 00:10:42 +03:00
|
|
|
|
1. The WWT research app in `research-app/`
|
2020-05-03 22:48:47 +03:00
|
|
|
|
1. The user-facing app for creating embed iframe code in `embed-creator/`
|
2021-02-16 00:10:42 +03:00
|
|
|
|
1. Commands to serve the web apps:
|
2022-11-29 21:56:50 +03:00
|
|
|
|
1. `yarn run serve-embed` to serve the embed app
|
|
|
|
|
1. `yarn run serve-research` to serve the research app
|
|
|
|
|
1. `yarn run serve-creator` to serve the embed creator app
|
|
|
|
|
1. `yarn test` (mainly uses [mocha] and [chai]; see also [Integration Testing] below)
|
|
|
|
|
1. `yarn doc` (uses [TypeDoc])
|
2020-05-03 22:48:47 +03:00
|
|
|
|
|
|
|
|
|
[Node.js]: https://nodejs.org/en/
|
2022-11-29 21:56:50 +03:00
|
|
|
|
[Yarn]: https://yarnpkg.com/
|
2020-05-03 22:48:47 +03:00
|
|
|
|
[Vue]: https://vuejs.org/
|
2022-11-10 22:05:10 +03:00
|
|
|
|
[Pinia]: https://pinia.vuejs.org/
|
2020-05-03 22:48:47 +03:00
|
|
|
|
[ESLint]: https://eslint.org/
|
|
|
|
|
[mocha]: https://mochajs.org/
|
|
|
|
|
[chai]: https://www.chaijs.com/
|
2022-11-29 21:56:50 +03:00
|
|
|
|
[Integration Testing]: #integration-testing
|
2020-05-03 22:48:47 +03:00
|
|
|
|
[TypeDoc]: https://typedoc.org/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Repository structure
|
|
|
|
|
|
|
|
|
|
This repository is a [monorepo] containing the source for several interlocking
|
|
|
|
|
TypeScript packages that together comprise the core of the WWT web framework.
|
|
|
|
|
The most important subdirectories are:
|
|
|
|
|
|
|
|
|
|
[monorepo]: https://en.wikipedia.org/wiki/Monorepo
|
|
|
|
|
|
2023-07-11 02:16:59 +03:00
|
|
|
|
- `@wwtelescope/engine` in `engine/`, the core engine code with TypeScript annotations
|
2022-11-15 21:25:40 +03:00
|
|
|
|
- `@wwtelescope/engine-pinia` in `engine-pinia/`, a higher-level package that turns the
|
2022-11-10 22:34:31 +03:00
|
|
|
|
engine into a reusable [Vue]/[Pinia] component
|
2020-05-23 16:56:23 +03:00
|
|
|
|
- `@wwtelescope/embed` in `embed/`, a web application that turns WWT into a
|
2020-05-03 22:48:47 +03:00
|
|
|
|
configurable, embeddable iframe
|
2021-02-16 00:10:42 +03:00
|
|
|
|
- `@wwtelescope/research-app` in `research-app/`, an embeddable web application for
|
|
|
|
|
astrophysics research using WWT.
|
2020-05-03 22:48:47 +03:00
|
|
|
|
- The narrative documentation in `docs/`
|
|
|
|
|
|
|
|
|
|
README files inside the individual subdirectories give more information about
|
|
|
|
|
their contents and development workflows.
|
|
|
|
|
|
2022-11-15 21:25:40 +03:00
|
|
|
|
Previous versions used [Vuex] instead of [Pinia] in the `engine-vuex/`
|
|
|
|
|
subdirectory. That module has been superseded by the Pinia version.
|
|
|
|
|
|
|
|
|
|
[Vuex]: https://vuex.vuejs.org/
|
|
|
|
|
|
2020-05-03 22:48:47 +03:00
|
|
|
|
|
2023-07-11 02:16:59 +03:00
|
|
|
|
## Building the code
|
2020-05-03 22:48:47 +03:00
|
|
|
|
|
2023-07-11 02:16:59 +03:00
|
|
|
|
Code in this repository is built using standard [Node.js]/[Yarn] tooling.
|
2022-11-29 21:56:50 +03:00
|
|
|
|
These tools must be installed before you can do anything else. To set up your
|
|
|
|
|
checkout, follow the instructions in the [Developers’ Quick Start][dqs] above.
|
2020-05-03 22:48:47 +03:00
|
|
|
|
|
2022-11-29 21:56:50 +03:00
|
|
|
|
[dqs]: #developers-quick-start
|
2020-05-03 22:48:47 +03:00
|
|
|
|
|
|
|
|
|
Once setup is complete, the following commands will be useful:
|
|
|
|
|
|
2022-11-29 21:56:50 +03:00
|
|
|
|
- `yarn build` to build the subpackages
|
|
|
|
|
- `yarn lint` to lint the subpackages (using [eslint] with TypeScript extensions)
|
|
|
|
|
- `yarn test` to run the tests (mainly using [mocha] and [chai])
|
|
|
|
|
- `yarn doc` to build most of the documentation (using [TypeDoc]) — but see below
|
2022-11-29 23:25:34 +03:00
|
|
|
|
- `yarn clean` to remove built files
|
2020-05-03 22:48:47 +03:00
|
|
|
|
|
2022-11-29 21:56:50 +03:00
|
|
|
|
You can run these commands from the top level, which will run them for all of
|
|
|
|
|
the packages, or from the subdirectory of the package you’re interested in.
|
2020-05-03 22:48:47 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Building the full documentation
|
2020-04-26 23:11:53 +03:00
|
|
|
|
|
2021-02-16 00:10:42 +03:00
|
|
|
|
Documentation is maintained in subdirectories of `docs/`. The documentation is a
|
2020-05-03 22:48:47 +03:00
|
|
|
|
Frankenstein combination of the autogenerated API documentation and narrative
|
|
|
|
|
material written in [CommonMark Markdown]. The final HTML is assembled with the
|
2022-11-29 21:56:50 +03:00
|
|
|
|
static site generator [Zola].
|
2020-04-26 23:11:53 +03:00
|
|
|
|
|
2020-04-26 23:28:46 +03:00
|
|
|
|
[CommonMark Markdown]: https://commonmark.org/
|
2020-04-26 23:11:53 +03:00
|
|
|
|
[Zola]: https://getzola.org/
|
|
|
|
|
[TypeDoc]: https://typedoc.org/
|
|
|
|
|
|
|
|
|
|
1. Zola is fast and self-contained and [ridiculously easy to
|
|
|
|
|
install][install-zola].
|
2022-11-29 21:56:50 +03:00
|
|
|
|
1. The `yarn doc` command will install the autogenerated documentation into
|
2021-02-16 00:10:42 +03:00
|
|
|
|
`docs/engine/static/`
|
|
|
|
|
1. Running `zola build` in a subdirectory of `docs` will assembled the final HTML
|
|
|
|
|
into `docs/{subdir}/public/`.
|
2020-04-26 23:11:53 +03:00
|
|
|
|
1. The command `zola check` will check the narrative docs for broken links.
|
2020-05-03 22:48:47 +03:00
|
|
|
|
1. The command `zola serve` will serve the documentation using a local server
|
|
|
|
|
with autoreload.
|
2020-04-26 23:11:53 +03:00
|
|
|
|
|
|
|
|
|
[install-zola]: https://www.getzola.org/documentation/getting-started/installation/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Continuous Integration and Deployment
|
|
|
|
|
|
2020-09-23 20:32:13 +03:00
|
|
|
|
This repository uses [Cranko] to automate release workflows. This automation is
|
|
|
|
|
essential to the smooth and reproducible deployment of the WWT web services.
|
|
|
|
|
|
|
|
|
|
[Cranko]: https://pkgw.github.io/cranko/
|
2019-12-31 03:54:54 +03:00
|
|
|
|
|
2021-09-01 01:34:26 +03:00
|
|
|
|
|
2021-09-02 20:04:39 +03:00
|
|
|
|
## Integration Testing
|
2021-09-01 01:34:26 +03:00
|
|
|
|
|
2021-09-02 20:04:39 +03:00
|
|
|
|
Integration testing of the apps is done using [Selenium], [Nightwatch], and
|
|
|
|
|
[BrowserStack]. For the main branch, this is triggered automatically with each
|
|
|
|
|
commit/pull request. However, the test suite can also be run using a version of
|
|
|
|
|
the app on your local machine, either locally (using the Nightwatch binary) or
|
|
|
|
|
using BrowserStack (provided that you have a BrowserStack account). In either
|
|
|
|
|
case, you may need to modify the `url` in `tests/page_objects/researchApp.js` to
|
|
|
|
|
point to the localhost port that you will be using (the default is
|
|
|
|
|
`http://localhost:8080`).
|
|
|
|
|
|
|
|
|
|
[Selenium]: https://www.selenium.dev/
|
|
|
|
|
[Nightwatch]: https://nightwatchjs.org/
|
|
|
|
|
[BrowserStack]: https://www.browserstack.com/
|
|
|
|
|
|
|
|
|
|
To run the test suite on a local version of the app with ChromeDriver:
|
2021-09-01 01:34:26 +03:00
|
|
|
|
|
|
|
|
|
```
|
2022-11-29 21:56:50 +03:00
|
|
|
|
yarn run serve-research & # or equivalent
|
2021-09-01 01:34:26 +03:00
|
|
|
|
cd tests
|
2022-11-29 21:56:50 +03:00
|
|
|
|
yarn build
|
2023-03-04 02:40:07 +03:00
|
|
|
|
yarn local
|
2021-09-01 01:34:26 +03:00
|
|
|
|
```
|
|
|
|
|
|
2021-09-02 20:04:39 +03:00
|
|
|
|
To run tests on a local version of the app via BrowserStack's multi-browser,
|
|
|
|
|
multi-platform infrastructure, do the following:
|
2021-09-01 01:34:26 +03:00
|
|
|
|
|
2021-09-02 20:04:39 +03:00
|
|
|
|
* Set the variables `BROWSERSTACK_USERNAME` and `BROWSERSTACK_ACCESS_KEY` to your BrowserStack
|
|
|
|
|
username and access key, respectively. You can find these values in your BrowserStack
|
2021-09-01 01:34:26 +03:00
|
|
|
|
[Account Settings].
|
|
|
|
|
|
|
|
|
|
[Account Settings]: https://www.browserstack.com/accounts/settings
|
|
|
|
|
|
2023-03-04 02:40:07 +03:00
|
|
|
|
* Run the test suite as above but with the final command: `yarn bs-local`
|
2021-09-01 03:56:28 +03:00
|
|
|
|
|
2021-09-02 20:04:39 +03:00
|
|
|
|
By default, both of these local options will run the tests in Chrome. You can
|
|
|
|
|
adjust the testing environments adding the `-e` option, which can be
|
|
|
|
|
accomplished with syntax such as
|
2021-09-01 03:56:28 +03:00
|
|
|
|
|
|
|
|
|
```
|
2023-03-04 02:40:07 +03:00
|
|
|
|
yarn bs-local -e firefox,edge
|
2021-09-01 01:34:26 +03:00
|
|
|
|
```
|
2019-12-31 03:54:54 +03:00
|
|
|
|
|
2021-09-02 20:04:39 +03:00
|
|
|
|
|
2019-12-31 03:54:54 +03:00
|
|
|
|
## Getting involved
|
|
|
|
|
|
|
|
|
|
We love it when people get involved in the WWT community! You can get started
|
|
|
|
|
by [participating in our user forum] or by
|
|
|
|
|
[signing up for our low-traffic newsletter]. If you would like to help make
|
|
|
|
|
WWT better, our [Contributor Hub] aims to be your one-stop shop for
|
|
|
|
|
information about how to contribute to the project, with the
|
|
|
|
|
[Contributors’ Guide] being the first thing you should read. Here on GitHub we
|
|
|
|
|
operate with a standard [fork-and-pull] model.
|
|
|
|
|
|
|
|
|
|
[participating in our user forum]: https://wwt-forum.org/
|
|
|
|
|
[signing up for our low-traffic newsletter]: https://bit.ly/wwt-signup
|
|
|
|
|
[Contributor Hub]: https://worldwidetelescope.github.io/
|
|
|
|
|
[Contributors’ Guide]: https://worldwidetelescope.github.io/contributing/
|
|
|
|
|
[fork-and-pull]: https://help.github.com/en/articles/about-collaborative-development-models
|
|
|
|
|
|
|
|
|
|
All participation in WWT communities is conditioned on your adherence to the
|
|
|
|
|
[WWT Code of Conduct], which basically says that you should not be a jerk.
|
|
|
|
|
|
|
|
|
|
[WWT Code of Conduct]: https://worldwidetelescope.github.io/code-of-conduct/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Acknowledgments
|
|
|
|
|
|
2023-06-06 04:52:01 +03:00
|
|
|
|
Work on the WorldWide Telescope system has been supported by the [American
|
|
|
|
|
Astronomical Society] (AAS), the [.NET Foundation], and other partners. See [the
|
|
|
|
|
WWT user website][acks] for details.
|
2019-12-31 03:54:54 +03:00
|
|
|
|
|
2020-04-26 23:11:53 +03:00
|
|
|
|
[American Astronomical Society]: https://aas.org/
|
2019-12-31 03:54:54 +03:00
|
|
|
|
[.NET Foundation]: https://dotnetfoundation.org/
|
2023-06-06 04:52:01 +03:00
|
|
|
|
[acks]: https://worldwidetelescope.org/about/acknowledgments/
|
2019-12-31 03:54:54 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Legalities
|
|
|
|
|
|
|
|
|
|
The WWT code is licensed under the [MIT License]. The copyright to the code is
|
|
|
|
|
owned by the [.NET Foundation].
|
|
|
|
|
|
|
|
|
|
[MIT License]: https://opensource.org/licenses/MIT
|