Skip to content

Refactor repo to become a monorepo#34

Merged
ben-z merged 10 commits intomainfrom
benz/turborepo
Jun 29, 2025
Merged

Refactor repo to become a monorepo#34
ben-z merged 10 commits intomainfrom
benz/turborepo

Conversation

@ben-z
Copy link
Member

@ben-z ben-z commented Jun 29, 2025

This PR turns the repo into a monorepo using turborepo.

This facilitates adding more projects to this repo, such as an email server.

The current repo is already kinda a monorepo, with a CLI component and an emails component. This PR establishes clear boundaries between projects.

@ben-z ben-z requested a review from Copilot June 29, 2025 04:44
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the repository into a monorepo, adding Turborepo configuration and splitting functionality into workspace packages and apps.

  • Introduce turbo.json and workspace settings in package.json to enable monorepo tasks.
  • Extract shared TypeScript config and utility code into packages/ts-config and packages/utils.
  • Create separate packages/templates and apps/cli for email templates and CLI, updating imports and build scripts accordingly.

Reviewed Changes

Copilot reviewed 18 out of 30 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
turbo.json Add Turborepo schema and task definitions
package.json (root) Mark root as private, add Turborepo scripts & workspaces
packages/ts-config/package.json Define shared tsconfig package
packages/templates/package.json Define email-templates package and scripts
apps/cli/src/index.ts Update template loading to use generated index
packages/templates/scripts/gen-emails-index.js Generate a single TS index for all email templates
apps/cli/.gitignore Ignore CLI build output
.github/workflows/build-and-publish.yml Adjust CLI build/publish steps
Comments suppressed due to low confidence (4)

packages/templates/package.json:2

  • [nitpick] The scope @watonomous is inconsistent with other packages using @repo. Consider renaming to @repo/watcloud-email-templates for consistency across the monorepo.
  "name": "@watonomous/watcloud-email-templates",

.github/workflows/build-and-publish.yml:43

  • The workflow expects build artifacts in apps/cli/out/, but the CLI build appears to emit to dist/. Update the path or adjust the CLI build output directory.
        path: apps/cli/out/

packages/templates/scripts/gen-emails-index.js:17

  • [nitpick] Using require in a generated TypeScript index may cause ESM/CJS interop issues. Consider generating static import statements or using dynamic import() for better compatibility.
    code += `    "${name}": require('./emails/${name}'),\n`;

apps/cli/src/index.ts:13

  • If your templates are ESM modules, the actual export may be under mod.default. Ensure you handle default exports or adjust the index generator to export the raw component directly.
    const mod = Emails[template_name];

@ben-z ben-z requested a review from alexboden June 29, 2025 06:00
@ben-z ben-z mentioned this pull request Jun 29, 2025
@ben-z ben-z merged commit ed94b94 into main Jun 29, 2025
1 check passed
@ben-z ben-z deleted the benz/turborepo branch June 29, 2025 18:20
ben-z added a commit that referenced this pull request Jul 2, 2025
This PR updates README files for the monorepo. Follow-up to #34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants