Getting started with oneRepo
Quick start
Section titled Quick start-
Install the CLI
First, install oneRepo’s
one
command into your path:Install via npm npx --package=onerepo one installInstall via Yarn yarn dlx --package=onerepo one installInstall via pnpm pnpm --package=onerepo dlx one install -
Create your oneRepo
Next, use the
one create
command to initialize into an existing or a new repository.Initialize oneRepo in a new or existing repository one create -
Bring your own Package Manager
oneRepo is compatible with all major package managers for Node.js.
Choose your own package manager ? Which package manager would you like to use?❯ npmpnpmyarnChoose your own package manager ? Which package manager would you like to use?npmpnpm❯ yarnChoose your own package manager ? Which package manager would you like to use?npm❯ pnpmyarn -
Configure your repo
Modify the root configuration file,
./onerepo.config.ts
, for your repo’s specific needs.Refer to the full configuration documentation for more information.
./onerepo.config.js export default {root: true,codeowners: {},tasks: {},// And much more!};./onerepo.config.ts import type { Config } from 'onerepo';export default {root: true,codeowners: {},tasks: {},// And much more!} satisfies Config;./onerepo.config.cjs module.exports = {root: true,codeowners: {},tasks: {},// And much more!}; -
Ready to go!
That’s it! Change into your monorepo’s root directory and use the
one
CLI.Terminal window cd my-monorepoone --helpone <command> [options]one workspace <workspace-name> <command> [options]Commands:one tasks Run tasks against repo-defined lifecycles. Thiscommand will limit the tasks across the affectedworkspace set based on the current state of therepository.one hooks Manage git repository hooksone graph Run core Graph commandsone generate Generate files, folders, and workspaces fromtemplates. [aliases: gen]# …
Manually integrating oneRepo
Section titled Manually integrating oneRepo-
Install dependencies
Install dependencies using your package manager of choice.
Install via npm npm install --save-dev onerepoInstall via Yarn yarn add --dev onerepoInstall via pnpm pnpm add --save-dev onerepo -
Install the CLI
Install the CLI into your system. This will create a command,
one
, that can be run from anywhere in your path. It will always pick up a local version ofonerepo
, if it exists, otherwise fall back on the current version.Install via npm npm exec one installInstall via Yarn yarn one installInstall via pnpm pnpm one install -
Configure workspaces
Configure your package manager to work with workspaces
package.json {"name": "my-monorepo","private": true,"workspaces": ["apps/*", "modules/*"]}package.json {"name": "my-monorepo","private": true,"workspaces": ["apps/*", "modules/*"]}pnpm-workspace.yaml packages:- 'apps/*'- 'modules/*' -
Configure
Create a configuration file at the root of your repository. This may be either JavaScript or TypeScript.
Refer to the full configuration documentation for more information.
./onerepo.config.js export default {root: true,};./onerepo.config.ts import type { Config } from 'onerepo';export default {root: true,} satisfies Config;./onerepo.config.cjs module.exports = {root: true,};