Detalhes do pacote

@powerhousedao/academy

This documentation website is built using Docusaurus, a modern static website generator. To contribute to the documentation please work on a feature branch in case of big refactors, and build & serve before pushing to the develop

readme (leia-me)

Ask DeepWiki


Powerhouse Monorepo

This repository uses pnpm workspaces and Nx to manage a monorepo with multiple projects and packages.

Table of Contents

How to Run this Repo

  1. Clone the repo
     git clone <repo-url>
     cd <repo-directory>
    
  2. Install the dependencies: pnpm install
  3. Build with: pnpm build
  4. Run a project or app: npx nx <run_command_for_the_package_or_app> <package_or_app_name>;

For example, to run the Switchboard application in /apps/switchboard/, use npx nx start @powerhousedao/switchboard.

Linking Dependencies Between Projects and Packages

To link a dependency into a project, add it to your package.json and point the dependency version to workspace:*

package.json

{
  "name": "my-new-package",
  "version": "0.0.0",
  "scripts": {
    ...
  },
  "dependencies": {
    ...
    "@pgph/pkg-a": "workspace:*", // Link to a local dependency
    "@pgph/pkg-b": "workspace:*",
    "@pgph/pkg-c": "workspace:*"
  }
}

Adding a New Package or App

Pre-steps

  1. Ensure that your package/app is properly configured to be built and published/released.
  2. If deploying a package to npm, ensure that bundled files are included in the publish workflow and exclude unnecessary files (test files, config, etc.).

Steps

  1. Add your package/app into the respective folder (packages/* or apps/*).
  2. Install the dependencies: pnpm install
  3. Ensure that your package.json points to version 0.0.0
  4. Commit your changes: git commit -m "feat(<your_new_package_name>)!: initial package setup"
  5. If pushing a new package to be deployed to npm, build the package first: npx nx <build_command> <your_new_package_name>
  6. Perform an initial test release in your local environment: npx nx release --first-release --projects=<your_new_package_name> --dry-run
  7. Perform the initial release in your local environment: (This step is required, otherwise releases from CI are not going to work): npx nx release --first-release --projects=<your_new_package_name>
    • This process will create a new tag and release in GitHub, and push the new tag to GitHub.
    • You'll be prompted if you want to create the release manually in your browser (this is going to prefill all the info for the release for you). Answer "yes" and verify in your browser that the release information is correct. Publish the release in github.
    • Finally you'll be prompted if you want to publish the release to npm: answer "yes" if this is required for your package.
  8. Add your package/app to the release GitHub Action workflow: If adding a new package to be released to npm, update the .github/worflows/release-package.yml:

     ---
     name: Release Package
    
     on:
     workflow_dispatch:
         inputs:
         package:
             description: 'Choose a package'
             required: true
             default: 'packages/*'
             type: choice
             options:
                 - '@pgph/pkg-a'
                 - '@pgph/pkg-b'
                 - '@pgph/pkg-c'
                 - <add_your_new_package_name_here>
                 - 'packages/*'
    

    If adding a new app or a package requiring a special workflow, set up a new release configuration:

    ```yml

    name: Your Custom Release

    on: workflow_dispatch:

jobs:
build:
    name: ...
    runs-on: ...
    permissions:
    contents: write
    id-token: write
    steps:
    ...
    - name: git config
        shell: bash
        run: |
        git config user.name "Github Actions Bot"
        git config user.email "-"

    - name: Update pkg version
        run: npx nx release --projects=<your_new_package/app_name> --skip-publish
        shell: bash
        env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    ...

```
  1. Trigger future releases directly from GitHub Actions.

Using Docker

This project can be run using Docker and Docker Compose. The docker-compose.yml file in the root directory defines the services and their configurations.

Prerequisites

  • Docker Engine (version 20.10.0 or later)
  • Docker Compose (version 2.0.0 or later)

Basic Usage

  1. Build and start all services:

     docker compose up
    
  2. Run in detached mode (background):

     docker compose up -d
    
  3. View running containers:

     docker compose ps
    
  4. View logs:

     docker compose logs -f
    
  5. Stop all services:

     docker compose down
    

Working with Individual Services

The docker-compose.yml file defines multiple services. You can work with individual services by specifying the service name:

# Start a specific service
docker compose up switchboard    # Start the Switchboard service
docker compose up connect       # Start the Connect service

# View logs for a specific service
docker compose logs -f switchboard    # View Switchboard logs
docker compose logs -f connect       # View Connect logs

# Rebuild a specific service
docker compose up -d --build switchboard    # Rebuild and start Switchboard
docker compose up -d --build connect       # Rebuild and start Connect

Development Tips

  • Use docker compose up --build to ensure you're running with the latest changes
  • The docker-compose.yml file includes development-specific configurations
  • Environment variables can be configured in the .env file
  • For production deployments, use the docker-compose.prod.yml configuration

How to contribute to this project

Packages:

Currently, only the main branch is enabled in this project, which means all packages are deployed to NPM from the main branch. To contribute to a package, please follow these steps:

  1. Create a feature branch from the main branch:

     git pull origin main
     git checkout main
     git checkout -b feature/my-branch
    
  2. Make your changes in the feature branch.

  3. Once your changes are ready, commit them following the conventional commits standard:
    • Try to keep your commits scoped (do not include files from multiple packages in a single commit).
    • Include the package scope affected by your changes in the commit message, for example:
        git commit -m "feat(document-model): my commit message"
      
  4. Push your branch to GitHub and open a pull request (PR) against the main branch.
  5. Once your PR is approved, merge it.
  6. A GitHub Action will be triggered automatically after you merge your PR. This action will handle versioning and release the new version of the affected packages to NPM. Optionally, you can trigger the deployment of your package manually

changelog (log de mudanças)

3.1.2 (2025-06-26)

This was a version bump only for @powerhousedao/academy to align it with other projects, there were no code changes.

3.1.1 (2025-06-23)

This was a version bump only for @powerhousedao/academy to align it with other projects, there were no code changes.

3.1.0 (2025-06-18)

This was a version bump only for @powerhousedao/academy to align it with other projects, there were no code changes.

2.5.0-staging.3 (2025-06-18)

This was a version bump only for @powerhousedao/academy to align it with other projects, there were no code changes.

2.5.0-staging.2 (2025-06-18)

🚀 Features

  • connect,builder-tools,ph-cli: added support for path argument on ph connect build and preview (fe049aae8)
  • add app skeleton to html at build time (1882bb820)
  • reactor: initial event-bus implementation with tests and benchmarks (ef5b3c42e)

🩹 Fixes

  • deploy not on push to main (63eef7020)
  • deploy powerhouse to available environments (a45859a22)
  • ph-cli: install and uninstall packages with and without version tag (c2a4ad13f)
  • connect: set proper tag on docker build (598c1b3fb)

❤️ Thank You

  • acaldas @acaldas
  • Benjamin Jordan (@thegoldenmule)
  • Frank

2.5.0-staging.1 (2025-06-13)

🚀 Features

  • start dependent services with switchboard (188c82c6a)
  • added hostnames in docker compose (a590eea17)
  • docker-compose: work with published images (9f31b70fb)
  • ci: build and publish docker images on newly created tags (ee930c4a4)
  • added docker publish workflow (adf65ef8a)
  • show app skeleton while loading and accessibility fixes (4f96e2472)
  • improved analytics frontend integration (269aed50c)
  • connect: updated diff-analyzer processor (ce5d1219f)
  • run analytics db on web worker (ecf79575f)

🩹 Fixes

❤️ Thank You

  • acaldas
  • Frank

2.5.0-staging.0 (2025-06-05)

This was a version bump only for @powerhousedao/academy to align it with other projects, there were no code changes.

2.5.0-dev.9 (2025-06-05)

This was a version bump only for @powerhousedao/academy to align it with other projects, there were no code changes.

2.5.0-dev.8 (2025-06-05)

This was a version bump only for @powerhousedao/academy to align it with other projects, there were no code changes.

2.5.0-dev.7 (2025-06-05)

This was a version bump only for @powerhousedao/academy to align it with other projects, there were no code changes.

2.5.0-dev.6 (2025-06-05)

🩹 Fixes

  • set node 22 in release branch workflow (b33681938)

❤️ Thank You

  • Frank

2.5.0-dev.5 (2025-06-05)

This was a version bump only for @powerhousedao/academy to align it with other projects, there were no code changes.

2.5.0-dev.4 (2025-06-05)

🩹 Fixes

  • builder-tools: move esbuild dev dep to deps (baa22be6f)

❤️ Thank You

  • ryanwolhuter @ryanwolhuter

2.5.0-dev.3 (2025-06-05)

🚀 Features

  • builder-tools: add node polyfills esbuild plugin for connect build (43dd16b4d)

❤️ Thank You

  • ryanwolhuter

2.5.0-dev.2 (2025-06-05)

This was a version bump only for @powerhousedao/academy to align it with other projects, there were no code changes.

2.5.0-dev.1 (2025-06-05)

This was a version bump only for @powerhousedao/academy to align it with other projects, there were no code changes.

2.5.0-dev.0 (2025-06-04)

🚀 Features

  • academy: centralize husky & auto-update cli docs (8c92e0bb1)
  • ph-cli: added setup-service command (dfa082aa6)
  • scripts: updated setup scripts (9f7fa7644)
  • enforce conventional commits (faa49da40)
  • removed scalars package (d6f7059a7)
  • enabled switchboard command (5a9c467bf)
  • removed scalars dependencies (596aedbd5)
  • builder-tools: handle recursive objects in initial state generator (c9eedcc43)
  • monorepo: bump graphql lib (ba9d5d338)
  • monorepo: handle updating monorepo build deps (db2ac2316)
  • monorepo: regenerate lockfile (a6c390b4e)
  • builder-tools: fix wrong value used for field id (a6c6142e0)
  • reactor-api,reactor-local: updated analytics dependencies (cbeace573)

🩹 Fixes

  • academy: docker build (58e83be09)
  • academy: lockfile issue second time' (6208fe614)
  • academy: fix frozen lockfile issue' (80f18ec73)
  • academy: fix frozen lockfile issue (bfc3dcd21)
  • pre-commit: use bash syntax and shebang (da00ff581)
  • added missing dep to academy (4ec6c8278)
  • academy: clean up husky script (e18e26cd8)
  • academy: deployment (36e5f194d)
  • switchboard: docker build (7052e39e1)
  • docker build with PH_PACKAGES (856ac1187)
  • document-drive: fix type issue on browser storage (240a78b41)
  • ph-cli: ph add does not remove installed packages (aedfbf56e)
  • remove .env and add to .gitignore (0d2d48684)
  • switchboard,reactor-local: latest version of sky atlas was not being installed (72bf72fd4)

❤️ Thank You

  • acaldas @acaldas
  • Benjamin Jordan
  • Callme-T
  • Frank
  • Guillermo Puente @gpuente
  • ryanwolhuter @ryanwolhuter

0.1.0-dev.6 (2025-06-04)

🩹 Fixes

❤️ Thank You

  • Frank

0.1.0-dev.5 (2025-06-03)

🩹 Fixes

  • academy: lockfile issue second time' (6208fe614)
  • academy: fix frozen lockfile issue' (80f18ec73)
  • academy: fix frozen lockfile issue (bfc3dcd21)

❤️ Thank You

  • Callme-T

0.1.0-dev.4 (2025-06-03)

🚀 Features

  • academy: centralize husky & auto-update cli docs (8c92e0bb1)
  • ph-cli: added setup-service command (dfa082aa6)
  • scripts: updated setup scripts (9f7fa7644)

🩹 Fixes

  • pre-commit: use bash syntax and shebang (da00ff581)
  • added missing dep to academy (4ec6c8278)
  • academy: clean up husky script (e18e26cd8)

❤️ Thank You

  • Callme-T
  • Frank
  • Guillermo Puente @gpuente

0.1.0-dev.3 (2025-05-27)

🚀 Features

❤️ Thank You

  • Frank

0.1.0-dev.2 (2025-05-26)

🩹 Fixes

❤️ Thank You

  • Frank

0.1.0-dev.1 (2025-05-25)

🚀 Features

  • academy: added authorization docs (470231bfd)

❤️ Thank You

  • Frank

0.1.0-dev.0 (2025-05-24)

🚀 Features

  • academy: added authorization docs (470231bfd)

❤️ Thank You

  • Frank