|
1 | 1 | <picture> |
2 | 2 | <source media="(prefers-color-scheme: dark)" srcset="https://github.com/hypermod-io/hypermod-community/assets/3030010/f4ec415a-b320-4949-b352-0be9b1666f97"> |
3 | 3 | <source media="(prefers-color-scheme: light)" srcset="https://github.com/hypermod-io/hypermod-community/assets/3030010/9deed89f-1b24-4914-8007-74551abf40b2"> |
4 | | - <img alt="Hypermod – App repository banner" src="https://github.com/hypermod-io/hypermod-community/assets/3030010/9deed89f-1b24-4914-8007-74551abf40b2"> |
| 4 | + <img alt="Hypermod Community banner" src="https://github.com/hypermod-io/hypermod-community/assets/3030010/9deed89f-1b24-4914-8007-74551abf40b2"> |
5 | 5 | </picture> |
6 | 6 |
|
7 | 7 | # Hypermod Community |
8 | 8 |
|
9 | | -**Formerly: CodeshiftCommunity** |
| 9 | +Hypermod Community is the open-source codemod registry and CLI ecosystem for [Hypermod.io](https://www.hypermod.io/). |
| 10 | +Use this repository to discover, author, test, publish, and contribute codemods; use Hypermod.io to explore codemods, learn migration workflows, and promote safer package upgrades at scale. |
10 | 11 |
|
11 | | -The community-owned global registry and documentation hub for codemods. Providing library maintainers & users with facilities to help write, test, publish and consume codemods in a structured, standardized and familiar way. |
| 12 | +[Explore Hypermod.io](https://www.hypermod.io/) • |
| 13 | +[Browse codemods](https://www.hypermod.io/explore) • |
| 14 | +[Read the docs](https://www.hypermod.io/docs) • |
| 15 | +[Join Discord](https://discord.gg/XGqmKNZ8Rk) |
12 | 16 |
|
13 | | -[💬 Join our community on Discord](https://discord.gg/XGqmKNZ8Rk) |
| 17 | +## Why this project exists |
14 | 18 |
|
15 | | -## Features |
| 19 | +Upgrading dependencies is expensive when maintainers only ship changelogs and users are left to translate breaking changes by hand. |
| 20 | +Hypermod helps library maintainers, platform teams, design-system teams, and migration owners turn breaking API changes into repeatable codemods that can be shared with the wider ecosystem and used by agents. |
16 | 21 |
|
17 | | -🔭 Explore an extensive list of codemods [contributed by the community](https://www.hypermod.io/explore). |
| 22 | +This repository is the community-facing home for that workflow: |
18 | 23 |
|
19 | | -🧠 Up-skill your engineering team using our [guides & resources](https://www.hypermod.io/docs/guides/your-first-codemod). |
| 24 | +- **Community codemod registry** for versioned and reusable codemods. |
| 25 | +- **CLI packages** for running codemods locally, from npm, or from Hypermod.io-hosted sources. |
| 26 | +- **Authoring utilities** for creating, validating, and testing codemod packages. |
| 27 | +- **Examples and templates** that make it easier to ship migrations users can actually adopt. |
20 | 28 |
|
21 | | -🎨 Perfect for [Design Systems & Monorepos](https://www.hypermod.io/docs/local-development/monorepos). |
| 29 | +## How Hypermod Community and Hypermod.io fit together |
22 | 30 |
|
23 | | -## Registry |
| 31 | +- **Hypermod.io** is the orchestration and discovery layer: explore codemods, generate codemods, deploy migrations across repositories, and access hosted Hypermod experiences. |
| 32 | +- **`@hypermod/cli`** is the command-line entry point for running codemods in local projects, from npm packages, and from Hypermod.io-powered sources. |
| 33 | +- **This repository** is the open-source registry, package monorepo, and contribution surface behind the ecosystem. |
24 | 34 |
|
25 | | -[The registry](https://www.hypermod.io/explore) contains all community-contributed codemods, hosted and published directly from the Hypermod Platform. |
| 35 | +## Get started with the CLI |
26 | 36 |
|
27 | | -## CLI |
| 37 | +We recommend using the CLI with `npx` so you always run the latest version: |
28 | 38 |
|
29 | | -Downloading and running codemods as well as initialising and maintaining codemod packages can all be done via the Hypermod CLI (`@hypermod/cli`). |
| 39 | +```bash |
| 40 | +npx @hypermod/cli --packages react@18.0.0 ./src |
| 41 | +``` |
30 | 42 |
|
31 | | -[Please see the docs for more information and examples](https://www.hypermod.io/docs/tools/cli) |
| 43 | +You can also install it globally: |
32 | 44 |
|
33 | | -We recommend running the CLI with `$ npx` to ensure you always have the latest version. |
| 45 | +```bash |
| 46 | +npm install -g @hypermod/cli |
| 47 | +# or |
| 48 | +yarn global add @hypermod/cli |
| 49 | +``` |
34 | 50 |
|
35 | | -`$ npx @hypermod/cli --packages mylib@1.0.0 /project/src` |
| 51 | +Then run it with either binary: |
36 | 52 |
|
37 | | -But it can also be installed globally: |
| 53 | +```bash |
| 54 | +hypermod --help |
| 55 | +# or |
| 56 | +hypermod-cli --help |
| 57 | +``` |
38 | 58 |
|
39 | | -`$ npm install -g @hypermod/cli or yarn global add @hypermod/cli` |
| 59 | +### Common usage examples |
40 | 60 |
|
41 | | -and run with: |
| 61 | +#### Run a package migration from npm/community codemods |
42 | 62 |
|
43 | | -`$ hypermod or $ hypermod-cli` |
| 63 | +```bash |
| 64 | +npx @hypermod/cli --packages @atlaskit/button@3.0.0 ./src |
| 65 | +``` |
| 66 | + |
| 67 | +#### Run all transforms from a version to latest |
| 68 | + |
| 69 | +```bash |
| 70 | +npx @hypermod/cli --sequence --packages @mylib/button@3.0.0 ./src |
| 71 | +``` |
| 72 | + |
| 73 | +#### Run a preset |
| 74 | + |
| 75 | +```bash |
| 76 | +npx @hypermod/cli --packages @mylib/button#remove-deprecated-props ./src |
| 77 | +``` |
| 78 | + |
| 79 | +#### Run a local transform file |
| 80 | + |
| 81 | +```bash |
| 82 | +npx @hypermod/cli --transform ./codemods/rename-imports/transform.ts ./src |
| 83 | +``` |
| 84 | + |
| 85 | +#### Browse available codemods for packages |
| 86 | + |
| 87 | +```bash |
| 88 | +npx @hypermod/cli list react @atlaskit/button |
| 89 | +``` |
| 90 | + |
| 91 | +#### Initialize a new codemod package |
| 92 | + |
| 93 | +```bash |
| 94 | +npx @hypermod/cli init --transform 1.0.0 my-codemod-package |
| 95 | +``` |
| 96 | + |
| 97 | +#### Validate a codemod package |
| 98 | + |
| 99 | +```bash |
| 100 | +npx @hypermod/cli validate ./community/my-package |
| 101 | +``` |
| 102 | + |
| 103 | +## What the CLI supports |
| 104 | + |
| 105 | +`@hypermod/cli` is built for real migration workflows, not just one-off transforms. |
| 106 | + |
| 107 | +- Run codemods from **local transform files**. |
| 108 | +- Resolve codemods from **npm packages** and the **community registry**. |
| 109 | +- Run **versioned transforms in sequence** for safer upgrades. |
| 110 | +- Run **presets** for utility codemods that are not tied to a semver milestone. |
| 111 | +- Initialize and validate codemod packages for maintainers and contributors. |
| 112 | +- Access Hypermod.io-powered transform sources through the same CLI surface. |
| 113 | + |
| 114 | +For the latest product docs and guides, visit [hypermod.io/docs](https://www.hypermod.io/docs). |
| 115 | + |
| 116 | +## Who this is for |
| 117 | + |
| 118 | +- **Library maintainers** who want to ship upgrades users can actually adopt. |
| 119 | +- **Platform and infra teams** performing large-scale migrations across many repositories. |
| 120 | +- **Design-system teams** managing frequent component API changes. |
| 121 | +- **Application teams** that want safer, faster JavaScript and TypeScript refactors. |
| 122 | + |
| 123 | +## Contributing codemods |
| 124 | + |
| 125 | +Community codemods live in the [`community/`](./community) directory and are published as packages that can be discovered and run through the Hypermod ecosystem. |
| 126 | + |
| 127 | +Useful starting points: |
| 128 | + |
| 129 | +- Browse the community packages in [`community/`](./community) |
| 130 | +- Inspect the CLI in [`packages/cli`](./packages/cli) |
| 131 | +- Use the package template in [`packages/initializer/template`](./packages/initializer/template) |
| 132 | +- Explore product docs on [Hypermod.io](https://www.hypermod.io/docs) |
44 | 133 |
|
45 | 134 | ## Used by |
46 | 135 |
|
|
0 commit comments