Skip to content

Latest commit

 

History

History
75 lines (55 loc) · 3.25 KB

HACKING.md

File metadata and controls

75 lines (55 loc) · 3.25 KB

General Tips

You can start editing the page by modifying pages/index.tsx. The page auto-updates as you edit the file.

API routes can be accessed on http://localhost:3000/api/hello. This endpoint can be edited in pages/api/hello.ts.

The pages/api directory is mapped to /api/*. Files in this directory are treated as API routes instead of React pages.

Local Integerated Development Setup

Ozone requires a PDS service to talk to, and it is convenient to point it to a local dev-env instance for testing during development.

  1. In the separate atproto project, run the dev server using yarn workspace @atproto/dev-env start. This will run a PDS, seeded with some users and data for you.
  2. Run the development server for Ozone using yarn dev. This will start running the Ozone frontend at http://localhost:3000.
  3. Navigate to the login page in your browser, at http://localhost:3000.
  4. Login using the atproto dev-env credentials, which you can find here. For development some example login credentials that would work are:

You can also test with different permission levels with the following credentials (/)

  • Triage: triage.test/triage-pass
  • Triage: admin-mod.test/admin-mod-pass

Working with unpublished changes to the @atproto/api package

In the course of development there may be updates to the atproto client that are not yet published to npm, but you would like to use with Ozone. Here's the workflow for using unpublished changes to the @atproto/api package:

  1. Ensure the atproto/ project lives as a sibling to the ozone/ project on your filesystem (or adjust the path used in step 4).

    ~/Documents/bluesky
    ❯ ls -l
    total 19856
    drwxr-xr-x  22 user  group  704 Jan 19 15:51 atproto
    drwxr-xr-x  24 user  group  768 Jan 24 19:17 ozone
    
  2. Checkout whichever branch you'd like to use in atproto/ for the @atproto/api package.

    ~/Documents/bluesky
    ❯ cd atproto
    ~/Documents/bluesky/atproto
    ❯ git checkout main
    
  3. Build the @atproto/api package in atproto/.

    ~/Documents/bluesky/atproto
    ❯ yarn
    
  4. Update the package.json file in ozone/ to reference the local build of @atproto/api.

       "dependencies": {
    -    "@atproto/api": "^0.0.3",
    +    "@atproto/api": "link:../atproto/packages/api/dist",
         "@headlessui/react": "^1.7.7",
  5. Ask yarn to reinstall, creating the link from ozone/ to the local build of @atproto/api.

    ~/Documents/bluesky/ozone
    ❯ yarn
    
  6. Take care not to check-in the changes to package.json and yarn.lock that came from the temporary linking. When you're done, you can reset everything with:

    ~/Documents/bluesky/ozone
    ❯ git checkout package.json yarn.lock && yarn