@loveluthien/carta-frontend 6.0.0-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/ISSUE_TEMPLATE/bug_report.md +34 -0
- package/.github/pull_request_template.md +23 -0
- package/.github/workflows/continuous_integration.yml +139 -0
- package/.github/workflows/deploy.yml +30 -0
- package/.husky/pre-commit +16 -0
- package/.husky/pre-push +42 -0
- package/.prettierignore +1 -0
- package/.prettierrc.json +18 -0
- package/CHANGELOG.md +363 -0
- package/COPYING.md +636 -0
- package/README.md +112 -0
- package/babel.config.json +10 -0
- package/build/ast_wrapper.wasm +0 -0
- package/build/carta_computation.wasm +0 -0
- package/build/carta_icon_128px.png +0 -0
- package/build/carta_logo.png +0 -0
- package/build/gsl_wrapper.wasm +0 -0
- package/build/index.html +147 -0
- package/build/manifest.json +15 -0
- package/build/robots.txt +3 -0
- package/build/static/css/546.aa44a897.css +1 -0
- package/build/static/css/async/359.4d8f6ff7.css +1 -0
- package/build/static/css/async/403.ea9edfac.css +1 -0
- package/build/static/css/async/462.8bde08e0.css +1 -0
- package/build/static/css/index.c1f77b92.css +1 -0
- package/build/static/font/blueprint-icons-16.5fb1af27.woff2 +0 -0
- package/build/static/font/blueprint-icons-16.79f603d1.woff +0 -0
- package/build/static/font/blueprint-icons-16.83d51978.eot +0 -0
- package/build/static/font/blueprint-icons-16.af0c342f.ttf +0 -0
- package/build/static/font/blueprint-icons-20.83fddc09.ttf +0 -0
- package/build/static/font/blueprint-icons-20.9a51bc58.woff +0 -0
- package/build/static/font/blueprint-icons-20.d61315fe.eot +0 -0
- package/build/static/font/blueprint-icons-20.ebf16e9a.woff2 +0 -0
- package/build/static/image/allmaps.03f2ba92.png +0 -0
- package/build/static/image/gamma.6fca425b.png +0 -0
- package/build/static/image/linear.c7941b64.png +0 -0
- package/build/static/image/log.7fce6aee.png +0 -0
- package/build/static/image/power.5dac9727.png +0 -0
- package/build/static/image/sqrt.0ec2b3f1.png +0 -0
- package/build/static/image/squared.798b23aa.png +0 -0
- package/build/static/js/546.b5841ade.js +489 -0
- package/build/static/js/546.b5841ade.js.LICENSE.txt +925 -0
- package/build/static/js/async/359.97257512.js +1 -0
- package/build/static/js/async/403.b00f768c.js +1 -0
- package/build/static/js/async/462.92c07a07.js +1 -0
- package/build/static/js/async/905.70044ee8.js +1 -0
- package/build/static/js/async/907.dc17f1d2.js +1 -0
- package/build/static/js/async/blueprint-icons-16px-paths.e17db832.js +1 -0
- package/build/static/js/async/blueprint-icons-20px-paths.6ad43f5f.js +1 -0
- package/build/static/js/async/blueprint-icons-all-paths-loader.61cc0f7b.js +1 -0
- package/build/static/js/async/blueprint-icons-all-paths.0c699441.js +1 -0
- package/build/static/js/async/blueprint-icons-split-paths-by-size-loader.5cff79f5.js +1 -0
- package/build/static/js/index.8fc34b4d.js +1344 -0
- package/build/static/js/index.9a30d560.worker.js +1 -0
- package/build/static/js/zfp_wrapper.wasm +0 -0
- package/build/static/svg/blueprint-icons-16.130888ef.svg +2097 -0
- package/build/static/svg/blueprint-icons-20.c8456d56.svg +2097 -0
- package/build/zfp_wrapper.wasm +0 -0
- package/declarations.d.ts +18 -0
- package/docs_website/.prettierignore +1 -0
- package/docs_website/api/api.md +13 -0
- package/docs_website/babel.config.js +3 -0
- package/docs_website/docs/assets/enable-code-snippets.png +0 -0
- package/docs_website/docs/code-snippet-tutorial/_category_.json +8 -0
- package/docs_website/docs/code-snippet-tutorial/basics.md +97 -0
- package/docs_website/docs/code-snippet-tutorial/image-blending.mdx +57 -0
- package/docs_website/docs/code-snippet-tutorial/image-fitting.mdx +44 -0
- package/docs_website/docs/code-snippet-tutorial/image-properties.mdx +84 -0
- package/docs_website/docs/code-snippet-tutorial/moment-images.mdx +31 -0
- package/docs_website/docs/code-snippet-tutorial/pv-images.mdx +28 -0
- package/docs_website/docs/code-snippet-tutorial/quick-start.mdx +82 -0
- package/docs_website/docs/code-snippet-tutorial/regions.mdx +49 -0
- package/docs_website/docs/contributing/_category_.json +7 -0
- package/docs_website/docs/contributing/developer-tips.md +61 -0
- package/docs_website/docs/contributing/documentation-guidelines.md +87 -0
- package/docs_website/docs/contributing/github-workflow.md +146 -0
- package/docs_website/docs/contributing/release-guidelines.md +73 -0
- package/docs_website/docs/contributing/unit-test-guidelines.md +79 -0
- package/docs_website/docs/documents.mdx +15 -0
- package/docs_website/docusaurus.config.js +167 -0
- package/docs_website/package-lock.json +16769 -0
- package/docs_website/package.json +121 -0
- package/docs_website/patches/@docusaurus+core+3.9.2.patch +20 -0
- package/docs_website/sidebars.js +33 -0
- package/docs_website/static/.nojekyll +0 -0
- package/docs_website/static/img/carta_icon_128px.png +0 -0
- package/docs_website/versioned_docs/version-4.1.0/api-packages.json +1 -0
- package/docs_website/versioned_docs/version-4.1.0/api-typedoc.json +214112 -0
- package/docs_website/versioned_docs/version-4.1.0/assets/enable-code-snippets.png +0 -0
- package/docs_website/versioned_docs/version-4.1.0/code-snippet-tutorial/_category_.json +8 -0
- package/docs_website/versioned_docs/version-4.1.0/code-snippet-tutorial/basics.md +97 -0
- package/docs_website/versioned_docs/version-4.1.0/code-snippet-tutorial/image-fitting.mdx +42 -0
- package/docs_website/versioned_docs/version-4.1.0/code-snippet-tutorial/image-properties.mdx +86 -0
- package/docs_website/versioned_docs/version-4.1.0/code-snippet-tutorial/moment-images.mdx +31 -0
- package/docs_website/versioned_docs/version-4.1.0/code-snippet-tutorial/pv-images.mdx +28 -0
- package/docs_website/versioned_docs/version-4.1.0/code-snippet-tutorial/quick-start.mdx +82 -0
- package/docs_website/versioned_docs/version-4.1.0/code-snippet-tutorial/regions.mdx +49 -0
- package/docs_website/versioned_docs/version-4.1.0/contributing/_category_.json +7 -0
- package/docs_website/versioned_docs/version-4.1.0/contributing/developer-tips.md +36 -0
- package/docs_website/versioned_docs/version-4.1.0/contributing/documentation-guidelines.md +87 -0
- package/docs_website/versioned_docs/version-4.1.0/contributing/github-workflow.md +141 -0
- package/docs_website/versioned_docs/version-4.1.0/contributing/release-guidelines.md +73 -0
- package/docs_website/versioned_docs/version-4.1.0/contributing/unit-test-guidelines.md +79 -0
- package/docs_website/versioned_docs/version-4.1.0/documents.mdx +15 -0
- package/docs_website/versioned_docs/version-5.0.0/api-packages.json +1 -0
- package/docs_website/versioned_docs/version-5.0.0/api-typedoc.json +315266 -0
- package/docs_website/versioned_docs/version-5.0.0/assets/enable-code-snippets.png +0 -0
- package/docs_website/versioned_docs/version-5.0.0/code-snippet-tutorial/_category_.json +8 -0
- package/docs_website/versioned_docs/version-5.0.0/code-snippet-tutorial/basics.md +97 -0
- package/docs_website/versioned_docs/version-5.0.0/code-snippet-tutorial/image-blending.mdx +57 -0
- package/docs_website/versioned_docs/version-5.0.0/code-snippet-tutorial/image-fitting.mdx +44 -0
- package/docs_website/versioned_docs/version-5.0.0/code-snippet-tutorial/image-properties.mdx +86 -0
- package/docs_website/versioned_docs/version-5.0.0/code-snippet-tutorial/moment-images.mdx +31 -0
- package/docs_website/versioned_docs/version-5.0.0/code-snippet-tutorial/pv-images.mdx +28 -0
- package/docs_website/versioned_docs/version-5.0.0/code-snippet-tutorial/quick-start.mdx +82 -0
- package/docs_website/versioned_docs/version-5.0.0/code-snippet-tutorial/regions.mdx +49 -0
- package/docs_website/versioned_docs/version-5.0.0/contributing/_category_.json +7 -0
- package/docs_website/versioned_docs/version-5.0.0/contributing/developer-tips.md +36 -0
- package/docs_website/versioned_docs/version-5.0.0/contributing/documentation-guidelines.md +87 -0
- package/docs_website/versioned_docs/version-5.0.0/contributing/github-workflow.md +141 -0
- package/docs_website/versioned_docs/version-5.0.0/contributing/release-guidelines.md +73 -0
- package/docs_website/versioned_docs/version-5.0.0/contributing/unit-test-guidelines.md +79 -0
- package/docs_website/versioned_docs/version-5.0.0/documents.mdx +15 -0
- package/docs_website/versioned_sidebars/version-4.1.0-sidebars.json +8 -0
- package/docs_website/versioned_sidebars/version-5.0.0-sidebars.json +8 -0
- package/docs_website/versions.json +4 -0
- package/eslint.config.mjs +86 -0
- package/jest.config.js +101 -0
- package/package.json +186 -0
- package/patches/golden-layout+1.5.9.patch +24 -0
- package/patches/react-split-pane+0.1.92.patch +20 -0
- package/rsbuild.config.ts +75 -0
- package/schemas/.github/workflows/AddToCartaVisProject.yml +23 -0
- package/schemas/.prettierrc.json +18 -0
- package/schemas/CMakeLists.txt +15 -0
- package/schemas/README.md +1 -0
- package/schemas/_config.yml +7 -0
- package/schemas/controller_config_schema_1.json +343 -0
- package/schemas/controller_config_schema_2.json +685 -0
- package/schemas/layout_schema_2.json +440 -0
- package/schemas/preference_backend_schema_1.json +81 -0
- package/schemas/preference_backend_schema_2.json +118 -0
- package/schemas/preference_schema_1.json +410 -0
- package/schemas/preferences_schema_2.json +421 -0
- package/schemas/schemacompiler.c +200 -0
- package/schemas/snippet_schema_1.json +45 -0
- package/schemas/workspace_schema_1.json +573 -0
- package/scripts/make_colormaps.py +161 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 4
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Documentation guidelines
|
|
6
|
+
|
|
7
|
+
Guidelines for building and writing this website.
|
|
8
|
+
|
|
9
|
+
## Building documentation
|
|
10
|
+
|
|
11
|
+
The website is hosted on GitHub Pages, and whenever the `dev` branch is updated, the website is automatically updated using GitHub Actions.
|
|
12
|
+
|
|
13
|
+
To build and test the website locally, navigate to the `docs_website/` directory and install package dependencies:
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
cd docs_website
|
|
17
|
+
npm install
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
and run the development server:
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
npm start
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
If you make changes to the files in the `docs/` and `api/` folders, the site will automatically reload and display the changes.
|
|
27
|
+
|
|
28
|
+
To create a local production build:
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
npm run build
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
To test the local production build:
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
npm run serve
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Please note that the search feature is only available in production builds.
|
|
41
|
+
|
|
42
|
+
## Writing documentation pages
|
|
43
|
+
|
|
44
|
+
The "Docs" pages and the "API/Overview" page are generated from markdown files in the `docs/` and `api/` directories. Simply edit these directories to modify the content or add new pages.
|
|
45
|
+
|
|
46
|
+
For links to the "Docs" index pages and "API" subpages, it is required to use the `DocsIndexLink` and `ApiLink` MDX components to ensure the corresponding version is linked. If the file contains MDX components, it is recommended to use the `.mdx` extension.
|
|
47
|
+
|
|
48
|
+
### Formatting
|
|
49
|
+
|
|
50
|
+
To check the format of the changes, run (from the `docs_website/` folder):
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
npm run checkformat
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
To automatically fix the format:
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
npm run reformat
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
This maintains consistent markdown styling, including indentation, maximum line length, and list numbering. Please refer to the [Prettier documentation](https://prettier.io/blog/2017/11/07/1.8.0.html#markdown-support) for more information.
|
|
63
|
+
|
|
64
|
+
## Writing API documentation
|
|
65
|
+
|
|
66
|
+
The "API" subpages are generated from TSDoc documentation in the codebase. Catalogs are created based on the `index.ts` files, and elements need to be exported in the respective `index.ts` file to appear on the catalog subpages. Private and projected elements are not displayed.
|
|
67
|
+
|
|
68
|
+
Please note that the development server does not automatically re-parse TSDoc. Therefore, if you modify TSDoc in the codebase, you will need to rebuild it to display the changes.
|
|
69
|
+
|
|
70
|
+
### Formatting
|
|
71
|
+
|
|
72
|
+
For TSDoc format, please refer to the [TSDoc documentation](https://tsdoc.org). ESLint is applied to check for the required format. To run the lint checks (from the repository root):
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
npm run check-eslint
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Versioning
|
|
79
|
+
|
|
80
|
+
To tag a new version, run (from the `docs_website/` folder):
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
npm run docusaurus docs:version 1.2.3
|
|
84
|
+
npm run docusaurus api:version 1.2.3
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
This will append the new version to `versions.json` and create files in the `versioned_docs/` and `versioned_sidebars/` folders. To modify the content or add new pages for a specific version, edit the files in these folders.
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 2
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# GitHub workflow
|
|
6
|
+
|
|
7
|
+
The workflow for contributing to the codebase.
|
|
8
|
+
|
|
9
|
+
## Creating new issues
|
|
10
|
+
|
|
11
|
+
When creating new issues, please refer to [this page](https://github.com/CARTAvis/carta-frontend/labels) for the available labels that can be added.
|
|
12
|
+
|
|
13
|
+
If the issue is related to bug fixing, please use the [bug report template](https://github.com/CARTAvis/carta-frontend/blob/dev/.github/ISSUE_TEMPLATE/bug_report.md). Please make sure to fill in the template with all the necessary information, including the description, reproduction steps, and platform information. Providing reproduction steps is particularly helpful for resolving issues. Additionally, including testing images can be helpful for reproducing the issue.
|
|
14
|
+
|
|
15
|
+
## Contributing to the codebase
|
|
16
|
+
|
|
17
|
+
### Cloning and building the codebase
|
|
18
|
+
|
|
19
|
+
To clone the codebase to your computer:
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
git clone git@github.com:CARTAvis/carta-frontend.git
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
For detailed instructions on building the codebase from source, please refer to the [README file](https://github.com/CARTAvis/carta-frontend/blob/dev/README.md#development).
|
|
26
|
+
|
|
27
|
+
### Creating a branch
|
|
28
|
+
|
|
29
|
+
Before making any changes to the codebase, create and check out to a new branch. It's recommended to use the following format for branch names:
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
git checkout -b "[author]/[issue id]_[description_with_underscores]"
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
If the issue doesn't exist yet, please create a new issue. When you start working on the issue, update the GitHub Project status of the issue to "In Progress".
|
|
36
|
+
|
|
37
|
+
### Pushing changes
|
|
38
|
+
|
|
39
|
+
To stage and commit your changes:
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
git add .
|
|
43
|
+
git commit -m "a short description of the change"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Please note that Husky hooks run automatically during `commit` and `push`.
|
|
47
|
+
|
|
48
|
+
- If the hook checks fail, fix the reported issues and retry.
|
|
49
|
+
- If hooks are not available in your local clone, run `npm install` (or `npm run prepare` if install scripts were skipped).
|
|
50
|
+
|
|
51
|
+
To push the branch to the remote repository:
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
git push
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Making a pull request
|
|
58
|
+
|
|
59
|
+
#### Pull request template
|
|
60
|
+
|
|
61
|
+
When making a pull request from your branch, please use the [pull request template](https://github.com/CARTAvis/carta-frontend/blob/dev/.github/pull_request_template.md).
|
|
62
|
+
|
|
63
|
+
In the description section, please provide details about your changes, including linked issues and companion pull requests (if there are), what is implemented or fixed, and how to test it.
|
|
64
|
+
|
|
65
|
+
Each check item in the checklist section is explained below:
|
|
66
|
+
|
|
67
|
+
For linked issues (if there are): this section is for checking the status of the issues that are linked in the above description.
|
|
68
|
+
|
|
69
|
+
- assignee and label added: assign yourself to the issue you are working on. Add labels to the issue.
|
|
70
|
+
|
|
71
|
+
- GitHub Project estimate added: provide an estimate for the time required to complete the issue. This estimation is useful for future development planning.
|
|
72
|
+
|
|
73
|
+
For the pull request: this section is for checking the status of the pull request and reviewing the code changes.
|
|
74
|
+
|
|
75
|
+
- reviewers and assignee added: assign reviewers and an assignee to the pull request. The assignee will be responsible for merging the pull request.
|
|
76
|
+
|
|
77
|
+
- GitHub Project estimate added: provide an estimate for the time required to review the pull request.
|
|
78
|
+
|
|
79
|
+
- changelog updated / no changelog update needed: updating the changelog is required when the issue exists in the latest release and the changes have an impact on users. It is recommended to update the changelog when sending the pull request and to resolve changelog merge conflicts using the GitHub UI.
|
|
80
|
+
|
|
81
|
+
- unit test added (for functions with no dependenies): it is recommended to add unit tests for functions that are related to the code changes.
|
|
82
|
+
|
|
83
|
+
- API documentation added (for public variables and methods in stores): it is recommended to add API documentation for public variables and methods in stores that are related to the code changes. Check [here](./documentation-guidelines/#writing-api-documentation) for adding API documentation.
|
|
84
|
+
|
|
85
|
+
For dependencies: this section is for checking repositories that have dependencies on carta-frontend or are dependencies of carta-frontend.
|
|
86
|
+
|
|
87
|
+
- e2e test passing / corresponding fix added: check if the end-to-end tests are passing. This will be checked during the review.
|
|
88
|
+
|
|
89
|
+
- protobuf version bumped / no protobuf version bumped needed: updating the protobuf version is required when the behavior of the protobuf messages is changed.
|
|
90
|
+
|
|
91
|
+
- protobuf updated to the latest dev commit / no protobuf update needed: updating the protobuf is required when there are changes in the carta-protobuf submodule. This can be done when the pull request is ready for merge. Check [here](#merging-a-pull-request-with-protobuf-changes-required) for the steps.
|
|
92
|
+
|
|
93
|
+
- corresponding ICD test fix added (`BackendService` changed) / no ICD test fix needed (`BackendService` unchanged): updating ICD tests is required when there are changes in `BackendService`.
|
|
94
|
+
|
|
95
|
+
- user manual prepared (for large new features): preparing user manual updates in advance is required for large new features.
|
|
96
|
+
|
|
97
|
+
#### CI checks
|
|
98
|
+
|
|
99
|
+
Please ensure that the CI passes successfully when making the pull request. The CI checks various items:
|
|
100
|
+
|
|
101
|
+
- Codebase formatting: Check [here](./developer-tips/#checking-and-fixing-code-format) for automatic codebase formatting.
|
|
102
|
+
- Production builds with different Node versions: The build will not be successful if the lint check fails. Check [here](./developer-tips/#code-linting) for details.
|
|
103
|
+
- Documentation page formatting: Check [here](./documentation-guidelines/#formatting) for automatic formatting.
|
|
104
|
+
- Production build of the documentation website: Details of building the website locally can be found [here](./documentation-guidelines/#building-documentation).
|
|
105
|
+
|
|
106
|
+
### Merging a pull request
|
|
107
|
+
|
|
108
|
+
The assignee of the pull request is responsible for merging the pull request. When merging the pull request, ensure the following:
|
|
109
|
+
|
|
110
|
+
- Sufficient reviewers have approved the pull request.
|
|
111
|
+
- All items in the checklist are completed.
|
|
112
|
+
- All CI checks have passed successfully.
|
|
113
|
+
|
|
114
|
+
After merging the pull request, make sure to close the linked issue if necessary. GitHub automatically closes issues when they are linked properly. Remember to delete the branch after the merge.
|
|
115
|
+
|
|
116
|
+
#### Merging a pull request with protobuf changes required
|
|
117
|
+
|
|
118
|
+
If the pull request requires changes in the carta-protobuf submodule and is ready for merge, follow these steps:
|
|
119
|
+
|
|
120
|
+
1. Merge the carta-protobuf branch in the repository.
|
|
121
|
+
|
|
122
|
+
2. Check out the frontend branch:
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
git checkout [the frontend branch]
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
3. Check out the dev branch of the protobuf submodule and pull the latest version:
|
|
129
|
+
|
|
130
|
+
```
|
|
131
|
+
cd protobuf
|
|
132
|
+
git checkout dev
|
|
133
|
+
git pull
|
|
134
|
+
cd ..
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
4. Commit and push the changes:
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
git commit -a -m "update protobuf"
|
|
141
|
+
git push
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
5. Finally, you can check the item "protobuf updated to the latest dev commit" in the check list. The pull request is ready for merge if all the other checklist items are completed and the CI checks have passed.
|
|
145
|
+
|
|
146
|
+
6. For the carta-backend repository, follow similar steps for the corresponding backend branch as in steps 2 to 5. Merge the frontend and backend pull requests simultaneously.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 5
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Release guidelines
|
|
6
|
+
|
|
7
|
+
In this document, 123 is a placeholder for the current release number, and 124 for the following release number.
|
|
8
|
+
|
|
9
|
+
## Beta releases
|
|
10
|
+
|
|
11
|
+
### Beta release
|
|
12
|
+
|
|
13
|
+
1. `dev` branch: update `CHANGELOG.md`. Change the `Unreleased` heading to `123.0.0-beta.0`.
|
|
14
|
+
2. `dev` branch: update the user manual URL if necessary.
|
|
15
|
+
3. Create a `release/123.0` branch using the `dev` branch.
|
|
16
|
+
4. `release/123.0` branch: update the `package.json` version string to `123.0.0-beta.0`. Run `npm install` to update `package-lock.json`.
|
|
17
|
+
5. Create a `v123.0.0-beta.0` tag using the release branch.
|
|
18
|
+
6. Test the release branch. Make any required fixes in the `dev` branch, and merge them into the release branch. Ideally, bump the version and create a new tag every time changes are merged. If you don't want to bump the version, remember to destroy and recreate the latest tag.
|
|
19
|
+
7. Create packages from the release branch.
|
|
20
|
+
|
|
21
|
+
### After beta release
|
|
22
|
+
|
|
23
|
+
1. `dev` branch: update `CHANGELOG.md`. Create a new `Unreleased` section.
|
|
24
|
+
2. `dev` branch: update the documentation website ([guidelines](./documentation-guidelines/#versioning)). Create a new version `123.0.0-beta.0`.
|
|
25
|
+
|
|
26
|
+
### Additional beta release
|
|
27
|
+
|
|
28
|
+
This process should be followed if changes have to be made after the beta packages have already been published (or even provided to a limited number of users). If there are significant changes in `dev` that should _not_ be included in the beta release, follow the point release procedure instead (but adjust the version strings as required).
|
|
29
|
+
|
|
30
|
+
1. Make the required fixes in `dev`.
|
|
31
|
+
2. `dev` branch: update `CHANGELOG.md`. Change the `Unreleased` heading to `123.0.0-beta.1`.
|
|
32
|
+
3. `dev` branch: update the user manual URL if necessary.
|
|
33
|
+
4. Merge the `dev` branch into the `release/123.0` branch.
|
|
34
|
+
5. `release/123.0` branch: update the `package.json` version string to `123.0.0-beta.1`. Run `npm install` to update `package-lock.json`.
|
|
35
|
+
6. Create a `v123.0.0-beta.1` tag using the release branch.
|
|
36
|
+
7. Test the release branch. Make any required fixes in the `dev` branch, and merge them into the release branch. Ideally, bump the version and create a new tag every time changes are merged. If you don't want to bump the version, remember to destroy and recreate the latest tag.
|
|
37
|
+
8. Create packages from the release branch.
|
|
38
|
+
|
|
39
|
+
## Stable releases
|
|
40
|
+
|
|
41
|
+
### Final release
|
|
42
|
+
|
|
43
|
+
1. `dev` branch: update `CHANGELOG.md`. Change the `Unreleased` heading to `123.0.0`.
|
|
44
|
+
2. `dev` branch: update the user manual URL if necessary.
|
|
45
|
+
3. Merge the `dev` branch into the `release/123.0` branch.
|
|
46
|
+
4. `release/123.0` branch: update the `package.json` version string to `123.0.0-rc.0`. Run `npm install` to update `package-lock.json`.
|
|
47
|
+
5. Create a `v123.0.0-rc.0` tag using the release branch.
|
|
48
|
+
6. Test the release branch. Make any required fixes in the `dev` branch, and merge them into the release branch. Ideally, bump the version and create a new tag every time changes are merged. If you don't want to bump the version, remember to destroy and recreate the latest tag.
|
|
49
|
+
7. `release/123.0` branch: update the `package.json` version string to `123.0.0`. Run `npm install` to update `package-lock.json`.
|
|
50
|
+
8. Create a `v123.0.0` tag using the release branch.
|
|
51
|
+
9. Create packages from the release branch.
|
|
52
|
+
|
|
53
|
+
### After final release
|
|
54
|
+
|
|
55
|
+
1. `dev` branch: update the `package.json` version string to `124.0.0-dev`. Run `npm install` to update `package-lock.json`.
|
|
56
|
+
2. `dev` branch: update `CHANGELOG.md`. Create a new `Unreleased` section.
|
|
57
|
+
3. `dev` branch: update the documentation website ([guidelines](./documentation-guidelines/#versioning)). Create a new version `123.0.0`.
|
|
58
|
+
|
|
59
|
+
### Point release
|
|
60
|
+
|
|
61
|
+
This process should be followed if important bug fixes have to be released after the final release packages have already been published (or even provided to a limited number of users). If there are no changes in `dev` that should not be included in the point release, follow the additional beta release procedure instead (but adjust the version strings as required).
|
|
62
|
+
|
|
63
|
+
1. Make the required fixes in `dev`. Cherry-pick them into the release branch.
|
|
64
|
+
2. `dev` branch: update `CHANGELOG.md`. Move the cherry-picked changes from the `Unreleased` section to a new `123.0.1` section _under_ `Unreleased`.
|
|
65
|
+
3. `release/123.0` branch: update `CHANGELOG.md`. Copy only the `123.0.1` section from the changelog in the `dev` branch.
|
|
66
|
+
4. `release/123.0` branch: update the `package.json` version string to `123.0.1`. Run `npm install` to update `package-lock.json`.
|
|
67
|
+
5. Create a `v123.0.1` tag using the release branch.
|
|
68
|
+
6. Test the release branch. If an issue affects both `dev` and the release branch, fix it in `dev` and cherry-pick the changes into the release branch. If an issue is caused by changes in `dev` which are not included in the point release, make the minimal required changes in the release branch. Ideally, bump the version and create a new tag every time changes are made. If you don't want to bump the version, remember to destroy and recreate the latest tag.
|
|
69
|
+
7. Create packages from the release branch.
|
|
70
|
+
|
|
71
|
+
### After point release
|
|
72
|
+
|
|
73
|
+
- `dev` branch: update the documentation website ([guidelines](./documentation-guidelines/#versioning)). Replace version `123.0.0` with `123.0.1`.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 3
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Unit test guidelines
|
|
6
|
+
|
|
7
|
+
Guidelines for running and writing unit tests.
|
|
8
|
+
|
|
9
|
+
## Running unit tests
|
|
10
|
+
|
|
11
|
+
1. Install package dependencies:
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
npm install
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
2. Build carta-protobuf and WebAssembly libraries:
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
npm run build-protobuf
|
|
21
|
+
|
|
22
|
+
npm run build-libs
|
|
23
|
+
npm run build-wrappers
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
3. Run unit tests:
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
npm test
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
By default, Jest runs tests related to changed files.
|
|
33
|
+
|
|
34
|
+
To display individual test results, use the `--verbose` flag:
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
npm test --verbose
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
For more options available in Jest, please refer to the [Jest documentation](https://jestjs.io/docs/cli).
|
|
41
|
+
|
|
42
|
+
## Writing unit tests
|
|
43
|
+
|
|
44
|
+
### Structures
|
|
45
|
+
|
|
46
|
+
- Directory structure: colocate the test file in the same directory and name with `.test.ts/tsx` suffix. For example,
|
|
47
|
+
```
|
|
48
|
+
.
|
|
49
|
+
└── src
|
|
50
|
+
└── components
|
|
51
|
+
└── AComponent
|
|
52
|
+
├── AComponent.tsx
|
|
53
|
+
├── AComponent.scss
|
|
54
|
+
└── AComponent.test.tsx
|
|
55
|
+
└── utilities
|
|
56
|
+
└── math
|
|
57
|
+
├── math.ts
|
|
58
|
+
└── math.test.ts
|
|
59
|
+
```
|
|
60
|
+
- Test code structure: use `describe` to structure the tests. For example,
|
|
61
|
+
|
|
62
|
+
```javascript
|
|
63
|
+
describe("[unit]", () => {
|
|
64
|
+
test("[expected behavior]", () => {});
|
|
65
|
+
|
|
66
|
+
describe("[sub unit]", () => {
|
|
67
|
+
test("[expected behavior]", () => {});
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
- Make sure to implement low-level tests that focus on a certain class or function. Mock imported classes and functions with Jest when necessary.
|
|
73
|
+
- TypeScript enum: import TypeScript enum without index files to avoid compile failure.
|
|
74
|
+
|
|
75
|
+
### Testing React components
|
|
76
|
+
|
|
77
|
+
- Avoid mocking blueprint.js objects to prevent having complex setups.
|
|
78
|
+
- Avoid testing snapshots to prevent having large files in the codebase.
|
|
79
|
+
- Follow [the order of priority](https://testing-library.com/docs/queries/about/#priority) suggested by React Testing Library when querying elements.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 1
|
|
3
|
+
slug: /
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Documents
|
|
7
|
+
|
|
8
|
+
### Table of Contents
|
|
9
|
+
|
|
10
|
+
- <DocsIndexLink path="/code-snippet-tutorial">
|
|
11
|
+
<h4>Code snippet tutorial</h4>
|
|
12
|
+
</DocsIndexLink>
|
|
13
|
+
- <DocsIndexLink path="/contributing">
|
|
14
|
+
<h4>Contributing</h4>
|
|
15
|
+
</DocsIndexLink>
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
// Note: type annotations allow type checking and IDEs autocompletion
|
|
3
|
+
|
|
4
|
+
const {themes} = require("prism-react-renderer");
|
|
5
|
+
const path = require("path");
|
|
6
|
+
const versions = require("./versions.json");
|
|
7
|
+
const packageJson = require("../package.json");
|
|
8
|
+
|
|
9
|
+
const lightCodeTheme = themes.github;
|
|
10
|
+
const darkCodeTheme = themes.dracula;
|
|
11
|
+
const devVersion = packageJson.version;
|
|
12
|
+
|
|
13
|
+
const apiOnClick = `
|
|
14
|
+
const versionLink = document.querySelector('.navbar__item.dropdown.dropdown--hoverable.dropdown--right .navbar__link');
|
|
15
|
+
const currentVersion = versionLink?.textContent;
|
|
16
|
+
let version = '';
|
|
17
|
+
if (currentVersion) {
|
|
18
|
+
if (currentVersion === 'Next' || currentVersion === '${devVersion}') {
|
|
19
|
+
version = '/next';
|
|
20
|
+
} else if (currentVersion !== '${versions?.[0]}') {
|
|
21
|
+
version = '/' + currentVersion;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
window.location.href = '/carta-frontend/api' + version;
|
|
26
|
+
`;
|
|
27
|
+
|
|
28
|
+
const apiButton = `
|
|
29
|
+
<a class="navbar__link menu__link api_link" onclick="${apiOnClick}">API</a>
|
|
30
|
+
`;
|
|
31
|
+
|
|
32
|
+
// eslint-disable-next-line tsdoc/syntax
|
|
33
|
+
/** @type {import('@docusaurus/types').Config} */
|
|
34
|
+
const config = {
|
|
35
|
+
title: "CARTA Frontend Documentation",
|
|
36
|
+
tagline: "Welcome to the CARTA frontend documentation",
|
|
37
|
+
favicon: "img/carta_icon_128px.png",
|
|
38
|
+
|
|
39
|
+
// Set the production url of your site here
|
|
40
|
+
url: "https://cartavis.org",
|
|
41
|
+
// Set the /<baseUrl>/ pathname under which your site is served
|
|
42
|
+
// For GitHub pages deployment, it is often '/<projectName>/'
|
|
43
|
+
baseUrl: "/carta-frontend",
|
|
44
|
+
|
|
45
|
+
// GitHub pages deployment config.
|
|
46
|
+
// If you aren't using GitHub pages, you don't need these.
|
|
47
|
+
organizationName: "CARTAvis", // Usually your GitHub org/user name.
|
|
48
|
+
projectName: "carta-frontend", // Usually your repo name.
|
|
49
|
+
trailingSlash: false,
|
|
50
|
+
|
|
51
|
+
onBrokenLinks: "warn",
|
|
52
|
+
|
|
53
|
+
markdown: {
|
|
54
|
+
hooks: {
|
|
55
|
+
onBrokenMarkdownLinks: "warn"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
// Even if you don't use internalization, you can use this field to set useful
|
|
60
|
+
// metadata like html lang. For example, if your site is Chinese, you may want
|
|
61
|
+
// to replace "en" with "zh-Hans".
|
|
62
|
+
i18n: {
|
|
63
|
+
defaultLocale: "en",
|
|
64
|
+
locales: ["en"]
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
presets: [
|
|
68
|
+
[
|
|
69
|
+
"classic",
|
|
70
|
+
// eslint-disable-next-line tsdoc/syntax
|
|
71
|
+
/** @type {import('@docusaurus/preset-classic').Options} */
|
|
72
|
+
({
|
|
73
|
+
docs: {
|
|
74
|
+
versions: {
|
|
75
|
+
current: {
|
|
76
|
+
label: devVersion
|
|
77
|
+
},
|
|
78
|
+
"5.0.0": {
|
|
79
|
+
banner: "none"
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
sidebarPath: require.resolve("./sidebars.js")
|
|
83
|
+
},
|
|
84
|
+
theme: {
|
|
85
|
+
customCss: require.resolve("./src/css/custom.css")
|
|
86
|
+
}
|
|
87
|
+
})
|
|
88
|
+
]
|
|
89
|
+
],
|
|
90
|
+
|
|
91
|
+
themeConfig:
|
|
92
|
+
// eslint-disable-next-line tsdoc/syntax
|
|
93
|
+
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
|
|
94
|
+
({
|
|
95
|
+
navbar: {
|
|
96
|
+
title: "CARTA Frontend Documentation",
|
|
97
|
+
logo: {
|
|
98
|
+
alt: "CARTA Logo",
|
|
99
|
+
src: "img/carta_icon_128px.png"
|
|
100
|
+
},
|
|
101
|
+
items: [
|
|
102
|
+
{
|
|
103
|
+
type: "docSidebar",
|
|
104
|
+
sidebarId: "docsSidebar",
|
|
105
|
+
position: "left",
|
|
106
|
+
label: "Docs"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
type: "html",
|
|
110
|
+
position: "left",
|
|
111
|
+
value: apiButton,
|
|
112
|
+
className: "navbar__link"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
type: "docsVersionDropdown",
|
|
116
|
+
position: "right",
|
|
117
|
+
dropdownActiveClassDisabled: true
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
href: "https://github.com/CARTAvis/carta-frontend",
|
|
121
|
+
label: "GitHub",
|
|
122
|
+
position: "right"
|
|
123
|
+
}
|
|
124
|
+
]
|
|
125
|
+
},
|
|
126
|
+
footer: {
|
|
127
|
+
style: "dark",
|
|
128
|
+
copyright: `Copyright © ${new Date().getFullYear()} CARTA development team. Built with Docusaurus.`
|
|
129
|
+
},
|
|
130
|
+
prism: {
|
|
131
|
+
theme: lightCodeTheme,
|
|
132
|
+
darkTheme: darkCodeTheme
|
|
133
|
+
}
|
|
134
|
+
}),
|
|
135
|
+
|
|
136
|
+
plugins: [
|
|
137
|
+
[
|
|
138
|
+
"@loveluthien/docusaurus-plugin-typedoc-api",
|
|
139
|
+
{
|
|
140
|
+
projectRoot: path.join(__dirname, ".."),
|
|
141
|
+
packages: [
|
|
142
|
+
{
|
|
143
|
+
path: ".",
|
|
144
|
+
entry: {
|
|
145
|
+
index: {path: "src/index.tsx", entry: "."}, // index.tsx has no exports; work-around for displaying the overview page
|
|
146
|
+
components: {path: "src/components/index.ts", entry: ".", label: "Components"},
|
|
147
|
+
"components/Dialogs": {path: "src/components/Dialogs/index.ts", entry: ".", label: "Components - Dialogs"},
|
|
148
|
+
"components/Shared": {path: "src/components/Shared/index.ts", entry: ".", label: "Components - Shared"},
|
|
149
|
+
enums: {path: "src/enums/index.ts", entry: ".", label: "Enums"},
|
|
150
|
+
models: {path: "src/models/index.ts", entry: ".", label: "Models"},
|
|
151
|
+
services: {path: "src/services/index.ts", entry: ".", label: "Services"},
|
|
152
|
+
stores: {path: "src/stores/index.ts", entry: ".", label: "Stores"},
|
|
153
|
+
utilities: {path: "src/utilities/index.ts", entry: ".", label: "Utilities"}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
],
|
|
157
|
+
readmes: true,
|
|
158
|
+
readmeName: "docs_website/api/api.md",
|
|
159
|
+
changelogs: true,
|
|
160
|
+
tsconfigName: "tsconfig.json"
|
|
161
|
+
}
|
|
162
|
+
],
|
|
163
|
+
require.resolve("docusaurus-lunr-search")
|
|
164
|
+
]
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
module.exports = config;
|