(adsbygoogle = window.adsbygoogle || []).push({});

Development

This page may include outdated information.

Architecture

The OpenUPM service is composed of below sub-systems:

  • Public upm registry
  • *Automatic build pipelines
  • *Website next
  • *Website backend (API)
  • *Package curated list
  • OpenUPM-CLIopen in new window command-line tool

Entries with * prefix are located in the main repositoryopen in new window.

Directory Structure

.
├── src          # backend
│   ├── node       # node.js server
│   ├── shared     # shared code between node and client
├── data         # linked data folder
├── docs         # website frontend (vuepress)
└── test        # unit tests

Public UPM Registry

OpenUPM uses a custom verdaccio to host the registry. Though verdaccio is the most popular open-source project to set up a private npm registry, most deployments served a very limited user base or for the testing purpose that doesn't care about performance much. OpenUPM try to solve quite a few issues related to the cluster deployment. Before these PRs get merged, OpenUPM will stay with the custom build:

Since OpenUPM has it's own way to organize the package list, the verdaccio website and API endpoints are disabled (headless mode).

Automatic Build Pipelines

OpenUPM watches the package curated list regularly detects new contents and uses the job queue to build packages through Azure Pipelinesopen in new window.

Cronjob

OpenUPM uses pm2 cron feature to run cronjobs.

JobDescriptionGitHub Reset APIGitHub GraphQL API
add-build-package-jobadd build-pkg to the job queue.
fetch-package-extrafetch package README, stars, ogimagen2n
aggregate-package-extraaggregate package extra
update-recent-packagesupdate recent updated packages
fetch-site-infofetch repo stars1
update-feedsupdate RSS feeds

Job Queue

OpenUPM uses Bee-Queueopen in new window to manage the job queue.

JobDescriptionGitHub API
build-pkg:<pkg>fetch repo info and create build-rel jobs for valid Git tags0
build-rel:<pkg>:<ver>build pkg@version via Azure Pipelines0

GitHub Rate Limit

Print the rate limitopen in new window status.

yarn gh:ratelimit

Website Frontend

OpenUPM uses VuePressopen in new window - a static website generator to develop website next.

source env.sh
yarn docs:dev

To enable webpack bundle analyzer:

WEBPACK_BUNDLE_ANALYZER=1 yarn docs:build

Website Backend

OpenUPM uses Expressopen in new window to develop website backend (API).

yarn server:dev

Package Curated List

OpenUPM uses git as a database to maintain the package curated list. Each package is described as a YAML file.

i18n

The website supports two regions with different configurations:

RegionLanguageFallback Language
USen-USn/a
CNzh-CNen-US
  • The documentation level translations are located at docs/zh.

  • The component level translations are located at docs/.vuepress/locales. i18n-allyopen in new window is powerful i18n extensions for VS Code to edit locale files.

  • To develop the CN region:

    VITE_OPENUPM_REGION=cn npm run docs:dev