Skip to content
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
30 changes: 30 additions & 0 deletions versioned_docs/version-3.x/_components/PackageUninstall.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import CodeBlock from '@theme/CodeBlock';
import TabItem from '@theme/TabItem';
import Tabs from '@theme/Tabs';

interface Props {
dependencies: string[];
}

const pkgManagers = [
{ name: 'npm', command: 'npm uninstall' },
{ name: 'pnpm', command: 'pnpm remove' },
{ name: 'bun', command: 'bun remove' },
{ name: 'yarn', command: 'yarn remove' },
];

const PackageUninstall = ({ dependencies }: Props) => {
return (
<Tabs>
{pkgManagers.map((pkg) => (
<TabItem key={pkg.name} value={pkg.name} label={pkg.name}>
<CodeBlock language="bash">
{`${dependencies?.length ? `${pkg.command} ${dependencies.join(' ')}` : ''}`}
</CodeBlock>
</TabItem>
))}
</Tabs>
);
};

export default PackageUninstall;
13 changes: 13 additions & 0 deletions versioned_docs/version-3.x/migrate-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ sidebar_position: 11
---

import PackageInstall from './_components/PackageInstall';
import PackageUninstall from './_components/PackageUninstall';

# Migrating From ZenStack V2

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

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.

## Migrating ZenStack Packages

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:

- `zenstack`: the CLI package is now named `@zenstackhq/cli`
- `@zenstackhq/runtime`: the ORM runtime package is now named `@zenstackhq/orm`

Make sure you replace them in your project.

<PackageUninstall dependencies={["zenstack", "@zenstackhq/runtime"]} />
<PackageInstall dependencies={["@zenstackhq/orm@next"]} devDependencies={["@zenstackhq/cli@next"]} />

## Migrating ZModel

### Access Control
Expand Down