Skip to content

Commit 554a07b

Browse files
committed
docs: update imports from @sylphx/rosetta/server to @sylphx/rosetta-next/server
Updated all documentation to use the new import paths after architecture refactor. The /server entry point has moved from core to rosetta-next.
1 parent 14e668a commit 554a07b

File tree

14 files changed

+43
-43
lines changed

14 files changed

+43
-43
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ export const storage: StorageAdapter = {
151151

152152
```typescript
153153
// lib/rosetta/index.ts
154-
import { Rosetta } from '@sylphx/rosetta/server';
154+
import { Rosetta } from '@sylphx/rosetta-next/server';
155155
import { OpenRouterAdapter } from '@sylphx/rosetta/adapters';
156156
import { cookies } from 'next/headers';
157157
import { storage } from './storage';
@@ -169,7 +169,7 @@ export const rosetta = new Rosetta({
169169
},
170170
});
171171

172-
export { t, flushCollectedStrings, getTranslationsForClient, getLocale } from '@sylphx/rosetta/server';
172+
export { t, flushCollectedStrings, getTranslationsForClient, getLocale } from '@sylphx/rosetta-next/server';
173173
```
174174

175175
### 4. Set Up Layout
@@ -474,7 +474,7 @@ export function TranslationDashboard() {
474474

475475
## API Reference
476476

477-
### Server (`@sylphx/rosetta/server`)
477+
### Server (`@sylphx/rosetta-next/server`)
478478

479479
#### `Rosetta` class
480480

@@ -663,7 +663,7 @@ if (lockAcquired) {
663663
For serverless environments where DB latency matters, use the cache adapters:
664664
665665
```typescript
666-
import { Rosetta, ExternalCache } from '@sylphx/rosetta/server';
666+
import { Rosetta, ExternalCache } from '@sylphx/rosetta-next/server';
667667
import { Redis } from '@upstash/redis';
668668

669669
const redis = new Redis({ url, token });

docs/advanced/caching.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ interface CacheAdapter {
2020
Best for traditional Node.js servers:
2121

2222
```ts
23-
import { InMemoryCache } from '@sylphx/rosetta/server';
23+
import { InMemoryCache } from '@sylphx/rosetta-next/server';
2424

2525
const cache = new InMemoryCache({
2626
ttlMs: 5 * 60 * 1000, // 5 minutes (default)
@@ -53,7 +53,7 @@ const rosetta = new Rosetta({
5353
Best for serverless and multi-instance deployments:
5454

5555
```ts
56-
import { ExternalCache } from '@sylphx/rosetta/server';
56+
import { ExternalCache } from '@sylphx/rosetta-next/server';
5757
import { Redis } from '@upstash/redis';
5858

5959
const redis = new Redis({
@@ -93,7 +93,7 @@ const rosetta = new Rosetta({
9393
For request-level deduplication:
9494

9595
```ts
96-
import { RequestScopedCache } from '@sylphx/rosetta/server';
96+
import { RequestScopedCache } from '@sylphx/rosetta-next/server';
9797

9898
const requestCache = new RequestScopedCache();
9999

docs/advanced/storage-adapter.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ CREATE UNIQUE INDEX idx_translations_locale_hash ON translations(locale, hash);
367367
Wrap your adapter with caching:
368368
369369
```ts
370-
import { InMemoryCache } from '@sylphx/rosetta/server';
370+
import { InMemoryCache } from '@sylphx/rosetta-next/server';
371371

372372
const cache = new InMemoryCache({ ttlMs: 60000 });
373373

docs/api/rosetta-class.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ The main entry point for server-side Rosetta operations.
55
## Constructor
66

77
```ts
8-
import { Rosetta } from '@sylphx/rosetta/server';
8+
import { Rosetta } from '@sylphx/rosetta-next/server';
99

1010
const rosetta = new Rosetta(config);
1111
```
@@ -104,7 +104,7 @@ const hash = Rosetta.hashText(text, context);
104104

105105
```ts
106106
// lib/rosetta/index.ts
107-
import { Rosetta, InMemoryCache } from '@sylphx/rosetta/server';
107+
import { Rosetta, InMemoryCache } from '@sylphx/rosetta-next/server';
108108
import { DrizzleStorageAdapter } from '@sylphx/rosetta-drizzle';
109109
import { db } from '@/db';
110110
import { rosettaSources, rosettaTranslations } from '@/db/schema';
@@ -146,7 +146,7 @@ export default async function Layout({ children, params }) {
146146
## TypeScript
147147

148148
```ts
149-
import type { Rosetta } from '@sylphx/rosetta/server';
149+
import type { Rosetta } from '@sylphx/rosetta-next/server';
150150
import type { StorageAdapter, CacheAdapter } from '@sylphx/rosetta';
151151

152152
// Type the rosetta instance

docs/api/t-function.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ The translation function for server components.
55
## Import
66

77
```ts
8-
import { t } from '@sylphx/rosetta/server';
8+
import { t } from '@sylphx/rosetta-next/server';
99
```
1010

1111
## Signature
@@ -59,7 +59,7 @@ interface TranslateOptions {
5959
### Basic Translation
6060

6161
```ts
62-
import { t } from '@sylphx/rosetta/server';
62+
import { t } from '@sylphx/rosetta-next/server';
6363

6464
function ServerComponent() {
6565
return <h1>{t("Welcome to our app")}</h1>;
@@ -156,7 +156,7 @@ t("Hello World", { context: "greeting" })
156156
Get current locale:
157157

158158
```ts
159-
import { getLocale } from '@sylphx/rosetta/server';
159+
import { getLocale } from '@sylphx/rosetta-next/server';
160160

161161
const locale = getLocale(); // "zh-TW"
162162
```
@@ -166,7 +166,7 @@ const locale = getLocale(); // "zh-TW"
166166
Get fallback chain:
167167

168168
```ts
169-
import { getLocaleChain } from '@sylphx/rosetta/server';
169+
import { getLocaleChain } from '@sylphx/rosetta-next/server';
170170

171171
const chain = getLocaleChain(); // ["zh-TW", "zh", "en"]
172172
```
@@ -176,7 +176,7 @@ const chain = getLocaleChain(); // ["zh-TW", "zh", "en"]
176176
Get default locale:
177177

178178
```ts
179-
import { getDefaultLocale } from '@sylphx/rosetta/server';
179+
import { getDefaultLocale } from '@sylphx/rosetta-next/server';
180180

181181
const defaultLocale = getDefaultLocale(); // "en"
182182
```
@@ -186,7 +186,7 @@ const defaultLocale = getDefaultLocale(); // "en"
186186
Check if inside context:
187187

188188
```ts
189-
import { isInsideRosettaContext } from '@sylphx/rosetta/server';
189+
import { isInsideRosettaContext } from '@sylphx/rosetta-next/server';
190190

191191
if (isInsideRosettaContext()) {
192192
// Safe to use t()
@@ -198,7 +198,7 @@ if (isInsideRosettaContext()) {
198198
Get full context object:
199199

200200
```ts
201-
import { getRosettaContext } from '@sylphx/rosetta/server';
201+
import { getRosettaContext } from '@sylphx/rosetta-next/server';
202202

203203
const ctx = getRosettaContext();
204204
// { locale, defaultLocale, localeChain, translations, storage }
@@ -252,7 +252,7 @@ t(`Welcome, ${user.name}!`) // Won't be extracted!
252252
## TypeScript
253253

254254
```ts
255-
import type { TranslateFunction, TranslateOptions } from '@sylphx/rosetta/server';
255+
import type { TranslateFunction, TranslateOptions } from '@sylphx/rosetta-next/server';
256256

257257
// Type-safe usage
258258
const text: string = t("Hello");

docs/api/types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ import type {
402402
Rosetta,
403403
RosettaContext,
404404
TranslateFunction,
405-
} from '@sylphx/rosetta/server';
405+
} from '@sylphx/rosetta-next/server';
406406

407407
// Next.js
408408
import type {

docs/examples/basic.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export const storage = new DrizzleStorageAdapter({
7878

7979
```ts
8080
// lib/rosetta/index.ts
81-
import { Rosetta, InMemoryCache } from '@sylphx/rosetta/server';
81+
import { Rosetta, InMemoryCache } from '@sylphx/rosetta-next/server';
8282
import { storage } from './storage';
8383

8484
export const rosetta = new Rosetta({
@@ -126,7 +126,7 @@ export function generateStaticParams() {
126126

127127
```tsx
128128
// app/[locale]/page.tsx
129-
import { t } from '@sylphx/rosetta/server';
129+
import { t } from '@sylphx/rosetta-next/server';
130130
import { Counter } from '@/components/counter';
131131

132132
export default function HomePage() {

docs/examples/custom-storage.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ export class PrismaStorageAdapter implements StorageAdapter {
201201

202202
```ts
203203
// lib/rosetta/index.ts
204-
import { Rosetta } from '@sylphx/rosetta/server';
204+
import { Rosetta } from '@sylphx/rosetta-next/server';
205205
import { PrismaClient } from '@prisma/client';
206206
import { PrismaStorageAdapter } from './prisma-adapter';
207207

@@ -464,7 +464,7 @@ CREATE UNIQUE INDEX idx_sources_hash ON sources(hash);
464464
### Use Caching
465465

466466
```ts
467-
import { InMemoryCache } from '@sylphx/rosetta/server';
467+
import { InMemoryCache } from '@sylphx/rosetta-next/server';
468468

469469
const rosetta = new Rosetta({
470470
storage: myAdapter,

docs/guide/deployment.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This guide covers production deployment considerations for Rosetta.
99
Best for: Self-hosted, Docker, VPS
1010

1111
```ts
12-
import { Rosetta, InMemoryCache } from '@sylphx/rosetta/server';
12+
import { Rosetta, InMemoryCache } from '@sylphx/rosetta-next/server';
1313

1414
const rosetta = new Rosetta({
1515
storage,
@@ -31,7 +31,7 @@ const rosetta = new Rosetta({
3131
Best for: Vercel, AWS Lambda, Netlify Functions
3232

3333
```ts
34-
import { Rosetta, ExternalCache } from '@sylphx/rosetta/server';
34+
import { Rosetta, ExternalCache } from '@sylphx/rosetta-next/server';
3535
import { Redis } from '@upstash/redis';
3636

3737
const redis = new Redis({

docs/guide/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Rosetta works seamlessly with both server and client components:
4141

4242
```tsx
4343
// Server Component - uses AsyncLocalStorage
44-
import { t } from '@sylphx/rosetta/server';
44+
import { t } from '@sylphx/rosetta-next/server';
4545
function ServerComponent() {
4646
return <h1>{t("Hello World")}</h1>;
4747
}

0 commit comments

Comments
 (0)