Skip to content

Update/docs/insights and reorganize #1514

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

Merged
merged 3 commits into from
Apr 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion apps/docs/codemod-registry/introduction.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: 'Codemod Regisry'
icon: 'share-nodes'
---

[Codemod Registry](https://codemod.com/registry) is a centralized hub for discovering and sharing codemods, making them easily accessible to open-source communities and teams of any size.
Expand Down
20 changes: 10 additions & 10 deletions apps/docs/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,18 @@
"group": "Quickstart",
"pages": [
"introduction",
"platform/build",
"platform/share",
"platform/run"
"platform/plan",
"platform/automate",
"platform/orchestrate",
"platform/track"
]
},
{
"group": "Codemod Platform",
"pages": [
"scanner",
"codemod-studio",
"codemod-registry/introduction"
]
"pages": ["scanner", "migrations", "insights", "codemod-studio"]
},
{
"group": "Legacy Guides",
"group": "OSS & Community",
"pages": [
{
"group": "Building codemods",
Expand All @@ -53,7 +50,10 @@
},
{
"group": "Sharing codemods",
"pages": ["sharing/publishing-codemods"]
"pages": [
"codemod-registry/introduction",
"sharing/publishing-codemods"
]
}
]
},
Expand Down
Binary file added apps/docs/images/campaigns/campaigns.mp4
Binary file not shown.
Binary file added apps/docs/images/campaigns/migrations.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/docs/images/campaigns/running-migration.mp4
Binary file not shown.
Binary file added apps/docs/images/insights/create-dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/docs/images/insights/create-widget.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/docs/images/insights/insights-demo.mp4
Binary file not shown.
Binary file added apps/docs/images/insights/query-formula.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/docs/images/insights/setting-up-widget.mp4
Binary file not shown.
79 changes: 79 additions & 0 deletions apps/docs/insights.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---
title: 'Insights'
icon: 'chart-simple'
---

In large codebases, tracking migrations, old/new APIs, security anti-patterns, and trends can be incredibly useful. Engineers and engineering leaders in progressive software teams can stay on top of these changes using **Codemod Insights**.

With Codemod Insights, you can generate customized dashboards and widgets that provide helpful insights about your code's posture. This way, you can make informed decisions and track code changes that scale over time.


<Frame>
<iframe
className="w-full aspect-video"
src="https://player.mux.com/NKwErby4jzks00O8801ihJgcMhq5dvlZ8xbIlam2xoqe8?metadata-video-title=Codemod+Insights+Demo"
title="Codemod Insights Demo"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen
></iframe>
</Frame>

## Using Codemod Insights

<Steps>
<Step title="Create a dashboard">
Dashboards help you keep your insights' widgets organized.

For example, you can create a dashboard called `i18n migration` to organize all widgets related to your i18n migration.

To create a new dashboard, go to `Insights -> Create Dashboard`.

<Frame>
![Creating a new dashboard](/images/insights/create-dashboard.png)
</Frame>
</Step>
<Step title="Create a widget">
Once you're in your new dashboard, you can create a new widget.

Widgets help you get useful insights about a variety of patterns in your codebase.

Currently, you can create `Timeseries chart`, `Single number`, or `Table` widgets.

<Frame>
![Creating a new widget](/images/insights/create-widget.png)
</Frame>
</Step>
<Step title="Setting up your widget">
Widgets allow you to track and visualize insights by running queries over your codebase. Each query represents an [`ast-grep` YAML rule](https://ast-grep.github.io/reference/yaml.html) that is applied to your repository.

Start by specifying a code pattern you would like to track and visualize. You can generate ast-grep rules with the help of AI [using Codemod Studio](/codemod-studio#using-codemod-ai).

For each quer, you can specify:
- `ast-grep` rule ([generate rules easily with codemod studio](/codemod-studio#using-codemod-ai))
- match type, can be occurrence counts or file counts
- target repository
- query label
- group options
- date/commit hash (for Single number and Table widgets)

<Frame>
<video
autoPlay
muted
loop
playsInline
className="w-full"
src="/images/insights/setting-up-widget.mp4"
></video>
</Frame>

<Tip>
When configuring widgets, you can add multiple queries to extend the information a widget provides. Additionally, you can aggregate the results of multiple queries by specifying a formula. To refer to a query's value in a formula, use the query's name (alphabetical order index).

<Frame>
![Writing formulas](/images/insights/query-formula.png)
</Frame>
</Tip>
</Step>
</Steps>
31 changes: 19 additions & 12 deletions apps/docs/introduction.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
---
title: Overview
description: 'Build, share, and run codemods faster and easier.'
---

<img
src="/images/intro/codemod-platform-architecture.png"
alt="Codemod platform architecture"
/>
<Frame>
<img
src="/images/intro/codemod-docs-hero-light.jpg"
alt="Codemod platform architecture"
className="block dark:hidden"
/>
<img
src="/images/intro/codemod-docs-hero-dark.jpg"
alt="Codemod platform architecture"
className="hidden dark:block"
/>
</Frame>

Codemod platform helps you create, distribute, and run codemods in codebases of any size.

Expand All @@ -19,16 +26,16 @@ We are making dream migrations a reality for all developers in the world, one fr
Take the first step towards modernizing your codebase.

<CardGroup cols={2}>
<Card title="Build" icon="screwdriver-wrench" href="/platform/build">
<Card title="Plan" icon="notebook" href="/platform/plan">
Build your own codemods, with the help of AI.
</Card>
<Card title="Share" icon="share-nodes" href="/platform/share">
Share your codemods with the world.
<Card title="Automate" icon="robot" href="/platform/automate">
Put migrations, code search, and insights on autopilot.
</Card>
<Card title="Run" icon="terminal" href="/platform/run">
Run your or community-made codemods over your projects.
<Card title="Orchestrate" icon="users-rays" href="/platform/orchestrate">
Orchestrate & manage large-scale code migration campaigns.
</Card>
<Card title="Manage (Enterprise)" icon="rocket" href="https://codemod.com/contact">
Manage large-scale code migrations across many teams.
<Card title="Track" icon="chart-line-up-down" href="/platform/track">
This helps you stay on top of code changes that scale over time.
</Card>
</CardGroup>
27 changes: 27 additions & 0 deletions apps/docs/migrations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,30 @@
title: 'Migrations'
icon: 'arrow-up-right-dots'
---

Migration campaigns allow progressive software teams to orchestrate large-scale and incremental code migrations.

By using Codemod during migrations, you get access to runbooks, automations, and a developer experience that drastically increases migration success potential and reduces the spent migration effort & time.

<Frame>
![Migrations dashboard](/images/campaigns/migrations.png)
</Frame>

<Info>
Migration Campaigns is a feature designed for enterprise engingeering teams. To start a new migration campaign, simply [get in touch with us](https://go.codemod.com/contact) and we'll add the requested migration to your dashboard.
</Info>

## Starting migration campaigns

Codemod's free-tier allows you to test internationalization (i18n) campaigns. To use Codemod for other migrations and/or get access to the [pro tier](https://codemod.com/pricing), please [contact us](https://go.codemod.com/contact).

<Frame>
<video
autoPlay
muted
loop
playsInline
className="w-full"
src="/images/campaigns/running-migration.mp4"
></video>
</Frame>
15 changes: 15 additions & 0 deletions apps/docs/platform/automate.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: Automate Migrations
sidebarTitle: "Automate"
---

Codemod platform provides a developer experience that significantly reduces the friction of automating code migrations.

With Codemod platform, you can put code migrations on autopilot with AI-powered [ast-grep](https://ast-grep.github.io/) rules.

## Start automating migrations
<Card title="Codemod Studio ->" icon="wrench" href="/codemod-studio">
Get started with building codemods using Codemod Studio.
</Card>

<Info>The [legacy jscodeshift studio](https://codemod.com/studio-jscodeshift) has been deprecated in favor of our new [Codemod Studio powered by ast-grep](https://go.codemod.com/studio). If you would like to build legacy jscodeshift codemods, please refer to the [building legacy codemods docs](/building-codemods/package-requirements).</Info>
15 changes: 15 additions & 0 deletions apps/docs/platform/orchestrate.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: Orchestrate Migrations
sidebarTitle: "Orchestrate"
---

Code migrations are often an incremental process that grows in complexity over time. By using Migration Campaigns, Codemod provides the required tooling to help teams navigate large-scale migration complexities.

## Start automating migrations
<Card
title="Migration Campaigns"
icon="route"
href="/migrations"
>
Orchestrate large-scale migration campaigns.
</Card>
28 changes: 28 additions & 0 deletions apps/docs/platform/plan.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
title: Plan Migrations
sidebarTitle: "Plan"
---

Codemod allows you to confidently plan and execute large-scale code migrations by providing essential tooling to:
1. [Identify migration opportunities](/scanner): Discover areas such as dependency upgrades, security patches, internationalization migrations, and more.
2. [Gain actionable insights into your codebase's state](/insights): Enable engineers and technical leaders to make informed decisions and continuously plan future migrations.


## Get started with migration planning

<CardGroup>
<Card
title="Opportunity Finder"
icon="magnifying-glass"
href="/scanner"
>
Uncover and measure high-impact migration opportunities.
</Card>
<Card
title="Insights"
icon="chart-simple"
href="/insights"
>
Get helpful insights to confidently find & plan future migrations.
</Card>
</CardGroup>
2 changes: 1 addition & 1 deletion apps/docs/platform/share.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Sharing Codemods
sidebarTitle: "Share"
sidebarTitle: "Distribute"
---

To streamline distributing and collaborating on your codemods, Codemod platform allows you to easily share codemods with friends, team members, the open-source community.
Expand Down
15 changes: 15 additions & 0 deletions apps/docs/platform/track.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: Track Migrations & Code Posture
sidebarTitle: "Track"
---

Codemod allows you to continuously track and get detailed insights about your code posture. This helps you stay on top of code migrations, security posture, unwanted code patterns and more changes that scale over time.

## Start automating migrations
<Card
title="Insights"
icon="chart-simple"
href="/insights"
>
Get helpful insights to confidently find & plan future migrations.
</Card>
2 changes: 1 addition & 1 deletion apps/docs/scanner.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: 'Migration Scanner'
title: 'Opportunity Finder'
icon: 'magnifying-glass'
---

Expand Down
Loading