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.
For more information on how to contribute to this project, see the contribution guide.
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 .
To install:
npm installTo build the workspaces:
npm run build -wsTo 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/viewersNote 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 buildTo run the demo locally:
npm run dev -w @source-cooperative/components-demoTo run the viewer app locally:
npm run dev -w @source-cooperative/viewersTo run the sc command-line interface:
npx sc