Skip to content

Conversation

@jcortes
Copy link
Collaborator

@jcortes jcortes commented Nov 7, 2025

WHY

Resolves #18924

Summary by CodeRabbit

  • New Features

    • Optional Markdown support for Create Document: enable Markdown input to be parsed and converted into Google Docs formatting (headings, bold, italic, lists, inline code).
    • New "Insert Markdown" capability to convert and apply Markdown content to documents.
  • Chores

    • Multiple component/action version bumps; package version updated and markdown-it dependency added.

@jcortes jcortes self-assigned this Nov 7, 2025
@vercel
Copy link

vercel bot commented Nov 7, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
pipedream-docs Ignored Ignored Nov 8, 2025 1:18am
pipedream-docs-redirect-do-not-edit Ignored Ignored Nov 8, 2025 1:18am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 7, 2025

Walkthrough

Adds Markdown support for creating Google Docs: new markdown parser module and app method, a Create Document action useMarkdown option switching insertion to markdown flow, package dependency bump, and multiple metadata version increments.

Changes

Cohort / File(s) Summary
Markdown parsing infrastructure
components/google_docs/common/markdown-parser.mjs
New module exporting parseMarkdown(markdown) and convertToGoogleDocsRequests(parseResult) which produce plain text and Google Docs batchUpdate requests (headings, paragraphs, lists, bold, italic, code).
Create Document action
components/google_docs/actions/create-document/create-document.mjs
Version bumped 0.1.80.2.0. Added public boolean prop useMarkdown and conditional insertion: calls insertMarkdownText(documentId, text) when enabled, otherwise insertText(documentId, { text }).
App integration
components/google_docs/google_docs.app.mjs
Added insertMarkdownText(documentId, markdown) which uses the markdown parser, converts to Google Docs requests, and executes a single batchUpdate when requests exist. New import for markdown-parser.mjs.
Package / dependencies
components/google_docs/package.json
Version bumped 0.5.10.6.0. Added dependency markdown-it: ^14.1.0.
Other action/source version bumps
components/google_docs/actions/*, components/google_docs/sources/*
Multiple files updated only for metadata version increments (minor bumps across append-image, append-text, create-document-from-template, find-document, get-document, get-tab-content, insert-page-break, insert-table, insert-text, replace-image, replace-text, new-document-created, new-or-updated-document).

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CreateDoc as Create Document Action
    participant App as GoogleDocs App
    participant Parser as Markdown Parser
    participant GoogleDocs as Google Docs API

    User->>CreateDoc: create(documentId, text, useMarkdown=true)
    CreateDoc->>App: insertMarkdownText(documentId, text)
    App->>Parser: parseMarkdown(text)
    Parser-->>App: { text, formattingRequests, totalLength }
    App->>Parser: convertToGoogleDocsRequests(parseResult)
    Parser-->>App: [batchUpdate requests]
    App->>GoogleDocs: batchUpdate(requests)
    GoogleDocs-->>App: response
    App-->>CreateDoc: result
    CreateDoc-->>User: completed
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Areas needing extra attention:
    • components/google_docs/common/markdown-parser.mjs — parsing correctness, edge cases, index/offset calculations for formatting ranges.
    • components/google_docs/google_docs.app.mjs — batching logic, error wrapping, and no-op handling when parser returns no requests.
    • components/google_docs/actions/create-document/create-document.mjs — propDefinition and conditional call correctness.
    • Dependency addition in components/google_docs/package.json for compatibility and lockfile implications.

Suggested reviewers

  • michelle0927
  • lcaresia

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description is minimal, containing only a reference to the resolved issue without elaborating on implementation details or changes made. Provide more context about the implementation approach, key changes made (e.g., markdown parser module, new useMarkdown option), and how the feature works.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main feature addition: creating styled Google Docs documents from Markdown.
Linked Issues check ✅ Passed The PR fully implements the requested feature: adds a markdown mode to create-document action that accepts Markdown input and converts it to Google Docs formatted documents with headings, bold, italic, lists support.
Out of Scope Changes check ✅ Passed All changes are within scope: version bumps across related modules to reflect the new markdown feature, markdown parser implementation, and the new useMarkdown option for create-document action.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature-create-styled-google-docs-from-md

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7e81281 and 7d9ba5f.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (17)
  • components/google_docs/actions/append-image/append-image.mjs (1 hunks)
  • components/google_docs/actions/append-text/append-text.mjs (1 hunks)
  • components/google_docs/actions/create-document-from-template/create-document-from-template.mjs (1 hunks)
  • components/google_docs/actions/create-document/create-document.mjs (3 hunks)
  • components/google_docs/actions/find-document/find-document.mjs (1 hunks)
  • components/google_docs/actions/get-document/get-document.mjs (1 hunks)
  • components/google_docs/actions/get-tab-content/get-tab-content.mjs (1 hunks)
  • components/google_docs/actions/insert-page-break/insert-page-break.mjs (1 hunks)
  • components/google_docs/actions/insert-table/insert-table.mjs (1 hunks)
  • components/google_docs/actions/insert-text/insert-text.mjs (1 hunks)
  • components/google_docs/actions/replace-image/replace-image.mjs (1 hunks)
  • components/google_docs/actions/replace-text/replace-text.mjs (1 hunks)
  • components/google_docs/common/markdown-parser.mjs (1 hunks)
  • components/google_docs/google_docs.app.mjs (2 hunks)
  • components/google_docs/package.json (2 hunks)
  • components/google_docs/sources/new-document-created/new-document-created.mjs (1 hunks)
  • components/google_docs/sources/new-or-updated-document/new-or-updated-document.mjs (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (3)
components/google_docs/google_docs.app.mjs (1)
components/google_docs/common/markdown-parser.mjs (2)
  • parseResult (231-234)
  • batchRequests (235-235)
components/google_docs/common/markdown-parser.mjs (1)
components/google_docs/google_docs.app.mjs (6)
  • parseResult (185-185)
  • batchRequests (186-186)
  • request (138-138)
  • request (145-145)
  • request (158-160)
  • request (168-170)
components/google_docs/actions/create-document/create-document.mjs (1)
components/google_docs/google_docs.app.mjs (1)
  • documentId (44-44)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Lint Code Base
  • GitHub Check: pnpm publish
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
🔇 Additional comments (13)
components/google_docs/actions/insert-page-break/insert-page-break.mjs (1)

7-7: Version bump appears isolated from functional changes.

Line 7 contains a metadata-only version increment from 0.0.2 to 0.0.3. The file has no functional changes to logic, control flow, or API signatures. This appears to be part of the broader metadata version increments mentioned in the AI summary.

Can you confirm the versioning strategy? If this version bump is part of a coordinated release or to align with the markdown feature addition, that's fine. However, if this is a side effect of automated tooling or a cascading change, please clarify for consistency.

components/google_docs/sources/new-document-created/new-document-created.mjs (1)

8-8: Verify that the version bump is intentional given no functional changes to this source.

This component has no functional modifications—only a metadata version bump from 0.0.5 to 0.0.6. While the AI summary indicates this aligns with "broader PR changes that increment package/module versions across multiple components," please confirm that this version increment is necessary for this specific source module.

If the version bump is purely for consistency across the package (since Markdown handling is added elsewhere), it may be appropriate. However, if this source module should maintain its existing version because it has no changes, the bump could be rolled back.

components/google_docs/actions/find-document/find-document.mjs (1)

17-17: Version bump approved.

This is a metadata-only patch version increment coordinated with the broader Markdown feature release. No functional changes.

components/google_docs/actions/insert-table/insert-table.mjs (1)

7-7: Version bump approved.

This is a metadata-only patch version increment. No functional changes.

components/google_docs/actions/create-document-from-template/create-document-from-template.mjs (1)

16-16: Version bump approved.

This is a metadata-only patch version increment. No functional changes.

components/google_docs/actions/append-text/append-text.mjs (1)

7-7: Version bump approved.

This is a metadata-only patch version increment. No functional changes.

components/google_docs/actions/append-image/append-image.mjs (1)

7-7: Version bump approved.

This is a metadata-only patch version increment. No functional changes.

components/google_docs/actions/replace-text/replace-text.mjs (1)

7-7: Version bump approved.

This is a metadata-only patch version increment. No functional changes.

components/google_docs/sources/new-or-updated-document/new-or-updated-document.mjs (1)

12-12: Version bump approved.

This is a metadata-only patch version increment. No functional changes.

components/google_docs/actions/get-tab-content/get-tab-content.mjs (1)

7-7: Version bump approved.

This is a metadata-only patch version increment. No functional changes.

components/google_docs/common/markdown-parser.mjs (1)

250-254: Good: Null request filtering implemented.

The code now properly filters out null requests returned by buildFormattingRequest for unknown formatting types. This addresses a concern from previous reviews.

components/google_docs/actions/create-document/create-document.mjs (1)

28-33: Well-documented new feature prop.

The useMarkdown prop is clearly described with appropriate type, label, and description explaining the markdown formatting capability.

components/google_docs/package.json (1)

3-3: No issues found—the markdown-it version is current and secure.

The package.json correctly specifies markdown-it ^14.1.0, which is the latest stable version. The two historical CVEs (HIGH and MODERATE severity from 2022) were patched in v3.0.0 and v12.3.2 respectively, both of which predate the specified version.


Comment @coderabbitai help to get the list of available commands and usage tips.

@jcortes jcortes force-pushed the feature-create-styled-google-docs-from-md branch from 7763a6a to 7e81281 Compare November 7, 2025 22:28
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 9

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7898384 and 7e81281.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (17)
  • components/google_docs/actions/append-image/append-image.mjs (1 hunks)
  • components/google_docs/actions/append-text/append-text.mjs (1 hunks)
  • components/google_docs/actions/create-document-from-template/create-document-from-template.mjs (1 hunks)
  • components/google_docs/actions/create-document/create-document.mjs (3 hunks)
  • components/google_docs/actions/find-document/find-document.mjs (1 hunks)
  • components/google_docs/actions/get-document/get-document.mjs (1 hunks)
  • components/google_docs/actions/get-tab-content/get-tab-content.mjs (1 hunks)
  • components/google_docs/actions/insert-page-break/insert-page-break.mjs (1 hunks)
  • components/google_docs/actions/insert-table/insert-table.mjs (1 hunks)
  • components/google_docs/actions/insert-text/insert-text.mjs (1 hunks)
  • components/google_docs/actions/replace-image/replace-image.mjs (1 hunks)
  • components/google_docs/actions/replace-text/replace-text.mjs (1 hunks)
  • components/google_docs/common/markdown-parser.mjs (1 hunks)
  • components/google_docs/google_docs.app.mjs (2 hunks)
  • components/google_docs/package.json (2 hunks)
  • components/google_docs/sources/new-document-created/new-document-created.mjs (1 hunks)
  • components/google_docs/sources/new-or-updated-document/new-or-updated-document.mjs (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
components/google_docs/common/markdown-parser.mjs (2)
components/google_docs/actions/insert-text/insert-text.mjs (1)
  • text (46-52)
components/google_docs/google_docs.app.mjs (2)
  • parseResult (184-184)
  • batchRequests (185-185)
components/google_docs/google_docs.app.mjs (1)
components/google_docs/common/markdown-parser.mjs (2)
  • parseResult (232-235)
  • batchRequests (236-236)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Lint Code Base
🔇 Additional comments (16)
components/google_docs/actions/get-tab-content/get-tab-content.mjs (1)

7-7: Version bump is intentional and consistent—no action needed.

The script output reveals a systematic, package-wide version maintenance strategy:

  • Four read-only utility actions at v0.0.2 were bumped together to v0.0.3: insert-table, insert-text, insert-page-break, and get-tab-content
  • Five actions at v0.0.9 were bumped to v0.0.10
  • Two actions at v0.1.8 were bumped to v0.1.9
  • create-document received a major bump to v0.2.0 due to new Markdown functionality

This is not an accidental inclusion. The version bump for get-tab-content follows the same pattern as other actions at the same version tier, indicating deliberate, coordinated release maintenance across the package.

components/google_docs/actions/create-document-from-template/create-document-from-template.mjs (1)

16-16: LGTM: Version bump aligns with PR release.

The patch version increment is appropriate for this coordinated release.

components/google_docs/actions/append-image/append-image.mjs (1)

7-7: LGTM: Version bump aligns with PR release.

The patch version increment is appropriate for this coordinated release.

components/google_docs/actions/find-document/find-document.mjs (1)

17-17: LGTM: Version bump aligns with PR release.

The patch version increment is appropriate for this coordinated release.

components/google_docs/actions/append-text/append-text.mjs (1)

7-7: LGTM: Version bump aligns with PR release.

The patch version increment is appropriate for this coordinated release.

components/google_docs/actions/insert-table/insert-table.mjs (1)

7-7: LGTM: Version bump aligns with PR release.

The patch version increment is appropriate for this coordinated release.

components/google_docs/actions/get-document/get-document.mjs (1)

8-8: LGTM: Version bump aligns with PR release.

The patch version increment is appropriate for this coordinated release.

components/google_docs/actions/insert-text/insert-text.mjs (1)

7-7: LGTM: Version bump aligns with PR release.

The patch version increment is appropriate for this coordinated release.

components/google_docs/actions/insert-page-break/insert-page-break.mjs (1)

7-7: LGTM: Version bump aligns with PR release.

The patch version increment is appropriate for this coordinated release.

components/google_docs/actions/replace-image/replace-image.mjs (1)

7-7: Version bump looks good.

This is a metadata-only update consistent with the PR-wide versioning changes.

components/google_docs/sources/new-or-updated-document/new-or-updated-document.mjs (1)

12-12: Version bump is appropriate.

Metadata update aligns with the broader package release.

components/google_docs/sources/new-document-created/new-document-created.mjs (1)

8-8: Version update is consistent.

The version bump aligns with the package-wide version update.

components/google_docs/actions/replace-text/replace-text.mjs (1)

7-7: LGTM: metadata update only.

Version bump is consistent with the release.

components/google_docs/actions/create-document/create-document.mjs (1)

28-33: Good approach: optional feature flag for backward compatibility.

The useMarkdown flag allows users to opt into the new functionality while maintaining backward compatibility with existing workflows.

components/google_docs/common/markdown-parser.mjs (1)

12-18: LGTM: Secure markdown-it configuration.

The parser correctly disables HTML (html: false) to prevent injection attacks, enables line breaks, and disables auto-linking. This configuration is appropriate for converting to Google Docs formatting.

components/google_docs/package.json (1)

18-18: No issues found—markdown-it version is current and secure.

Version 14.1.0 is the latest stable release. The two known security vulnerabilities for markdown-it affect versions < 3.0.0 and < 12.3.2, both of which are significantly older and already patched. The specified version ^14.1.0 is unaffected by these advisories.

@jcortes jcortes force-pushed the feature-create-styled-google-docs-from-md branch from 7e81281 to 7d9ba5f Compare November 8, 2025 01:18
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.

[FEATURE] Create styled google docs documents from markdown

2 participants