feat(init): generate bunfig.toml with Gitea scoped registry + fix versions

- init workspace now generates bunfig.toml pointing @uncaged scope to Gitea
- Fix template versions: "*" → "^0.3.1" (packages are now published)
This commit is contained in:
2026-05-12 11:31:41 +08:00
parent 05fbd4f5b5
commit bbb79f821e
2 changed files with 9 additions and 2 deletions
@@ -6,7 +6,7 @@ export function templatePackageJson(templateName: string): string {
private: true, private: true,
type: "module", type: "module",
dependencies: { dependencies: {
"@uncaged/workflow-runtime": "*", "@uncaged/workflow-runtime": "^0.3.1",
zod: "^4.0.0", zod: "^4.0.0",
}, },
}, },
@@ -28,7 +28,7 @@ function workflowsPackageJson(): string {
private: true, private: true,
type: "module", type: "module",
dependencies: { dependencies: {
"@uncaged/workflow-runtime": "*", "@uncaged/workflow-runtime": "^0.3.1",
zod: "^4.0.0", zod: "^4.0.0",
}, },
}, },
@@ -157,6 +157,12 @@ uncaged-workflow add <name> <path/to/bundle.esm.js>
`; `;
} }
function bunfigToml(): string {
return `[install.scopes]
"@uncaged" = "https://git.shazhou.work/api/packages/shazhou/npm/"
`;
}
function readmeMd(workspaceName: string): string { function readmeMd(workspaceName: string): string {
return `# ${workspaceName} return `# ${workspaceName}
@@ -210,6 +216,7 @@ export async function cmdInitWorkspace(
writeFile(join(rootPath, "README.md"), readmeMd(workspaceName), "utf8"), writeFile(join(rootPath, "README.md"), readmeMd(workspaceName), "utf8"),
writeFile(join(rootPath, "templates", ".gitkeep"), "", "utf8"), writeFile(join(rootPath, "templates", ".gitkeep"), "", "utf8"),
writeFile(join(rootPath, "workflows", "package.json"), workflowsPackageJson(), "utf8"), writeFile(join(rootPath, "workflows", "package.json"), workflowsPackageJson(), "utf8"),
writeFile(join(rootPath, "bunfig.toml"), bunfigToml(), "utf8"),
]); ]);
return ok({ rootPath }); return ok({ rootPath });