Skip to content

Port sanity-plugin-google-translate to monorepo#906

Draft
Copilot wants to merge 79 commits into
mainfrom
copilot/move-google-translate-plugin
Draft

Port sanity-plugin-google-translate to monorepo#906
Copilot wants to merge 79 commits into
mainfrom
copilot/move-google-translate-plugin

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 27, 2026

Migrates sanity-plugin-google-translate into the plugins monorepo using git subtree to preserve commit history. Also includes the generator fix from #905 (CJS format for Node.js 24 compatibility) since the generator was broken without it.

Changes

  • Git subtree import from sanity-io/sanity-plugin-google-translate main branch with full history
  • Monorepo scaffold: package.json (ESM-only, catalog deps), tsconfig, vitest, package.config.ts with React Compiler + styled-components babel plugin
  • Test studio integration: workspace dependency, #google-translate example plugin in sanity.config.ts
  • Knip workspace entry with babel-plugin-styled-components in ignoreDependencies
  • Changeset for major version bump (React 19.2+, Sanity v5+, ESM-only, Node 20.19+)
  • Generator fix (from feat: fold sanity-plugin-latex-input into monorepo #905): tsdown.config.mts outputs CJS, config.ts imports .cjs extension
  • Cleanup: Removed standalone repo config files not needed in the monorepo (.github/, .husky/, .editorconfig, .eslintignore, .eslintrc, .gitignore, .npmignore, .prettierignore, .prettierrc, .releaserc.json)

Breaking changes in the new major

  • ESM-only (CJS dropped)
  • React 19.2+, Sanity v5+, Node.js 20.19+
  • React Compiler enabled (target: 19)
  • styled-components ^6.1 peer dependency retained

Notes

  • @sanity/icons kept at ^3.7.4 (not in workspace catalog)
  • isolatedDeclarations disabled in tsconfig.build.json (can be enabled later)
  • Trusted publishing needs to be configured: npm trust github sanity-plugin-google-translate --file=release.yml --repository=sanity-io/plugins

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 27, 2026

@copilot resolve the merge conflicts in this pull request

Merge conflicts resolved in commit 199a0e8. The conflicts were in knip.jsonc (kept both google-translate and latex-input workspace entries) and pnpm-lock.yaml (regenerated after merge).

These files came from the subtree import but are not needed in the monorepo.
@pedrobonamin
Copy link
Copy Markdown
Contributor

@copilot you are moving over some config files that are not necessary in this monorepo setup, please verify and remove all the unnecessary ones

These files came from the subtree import but are handled at the monorepo
root level or are no longer needed:
- .editorconfig, .eslintignore, .eslintrc, .prettierignore, .prettierrc (root-level)
- .gitignore (root-level)
- .npmignore (not needed with @sanity/pkg-utils)
- .releaserc.json (using changesets, not semantic-release)
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 27, 2026

@copilot you are moving over some config files that are not necessary in this monorepo setup, please verify and remove all the unnecessary ones

Removed in 25fc5d6. Deleted .editorconfig, .eslintignore, .eslintrc, .gitignore, .npmignore, .prettierignore, .prettierrc, and .releaserc.json — all handled at root level or no longer needed (changesets replaces semantic-release, @sanity/pkg-utils replaces .npmignore).

Comment thread plugins/sanity-plugin-google-translate/README.md Outdated
@pedrobonamin
Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 27, 2026

@copilot add an example in where we use the plugin see the readme here https://github.com/sanity-io/plugins/pull/906/changes#diff-fd02b2584732a3a696692c7a6aefd6e329b7eaf90d179904476dddd7944e02fbR42-R7...

Added in 129abd2. The example now includes a localizedString object type with options.translate = true and a googleTranslateTest document type that uses it, following the pattern from the README.

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.

8 participants