the-coven

A TypeScript SDK for interacting with magical spells and recipes

Downloads
458
Stars
1

The Coven - Your SpellCasting Companion

Welcome to The Coven's SpellCasting Companion, an Nx-powered monorepo for managing and casting magical spells!

This project is created for the purpose of the Squiggle Conf 2024 workshop Build Editor Extensions with the Makers of Nx Console.

You can see it live at the-coven.vercel.app.

Project Structure

This Nx workspace is organized into the following apps and libraries:

.
 apps
    codex-arcana-jetbrains  # JetBrains IDE plugin
    codex-arcana-vscode     # Visual Studio Code extension
    spells                  # Next.js application for spellcasting
 libs
    shared
       util-interface      # Shared TypeScript interfaces and types
    spellcasting-sdk        # SDK for interacting with the API

Documentation

API and SDK documentation can be found in the respective project directories.

Getting Started

Prerequisites

  • Node.js (v18 or later)
  • npm or Yarn or pnpm
  • JetBrains IDE (for the JetBrains plugin)
  • Visual Studio Code (for the VS Code extension)

Installation

  1. Clone the repository:

    git clone [email protected]:MaxKless/the-coven.git
    cd the-coven
    
  2. Install dependencies:

    npm install
    

Running the Project

  1. Start the spells application:

    npx nx serve spells
    
  2. In a new terminal window, go to the spells directory and run partykit:

    cd apps/spells
    npx partykit dev
    
  3. Open your browser and navigate to http://localhost:3000 to view the application.

Development

JetBrains Plugin (apps/codex-arcana-jetbrains)

To build the JetBrains plugin:

npx nx build codex-arcana-jetbrains

VS Code Extension (apps/codex-arcana-vscode)

To build the VS Code extension:

npx nx build codex-arcana-vscode

Building Projects

To create a production build of a project:

npx nx build <project-name>

For example:

npx nx build spells

Running Tests

To run tests for all projects:

npx nx run-many --target=test --all

To run tests for a specific project:

npx nx test <project-name>

Linting

To lint all projects:

npx nx run-many --target=lint --all

To lint a specific project:

npx nx lint <project-name>

Useful Nx Commands

  • npx nx graph: Visually explore the project graph
  • npx nx affected:graph: See what's been affected by your changes
  • npx nx show project <project-name>: See available targets for a project

Learn More About Nx

Max & Katerina links

Community

Join the Nx community:

Additional Information

  • The project uses PartyKit for real-time functionality. See partykit.json and server.ts in the spells app for configuration.
  • The spells application uses Next.js and includes API routes for spell casting, ingredients, incantations, and recipes.
  • The project includes ESLint configurations for code linting.
  • Jest and Vitest are set up for testing.
  • The libs/shared/util-interface contains shared TypeScript interfaces and types used across the project.
  • The libs/spellcasting-sdk provides a convenient SDK for interacting with the spellcasting API.