diff --git a/packages/core/src/repo.ts b/packages/core/src/repo.ts index 4c4d870b..4f2f05dc 100644 --- a/packages/core/src/repo.ts +++ b/packages/core/src/repo.ts @@ -1,4 +1,4 @@ -import { join } from "node:path"; +import { basename, join } from "node:path"; import { isDirectory, isReadableAndWritableDirectory } from "./directory.js"; import { hasPackage, Package, writePackage } from "./package.js"; import { writeReadme } from "./workspace.js"; @@ -35,6 +35,8 @@ export async function createRepo({ await writePackage({ directory, data: { + name: basename(directory), + version: "0.0.0", license, moker: { plugins: [], diff --git a/packages/core/src/yarn.ts b/packages/core/src/yarn.ts index 62d31193..c5878d18 100644 --- a/packages/core/src/yarn.ts +++ b/packages/core/src/yarn.ts @@ -28,6 +28,8 @@ const queues = { }; export async function initYarnExistingRepo({ directory }: DirOption) { + await exec("git", ["init", "--initial-branch", "main"], { cwd: directory }); + await exec("yarn", ["set", "version", "latest"], { cwd: directory }); await initYarn({ directory });