Nothing Special   »   [go: up one dir, main page]

Skip to content

Latest commit

 

History

History
71 lines (44 loc) · 3.62 KB

DEVELOPING.md

File metadata and controls

71 lines (44 loc) · 3.62 KB

Developing Condict

Getting a development version of Condict up and running is a slightly involved process. Keep in mind Condict is a work in progress, and many features are missing, including documentation.

Prerequisites

  • Node.js version 16 or higher with npm
    • Yarn is not recommended for this project
  • A working C++ compiler for building native modules
    • node-gyp is installed as a dependency where needed – see its documentation for setup instructions
    • On Windows, you must install Visual Studio Build Tools or a version of Visual Studio – version 2019 or later is strongly recommended

Limitations

The @condict/server package relies on a few packages with native bindings, and contains a native package of its own. These must be rebuilt separately for Node and Electron. When running the server directly (or through @condict/http-server), you cannot start the app. When developing the app, you cannot start the server directly.

When you use npm run dev:server or npm run dev:app, the build scripts automatically recompile native dependencies for the correct platform if necessary.

Getting started

If you're using Git, first run this in the repo root: git update-index --skip-worktree packages/*/dist/cli.js

These cli.js files are provided so that subsequent commands work on Windows without any extra faff. They will be replaced when the respective packages are rebuilt, so we need to tell Git to ignore changes to them.

Run initial setup: npm run setup

This will install all dependencies, bootstrap packages with Lerna and build everything. It may take a few minutes.

Developing UI components

  1. In the repo root, run npm run dev:ui
  2. Open http://localhost:3000 in a web browser for a component playground

Source files for the UI component playground are in dev/.

Note: If another process is listening on port 3000, this command will fail. Close the process that is listening on port 3000.

Developing the server

  1. In the repo root, run npm run dev:server
  2. In a different terminal:
    1. cd packages/http-server
    2. First time only: cp config.json.example config.json
    3. Please edit config.json file if you wish to customize logging and the database location.
    4. npm start

When the server is running, a GraphQL sandbox will be accessible at http://localhost:4000. If you have set a different port in the config, connect to that port instead of 4000.

Important: The GraphQL sandbox is not served locally. It's an embedded version of Apollo Sandbox. You must be connected to the internet to use it. If you do not wish to use it, you can query the server from any GraphQL client of your choice.

The server does not automatically reload on recompilation. You must restart it manually when you make changes. Additionally, if you edit the native code in src-cpp/, you must run npm run build:native to recompile the native bindings.

Developing the app

  1. npm run dev:app
  2. In a different terminal:
    1. cd packages/app
    2. npm start

The app does not automatically reload on recompilation. You must manually reload the server when you make changes (Ctrl+R or ⌘ Command+R).

Now you should have a Condict window. Have fun!

Having trouble?

If these instructions don't work, that's considered a documentation bug. Please consider filing an issue to get help!