mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
fix pnpm workspace
This commit is contained in:
5
.changeset/slimy-pots-grab.md
Normal file
5
.changeset/slimy-pots-grab.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"create-better-t-stack": patch
|
||||
---
|
||||
|
||||
fix pnpm workspace
|
||||
@@ -1,7 +1,8 @@
|
||||
import path from "node:path";
|
||||
import { $ } from "execa";
|
||||
import fs from "fs-extra";
|
||||
import type { ProjectConfig, ProjectDatabase, ProjectOrm } from "../types";
|
||||
import { PKG_ROOT } from "../constants";
|
||||
import type { ProjectConfig } from "../types";
|
||||
|
||||
export async function updatePackageConfigurations(
|
||||
projectDir: string,
|
||||
@@ -30,6 +31,18 @@ async function updateRootPackageJson(
|
||||
}
|
||||
|
||||
await fs.writeJson(rootPackageJsonPath, packageJson, { spaces: 2 });
|
||||
|
||||
if (options.packageManager === "pnpm") {
|
||||
const pnpmWorkspaceTemplatePath = path.join(
|
||||
PKG_ROOT,
|
||||
"template/with-pnpm/pnpm-workspace.yaml",
|
||||
);
|
||||
const targetWorkspacePath = path.join(projectDir, "pnpm-workspace.yaml");
|
||||
|
||||
if (await fs.pathExists(pnpmWorkspaceTemplatePath)) {
|
||||
await fs.copy(pnpmWorkspaceTemplatePath, targetWorkspacePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
2
apps/cli/template/with-pnpm/pnpm-workspace.yaml
Normal file
2
apps/cli/template/with-pnpm/pnpm-workspace.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
packages:
|
||||
- "packages/*"
|
||||
Reference in New Issue
Block a user