Skip to content

feat(sync): support packages living in a monorepo - #5

Merged
Julien-R44 merged 3 commits into
adonisjs-community:mainfrom
DavideCarvalho:monorepo-directory
Oct 21, 2026
Merged

Julien-R44 merged 3 commits into
adonisjs-community:mainfrom
DavideCarvalho:monorepo-directory

Conversation

@DavideCarvalho

@DavideCarvalho DavideCarvalho commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

sync always reads npm and description from the package.json at the repository root. For a package living in a monorepo, that root package.json belongs to the workspace and not to the published package.

8 packages in the registry live in a monorepo:

  • the 5 FriendsOfAdonis packages;
  • react-adonisjs, radonis and tuyau.

They only show the right npm name today because they were migrated as-is and sync never ran on them. As soon as someone edits one, the Sync Check rewrites the name to the workspace root and fails. For example:

Package npm in the file npm written by sync on main
foadonis-graphql @foadonis/graphql friends-of-adonis
react-adonisjs @matstack/react-adonisjs @matstack/react-adonisjs-monorepo
radonis @microeinhundert/radonis radonis-monorepo
tuyau @tuyau/client @tuyau/monorepo

Changes

1. feat(sync): adds an optional directory field, the folder of the package inside the repository. When it is set, sync reads <directory>/package.json. Nothing changes for packages without it.

name: foadonis-graphql
repo: FriendsOfAdonis/FriendsOfAdonis
directory: packages/graphql

2. fix: sets directory on those 8 packages and re-runs pnpm sync on them. The diff is what sync produces:

  • npm is unchanged, except for tuyau, which now points to @tuyau/core. @tuyau/client is no longer in the repository and stopped at 0.2.10, while Tuyau v1 ships @tuyau/core.
  • description now comes from each package's own package.json.
  • github and maintainers are added. The migrated files didn't have them.
  • The tuyau website follows its redirect to https://docs.adonisjs.com/guides/frontend/api-client.

I checked it locally:

  • running pnpm sync again on the 8 packages changes nothing, so the Sync Check passes;
  • pnpm check passes.

I need this to list the Agora libraries, which are all monorepos. That PR is stacked on this one.

🤖 Generated with Claude Code

DavideCarvalho and others added 2 commits October 21, 2026 16:50
Add an optional `directory` field. When set, sync reads `npm` and
`description` from <directory>/package.json instead of the repository
root.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FriendsOfAdonis (5 packages), react-adonisjs, radonis and tuyau publish
their package from a sub-folder. Without `directory`, sync rewrote
their npm name to the workspace root (e.g. friends-of-adonis).

tuyau now points to @tuyau/core: @tuyau/client is no longer in the
repository and stopped at 0.2.10.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Julien-R44

Copy link
Copy Markdown
Member

Thanks mate

@Julien-R44
Julien-R44 merged commit d4befe7 into adonisjs-community:main Oct 21, 2026
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