Skip to content

source-cooperative/components

Repository files navigation

Source Cooperative Monorepo

This is a monorepo for the Source Cooperative project. It contains the following packages and apps:

  • @source-cooperative/cli: A command-line interface for administrating the Source Cooperative database. The code is in the packages/cli directory.
  • @source-cooperative/components: A collection of reusable React components. The code is in the packages/components directory. It require React and Next.js, since some use Next.js (next/link, next/router).
  • @source-cooperative/components-demo: A demo app for the components. The code is in the apps/components-demo directory.
  • @source-cooperative/viewers: The https://viewers.source.coop webapp. It aims at exploring large remote files in the browser. The code is in the apps/viewers directory.

Creating or improving a component

For more information on how to contribute to this project, see the contribution guide.

Monorepo

The monorepo is managed with npm workspaces. It contains three workspaces: @source-cooperative/components, and two other that depend on it: @source-cooperative/components-demo and @source-cooperative/viewers .

Install

To install:

npm install

Build

To build the workspaces:

npm run build -ws

To build only one workspace, launch one of the following commands:

npm run build -w @source-cooperative/components
npm run build -w @source-cooperative/components-demo
npm run build -w @source-cooperative/viewers

Note that using -w or -ws must be done from the root of the monorepo. Alternatively, you can use npm run build from the workspace directory, eg:

cd packages/components
npm i
npm run build

Run

To run the demo locally:

npm run dev -w @source-cooperative/components-demo

To run the viewer app locally:

npm run dev -w @source-cooperative/viewers

To run the sc command-line interface:

npx sc

Contributors 6