Skip to content

Commit 5e12739

Browse files
authored
doc: add package migration to v2-migration doc (#504)
* doc: add package migration to v2-migration doc * update
1 parent 7979a01 commit 5e12739

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import CodeBlock from '@theme/CodeBlock';
2+
import TabItem from '@theme/TabItem';
3+
import Tabs from '@theme/Tabs';
4+
5+
interface Props {
6+
dependencies: string[];
7+
}
8+
9+
const pkgManagers = [
10+
{ name: 'npm', command: 'npm uninstall' },
11+
{ name: 'pnpm', command: 'pnpm remove' },
12+
{ name: 'bun', command: 'bun remove' },
13+
{ name: 'yarn', command: 'yarn remove' },
14+
];
15+
16+
const PackageUninstall = ({ dependencies }: Props) => {
17+
return (
18+
<Tabs>
19+
{pkgManagers.map((pkg) => (
20+
<TabItem key={pkg.name} value={pkg.name} label={pkg.name}>
21+
<CodeBlock language="bash">
22+
{`${dependencies?.length ? `${pkg.command} ${dependencies.join(' ')}` : ''}`}
23+
</CodeBlock>
24+
</TabItem>
25+
))}
26+
</Tabs>
27+
);
28+
};
29+
30+
export default PackageUninstall;

versioned_docs/version-3.x/migrate-v2.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ sidebar_position: 11
44
---
55

66
import PackageInstall from './_components/PackageInstall';
7+
import PackageUninstall from './_components/PackageUninstall';
78

89
# Migrating From ZenStack V2
910

@@ -40,6 +41,18 @@ Here are a few essential items to verify before preparing your migration:
4041

4142
Since ZenStack v3 is no longer based on Prisma ORM, the first step is to replace Prisma dependencies with ZenStack and update the code where `PrismaClient` is created. Please follow the [Prisma Migration Guide](./migrate-prisma.md) for detailed instructions.
4243

44+
## Migrating ZenStack Packages
45+
46+
As you have seen in the [Prisma Migration Guide](./migrate-prisma.md), all v3 packages are published under the "@next" tag for now. Two most important packages have been renamed:
47+
48+
- `zenstack`: the CLI package is now named `@zenstackhq/cli`
49+
- `@zenstackhq/runtime`: the ORM runtime package is now named `@zenstackhq/orm`
50+
51+
Make sure you replace them in your project.
52+
53+
<PackageUninstall dependencies={["zenstack", "@zenstackhq/runtime"]} />
54+
<PackageInstall dependencies={["@zenstackhq/orm@next"]} devDependencies={["@zenstackhq/cli@next"]} />
55+
4356
## Migrating ZModel
4457

4558
### Access Control

0 commit comments

Comments
 (0)