├── .editorconfig ├── .gitattributes ├── .github ├── CODEOWNERS ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── 01-bug-report.yml │ ├── 02-documentation-issue.yml │ ├── 06-feature-change.yml │ └── config.yml ├── PULL_REQUEST_TEMPLATE.md ├── dependabot.yml └── workflows │ ├── merge-main.yaml │ └── pull-request.yaml ├── .gitignore ├── .hooks ├── post-checkout ├── post-merge ├── post-rewrite └── pre-commit ├── .prettierignore ├── .yarn ├── patches │ └── @astrojs-starlight-npm-0.21.0-f537baa752.patch ├── plugins │ └── @yarnpkg │ │ ├── plugin-interactive-tools.cjs │ │ ├── plugin-typescript.cjs │ │ └── plugin-workspace-tools.cjs └── releases │ └── yarn-3.3.1.cjs ├── .yarnrc.yml ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE.md ├── README.md ├── SECURITY.md ├── actions ├── get-tasks │ └── action.yaml └── run-task │ └── action.yml ├── bin └── one.mjs ├── commands ├── __tests__ │ ├── __fixtures__ │ │ ├── build │ │ │ ├── modules │ │ │ │ ├── burritos │ │ │ │ │ ├── package.json │ │ │ │ │ └── src │ │ │ │ │ │ ├── fixtures │ │ │ │ │ │ └── foo.ts │ │ │ │ │ │ └── index.ts │ │ │ │ ├── churros │ │ │ │ │ ├── package.json │ │ │ │ │ └── tsconfig.json │ │ │ │ └── tacos │ │ │ │ │ ├── onerepo.config.js │ │ │ │ │ ├── package.json │ │ │ │ │ └── tsconfig.build.json │ │ │ ├── onerepo.config.js │ │ │ ├── package-lock.json │ │ │ └── package.json │ │ └── start │ │ │ ├── apps │ │ │ ├── burritos │ │ │ │ ├── package.json │ │ │ │ └── vite.config.ts │ │ │ ├── churros │ │ │ │ ├── package.json │ │ │ │ └── tsconfig.json │ │ │ └── menu │ │ │ │ ├── commands │ │ │ │ └── start.ts │ │ │ │ ├── package.json │ │ │ │ └── vite.config.ts │ │ │ ├── modules │ │ │ └── tacos │ │ │ │ └── package.json │ │ │ └── package.json │ └── build.test.ts ├── build.ts └── vitest.config.js ├── config ├── graph-schema.ts └── templates │ ├── command │ ├── .onegen.js │ └── <%- name %>.ts.ejs │ ├── module │ ├── .onegen.cjs │ ├── package.json.ejs │ ├── src │ │ └── index.ts.ejs │ ├── tsconfig.build.json │ ├── tsconfig.json.ejs │ └── vitest.config.js.ejs │ └── plugin │ ├── .onegen.js │ ├── README.md.ejs │ ├── package.json.ejs │ ├── src │ ├── commands │ │ └── <%- name %>.ts.ejs │ └── index.ts.ejs │ ├── tsconfig.build.json │ ├── tsconfig.json.ejs │ └── vitest.config.js.ejs ├── docs ├── .gitignore ├── CHANGELOG.md ├── README.md ├── astro.config.ts ├── commands │ ├── collect-content.ts │ ├── pull-changelogs.ts │ └── typedoc.ts ├── eslint.config.ts ├── netlify.toml ├── onerepo.config.ts ├── package.json ├── public │ ├── _headers │ ├── _redirects │ ├── favicon.svg │ └── robots.txt ├── src │ ├── assets │ │ ├── logo-full-dark.svg │ │ ├── logo-full.svg │ │ ├── logo.png │ │ ├── logo.svg │ │ ├── og-background.png │ │ ├── og-logo.png │ │ ├── oneRepo.svg │ │ ├── pkgmgr │ │ │ ├── npm.svg │ │ │ ├── pnpm.svg │ │ │ └── yarn.svg │ │ ├── plugins │ │ │ ├── changesets.webp │ │ │ ├── eslint.webp │ │ │ ├── jest.webp │ │ │ ├── prettier.webp │ │ │ ├── typescript.webp │ │ │ └── vitest.webp │ │ └── render.png │ ├── components │ │ ├── Aurora.astro │ │ ├── Button.astro │ │ ├── Footer.astro │ │ ├── Head.astro │ │ ├── LinkCard.astro │ │ ├── PageFrame.astro │ │ ├── PageTitle.astro │ │ ├── Visualizer.astro │ │ └── visualizer.ts │ ├── content.config.ts │ ├── content │ │ ├── docs │ │ │ ├── api │ │ │ │ ├── index.md │ │ │ │ └── onerepo │ │ │ │ │ └── namespaces │ │ │ │ │ ├── builders.md │ │ │ │ │ ├── file.md │ │ │ │ │ └── git.md │ │ │ ├── changelogs │ │ │ │ ├── @onerepo │ │ │ │ │ ├── builders.mdx │ │ │ │ │ ├── file.mdx │ │ │ │ │ ├── git.mdx │ │ │ │ │ ├── graph.mdx │ │ │ │ │ ├── logger.mdx │ │ │ │ │ ├── package-manager.mdx │ │ │ │ │ ├── plugin-docgen.mdx │ │ │ │ │ ├── plugin-eslint.mdx │ │ │ │ │ ├── plugin-jest.mdx │ │ │ │ │ ├── plugin-performance-writer.mdx │ │ │ │ │ ├── plugin-prettier.mdx │ │ │ │ │ ├── plugin-typescript.mdx │ │ │ │ │ ├── plugin-vitest.mdx │ │ │ │ │ ├── subprocess.mdx │ │ │ │ │ ├── test-cli.mdx │ │ │ │ │ └── yargs.mdx │ │ │ │ └── index.mdx │ │ │ ├── concepts │ │ │ │ ├── primer.mdx │ │ │ │ └── why-onerepo.mdx │ │ │ ├── core │ │ │ │ ├── changes.mdx │ │ │ │ ├── codeowners.mdx │ │ │ │ ├── create.mdx │ │ │ │ ├── dependencies.mdx │ │ │ │ ├── generate.mdx │ │ │ │ ├── graph.mdx │ │ │ │ ├── hooks.mdx │ │ │ │ ├── install.mdx │ │ │ │ ├── tasks.mdx │ │ │ │ └── workspace.mdx │ │ │ ├── discord.mdx │ │ │ ├── docs │ │ │ │ ├── commands.mdx │ │ │ │ ├── config.mdx │ │ │ │ ├── getting-started.mdx │ │ │ │ ├── log-output.mdx │ │ │ │ └── source-dependencies.mdx │ │ │ ├── index.mdx │ │ │ ├── plugins │ │ │ │ ├── docgen.mdx │ │ │ │ ├── docgen │ │ │ │ │ └── example.mdx │ │ │ │ ├── eslint.mdx │ │ │ │ ├── index.mdx │ │ │ │ ├── jest.mdx │ │ │ │ ├── performance-writer.mdx │ │ │ │ ├── prettier.mdx │ │ │ │ ├── typescript.mdx │ │ │ │ └── vitest.mdx │ │ │ ├── project │ │ │ │ ├── code-of-conduct.mdx │ │ │ │ ├── contributing.mdx │ │ │ │ └── index.mdx │ │ │ └── visualize.mdx │ │ └── i18n │ │ │ └── _gitkeep │ ├── custom.css │ ├── pages │ │ └── open-graph │ │ │ └── [...route].ts │ ├── plugins │ │ └── remark-mermaid.ts │ └── types.ts ├── tsconfig.json └── typedoc.cjs ├── eslint.config.ts ├── internal ├── eslint-plugin │ ├── package.json │ ├── src │ │ ├── index.ts │ │ └── types.d.ts │ └── tsconfig.json ├── jest-config │ ├── package.json │ ├── src │ │ ├── globals.js │ │ ├── index.d.ts │ │ ├── index.js │ │ └── mocks │ │ │ └── prettier.js │ └── tsconfig.json ├── prettier-config │ ├── package.json │ ├── src │ │ ├── index.cjs │ │ └── index.d.ts │ └── tsconfig.json ├── tsconfig │ ├── base.json │ └── package.json └── vitest-config │ ├── package.json │ ├── src │ ├── index.d.ts │ └── index.js │ └── tsconfig.json ├── jest.config.js ├── modules ├── builders │ ├── .changes │ │ ├── 000-swift-words-worry.md │ │ └── 001-silly-foxes-marry.md │ ├── CHANGELOG.archive.md │ ├── CHANGELOG.md │ ├── package.json │ ├── src │ │ ├── __tests__ │ │ │ ├── __fixtures__ │ │ │ │ └── repo │ │ │ │ │ ├── apps │ │ │ │ │ └── menu │ │ │ │ │ │ └── package.json │ │ │ │ │ ├── modules │ │ │ │ │ ├── burritos │ │ │ │ │ │ └── package.json │ │ │ │ │ └── tacos │ │ │ │ │ │ ├── onerepo.config.js │ │ │ │ │ │ └── package.json │ │ │ │ │ ├── onerepo.config.js │ │ │ │ │ ├── package-lock.json │ │ │ │ │ └── package.json │ │ │ └── getters.test.ts │ │ ├── getters.ts │ │ ├── index.ts │ │ ├── with-affected.ts │ │ ├── with-all-inputs.ts │ │ ├── with-files.ts │ │ └── with-workspaces.ts │ ├── tsconfig.build.json │ ├── tsconfig.json │ └── vitest.config.js ├── eslint-formatter │ ├── .changes │ │ ├── 000-swift-words-worry.md │ │ ├── 001-silly-foxes-marry.md │ │ └── 002-tired-ads-peel.md │ ├── CHANGELOG.archive.md │ ├── CHANGELOG.md │ ├── package.json │ ├── src │ │ └── index.js │ ├── tsconfig.build.json │ └── tsconfig.json ├── file │ ├── .changes │ │ ├── 000-swift-words-worry.md │ │ ├── 001-moody-doodles-hear.md │ │ ├── 002-silly-foxes-marry.md │ │ ├── 003-dirty-waves-start.md │ │ └── 004-giant-eyes-tan.md │ ├── CHANGELOG.archive.md │ ├── CHANGELOG.md │ ├── package.json │ ├── src │ │ ├── __tests__ │ │ │ └── index.test.ts │ │ ├── index.ts │ │ ├── signing.ts │ │ └── utils │ │ │ └── strip-json-comments.ts │ ├── tsconfig.build.json │ ├── tsconfig.json │ └── vitest.config.js ├── git │ ├── .changes │ │ ├── 000-swift-words-worry.md │ │ └── 001-silly-foxes-marry.md │ ├── CHANGELOG.archive.md │ ├── CHANGELOG.md │ ├── package.json │ ├── src │ │ ├── __tests__ │ │ │ └── workflow.test.ts │ │ ├── index.ts │ │ └── workflow.ts │ ├── tsconfig.build.json │ ├── tsconfig.json │ └── vitest.config.js ├── github-action │ ├── .gitignore │ ├── commands │ │ └── build.ts │ ├── dist │ │ ├── get-tasks.cjs │ │ └── run-task.cjs │ ├── onerepo.config.ts │ ├── package.json │ ├── src │ │ ├── get-tasks.ts │ │ └── run-task.ts │ ├── tsconfig.build.json │ └── tsconfig.json ├── graph │ ├── .changes │ │ ├── 000-swift-words-worry.md │ │ ├── 001-moody-doodles-hear.md │ │ ├── 002-silly-foxes-marry.md │ │ └── 003-loose-phones-call.md │ ├── CHANGELOG.archive.md │ ├── CHANGELOG.md │ ├── jest.config.js │ ├── package.json │ ├── src │ │ ├── Graph.ts │ │ ├── Workspace.ts │ │ ├── __tests__ │ │ │ ├── Graph.test.ts │ │ │ ├── __fixtures__ │ │ │ │ ├── pnpm │ │ │ │ │ ├── modules │ │ │ │ │ │ ├── pnpm-0 │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ └── pnpm-1 │ │ │ │ │ │ │ └── package.json │ │ │ │ │ ├── onerepo.config.js │ │ │ │ │ ├── package.json │ │ │ │ │ ├── pnpm-lock.yaml │ │ │ │ │ └── pnpm-workspace.yaml │ │ │ │ ├── repo │ │ │ │ │ ├── modules │ │ │ │ │ │ ├── burritos │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ ├── lettuce │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ └── tacos │ │ │ │ │ │ │ └── package.json │ │ │ │ │ ├── onerepo.config.js │ │ │ │ │ ├── package-lock.json │ │ │ │ │ └── package.json │ │ │ │ └── reused-alias │ │ │ │ │ ├── modules │ │ │ │ │ ├── lettuce │ │ │ │ │ │ └── package.json │ │ │ │ │ └── spinach │ │ │ │ │ │ └── package.json │ │ │ │ │ ├── onerepo.config.js │ │ │ │ │ ├── package-lock.json │ │ │ │ │ └── package.json │ │ │ └── index.test.ts │ │ └── index.ts │ ├── tsconfig.build.json │ ├── tsconfig.json │ └── vitest.config.js ├── logger │ ├── .changes │ │ ├── 000-swift-words-worry.md │ │ └── 001-silly-foxes-marry.md │ ├── CHANGELOG.archive.md │ ├── CHANGELOG.md │ ├── jest.config.js │ ├── package.json │ ├── src │ │ ├── LogBuffer.ts │ │ ├── LogStep.ts │ │ ├── Logger.ts │ │ ├── __tests__ │ │ │ ├── LogStep.test.ts │ │ │ └── Logger.test.ts │ │ ├── global.ts │ │ └── index.ts │ ├── tsconfig.build.json │ ├── tsconfig.json │ └── vitest.config.js ├── onerepo │ ├── .changes │ │ ├── 000-swift-words-worry.md │ │ ├── 001-moody-doodles-hear.md │ │ ├── 002-silly-foxes-marry.md │ │ └── 003-loose-phones-call.md │ ├── CHANGELOG.archive.md │ ├── CHANGELOG.md │ ├── README.md │ ├── package.json │ ├── src │ │ ├── __tests__ │ │ │ ├── __fixtures__ │ │ │ │ └── repo │ │ │ │ │ ├── modules │ │ │ │ │ ├── burritos │ │ │ │ │ │ ├── onerepo.config.js │ │ │ │ │ │ └── package.json │ │ │ │ │ └── tacos │ │ │ │ │ │ ├── onerepo.config.js │ │ │ │ │ │ └── package.json │ │ │ │ │ ├── onerepo.config.js │ │ │ │ │ ├── package-lock.json │ │ │ │ │ └── package.json │ │ │ └── index.test.ts │ │ ├── bin │ │ │ ├── one.ts │ │ │ └── utils │ │ │ │ ├── get-config.ts │ │ │ │ └── update-node-modules.ts │ │ ├── core │ │ │ ├── changes │ │ │ │ ├── __tests__ │ │ │ │ │ ├── __fixtures__ │ │ │ │ │ │ └── with-entries │ │ │ │ │ │ │ ├── modules │ │ │ │ │ │ │ ├── cheese │ │ │ │ │ │ │ │ ├── .changes │ │ │ │ │ │ │ │ │ └── 1-five-horses-run.md │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ ├── lettuce │ │ │ │ │ │ │ │ ├── .changes │ │ │ │ │ │ │ │ │ └── 1-five-horses-run.md │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ ├── private │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ └── tacos │ │ │ │ │ │ │ │ ├── .changes │ │ │ │ │ │ │ │ └── 1-five-horses-run.md │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ ├── onerepo.config.ts │ │ │ │ │ │ │ ├── package.json │ │ │ │ │ │ │ └── yarn.lock │ │ │ │ │ ├── add.test.ts │ │ │ │ │ ├── migrate.test.ts │ │ │ │ │ ├── show.test.ts │ │ │ │ │ ├── verify.test.ts │ │ │ │ │ └── version.test.ts │ │ │ │ ├── add.ts │ │ │ │ ├── index.ts │ │ │ │ ├── migrate.ts │ │ │ │ ├── publish.ts │ │ │ │ ├── show.ts │ │ │ │ ├── snapshot.ts │ │ │ │ ├── utils │ │ │ │ │ ├── __tests__ │ │ │ │ │ │ ├── apply-versions.test.ts │ │ │ │ │ │ ├── changelog.test.ts │ │ │ │ │ │ ├── confirm-clean.test.ts │ │ │ │ │ │ ├── filename.test.ts │ │ │ │ │ │ └── read-change.test.ts │ │ │ │ │ ├── apply-versions.ts │ │ │ │ │ ├── changelog.ts │ │ │ │ │ ├── confirm-clean.ts │ │ │ │ │ ├── filename.ts │ │ │ │ │ ├── get-versionable.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── read-change.ts │ │ │ │ │ ├── request-otp.ts │ │ │ │ │ └── request-versioned.ts │ │ │ │ ├── verify.ts │ │ │ │ └── version.ts │ │ │ ├── codeowners │ │ │ │ ├── __tests__ │ │ │ │ │ ├── __fixtures__ │ │ │ │ │ │ └── repo │ │ │ │ │ │ │ ├── .github │ │ │ │ │ │ │ └── CODEOWNERS │ │ │ │ │ │ │ ├── modules │ │ │ │ │ │ │ ├── burritos │ │ │ │ │ │ │ │ ├── onerepo.config.js │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ └── tacos │ │ │ │ │ │ │ │ ├── onerepo.config.js │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ ├── onerepo.config.js │ │ │ │ │ │ │ ├── package-lock.json │ │ │ │ │ │ │ └── package.json │ │ │ │ │ ├── show.test.ts │ │ │ │ │ ├── sync.test.ts │ │ │ │ │ └── verify.test.ts │ │ │ │ ├── get-codeowners.ts │ │ │ │ ├── index.ts │ │ │ │ ├── show.ts │ │ │ │ ├── sync.ts │ │ │ │ └── verify.ts │ │ │ ├── create │ │ │ │ ├── create.ts │ │ │ │ └── index.ts │ │ │ ├── dependencies │ │ │ │ ├── __tests__ │ │ │ │ │ ├── __fixtures__ │ │ │ │ │ │ ├── bad-repo-dev │ │ │ │ │ │ │ ├── apps │ │ │ │ │ │ │ │ └── menu │ │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ ├── modules │ │ │ │ │ │ │ │ ├── burritos │ │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ │ └── tacos │ │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ ├── onerepo.config.js │ │ │ │ │ │ │ ├── package-lock.json │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ ├── bad-repo │ │ │ │ │ │ │ ├── apps │ │ │ │ │ │ │ │ └── menu │ │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ ├── modules │ │ │ │ │ │ │ │ ├── burritos │ │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ │ └── tacos │ │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ ├── onerepo.config.js │ │ │ │ │ │ │ ├── package-lock.json │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ ├── regression-678 │ │ │ │ │ │ │ ├── onerepo.config.js │ │ │ │ │ │ │ ├── package-lock.json │ │ │ │ │ │ │ ├── package.json │ │ │ │ │ │ │ └── packages │ │ │ │ │ │ │ │ ├── bar │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ │ └── foo │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ ├── regression-682 │ │ │ │ │ │ │ ├── onerepo.config.js │ │ │ │ │ │ │ ├── package-lock.json │ │ │ │ │ │ │ ├── package.json │ │ │ │ │ │ │ └── packages │ │ │ │ │ │ │ │ ├── bar │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ │ └── foo │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ └── repo │ │ │ │ │ │ │ ├── apps │ │ │ │ │ │ │ └── menu │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ ├── modules │ │ │ │ │ │ │ ├── burritos │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ └── tacos │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ ├── onerepo.config.js │ │ │ │ │ │ │ ├── package-lock.json │ │ │ │ │ │ │ └── package.json │ │ │ │ │ ├── add.test.ts │ │ │ │ │ ├── remove.test.ts │ │ │ │ │ └── verify.test.ts │ │ │ │ ├── add.ts │ │ │ │ ├── index.ts │ │ │ │ ├── remove.ts │ │ │ │ ├── utils │ │ │ │ │ └── verify-dependencies.ts │ │ │ │ └── verify.ts │ │ │ ├── generate │ │ │ │ ├── __tests__ │ │ │ │ │ ├── __fixtures__ │ │ │ │ │ │ ├── app │ │ │ │ │ │ │ ├── .onegen.cjs │ │ │ │ │ │ │ ├── .test │ │ │ │ │ │ │ ├── <%-name%>.ts.ejs │ │ │ │ │ │ │ ├── index.ts.ejs │ │ │ │ │ │ │ └── package.json.ejs │ │ │ │ │ │ ├── module │ │ │ │ │ │ │ └── .onegen.cjs │ │ │ │ │ │ └── package-lock.json │ │ │ │ │ └── generate.test.ts │ │ │ │ ├── generate.ts │ │ │ │ └── index.ts │ │ │ ├── graph │ │ │ │ ├── __tests__ │ │ │ │ │ ├── __fixtures__ │ │ │ │ │ │ ├── bad-repo-dev │ │ │ │ │ │ │ ├── apps │ │ │ │ │ │ │ │ └── menu │ │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ ├── modules │ │ │ │ │ │ │ │ ├── burritos │ │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ │ └── tacos │ │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ ├── package-lock.json │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ ├── bad-repo │ │ │ │ │ │ │ ├── apps │ │ │ │ │ │ │ │ └── menu │ │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ ├── modules │ │ │ │ │ │ │ │ ├── burritos │ │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ │ └── tacos │ │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ ├── package-lock.json │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ ├── functional-schema.ts │ │ │ │ │ │ ├── js-schema.ts │ │ │ │ │ │ ├── repo │ │ │ │ │ │ │ ├── apps │ │ │ │ │ │ │ │ └── menu │ │ │ │ │ │ │ │ │ ├── package.json │ │ │ │ │ │ │ │ │ └── settings.yaml │ │ │ │ │ │ │ ├── modules │ │ │ │ │ │ │ │ ├── burritos │ │ │ │ │ │ │ │ │ ├── jest.config.js │ │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ │ └── tacos │ │ │ │ │ │ │ │ │ ├── onerepo.config.js │ │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ ├── onerepo.config.js │ │ │ │ │ │ │ ├── package-lock.json │ │ │ │ │ │ │ ├── package.json │ │ │ │ │ │ │ └── tsconfig.json │ │ │ │ │ │ ├── tsconfig-schema.ts │ │ │ │ │ │ └── yaml-schema.ts │ │ │ │ │ ├── show.test.ts │ │ │ │ │ └── verify.test.ts │ │ │ │ ├── index.ts │ │ │ │ ├── schema.ts │ │ │ │ ├── show.ts │ │ │ │ └── verify.ts │ │ │ ├── hooks │ │ │ │ ├── __tests__ │ │ │ │ │ ├── create.test.ts │ │ │ │ │ ├── index.test.ts │ │ │ │ │ └── init.test.ts │ │ │ │ ├── create.ts │ │ │ │ ├── index.ts │ │ │ │ └── init.ts │ │ │ ├── install │ │ │ │ ├── __tests__ │ │ │ │ │ └── install.test.ts │ │ │ │ ├── index.ts │ │ │ │ └── install.ts │ │ │ ├── tasks │ │ │ │ ├── __tests__ │ │ │ │ │ ├── __fixtures__ │ │ │ │ │ │ ├── multi-match │ │ │ │ │ │ │ ├── modules │ │ │ │ │ │ │ │ ├── burritos │ │ │ │ │ │ │ │ │ ├── onerepo.config.js │ │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ │ └── tacos │ │ │ │ │ │ │ │ │ ├── onerepo.config.js │ │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ ├── onerepo.config.js │ │ │ │ │ │ │ ├── package-lock.json │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ └── repo │ │ │ │ │ │ │ ├── modules │ │ │ │ │ │ │ ├── burritos │ │ │ │ │ │ │ │ ├── onerepo.config.js │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ └── tacos │ │ │ │ │ │ │ │ ├── onerepo.config.js │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ ├── onerepo.config.js │ │ │ │ │ │ │ ├── package-lock.json │ │ │ │ │ │ │ └── package.json │ │ │ │ │ └── tasks.test.ts │ │ │ │ ├── index.ts │ │ │ │ ├── run-tasks.ts │ │ │ │ └── tasks.ts │ │ │ └── workspace │ │ │ │ ├── __tests__ │ │ │ │ ├── __fixtures__ │ │ │ │ │ └── repo │ │ │ │ │ │ ├── modules │ │ │ │ │ │ ├── burritos │ │ │ │ │ │ │ ├── onerepo.config.ts │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ └── tacos │ │ │ │ │ │ │ ├── onerepo.config.ts │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ ├── onerepo.config.js │ │ │ │ │ │ ├── package.json │ │ │ │ │ │ └── yarn.lock │ │ │ │ └── passthrough.test.ts │ │ │ │ ├── index.ts │ │ │ │ └── passthrough.ts │ │ ├── deps.d.ts │ │ ├── index.ts │ │ ├── setup │ │ │ ├── index.ts │ │ │ └── setup.ts │ │ └── types │ │ │ ├── config-root.ts │ │ │ ├── config-workspace.ts │ │ │ ├── index.ts │ │ │ ├── plugin.ts │ │ │ └── tasks.ts │ ├── tsconfig.build.json │ ├── tsconfig.json │ └── vitest.config.js ├── package-manager │ ├── .changes │ │ ├── 000-swift-words-worry.md │ │ └── 001-silly-foxes-marry.md │ ├── CHANGELOG.archive.md │ ├── CHANGELOG.md │ ├── package.json │ ├── src │ │ ├── __tests__ │ │ │ ├── __fixtures__ │ │ │ │ ├── packagelock │ │ │ │ │ └── package-lock.json │ │ │ │ ├── pnpmlock │ │ │ │ │ └── pnpm-lock.yaml │ │ │ │ ├── pnpmworkyaml │ │ │ │ │ └── pnpm-workspace.yaml │ │ │ │ ├── yarnlock │ │ │ │ │ └── yarn.lock │ │ │ │ ├── yarnrcyaml │ │ │ │ │ └── .yarnrc.yaml │ │ │ │ └── yarnrcyml │ │ │ │ │ └── .yarnrc.yml │ │ │ ├── get-package-manager.test.ts │ │ │ ├── npm.test.ts │ │ │ ├── package-json.test.ts │ │ │ ├── pnpm.test.ts │ │ │ └── yarn.test.ts │ │ ├── get-package-manager.ts │ │ ├── index.ts │ │ ├── methods.ts │ │ ├── npm.ts │ │ ├── package-json.ts │ │ ├── pnpm.ts │ │ └── yarn.ts │ ├── tsconfig.build.json │ ├── tsconfig.json │ └── vitest.config.js ├── subprocess │ ├── .changes │ │ ├── 000-swift-words-worry.md │ │ └── 001-silly-foxes-marry.md │ ├── CHANGELOG.archive.md │ ├── CHANGELOG.md │ ├── package.json │ ├── src │ │ └── index.ts │ ├── tsconfig.build.json │ └── tsconfig.json ├── test-cli │ ├── .changes │ │ ├── 000-swift-words-worry.md │ │ ├── 001-silly-foxes-marry.md │ │ └── 002-loose-phones-call.md │ ├── CHANGELOG.archive.md │ ├── CHANGELOG.md │ ├── package.json │ ├── src │ │ ├── fixtures │ │ │ └── repo │ │ │ │ ├── eslint.config.ts │ │ │ │ ├── modules │ │ │ │ ├── burritos │ │ │ │ │ ├── package.json │ │ │ │ │ └── tsconfig.json │ │ │ │ └── tacos │ │ │ │ │ ├── package.json │ │ │ │ │ └── tsconfig.json │ │ │ │ ├── onerepo.config.js │ │ │ │ ├── package-lock.json │ │ │ │ ├── package.json │ │ │ │ └── tsconfig.json │ │ └── index.ts │ ├── tsconfig.build.json │ └── tsconfig.json └── yargs │ ├── .changes │ ├── 000-swift-words-worry.md │ └── 001-silly-foxes-marry.md │ ├── CHANGELOG.archive.md │ ├── CHANGELOG.md │ ├── package.json │ ├── src │ ├── index.ts │ ├── middleware │ │ ├── engine-check.ts │ │ ├── environment.ts │ │ ├── index.ts │ │ └── sudo-check.ts │ └── yargs.ts │ ├── tsconfig.build.json │ └── tsconfig.json ├── onerepo.config.ts ├── package.json ├── plugins ├── README.md ├── docgen │ ├── .changes │ │ ├── 000-swift-words-worry.md │ │ ├── 001-moody-doodles-hear.md │ │ ├── 002-silly-foxes-marry.md │ │ └── 003-loose-phones-call.md │ ├── CHANGELOG.archive.md │ ├── CHANGELOG.md │ ├── README.md │ ├── package.json │ ├── src │ │ ├── index.ts │ │ ├── markdown.ts │ │ └── yargs.ts │ ├── tsconfig.build.json │ ├── tsconfig.json │ └── vitest.config.js ├── eslint │ ├── .changes │ │ ├── 000-swift-words-worry.md │ │ ├── 001-moody-doodles-hear.md │ │ ├── 002-silly-foxes-marry.md │ │ ├── 003-crazy-bobcats-sniff.md │ │ ├── 004-fast-squids-rhyme.md │ │ └── 005-red-suits-rhyme.md │ ├── CHANGELOG.archive.md │ ├── CHANGELOG.md │ ├── README.md │ ├── package.json │ ├── src │ │ ├── commands │ │ │ ├── __tests__ │ │ │ │ └── eslint.test.ts │ │ │ └── eslint.ts │ │ ├── config.ts │ │ └── index.ts │ ├── tsconfig.build.json │ ├── tsconfig.json │ └── vitest.config.js ├── jest │ ├── .changes │ │ ├── 000-swift-words-worry.md │ │ └── 001-silly-foxes-marry.md │ ├── CHANGELOG.archive.md │ ├── CHANGELOG.md │ ├── README.md │ ├── jest.config.js │ ├── package.json │ ├── src │ │ ├── commands │ │ │ ├── __tests__ │ │ │ │ └── jest.test.ts │ │ │ └── jest.ts │ │ └── index.ts │ ├── tsconfig.build.json │ └── tsconfig.json ├── performance-writer │ ├── .changes │ │ ├── 000-swift-words-worry.md │ │ └── 001-silly-foxes-marry.md │ ├── CHANGELOG.archive.md │ ├── CHANGELOG.md │ ├── README.md │ ├── package.json │ ├── src │ │ ├── __tests__ │ │ │ └── index.test.ts │ │ └── index.ts │ ├── tsconfig.build.json │ ├── tsconfig.json │ └── vitest.config.js ├── prettier │ ├── .changes │ │ ├── 000-swift-words-worry.md │ │ └── 001-silly-foxes-marry.md │ ├── CHANGELOG.archive.md │ ├── CHANGELOG.md │ ├── README.md │ ├── package.json │ ├── src │ │ ├── commands │ │ │ ├── __tests__ │ │ │ │ └── prettier.test.ts │ │ │ └── prettier.ts │ │ └── index.ts │ ├── tsconfig.build.json │ ├── tsconfig.json │ └── vitest.config.js ├── typescript │ ├── .changes │ │ ├── 000-swift-words-worry.md │ │ └── 001-silly-foxes-marry.md │ ├── CHANGELOG.archive.md │ ├── CHANGELOG.md │ ├── README.md │ ├── package.json │ ├── src │ │ ├── commands │ │ │ ├── __tests__ │ │ │ │ └── typescript.test.ts │ │ │ └── typescript.ts │ │ └── index.ts │ ├── tsconfig.build.json │ ├── tsconfig.json │ └── vitest.config.js └── vitest │ ├── .changes │ ├── 000-swift-words-worry.md │ ├── 001-silly-foxes-marry.md │ └── 002-silver-stars-talk.md │ ├── CHANGELOG.archive.md │ ├── CHANGELOG.md │ ├── README.md │ ├── package.json │ ├── src │ ├── commands │ │ ├── __tests__ │ │ │ └── vitest.test.ts │ │ └── vitest.ts │ └── index.ts │ ├── tsconfig.build.json │ ├── tsconfig.json │ └── vitest.config.js ├── prettier.config.cjs ├── tsconfig.json ├── vitest.config.ts ├── vitest.workspace.ts └── yarn.lock /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | insert_final_newline = true 6 | 7 | [*.{ts,js,mjs,cjs,json,yml,astro}] 8 | charset = utf-8 9 | indent_style = tab 10 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | /.yarn/** linguist-vendored 2 | /.yarn/releases/* binary 3 | /.yarn/plugins/**/* binary 4 | /.pnp.* binary linguist-generated 5 | 6 | /modules/github-action/dist/* binary 7 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # @generated SignedSource<> 2 | 3 | # @onerepo/root 4 | * @paularmstrong 5 | 6 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: 2 | - paularmstrong 3 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/02-documentation-issue.yml: -------------------------------------------------------------------------------- 1 | name: 🔖 Report a documentation issue 2 | description: Something is wrong or missing in the documentation. 3 | labels: 4 | - bug 5 | - 📖 documentation 6 | - triage 7 | body: 8 | - type: markdown 9 | attributes: 10 | value: | 11 | ## Thank you! 12 | Documentation is really hard. Your help in making it better is appreciated! 13 | - type: input 14 | id: url 15 | attributes: 16 | label: What is the URL of the page? 17 | placeholder: https://onerepo.tools/ 18 | validations: 19 | required: true 20 | - type: textarea 21 | id: information 22 | attributes: 23 | label: What's wrong? 24 | description: The more details, the better. 25 | validations: 26 | required: true 27 | - type: markdown 28 | attributes: 29 | value: | 30 | --- 31 | - type: checkboxes 32 | id: participation 33 | attributes: 34 | label: Participation 35 | options: 36 | - label: I am willing to submit a pull request for this issue. 37 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: 💡 Ideas for new features, improvements, and RFCs 4 | url: https://github.com/paularmstrong/onerepo/discussions/categories/ideas 5 | about: Propose and discuss future improvements to oneRepo. 6 | - name: 📚 Documentation 7 | url: https://onerepo.tools/ 8 | - name: 🧑‍⚕️ Support 9 | url: https://github.com/paularmstrong/onerepo/discussions/categories/q-a 10 | about: The issue tracker is not for support questions or other discussions. 11 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 9 | 10 | **Problem:** 11 | 12 | 16 | 17 | **Solution:** 18 | 19 | 23 | 24 | **Related issues:** 25 | 26 | 29 | 30 | Fixes # 31 | 32 | **Checklist:** 33 | 34 | - [ ] Added or updated tests 35 | - [ ] Added or updated documentation 36 | - [ ] Ensured the pre-commit hooks ran successfully 37 | 38 | _By opening this pull request, you agree that this submission can be released under the same [License](https://github.com/paularmstrong/onerepo/blob/main/LICENSE.md) that covers the project._ 39 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: npm 4 | directory: '/' 5 | rebase-strategy: auto 6 | schedule: 7 | interval: monthly 8 | versioning-strategy: increase 9 | labels: 10 | - dependencies 11 | open-pull-requests-limit: 15 12 | groups: 13 | production-dependencies: 14 | dependency-type: production 15 | typescript: 16 | patterns: 17 | - typescript 18 | - '@types/*' 19 | exclude-patterns: 20 | - '@types/eslint' 21 | docs: 22 | patterns: 23 | - 'astro' 24 | - '@astrojs/*' 25 | - 'tailwindcss' 26 | - 'postcss' 27 | - 'netlify-*' 28 | eslint: 29 | patterns: 30 | - '*eslint*' 31 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | 3 | # dependencies 4 | **/node_modules/* 5 | .pnp.* 6 | .yarn/* 7 | !.yarn/patches 8 | !.yarn/plugins 9 | !.yarn/releases 10 | !.yarn/sdks 11 | !.yarn/versions 12 | 13 | # logs 14 | npm-debug.log* 15 | yarn-debug.log* 16 | yarn-error.log* 17 | pnpm-debug.log* 18 | 19 | # output 20 | **/dist/* 21 | coverage/* 22 | **/*.tsbuildinfo 23 | *.eslintcache 24 | .netlify 25 | 26 | .cache 27 | -------------------------------------------------------------------------------- /.hooks/post-checkout: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | . "$(dirname -- "$0")/_/hooks.sh" 3 | 4 | # If the third argument is "1", then we have switched branches 5 | if [ $3 = '1' ]; then 6 | one tasks --lifecycle=post-checkout 7 | fi 8 | -------------------------------------------------------------------------------- /.hooks/post-merge: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | . "$(dirname -- "$0")/_/hooks.sh" 3 | 4 | one tasks --lifecycle=post-merge 5 | -------------------------------------------------------------------------------- /.hooks/post-rewrite: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | . "$(dirname -- "$0")/_/hooks.sh" 3 | 4 | one tasks --lifecycle=post-checkout 5 | -------------------------------------------------------------------------------- /.hooks/pre-commit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | . "$(dirname -- "$0")/_/hooks.sh" 3 | 4 | one tasks --lifecycle=pre-commit 5 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | .git 2 | **/dist/* 3 | **/node_modules/* 4 | **/.yarn/* 5 | 6 | coverage/* 7 | *.tsbuildinfo 8 | *.d.ts 9 | *.d.ts.map 10 | 11 | **/.astro/* 12 | **/.netlify/* 13 | **/coverage/* 14 | -------------------------------------------------------------------------------- /.yarn/patches/@astrojs-starlight-npm-0.21.0-f537baa752.patch: -------------------------------------------------------------------------------- 1 | diff --git a/user-components/rehype-file-tree.ts b/user-components/rehype-file-tree.ts 2 | index 5af454fe32dc0cd7a1b8448e08c00d56a85babe9..5716e5f5c120633d7173464203efa94d8fa5d1cd 100644 3 | --- a/user-components/rehype-file-tree.ts 4 | +++ b/user-components/rehype-file-tree.ts 5 | @@ -170,7 +170,7 @@ function getFileIcon(fileName: string) { 6 | function getFileIconName(fileName: string) { 7 | let icon = definitions.files[fileName]; 8 | if (icon) return icon; 9 | - icon = getFileIconTypeFromExtension(fileName); 10 | + icon = getFileIconTypeFromExtension(fileName)!; 11 | if (icon) return icon; 12 | for (const [partial, partialIcon] of Object.entries(definitions.partials)) { 13 | if (fileName.includes(partial)) return partialIcon; 14 | -------------------------------------------------------------------------------- /.yarnrc.yml: -------------------------------------------------------------------------------- 1 | nodeLinker: node-modules 2 | 3 | npmRegistryServer: 'https://registry.npmjs.org' 4 | 5 | plugins: 6 | - path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs 7 | spec: '@yarnpkg/plugin-typescript' 8 | - path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs 9 | spec: '@yarnpkg/plugin-workspace-tools' 10 | - path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs 11 | spec: '@yarnpkg/plugin-interactive-tools' 12 | 13 | progressBarStyle: default 14 | 15 | yarnPath: .yarn/releases/yarn-3.3.1.cjs 16 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # MIT License 2 | 3 | Copyright (c) 2023 Paul Armstrong 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # oneRepo 2 | 3 | [![Build status](https://img.shields.io/github/actions/workflow/status/paularmstrong/onerepo/merge-main.yaml?branch=main)](https://github.com/paularmstrong/onerepo/actions/workflows/merge-main.yaml) [![NPM version](https://img.shields.io/npm/v/onerepo)](https://npmjs.com/package/onerepo) ![Netlify](https://img.shields.io/netlify/f544fa4c-f2ad-4b59-83a0-933daa0b0b31) 4 | 5 | ## Documentation 6 | 7 | https://onerepo.tools/ 8 | 9 | - [Getting started](https://onerepo.tools/docs/getting-started/) 10 | - [Contributing](https://onerepo.tools/project/contributing/) 11 | 12 | ## License 13 | 14 | MIT License 15 | 16 | Copyright © 2023 Paul Armstrong 17 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Reporting a Vulnerability 4 | 5 | Please email security@onerepo.tools. 6 | -------------------------------------------------------------------------------- /actions/get-tasks/action.yaml: -------------------------------------------------------------------------------- 1 | name: oneRepo 2 | description: Run oneRepo tasks on GitHub 3 | inputs: 4 | packageManager: 5 | description: Package manager to use (`npm`, `yarn`, `pnpm`) 6 | required: true 7 | lifecycle: 8 | description: The lifecycle that will be run 9 | required: true 10 | overrideBin: 11 | description: Override the path to the `one` executable 12 | verbosity: 13 | description: How verbose to be 14 | 15 | runs: 16 | using: node20 17 | main: ../../modules/github-action/dist/get-tasks.cjs 18 | -------------------------------------------------------------------------------- /actions/run-task/action.yml: -------------------------------------------------------------------------------- 1 | name: oneRepo 2 | description: Run oneRepo tasks on GitHub 3 | inputs: 4 | task: 5 | description: A single task or sequence of tasks from the oneRepo tasks --list output 6 | required: true 7 | 8 | runs: 9 | using: node20 10 | main: ../../modules/github-action/dist/run-task.cjs 11 | -------------------------------------------------------------------------------- /bin/one.mjs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | import { createJiti } from 'jiti'; 3 | 4 | /** 5 | * Important note: this file is only necessary for the oneRepo source repository 6 | * because we run all CI through the source files themselves, which are written 7 | * in TypeScript. Without using this file, we will see errors like: 8 | * 9 | * TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" … 10 | * 11 | * This is also the reason that the root package.json overrides the `bin` for 12 | * the `one` CLI to point to this file. 13 | */ 14 | 15 | const jiti = createJiti(import.meta.url, { interopDefault: true }); 16 | 17 | jiti('onerepo/src/bin/one.ts'); 18 | -------------------------------------------------------------------------------- /commands/__tests__/__fixtures__/build/modules/burritos/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "burritos", 3 | "main": "./src/index.ts", 4 | "type": "module", 5 | "version": "4.5.2" 6 | } 7 | -------------------------------------------------------------------------------- /commands/__tests__/__fixtures__/build/modules/burritos/src/fixtures/foo.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/commands/__tests__/__fixtures__/build/modules/burritos/src/fixtures/foo.ts -------------------------------------------------------------------------------- /commands/__tests__/__fixtures__/build/modules/burritos/src/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/commands/__tests__/__fixtures__/build/modules/burritos/src/index.ts -------------------------------------------------------------------------------- /commands/__tests__/__fixtures__/build/modules/churros/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "churros", 3 | "main": "./src/index.ts", 4 | "type": "module", 5 | "version": "1.2.3" 6 | } 7 | -------------------------------------------------------------------------------- /commands/__tests__/__fixtures__/build/modules/churros/tsconfig.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/commands/__tests__/__fixtures__/build/modules/churros/tsconfig.json -------------------------------------------------------------------------------- /commands/__tests__/__fixtures__/build/modules/tacos/onerepo.config.js: -------------------------------------------------------------------------------- 1 | /** @type import('onerepo').Config */ 2 | module.exports = { 3 | tasks: { 4 | build: { serial: ['echo "build" "tacos"'] }, 5 | }, 6 | }; 7 | -------------------------------------------------------------------------------- /commands/__tests__/__fixtures__/build/modules/tacos/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tacos", 3 | "main": "./src/index.ts", 4 | "type": "module", 5 | "version": "1.2.3" 6 | } 7 | -------------------------------------------------------------------------------- /commands/__tests__/__fixtures__/build/modules/tacos/tsconfig.build.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/commands/__tests__/__fixtures__/build/modules/tacos/tsconfig.build.json -------------------------------------------------------------------------------- /commands/__tests__/__fixtures__/build/onerepo.config.js: -------------------------------------------------------------------------------- 1 | /** @type import('onerepo').Config */ 2 | module.exports = { 3 | tasks: { 4 | 'pre-commit': { parallel: ['$0 lint', '$0 tsc'] }, 5 | commit: { serial: ['echo "commit"'] }, 6 | 'post-commit': { serial: ['echo "post-commit"'] }, 7 | }, 8 | }; 9 | -------------------------------------------------------------------------------- /commands/__tests__/__fixtures__/build/package-lock.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/commands/__tests__/__fixtures__/build/package-lock.json -------------------------------------------------------------------------------- /commands/__tests__/__fixtures__/build/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fixture-root", 3 | "private": true, 4 | "type": "commonjs", 5 | "workspaces": [ 6 | "apps/*", 7 | "modules/*" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /commands/__tests__/__fixtures__/start/apps/burritos/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "burritos", 3 | "main": "./src/index.ts", 4 | "private": true, 5 | "version": "4.5.2" 6 | } 7 | -------------------------------------------------------------------------------- /commands/__tests__/__fixtures__/start/apps/burritos/vite.config.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/commands/__tests__/__fixtures__/start/apps/burritos/vite.config.ts -------------------------------------------------------------------------------- /commands/__tests__/__fixtures__/start/apps/churros/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "churros", 3 | "main": "./src/index.ts", 4 | "version": "1.2.3", 5 | "scripts": { 6 | "start": "echo 'nothing'", 7 | "build": "echo 'build'" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /commands/__tests__/__fixtures__/start/apps/churros/tsconfig.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/commands/__tests__/__fixtures__/start/apps/churros/tsconfig.json -------------------------------------------------------------------------------- /commands/__tests__/__fixtures__/start/apps/menu/commands/start.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/commands/__tests__/__fixtures__/start/apps/menu/commands/start.ts -------------------------------------------------------------------------------- /commands/__tests__/__fixtures__/start/apps/menu/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "menu", 3 | "private": true, 4 | "dependencies": { 5 | "tacos": "workspace:^" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /commands/__tests__/__fixtures__/start/apps/menu/vite.config.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/commands/__tests__/__fixtures__/start/apps/menu/vite.config.ts -------------------------------------------------------------------------------- /commands/__tests__/__fixtures__/start/modules/tacos/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tacos", 3 | "main": "./src/index.ts", 4 | "version": "1.2.3" 5 | } 6 | -------------------------------------------------------------------------------- /commands/__tests__/__fixtures__/start/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fixture-root", 3 | "private": true, 4 | "type": "commonjs", 5 | "workspaces": [ 6 | "apps/*", 7 | "modules/*" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /commands/vitest.config.js: -------------------------------------------------------------------------------- 1 | // eslint-disable-next-line import/no-extraneous-dependencies 2 | import { defineProject } from '@internal/vitest-config'; 3 | 4 | export default defineProject({}); 5 | -------------------------------------------------------------------------------- /config/templates/command/.onegen.js: -------------------------------------------------------------------------------- 1 | import { fileURLToPath } from 'node:url'; 2 | import path from 'node:path'; 3 | 4 | export default { 5 | name: 'Command', 6 | description: 'Create a repo-local command', 7 | outDir: () => path.join(fileURLToPath(import.meta.url), '..', '..', '..', '..', 'commands'), 8 | prompts: [ 9 | { 10 | name: 'name', 11 | message: 'What is the name of the command?', 12 | filter: (name) => name.replace(/[^a-zA-Z0-9-]/g, '').toLowerCase(), 13 | transformer: (name) => name.replace(/[^a-zA-Z0-9-]/g, '').toLowerCase(), 14 | }, 15 | { 16 | name: 'description', 17 | message: 'What is the command’s description?', 18 | }, 19 | ], 20 | }; 21 | -------------------------------------------------------------------------------- /config/templates/command/<%- name %>.ts.ejs: -------------------------------------------------------------------------------- 1 | import type { Builder, Handler } from 'onerepo'; 2 | 3 | export const name = '<%- name %>'; 4 | 5 | export const description = '<%- description %>'; 6 | 7 | export const builder: Builder = (yargs) => yargs.usage(`$0 ${name}`); 8 | 9 | export const handler: Handler = async (argv, { logger }) => { 10 | logger.error('Fill me in'); 11 | }; -------------------------------------------------------------------------------- /config/templates/module/.onegen.cjs: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | module.exports = { 4 | name: 'Module', 5 | description: 'Create a shared Workspace in modules/', 6 | outDir: ({ name }) => path.join(__dirname, '..', '..', '..', 'modules', name), 7 | prompts: [ 8 | { 9 | name: 'name', 10 | message: 'What is the name of the module?', 11 | suffix: ' @onerepo/', 12 | filter: (name) => name.replace(/[^a-zA-Z0-9-]/g, '').toLowerCase(), 13 | transformer: (name) => name.replace(/[^a-zA-Z0-9-]/g, '').toLowerCase(), 14 | }, 15 | ], 16 | }; 17 | -------------------------------------------------------------------------------- /config/templates/module/package.json.ejs: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@onerepo/<%- name %>", 3 | "version": "0.0.0", 4 | "license": "MIT", 5 | "repository": { 6 | "type": "git", 7 | "url": "git://github.com/paularmstrong/onerepo.git" 8 | }, 9 | "homepage": "https://onerepo.tools", 10 | "type": "module", 11 | "main": "./src/index.ts", 12 | "publishConfig": { 13 | "access": "public", 14 | "main": "./dist/index.js", 15 | "typings": "./dist/src/index.d.ts" 16 | }, 17 | "files": [ 18 | "./dist/**/*", 19 | "./README.md", 20 | "./CHANGELOG.md" 21 | ], 22 | "dependencies": {}, 23 | "devDependencies": { 24 | "@internal/tsconfig": "workspace:^", 25 | "@internal/vite-config": "workspace:^", 26 | }, 27 | "engines": { 28 | "node": "^18 || ^20 || ^22" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /config/templates/module/src/index.ts.ejs: -------------------------------------------------------------------------------- 1 | export function <%- name.replace(/-./g, (x)=> x[1].toUpperCase()) %>(): void { 2 | return ; 3 | } 4 | -------------------------------------------------------------------------------- /config/templates/module/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./src"], 7 | "exclude": ["./**/*.test.ts", "./**/__tests__/*"] 8 | } 9 | -------------------------------------------------------------------------------- /config/templates/module/tsconfig.json.ejs: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/tsconfig/base.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./src"] 7 | } 8 | -------------------------------------------------------------------------------- /config/templates/module/vitest.config.js.ejs: -------------------------------------------------------------------------------- 1 | import { defineProject } from '@internal/vitest-config'; 2 | 3 | export default defineProject({}); 4 | -------------------------------------------------------------------------------- /config/templates/plugin/.onegen.js: -------------------------------------------------------------------------------- 1 | import { fileURLToPath } from 'node:url'; 2 | import path from 'node:path'; 3 | 4 | export default { 5 | name: 'Plugin', 6 | description: 'Create a publishable oneRepo plugin', 7 | outDir: ({ name }) => path.join(fileURLToPath(import.meta.url), '..', '..', '..', '..', 'plugins', name), 8 | prompts: [ 9 | { 10 | name: 'name', 11 | message: 'What is the name of the plugin?', 12 | suffix: ' @onerepo/plugin-', 13 | filter: (name) => name.replace(/[^a-zA-Z0-9-]/g, '').toLowerCase(), 14 | transformer: (name) => name.replace(/[^a-zA-Z0-9-]/g, '').toLowerCase(), 15 | }, 16 | ], 17 | }; 18 | -------------------------------------------------------------------------------- /config/templates/plugin/README.md.ejs: -------------------------------------------------------------------------------- 1 | --- 2 | title: '@onerepo/plugin-<%= name%>' 3 | description: 4 | --- 5 | 6 | ## Installation 7 | 8 | ```sh 9 | npm install --save-dev @onerepo/plugin-<%= name %> 10 | ``` 11 | -------------------------------------------------------------------------------- /config/templates/plugin/package.json.ejs: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@onerepo/plugin-<%- name %>", 3 | "version": "0.0.0", 4 | "license": "MIT", 5 | "repository": { 6 | "type": "git", 7 | "url": "git://github.com/paularmstrong/onerepo.git" 8 | }, 9 | "homepage": "https://onerepo.tools/plugins/<%- name %>/", 10 | "type": "module", 11 | "main": "./src/index.ts", 12 | "publishConfig": { 13 | "access": "public", 14 | "main": "./dist/index.js", 15 | "typings": "./dist/src/index.d.ts" 16 | }, 17 | "files": [ 18 | "./dist/**/*", 19 | "./README.md", 20 | "./CHANGELOG.md" 21 | ], 22 | "dependencies": {}, 23 | "devDependencies": { 24 | "@internal/tsconfig": "workspace:^", 25 | "@internal/vitest-config": "workspace:^", 26 | }, 27 | "engines": { 28 | "node": "^18 || ^20 || ^22" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /config/templates/plugin/src/commands/<%- name %>.ts.ejs: -------------------------------------------------------------------------------- 1 | import { run } from 'onerepo'; 2 | import type { Builder, Handler } from 'onerepo'; 3 | 4 | export const command = '<%- name %>'; 5 | 6 | export const description = 'TODO: enter a description'; 7 | 8 | type Args = { 9 | // TODO 10 | }; 11 | 12 | export const builder: Builder = (yargs) => yargs; 13 | 14 | export const handler: Handler = async function handler(argv, { logger }) { 15 | // TODO: do something 16 | logger.error('Nothing to do'); 17 | }; 18 | -------------------------------------------------------------------------------- /config/templates/plugin/src/index.ts.ejs: -------------------------------------------------------------------------------- 1 | import type { Plugin } from 'onerepo'; 2 | import * as cmd from './commands/<%- name %>'; 3 | 4 | type Options = { 5 | name?: string; 6 | }; 7 | 8 | export function <%- name.replace(/-./g, (x)=> x[1].toUpperCase()) %>(opts: Options = {}): Plugin { 9 | return { 10 | yargs: (yargs, visitor) => { 11 | const { command, description, builder, handler } = visitor(cmd); 12 | const name = opts.name ?? command; 13 | return yargs.command( 14 | name, 15 | description, 16 | (yargs) => builder(yargs).usage(`$0 ${Array.isArray(name) ? name[0] : name} [options]`), 17 | handler 18 | ); 19 | }, 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /config/templates/plugin/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./src"], 7 | "exclude": ["./**/*.test.ts", "./**/__tests__/*"] 8 | } 9 | -------------------------------------------------------------------------------- /config/templates/plugin/tsconfig.json.ejs: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/tsconfig/base.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./src"] 7 | } 8 | -------------------------------------------------------------------------------- /config/templates/plugin/vitest.config.js.ejs: -------------------------------------------------------------------------------- 1 | import { defineProject } from '@internal/vitest-config'; 2 | 3 | export default defineProject({}); 4 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | # generated types 2 | .netlify/ 3 | .vite/ 4 | src/api/* 5 | usage/* 6 | .astro/* 7 | -------------------------------------------------------------------------------- /docs/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # @onerepo/docs 2 | 3 | ## null 4 | 5 | ### Patch Changes 6 | 7 | - Minor updates to internal import methods [#430](https://github.com/paularmstrong/onerepo/pull/430) ([@paularmstrong](https://github.com/paularmstrong)) 8 | -------------------------------------------------------------------------------- /docs/eslint.config.ts: -------------------------------------------------------------------------------- 1 | import tseslint from 'typescript-eslint'; 2 | import pluginAstro from 'eslint-plugin-astro'; 3 | 4 | export default tseslint.config( 5 | { 6 | ignores: ['.astro/**'], 7 | }, 8 | ...pluginAstro.configs.recommended, 9 | { 10 | rules: { 11 | 'import/no-unresolved': ['error', { ignore: ['astro:*'] }], 12 | }, 13 | }, 14 | ); 15 | -------------------------------------------------------------------------------- /docs/netlify.toml: -------------------------------------------------------------------------------- 1 | [dev] 2 | framework = "astro" 3 | targetPort = 4321 4 | autoLaunch = false 5 | 6 | [build] 7 | ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF . ../yarn.lock" 8 | 9 | [[plugins]] 10 | package = "netlify-plugin-csp-generator" 11 | 12 | [plugins.inputs] 13 | buildDir = "dist" 14 | 15 | [plugins.inputs.policies] 16 | baseUri = "'self'" 17 | childSrc = "'none'" 18 | connectSrc = "'self' https://onerepo.goatcounter.com/count" 19 | defaultSrc = "'self'" 20 | fontSrc = "'none'" 21 | frameSrc = "'none'" 22 | imgSrc = "'self' https://www.netlify.com data: https://api.producthunt.com" 23 | manifestSrc = "'self'" 24 | mediaSrc = "'none'" 25 | objectSrc = "'none'" 26 | scriptSrc = "'self' 'unsafe-eval' https://gc.zgo.at" 27 | scriptSrcElem = "'self' 'unsafe-inline' 'unsafe-eval' https://gc.zgo.at" 28 | scriptSrcAttr = "'none'" 29 | styleSrc = "'self'" 30 | styleSrcElem = "'self' 'unsafe-inline'" 31 | styleSrcAttr = "'self' 'unsafe-inline'" 32 | workerSrc = "'none'" 33 | -------------------------------------------------------------------------------- /docs/onerepo.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from 'onerepo'; 2 | 3 | export default { 4 | commands: { 5 | passthrough: { 6 | start: { description: 'Start the Astro dev server.', command: 'astro dev --host' }, 7 | build: { description: 'Build the documentation site for production.', command: 'astro build' }, 8 | check: { description: 'Check Astro pages for errors.', command: 'astro check' }, 9 | astro: { description: 'Run Astro directly.' }, 10 | }, 11 | }, 12 | tasks: { 13 | 'pre-commit': { 14 | serial: [ 15 | { match: '**/*.astro', cmd: '$0 ws docs check' }, 16 | { match: '../modules/**/*.ts', cmd: '$0 ws docs typedoc --add' }, 17 | { match: '../**/*', cmd: '$0 ws docs collect-content -w ${workspaces} --add' }, 18 | { match: '../**/CHANGELOG.md', cmd: '$0 ws docs pull-changelogs --add' }, 19 | ], 20 | }, 21 | 'pre-merge': { 22 | serial: [{ match: '**/*.astro', cmd: '$0 ws docs check' }], 23 | }, 24 | build: { 25 | serial: ['$0 ws docs build'], 26 | }, 27 | }, 28 | } satisfies Config; 29 | -------------------------------------------------------------------------------- /docs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@onerepo/docs", 3 | "type": "module", 4 | "private": true, 5 | "devDependencies": { 6 | "@astrojs/check": "^0.9.4", 7 | "@internal/tsconfig": "workspace:^", 8 | "@types/d3": "^7.4.3", 9 | "@types/pako": "^2.0.3", 10 | "eslint": "^9.28.0", 11 | "eslint-plugin-astro": "^1.3.1", 12 | "glob": "^10.1.0", 13 | "netlify-plugin-csp-generator": "^1.6.1", 14 | "onerepo": "1.2.0", 15 | "postcss": "^8.4.49", 16 | "typedoc": "^0.28.5", 17 | "typedoc-plugin-markdown": "^4.6.4", 18 | "typedoc-plugin-remark": "^2.0.1", 19 | "typescript": "^5.7.2", 20 | "typescript-eslint": "^8.33.0" 21 | }, 22 | "dependencies": { 23 | "@astrojs/markdown-remark": "^6.3.2", 24 | "@astrojs/mdx": "^4.3.0", 25 | "@astrojs/starlight": "^0.34.3", 26 | "@expressive-code/plugin-collapsible-sections": "^0.41.2", 27 | "astro": "^5.8.1", 28 | "astro-meta-tags": "^0.3.2", 29 | "astro-og-canvas": "^0.7.0", 30 | "d3": "^7.9.0", 31 | "dagre-d3-es": "^7.0.11", 32 | "graph-data-structure": "^3.2.0", 33 | "js-base64": "^3.7.7", 34 | "mermaid": "11.4.1", 35 | "pako": "^2.1.0", 36 | "starlight-links-validator": "^0.13.4", 37 | "unist-util-visit": "^5.0.0" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /docs/public/_headers: -------------------------------------------------------------------------------- 1 | /_astro/* 2 | Cache-Control: public 3 | Cache-Control: max-age=31536000 4 | Cache-Control: immutable 5 | -------------------------------------------------------------------------------- /docs/public/_redirects: -------------------------------------------------------------------------------- 1 | /plugins/generate /core/generate 2 | -------------------------------------------------------------------------------- /docs/public/favicon.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /docs/public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Allow: / 3 | 4 | Sitemap: https://onerepo.tools/sitemap-index.xml 5 | -------------------------------------------------------------------------------- /docs/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/docs/src/assets/logo.png -------------------------------------------------------------------------------- /docs/src/assets/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /docs/src/assets/og-background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/docs/src/assets/og-background.png -------------------------------------------------------------------------------- /docs/src/assets/og-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/docs/src/assets/og-logo.png -------------------------------------------------------------------------------- /docs/src/assets/oneRepo.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /docs/src/assets/pkgmgr/npm.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /docs/src/assets/plugins/changesets.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/docs/src/assets/plugins/changesets.webp -------------------------------------------------------------------------------- /docs/src/assets/plugins/eslint.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/docs/src/assets/plugins/eslint.webp -------------------------------------------------------------------------------- /docs/src/assets/plugins/jest.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/docs/src/assets/plugins/jest.webp -------------------------------------------------------------------------------- /docs/src/assets/plugins/prettier.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/docs/src/assets/plugins/prettier.webp -------------------------------------------------------------------------------- /docs/src/assets/plugins/typescript.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/docs/src/assets/plugins/typescript.webp -------------------------------------------------------------------------------- /docs/src/assets/plugins/vitest.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/docs/src/assets/plugins/vitest.webp -------------------------------------------------------------------------------- /docs/src/assets/render.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/docs/src/assets/render.png -------------------------------------------------------------------------------- /docs/src/components/Head.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import Default from '@astrojs/starlight/components/Head.astro'; 3 | --- 4 | 5 | 6 | 13 | -------------------------------------------------------------------------------- /docs/src/components/PageFrame.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import Default from '@astrojs/starlight/components/PageFrame.astro'; 3 | 4 | const isVisualizer = Astro.locals.starlightRoute.entry.slug === 'visualize'; 5 | --- 6 | 7 | { 8 | isVisualizer ? ( 9 |
10 |
11 | 12 |
13 | 14 |
15 | ) : ( 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | ) 26 | } 27 | 28 | 46 | -------------------------------------------------------------------------------- /docs/src/content.config.ts: -------------------------------------------------------------------------------- 1 | import { z, defineCollection } from 'astro:content'; 2 | import { docsSchema, i18nSchema } from '@astrojs/starlight/schema'; 3 | import { docsLoader } from '@astrojs/starlight/loaders'; 4 | 5 | export const collections: Record> = { 6 | docs: defineCollection({ 7 | loader: docsLoader(), 8 | schema: docsSchema({ 9 | extend: z.object({ 10 | meta: z 11 | .object({ 12 | stability: z.enum(['stable', 'unstable', 'preview', 'experimental', 'deprecated']).optional(), 13 | version: z.string().optional(), 14 | }) 15 | .optional(), 16 | }), 17 | }), 18 | }), 19 | i18n: defineCollection({ type: 'data', schema: i18nSchema() }), 20 | }; 21 | -------------------------------------------------------------------------------- /docs/src/content/docs/changelogs/@onerepo/plugin-jest.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: '@onerepo/plugin-jest changelog' 3 | sidebar: 4 | label: plugin-jest 5 | tableOfContents: 6 | maxHeadingLevel: 2 7 | --- 8 | 9 | {/* start-onerepo-sentinel */} 10 | {/* @generated SignedSource<<62f0d03853322d27ecc49bad837f4533>> */} 11 | 12 | ## 1.0.1 13 | 14 | ### Patch changes 15 | 16 | - Updated internal/third-party typescript definitions ([e5fb5fa](https://github.com/paularmstrong/onerepo/commit/e5fb5fa0e9fbe6ff18c2d993cb22119a3908df73)) 17 | - Internal formatting changes due to Prettier upgrade. ([f8cb805](https://github.com/paularmstrong/onerepo/commit/f8cb80550ceabdce6ff6c13bf22466a59e694b0f)) 18 | 19 | ### Dependencies updated 20 | 21 | - onerepo@1.2.0 22 | - @onerepo/test-cli@1.0.4 23 | - @onerepo/yargs@1.0.4 24 | - @onerepo/builders@1.0.4 25 | - @onerepo/git@1.1.0 26 | - @onerepo/graph@1.0.4 27 | - @onerepo/package-manager@1.0.4 28 | - @onerepo/subprocess@1.0.4 29 | - @onerepo/file@1.0.4 30 | - @onerepo/logger@1.0.4 31 | 32 | > View the full changelog: [cd94664...9895235](https://github.com/paularmstrong/onerepo/compare/cd9466419b207f690e55f87d0e4632eebdc0ca6a...98952352d3c32adf853657e46e14f12fe1737992) 33 | 34 | ## 1.0.0 35 | 36 | 🎉 Initial stable release! 37 | 38 | _For historical changelogs, please view the [oneRepo source](https://github.com/paularmstrong/onerepo/tree/main/plugins/plugin-jest)._ 39 | 40 | {/* end-onerepo-sentinel */} 41 | -------------------------------------------------------------------------------- /docs/src/content/docs/changelogs/@onerepo/plugin-performance-writer.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: '@onerepo/plugin-performance-writer changelog' 3 | sidebar: 4 | label: plugin-performance-writer 5 | tableOfContents: 6 | maxHeadingLevel: 2 7 | --- 8 | 9 | {/* start-onerepo-sentinel */} 10 | {/* @generated SignedSource<> */} 11 | 12 | ## 1.0.1 13 | 14 | ### Patch changes 15 | 16 | - Internal formatting changes due to Prettier upgrade. ([f8cb805](https://github.com/paularmstrong/onerepo/commit/f8cb80550ceabdce6ff6c13bf22466a59e694b0f)) 17 | 18 | ### Dependencies updated 19 | 20 | - onerepo@1.2.0 21 | - @onerepo/test-cli@1.0.4 22 | - @onerepo/yargs@1.0.4 23 | - @onerepo/builders@1.0.4 24 | - @onerepo/git@1.1.0 25 | - @onerepo/graph@1.0.4 26 | - @onerepo/package-manager@1.0.4 27 | - @onerepo/subprocess@1.0.4 28 | - @onerepo/file@1.0.4 29 | - @onerepo/logger@1.0.4 30 | 31 | > View the full changelog: [cd94664...9895235](https://github.com/paularmstrong/onerepo/compare/cd9466419b207f690e55f87d0e4632eebdc0ca6a...98952352d3c32adf853657e46e14f12fe1737992) 32 | 33 | ## 1.0.0 34 | 35 | 🎉 Initial stable release! 36 | 37 | _For historical changelogs, please view the [oneRepo source](https://github.com/paularmstrong/onerepo/tree/main/plugins/plugin-performance-writer)._ 38 | 39 | {/* end-onerepo-sentinel */} 40 | -------------------------------------------------------------------------------- /docs/src/content/docs/changelogs/@onerepo/plugin-typescript.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: '@onerepo/plugin-typescript changelog' 3 | sidebar: 4 | label: plugin-typescript 5 | tableOfContents: 6 | maxHeadingLevel: 2 7 | --- 8 | 9 | {/* start-onerepo-sentinel */} 10 | {/* @generated SignedSource<<40aeebe7c52daac07ffbab049fbd6ef0>> */} 11 | 12 | ## 1.0.1 13 | 14 | ### Patch changes 15 | 16 | - Internal formatting changes due to Prettier upgrade. ([f8cb805](https://github.com/paularmstrong/onerepo/commit/f8cb80550ceabdce6ff6c13bf22466a59e694b0f)) 17 | - Type documentation updates for plugin options. ([afbf0a7](https://github.com/paularmstrong/onerepo/commit/afbf0a7980d54960b54a0f27956ce421a9723c92)) 18 | 19 | ### Dependencies updated 20 | 21 | - onerepo@1.2.0 22 | - @onerepo/test-cli@1.0.4 23 | - @onerepo/yargs@1.0.4 24 | - @onerepo/builders@1.0.4 25 | - @onerepo/git@1.1.0 26 | - @onerepo/graph@1.0.4 27 | - @onerepo/package-manager@1.0.4 28 | - @onerepo/subprocess@1.0.4 29 | - @onerepo/file@1.0.4 30 | - @onerepo/logger@1.0.4 31 | 32 | > View the full changelog: [cd94664...9895235](https://github.com/paularmstrong/onerepo/compare/cd9466419b207f690e55f87d0e4632eebdc0ca6a...98952352d3c32adf853657e46e14f12fe1737992) 33 | 34 | ## 1.0.0 35 | 36 | 🎉 Initial stable release! 37 | 38 | _For historical changelogs, please view the [oneRepo source](https://github.com/paularmstrong/onerepo/tree/main/plugins/plugin-typescript)._ 39 | 40 | {/* end-onerepo-sentinel */} 41 | -------------------------------------------------------------------------------- /docs/src/content/docs/core/create.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Create 3 | description: Install oneRepo monorepo tools into a new or existing JavaScript or TypeScript repository. 4 | --- 5 | 6 | A helper command to enable you to _install_ global access to your oneRepo CLI. This allows you to run your CLI by name from anywhere within your repository without needing to know the path to the original binary. 7 | 8 | ## Usage 9 | 10 | ```sh 11 | npx --package=onerepo@latest one create 12 | ``` 13 | -------------------------------------------------------------------------------- /docs/src/content/docs/discord.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Discord 3 | head: 4 | - tag: meta 5 | attrs: 6 | content: '0; url=https://discord.gg/ENTcXb5sVR' 7 | http-equiv: refresh 8 | - tag: meta 9 | attrs: 10 | name: robots 11 | content: 'noindex, nofollow' 12 | template: splash 13 | hero: 14 | tagline: Launching oneRepo on Discord now… 15 | image: 16 | file: ../../assets/render.png 17 | actions: 18 | - text: Launch Discord 19 | link: https://discord.gg/ENTcXb5sVR 20 | icon: discord 21 | variant: primary 22 | --- 23 | -------------------------------------------------------------------------------- /docs/src/content/docs/project/index.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Getting help 3 | description: Where to get help using and working with the oneRepo JavaScript and TypeScript monorepo toolchain. 4 | sidebar: 5 | order: 0 6 | --- 7 | 8 | import { CardGrid } from '@astrojs/starlight/components'; 9 | import LinkCard from '../../../components/LinkCard.astro'; 10 | 11 | 12 | 18 | 24 | 25 | -------------------------------------------------------------------------------- /docs/src/content/docs/visualize.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Visualize your repo 3 | description: Explore the Workspace dependency Graph for your monorepo. 4 | tableOfContents: false 5 | template: 'splash' 6 | editUrl: false 7 | lastUpdated: false 8 | meta: 9 | stability: experimental 10 | --- 11 | 12 | import Visualizer from '../../components/Visualizer.astro'; 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/src/content/i18n/_gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/docs/src/content/i18n/_gitkeep -------------------------------------------------------------------------------- /docs/src/pages/open-graph/[...route].ts: -------------------------------------------------------------------------------- 1 | import { getCollection } from 'astro:content'; 2 | import { OGImageRoute } from 'astro-og-canvas'; 3 | 4 | const collectionEntries = await getCollection('docs'); 5 | const pages = Object.fromEntries(collectionEntries.map(({ id, data }: { id: string; data: unknown }) => [id, data])); 6 | 7 | export const { getStaticPaths, GET } = OGImageRoute({ 8 | param: 'route', 9 | pages, 10 | getImageOptions: (_path, page) => ({ 11 | title: page.title, 12 | description: page.description, 13 | logo: { 14 | // This is actually transparent 15 | // The logo is embedded in the BG image to control positioning 16 | path: './src/assets/og-logo.png', 17 | }, 18 | bgImage: { 19 | path: './src/assets/og-background.png', 20 | fit: 'none', 21 | }, 22 | font: { 23 | title: { 24 | weight: 'Black', 25 | }, 26 | description: { 27 | weight: 'Medium', 28 | size: 32, 29 | }, 30 | }, 31 | }), 32 | }); 33 | -------------------------------------------------------------------------------- /docs/src/plugins/remark-mermaid.ts: -------------------------------------------------------------------------------- 1 | import type { RemarkPlugin } from '@astrojs/markdown-remark'; 2 | import { visit } from 'unist-util-visit'; 3 | 4 | const escapeMap: Record = { 5 | '&': '&', 6 | '<': '<', 7 | '>': '>', 8 | '"': '"', 9 | "'": ''', 10 | '\n': '%0A', 11 | }; 12 | 13 | const escapeHtml = (str: string) => str.replace(/[&<>"']/g, (c) => escapeMap[c] ?? c); 14 | 15 | export const mermaid: RemarkPlugin<[]> = () => (tree) => { 16 | visit(tree, 'code', (node) => { 17 | if (node.lang !== 'mermaid') return; 18 | 19 | // @ts-ignore 20 | node.type = 'html'; 21 | node.value = `

Loading graph...

`; 22 | }); 23 | }; 24 | -------------------------------------------------------------------------------- /docs/src/types.ts: -------------------------------------------------------------------------------- 1 | export type PluginFrontmatter = { 2 | title: string; 3 | tool: string; 4 | description: string; 5 | }; 6 | -------------------------------------------------------------------------------- /docs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "astro/tsconfigs/strict", 3 | "compilerOptions": { 4 | "outDir": "./dist", 5 | "noEmit": false, 6 | "composite": true, 7 | "emitDeclarationOnly": true 8 | }, 9 | "include": [".astro/types.d.ts", "./**/*"], 10 | "exclude": ["dist/**/*"], 11 | "references": [ 12 | { 13 | "path": "../modules/onerepo" 14 | }, 15 | { 16 | "path": "../modules/test-cli" 17 | }, 18 | { 19 | "path": "../modules/yargs" 20 | }, 21 | { 22 | "path": "../modules/builders" 23 | }, 24 | { 25 | "path": "../modules/git" 26 | }, 27 | { 28 | "path": "../modules/graph" 29 | }, 30 | { 31 | "path": "../modules/package-manager" 32 | }, 33 | { 34 | "path": "../modules/subprocess" 35 | }, 36 | { 37 | "path": "../modules/file" 38 | }, 39 | { 40 | "path": "../modules/logger" 41 | }, 42 | { 43 | "path": "../internal/vitest-config" 44 | }, 45 | { 46 | "path": "../internal/jest-config" 47 | } 48 | ] 49 | } 50 | -------------------------------------------------------------------------------- /docs/typedoc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | enumMembersFormat: 'table', 3 | excludeInternal: true, 4 | excludeExternals: true, 5 | excludePrivate: true, 6 | expandObjects: true, 7 | githubPages: false, 8 | hideBreadcrumbs: true, 9 | hideGenerator: true, 10 | // hideInPageTOC: true, 11 | hidePageHeader: true, 12 | hidePageTitle: true, 13 | indexFormat: 'table', 14 | // memberPageTitle: '{name}', 15 | router: 'module', 16 | parametersFormat: 'table', 17 | propertiesFormat: 'list', 18 | readme: 'none', 19 | sort: ['kind', 'enum-value-ascending', 'alphabetical'], 20 | sourceLinkTemplate: 'https://github.com/paularmstrong/onerepo/blob/{gitRevision}/{path}', 21 | typeDeclarationFormat: 'list', 22 | // useCodeBlocks: true, 23 | kindSortOrder: [ 24 | 'Project', 25 | 'Module', 26 | 'Namespace', 27 | 'Function', 28 | 'Class', 29 | 'Constructor', 30 | 'Property', 31 | 'Accessor', 32 | 'Method', 33 | 'Variable', 34 | 'Parameter', 35 | 'Interface', 36 | 'TypeAlias', 37 | 'Enum', 38 | 'EnumMember', 39 | 'Reference', 40 | 'TypeParameter', 41 | 'TypeLiteral', 42 | 'CallSignature', 43 | 'ConstructorSignature', 44 | 'IndexSignature', 45 | 'GetSignature', 46 | 'SetSignature', 47 | ], 48 | }; 49 | -------------------------------------------------------------------------------- /eslint.config.ts: -------------------------------------------------------------------------------- 1 | import tseslint from 'typescript-eslint'; 2 | import { rootConfig } from '@internal/eslint-plugin'; 3 | import onerepoEslint from '@onerepo/plugin-eslint/config'; 4 | 5 | export default onerepoEslint( 6 | tseslint.config( 7 | { 8 | ignores: ['**/dist', '**/fixtures', '**/.yarn', '*.tsbuildinfo'], 9 | }, 10 | rootConfig, 11 | ), 12 | ); 13 | -------------------------------------------------------------------------------- /internal/eslint-plugin/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@internal/eslint-plugin", 3 | "private": true, 4 | "type": "module", 5 | "main": "./src/index.ts", 6 | "exports": { 7 | ".": "./src/index.ts" 8 | }, 9 | "dependencies": { 10 | "@eslint/js": "^9.28.0", 11 | "@typescript-eslint/eslint-plugin": "^8.33.0", 12 | "@typescript-eslint/parser": "^8.33.0", 13 | "eslint-import-resolver-typescript": "^4.4.2", 14 | "eslint-plugin-import": "^2.31.0", 15 | "eslint-plugin-jest": "^28.12.0", 16 | "eslint-plugin-unused-imports": "^4.1.4", 17 | "typescript": "^5.7.2", 18 | "typescript-eslint": "^8.33.0" 19 | }, 20 | "devDependencies": { 21 | "@internal/tsconfig": "workspace:^" 22 | }, 23 | "peerDependencies": { 24 | "eslint": "^9" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /internal/eslint-plugin/src/types.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'eslint-plugin-import' { 2 | // eslint-disable-next-line no-var 3 | var flatConfigs = { 4 | errors: any 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /internal/eslint-plugin/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/tsconfig/base.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./**/*"], 7 | "references": [] 8 | } 9 | -------------------------------------------------------------------------------- /internal/jest-config/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@internal/jest-config", 3 | "private": true, 4 | "type": "module", 5 | "main": "./src/index.js", 6 | "devDependencies": { 7 | "@internal/tsconfig": "workspace:^", 8 | "@types/jest": "^29.5.14", 9 | "esbuild": "^0.25.4", 10 | "esbuild-jest": "^0.5.0", 11 | "jest": "^29.7.0" 12 | }, 13 | "peerDependencies": { 14 | "jest": "^29.5.0" 15 | }, 16 | "dependencies": { 17 | "@jest/globals": "^29.7.0" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /internal/jest-config/src/globals.js: -------------------------------------------------------------------------------- 1 | // @ts-nocheck 2 | import { jest } from '@jest/globals'; 3 | 4 | global.vi = new Proxy( 5 | {}, 6 | { 7 | get(target, property) { 8 | return jest[property].bind(jest); 9 | }, 10 | }, 11 | ); 12 | -------------------------------------------------------------------------------- /internal/jest-config/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { Config } from 'jest'; 2 | 3 | declare const makeConfig = (Config) => Config; 4 | 5 | -------------------------------------------------------------------------------- /internal/jest-config/src/index.js: -------------------------------------------------------------------------------- 1 | import path from 'node:path'; 2 | import { fileURLToPath } from 'node:url'; 3 | 4 | function localPath( 5 | /** @type {string} */ 6 | filepath, 7 | ) { 8 | return path.join(path.dirname(fileURLToPath(import.meta.url)), filepath); 9 | } 10 | 11 | /** 12 | * @param config {import('jest').Config} 13 | * @return {import('jest').Config} 14 | */ 15 | export function makeConfig(config) { 16 | const { rootDir = '', ...rest } = config; 17 | return { 18 | clearMocks: true, 19 | resetMocks: true, 20 | restoreMocks: true, 21 | moduleFileExtensions: ['js', 'mjs', 'cjs', 'jsx', 'ts', 'tsx', 'json', 'node'], 22 | ...rest, 23 | coveragePathIgnorePatterns: [ 24 | '/__fixtures__/', 25 | '/dist/', 26 | '.config.(mjs|cjs|ts|js)$', 27 | ...(rest.coveragePathIgnorePatterns ?? []), 28 | ], 29 | rootDir: path.dirname(fileURLToPath(rootDir)), 30 | moduleNameMapper: { 31 | '^prettier$': localPath('mocks/prettier.js'), 32 | }, 33 | modulePathIgnorePatterns: ['fixtures'], 34 | setupFiles: [localPath('globals.js')], 35 | testPathIgnorePatterns: ['/dist/'], 36 | transformIgnorePatterns: ['/node_modules/(?!(inquirer|log-update))/', ...(config.transformIgnorePatterns ?? [])], 37 | transform: { 38 | '\\.[jt]sx?$': ['esbuild-jest', { sourcemap: true }], 39 | ...config.transform, 40 | }, 41 | watchPathIgnorePatterns: ['/node_modules/'], 42 | }; 43 | } 44 | -------------------------------------------------------------------------------- /internal/jest-config/src/mocks/prettier.js: -------------------------------------------------------------------------------- 1 | // @ts-nocheck 2 | jest.mock('prettier', () => ({ 3 | __esModule: true, 4 | ...jest.requireActual('prettier'), 5 | })); 6 | -------------------------------------------------------------------------------- /internal/jest-config/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/tsconfig/base.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./**/*"], 7 | "references": [] 8 | } 9 | -------------------------------------------------------------------------------- /internal/prettier-config/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@internal/prettier-config", 3 | "private": true, 4 | "type": "commonjs", 5 | "main": "./src/index.cjs", 6 | "peerDependencies": { 7 | "prettier": "^2 || ^3" 8 | }, 9 | "devDependencies": { 10 | "@internal/tsconfig": "workspace:^", 11 | "@types/prettier": "^3.0.0" 12 | }, 13 | "dependencies": { 14 | "prettier-plugin-astro": "^0.14.1" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /internal/prettier-config/src/index.cjs: -------------------------------------------------------------------------------- 1 | /** @type import('prettier').Config */ 2 | module.exports = { 3 | plugins: [require.resolve('prettier-plugin-astro')], 4 | printWidth: 120, 5 | singleQuote: true, 6 | useTabs: true, 7 | 8 | overrides: [ 9 | { 10 | files: '*.astro', 11 | options: { 12 | parser: 'astro', 13 | }, 14 | }, 15 | { 16 | files: ['*.mdx'], 17 | options: { 18 | printWidth: 100, 19 | }, 20 | }, 21 | ], 22 | }; 23 | -------------------------------------------------------------------------------- /internal/prettier-config/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from 'prettier'; 2 | 3 | export default Config; 4 | -------------------------------------------------------------------------------- /internal/prettier-config/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/tsconfig/base.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./**/*"], 7 | "references": [] 8 | } 9 | -------------------------------------------------------------------------------- /internal/tsconfig/base.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowSyntheticDefaultImports": true, 4 | "checkJs": true, 5 | "composite": true, 6 | "declaration": true, 7 | "declarationMap": false, 8 | "downlevelIteration": true, 9 | "esModuleInterop": true, 10 | "forceConsistentCasingInFileNames": true, 11 | "isolatedModules": false, 12 | "lib": ["esnext"], 13 | "module": "esnext", 14 | "moduleResolution": "bundler", 15 | "noImplicitAny": true, 16 | "noImplicitThis": true, 17 | "skipLibCheck": true, 18 | "resolveJsonModule": true, 19 | "sourceMap": true, 20 | "strict": true, 21 | "target": "es2022", 22 | "types": ["node", "vitest/globals"] 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /internal/tsconfig/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@internal/tsconfig", 3 | "private": true, 4 | "main": "./base.json", 5 | "files": [ 6 | "./base.json" 7 | ], 8 | "dependencies": { 9 | "@types/jest": "^29.5.14", 10 | "@types/node": "^20.17.9" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /internal/vitest-config/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@internal/vitest-config", 3 | "private": true, 4 | "type": "module", 5 | "main": "./src/index.js", 6 | "devDependencies": { 7 | "@internal/tsconfig": "workspace:^", 8 | "vitest": "^3.1.4" 9 | }, 10 | "peerDependencies": { 11 | "vitest": "^3" 12 | }, 13 | "dependencies": { 14 | "@vitest/coverage-v8": "^3.1.4" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /internal/vitest-config/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { UserProjectConfigExport } from 'vitest/config'; 2 | 3 | declare const defineProject = UserProjectConfigExport; 4 | 5 | -------------------------------------------------------------------------------- /internal/vitest-config/src/index.js: -------------------------------------------------------------------------------- 1 | import { defineProject as vitestDefineProject } from 'vitest/config'; 2 | 3 | // defineWorkspace provides a nice type hinting DX 4 | export const defineProject = ( 5 | /** @type {any} */ 6 | config, 7 | ) => 8 | vitestDefineProject({ 9 | ...config, 10 | test: { 11 | ...('test' in config ? config.test : {}), 12 | globals: true, 13 | restoreMocks: true, 14 | mockReset: true, 15 | }, 16 | }); 17 | -------------------------------------------------------------------------------- /internal/vitest-config/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/tsconfig/base.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./**/*"], 7 | "references": [] 8 | } 9 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('jest').Config} */ 2 | export default { 3 | collectCoverageFrom: ['**/*.{ts,js}', '!**/node_modules/**'], 4 | projects: ['/modules/*/jest.config.js', '/plugins/*/jest.config.js'], 5 | }; 6 | -------------------------------------------------------------------------------- /modules/builders/.changes/000-swift-words-worry.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: minor 3 | --- 4 | 5 | Officially support Node 22 6 | -------------------------------------------------------------------------------- /modules/builders/.changes/001-silly-foxes-marry.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: patch 3 | --- 4 | 5 | Updates build dependency "esbuild". 6 | -------------------------------------------------------------------------------- /modules/builders/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@onerepo/builders", 3 | "version": "1.0.4", 4 | "license": "MIT", 5 | "repository": { 6 | "type": "git", 7 | "url": "git://github.com/paularmstrong/onerepo.git", 8 | "directory": "modules/builders" 9 | }, 10 | "homepage": "https://onerepo.tools", 11 | "type": "module", 12 | "main": "./src/index.ts", 13 | "publishConfig": { 14 | "access": "public", 15 | "main": "./dist/index.js", 16 | "typings": "./dist/src/index.d.ts" 17 | }, 18 | "files": [ 19 | "./dist/**/*", 20 | "./README.md", 21 | "./CHANGELOG.md" 22 | ], 23 | "dependencies": { 24 | "@onerepo/git": "1.1.0", 25 | "@onerepo/logger": "1.0.4", 26 | "minimatch": "^9.0.3" 27 | }, 28 | "devDependencies": { 29 | "@internal/tsconfig": "workspace:^", 30 | "@internal/vitest-config": "workspace:^", 31 | "@onerepo/graph": "workspace:^" 32 | }, 33 | "engines": { 34 | "node": "^18 || ^20 || ^22" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /modules/builders/src/__tests__/__fixtures__/repo/apps/menu/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "menu", 3 | "dependencies": { 4 | "tacos": "workspace:^" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /modules/builders/src/__tests__/__fixtures__/repo/modules/burritos/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "burritos", 3 | "version": "4.5.2" 4 | } 5 | -------------------------------------------------------------------------------- /modules/builders/src/__tests__/__fixtures__/repo/modules/tacos/onerepo.config.js: -------------------------------------------------------------------------------- 1 | /** @type import('onerepo').Config */ 2 | module.exports = { 3 | tasks: { 4 | 'post-commit': { serial: ['echo "post-commit" "tacos"'] }, 5 | }, 6 | }; 7 | -------------------------------------------------------------------------------- /modules/builders/src/__tests__/__fixtures__/repo/modules/tacos/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tacos", 3 | "version": "1.2.3" 4 | } 5 | -------------------------------------------------------------------------------- /modules/builders/src/__tests__/__fixtures__/repo/onerepo.config.js: -------------------------------------------------------------------------------- 1 | /** @type import('onerepo').Config */ 2 | module.exports = { 3 | tasks: { 4 | 'pre-commit': { parallel: ['$0 lint', '$0 tsc'] }, 5 | commit: { serial: ['echo "commit"'] }, 6 | 'post-commit': { serial: ['echo "post-commit"'] }, 7 | }, 8 | }; 9 | -------------------------------------------------------------------------------- /modules/builders/src/__tests__/__fixtures__/repo/package-lock.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/modules/builders/src/__tests__/__fixtures__/repo/package-lock.json -------------------------------------------------------------------------------- /modules/builders/src/__tests__/__fixtures__/repo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fixture-root", 3 | "private": true, 4 | "type": "commonjs", 5 | "workspaces": [ 6 | "apps/*", 7 | "modules/*" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /modules/builders/src/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Common and reusable command-line option builders. 3 | * 4 | * @module 5 | */ 6 | export * from './getters'; 7 | export * from './with-affected'; 8 | export * from './with-all-inputs'; 9 | export * from './with-files'; 10 | export * from './with-workspaces'; 11 | -------------------------------------------------------------------------------- /modules/builders/src/with-files.ts: -------------------------------------------------------------------------------- 1 | import type { Yargs } from '@onerepo/yargs'; 2 | 3 | /** 4 | * Adds the following input arguments to command {@link Handler | `Handler`}. Typically used in conjunction with getters like {@link !builders.getFilepaths | `builders.getFilepaths`}. 5 | * - `--files` 6 | * 7 | * See [`WithFiles`](#withfiles-1) for type safety. 8 | * 9 | * ```js title="commands/mycommand.js" 10 | * export const builder = (yargs) => builders.withFiles(yargs); 11 | * ``` 12 | * 13 | * @group Builders 14 | */ 15 | export const withFiles = (yargs: Yargs): Yargs => 16 | yargs.option('files', { 17 | alias: 'f', 18 | type: 'array', 19 | string: true, 20 | description: 'Determine Workspaces from specific files', 21 | conflicts: ['all', 'workspaces'], 22 | }); 23 | 24 | /** 25 | * To be paired with the {@link withFiles | `builders.withFiles`}. Adds types for arguments parsed. 26 | * 27 | * ```ts title="commands/mycommand.ts" 28 | * type Argv = builders.WithFiles & { 29 | * // ... 30 | * }; 31 | * 32 | * export const builder: Builder = (yargs) => builders.withFiles(yargs); 33 | * ``` 34 | * 35 | * @group Builders 36 | */ 37 | export type WithFiles = { 38 | /** 39 | * List of filepaths. 40 | */ 41 | files?: Array; 42 | }; 43 | -------------------------------------------------------------------------------- /modules/builders/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./src"], 7 | "exclude": ["./**/*.test.ts", "./**/__tests__/*"] 8 | } 9 | -------------------------------------------------------------------------------- /modules/builders/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/tsconfig/base.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./**/*"], 7 | "references": [ 8 | { 9 | "path": "../git" 10 | }, 11 | { 12 | "path": "../graph" 13 | }, 14 | { 15 | "path": "../package-manager" 16 | }, 17 | { 18 | "path": "../subprocess" 19 | }, 20 | { 21 | "path": "../file" 22 | }, 23 | { 24 | "path": "../logger" 25 | }, 26 | { 27 | "path": "../../internal/vitest-config" 28 | }, 29 | { 30 | "path": "../../internal/jest-config" 31 | } 32 | ] 33 | } 34 | -------------------------------------------------------------------------------- /modules/builders/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineProject } from '@internal/vitest-config'; 2 | 3 | export default defineProject({}); 4 | -------------------------------------------------------------------------------- /modules/eslint-formatter/.changes/000-swift-words-worry.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: minor 3 | --- 4 | 5 | Officially support Node 22 6 | -------------------------------------------------------------------------------- /modules/eslint-formatter/.changes/001-silly-foxes-marry.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: patch 3 | --- 4 | 5 | Updates build dependency "esbuild". 6 | -------------------------------------------------------------------------------- /modules/eslint-formatter/.changes/002-tired-ads-peel.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: minor 3 | --- 4 | 5 | Adds official support for ESLint 9. 6 | -------------------------------------------------------------------------------- /modules/eslint-formatter/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # eslint-formatter-onerepo 2 | 3 | ## 1.0.4 4 | 5 | ### Patch changes 6 | 7 | - Internal formatting changes due to Prettier upgrade. ([f8cb805](https://github.com/paularmstrong/onerepo/commit/f8cb80550ceabdce6ff6c13bf22466a59e694b0f)) 8 | 9 | > View the full changelog: [a117f2a...9895235](https://github.com/paularmstrong/onerepo/compare/a117f2a8326b148de98fcffefc37e6ad46edcb87...98952352d3c32adf853657e46e14f12fe1737992) 10 | 11 | ## 1.0.3 12 | 13 | > View the full changelog: [c8234dc...9359c78](https://github.com/paularmstrong/onerepo/compare/c8234dc79f7b7f40ca42167d41a6a6f4126c5286...9359c78e4da54e0402ad6a4bf5890a8a71972c8e) 14 | 15 | ## 1.0.2 16 | 17 | > View the full changelog: [74892d8...d7f3a29](https://github.com/paularmstrong/onerepo/compare/74892d8605917bb0d8a1c3fe113d1b04f2505abb...d7f3a2956c6d8ea4a4346ac2541b67196fdc6011) 18 | 19 | ## 1.0.1 20 | 21 | > View the full changelog: [cd94664...6ae1391](https://github.com/paularmstrong/onerepo/compare/cd9466419b207f690e55f87d0e4632eebdc0ca6a...6ae13912ef4b9bedab788be13fa167a709b26bba) 22 | 23 | ## 1.0.0 24 | 25 | 🎉 Initial stable release! 26 | 27 | _For historical changelogs, please view the [oneRepo source](https://github.com/paularmstrong/onerepo/tree/main/modules/eslint-formatter)._ 28 | -------------------------------------------------------------------------------- /modules/eslint-formatter/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "eslint-formatter-onerepo", 3 | "version": "1.0.4", 4 | "license": "MIT", 5 | "repository": { 6 | "type": "git", 7 | "url": "git://github.com/paularmstrong/onerepo.git", 8 | "directory": "modules/eslint-formatter" 9 | }, 10 | "homepage": "https://onerepo.tools", 11 | "type": "commonjs", 12 | "main": "./src/index.js", 13 | "publishConfig": { 14 | "access": "public", 15 | "main": "./dist/index.js", 16 | "typings": "./dist/src/index.d.ts" 17 | }, 18 | "files": [ 19 | "./dist/**/*", 20 | "./README.md", 21 | "./CHANGELOG.md" 22 | ], 23 | "dependencies": { 24 | "@actions/core": "^1.10.1" 25 | }, 26 | "devDependencies": { 27 | "@internal/jest-config": "workspace:^", 28 | "@internal/tsconfig": "workspace:^", 29 | "eslint": "^9.28.0" 30 | }, 31 | "peerDependencies": { 32 | "eslint": "^8 || ^9" 33 | }, 34 | "engines": { 35 | "node": "^18 || ^20 || ^22" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /modules/eslint-formatter/src/index.js: -------------------------------------------------------------------------------- 1 | const gh = require('@actions/core'); 2 | const { ESLint } = require('eslint'); 3 | 4 | /** 5 | * @type {import('eslint').ESLint.Formatter} 6 | */ 7 | const formatter = { 8 | format: async function (results, context) { 9 | const eslint = new ESLint(); 10 | const { format } = await eslint.loadFormatter('stylish'); 11 | 12 | if (process.env.GITHUB_RUN_ID && process.env.ONEREPO_ESLINT_GITHUB_ANNOTATE === 'true') { 13 | results.forEach((file) => { 14 | file.messages.forEach((msg) => { 15 | const data = { file: file.filePath, startLine: msg.line, startColumn: msg.column }; 16 | const message = `${msg.message} (${msg.ruleId})`; 17 | if (msg.severity === 2) { 18 | gh.error(message, data); 19 | } else if (msg.severity === 1) { 20 | gh.warning(message, data); 21 | } 22 | }); 23 | }); 24 | } 25 | 26 | return format(results, context); 27 | }, 28 | }; 29 | 30 | module.exports = formatter.format; 31 | -------------------------------------------------------------------------------- /modules/eslint-formatter/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./src"], 7 | "exclude": ["./**/*.test.ts", "./**/__tests__/*"] 8 | } 9 | -------------------------------------------------------------------------------- /modules/eslint-formatter/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/tsconfig/base.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./**/*"], 7 | "references": [ 8 | { 9 | "path": "../../internal/jest-config" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /modules/file/.changes/000-swift-words-worry.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: minor 3 | --- 4 | 5 | Officially support Node 22 6 | -------------------------------------------------------------------------------- /modules/file/.changes/001-moody-doodles-hear.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: patch 3 | --- 4 | 5 | Update internal typescript resolution package (Jiti) 6 | -------------------------------------------------------------------------------- /modules/file/.changes/002-silly-foxes-marry.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: patch 3 | --- 4 | 5 | Updates build dependency "esbuild". 6 | -------------------------------------------------------------------------------- /modules/file/.changes/003-dirty-waves-start.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: patch 3 | --- 4 | 5 | Adds comment syntax for more JavaScript and TypeScript files when using `file.writeSafe()`. 6 | -------------------------------------------------------------------------------- /modules/file/.changes/004-giant-eyes-tan.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: patch 3 | --- 4 | 5 | Removes some extra whitespace added with `file.writeSafe()`. 6 | -------------------------------------------------------------------------------- /modules/file/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@onerepo/file", 3 | "version": "1.0.4", 4 | "license": "MIT", 5 | "repository": { 6 | "type": "git", 7 | "url": "git://github.com/paularmstrong/onerepo.git", 8 | "directory": "modules/file" 9 | }, 10 | "homepage": "https://onerepo.tools", 11 | "type": "module", 12 | "main": "./src/index.ts", 13 | "publishConfig": { 14 | "access": "public", 15 | "main": "./dist/index.js", 16 | "typings": "./dist/src/index.d.ts" 17 | }, 18 | "files": [ 19 | "./dist/**/*", 20 | "./README.md", 21 | "./CHANGELOG.md" 22 | ], 23 | "dependencies": { 24 | "@onerepo/logger": "1.0.4", 25 | "jiti": "^2.4.2" 26 | }, 27 | "devDependencies": { 28 | "@internal/tsconfig": "workspace:^", 29 | "@internal/vitest-config": "workspace:^", 30 | "prettier": "^3.4.2" 31 | }, 32 | "peerDependencies": { 33 | "prettier": "^2 || ^3" 34 | }, 35 | "engines": { 36 | "node": "^18 || ^20 || ^22" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /modules/file/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./src"], 7 | "exclude": ["./**/*.test.ts", "./**/__tests__/*"] 8 | } 9 | -------------------------------------------------------------------------------- /modules/file/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/tsconfig/base.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./**/*"], 7 | "references": [ 8 | { 9 | "path": "../logger" 10 | }, 11 | { 12 | "path": "../../internal/vitest-config" 13 | }, 14 | { 15 | "path": "../../internal/jest-config" 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /modules/file/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineProject } from '@internal/vitest-config'; 2 | 3 | export default defineProject({}); 4 | -------------------------------------------------------------------------------- /modules/git/.changes/000-swift-words-worry.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: minor 3 | --- 4 | 5 | Officially support Node 22 6 | -------------------------------------------------------------------------------- /modules/git/.changes/001-silly-foxes-marry.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: patch 3 | --- 4 | 5 | Updates build dependency "esbuild". 6 | -------------------------------------------------------------------------------- /modules/git/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@onerepo/git", 3 | "version": "1.1.0", 4 | "license": "MIT", 5 | "repository": { 6 | "type": "git", 7 | "url": "git://github.com/paularmstrong/onerepo.git", 8 | "directory": "modules/git" 9 | }, 10 | "homepage": "https://onerepo.tools", 11 | "type": "module", 12 | "main": "./src/index.ts", 13 | "publishConfig": { 14 | "access": "public", 15 | "main": "./dist/index.js", 16 | "typings": "./dist/src/index.d.ts" 17 | }, 18 | "files": [ 19 | "./dist/**/*", 20 | "./README.md", 21 | "./CHANGELOG.md" 22 | ], 23 | "dependencies": { 24 | "@onerepo/file": "1.0.4", 25 | "@onerepo/logger": "1.0.4", 26 | "@onerepo/subprocess": "1.0.4" 27 | }, 28 | "devDependencies": { 29 | "@internal/tsconfig": "workspace:^", 30 | "@internal/vitest-config": "workspace:^", 31 | "@onerepo/graph": "workspace:^" 32 | }, 33 | "engines": { 34 | "node": "^18 || ^20 || ^22" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /modules/git/src/__tests__/workflow.test.ts: -------------------------------------------------------------------------------- 1 | import * as subprocess from '@onerepo/subprocess'; 2 | import * as file from '@onerepo/file'; 3 | import { getLogger } from '@onerepo/logger'; 4 | import { getGraph } from '@onerepo/graph'; 5 | import { StagingWorkflow } from '../workflow'; 6 | 7 | const graph = getGraph(); 8 | 9 | describe('StagingWorkflow', () => { 10 | beforeEach(() => { 11 | vi.spyOn(subprocess, 'run').mockResolvedValue(['', '']); 12 | vi.spyOn(file, 'exists').mockResolvedValue(false); 13 | vi.spyOn(file, 'read').mockResolvedValue(''); 14 | vi.spyOn(file, 'remove').mockResolvedValue(undefined); 15 | vi.spyOn(file, 'write').mockResolvedValue(undefined); 16 | }); 17 | 18 | describe('saveUnstaged', () => { 19 | test('checks status', async () => { 20 | const logger = getLogger({ verbosity: 0 }); 21 | const workflow = new StagingWorkflow({ graph, logger }); 22 | 23 | await workflow.saveUnstaged(); 24 | 25 | expect(subprocess.run).toHaveBeenCalledWith( 26 | expect.objectContaining({ 27 | cmd: 'git', 28 | args: ['status', '-z'], 29 | }), 30 | ); 31 | }); 32 | 33 | test.todo('Actually write tests for this cumbersome process'); 34 | }); 35 | }); 36 | -------------------------------------------------------------------------------- /modules/git/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./src"], 7 | "exclude": ["./**/*.test.ts", "./**/__tests__/*"] 8 | } 9 | -------------------------------------------------------------------------------- /modules/git/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/tsconfig/base.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./**/*"], 7 | "references": [ 8 | { 9 | "path": "../graph" 10 | }, 11 | { 12 | "path": "../package-manager" 13 | }, 14 | { 15 | "path": "../subprocess" 16 | }, 17 | { 18 | "path": "../file" 19 | }, 20 | { 21 | "path": "../logger" 22 | }, 23 | { 24 | "path": "../../internal/vitest-config" 25 | }, 26 | { 27 | "path": "../../internal/jest-config" 28 | } 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /modules/git/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineProject } from '@internal/vitest-config'; 2 | 3 | export default defineProject({}); 4 | -------------------------------------------------------------------------------- /modules/github-action/.gitignore: -------------------------------------------------------------------------------- 1 | !dist/get-tasks.cjs 2 | !dist/run-task.cjs 3 | -------------------------------------------------------------------------------- /modules/github-action/onerepo.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from 'onerepo'; 2 | 3 | export default { 4 | tasks: { 5 | 'pre-commit': { 6 | parallel: [{ cmd: '$0 ws github-action build', match: 'src/**/*' }], 7 | }, 8 | build: { 9 | parallel: ['$0 ws github-action build'], 10 | }, 11 | }, 12 | } satisfies Config; 13 | -------------------------------------------------------------------------------- /modules/github-action/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@onerepo/github-action", 3 | "private": true, 4 | "license": "MIT", 5 | "repository": { 6 | "type": "git", 7 | "url": "git://github.com/paularmstrong/onerepo.git", 8 | "directory": "modules/github-action" 9 | }, 10 | "homepage": "https://onerepo.tools", 11 | "type": "module", 12 | "main": "./src/index.ts", 13 | "publishConfig": { 14 | "access": "public", 15 | "main": "./dist/index.js", 16 | "typings": "./dist/src/index.d.ts" 17 | }, 18 | "files": [ 19 | "./dist/**/*", 20 | "./README.md", 21 | "./CHANGELOG.md" 22 | ], 23 | "devDependencies": { 24 | "@internal/tsconfig": "workspace:^" 25 | }, 26 | "engines": { 27 | "node": "^18 || ^20 || ^22" 28 | }, 29 | "dependencies": { 30 | "@actions/core": "^1.10.1", 31 | "glob": "^10.1.0", 32 | "onerepo": "workspace:^" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /modules/github-action/src/get-tasks.ts: -------------------------------------------------------------------------------- 1 | import { execSync } from 'node:child_process'; 2 | import * as core from '@actions/core'; 3 | 4 | const pkgManager = core.getInput('packageManager', { required: true }); 5 | const overrideBin = core.getInput('overrideBin', { required: false }); 6 | const lifecycle = core.getInput('lifecycle', { required: true }); 7 | const verbosity = parseInt(core.getInput('verbosity') ?? 2, 10); 8 | 9 | const tasks = execSync( 10 | `${overrideBin ? overrideBin : `${pkgManager} one`} tasks --lifecycle=${lifecycle} --list -${'v'.repeat(verbosity)}`, 11 | { env: { ONEREPO_USE_HOOKS: '0', ...process.env } }, 12 | ) 13 | .toString() 14 | .trim(); 15 | 16 | core.setOutput('tasks', tasks); 17 | -------------------------------------------------------------------------------- /modules/github-action/src/run-task.ts: -------------------------------------------------------------------------------- 1 | import { spawn } from 'node:child_process'; 2 | import type { RunSpec } from 'onerepo'; 3 | import { getInput } from '@actions/core'; 4 | 5 | const input = getInput('task', { required: true }); 6 | const parsed: RunSpec | Array = JSON.parse(input); 7 | 8 | const tasks = Array.isArray(parsed) ? parsed : [parsed]; 9 | 10 | async function run() { 11 | let failures = false; 12 | for (const task of tasks) { 13 | await new Promise((resolve) => { 14 | const proc = spawn(task.cmd, task.args ?? [], { 15 | ...(task.opts ?? {}), 16 | env: { ...(task.opts?.env ?? {}), ONEREPO_USE_HOOKS: '0', ...process.env }, 17 | stdio: 'inherit', 18 | }); 19 | 20 | proc.on('exit', (code) => { 21 | if (code && isFinite(code)) { 22 | failures = true; 23 | resolve(code); 24 | return; 25 | } 26 | resolve(0); 27 | }); 28 | }); 29 | } 30 | 31 | if (failures) { 32 | process.exitCode = 1; 33 | process.exit(1); 34 | } 35 | } 36 | 37 | run(); 38 | -------------------------------------------------------------------------------- /modules/github-action/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./src"], 7 | "exclude": ["./**/*.test.ts", "./**/__tests__/*"] 8 | } 9 | -------------------------------------------------------------------------------- /modules/github-action/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/tsconfig/base.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./**/*"], 7 | "references": [ 8 | { 9 | "path": "../onerepo" 10 | }, 11 | { 12 | "path": "../test-cli" 13 | }, 14 | { 15 | "path": "../yargs" 16 | }, 17 | { 18 | "path": "../builders" 19 | }, 20 | { 21 | "path": "../git" 22 | }, 23 | { 24 | "path": "../graph" 25 | }, 26 | { 27 | "path": "../package-manager" 28 | }, 29 | { 30 | "path": "../subprocess" 31 | }, 32 | { 33 | "path": "../file" 34 | }, 35 | { 36 | "path": "../logger" 37 | }, 38 | { 39 | "path": "../../internal/vitest-config" 40 | }, 41 | { 42 | "path": "../../internal/jest-config" 43 | } 44 | ] 45 | } 46 | -------------------------------------------------------------------------------- /modules/graph/.changes/000-swift-words-worry.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: minor 3 | --- 4 | 5 | Officially support Node 22 6 | -------------------------------------------------------------------------------- /modules/graph/.changes/001-moody-doodles-hear.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: patch 3 | --- 4 | 5 | Update internal typescript resolution package (Jiti) 6 | -------------------------------------------------------------------------------- /modules/graph/.changes/002-silly-foxes-marry.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: patch 3 | --- 4 | 5 | Updates build dependency "esbuild". 6 | -------------------------------------------------------------------------------- /modules/graph/.changes/003-loose-phones-call.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: patch 3 | --- 4 | 5 | Internal-only type and formatting updates. 6 | -------------------------------------------------------------------------------- /modules/graph/jest.config.js: -------------------------------------------------------------------------------- 1 | import { makeConfig } from '@internal/jest-config'; 2 | 3 | const config = makeConfig({ 4 | displayName: 'graph', 5 | rootDir: import.meta.url, 6 | }); 7 | 8 | export default config; 9 | -------------------------------------------------------------------------------- /modules/graph/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@onerepo/graph", 3 | "version": "1.0.4", 4 | "license": "MIT", 5 | "repository": { 6 | "type": "git", 7 | "url": "git://github.com/paularmstrong/onerepo.git", 8 | "directory": "modules/graph" 9 | }, 10 | "homepage": "https://onerepo.tools", 11 | "type": "module", 12 | "main": "./src/index.ts", 13 | "publishConfig": { 14 | "access": "public", 15 | "main": "./dist/index.js", 16 | "typings": "./dist/src/index.d.ts" 17 | }, 18 | "files": [ 19 | "./dist/**/*", 20 | "./README.md", 21 | "./CHANGELOG.md" 22 | ], 23 | "dependencies": { 24 | "@onerepo/package-manager": "1.0.4", 25 | "defaults": "^3.0.0", 26 | "glob": "^10.1.0", 27 | "graph-data-structure": "^3.2.0", 28 | "jiti": "^2.4.2", 29 | "js-yaml": "^4.1.0", 30 | "minimatch": "^9.0.3" 31 | }, 32 | "devDependencies": { 33 | "@internal/jest-config": "workspace:^", 34 | "@internal/tsconfig": "workspace:^", 35 | "@internal/vitest-config": "workspace:^", 36 | "typescript": "^5.7.2" 37 | }, 38 | "engines": { 39 | "node": "^18 || ^20 || ^22" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /modules/graph/src/__tests__/__fixtures__/pnpm/modules/pnpm-0/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pnpm-0", 3 | "version": "4.5.2" 4 | } 5 | -------------------------------------------------------------------------------- /modules/graph/src/__tests__/__fixtures__/pnpm/modules/pnpm-1/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pnpm-1", 3 | "version": "4.5.2", 4 | "dependencies": { 5 | "pnpm-0": "4.5.2" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /modules/graph/src/__tests__/__fixtures__/pnpm/onerepo.config.js: -------------------------------------------------------------------------------- 1 | /** @type import('onerepo').Config */ 2 | module.exports = { 3 | root: true, 4 | tasks: { 5 | 'pre-commit': { parallel: ['$0 lint', '$0 tsc'] }, 6 | }, 7 | }; 8 | -------------------------------------------------------------------------------- /modules/graph/src/__tests__/__fixtures__/pnpm/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pnpm", 3 | "private": true, 4 | "type": "commonjs", 5 | "packageManager": "pnpm@7.4.5" 6 | } 7 | -------------------------------------------------------------------------------- /modules/graph/src/__tests__/__fixtures__/pnpm/pnpm-lock.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/modules/graph/src/__tests__/__fixtures__/pnpm/pnpm-lock.yaml -------------------------------------------------------------------------------- /modules/graph/src/__tests__/__fixtures__/pnpm/pnpm-workspace.yaml: -------------------------------------------------------------------------------- 1 | packages: 2 | - modules/* 3 | -------------------------------------------------------------------------------- /modules/graph/src/__tests__/__fixtures__/repo/modules/burritos/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "burritos", 3 | "version": "4.5.2", 4 | "dependencies": { 5 | "lettuce": "4.5.2" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /modules/graph/src/__tests__/__fixtures__/repo/modules/lettuce/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lettuce", 3 | "version": "4.5.2" 4 | } 5 | -------------------------------------------------------------------------------- /modules/graph/src/__tests__/__fixtures__/repo/modules/tacos/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tacos", 3 | "version": "1.2.3", 4 | "devDependencies": { 5 | "lettuce": "4.5.2" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /modules/graph/src/__tests__/__fixtures__/repo/onerepo.config.js: -------------------------------------------------------------------------------- 1 | /** @type import('onerepo').Config */ 2 | module.exports = { 3 | root: true, 4 | 5 | tasks: { 6 | 'pre-commit': { parallel: ['$0 lint', '$0 tsc'] }, 7 | }, 8 | }; 9 | -------------------------------------------------------------------------------- /modules/graph/src/__tests__/__fixtures__/repo/package-lock.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/modules/graph/src/__tests__/__fixtures__/repo/package-lock.json -------------------------------------------------------------------------------- /modules/graph/src/__tests__/__fixtures__/repo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fixture-root", 3 | "private": true, 4 | "type": "commonjs", 5 | "workspaces": [ 6 | "modules/*" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /modules/graph/src/__tests__/__fixtures__/reused-alias/modules/lettuce/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lettuce", 3 | "alias": [ 4 | "leaf" 5 | ], 6 | "version": "4.5.2" 7 | } 8 | -------------------------------------------------------------------------------- /modules/graph/src/__tests__/__fixtures__/reused-alias/modules/spinach/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "spinach", 3 | "alias": [ 4 | "leaf" 5 | ], 6 | "version": "1.2.3", 7 | "dependencies": { 8 | "fixture-lettuce": "4.5.2" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /modules/graph/src/__tests__/__fixtures__/reused-alias/onerepo.config.js: -------------------------------------------------------------------------------- 1 | /** @type import('onerepo').Config */ 2 | module.exports = { 3 | root: true, 4 | }; 5 | -------------------------------------------------------------------------------- /modules/graph/src/__tests__/__fixtures__/reused-alias/package-lock.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/modules/graph/src/__tests__/__fixtures__/reused-alias/package-lock.json -------------------------------------------------------------------------------- /modules/graph/src/__tests__/__fixtures__/reused-alias/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fixture-root", 3 | "private": true, 4 | "type": "module", 5 | "workspaces": [ 6 | "modules/*" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /modules/graph/src/__tests__/index.test.ts: -------------------------------------------------------------------------------- 1 | import path from 'node:path'; 2 | import { getGraph, getRootPackageJson } from '..'; 3 | 4 | describe('getRootPackageJson', () => { 5 | test('gets this repo’s root package.json', async () => { 6 | const { filePath, json } = getRootPackageJson(process.cwd()); 7 | expect(filePath).toMatch(/\/package.json$/); 8 | expect(json).toMatchObject({ 9 | name: '@onerepo/root', 10 | private: true, 11 | workspaces: expect.any(Array), 12 | }); 13 | }); 14 | }); 15 | 16 | describe('getGraph', () => { 17 | test('gets a Graph for pnpm repos', async () => { 18 | const graph = getGraph(path.join(__dirname, '__fixtures__/pnpm')); 19 | expect(graph.root.name).toMatch('pnpm'); 20 | expect(graph.serialized).toMatchObject({ 21 | nodes: [{ id: 'pnpm' }, { id: 'pnpm-0' }, { id: 'pnpm-1' }], 22 | }); 23 | }); 24 | }); 25 | -------------------------------------------------------------------------------- /modules/graph/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./src"], 7 | "exclude": ["./**/*.test.ts", "./**/__tests__/*"] 8 | } 9 | -------------------------------------------------------------------------------- /modules/graph/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/tsconfig/base.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./**/*"], 7 | "references": [ 8 | { 9 | "path": "../package-manager" 10 | }, 11 | { 12 | "path": "../subprocess" 13 | }, 14 | { 15 | "path": "../logger" 16 | }, 17 | { 18 | "path": "../../internal/vitest-config" 19 | }, 20 | { 21 | "path": "../../internal/jest-config" 22 | } 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /modules/graph/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineProject } from '@internal/vitest-config'; 2 | 3 | export default defineProject({}); 4 | -------------------------------------------------------------------------------- /modules/logger/.changes/000-swift-words-worry.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: minor 3 | --- 4 | 5 | Officially support Node 22 6 | -------------------------------------------------------------------------------- /modules/logger/.changes/001-silly-foxes-marry.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: patch 3 | --- 4 | 5 | Updates build dependency "esbuild". 6 | -------------------------------------------------------------------------------- /modules/logger/jest.config.js: -------------------------------------------------------------------------------- 1 | import { makeConfig } from '@internal/jest-config'; 2 | 3 | const config = makeConfig({ 4 | displayName: 'logger', 5 | rootDir: import.meta.url, 6 | }); 7 | 8 | export default config; 9 | -------------------------------------------------------------------------------- /modules/logger/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@onerepo/logger", 3 | "version": "1.0.4", 4 | "license": "MIT", 5 | "repository": { 6 | "type": "git", 7 | "url": "git://github.com/paularmstrong/onerepo.git", 8 | "directory": "modules/logger" 9 | }, 10 | "homepage": "https://onerepo.tools", 11 | "type": "module", 12 | "main": "./src/index.ts", 13 | "publishConfig": { 14 | "access": "public", 15 | "main": "./dist/index.js", 16 | "typings": "./dist/src/index.d.ts" 17 | }, 18 | "files": [ 19 | "./dist/**/*", 20 | "./README.md", 21 | "./CHANGELOG.md" 22 | ], 23 | "dependencies": { 24 | "log-update": "^5.0.1", 25 | "picocolors": "^1.0.0" 26 | }, 27 | "devDependencies": { 28 | "@internal/jest-config": "workspace:^", 29 | "@internal/tsconfig": "workspace:^", 30 | "@internal/vitest-config": "workspace:^", 31 | "typescript": "^5.7.2" 32 | }, 33 | "engines": { 34 | "node": "^18 || ^20 || ^22" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /modules/logger/src/LogBuffer.ts: -------------------------------------------------------------------------------- 1 | import { Duplex } from 'node:stream'; 2 | 3 | export class LogBuffer extends Duplex { 4 | _read() {} 5 | 6 | // eslint-disable-next-line @typescript-eslint/no-unused-vars 7 | _write(chunk: string, encoding = 'utf8', callback: () => void) { 8 | this.push(chunk); 9 | callback(); 10 | } 11 | 12 | _final(callback: () => void) { 13 | this.push(null); 14 | callback(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /modules/logger/src/global.ts: -------------------------------------------------------------------------------- 1 | import type { Logger } from './Logger'; 2 | 3 | const sym = Symbol.for('onerepo_loggers'); 4 | 5 | function getLoggers(): Array { 6 | // @ts-ignore Cannot type symbol as key on global 7 | if (!global[sym]) { 8 | // @ts-ignore 9 | global[sym] = []; 10 | } 11 | // @ts-ignore 12 | return global[sym]; 13 | } 14 | 15 | export function getCurrent() { 16 | const loggers = getLoggers(); 17 | return loggers[0]; 18 | } 19 | 20 | export function setCurrent(logger: Logger) { 21 | const loggers = getLoggers(); 22 | if (!loggers.includes(logger)) { 23 | loggers.unshift(logger); 24 | } 25 | } 26 | 27 | export function destroyCurrent() { 28 | const loggers = getLoggers(); 29 | loggers.shift(); 30 | } 31 | -------------------------------------------------------------------------------- /modules/logger/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./src"], 7 | "exclude": ["./**/*.test.ts", "./**/__tests__/*"] 8 | } 9 | -------------------------------------------------------------------------------- /modules/logger/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/tsconfig/base.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./**/*"], 7 | "references": [ 8 | { 9 | "path": "../../internal/vitest-config" 10 | }, 11 | { 12 | "path": "../../internal/jest-config" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /modules/logger/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineProject } from '@internal/vitest-config'; 2 | 3 | export default defineProject({}); 4 | -------------------------------------------------------------------------------- /modules/onerepo/.changes/000-swift-words-worry.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: minor 3 | --- 4 | 5 | Officially support Node 22 6 | -------------------------------------------------------------------------------- /modules/onerepo/.changes/001-moody-doodles-hear.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: patch 3 | --- 4 | 5 | Update internal typescript resolution package (Jiti) 6 | -------------------------------------------------------------------------------- /modules/onerepo/.changes/002-silly-foxes-marry.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: patch 3 | --- 4 | 5 | Updates build dependency "esbuild". 6 | -------------------------------------------------------------------------------- /modules/onerepo/.changes/003-loose-phones-call.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: patch 3 | --- 4 | 5 | Internal-only type and formatting updates. 6 | -------------------------------------------------------------------------------- /modules/onerepo/src/__tests__/__fixtures__/repo/modules/burritos/onerepo.config.js: -------------------------------------------------------------------------------- 1 | /** @type import('onerepo').Config */ 2 | module.exports = { 3 | tasks: { 4 | 'pre-merge': { serial: [{ cmd: 'echo "pre-merge" "burritos"', meta: { good: 'yes' } }] }, 5 | deploy: { parallel: ['echo "deployburritos"'] }, 6 | }, 7 | }; 8 | -------------------------------------------------------------------------------- /modules/onerepo/src/__tests__/__fixtures__/repo/modules/burritos/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fixture-burritos", 3 | "version": "4.5.2" 4 | } 5 | -------------------------------------------------------------------------------- /modules/onerepo/src/__tests__/__fixtures__/repo/modules/tacos/onerepo.config.js: -------------------------------------------------------------------------------- 1 | /** @type import('onerepo').Config */ 2 | module.exports = { 3 | tasks: { 4 | 'post-commit': { serial: ['echo "post-commit" "tacos"'] }, 5 | publish: { parallel: [{ cmd: 'publish tacos', match: '../burritos/**/*' }] }, 6 | deploy: { parallel: ['echo "deploytacos"'] }, 7 | }, 8 | }; 9 | -------------------------------------------------------------------------------- /modules/onerepo/src/__tests__/__fixtures__/repo/modules/tacos/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fixture-tacos", 3 | "version": "1.2.3" 4 | } 5 | -------------------------------------------------------------------------------- /modules/onerepo/src/__tests__/__fixtures__/repo/onerepo.config.js: -------------------------------------------------------------------------------- 1 | /** @type import('onerepo').Config */ 2 | module.exports = { 3 | tasks: { 4 | 'pre-commit': { parallel: ['$0 lint', '$0 tsc'] }, 5 | commit: { serial: ['echo "commit"'] }, 6 | 'post-commit': { serial: ['echo "post-commit"'] }, 7 | build: { serial: [{ match: '**/foo.json', cmd: 'build' }] }, 8 | deploy: { parallel: ['echo "deployroot"'] }, 9 | }, 10 | }; 11 | -------------------------------------------------------------------------------- /modules/onerepo/src/__tests__/__fixtures__/repo/package-lock.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/modules/onerepo/src/__tests__/__fixtures__/repo/package-lock.json -------------------------------------------------------------------------------- /modules/onerepo/src/__tests__/__fixtures__/repo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fixture-root", 3 | "private": true, 4 | "type": "commonjs", 5 | "workspaces": [ 6 | "modules/*" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /modules/onerepo/src/bin/utils/get-config.ts: -------------------------------------------------------------------------------- 1 | import path from 'node:path'; 2 | import type { Jiti } from 'jiti'; 3 | import type { RootConfig } from '../../types'; 4 | 5 | /** 6 | * Gets the configuration file and dirname of the file starting at the process.cwd() and working upward until hitting the root of the filesystem. 7 | * If not found, will return undefined. 8 | */ 9 | export function getConfig(require: NodeJS.Require | Jiti, cwd: string = process.cwd()) { 10 | // Find a root config starting at the current working directory, looking upward toward filesystem root 11 | let configRoot = cwd; 12 | let config: RootConfig | undefined; 13 | let lastKnownPossibleRoot: string | undefined; 14 | while (configRoot && configRoot !== '/') { 15 | try { 16 | const { default: conf } = require(path.join(configRoot, `onerepo.config`)); 17 | config = conf; 18 | if (config?.root) { 19 | break; 20 | } 21 | configRoot = path.dirname(configRoot); 22 | config = undefined; 23 | } catch (e) { 24 | // @ts-ignore 25 | if (e instanceof Error && e.code === 'MODULE_NOT_FOUND' && !/onerepo\.config['"]/.test(e.message)) { 26 | lastKnownPossibleRoot = configRoot; 27 | } 28 | configRoot = path.dirname(configRoot); 29 | config = undefined; 30 | } 31 | } 32 | 33 | return { config, configRoot: configRoot !== '/' ? configRoot : (lastKnownPossibleRoot ?? configRoot) }; 34 | } 35 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/changes/__tests__/__fixtures__/with-entries/modules/cheese/.changes/1-five-horses-run.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: minor 3 | --- 4 | 5 | A minor change 6 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/changes/__tests__/__fixtures__/with-entries/modules/cheese/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cheese", 3 | "version": "2.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/changes/__tests__/__fixtures__/with-entries/modules/lettuce/.changes/1-five-horses-run.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: minor 3 | --- 4 | 5 | A minor change 6 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/changes/__tests__/__fixtures__/with-entries/modules/lettuce/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lettuce", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/changes/__tests__/__fixtures__/with-entries/modules/private/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "internal-private", 3 | "private": true 4 | } 5 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/changes/__tests__/__fixtures__/with-entries/modules/tacos/.changes/1-five-horses-run.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: minor 3 | --- 4 | 5 | A minor change 6 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/changes/__tests__/__fixtures__/with-entries/modules/tacos/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tacos", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | "cheese": "workspace:*", 6 | "lettuce": "1.0.0" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/changes/__tests__/__fixtures__/with-entries/onerepo.config.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | root: true, 3 | }; 4 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/changes/__tests__/__fixtures__/with-entries/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "root", 3 | "packageManager": "yarn@3.3.1", 4 | "workspaces": [ 5 | "modules/*" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/changes/__tests__/__fixtures__/with-entries/yarn.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/modules/onerepo/src/core/changes/__tests__/__fixtures__/with-entries/yarn.lock -------------------------------------------------------------------------------- /modules/onerepo/src/core/changes/__tests__/show.test.ts: -------------------------------------------------------------------------------- 1 | import path from 'node:path'; 2 | import { getCommand } from '@onerepo/test-cli'; 3 | import { getGraph } from '@onerepo/graph'; 4 | import * as show from '../show'; 5 | 6 | const graph = getGraph(path.join(__dirname, '__fixtures__/with-entries')); 7 | const { run } = getCommand(show, graph); 8 | 9 | describe('show changes', () => { 10 | test('adds change files', async () => { 11 | vi.spyOn(process.stdout, 'write').mockReturnValue(true); 12 | await run('-w tacos --format json'); 13 | 14 | expect(process.stdout.write).toHaveBeenCalledWith( 15 | expect.stringContaining( 16 | '{"cheese":{"type":"minor","version":"2.1.0","entries":[{"type":"minor","content":"A minor change\\n"', 17 | ), 18 | ); 19 | }); 20 | }); 21 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/changes/utils/__tests__/confirm-clean.test.ts: -------------------------------------------------------------------------------- 1 | import inquirer from 'inquirer'; 2 | import * as git from '@onerepo/git'; 3 | import { confirmClean } from '../confirm-clean'; 4 | 5 | describe('confirmClean', () => { 6 | describe('when not clean', () => { 7 | beforeEach(() => { 8 | vi.spyOn(git, 'isClean').mockResolvedValue(false); 9 | }); 10 | 11 | test('returns false from prompt', async () => { 12 | vi.spyOn(inquirer, 'prompt').mockResolvedValue({ okay: false }); 13 | 14 | await expect(confirmClean()).resolves.toBe(false); 15 | expect(inquirer.prompt).toHaveBeenCalled(); 16 | }); 17 | 18 | test('returns true from prompt', async () => { 19 | vi.spyOn(inquirer, 'prompt').mockResolvedValue({ okay: true }); 20 | 21 | await expect(confirmClean()).resolves.toBe(true); 22 | expect(inquirer.prompt).toHaveBeenCalled(); 23 | }); 24 | }); 25 | 26 | describe('when clean', () => { 27 | beforeEach(() => { 28 | vi.spyOn(git, 'isClean').mockResolvedValue(true); 29 | }); 30 | 31 | test('returns true from prompt', async () => { 32 | vi.spyOn(inquirer, 'prompt'); 33 | 34 | await expect(confirmClean()).resolves.toBe(true); 35 | expect(inquirer.prompt).not.toHaveBeenCalled(); 36 | }); 37 | }); 38 | }); 39 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/changes/utils/__tests__/filename.test.ts: -------------------------------------------------------------------------------- 1 | import path from 'node:path'; 2 | import * as humanId from 'human-id'; 3 | import { getGraph } from '@onerepo/graph'; 4 | import { getFilename } from '../filename'; 5 | 6 | const graph = getGraph(path.join(__dirname, '../../__tests__/__fixtures__/with-entries')); 7 | 8 | describe('getFilename', () => { 9 | test('generates a hash from the content and date', async () => { 10 | vi.spyOn(Date, 'now').mockReturnValue(1706903142100); 11 | 12 | await expect(getFilename(graph, 'tacos', 'hash')).resolves.toEqual('a5f1b372'); 13 | 14 | vi.spyOn(Date, 'now').mockReturnValue(1706903168043); 15 | 16 | await expect(getFilename(graph, 'tacos', 'hash')).resolves.toEqual('c00303e8'); 17 | }); 18 | 19 | test('generates using human-id', async () => { 20 | vi.spyOn(humanId, 'humanId').mockReturnValue('modern-clouds-camp'); 21 | await expect(getFilename(graph, 'tacos', 'human')).resolves.toEqual('modern-clouds-camp'); 22 | }); 23 | 24 | test('returns a hash if human-id fails', async () => { 25 | vi.spyOn(humanId, 'humanId').mockImplementation(() => { 26 | throw new Error(); 27 | }); 28 | vi.spyOn(Date, 'now').mockReturnValue(1706903168043); 29 | 30 | await expect(getFilename(graph, 'tacos', 'human')).resolves.toEqual('c00303e8'); 31 | }); 32 | }); 33 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/changes/utils/__tests__/read-change.test.ts: -------------------------------------------------------------------------------- 1 | import * as subprocess from '@onerepo/subprocess'; 2 | import * as file from '@onerepo/file'; 3 | import { readChange } from '../read-change'; 4 | 5 | describe('readChange', () => { 6 | beforeEach(() => { 7 | vi.spyOn(subprocess, 'run').mockResolvedValue(['abc123', '']); 8 | }); 9 | 10 | test('returns null if invalid format', async () => { 11 | vi.spyOn(file, 'read').mockResolvedValue('asdf'); 12 | await expect(readChange('asdf.md')).resolves.toBeNull(); 13 | }); 14 | 15 | test('returns null if yaml parsing fails', async () => { 16 | vi.spyOn(file, 'read').mockResolvedValue('---\n*(^\n---\n\nasdf'); 17 | await expect(readChange('asdf.md')).resolves.toBeNull(); 18 | }); 19 | 20 | test('returns data and contents', async () => { 21 | vi.spyOn(file, 'read').mockResolvedValue('---\ntype: minor\n---\n\nasdf'); 22 | await expect(readChange('asdf.md')).resolves.toEqual({ 23 | type: 'minor', 24 | content: 'asdf', 25 | ref: 'abc123', 26 | filepath: 'asdf.md', 27 | }); 28 | }); 29 | }); 30 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/changes/utils/confirm-clean.ts: -------------------------------------------------------------------------------- 1 | import inquirer from 'inquirer'; 2 | import { isClean } from '@onerepo/git'; 3 | import type { LogStep } from '@onerepo/logger'; 4 | import { getLogger, stepWrapper } from '@onerepo/logger'; 5 | 6 | export async function confirmClean(options: { step?: LogStep } = {}) { 7 | return stepWrapper({ name: 'Confirm working state', step: options.step }, async (step) => { 8 | const logger = getLogger(); 9 | if (!(await isClean({ step }))) { 10 | logger.pause(); 11 | const { okay } = await inquirer.prompt([ 12 | { 13 | type: 'confirm', 14 | name: 'okay', 15 | message: 'Current work tree has modifications or untracked files. Do you wish to continue?', 16 | default: false, 17 | }, 18 | ]); 19 | logger.unpause(); 20 | 21 | if (okay) { 22 | step.warn('Current work tree has modifications or untracked files. Continuing as marked_okay.'); 23 | } 24 | return okay; 25 | } 26 | return true; 27 | }); 28 | } 29 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/changes/utils/filename.ts: -------------------------------------------------------------------------------- 1 | import { createHash } from 'node:crypto'; 2 | import type { LogStep } from '@onerepo/logger'; 3 | import { stepWrapper } from '@onerepo/logger'; 4 | import type { Graph } from '@onerepo/graph'; 5 | 6 | export async function getFilename( 7 | graph: Graph, 8 | contents: string, 9 | method: 'hash' | 'human', 10 | options: { step?: LogStep } = {}, 11 | ) { 12 | return stepWrapper({ name: 'Generate filename', step: options.step }, async (step) => { 13 | if (method === 'human') { 14 | try { 15 | // eslint-disable-next-line import/no-extraneous-dependencies 16 | const { humanId } = await import('human-id'); 17 | return humanId({ separator: '-', capitalize: false }); 18 | } catch { 19 | step.warn('Please install "human-id" to use "human" readable filenames for changes.'); 20 | step.warn(`\u0000\n> one dependencies add --workspace=${graph.root.name} --dev=human-id\n\u0000`); 21 | } 22 | } 23 | 24 | const md5sum = createHash('md5'); 25 | md5sum.update(`${Date.now()} ${contents}`, 'utf8'); 26 | return md5sum.digest('hex').substring(0, 8); 27 | }); 28 | } 29 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/changes/utils/index.ts: -------------------------------------------------------------------------------- 1 | export * from './apply-versions'; 2 | export * from './changelog'; 3 | export * from './confirm-clean'; 4 | export * from './filename'; 5 | export * from './get-versionable'; 6 | export * from './read-change'; 7 | export * from './request-otp'; 8 | export * from './request-versioned'; 9 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/changes/utils/request-otp.ts: -------------------------------------------------------------------------------- 1 | import inquirer from 'inquirer'; 2 | import pc from 'picocolors'; 3 | import { getLogger } from '@onerepo/logger'; 4 | 5 | export async function requestOtp() { 6 | const logger = getLogger(); 7 | 8 | if (!process.stdout.isTTY) { 9 | throw new Error('Cannot prompt for OTP in a non-TTY environment.'); 10 | } 11 | 12 | logger.pause(); 13 | const { otp } = await inquirer.prompt([ 14 | { 15 | type: 'password', 16 | prefix: '🔐', 17 | message: 'Please enter your OTP', 18 | name: 'otp', 19 | validate: (input) => { 20 | if (!input) { 21 | return `${pc.bold(pc.red('Error:'))} Please enter a one-time passcode.`; 22 | } 23 | return true; 24 | }, 25 | }, 26 | ]); 27 | logger.unpause(); 28 | return otp as string; 29 | } 30 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/codeowners/__tests__/__fixtures__/repo/.github/CODEOWNERS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/modules/onerepo/src/core/codeowners/__tests__/__fixtures__/repo/.github/CODEOWNERS -------------------------------------------------------------------------------- /modules/onerepo/src/core/codeowners/__tests__/__fixtures__/repo/modules/burritos/onerepo.config.js: -------------------------------------------------------------------------------- 1 | /** @type import('onerepo').Config */ 2 | module.exports = { 3 | codeowners: { 4 | '*': ['@burritos'], 5 | }, 6 | }; 7 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/codeowners/__tests__/__fixtures__/repo/modules/burritos/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fixture-burritos", 3 | "version": "4.5.2", 4 | "main": "./src/index.ts", 5 | "repository": { 6 | "directory": "modules/burritos" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/codeowners/__tests__/__fixtures__/repo/modules/tacos/onerepo.config.js: -------------------------------------------------------------------------------- 1 | /** @type import('onerepo').Config */ 2 | module.exports = { 3 | codeowners: { 4 | '*': ['@tacos'], 5 | }, 6 | }; 7 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/codeowners/__tests__/__fixtures__/repo/modules/tacos/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fixture-tacos", 3 | "version": "1.2.3", 4 | "main": "./src/index.ts", 5 | "repository": { 6 | "directory": "modules/tacos" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/codeowners/__tests__/__fixtures__/repo/onerepo.config.js: -------------------------------------------------------------------------------- 1 | /** @type import('onerepo').Config */ 2 | module.exports = { 3 | root: true, 4 | codeowners: { 5 | '*': ['@tacos'], 6 | }, 7 | }; 8 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/codeowners/__tests__/__fixtures__/repo/package-lock.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/modules/onerepo/src/core/codeowners/__tests__/__fixtures__/repo/package-lock.json -------------------------------------------------------------------------------- /modules/onerepo/src/core/codeowners/__tests__/__fixtures__/repo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fixture-root", 3 | "private": true, 4 | "type": "commonjs", 5 | "repository": { 6 | "directory": "" 7 | }, 8 | "workspaces": [ 9 | "apps/*", 10 | "modules/*" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/codeowners/__tests__/sync.test.ts: -------------------------------------------------------------------------------- 1 | import path from 'node:path'; 2 | import { getCommand } from '@onerepo/test-cli'; 3 | import * as file from '@onerepo/file'; 4 | import * as git from '@onerepo/git'; 5 | import { getGraph } from '@onerepo/graph'; 6 | import * as Sync from '../sync'; 7 | import { location } from '../get-codeowners'; 8 | 9 | const { run, graph } = getCommand(Sync, getGraph(path.join(__dirname, '__fixtures__/repo'))); 10 | 11 | describe('codeowners sync', () => { 12 | test.each(Object.entries(location))('writes codeowners for %s to %s', async (provider, location) => { 13 | vi.spyOn(file, 'write').mockResolvedValue(); 14 | await run(`--provider=${provider}`); 15 | 16 | expect(file.write).toHaveBeenCalledWith( 17 | graph.root.resolve(location), 18 | `# fixture-root 19 | * @tacos 20 | 21 | # fixture-burritos 22 | modules/burritos/* @burritos 23 | 24 | # fixture-tacos 25 | modules/tacos/* @tacos 26 | 27 | `, 28 | { sign: true }, 29 | ); 30 | }); 31 | 32 | test('can add to the git index', async () => { 33 | vi.spyOn(git, 'updateIndex').mockResolvedValue(''); 34 | vi.spyOn(file, 'write').mockResolvedValue(); 35 | 36 | await run('--provider=github --add'); 37 | 38 | expect(git.updateIndex).toHaveBeenCalledWith(graph.root.resolve(location.github)); 39 | }); 40 | }); 41 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/codeowners/index.ts: -------------------------------------------------------------------------------- 1 | import type { Plugin } from '../../types'; 2 | import * as Show from './show'; 3 | import * as Sync from './sync'; 4 | import * as Verify from './verify'; 5 | 6 | export const codeowners: Plugin = function codeowners(options) { 7 | return { 8 | yargs: (yargs, visitor) => { 9 | const show = visitor(Show); 10 | const sync = visitor(Sync); 11 | const verify = visitor(Verify); 12 | return yargs.command( 13 | ['codeowners', 'owners'], 14 | 'Manage codeowners', 15 | (yargs) => { 16 | const y = yargs 17 | .usage(`$0 codeowners `) 18 | .command(show.command, show.description, show.builder, show.handler) 19 | .command(sync.command, sync.description, sync.builder, sync.handler) 20 | .command(verify.command, verify.description, verify.builder, verify.handler) 21 | .default('provider', options.vcs.provider) 22 | .demandCommand(1); 23 | 24 | return y; 25 | }, 26 | () => {}, 27 | ); 28 | }, 29 | }; 30 | }; 31 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/create/index.ts: -------------------------------------------------------------------------------- 1 | import type { Plugin } from '../../types'; 2 | import * as cmd from './create'; 3 | 4 | export const create: Plugin = function create() { 5 | return { 6 | yargs: (yargs, visitor) => { 7 | const { command, description, builder, handler } = visitor(cmd); 8 | return yargs.command( 9 | command, 10 | description, 11 | (yargs) => builder(yargs).usage(`$0 ${command[0]} [options...]`), 12 | handler, 13 | ); 14 | }, 15 | }; 16 | }; 17 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/dependencies/__tests__/__fixtures__/bad-repo-dev/apps/menu/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "menu", 3 | "private": true, 4 | "main": "./src/index.ts", 5 | "dependencies": { 6 | "fixture-tacos": "workspace:^", 7 | "tortillas": "1.2.1" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/dependencies/__tests__/__fixtures__/bad-repo-dev/modules/burritos/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fixture-burritos", 3 | "version": "4.5.2", 4 | "main": "./src/index.ts" 5 | } 6 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/dependencies/__tests__/__fixtures__/bad-repo-dev/modules/tacos/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fixture-tacos", 3 | "version": "1.2.3", 4 | "main": "./src/index.ts", 5 | "devDependencies": { 6 | "tortillas": "^1.4.5" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/dependencies/__tests__/__fixtures__/bad-repo-dev/onerepo.config.js: -------------------------------------------------------------------------------- 1 | /** @type import('onerepo').Config */ 2 | module.exports = { 3 | root: true, 4 | }; 5 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/dependencies/__tests__/__fixtures__/bad-repo-dev/package-lock.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/modules/onerepo/src/core/dependencies/__tests__/__fixtures__/bad-repo-dev/package-lock.json -------------------------------------------------------------------------------- /modules/onerepo/src/core/dependencies/__tests__/__fixtures__/bad-repo-dev/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fixture-root", 3 | "private": true, 4 | "type": "commonjs", 5 | "workspaces": [ 6 | "apps/*", 7 | "modules/*" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/dependencies/__tests__/__fixtures__/bad-repo/apps/menu/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "menu", 3 | "private": true, 4 | "main": "./src/index.ts", 5 | "dependencies": { 6 | "fixture-tacos": "workspace:^", 7 | "tortillas": "1.2.1" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/dependencies/__tests__/__fixtures__/bad-repo/modules/burritos/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fixture-burritos", 3 | "version": "4.5.2", 4 | "main": "./src/index.ts" 5 | } 6 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/dependencies/__tests__/__fixtures__/bad-repo/modules/tacos/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fixture-tacos", 3 | "version": "1.2.3", 4 | "main": "./src/index.ts", 5 | "dependencies": { 6 | "tortillas": "^1.4.5" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/dependencies/__tests__/__fixtures__/bad-repo/onerepo.config.js: -------------------------------------------------------------------------------- 1 | /** @type import('onerepo').Config */ 2 | module.exports = { 3 | root: true, 4 | }; 5 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/dependencies/__tests__/__fixtures__/bad-repo/package-lock.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/modules/onerepo/src/core/dependencies/__tests__/__fixtures__/bad-repo/package-lock.json -------------------------------------------------------------------------------- /modules/onerepo/src/core/dependencies/__tests__/__fixtures__/bad-repo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fixture-root", 3 | "private": true, 4 | "type": "commonjs", 5 | "workspaces": [ 6 | "apps/*", 7 | "modules/*" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/dependencies/__tests__/__fixtures__/regression-678/onerepo.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | root: true, 3 | }; 4 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/dependencies/__tests__/__fixtures__/regression-678/package-lock.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/modules/onerepo/src/core/dependencies/__tests__/__fixtures__/regression-678/package-lock.json -------------------------------------------------------------------------------- /modules/onerepo/src/core/dependencies/__tests__/__fixtures__/regression-678/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fixture-root", 3 | "private": true, 4 | "type": "module", 5 | "workspaces": [ 6 | "packages/*" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/dependencies/__tests__/__fixtures__/regression-678/packages/bar/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@acme/bar", 3 | "version": "2.0.0", 4 | "main": "./index.js", 5 | "dependencies": { 6 | "@acme/foo": "1.0.0" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/dependencies/__tests__/__fixtures__/regression-678/packages/foo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@acme/foo", 3 | "version": "2.0.0", 4 | "main": "./index.js" 5 | } 6 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/dependencies/__tests__/__fixtures__/regression-682/onerepo.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | root: true, 3 | }; 4 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/dependencies/__tests__/__fixtures__/regression-682/package-lock.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/modules/onerepo/src/core/dependencies/__tests__/__fixtures__/regression-682/package-lock.json -------------------------------------------------------------------------------- /modules/onerepo/src/core/dependencies/__tests__/__fixtures__/regression-682/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fixture-root", 3 | "private": true, 4 | "type": "module", 5 | "workspaces": [ 6 | "packages/*" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/dependencies/__tests__/__fixtures__/regression-682/packages/bar/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@acme/bar", 3 | "version": "2.0.0", 4 | "main": "./index.js", 5 | "dependencies": { 6 | "@acme/foo": "workspace:*" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/dependencies/__tests__/__fixtures__/regression-682/packages/foo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@acme/foo", 3 | "private": true, 4 | "main": "./index.js" 5 | } 6 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/dependencies/__tests__/__fixtures__/repo/apps/menu/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "menu", 3 | "private": true, 4 | "main": "./src/index.ts", 5 | "dependencies": { 6 | "fixture-burritos": "workspace:^", 7 | "fixture-tacos": "workspace:^", 8 | "tortillas": "^1.6.7" 9 | }, 10 | "repository": { 11 | "directory": "apps/menu" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/dependencies/__tests__/__fixtures__/repo/modules/burritos/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fixture-burritos", 3 | "version": "4.5.2", 4 | "main": "./src/index.ts", 5 | "repository": { 6 | "directory": "modules/burritos" 7 | }, 8 | "dependencies": { 9 | "lettuce": "^1.4.3" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/dependencies/__tests__/__fixtures__/repo/modules/tacos/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fixture-tacos", 3 | "version": "1.2.3", 4 | "main": "./src/index.ts", 5 | "dependencies": { 6 | "lettuce": "^1.5.6", 7 | "tortillas": "^1.4.5" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/dependencies/__tests__/__fixtures__/repo/onerepo.config.js: -------------------------------------------------------------------------------- 1 | /** @type import('onerepo').Config */ 2 | module.exports = { 3 | root: true, 4 | }; 5 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/dependencies/__tests__/__fixtures__/repo/package-lock.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/modules/onerepo/src/core/dependencies/__tests__/__fixtures__/repo/package-lock.json -------------------------------------------------------------------------------- /modules/onerepo/src/core/dependencies/__tests__/__fixtures__/repo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fixture-root", 3 | "private": true, 4 | "type": "commonjs", 5 | "repository": { 6 | "directory": "" 7 | }, 8 | "workspaces": [ 9 | "apps/*", 10 | "modules/*" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/generate/__tests__/__fixtures__/app/.onegen.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | outDir: ({ name }) => `apps/${name.replace(/[^a-zA-Z0-9-]/g, '').toLowerCase()}`, 3 | prompts: [ 4 | { 5 | name: 'name', 6 | type: 'question', 7 | message: 'What is the name of the workspace?', 8 | transformer: (name) => `@onerepo/fixture-app-${name.replace(/[^a-zA-Z0-9-]/g, '').toLowerCase()}`, 9 | }, 10 | ], 11 | }; 12 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/generate/__tests__/__fixtures__/app/.test: -------------------------------------------------------------------------------- 1 | this file should be generated 2 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/generate/__tests__/__fixtures__/app/<%-name%>.ts.ejs: -------------------------------------------------------------------------------- 1 | hello 2 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/generate/__tests__/__fixtures__/app/index.ts.ejs: -------------------------------------------------------------------------------- 1 | <%- name %> 2 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/generate/__tests__/__fixtures__/app/package.json.ejs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/modules/onerepo/src/core/generate/__tests__/__fixtures__/app/package.json.ejs -------------------------------------------------------------------------------- /modules/onerepo/src/core/generate/__tests__/__fixtures__/module/.onegen.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'Modules', 3 | description: 'A fancy description', 4 | outDir: 'modules', 5 | prompts: [ 6 | { 7 | name: 'name', 8 | type: 'question', 9 | message: 'What is the name of the workspace?', 10 | transformer: (name) => `@onerepo/fixture-app-${name.replace(/[^a-zA-Z0-9-]/g, '').toLowerCase()}`, 11 | }, 12 | { 13 | type: 'input', 14 | name: 'description', 15 | message: 'How would you describe tacos?', 16 | }, 17 | ], 18 | }; 19 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/generate/__tests__/__fixtures__/package-lock.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/modules/onerepo/src/core/generate/__tests__/__fixtures__/package-lock.json -------------------------------------------------------------------------------- /modules/onerepo/src/core/generate/index.ts: -------------------------------------------------------------------------------- 1 | import path from 'node:path'; 2 | import type { Plugin } from '../../types'; 3 | import * as cmd from './generate'; 4 | 5 | export const generate: Plugin = function generate(opts) { 6 | if (path.isAbsolute(opts.templateDir)) { 7 | throw new Error( 8 | 'Invalid path specified for `templateDir`. Path must be relative to the repository root, like "./config/templates"', 9 | ); 10 | } 11 | const resolvedDir = path.resolve(process.env.ONEREPO_ROOT!, opts.templateDir ?? ''); 12 | 13 | return { 14 | yargs: (yargs, visitor) => { 15 | const { command, description, builder, handler } = visitor(cmd); 16 | 17 | return yargs.command( 18 | command, 19 | description, 20 | (yargs) => { 21 | const y = builder(yargs) 22 | .usage(`$0 ${Array.isArray(command) ? command[0] : command} [options...]`) 23 | .default('template-dir', resolvedDir) 24 | .epilogue( 25 | `To create new templates add a new folder to ${path.relative( 26 | process.env.ONEREPO_ROOT!, 27 | resolvedDir, 28 | )} and create a \`.onegen.cjs\` configuration file. Follow the instructions online for more: https://onerepo.tools/core/generate/`, 29 | ); 30 | 31 | return y; 32 | }, 33 | handler, 34 | ); 35 | }, 36 | }; 37 | }; 38 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/graph/__tests__/__fixtures__/bad-repo-dev/apps/menu/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "menu", 3 | "private": true, 4 | "main": "./src/index.ts", 5 | "dependencies": { 6 | "fixture-tacos": "workspace:^", 7 | "tortillas": "1.2.1" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/graph/__tests__/__fixtures__/bad-repo-dev/modules/burritos/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fixture-burritos", 3 | "version": "4.5.2", 4 | "main": "./src/index.ts" 5 | } 6 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/graph/__tests__/__fixtures__/bad-repo-dev/modules/tacos/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fixture-tacos", 3 | "version": "1.2.3", 4 | "main": "./src/index.ts", 5 | "devDependencies": { 6 | "tortillas": "^1.4.5" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/graph/__tests__/__fixtures__/bad-repo-dev/package-lock.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/modules/onerepo/src/core/graph/__tests__/__fixtures__/bad-repo-dev/package-lock.json -------------------------------------------------------------------------------- /modules/onerepo/src/core/graph/__tests__/__fixtures__/bad-repo-dev/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fixture-root", 3 | "private": true, 4 | "type": "commonjs", 5 | "workspaces": [ 6 | "apps/*", 7 | "modules/*" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/graph/__tests__/__fixtures__/bad-repo/apps/menu/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "menu", 3 | "private": true, 4 | "main": "./src/index.ts", 5 | "dependencies": { 6 | "fixture-tacos": "workspace:^", 7 | "tortillas": "1.2.1" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/graph/__tests__/__fixtures__/bad-repo/modules/burritos/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fixture-burritos", 3 | "version": "4.5.2", 4 | "main": "./src/index.ts" 5 | } 6 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/graph/__tests__/__fixtures__/bad-repo/modules/tacos/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fixture-tacos", 3 | "version": "1.2.3", 4 | "main": "./src/index.ts", 5 | "dependencies": { 6 | "tortillas": "^1.4.5" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/graph/__tests__/__fixtures__/bad-repo/package-lock.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/modules/onerepo/src/core/graph/__tests__/__fixtures__/bad-repo/package-lock.json -------------------------------------------------------------------------------- /modules/onerepo/src/core/graph/__tests__/__fixtures__/bad-repo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fixture-root", 3 | "private": true, 4 | "type": "commonjs", 5 | "workspaces": [ 6 | "apps/*", 7 | "modules/*" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/graph/__tests__/__fixtures__/functional-schema.ts: -------------------------------------------------------------------------------- 1 | import type { Graph, GraphSchemaValidators, Workspace } from 'onerepo'; 2 | 3 | export default { 4 | '**': { 5 | 'package.json': (workspace: Workspace, graph: Graph) => ({ 6 | type: 'object', 7 | properties: { 8 | repository: { 9 | type: 'object', 10 | properties: { 11 | directory: { type: 'string', const: graph.root.relative(workspace.location) }, 12 | }, 13 | required: ['directory'], 14 | }, 15 | }, 16 | required: ['repository'], 17 | }), 18 | }, 19 | } satisfies GraphSchemaValidators; 20 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/graph/__tests__/__fixtures__/js-schema.ts: -------------------------------------------------------------------------------- 1 | import type { GraphSchemaValidators } from 'onerepo'; 2 | 3 | export default { 4 | '**': { 5 | 'jest.config.js': { 6 | type: 'object', 7 | properties: { 8 | displayName: { 9 | type: 'string', 10 | }, 11 | clearMocks: { 12 | type: 'boolean', 13 | const: true, 14 | }, 15 | }, 16 | required: ['displayName', 'clearMocks'], 17 | }, 18 | }, 19 | } satisfies GraphSchemaValidators; 20 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/graph/__tests__/__fixtures__/repo/apps/menu/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "menu", 3 | "private": true, 4 | "main": "./src/index.ts", 5 | "dependencies": { 6 | "fixture-tacos": "workspace:^" 7 | }, 8 | "repository": { 9 | "directory": "apps/menu" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/graph/__tests__/__fixtures__/repo/apps/menu/settings.yaml: -------------------------------------------------------------------------------- 1 | foo: bar 2 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/graph/__tests__/__fixtures__/repo/modules/burritos/jest.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('jest').Config} */ 2 | export default { 3 | clearMocks: true, 4 | }; 5 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/graph/__tests__/__fixtures__/repo/modules/burritos/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fixture-burritos", 3 | "version": "4.5.2", 4 | "main": "./src/index.ts", 5 | "repository": { 6 | "directory": "modules/burritos" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/graph/__tests__/__fixtures__/repo/modules/tacos/onerepo.config.js: -------------------------------------------------------------------------------- 1 | /** @type import('onerepo').Config */ 2 | module.exports = { 3 | tasks: { 4 | 'post-commit': { serial: ['echo "post-commit" "tacos"'] }, 5 | }, 6 | }; 7 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/graph/__tests__/__fixtures__/repo/modules/tacos/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fixture-tacos", 3 | "version": "1.2.3", 4 | "main": "./src/index.ts", 5 | "repository": { 6 | "directory": "modules/tacos" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/graph/__tests__/__fixtures__/repo/onerepo.config.js: -------------------------------------------------------------------------------- 1 | /** @type import('onerepo').Config */ 2 | module.exports = { 3 | root: true, 4 | tasks: { 5 | 'pre-commit': { parallel: ['$0 lint', '$0 tsc'] }, 6 | commit: { serial: ['echo "commit"'] }, 7 | 'post-commit': { serial: ['echo "post-commit"'] }, 8 | }, 9 | }; 10 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/graph/__tests__/__fixtures__/repo/package-lock.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/modules/onerepo/src/core/graph/__tests__/__fixtures__/repo/package-lock.json -------------------------------------------------------------------------------- /modules/onerepo/src/core/graph/__tests__/__fixtures__/repo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fixture-root", 3 | "private": true, 4 | "type": "commonjs", 5 | "repository": { 6 | "directory": "" 7 | }, 8 | "workspaces": [ 9 | "apps/*", 10 | "modules/*" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/graph/__tests__/__fixtures__/repo/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | // TSCONFIGS support CJSON! 3 | "extends": "bar" 4 | } 5 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/graph/__tests__/__fixtures__/tsconfig-schema.ts: -------------------------------------------------------------------------------- 1 | import type { GraphSchemaValidators } from 'onerepo'; 2 | 3 | export default { 4 | '**': { 5 | 'tsconfig.json': { 6 | type: 'object', 7 | properties: { 8 | extends: { 9 | type: 'string', 10 | const: 'foo', 11 | }, 12 | }, 13 | required: ['extends'], 14 | }, 15 | }, 16 | } satisfies GraphSchemaValidators; 17 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/graph/__tests__/__fixtures__/yaml-schema.ts: -------------------------------------------------------------------------------- 1 | import type { GraphSchemaValidators } from 'onerepo'; 2 | 3 | export default { 4 | '**': { 5 | 'settings.{yaml,yml}': { 6 | type: 'object', 7 | properties: { 8 | foo: { 9 | type: 'string', 10 | const: 'baz', 11 | }, 12 | }, 13 | required: ['foo'], 14 | }, 15 | }, 16 | } satisfies GraphSchemaValidators; 17 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/hooks/__tests__/init.test.ts: -------------------------------------------------------------------------------- 1 | import { getCommand } from '@onerepo/test-cli'; 2 | import * as file from '@onerepo/file'; 3 | import * as subprocess from '@onerepo/subprocess'; 4 | import { LogStep } from '@onerepo/logger'; 5 | import * as Init from '../init'; 6 | 7 | const { run, graph } = getCommand(Init); 8 | 9 | describe('hooks init', () => { 10 | beforeEach(() => { 11 | vi.spyOn(file, 'write').mockResolvedValue(); 12 | vi.spyOn(file, 'chmod').mockResolvedValue(); 13 | vi.spyOn(subprocess, 'run').mockResolvedValue(['', '']); 14 | }); 15 | test('happy path', async () => { 16 | await run('--hooks-path .test-hooks'); 17 | 18 | expect(file.write).toHaveBeenCalledWith( 19 | graph.root.resolve('.test-hooks/_/hooks.sh'), 20 | expect.stringContaining('#!/usr/bin/env sh\n'), 21 | { step: expect.any(LogStep) }, 22 | ); 23 | expect(file.chmod).toHaveBeenCalledWith(graph.root.resolve('.test-hooks/_/hooks.sh'), 0o775, { 24 | step: expect.any(LogStep), 25 | }); 26 | expect(file.write).toHaveBeenCalledWith(graph.root.resolve('.test-hooks/_/.gitignore'), '*', { 27 | step: expect.any(LogStep), 28 | }); 29 | 30 | expect(subprocess.run).toHaveBeenCalledWith( 31 | expect.objectContaining({ 32 | cmd: 'git', 33 | args: ['config', 'core.hooksPath', '.test-hooks'], 34 | }), 35 | ); 36 | }); 37 | }); 38 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/tasks/__tests__/__fixtures__/multi-match/modules/burritos/onerepo.config.js: -------------------------------------------------------------------------------- 1 | /** @type import('onerepo').Config */ 2 | module.exports = { 3 | tasks: { 4 | 'pre-merge': { serial: [{ cmd: 'echo "pre-merge" "burritos"', match: ['asdf', '../tacos/foo'] }] }, 5 | }, 6 | }; 7 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/tasks/__tests__/__fixtures__/multi-match/modules/burritos/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fixture-burritos", 3 | "version": "4.5.2" 4 | } 5 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/tasks/__tests__/__fixtures__/multi-match/modules/tacos/onerepo.config.js: -------------------------------------------------------------------------------- 1 | /** @type import('onerepo').Config */ 2 | module.exports = { tasks: {} }; 3 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/tasks/__tests__/__fixtures__/multi-match/modules/tacos/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fixture-tacos", 3 | "version": "1.2.3" 4 | } 5 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/tasks/__tests__/__fixtures__/multi-match/onerepo.config.js: -------------------------------------------------------------------------------- 1 | /** @type import('onerepo').Config */ 2 | module.exports = { 3 | root: true, 4 | 5 | tasks: {}, 6 | }; 7 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/tasks/__tests__/__fixtures__/multi-match/package-lock.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/modules/onerepo/src/core/tasks/__tests__/__fixtures__/multi-match/package-lock.json -------------------------------------------------------------------------------- /modules/onerepo/src/core/tasks/__tests__/__fixtures__/multi-match/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fixture-root", 3 | "private": true, 4 | "type": "commonjs", 5 | "workspaces": [ 6 | "modules/*" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/tasks/__tests__/__fixtures__/repo/modules/burritos/onerepo.config.js: -------------------------------------------------------------------------------- 1 | /** @type import('onerepo').Config */ 2 | module.exports = { 3 | tasks: { 4 | 'pre-merge': { serial: [{ cmd: 'echo "pre-merge" "burritos"', meta: { good: 'yes' } }] }, 5 | 'pre-deploy': { parallel: ['echo "deployburritos"'] }, 6 | }, 7 | }; 8 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/tasks/__tests__/__fixtures__/repo/modules/burritos/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fixture-burritos", 3 | "version": "4.5.2" 4 | } 5 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/tasks/__tests__/__fixtures__/repo/modules/tacos/onerepo.config.js: -------------------------------------------------------------------------------- 1 | /** @type import('onerepo').Config */ 2 | module.exports = { 3 | tasks: { 4 | 'post-commit': { serial: ['echo "post-commit" "tacos"'] }, 5 | 'pre-publish': { parallel: [{ cmd: 'publish tacos', match: '../burritos/**/*' }] }, 6 | 'pre-deploy': { parallel: ['echo "deploytacos"'] }, 7 | }, 8 | }; 9 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/tasks/__tests__/__fixtures__/repo/modules/tacos/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fixture-tacos", 3 | "version": "1.2.3" 4 | } 5 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/tasks/__tests__/__fixtures__/repo/onerepo.config.js: -------------------------------------------------------------------------------- 1 | /** @type import('onerepo').Config */ 2 | module.exports = { 3 | root: true, 4 | 5 | tasks: { 6 | 'pre-commit': { parallel: ['$0 lint', '$0 tsc'] }, 7 | 'post-commit': { serial: ['echo "post-commit"'] }, 8 | build: { serial: [{ match: '**/foo.json', cmd: 'build' }] }, 9 | 'pre-deploy': { parallel: ['echo "deployroot"'] }, 10 | 'pre-merge': { serial: [['$0 lint', '$0 format']] }, 11 | }, 12 | }; 13 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/tasks/__tests__/__fixtures__/repo/package-lock.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/modules/onerepo/src/core/tasks/__tests__/__fixtures__/repo/package-lock.json -------------------------------------------------------------------------------- /modules/onerepo/src/core/tasks/__tests__/__fixtures__/repo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fixture-root", 3 | "private": true, 4 | "type": "commonjs", 5 | "workspaces": [ 6 | "modules/*" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/tasks/index.ts: -------------------------------------------------------------------------------- 1 | import type { Plugin, RootConfig } from '../../types'; 2 | import * as cmd from './tasks'; 3 | 4 | export const tasks: Plugin = function tasks(config: Required) { 5 | return { 6 | yargs: (yargs, visitor) => { 7 | const { command, description, builder, handler } = visitor(cmd); 8 | return yargs.command( 9 | command, 10 | description, 11 | (yargs) => { 12 | const y = builder(yargs) 13 | .choices( 14 | 'lifecycle', 15 | [...(config.taskConfig.lifecycles || []), ...cmd.lifecycles].filter( 16 | (v, i, self) => self.indexOf(v) === i, 17 | ), 18 | ) 19 | .middleware((argv: cmd.Argv) => { 20 | if ((config.taskConfig.stashUnstaged ?? ['pre-commit']).includes(argv.lifecycle)) { 21 | argv.staged = true; 22 | } 23 | }); 24 | 25 | if (config.ignore) { 26 | y.default('ignore', config.ignore); 27 | } 28 | 29 | return y; 30 | }, 31 | handler, 32 | ); 33 | }, 34 | }; 35 | }; 36 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/workspace/__tests__/__fixtures__/repo/modules/burritos/onerepo.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from 'onerepo/src/types'; 2 | 3 | export default { 4 | commands: { 5 | passthrough: { 6 | eat: { description: 'Eat burritos', command: 'eat all --the-things' }, 7 | }, 8 | }, 9 | } satisfies Config; 10 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/workspace/__tests__/__fixtures__/repo/modules/burritos/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fixture-burritos", 3 | "version": "4.5.2" 4 | } 5 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/workspace/__tests__/__fixtures__/repo/modules/tacos/onerepo.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from 'onerepo/src/types'; 2 | 3 | export default { 4 | commands: { 5 | passthrough: { 6 | eat: { description: 'Eat things ' }, 7 | }, 8 | }, 9 | } satisfies Config; 10 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/workspace/__tests__/__fixtures__/repo/modules/tacos/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fixture-tacos", 3 | "version": "1.2.3" 4 | } 5 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/workspace/__tests__/__fixtures__/repo/onerepo.config.js: -------------------------------------------------------------------------------- 1 | /** @type import('onerepo').Config */ 2 | module.exports = { 3 | root: true, 4 | 5 | tasks: { 6 | 'pre-commit': { parallel: ['$0 lint', '$0 tsc'] }, 7 | 'post-commit': { serial: ['echo "post-commit"'] }, 8 | build: { serial: [{ match: '**/foo.json', cmd: 'build' }] }, 9 | deploy: { parallel: ['echo "deployroot"'] }, 10 | 'pre-merge': { serial: [['$0 lint', '$0 format']] }, 11 | }, 12 | }; 13 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/workspace/__tests__/__fixtures__/repo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fixture-root", 3 | "private": true, 4 | "type": "commonjs", 5 | "workspaces": [ 6 | "modules/*" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /modules/onerepo/src/core/workspace/__tests__/__fixtures__/repo/yarn.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/modules/onerepo/src/core/workspace/__tests__/__fixtures__/repo/yarn.lock -------------------------------------------------------------------------------- /modules/onerepo/src/core/workspace/passthrough.ts: -------------------------------------------------------------------------------- 1 | import type { Builder, Handler } from '@onerepo/yargs'; 2 | import type { Workspace } from '@onerepo/graph'; 3 | import parser from 'yargs-parser'; 4 | import unparser from 'yargs-unparser'; 5 | 6 | export const builder: Builder = (yargs) => yargs; 7 | 8 | export function getHandler(cmd: string, workspace: Workspace): Handler { 9 | return async function (argv, { graph }) { 10 | const { '--': passthrough = [] } = argv; 11 | 12 | const defaults = parser(cmd); 13 | const { 14 | _: [command, ...rest], 15 | ...args 16 | } = defaults; 17 | const restArgs = unparser({ _: [], ...args }).map(String); 18 | 19 | await graph.packageManager.run({ 20 | name: `Run ${cmd}`, 21 | cmd: `${command}`, 22 | args: [...rest.map(String), ...restArgs, ...passthrough], 23 | opts: { 24 | cwd: workspace.location, 25 | stdio: 'inherit', 26 | }, 27 | }); 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /modules/onerepo/src/deps.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'cliui'; 2 | -------------------------------------------------------------------------------- /modules/onerepo/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from '@onerepo/logger'; 2 | export * from '@onerepo/package-manager'; 3 | export * from '@onerepo/subprocess'; 4 | export * from '@onerepo/yargs'; 5 | 6 | export * as git from '@onerepo/git'; 7 | export * as file from '@onerepo/file'; 8 | export * as builders from '@onerepo/builders'; 9 | 10 | export * from './setup'; 11 | export * from './types'; 12 | export * from '@onerepo/graph'; 13 | 14 | export { runTasks } from './core/tasks/run-tasks'; 15 | -------------------------------------------------------------------------------- /modules/onerepo/src/types/index.ts: -------------------------------------------------------------------------------- 1 | import type { RootConfig } from './config-root'; 2 | import type { WorkspaceConfig } from './config-workspace'; 3 | 4 | /** 5 | * Picks the correct config type between `RootConfig` and `WorkspaceConfig` based on whether the `root` property is set. Use this to help ensure your configs do not have any incorrect keys or values. 6 | * 7 | * Satisfy a `RootConfig`: 8 | * 9 | * ```ts 10 | * import type { Config } from 'onerepo'; 11 | * 12 | * export default { 13 | * root: true, 14 | * } satisfies Config; 15 | * ``` 16 | * 17 | * Satisfy a `WorkspaceConfig` with custom lifecycles on tasks: 18 | * 19 | * ```ts 20 | * import type { Config } from 'onerepo'; 21 | * 22 | * export default { 23 | * tasks: { 24 | * stage: { 25 | * serial: ['$0 build'], 26 | * } 27 | * }, 28 | * } satisfies Config<'stage'>; 29 | * ``` 30 | * @group Config 31 | */ 32 | export type Config = 33 | | RootConfig 34 | | WorkspaceConfig; 35 | 36 | export * from './plugin'; 37 | export * from './config-root'; 38 | export * from './config-workspace'; 39 | export * from './tasks'; 40 | -------------------------------------------------------------------------------- /modules/onerepo/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./src", "./package.json"], 7 | "exclude": ["./**/*.test.ts", "./**/__tests__/*"] 8 | } 9 | -------------------------------------------------------------------------------- /modules/onerepo/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/tsconfig/base.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./**/*", "./package.json"], 7 | "exclude": ["dist"], 8 | "references": [ 9 | { 10 | "path": "../test-cli" 11 | }, 12 | { 13 | "path": "../yargs" 14 | }, 15 | { 16 | "path": "../builders" 17 | }, 18 | { 19 | "path": "../git" 20 | }, 21 | { 22 | "path": "../graph" 23 | }, 24 | { 25 | "path": "../package-manager" 26 | }, 27 | { 28 | "path": "../subprocess" 29 | }, 30 | { 31 | "path": "../file" 32 | }, 33 | { 34 | "path": "../logger" 35 | }, 36 | { 37 | "path": "../../internal/vitest-config" 38 | }, 39 | { 40 | "path": "../../internal/jest-config" 41 | } 42 | ] 43 | } 44 | -------------------------------------------------------------------------------- /modules/onerepo/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineProject } from '@internal/vitest-config'; 2 | 3 | export default defineProject({}); 4 | -------------------------------------------------------------------------------- /modules/package-manager/.changes/000-swift-words-worry.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: minor 3 | --- 4 | 5 | Officially support Node 22 6 | -------------------------------------------------------------------------------- /modules/package-manager/.changes/001-silly-foxes-marry.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: patch 3 | --- 4 | 5 | Updates build dependency "esbuild". 6 | -------------------------------------------------------------------------------- /modules/package-manager/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@onerepo/package-manager", 3 | "alias": [ 4 | "pkg-mgr" 5 | ], 6 | "version": "1.0.4", 7 | "license": "MIT", 8 | "repository": { 9 | "type": "git", 10 | "url": "git://github.com/paularmstrong/onerepo.git", 11 | "directory": "modules/package-manager" 12 | }, 13 | "homepage": "https://onerepo.tools", 14 | "type": "module", 15 | "main": "./src/index.ts", 16 | "publishConfig": { 17 | "access": "public", 18 | "main": "./dist/index.js", 19 | "typings": "./dist/src/index.d.ts" 20 | }, 21 | "files": [ 22 | "./dist/**/*", 23 | "./README.md", 24 | "./CHANGELOG.md" 25 | ], 26 | "dependencies": { 27 | "@onerepo/subprocess": "1.0.4", 28 | "semver": "^7.5.4" 29 | }, 30 | "devDependencies": { 31 | "@internal/tsconfig": "workspace:^", 32 | "@internal/vitest-config": "workspace:^", 33 | "typescript": "^5.7.2" 34 | }, 35 | "engines": { 36 | "node": "^18 || ^20 || ^22" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /modules/package-manager/src/__tests__/__fixtures__/packagelock/package-lock.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/modules/package-manager/src/__tests__/__fixtures__/packagelock/package-lock.json -------------------------------------------------------------------------------- /modules/package-manager/src/__tests__/__fixtures__/pnpmlock/pnpm-lock.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/modules/package-manager/src/__tests__/__fixtures__/pnpmlock/pnpm-lock.yaml -------------------------------------------------------------------------------- /modules/package-manager/src/__tests__/__fixtures__/pnpmworkyaml/pnpm-workspace.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/modules/package-manager/src/__tests__/__fixtures__/pnpmworkyaml/pnpm-workspace.yaml -------------------------------------------------------------------------------- /modules/package-manager/src/__tests__/__fixtures__/yarnlock/yarn.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/modules/package-manager/src/__tests__/__fixtures__/yarnlock/yarn.lock -------------------------------------------------------------------------------- /modules/package-manager/src/__tests__/__fixtures__/yarnrcyaml/.yarnrc.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/modules/package-manager/src/__tests__/__fixtures__/yarnrcyaml/.yarnrc.yaml -------------------------------------------------------------------------------- /modules/package-manager/src/__tests__/__fixtures__/yarnrcyml/.yarnrc.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/modules/package-manager/src/__tests__/__fixtures__/yarnrcyml/.yarnrc.yml -------------------------------------------------------------------------------- /modules/package-manager/src/index.ts: -------------------------------------------------------------------------------- 1 | import { Npm } from './npm'; 2 | import { Pnpm } from './pnpm'; 3 | import { Yarn } from './yarn'; 4 | import type { PackageManager } from './methods'; 5 | 6 | export * from './get-package-manager'; 7 | export * from './package-json'; 8 | export * from './methods'; 9 | 10 | /** 11 | * Get the {@link PackageManager | `PackageManager`} for the given package manager type (NPM, PNPm, or Yarn) 12 | * @group Package management 13 | */ 14 | export function getPackageManager(type: 'npm' | 'pnpm' | 'yarn'): PackageManager { 15 | return managers[type]; 16 | } 17 | 18 | const managers: Record<'npm' | 'pnpm' | 'yarn', PackageManager> = { 19 | npm: Npm, 20 | pnpm: Pnpm, 21 | yarn: Yarn, 22 | }; 23 | -------------------------------------------------------------------------------- /modules/package-manager/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./src"], 7 | "exclude": ["./**/*.test.ts", "./**/__tests__/*"] 8 | } 9 | -------------------------------------------------------------------------------- /modules/package-manager/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/tsconfig/base.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./**/*"], 7 | "references": [ 8 | { 9 | "path": "../subprocess" 10 | }, 11 | { 12 | "path": "../logger" 13 | }, 14 | { 15 | "path": "../../internal/vitest-config" 16 | }, 17 | { 18 | "path": "../../internal/jest-config" 19 | } 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /modules/package-manager/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineProject } from '@internal/vitest-config'; 2 | 3 | export default defineProject({}); 4 | -------------------------------------------------------------------------------- /modules/subprocess/.changes/000-swift-words-worry.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: minor 3 | --- 4 | 5 | Officially support Node 22 6 | -------------------------------------------------------------------------------- /modules/subprocess/.changes/001-silly-foxes-marry.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: patch 3 | --- 4 | 5 | Updates build dependency "esbuild". 6 | -------------------------------------------------------------------------------- /modules/subprocess/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@onerepo/subprocess", 3 | "version": "1.0.4", 4 | "license": "MIT", 5 | "repository": { 6 | "type": "git", 7 | "url": "git://github.com/paularmstrong/onerepo.git", 8 | "directory": "modules/subprocess" 9 | }, 10 | "homepage": "https://onerepo.tools", 11 | "type": "module", 12 | "main": "./src/index.ts", 13 | "publishConfig": { 14 | "access": "public", 15 | "main": "./dist/index.js", 16 | "typings": "./dist/src/index.d.ts" 17 | }, 18 | "files": [ 19 | "./dist/**/*", 20 | "./README.md", 21 | "./CHANGELOG.md" 22 | ], 23 | "dependencies": { 24 | "@onerepo/logger": "1.0.4" 25 | }, 26 | "devDependencies": { 27 | "@internal/jest-config": "workspace:^", 28 | "@internal/tsconfig": "workspace:^" 29 | }, 30 | "engines": { 31 | "node": "^18 || ^20 || ^22" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /modules/subprocess/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./src"], 7 | "exclude": ["./**/*.test.ts", "./**/__tests__/*"] 8 | } 9 | -------------------------------------------------------------------------------- /modules/subprocess/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/tsconfig/base.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./**/*"], 7 | "references": [ 8 | { 9 | "path": "../logger" 10 | }, 11 | { 12 | "path": "../../internal/vitest-config" 13 | }, 14 | { 15 | "path": "../../internal/jest-config" 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /modules/test-cli/.changes/000-swift-words-worry.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: minor 3 | --- 4 | 5 | Officially support Node 22 6 | -------------------------------------------------------------------------------- /modules/test-cli/.changes/001-silly-foxes-marry.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: patch 3 | --- 4 | 5 | Updates build dependency "esbuild". 6 | -------------------------------------------------------------------------------- /modules/test-cli/.changes/002-loose-phones-call.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: patch 3 | --- 4 | 5 | Internal-only type and formatting updates. 6 | -------------------------------------------------------------------------------- /modules/test-cli/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@onerepo/test-cli", 3 | "version": "1.0.4", 4 | "license": "MIT", 5 | "repository": { 6 | "type": "git", 7 | "url": "git://github.com/paularmstrong/onerepo.git", 8 | "directory": "modules/test-cli" 9 | }, 10 | "homepage": "https://onerepo.tools", 11 | "type": "module", 12 | "main": "./src/index.ts", 13 | "publishConfig": { 14 | "access": "public", 15 | "main": "./dist/index.js", 16 | "typings": "./dist/src/index.d.ts" 17 | }, 18 | "files": [ 19 | "./dist/**/*", 20 | "./README.md", 21 | "./CHANGELOG.md" 22 | ], 23 | "dependencies": { 24 | "@onerepo/builders": "1.0.4", 25 | "@onerepo/graph": "1.0.4", 26 | "@onerepo/logger": "1.0.4", 27 | "@onerepo/yargs": "1.0.4", 28 | "yargs": "^17.6.2" 29 | }, 30 | "devDependencies": { 31 | "@internal/tsconfig": "workspace:^", 32 | "typescript": "^5.7.2" 33 | }, 34 | "engines": { 35 | "node": "^18 || ^20 || ^22" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /modules/test-cli/src/fixtures/repo/eslint.config.ts: -------------------------------------------------------------------------------- 1 | // @ts-nocheck 2 | import burritos from 'fixture-burritos/eslint.config'; 3 | import tacos from 'fixture-tacos/eslint.config'; 4 | export default []; 5 | -------------------------------------------------------------------------------- /modules/test-cli/src/fixtures/repo/modules/burritos/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fixture-burritos", 3 | "alias": [ 4 | "burritos" 5 | ], 6 | "version": "4.5.2" 7 | } 8 | -------------------------------------------------------------------------------- /modules/test-cli/src/fixtures/repo/modules/burritos/tsconfig.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/modules/test-cli/src/fixtures/repo/modules/burritos/tsconfig.json -------------------------------------------------------------------------------- /modules/test-cli/src/fixtures/repo/modules/tacos/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fixture-tacos", 3 | "alias": [ 4 | "tacos" 5 | ], 6 | "version": "1.2.3" 7 | } 8 | -------------------------------------------------------------------------------- /modules/test-cli/src/fixtures/repo/modules/tacos/tsconfig.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/modules/test-cli/src/fixtures/repo/modules/tacos/tsconfig.json -------------------------------------------------------------------------------- /modules/test-cli/src/fixtures/repo/onerepo.config.js: -------------------------------------------------------------------------------- 1 | /** @type import('onerepo').Config */ 2 | module.exports = { 3 | tasks: { 4 | 'pre-commit': { parallel: ['$0 lint', '$0 tsc'] }, 5 | }, 6 | }; 7 | -------------------------------------------------------------------------------- /modules/test-cli/src/fixtures/repo/package-lock.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/modules/test-cli/src/fixtures/repo/package-lock.json -------------------------------------------------------------------------------- /modules/test-cli/src/fixtures/repo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fixture-root", 3 | "private": true, 4 | "type": "commonjs", 5 | "workspaces": [ 6 | "modules/*" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /modules/test-cli/src/fixtures/repo/tsconfig.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paularmstrong/onerepo/35af90aad3a5301853a6232d9aee6119b02f8188/modules/test-cli/src/fixtures/repo/tsconfig.json -------------------------------------------------------------------------------- /modules/test-cli/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./src"], 7 | "exclude": ["./**/*.test.ts", "./**/__tests__/*"] 8 | } 9 | -------------------------------------------------------------------------------- /modules/test-cli/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/tsconfig/base.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./**/*"], 7 | "exclude": ["dist"], 8 | "references": [ 9 | { 10 | "path": "../yargs" 11 | }, 12 | { 13 | "path": "../builders" 14 | }, 15 | { 16 | "path": "../git" 17 | }, 18 | { 19 | "path": "../graph" 20 | }, 21 | { 22 | "path": "../package-manager" 23 | }, 24 | { 25 | "path": "../subprocess" 26 | }, 27 | { 28 | "path": "../file" 29 | }, 30 | { 31 | "path": "../logger" 32 | }, 33 | { 34 | "path": "../../internal/vitest-config" 35 | }, 36 | { 37 | "path": "../../internal/jest-config" 38 | } 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /modules/yargs/.changes/000-swift-words-worry.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: minor 3 | --- 4 | 5 | Officially support Node 22 6 | -------------------------------------------------------------------------------- /modules/yargs/.changes/001-silly-foxes-marry.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: patch 3 | --- 4 | 5 | Updates build dependency "esbuild". 6 | -------------------------------------------------------------------------------- /modules/yargs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@onerepo/yargs", 3 | "version": "1.0.4", 4 | "license": "MIT", 5 | "repository": { 6 | "type": "git", 7 | "url": "git://github.com/paularmstrong/onerepo.git", 8 | "directory": "modules/yargs" 9 | }, 10 | "homepage": "https://onerepo.tools", 11 | "type": "module", 12 | "main": "./src/index.ts", 13 | "publishConfig": { 14 | "access": "public", 15 | "main": "./dist/index.js", 16 | "typings": "./dist/src/index.d.ts" 17 | }, 18 | "files": [ 19 | "./dist/**/*", 20 | "./README.md", 21 | "./CHANGELOG.md" 22 | ], 23 | "dependencies": { 24 | "@onerepo/builders": "1.0.4", 25 | "@onerepo/logger": "1.0.4", 26 | "@onerepo/subprocess": "1.0.4", 27 | "semver": "^7.5.4" 28 | }, 29 | "devDependencies": { 30 | "@internal/tsconfig": "workspace:^", 31 | "@types/yargs": "^17.0.33" 32 | }, 33 | "engines": { 34 | "node": "^18 || ^20 || ^22" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /modules/yargs/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './yargs'; 2 | -------------------------------------------------------------------------------- /modules/yargs/src/middleware/engine-check.ts: -------------------------------------------------------------------------------- 1 | import { intersects } from 'semver'; 2 | import type { Graph } from '@onerepo/graph'; 3 | import type { Logger } from '@onerepo/logger'; 4 | import type { Argv as Yargv } from 'yargs'; 5 | import type { Argv } from '@onerepo/yargs'; 6 | 7 | export function checkEnginesMiddleware(yargs: Yargv, graph: Graph, logger: Logger) { 8 | return async function checkEnginesMiddleware(argv: Omit) { 9 | if (argv['skip-engine-check']) { 10 | return; 11 | } 12 | 13 | const supportedRange = graph.root.packageJson.engines?.node; 14 | if (!supportedRange) { 15 | return; 16 | } 17 | 18 | const currentVersion = process.versions.node; 19 | if (intersects(currentVersion, supportedRange)) { 20 | return; 21 | } 22 | 23 | logger.error(`\u0000 24 | Node.js version mismatch. 25 | 26 | Expected curren version ("${currentVersion}") to intersect "${supportedRange}". 27 | 28 | Install a version matching "${supportedRange}" or bypass this check by passing "--skip-engine-check". 29 | \u0000`); 30 | await logger.end(); 31 | yargs.exit(1, new Error()); 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /modules/yargs/src/middleware/environment.ts: -------------------------------------------------------------------------------- 1 | import type { Verbosity } from '@onerepo/logger'; 2 | import { getLogger } from '@onerepo/logger'; 3 | import type { Argv } from '@onerepo/yargs'; 4 | 5 | export function setEnvironmentMiddleware(argv: Omit) { 6 | process.env.ONEREPO_DRY_RUN = `${argv['dry-run']}`; 7 | argv.verbosity = argv.quiet ? 0 : argv.verbosity; 8 | getLogger().verbosity = argv.verbosity as Verbosity; 9 | } 10 | -------------------------------------------------------------------------------- /modules/yargs/src/middleware/index.ts: -------------------------------------------------------------------------------- 1 | export * from './environment'; 2 | export * from './sudo-check'; 3 | export * from './engine-check'; 4 | -------------------------------------------------------------------------------- /modules/yargs/src/middleware/sudo-check.ts: -------------------------------------------------------------------------------- 1 | import type { Logger } from '@onerepo/logger'; 2 | import type { Argv as Yargv } from 'yargs'; 3 | 4 | export function sudoCheckMiddleware(yargs: Yargv, logger: Logger) { 5 | return async function sudoCheckMiddleware() { 6 | if (!process.env.SUDO_UID) { 7 | return; 8 | } 9 | 10 | logger.error(`\u0000 11 | Do not run commands with sudo! 12 | 13 | If elevated permissions are required, commands will prompt you for your password only if and when necessary. 14 | \u0000`); 15 | await logger.end(); 16 | yargs.exit(1, new Error()); 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /modules/yargs/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./src"], 7 | "exclude": ["./**/*.test.ts", "./**/__tests__/*"] 8 | } 9 | -------------------------------------------------------------------------------- /modules/yargs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/tsconfig/base.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./**/*"], 7 | "references": [ 8 | { 9 | "path": "../builders" 10 | }, 11 | { 12 | "path": "../git" 13 | }, 14 | { 15 | "path": "../graph" 16 | }, 17 | { 18 | "path": "../package-manager" 19 | }, 20 | { 21 | "path": "../subprocess" 22 | }, 23 | { 24 | "path": "../file" 25 | }, 26 | { 27 | "path": "../logger" 28 | }, 29 | { 30 | "path": "../../internal/vitest-config" 31 | }, 32 | { 33 | "path": "../../internal/jest-config" 34 | } 35 | ] 36 | } 37 | -------------------------------------------------------------------------------- /plugins/docgen/.changes/000-swift-words-worry.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: minor 3 | --- 4 | 5 | Officially support Node 22 6 | -------------------------------------------------------------------------------- /plugins/docgen/.changes/001-moody-doodles-hear.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: patch 3 | --- 4 | 5 | Update internal typescript resolution package (Jiti) 6 | -------------------------------------------------------------------------------- /plugins/docgen/.changes/002-silly-foxes-marry.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: patch 3 | --- 4 | 5 | Updates build dependency "esbuild". 6 | -------------------------------------------------------------------------------- /plugins/docgen/.changes/003-loose-phones-call.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: patch 3 | --- 4 | 5 | Internal-only type and formatting updates. 6 | -------------------------------------------------------------------------------- /plugins/docgen/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # @onerepo/plugin-docgen 2 | 3 | ## 1.0.1 4 | 5 | ### Patch changes 6 | 7 | - Updates to third-party modules ([0012245](https://github.com/paularmstrong/onerepo/commit/0012245b9e60b49d830fc0275fd88e73e453d287)) 8 | - Updated internal/third-party typescript definitions ([e5fb5fa](https://github.com/paularmstrong/onerepo/commit/e5fb5fa0e9fbe6ff18c2d993cb22119a3908df73)) 9 | - Internal formatting changes due to Prettier upgrade. ([f8cb805](https://github.com/paularmstrong/onerepo/commit/f8cb80550ceabdce6ff6c13bf22466a59e694b0f)) 10 | 11 | ### Dependencies updated 12 | 13 | - onerepo@1.2.0 14 | - @onerepo/test-cli@1.0.4 15 | - @onerepo/yargs@1.0.4 16 | - @onerepo/builders@1.0.4 17 | - @onerepo/git@1.1.0 18 | - @onerepo/graph@1.0.4 19 | - @onerepo/package-manager@1.0.4 20 | - @onerepo/subprocess@1.0.4 21 | - @onerepo/file@1.0.4 22 | - @onerepo/logger@1.0.4 23 | 24 | > View the full changelog: [cd94664...9895235](https://github.com/paularmstrong/onerepo/compare/cd9466419b207f690e55f87d0e4632eebdc0ca6a...98952352d3c32adf853657e46e14f12fe1737992) 25 | 26 | ## 1.0.0 27 | 28 | 🎉 Initial stable release! 29 | 30 | _For historical changelogs, please view the [oneRepo source](https://github.com/paularmstrong/onerepo/tree/main/plugins/plugin-docgen)._ 31 | -------------------------------------------------------------------------------- /plugins/docgen/README.md: -------------------------------------------------------------------------------- 1 | ## Installation 2 | 3 | ```sh 4 | npm install --save-dev @onerepo/plugin-docgen 5 | ``` 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /plugins/docgen/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@onerepo/plugin-docgen", 3 | "version": "1.0.1", 4 | "license": "MIT", 5 | "title": "Docgen", 6 | "repository": { 7 | "directory": "plugins/docgen", 8 | "type": "git", 9 | "url": "git://github.com/paularmstrong/onerepo.git" 10 | }, 11 | "homepage": "https://onerepo.tools/plugins/docgen/", 12 | "type": "module", 13 | "main": "./src/index.ts", 14 | "publishConfig": { 15 | "access": "public", 16 | "main": "./dist/index.js", 17 | "typings": "./dist/src/index.d.ts" 18 | }, 19 | "files": [ 20 | "./dist/**/*", 21 | "./README.md", 22 | "./CHANGELOG.md" 23 | ], 24 | "dependencies": { 25 | "glob": "^10.1.0", 26 | "jiti": "^2.4.2", 27 | "mdast-builder": "^1.1.1", 28 | "remark-gfm": "^4.0.0", 29 | "remark-parse": "^11.0.0", 30 | "remark-stringify": "^11.0.0", 31 | "unified": "^11.0.5" 32 | }, 33 | "devDependencies": { 34 | "@internal/tsconfig": "workspace:^", 35 | "@internal/vitest-config": "workspace:^", 36 | "onerepo": "workspace:^" 37 | }, 38 | "peerDependencies": { 39 | "onerepo": "^1" 40 | }, 41 | "engines": { 42 | "node": "^18 || ^20 || ^22" 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /plugins/docgen/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./src"], 7 | "exclude": ["./**/*.test.ts", "./**/__tests__/*"] 8 | } 9 | -------------------------------------------------------------------------------- /plugins/docgen/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/tsconfig/base.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./**/*"], 7 | "references": [ 8 | { 9 | "path": "../../modules/onerepo" 10 | }, 11 | { 12 | "path": "../../modules/test-cli" 13 | }, 14 | { 15 | "path": "../../modules/yargs" 16 | }, 17 | { 18 | "path": "../../modules/builders" 19 | }, 20 | { 21 | "path": "../../modules/git" 22 | }, 23 | { 24 | "path": "../../modules/graph" 25 | }, 26 | { 27 | "path": "../../modules/package-manager" 28 | }, 29 | { 30 | "path": "../../modules/subprocess" 31 | }, 32 | { 33 | "path": "../../modules/file" 34 | }, 35 | { 36 | "path": "../../modules/logger" 37 | }, 38 | { 39 | "path": "../../internal/vitest-config" 40 | }, 41 | { 42 | "path": "../../internal/jest-config" 43 | } 44 | ] 45 | } 46 | -------------------------------------------------------------------------------- /plugins/docgen/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineProject } from '@internal/vitest-config'; 2 | 3 | export default defineProject({}); 4 | -------------------------------------------------------------------------------- /plugins/eslint/.changes/000-swift-words-worry.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: minor 3 | --- 4 | 5 | Officially support Node 22 6 | -------------------------------------------------------------------------------- /plugins/eslint/.changes/001-moody-doodles-hear.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: patch 3 | --- 4 | 5 | Update internal typescript resolution package (Jiti) 6 | -------------------------------------------------------------------------------- /plugins/eslint/.changes/002-silly-foxes-marry.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: patch 3 | --- 4 | 5 | Updates build dependency "esbuild". 6 | -------------------------------------------------------------------------------- /plugins/eslint/.changes/003-crazy-bobcats-sniff.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: major 3 | --- 4 | 5 | Warnings will no longer cause ESLint checks to fail. 6 | 7 | A good rule to stand by: if something is a warning, it will be perceived as noise and never get fixed. Lint rules should either be full on errors, auto-fixed, or disabled. While it is not recommended, you can ee-enable failures on warnings with `eslint({ warnings: true })`. Do note that this may be a huge inconvenience for developers and you’ll be better off either disabling those rules or turning them into errors. 8 | -------------------------------------------------------------------------------- /plugins/eslint/.changes/004-fast-squids-rhyme.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: major 3 | --- 4 | 5 | Drops support for ESLint 8. Requires ESLint 9 and flat configs. 6 | -------------------------------------------------------------------------------- /plugins/eslint/.changes/005-red-suits-rhyme.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: major 3 | --- 4 | 5 | Added a new ESLint config wrapper to help support using isolated workspace configs within a root ESLint flat configuration. Check the [docs](https://onerepo.tools/plugins/eslint/) for more information. 6 | -------------------------------------------------------------------------------- /plugins/eslint/README.md: -------------------------------------------------------------------------------- 1 | ## Installation 2 | 3 | ```sh 4 | npm install --save-dev @onerepo/plugin-eslint 5 | ``` 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /plugins/eslint/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./src"], 7 | "exclude": ["./**/*.test.ts", "./**/__tests__/*"] 8 | } 9 | -------------------------------------------------------------------------------- /plugins/eslint/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/tsconfig/base.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./**/*"], 7 | "references": [ 8 | { 9 | "path": "../../modules/onerepo" 10 | }, 11 | { 12 | "path": "../../modules/test-cli" 13 | }, 14 | { 15 | "path": "../../modules/yargs" 16 | }, 17 | { 18 | "path": "../../modules/eslint-formatter" 19 | }, 20 | { 21 | "path": "../../modules/builders" 22 | }, 23 | { 24 | "path": "../../modules/git" 25 | }, 26 | { 27 | "path": "../../modules/graph" 28 | }, 29 | { 30 | "path": "../../modules/package-manager" 31 | }, 32 | { 33 | "path": "../../modules/subprocess" 34 | }, 35 | { 36 | "path": "../../modules/file" 37 | }, 38 | { 39 | "path": "../../modules/logger" 40 | }, 41 | { 42 | "path": "../../internal/vitest-config" 43 | }, 44 | { 45 | "path": "../../internal/jest-config" 46 | } 47 | ] 48 | } 49 | -------------------------------------------------------------------------------- /plugins/eslint/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineProject } from '@internal/vitest-config'; 2 | 3 | export default defineProject({}); 4 | -------------------------------------------------------------------------------- /plugins/jest/.changes/000-swift-words-worry.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: minor 3 | --- 4 | 5 | Officially support Node 22 6 | -------------------------------------------------------------------------------- /plugins/jest/.changes/001-silly-foxes-marry.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: patch 3 | --- 4 | 5 | Updates build dependency "esbuild". 6 | -------------------------------------------------------------------------------- /plugins/jest/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # @onerepo/plugin-jest 2 | 3 | ## 1.0.1 4 | 5 | ### Patch changes 6 | 7 | - Updated internal/third-party typescript definitions ([e5fb5fa](https://github.com/paularmstrong/onerepo/commit/e5fb5fa0e9fbe6ff18c2d993cb22119a3908df73)) 8 | - Internal formatting changes due to Prettier upgrade. ([f8cb805](https://github.com/paularmstrong/onerepo/commit/f8cb80550ceabdce6ff6c13bf22466a59e694b0f)) 9 | 10 | ### Dependencies updated 11 | 12 | - onerepo@1.2.0 13 | - @onerepo/test-cli@1.0.4 14 | - @onerepo/yargs@1.0.4 15 | - @onerepo/builders@1.0.4 16 | - @onerepo/git@1.1.0 17 | - @onerepo/graph@1.0.4 18 | - @onerepo/package-manager@1.0.4 19 | - @onerepo/subprocess@1.0.4 20 | - @onerepo/file@1.0.4 21 | - @onerepo/logger@1.0.4 22 | 23 | > View the full changelog: [cd94664...9895235](https://github.com/paularmstrong/onerepo/compare/cd9466419b207f690e55f87d0e4632eebdc0ca6a...98952352d3c32adf853657e46e14f12fe1737992) 24 | 25 | ## 1.0.0 26 | 27 | 🎉 Initial stable release! 28 | 29 | _For historical changelogs, please view the [oneRepo source](https://github.com/paularmstrong/onerepo/tree/main/plugins/plugin-jest)._ 30 | -------------------------------------------------------------------------------- /plugins/jest/README.md: -------------------------------------------------------------------------------- 1 | Jest is the recomended framework for headless testing with oneRepo. As opposed to Vitest and others, Jest allows a single runner that can use multiple project configurations. Think of each project as a separate workspace in your repo. 2 | 3 | The added benefit of Jest is that as you are working, you can run this single command and it will automatically test appropriate files related to your changes across all workspaces. There's no need to determine which workspaces to run – and can all be done with `--watch` mode at the same time. 4 | 5 | ## Installation 6 | 7 | ```sh 8 | npm install --save-dev @onerepo/plugin-jest 9 | ``` 10 | 11 | Create a root level jest config with the appropriate references to your workspace Jest configs: 12 | 13 | ```js title="jest.config.js" 14 | /** @type {import('jest').Config} */ 15 | export default { 16 | projects: ['/apps/*/jest.config.js', '/modules/*/jest.config.js'], 17 | }; 18 | ``` 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /plugins/jest/jest.config.js: -------------------------------------------------------------------------------- 1 | import { makeConfig } from '@internal/jest-config'; 2 | 3 | const config = makeConfig({ 4 | displayName: 'jest', 5 | rootDir: import.meta.url, 6 | }); 7 | 8 | export default config; 9 | -------------------------------------------------------------------------------- /plugins/jest/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@onerepo/plugin-jest", 3 | "description": "Official Jest plugin for the oneRepo toolchain.", 4 | "title": "Jest", 5 | "version": "1.0.1", 6 | "license": "MIT", 7 | "repository": { 8 | "type": "git", 9 | "url": "git://github.com/paularmstrong/onerepo.git", 10 | "directory": "plugins/jest" 11 | }, 12 | "homepage": "https://onerepo.tools/plugins/vitest/", 13 | "type": "module", 14 | "main": "./src/index.ts", 15 | "publishConfig": { 16 | "access": "public", 17 | "main": "./dist/index.js", 18 | "typings": "./dist/src/index.d.ts" 19 | }, 20 | "files": [ 21 | "./dist/**/*", 22 | "./README.md", 23 | "./CHANGELOG.md" 24 | ], 25 | "devDependencies": { 26 | "@internal/jest-config": "workspace:^", 27 | "@internal/tsconfig": "workspace:^", 28 | "@onerepo/test-cli": "workspace:^", 29 | "onerepo": "workspace:^", 30 | "typescript": "^5.7.2" 31 | }, 32 | "peerDependencies": { 33 | "jest": ">=29", 34 | "onerepo": "^1" 35 | }, 36 | "engines": { 37 | "node": "^18 || ^20 || ^22" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /plugins/jest/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./src"], 7 | "exclude": ["./**/*.test.ts", "./**/__tests__/*"] 8 | } 9 | -------------------------------------------------------------------------------- /plugins/jest/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/tsconfig/base.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/", 5 | "types": ["node", "@types/jest"] 6 | }, 7 | "include": ["./**/*"], 8 | "references": [ 9 | { 10 | "path": "../../modules/onerepo" 11 | }, 12 | { 13 | "path": "../../modules/test-cli" 14 | }, 15 | { 16 | "path": "../../modules/yargs" 17 | }, 18 | { 19 | "path": "../../modules/builders" 20 | }, 21 | { 22 | "path": "../../modules/git" 23 | }, 24 | { 25 | "path": "../../modules/graph" 26 | }, 27 | { 28 | "path": "../../modules/package-manager" 29 | }, 30 | { 31 | "path": "../../modules/subprocess" 32 | }, 33 | { 34 | "path": "../../modules/file" 35 | }, 36 | { 37 | "path": "../../modules/logger" 38 | }, 39 | { 40 | "path": "../../internal/vitest-config" 41 | }, 42 | { 43 | "path": "../../internal/jest-config" 44 | } 45 | ] 46 | } 47 | -------------------------------------------------------------------------------- /plugins/performance-writer/.changes/000-swift-words-worry.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: minor 3 | --- 4 | 5 | Officially support Node 22 6 | -------------------------------------------------------------------------------- /plugins/performance-writer/.changes/001-silly-foxes-marry.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: patch 3 | --- 4 | 5 | Updates build dependency "esbuild". 6 | -------------------------------------------------------------------------------- /plugins/performance-writer/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # @onerepo/plugin-performance-writer 2 | 3 | ## 1.0.1 4 | 5 | ### Patch changes 6 | 7 | - Internal formatting changes due to Prettier upgrade. ([f8cb805](https://github.com/paularmstrong/onerepo/commit/f8cb80550ceabdce6ff6c13bf22466a59e694b0f)) 8 | 9 | ### Dependencies updated 10 | 11 | - onerepo@1.2.0 12 | - @onerepo/test-cli@1.0.4 13 | - @onerepo/yargs@1.0.4 14 | - @onerepo/builders@1.0.4 15 | - @onerepo/git@1.1.0 16 | - @onerepo/graph@1.0.4 17 | - @onerepo/package-manager@1.0.4 18 | - @onerepo/subprocess@1.0.4 19 | - @onerepo/file@1.0.4 20 | - @onerepo/logger@1.0.4 21 | 22 | > View the full changelog: [cd94664...9895235](https://github.com/paularmstrong/onerepo/compare/cd9466419b207f690e55f87d0e4632eebdc0ca6a...98952352d3c32adf853657e46e14f12fe1737992) 23 | 24 | ## 1.0.0 25 | 26 | 🎉 Initial stable release! 27 | 28 | _For historical changelogs, please view the [oneRepo source](https://github.com/paularmstrong/onerepo/tree/main/plugins/plugin-performance-writer)._ 29 | -------------------------------------------------------------------------------- /plugins/performance-writer/README.md: -------------------------------------------------------------------------------- 1 | This is a usable example plugin to demonstrate how to build your own telemetry and performance tracing plugin using the oneRepo plugin API and internal performance entries. 2 | 3 | Using a [PerformanceObserver](https://nodejs.org/docs/latest-v18.x/api/perf_hooks.html#class-perf_hooksperformanceobserver), it listens for performance marks and converts them into measurements from `onerepo_start_` to `onerepo_end_` prefixed entries. On CLI shutdown, the measurements will be written to a file for later operation. 4 | 5 | No metrics or information are shared anywhere outside of your local environment. 6 | 7 | ## Installation 8 | 9 | ```sh 10 | npm install --save-dev @onerepo/plugin-performance-writer 11 | ``` 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /plugins/performance-writer/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@onerepo/plugin-performance-writer", 3 | "description": "Write performance measurements from oneRepo invocations to files.", 4 | "version": "1.0.1", 5 | "license": "MIT", 6 | "title": "Performance Writer", 7 | "repository": { 8 | "type": "git", 9 | "url": "git://github.com/paularmstrong/onerepo.git", 10 | "directory": "plugins/performance-writer" 11 | }, 12 | "homepage": "https://onerepo.tools/plugins/performance-writer/", 13 | "type": "module", 14 | "main": "./src/index.ts", 15 | "publishConfig": { 16 | "access": "public", 17 | "main": "./dist/index.js", 18 | "typings": "./dist/src/index.d.ts" 19 | }, 20 | "files": [ 21 | "./dist/**/*", 22 | "./README.md", 23 | "./CHANGELOG.md" 24 | ], 25 | "devDependencies": { 26 | "@internal/tsconfig": "workspace:^", 27 | "@internal/vitest-config": "workspace:^", 28 | "onerepo": "workspace:^" 29 | }, 30 | "peerDependencies": { 31 | "onerepo": "^1" 32 | }, 33 | "engines": { 34 | "node": "^18 || ^20 || ^22" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /plugins/performance-writer/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./src"], 7 | "exclude": ["./**/*.test.ts", "./**/__tests__/*"] 8 | } 9 | -------------------------------------------------------------------------------- /plugins/performance-writer/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/tsconfig/base.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./**/*"], 7 | "references": [ 8 | { 9 | "path": "../../modules/onerepo" 10 | }, 11 | { 12 | "path": "../../modules/test-cli" 13 | }, 14 | { 15 | "path": "../../modules/yargs" 16 | }, 17 | { 18 | "path": "../../modules/builders" 19 | }, 20 | { 21 | "path": "../../modules/git" 22 | }, 23 | { 24 | "path": "../../modules/graph" 25 | }, 26 | { 27 | "path": "../../modules/package-manager" 28 | }, 29 | { 30 | "path": "../../modules/subprocess" 31 | }, 32 | { 33 | "path": "../../modules/file" 34 | }, 35 | { 36 | "path": "../../modules/logger" 37 | }, 38 | { 39 | "path": "../../internal/vitest-config" 40 | }, 41 | { 42 | "path": "../../internal/jest-config" 43 | } 44 | ] 45 | } 46 | -------------------------------------------------------------------------------- /plugins/performance-writer/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineProject } from '@internal/vitest-config'; 2 | 3 | export default defineProject({}); 4 | -------------------------------------------------------------------------------- /plugins/prettier/.changes/000-swift-words-worry.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: minor 3 | --- 4 | 5 | Officially support Node 22 6 | -------------------------------------------------------------------------------- /plugins/prettier/.changes/001-silly-foxes-marry.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: patch 3 | --- 4 | 5 | Updates build dependency "esbuild". 6 | -------------------------------------------------------------------------------- /plugins/prettier/README.md: -------------------------------------------------------------------------------- 1 | ## Installation 2 | 3 | ```sh 4 | npm install --save-dev @onerepo/plugin-prettier 5 | ``` 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /plugins/prettier/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@onerepo/plugin-prettier", 3 | "description": "Official Prettier plugin for the oneRepo toolchain.", 4 | "title": "Prettier", 5 | "version": "1.0.4", 6 | "license": "MIT", 7 | "repository": { 8 | "type": "git", 9 | "url": "git://github.com/paularmstrong/onerepo.git", 10 | "directory": "plugins/prettier" 11 | }, 12 | "homepage": "https://onerepo.tools/plugins/prettier/", 13 | "type": "module", 14 | "main": "./src/index.ts", 15 | "publishConfig": { 16 | "access": "public", 17 | "main": "./dist/index.js", 18 | "typings": "./dist/src/index.d.ts" 19 | }, 20 | "files": [ 21 | "./dist/**/*", 22 | "./README.md", 23 | "./CHANGELOG.md" 24 | ], 25 | "dependencies": { 26 | "@actions/core": "^1.10.1", 27 | "ignore": "^5.3.1" 28 | }, 29 | "devDependencies": { 30 | "@internal/tsconfig": "workspace:^", 31 | "@internal/vitest-config": "workspace:^", 32 | "@onerepo/test-cli": "workspace:^", 33 | "onerepo": "workspace:^", 34 | "typescript": "^5.7.2" 35 | }, 36 | "peerDependencies": { 37 | "onerepo": "^1", 38 | "prettier": "^2 || ^3" 39 | }, 40 | "engines": { 41 | "node": "^18 || ^20 || ^22" 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /plugins/prettier/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./src"], 7 | "exclude": ["./**/*.test.ts", "./**/__tests__/*"] 8 | } 9 | -------------------------------------------------------------------------------- /plugins/prettier/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/tsconfig/base.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./**/*"], 7 | "references": [ 8 | { 9 | "path": "../../modules/onerepo" 10 | }, 11 | { 12 | "path": "../../modules/test-cli" 13 | }, 14 | { 15 | "path": "../../modules/yargs" 16 | }, 17 | { 18 | "path": "../../modules/builders" 19 | }, 20 | { 21 | "path": "../../modules/git" 22 | }, 23 | { 24 | "path": "../../modules/graph" 25 | }, 26 | { 27 | "path": "../../modules/package-manager" 28 | }, 29 | { 30 | "path": "../../modules/subprocess" 31 | }, 32 | { 33 | "path": "../../modules/file" 34 | }, 35 | { 36 | "path": "../../modules/logger" 37 | }, 38 | { 39 | "path": "../../internal/vitest-config" 40 | }, 41 | { 42 | "path": "../../internal/jest-config" 43 | } 44 | ] 45 | } 46 | -------------------------------------------------------------------------------- /plugins/prettier/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineProject } from '@internal/vitest-config'; 2 | 3 | export default defineProject({}); 4 | -------------------------------------------------------------------------------- /plugins/typescript/.changes/000-swift-words-worry.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: minor 3 | --- 4 | 5 | Officially support Node 22 6 | -------------------------------------------------------------------------------- /plugins/typescript/.changes/001-silly-foxes-marry.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: patch 3 | --- 4 | 5 | Updates build dependency "esbuild". 6 | -------------------------------------------------------------------------------- /plugins/typescript/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # @onerepo/plugin-typescript 2 | 3 | ## 1.0.1 4 | 5 | ### Patch changes 6 | 7 | - Internal formatting changes due to Prettier upgrade. ([f8cb805](https://github.com/paularmstrong/onerepo/commit/f8cb80550ceabdce6ff6c13bf22466a59e694b0f)) 8 | - Type documentation updates for plugin options. ([afbf0a7](https://github.com/paularmstrong/onerepo/commit/afbf0a7980d54960b54a0f27956ce421a9723c92)) 9 | 10 | ### Dependencies updated 11 | 12 | - onerepo@1.2.0 13 | - @onerepo/test-cli@1.0.4 14 | - @onerepo/yargs@1.0.4 15 | - @onerepo/builders@1.0.4 16 | - @onerepo/git@1.1.0 17 | - @onerepo/graph@1.0.4 18 | - @onerepo/package-manager@1.0.4 19 | - @onerepo/subprocess@1.0.4 20 | - @onerepo/file@1.0.4 21 | - @onerepo/logger@1.0.4 22 | 23 | > View the full changelog: [cd94664...9895235](https://github.com/paularmstrong/onerepo/compare/cd9466419b207f690e55f87d0e4632eebdc0ca6a...98952352d3c32adf853657e46e14f12fe1737992) 24 | 25 | ## 1.0.0 26 | 27 | 🎉 Initial stable release! 28 | 29 | _For historical changelogs, please view the [oneRepo source](https://github.com/paularmstrong/onerepo/tree/main/plugins/plugin-typescript)._ 30 | -------------------------------------------------------------------------------- /plugins/typescript/README.md: -------------------------------------------------------------------------------- 1 | ## Installation 2 | 3 | ```sh 4 | npm install --save-dev @onerepo/plugin-typescript 5 | ``` 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /plugins/typescript/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@onerepo/plugin-typescript", 3 | "description": "Official TypeScript plugin for the oneRepo toolchain.", 4 | "title": "TypeScript", 5 | "version": "1.0.1", 6 | "license": "MIT", 7 | "repository": { 8 | "type": "git", 9 | "url": "git://github.com/paularmstrong/onerepo.git", 10 | "directory": "plugins/typescript" 11 | }, 12 | "homepage": "https://onerepo.tools/plugins/typescript", 13 | "type": "module", 14 | "main": "./src/index.ts", 15 | "publishConfig": { 16 | "access": "public", 17 | "main": "./dist/index.js", 18 | "typings": "./dist/src/index.d.ts" 19 | }, 20 | "files": [ 21 | "./dist/**/*", 22 | "./README.md", 23 | "./CHANGELOG.md" 24 | ], 25 | "devDependencies": { 26 | "@internal/tsconfig": "workspace:^", 27 | "@internal/vitest-config": "workspace:^", 28 | "@onerepo/test-cli": "workspace:^", 29 | "onerepo": "workspace:^" 30 | }, 31 | "peerDependencies": { 32 | "onerepo": "^1", 33 | "typescript": "*" 34 | }, 35 | "engines": { 36 | "node": "^18 || ^20 || ^22" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /plugins/typescript/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./src"], 7 | "exclude": ["./**/*.test.ts", "./**/__tests__/*"] 8 | } 9 | -------------------------------------------------------------------------------- /plugins/typescript/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/tsconfig/base.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./**/*"], 7 | "references": [ 8 | { 9 | "path": "../../modules/onerepo" 10 | }, 11 | { 12 | "path": "../../modules/test-cli" 13 | }, 14 | { 15 | "path": "../../modules/yargs" 16 | }, 17 | { 18 | "path": "../../modules/builders" 19 | }, 20 | { 21 | "path": "../../modules/git" 22 | }, 23 | { 24 | "path": "../../modules/graph" 25 | }, 26 | { 27 | "path": "../../modules/package-manager" 28 | }, 29 | { 30 | "path": "../../modules/subprocess" 31 | }, 32 | { 33 | "path": "../../modules/file" 34 | }, 35 | { 36 | "path": "../../modules/logger" 37 | }, 38 | { 39 | "path": "../../internal/vitest-config" 40 | }, 41 | { 42 | "path": "../../internal/jest-config" 43 | } 44 | ] 45 | } 46 | -------------------------------------------------------------------------------- /plugins/typescript/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineProject } from '@internal/vitest-config'; 2 | 3 | export default defineProject({}); 4 | -------------------------------------------------------------------------------- /plugins/vitest/.changes/000-swift-words-worry.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: minor 3 | --- 4 | 5 | Officially support Node 22 6 | -------------------------------------------------------------------------------- /plugins/vitest/.changes/001-silly-foxes-marry.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: patch 3 | --- 4 | 5 | Updates build dependency "esbuild". 6 | -------------------------------------------------------------------------------- /plugins/vitest/.changes/002-silver-stars-talk.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: minor 3 | --- 4 | 5 | Officially supports Vitest v3. 6 | -------------------------------------------------------------------------------- /plugins/vitest/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # @onerepo/plugin-vitest 2 | 3 | ## 1.1.0 4 | 5 | ### Minor changes 6 | 7 | - Supports Vitest ^2.0.0 ([f3d116d](https://github.com/paularmstrong/onerepo/commit/f3d116d4a846c9f21051b01370caec80526ef2c0)) 8 | 9 | ### Patch changes 10 | 11 | - Updated internal/third-party typescript definitions ([e5fb5fa](https://github.com/paularmstrong/onerepo/commit/e5fb5fa0e9fbe6ff18c2d993cb22119a3908df73)) 12 | - Internal formatting changes due to Prettier upgrade. ([f8cb805](https://github.com/paularmstrong/onerepo/commit/f8cb80550ceabdce6ff6c13bf22466a59e694b0f)) 13 | 14 | ### Dependencies updated 15 | 16 | - onerepo@1.2.0 17 | - @onerepo/test-cli@1.0.4 18 | - @onerepo/yargs@1.0.4 19 | - @onerepo/builders@1.0.4 20 | - @onerepo/git@1.1.0 21 | - @onerepo/graph@1.0.4 22 | - @onerepo/package-manager@1.0.4 23 | - @onerepo/subprocess@1.0.4 24 | - @onerepo/file@1.0.4 25 | - @onerepo/logger@1.0.4 26 | 27 | > View the full changelog: [cd94664...9895235](https://github.com/paularmstrong/onerepo/compare/cd9466419b207f690e55f87d0e4632eebdc0ca6a...98952352d3c32adf853657e46e14f12fe1737992) 28 | 29 | ## 1.0.0 30 | 31 | 🎉 Initial stable release! 32 | 33 | _For historical changelogs, please view the [oneRepo source](https://github.com/paularmstrong/onerepo/tree/main/plugins/plugin-vitest)._ 34 | -------------------------------------------------------------------------------- /plugins/vitest/README.md: -------------------------------------------------------------------------------- 1 | ## Installation 2 | 3 | ```sh 4 | npm install --save-dev @onerepo/plugin-vitest 5 | ``` 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /plugins/vitest/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@onerepo/plugin-vitest", 3 | "description": "Official Vitest plugin for the oneRepo toolchain.", 4 | "title": "Vitest", 5 | "version": "1.1.0", 6 | "license": "MIT", 7 | "repository": { 8 | "type": "git", 9 | "url": "git://github.com/paularmstrong/onerepo.git", 10 | "directory": "plugins/vitest" 11 | }, 12 | "homepage": "https://onerepo.tools/plugins/vitest/", 13 | "type": "module", 14 | "main": "./src/index.ts", 15 | "publishConfig": { 16 | "access": "public", 17 | "main": "./dist/index.js", 18 | "typings": "./dist/src/index.d.ts" 19 | }, 20 | "files": [ 21 | "./dist/**/*", 22 | "./README.md", 23 | "./CHANGELOG.md" 24 | ], 25 | "devDependencies": { 26 | "@internal/tsconfig": "workspace:^", 27 | "@internal/vitest-config": "workspace:^", 28 | "@onerepo/test-cli": "workspace:^", 29 | "onerepo": "workspace:^", 30 | "typescript": "^5.7.2" 31 | }, 32 | "peerDependencies": { 33 | "onerepo": "^1", 34 | "vitest": "^0 || ^1 || ^2 || ^3" 35 | }, 36 | "engines": { 37 | "node": "^18 || ^20 || ^22" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /plugins/vitest/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./src"], 7 | "exclude": ["./**/*.test.ts", "./**/__tests__/*"] 8 | } 9 | -------------------------------------------------------------------------------- /plugins/vitest/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/tsconfig/base.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/" 5 | }, 6 | "include": ["./**/*"], 7 | "references": [ 8 | { 9 | "path": "../../modules/onerepo" 10 | }, 11 | { 12 | "path": "../../modules/test-cli" 13 | }, 14 | { 15 | "path": "../../modules/yargs" 16 | }, 17 | { 18 | "path": "../../modules/builders" 19 | }, 20 | { 21 | "path": "../../modules/git" 22 | }, 23 | { 24 | "path": "../../modules/graph" 25 | }, 26 | { 27 | "path": "../../modules/package-manager" 28 | }, 29 | { 30 | "path": "../../modules/subprocess" 31 | }, 32 | { 33 | "path": "../../modules/file" 34 | }, 35 | { 36 | "path": "../../modules/logger" 37 | }, 38 | { 39 | "path": "../../internal/vitest-config" 40 | }, 41 | { 42 | "path": "../../internal/jest-config" 43 | } 44 | ] 45 | } 46 | -------------------------------------------------------------------------------- /plugins/vitest/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineProject } from '@internal/vitest-config'; 2 | 3 | export default defineProject({}); 4 | -------------------------------------------------------------------------------- /prettier.config.cjs: -------------------------------------------------------------------------------- 1 | module.exports = '@internal/prettier-config'; 2 | -------------------------------------------------------------------------------- /vitest.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({}); 4 | -------------------------------------------------------------------------------- /vitest.workspace.ts: -------------------------------------------------------------------------------- 1 | import { defineWorkspace } from 'vitest/config'; 2 | 3 | export default defineWorkspace([ 4 | '/commands/vitest.config.js', 5 | '/modules/*/vitest.config.js', 6 | '/plugins/*/vitest.config.js', 7 | '/internal/*/vitest.config.js', 8 | ]); 9 | --------------------------------------------------------------------------------