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 thepackages/clidirectory.@source-cooperative/components: A collection of reusable React components. The code is in thepackages/componentsdirectory. 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 theapps/components-demodirectory.@source-cooperative/viewers: The https://viewers.source.coop webapp. It aims at exploring large remote files in the browser. The code is in theapps/viewersdirectory.
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 buildRun
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