Skip to content
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

docs: add enterprise registry setup page #6585

Merged
merged 2 commits into from
Dec 17, 2024
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
12 changes: 10 additions & 2 deletions .cursorignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@
.husky/
.vscode/
cypress/
documentation/
documentation/.docusaurus/
documentation/build/
documentation/node_modules/
documentation/plugins/
documentation/src/
documentation/static/
documentation/test/
documentation/versioned_docs/
documentation/versioned_sidebars/
examples/
hackathon/
patches/
Expand All @@ -14,10 +22,10 @@ CONTRIBUTING.md
LICENSE
README.md
SECURITY.md
*.md
packages/**/tsconfig.json
packages/**/tsconfig.test.json
packages/**/tsconfig.declarations.json
packages/**/jest.config.js
packages/**/refine.config.js
packages/**/tsup.config.ts
dist/
58 changes: 58 additions & 0 deletions documentation/docs/enterprise-edition/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
title: Getting Started
---

## Overview

While Refine Community Edition follows monthly release cycles, [Enterprise Edition](/enterprise) features are released continuously as they are merged to `next` branch.

Refine EE packages are distributed through our private NPM registry at `registry.refine.dev` under `@refinedev` scope.

## Setting up private registry

To use Refine Enterprise Edition packages, you need to configure your project to use our private registry for `@refinedev` scoped packages.

Create or edit `.npmrc` file in your project root with the following content:

```
@refinedev:registry=https://registry.refine.dev
//registry.refine.dev/:_authToken=${REFINE_NPM_TOKEN}
```

There are two ways to set up your authentication token:

1. **Environment Variable (Recommended)**

Add the token to your environment variables:

```bash
export REFINE_NPM_TOKEN=your-token-here
```

2. **Direct in .npmrc**

You can also directly add the token to your `.npmrc` file (not recommended for security reasons):

```plaintext
@refinedev:registry=https://registry.refine.dev
//registry.refine.dev/:_authToken=your-token-here
```

Once you've configured the registry and authentication, you can install enterprise packages using npm or yarn:

<InstallPackagesCommand args="@refinedev/core @refinedev/enterprise" />

## Release Cycle

Enterprise Edition packages follow the same versioning scheme as Community Edition but with continuous releases as features are developed and merged.

Let's look at an example to understand the release cycle:

1. Current version of `@refinedev/core` is `4.57.1`
2. A new feature or fix is developed and merged
3. Enterprise Edition immediately gets a new release as `4.57.2`
4. Community Edition will include this change in the next monthly release as `4.57.3`

This means Enterprise Edition users get access to new updates as soon as they are ready, while Community Edition users receive updates in regular monthly cycles.

**Note: in cases of critical bugs or security vulnerabilities, we release updates immediately for both Enterprise and Community editions. This is an exception to the regular monthly release cycle for Community Edition.**
26 changes: 13 additions & 13 deletions documentation/docs/enterprise-edition/multitenancy/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ pre-built components and hooks with minimal configuration.

This package is included in Refine's Enterprise Edition. To learn more about Refine's Enterprise Edition, please [contact us](https://s.refine.dev/okta-enterprise).

<InstallPackagesCommand args="@refinedev-ee/enterprise @refinedev-ee/multitenancy">
<InstallPackagesCommand args="@refinedev/enterprise @refinedev/multitenancy">

```yml title=".npmrc"
# A registry with the auth token should be added for the @refinedev-ee scope
@refinedev-ee:registry=https://registry.npmjs.org/
//registry.npmjs.org/:_authToken=$NPM_TOKEN
# A registry with the auth token should be added for the @refinedev scope
@refinedev:registry=https://registry.refine.dev/
//registry.refine.dev/:_authToken=$NPM_TOKEN
```

</InstallPackagesCommand>
Expand All @@ -27,8 +27,8 @@ This package is included in Refine's Enterprise Edition. To learn more about Ref
To use the multitenancy feature, we need to wrap our application with the `<RefineEnterprise />` component and provide the `multitenancyProvider` prop.

```tsx
import { RefineEnterprise } from "@refinedev-ee/enterprise";
import { useRouterAdapter, WithTenant } from "@refinedev-ee/multitenancy";
import { RefineEnterprise } from "@refinedev/enterprise";
import { useRouterAdapter, WithTenant } from "@refinedev/multitenancy";

type Tenant = {
id: string;
Expand Down Expand Up @@ -88,7 +88,7 @@ Adapters define where tenant information is stored. Refine offers `useRouterAdap
Extracts the tenantId from the URL and updates the route when the tenant changes.

```tsx
import { useRouterAdapter } from "@refinedev-ee/multitenancy";
import { useRouterAdapter } from "@refinedev/multitenancy";

const multitenancyProvider = {
adapter: useRouterAdapter({
Expand All @@ -110,7 +110,7 @@ const multitenancyProvider = {
Retrieves tenantId from local storage and updates it when the tenant changes.

```tsx
import { useLocalStorageAdapter } from "@refinedev-ee/multitenancy";
import { useLocalStorageAdapter } from "@refinedev/multitenancy";

const multitenancyProvider = {
adapter: useLocalStorageAdapter({
Expand All @@ -130,8 +130,8 @@ const multitenancyProvider = {
The `<WithTenant />` component is required to wrap your app code. It fetches `tenants`, handling the loading state and error state.

```tsx
import { RefineEnterprise } from "@refinedev-ee/enterprise";
import { WithTenant } from "@refinedev-ee/multitenancy";
import { RefineEnterprise } from "@refinedev/enterprise";
import { WithTenant } from "@refinedev/multitenancy";

<WithTenant
// render a component when the tenant is not available.
Expand All @@ -152,7 +152,7 @@ These components allow users to select a tenant from a list of available tenants
<TabItem value="Ant Design">

```tsx
import { TenantSelect } from "@refinedev-ee/multitenancy/antd";
import { TenantSelect } from "@refinedev/multitenancy/antd";

<TenantSelect
// Specifies the tenant object field to display in the select component.
Expand All @@ -171,7 +171,7 @@ import { TenantSelect } from "@refinedev-ee/multitenancy/antd";
<TabItem value="Material UI">

```tsx
import { TenantSelect } from "@refinedev-ee/multitenancy/mui";
import { TenantSelect } from "@refinedev/multitenancy/mui";

<TenantSelect
// Specifies the tenant object field to display in the select component.
Expand All @@ -198,7 +198,7 @@ Refine provides hooks to interact with the multitenancy feature.
The `useMultitenancy` hook is used to interact with the multitenancy context.

```tsx
import { useMultitenancy } from "@refinedev-ee/multitenancy";
import { useMultitenancy } from "@refinedev/multitenancy";

const {
// The current tenant object.
Expand Down
10 changes: 5 additions & 5 deletions documentation/docs/enterprise-edition/okta/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ Okta is an enterprise-grade identity management service. Refine's integration of

This package is included in Refine's Enterprise Edition. To learn more about Refine's Enterprise Edition, please [contact us](https://s.refine.dev/okta-enterprise).

<InstallPackagesCommand args="@refinedev-ee/okta @okta/okta-auth-js">
<InstallPackagesCommand args="@refinedev/okta @okta/okta-auth-js">

```yml title=".npmrc"
# A registry with the auth token should be added for the @refinedev-ee scope
@refinedev-ee:registry=https://registry.npmjs.org/
//registry.npmjs.org/:_authToken=$NPM_TOKEN
# A registry with the auth token should be added for the @refinedev scope
@refinedev:registry=https://registry.refine.dev/
//registry.refine.dev/:_authToken=$NPM_TOKEN
```

</InstallPackagesCommand>
Expand All @@ -37,7 +37,7 @@ import routerProvider, {
CatchAllNavigate,
NavigateToResource,
} from "@refinedev/react-router";
import { createAuthProvider, OktaCallback } from "@refinedev-ee/okta";
import { createAuthProvider, OktaCallback } from "@refinedev/okta";

const oktaAuth = new OktaAuth({
issuer: "https://{yourOktaDomain}/oauth2/default",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ export default function RouteDefinitions() {
const AppTsxCode = /* jsx */ `
import React from "react";

import { RefineEnterprise } from "@refinedev-ee/enterprise";
import { WithTenant } from "@refinedev-ee/multitenancy";
import routerProvider from "@refinedev-ee/nextjs-router/pages";
import dataProvider from "@refinedev-ee/simple-rest";
import { RefineEnterprise } from "@refinedev/enterprise";
import { WithTenant } from "@refinedev/multitenancy";
import routerProvider from "@refinedev/nextjs-router/pages";
import dataProvider from "@refinedev/simple-rest";
import type { AppProps } from "next/app";

import { multitenancyProvider } from "./providers/multitenancy";
Expand Down Expand Up @@ -87,7 +87,7 @@ export default App;
const ListTsxCode = /* jsx */ `
import React from "react";

import { useList } from "@refinedev-ee/core";
import { useList } from "@refinedev/core";

export default function ProductsList() {
const { data, isLoading } = useList();
Expand All @@ -112,7 +112,7 @@ export default function ProductsList() {
const CreateTsxCode = /* jsx */ `
import React from "react";

import { useCreate } from "@refinedev-ee/core";
import { useCreate } from "@refinedev/core";

export default function ProductsCreate() {
const { onFinish } = useForm();
Expand All @@ -133,7 +133,7 @@ export default function ProductsCreate() {
const ShowTsxCode = /* jsx */ `
import React from "react";

import { useShow } from "@refinedev-ee/core";
import { useShow } from "@refinedev/core";

export default function ProductsShow() {
const { query: { data, isLoading } } = useShow();
Expand All @@ -155,7 +155,7 @@ export default function ProductsShow() {
const EditTsxCode = /* jsx */ `
import React from "react";

import { useForm } from "@refinedev-ee/core";
import { useForm } from "@refinedev/core";

export default function ProductsEdit() {
const { onFinish, query, formLoading } = useForm();
Expand All @@ -179,9 +179,9 @@ export default function ProductsEdit() {
`.trim();

const MultitenancyProviderTsxCode = /* jsx */ `
import type { MultiTenancyProvider } from "@refinedev-ee/enterprise";
import { useRouterAdapter } from "@refinedev-ee/multitenancy";
import dataProvider from "@refinedev-ee/simple-rest";
import type { MultiTenancyProvider } from "@refinedev/enterprise";
import { useRouterAdapter } from "@refinedev/multitenancy";
import dataProvider from "@refinedev/simple-rest";

export type Tenant = {
id: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ export default function RouteDefinitions() {
}

const AppTsxCode = /* jsx */ `
import { RefineEnterprise } from "@refinedev-ee/enterprise";
import { WithTenant } from "@refinedev-ee/multitenancy";
import dataProvider from "@refinedev-ee/simple-rest";
import routerProvider from "@refinedev-ee/react-router-v6";
import { RefineEnterprise } from "@refinedev/enterprise";
import { WithTenant } from "@refinedev/multitenancy";
import dataProvider from "@refinedev/simple-rest";
import routerProvider from "@refinedev/react-router-v6";

import { BrowserRouter, Outlet, Routes, Route } from "react-router";

Expand Down Expand Up @@ -79,8 +79,8 @@ export const App: React.FC = () => {
`.trim();

const MultitenancyProviderTsxCode = /* jsx */ `
import type { MultiTenancyProvider } from "@refinedev-ee/core";
import { useRouterAdapter } from "@refinedev-ee/multitenancy";
import type { MultiTenancyProvider } from "@refinedev/core";
import { useRouterAdapter } from "@refinedev/multitenancy";
import dataProvider from "@refinedev/simple-rest";

export type Tenant = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ import {
ScrollRestoration,
} from "@remix-run/react";

import { RefineEnterprise } from "@refinedev-ee/enterprise";
import { WithTenant } from "@refinedev-ee/multitenancy";
import routerProvider from "@refinedev-ee/remix-router";
import dataProvider from "@refinedev-ee/simple-rest";
import { RefineEnterprise } from "@refinedev/enterprise";
import { WithTenant } from "@refinedev/multitenancy";
import routerProvider from "@refinedev/remix-router";
import dataProvider from "@refinedev/simple-rest";


import { multitenancyProvider } from "./providers/multitenancy";
Expand Down Expand Up @@ -105,7 +105,7 @@ export default function App() {
const ListTsxCode = /* jsx */ `
import React from "react";

import { useList } from "@refinedev-ee/core";
import { useList } from "@refinedev/core";

export default function ProductsList() {
const { data, isLoading } = useList();
Expand All @@ -130,7 +130,7 @@ export default function ProductsList() {
const CreateTsxCode = /* jsx */ `
import React from "react";

import { useCreate } from "@refinedev-ee/core";
import { useCreate } from "@refinedev/core";

export default function ProductsCreate() {
const { onFinish } = useForm();
Expand All @@ -151,7 +151,7 @@ export default function ProductsCreate() {
const ShowTsxCode = /* jsx */ `
import React from "react";

import { useShow } from "@refinedev-ee/core";
import { useShow } from "@refinedev/core";

export default function ProductsShow() {
const {
Expand All @@ -175,7 +175,7 @@ export default function ProductsShow() {
const EditTsxCode = /* jsx */ `
import React from "react";

import { useForm } from "@refinedev-ee/core";
import { useForm } from "@refinedev/core";

export default function ProductsEdit() {
const { onFinish, query, formLoading } = useForm();
Expand All @@ -199,9 +199,9 @@ export default function ProductsEdit() {
`.trim();

const MultitenancyProviderTsxCode = /* jsx */ `
import type { MultiTenancyProvider } from "@refinedev-ee/enterprise";
import { useRouterAdapter } from "@refinedev-ee/multitenancy";
import dataProvider from "@refinedev-ee/simple-rest";
import type { MultiTenancyProvider } from "@refinedev/enterprise";
import { useRouterAdapter } from "@refinedev/multitenancy";
import dataProvider from "@refinedev/simple-rest";

export type Tenant = {
id: string;
Expand Down
Loading
Loading