diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml new file mode 100644 index 0000000000..53da6be993 --- /dev/null +++ b/.github/workflows/build-docs.yml @@ -0,0 +1,31 @@ +name: Build Docs +on: + push: + branches: + - main + paths: + - 'docs/**/*.md' + - 'docs/images/*' + - 'mkdocs.yml' + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Configure Git Credentials + run: | + git config user.name github-actions[bot] + git config user.email 41898282+github-actions[bot]@users.noreply.github.com + - uses: actions/setup-python@v4 + with: + python-version: 3.x + - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV + - uses: actions/cache@v3 + with: + key: mkdocs-material-${{ env.cache_id }} + path: .cache + restore-keys: | + mkdocs-material- + - run: pip install mkdocs-material mkdocstrings mkdocstrings-python termynal + - run: mkdocs gh-deploy --force diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4dfbef8810..70dd346f62 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,163 +1 @@ -# Contribution Guide - -A big welcome and thank you for considering contributing to this project. - -This project is a community effort and lives off your contributions, be it in -the form of bug reports, feature requests, discussions, or fixes and other code -changes. - -Reading and following these guidelines will help us make the contribution -process easy and effective for everyone involved. It also communicates that you -agree to respect the time of the developers managing and developing these open -source projects. In return, we will reciprocate that respect by addressing your -issue, assessing changes, and helping you finalize your pull requests. - -## Quicklinks - -- [Code of Conduct](#code-of-conduct) -- [Getting Started](#getting-started) - - [Issues](#issues) - - [Pull Requests](#pull-requests) - - [Setup Development Environment](#setup-development-environment) - - [Linting](#linting) - - [Testing](#testing) - - [Start the OpenChallenges] -- [Release Procedure](#release-procedure) -- [Getting Help](#getting-help) - -## Code of Conduct - -We take our open source community seriously and hold ourselves and other -contributors to high standards of communication. By participating and -contributing to this project, you agree to uphold our [Code of Conduct]. - -## Getting Started - -Contributions are made to this repo via Issues and Pull Requests (PRs). A few -general guidelines that cover both: - -- Search for existing Issues and PRs before creating your own. -- We work hard to makes sure issues are handled in a timely manner but, - depending on the impact, it could take a while to investigate the root cause. - A friendly ping in the comment thread to the submitter or a contributor can - help draw attention if your issue is blocking. - -### Issues - -Issues should be used to report problems with this project, request a new -feature, or to discuss potential changes before a PR is created. When you create -a new Issue, a template will be loaded that will guide you through collecting -and providing the information we need to investigate. - -If you find an Issue that addresses the problem you're having, please add your -own reproduction information to the existing issue rather than creating a new -one. Adding a [reaction] can also help be indicating to our maintainers that a -particular problem is affecting more than just the reporter. - -### Pull Requests - -PRs to our repositories are always welcome and can be a quick way to get your -fix or improvement slated for the next release. In general, PRs should: - -- Only fix/add the functionality in question **OR** address wide-spread - whitespace/style issues, not both. -- Add unit or integration tests for fixed or changed functionality (if a test - suite already exists). -- Address a single concern in the least number of changed lines as possible. -- Include documentation in the repo or on our [docs site]. -- Be accompanied by a complete Pull Request template (loaded automatically when - a PR is created). - -For changes that address core functionality or would require breaking changes -(e.g. a major release), it's best to open an Issue to discuss your proposal -first. This is not required but can save time creating and reviewing changes. - -In general, we follow the [Forking Workflow]: - -1. Fork the repository to your own Github account -2. Clone the project to your machine -3. Create a branch locally with a succinct but descriptive name - - git checkout -b <new-branch> main - -4. Commit changes to the branch -5. Following any formatting and testing guidelines specific to this repo -6. Push changes to your fork -7. Open a PR in our repository and follow the PR template so that we can - efficiently review the changes. - -We recommend that you add this repository as an [upstream remote] to your local -git repository so that you can fetch the latest updates. - -```console -$ git remote add upstream https://github.com/Sage-Bionetworks/sage-monorepo.git -$ git remote -v -> ... -> upstream https://github.com/Sage-Bionetworks/sage-monorepo.git (fetch) -> upstream https://github.com/Sage-Bionetworks/sage-monorepo.git (push) -``` - -On your local machine make sure you have the latest version of the `main` branch -from this upstream repository: - -```console -git checkout main -git fetch upstream -git rebase upstream/main -``` - -### Setup Development Environment - -This project relies on Node tools and project-specific commands defined in -[package.json] to streamline the development and testing. The command below will -install the required development tools. - -Source `dev-env.sh`. - - . dev-env.sh - -Prepare the development environment. - - openchallenges-prepare - -### Linting - -Lint all the projects. - - yarn lint - -### Testing - -Build and test all the projects. - -```console -yarn build -yarn test -``` - -### Start the OpenChallenges - -Start the web app and its dependencies (API, API database). - - yarn start - -## Release Procedure - -Maintainers are required to follow the procedure below when creating a new -release. - -TBA - -## Getting Help - -Join us on the XXX and post your question to the channel that best matches the -topic of your request. - - - -[Code of Conduct]: CODE-OF-CONDUCT.md -[upstream remote]: https://help.github.com/en/articles/configuring-a-remote-for-a-fork -[reaction]: https://github.blog/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/ -[Forking Workflow]: https://www.atlassian.com/git/tutorials/comparing-workflows/forking-workflow -[package.json]: ../package.json -[README.md]: ../README.md +Please read the Contributing guidelines on the docs site. \ No newline at end of file diff --git a/docs/angular-universal.md b/docs/angular-universal.md index e1636393ea..44b8aa6e38 100644 --- a/docs/angular-universal.md +++ b/docs/angular-universal.md @@ -1,7 +1,3 @@ -# Angular Universal - -## Introduction - The article [Angular Universal: a Complete Practical Guide] offers an excellent introduction to Angular Universal, server-side rendering (SSR) and search engine optimization (SEO). diff --git a/docs/app-styles-themes-assets.md b/docs/app-styles-themes-assets.md index 5316009edf..b244bd80bb 100644 --- a/docs/app-styles-themes-assets.md +++ b/docs/app-styles-themes-assets.md @@ -1,7 +1,3 @@ -# App Styles, Themes and Assets - -## Overview - This document describes how SCSS styles, themes and assets are organized across a web app and its libraries. diff --git a/docs/bug-report.md b/docs/bug-report.md new file mode 100644 index 0000000000..10394f16d6 --- /dev/null +++ b/docs/bug-report.md @@ -0,0 +1,9 @@ +Issues should be used to report problems with this project, request a new +feature, or to discuss potential changes before a PR is created. When you create +a new Issue, a template will be loaded that will guide you through collecting +and providing the information we need to investigate. + +If you find an Issue that addresses the problem you're having, please add your +own reproduction information to the existing issue rather than creating a new +one. Adding a [reaction] can also help be indicating to our maintainers that a +particular problem is affecting more than just the reporter. diff --git a/docs/changelog.md b/docs/changelog.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/code-of-conduct.md b/docs/code-of-conduct.md new file mode 100644 index 0000000000..f0042a38a8 --- /dev/null +++ b/docs/code-of-conduct.md @@ -0,0 +1,5 @@ +We take our open source community seriously and hold ourselves and other +contributors to high standards of communication. By participating and +contributing to this project, you agree to uphold our [Code of Conduct]. + +[Code of Conduct]: CODE-OF-CONDUCT.md \ No newline at end of file diff --git a/docs/collect-challenge-logs-and-system-metrics.md b/docs/collect-challenge-logs-and-system-metrics.md index ff06c1abf9..94e9b0a22a 100644 --- a/docs/collect-challenge-logs-and-system-metrics.md +++ b/docs/collect-challenge-logs-and-system-metrics.md @@ -1,7 +1,3 @@ -# Collect Challenge Logs and System Metrics - -## Overview - This document describes how to centralize and explore the logs and system metrics generated by a fleet of hosts (EC2 instances) and Docker containers. The instructions are provided in the context of monitoring hosts and containers during a scientific challenge organized by Sage Bionetworks. diff --git a/docs/contributing-guidelines.md b/docs/contributing-guidelines.md new file mode 100644 index 0000000000..1b77390d27 --- /dev/null +++ b/docs/contributing-guidelines.md @@ -0,0 +1,23 @@ +A big welcome and thank you for considering contributing to this project. + +This project is a community effort and lives off your contributions, be it in +the form of bug reports, feature requests, discussions, or fixes and other code +changes. + +Reading and following these guidelines will help us make the contribution +process easy and effective for everyone involved. It also communicates that you +agree to respect the time of the developers managing and developing these open +source projects. In return, we will reciprocate that respect by addressing your +issue, assessing changes, and helping you finalize your pull requests. + + +## Getting Started + +Contributions are made to this repo via Issues and Pull Requests (PRs). A few +general guidelines that cover both: + +- Search for existing Issues and PRs before creating your own. +- We work hard to makes sure issues are handled in a timely manner but, + depending on the impact, it could take a while to investigate the root cause. + A friendly ping in the comment thread to the submitter or a contributor can + help draw attention if your issue is blocking. diff --git a/docs/contributing.md b/docs/contributing.md new file mode 100644 index 0000000000..95c37825c8 --- /dev/null +++ b/docs/contributing.md @@ -0,0 +1,104 @@ +PRs to our repositories are always welcome and can be a quick way to get your +fix or improvement slated for the next release. In general, PRs should: + +- Only fix/add the functionality in question **OR** address wide-spread + whitespace/style issues, not both. +- Add unit or integration tests for fixed or changed functionality (if a test + suite already exists). +- Address a single concern in the least number of changed lines as possible. +- Include documentation in the repo or on our [docs site]. +- Be accompanied by a complete Pull Request template (loaded automatically when + a PR is created). + +For changes that address core functionality or would require breaking changes +(e.g. a major release), it's best to open an Issue to discuss your proposal +first. This is not required but can save time creating and reviewing changes. + +In general, we follow the [Forking Workflow]: + +1. Fork the repository to your own Github account +2. Clone the project to your machine +3. Create a branch locally with a succinct but descriptive name + + git checkout -b <new-branch> main + +4. Commit changes to the branch +5. Following any formatting and testing guidelines specific to this repo +6. Push changes to your fork +7. Open a PR in our repository and follow the PR template so that we can + efficiently review the changes. + +We recommend that you add this repository as an [upstream remote] to your local +git repository so that you can fetch the latest updates. + +```console +$ git remote add upstream https://github.com/Sage-Bionetworks/sage-monorepo.git +$ git remote -v +> ... +> upstream https://github.com/Sage-Bionetworks/sage-monorepo.git (fetch) +> upstream https://github.com/Sage-Bionetworks/sage-monorepo.git (push) +``` + +On your local machine make sure you have the latest version of the `main` branch +from this upstream repository: + +```console +git checkout main +git fetch upstream +git rebase upstream/main +``` + +### Setup Development Environment + +This project relies on Node tools and project-specific commands defined in +[package.json] to streamline the development and testing. The command below will +install the required development tools. + +Source `dev-env.sh`. + + . dev-env.sh + +Prepare the development environment. + + openchallenges-prepare + +### Linting + +Lint all the projects. + + yarn lint + +### Testing + +Build and test all the projects. + +```console +yarn build +yarn test +``` + +### Start the OpenChallenges + +Start the web app and its dependencies (API, API database). + + yarn start + +## Release Procedure + +Maintainers are required to follow the procedure below when creating a new +release. + +TBA + +## Getting Help + +Join us on the XXX and post your question to the channel that best matches the +topic of your request. + + + +[upstream remote]: https://help.github.com/en/articles/configuring-a-remote-for-a-fork +[reaction]: https://github.blog/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/ +[Forking Workflow]: https://www.atlassian.com/git/tutorials/comparing-workflows/forking-workflow +[package.json]: ../package.json +[README.md]: ../README.md diff --git a/docs/create-a-new-angular-component.md b/docs/create-a-new-angular-component.md index 62d54501f7..88f0e1a2c7 100644 --- a/docs/create-a-new-angular-component.md +++ b/docs/create-a-new-angular-component.md @@ -1,17 +1,3 @@ -# Create a new Angular App Component - -In this document: - -- [Overview](#overview) -- [Create a new Angular library](#1-create-a-new-angular-library) -- [Create a new Angular component](#2-create-a-new-angular-component) -- [Add routing](#3-add-routing) -- [Time to test! ☕](#4-time-to-test-) -- [Import code from the Figma-to-Code export](#5-import-code-from-the-figma-to-code-export) -- [Update themes](#6-update-themes) - -## Overview - This doc describes how to create a new library + component in the OpenChallenges app, though the steps can be applied to any app in this project. This doc will also include information on where/how to copy-paste code from the [Figma-to-code export] into the app (starting at [Step 5]). diff --git a/docs/devcontainer.md b/docs/devcontainer.md index e51b117cc7..4e458adeab 100644 --- a/docs/devcontainer.md +++ b/docs/devcontainer.md @@ -1,7 +1,3 @@ -# Developing inside a Container - -## Overview - This document describes how to configure and develop in the dev container specified by this repository. The goal is to provide developers with the same development environment that is mainly isolated from their host. This method promotes reproducibility and remove the need to install diff --git a/docs/develop-on-a-remote-host.md b/docs/develop-on-a-remote-host.md index de8f208dfd..3cba374277 100644 --- a/docs/develop-on-a-remote-host.md +++ b/docs/develop-on-a-remote-host.md @@ -1,7 +1,3 @@ -# Develop on a remote host - -## Introduction - Team members who develop locally may not benefit from the same compute resources. The most notable resources that can impact the productivity of developers are the number and frequency of the CPU cores, the memory available and internet speed. The worse case is when a machine does not have the diff --git a/docs/figma-to-code.md b/docs/figma-to-code.md index 64478b7f5d..282cf77aa3 100644 --- a/docs/figma-to-code.md +++ b/docs/figma-to-code.md @@ -1,17 +1,9 @@ -# Figma to Code - -## Overview - Often times, it can be quite time-consuming to go from design concepts to code. With the Challenge Registry, we hope to alleviate this hurdle by utilizing TeleportHQ's Figma-to-code capability. [TeleportHQ] is an online collaborative platform meant for front-end development, in which a static website can either be built from scratch, or, in our case, from pre-defined components and frames created in Figma. -## Development workflow - -TODO - ## Requirements * Figma account (free plan) diff --git a/docs/images/logo-1.png b/docs/images/logo-1.png new file mode 100644 index 0000000000..73c8b557f6 Binary files /dev/null and b/docs/images/logo-1.png differ diff --git a/docs/images/sage.png b/docs/images/sage.png new file mode 100644 index 0000000000..6d31375bf3 Binary files /dev/null and b/docs/images/sage.png differ diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000000..d74a361692 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,72 @@ +![cnb-tools](images/logo-1.png) + +Sage Monorepo CI/CD +Sage Monorepo License + +--- + +Get started with Sage Monorepo, learn the fundamentals and explore advanced topics. + +- [Overview of Sage Monorepo] +- Cheat Sheet (coming soon) +- [Docs](docs) + +## Development Setup + +### Requirements + +- [Docker Engine] OR [GitHub Codespace] +- [Visual Studio Code] + +### Open Sage Monorepo in VS Code + +**Option 1**: Click on the button shown below to open Sage Monorepo in its [development container] +with VS Code. This option is suitable if you want to explore the content of Sage Monorepo. + +[![Open in Dev Containers](https://img.shields.io/static/v1?label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode&style=for-the-badge)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/Sage-Bionetworks/sage-monorepo 'Open in VS Code Dev Containers') + +**Option 2**: If you plan to contribute to this project, please [create a fork] and use its URL for +cloning. For more information on contributing and/or our Forking Workflow, see +[CONTRIBUTING.md](CONTRIBUTING.md). + + +```console +$ git clone --filter=blob:none +---> 100% +Resolving deltas: 100% (...), done. +``` + +Then open your fork repo inside our dev container using these instructions: + +- [Developing inside a Container](./docs/devcontainer.md) +- [Develop on a remote host](./docs/develop-on-a-remote-host.md) (optional) + +## Ecosystem + +- Java +- Node.js +- Python +- R + + +## Projects + +- OpenChallenges +- Schematic (evaluation) +- Synapse (evaluation) + +--- + +Love Sage Monorepo and its projects? Give our repo a star ⭐. + + + +[docker engine]: https://docs.docker.com/get-docker/ +[visual studio code]: https://code.visualstudio.com/ +[apache license 2.0]: https://github.com/Sage-Bionetworks/sage-monorepo/blob/main/LICENSE.txt +[GitHub Codespace]: https://github.com/features/codespaces +[Overview of Sage Monorepo]: https://docs.google.com/document/d/12oA-Uol_NsWUtC9LHlAlpcgZXXY9jkxFXqK2EMF96XM +[Code of Conduct]: CODE_OF_CONDUCT.md +[contributing]: CONTRIBUTING.md +[development container]: https://containers.dev/ +[create a fork]: https://github.com/Sage-Bionetworks/sage-monorepo/fork diff --git a/docs/libraries.md b/docs/libraries.md index 5f4cd14cb3..b43fd429a2 100644 --- a/docs/libraries.md +++ b/docs/libraries.md @@ -1,7 +1,3 @@ -# Libraries - -## Overview - This document explains how to create Angular and Web Components libraries. ## Angular library diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000000..8fe7d72c27 --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,85 @@ +# Project +site_name: "Sage Monorepo" +site_description: >- + A development environment for building robust apps faster. + +# Repository +repo_url: https://github.com/Sage-Bionetworks/sage-monorepo +repo_name: sage-monorepo + +# Navigation +nav: + - Home: + - Home: index.md + - Changelog: changelog.md + - Contributing: + - Overview: contributing-guidelines.md + - Reporting a bug: bug-report.md + - Adding a feature: contributing.md + - Code of conduct: code-of-conduct.md + - Getting Started: + - Angular Universal: angular-universal.md + - Devcontainer: devcontainer.md + - Nx: using-nx.md + - Remote host: develop-on-a-remote-host.md + - Setup: + - Figma-to-Code: figma-to-code.md + - Using styles/themes: app-styles-themes-assets.md + - Create a new library: libraries.md + - Create a new component: create-a-new-angular-component.md + - Monitor the stack: stack-monitoring.md + - Collect logs and system metrics: collect-challenge-logs-and-system-metrics.md + - Update tools and dependencies: update-dependencies.md + - Code coverage: coverage.md + - Cheat Sheets: + - VSCode: vscode-cheat-sheet.md + - Java: java-cheat-sheed.md + - OpenChallenges: cheat-sheet.md + - References: + - references.md + - Linters and formatters: linters-and-formatters.md + - FAQ: faq.md + +# Theme configuration +theme: + name: material + palette: + - media: "(prefers-color-scheme: light)" + scheme: default + primary: teal + toggle: + icon: material/toggle-switch-off-outline + name: Switch to dark mode + - media: "(prefers-color-scheme: dark)" + scheme: slate + primary: deep purple + toggle: + icon: material/toggle-switch + name: Switch to light mode + logo: images/sage.png + icon: + admonition: + note: octicons/tag-16 + info: octicons/info-16 + features: + - content.code.copy + - navigation.tabs + - navigation.footer + - navigation.sections + - search.highlight + - search.share + - search.suggest + - toc.follow + +plugins: +- search +- mkdocstrings +- autorefs +- termynal + +markdown_extensions: + - admonition + - pymdownx.details + - pymdownx.superfences + - toc: + permalink: true