MCPcopy Index your code
hub / github.com/vercel/next-forge / updateWorkspaceConfiguration

Function updateWorkspaceConfiguration

scripts/initialize.ts:115–134  ·  view source on GitHub ↗
(
  projectDir: string,
  packageManager: PackageManagerName
)

Source from the content-addressed store, hash-verified

113};
114
115const updateWorkspaceConfiguration = async (
116 projectDir: string,
117 packageManager: PackageManagerName
118) => {
119 const packageJsonPath = join(projectDir, "package.json");
120 const packageJsonFile = await readFile(packageJsonPath, "utf8");
121 const packageJson = JSON.parse(packageJsonFile);
122
123 if (packageManager === "pnpm") {
124 packageJson.workspaces = undefined;
125 const pnpmWorkspace = "packages:\n - 'apps/*'\n - 'packages/*'\n";
126 await writeFile(join(projectDir, "pnpm-workspace.yaml"), pnpmWorkspace);
127 }
128
129 const newPackageJson = JSON.stringify(packageJson, null, 2);
130
131 await writeFile(packageJsonPath, `${newPackageJson}\n`);
132
133 await rm("bun.lock", { force: true });
134};
135
136const updateInternalPackageDependencies = async (path: string) => {
137 const pkgJsonFile = await readFile(path, "utf8");

Callers 1

initializeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected