Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: split into monorepo with separate packages #1314

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

JoshuaKGoldberg
Copy link
Owner

@JoshuaKGoldberg JoshuaKGoldberg commented Sep 12, 2023

PR Checklist

Overview

Splits the large general-purpose TypeStat package into two:

  • ts-enhance: Improves a project's TypeScript code by creating and improving types. 💗
  • ts-initialize: Converts a project from JavaScript to TypeScript in as few changes as possible. 💝

It additionally publishes a typestat-utils package for shared code.

Generally onboards to create-typescript-app too. I figured this was a good time to do it, and test out what a monorepo with CTA would look like.

Checklist to un-draft:

  • Figuring out package naming
  • Splitting out package responsibilities
  • Finalize setting up workspace tasks and TSConfig project references
  • Passing build
  • Some passing tests
  • Figuring out monorepo/repository naming
  • Resolved created TODOs (especially around shared utils)
  • All passing tests
  • Trying it out as a package
  • Discovered issues from ☝️
  • One final docs + proofreading push

JoshuaKGoldberg added a commit that referenced this pull request Mar 25, 2024
## PR Checklist

-   [x] Addresses an existing issue: fixes #1318
- [x] That issue was marked as [`status: accepting
prs`](https://github.com/JoshuaKGoldberg/TypeStat/labels/status%3A%20accepting%20prs)

## Overview

In preparation for a full monorepo migration and rename (#1314), this
migrates as-is to `create-typescript-app`. That way I can get all these
rote changes (more linting, tabs, etc.) out of the way before making the
big jump to a monorepo & separate packages.

As part of this, adds a fix for pnpm's `node_modules/` symlink
resolution: 1e989a7

Replaces the `mz` runtime dependency with `node:fs` and
`node:fs/promises` uses.

💖
@JoshuaKGoldberg
Copy link
Owner Author

I'm going to work on turning https://github.com/JoshuaKGoldberg/emoji-blast into a monorepo (JoshuaKGoldberg/emoji-blast#172 -> JoshuaKGoldberg/emoji-blast#206) first to try out the tooling in that repository first. Then once that's done and stable, I'll take its learnings here.

@JoshuaKGoldberg JoshuaKGoldberg added the status: waiting for author Needs an action taken by the original poster label Dec 1, 2024
@JoshuaKGoldberg
Copy link
Owner Author

This is second in line for monorepo conversion. https://github.com/JoshuaKGoldberg/create is first in line and WIP.

@rubiesonthesky
Copy link
Collaborator

I have looked little bit into this new structure and I think it's improvement. It makes it more clear what goes with what than current structure.

Only "worry" that I have is, that the typestat-utils package won't have much content. I think in some places it would make more sense to not use some of those helper methods like pluralize, isNotUndefined (this could be replaces with .filter(x => !!x) in newer typescript)) etc.

So maybe the utils package would be more like cli package? So it would contain all things for printing to console, prompting etc? Not sure how viable that is but I kinda would like to see separation from the "business" logic and from the CLI logic in the packages. That would make some testing easier and maybe allow using these tools programmatically :)

I know that you probably want to use this repo as a testing ground for the monorepo migration, but I think that the new file structure that you have here, could be beneficial even before actually creating the monorepo. What I mean is, that the files could be moved under those package name directions how you plan them to be. And then later the whole project could be turned into monorepo.

However, it's exciting to see how you do this change with the tool!

@rubiesonthesky
Copy link
Collaborator

I think tsconfig.tsbuildinfo should be added to .gitignore :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting for author Needs an action taken by the original poster
Projects
None yet
2 participants