Skip to content

Commit

Permalink
Removed support for Bolt monorepos (#165)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andarist committed Jan 23, 2023
1 parent a01efc9 commit 7b9c4f6
Show file tree
Hide file tree
Showing 13 changed files with 12 additions and 184 deletions.
7 changes: 7 additions & 0 deletions .changeset/loud-cycles-grin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@manypkg/cli": minor
"@manypkg/find-root": major
"@manypkg/get-packages": major
---

Removed support for Bolt monorepos.
11 changes: 0 additions & 11 deletions __fixtures__/bolt-workspace/package.json

This file was deleted.

7 changes: 0 additions & 7 deletions __fixtures__/bolt-workspace/packages/pkg-a/package.json

This file was deleted.

4 changes: 0 additions & 4 deletions __fixtures__/bolt-workspace/packages/pkg-b/package.json

This file was deleted.

2 changes: 1 addition & 1 deletion packages/cli/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Manypkg

Manypkg is a linter for `package.json` files in Yarn, Bolt or pnpm monorepos.
Manypkg is a linter for `package.json` files in Yarn, Lerna, pnpm or Rush monorepos.

## Install

Expand Down
1 change: 0 additions & 1 deletion packages/cli/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export async function writePackage(pkg: Package) {

export async function install(toolType: string, cwd: string) {
const cliRunners: Record<string, string> = {
bolt: "bolt",
lerna: "lerna",
pnpm: "pnpm",
root: "yarn",
Expand Down
2 changes: 1 addition & 1 deletion packages/find-root/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @manypkg/find-root

> Find the root of a monorepo with Yarn workspaces, Bolt or pnpm
> Find the root of a monorepo with Yarn workspaces, Lerna, pnpm or Rush
## Install

Expand Down
9 changes: 1 addition & 8 deletions packages/find-root/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
Tool,
RootTool,
MonorepoRoot,
BoltTool,
LernaTool,
PnpmTool,
RushTool,
Expand All @@ -20,13 +19,7 @@ import {
* monorepo implementations first, with tools based on custom file schemas
* checked last.
*/
const defaultOrder: Tool[] = [
YarnTool,
BoltTool,
PnpmTool,
LernaTool,
RushTool,
];
const defaultOrder: Tool[] = [YarnTool, PnpmTool, LernaTool, RushTool];

const isNoEntryError = (err: unknown): boolean =>
!!err && typeof err === "object" && "code" in err && err.code === "ENOENT";
Expand Down
6 changes: 2 additions & 4 deletions packages/get-packages/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
# @manypkg/get-packages

> A simple utility to get the packages from a monorepo, whether they're using Yarn, Bolt or pnpm
> A simple utility to get the packages from a monorepo, whether they're using Yarn, Lerna, pnpm or Rush
This library exports `getPackages` and `getPackagesSync`. It is intended mostly for use of developers building tools that want to support different kinds of monorepos as an easy way to write tools without having to write tool-specific code. It supports Yarn, Bolt, pnpm and single-package repos(where the only package is the the same as the root package). This library uses `@manypkg/find-root` to search up from the directory that's passed to `getPackages` or `getPackagesSync` to find the project root.
This library exports `getPackages` and `getPackagesSync`. It is intended mostly for use of developers building tools that want to support different kinds of monorepos as an easy way to write tools without having to write tool-specific code. It supports Yarn, Lerna, pnpm, Rush and single-package repos(where the only package is the the same as the root package). This library uses `@manypkg/find-root` to search up from the directory that's passed to `getPackages` or `getPackagesSync` to find the project root.

```typescript
import { getPackages, getPackagesSync } from "@manypkg/get-packages";

const { tool, root, packages } = await getPackages(process.cwd());
const { tool, root, packages } = getPackagesSync(process.cwd());

type Tool = "yarn" | "bolt" | "pnpm" | "root";

type Package = { packageJson: PackageJSON; dir: string };

type Packages = {
Expand Down
16 changes: 0 additions & 16 deletions packages/get-packages/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,6 @@ let runTests = (getPackages: GetPackages) => {
expect(allPackages.tool.type).toEqual("yarn");
});

it("should resolve workspaces for bolt", async () => {
const allPackages = await getPackages(f.copy("bolt-workspace"));

if (allPackages.packages === null) {
return expect(allPackages.packages).not.toBeNull();
}

expect(allPackages.packages[0].packageJson.name).toEqual(
"bolt-workspace-pkg-a"
);
expect(allPackages.packages[1].packageJson.name).toEqual(
"bolt-workspace-pkg-b"
);
expect(allPackages.tool.type).toEqual("bolt");
});

it("should resolve workspaces for pnpm", async () => {
const allPackages = await getPackages(f.copy("pnpm-workspace-base"));

Expand Down
4 changes: 0 additions & 4 deletions packages/get-packages/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
// This is a modified version of the package-getting in bolt
// It supports yarn workspaces as well, and can fall back through
// several options

import path from "path";
import { findRoot, findRootSync } from "@manypkg/find-root";
import { Packages, MonorepoRoot } from "@manypkg/tools";
Expand Down
126 changes: 0 additions & 126 deletions packages/tools/src/BoltTool.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/tools/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export * from "./Tool";
export { BoltTool } from "./BoltTool";
export { LernaTool } from "./LernaTool";
export { PnpmTool } from "./PnpmTool";
export { RootTool } from "./RootTool";
Expand Down

0 comments on commit 7b9c4f6

Please sign in to comment.