cloudflare-next-intl 0.8.51 → 0.8.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -15
- package/bin/db_codegen.mjs +36 -17
- package/bin/ephemeral_pg.mjs +85 -5
- package/dist/package.json +314 -0
- package/dist/src/config/middleware.js +21 -6
- package/dist/src/cookie_consent/client/components/cookie_consent_dialog.d.ts +6 -1
- package/dist/src/cookie_consent/client/components/cookie_consent_dialog.js +6 -3
- package/dist/src/cookie_consent/client/components/privacy_policy_update_dialog.d.ts +6 -1
- package/dist/src/cookie_consent/client/components/privacy_policy_update_dialog.js +6 -3
- package/dist/src/cookie_consent/client/cookie_consent_provider.js +3 -2
- package/dist/src/cookie_consent/gdpr_countries.d.ts +2 -2
- package/dist/src/cookie_consent/gdpr_countries.js +2 -2
- package/dist/src/cookie_consent/types.d.ts +5 -0
- package/dist/src/db/codegen_paths.d.ts +1 -1
- package/dist/src/db/codegen_paths.js +1 -1
- package/dist/src/server/components/server_provider.js +1 -1
- package/dist/src/server/components/server_provider_static.js +1 -1
- package/dist/src/server/functions/geo.d.ts +2 -2
- package/dist/src/server/functions/geo.js +36 -12
- package/dist/src/types/types.d.ts +6 -0
- package/dist/src/vite/cf_workers_client_stub.d.ts +4 -0
- package/dist/src/vite/cf_workers_client_stub.js +23 -0
- package/dist/src/vite/index.d.ts +5 -0
- package/dist/src/vite/index.js +5 -0
- package/dist/src/vite/locale_file_plugin.d.ts +19 -0
- package/dist/src/vite/locale_file_plugin.js +90 -0
- package/dist/src/vite/plugin.d.ts +29 -0
- package/dist/src/vite/plugin.js +27 -0
- package/dist/src/vite/user_agent_stub.d.ts +4 -0
- package/dist/src/vite/user_agent_stub.js +49 -0
- package/llms.txt +2 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -239,22 +239,52 @@ export default setIntlConfig({
|
|
|
239
239
|
});
|
|
240
240
|
```
|
|
241
241
|
|
|
242
|
-
#### Vite
|
|
242
|
+
#### Vite Plugin for Vinext & Cloudflare Workers (`cloudflare-next-intl/vite`)
|
|
243
243
|
|
|
244
|
-
When
|
|
244
|
+
When using **Vinext** (Vite + Next.js App Router for Cloudflare Workers), add `cloudflareNextIntl()` to `vite.config.ts`. It is **required** for Vinext projects to resolve translations, bundle locale files, stub Node.js dependencies, and emit the build asset:
|
|
245
245
|
|
|
246
246
|
```typescript
|
|
247
247
|
// vite.config.ts
|
|
248
248
|
import { defineConfig } from "vite";
|
|
249
|
-
import {
|
|
249
|
+
import { cloudflareNextIntl } from "cloudflare-next-intl/vite";
|
|
250
250
|
|
|
251
251
|
export default defineConfig({
|
|
252
252
|
plugins: [
|
|
253
|
-
|
|
253
|
+
cloudflareNextIntl(), // All plugins enabled by default
|
|
254
254
|
],
|
|
255
255
|
});
|
|
256
256
|
```
|
|
257
257
|
|
|
258
|
+
##### What `cloudflareNextIntl()` Does
|
|
259
|
+
1. **Locale File Bundling & Resolution (`localeFiles`)**: Resolves `@locale-file/*` to your `./messages` directory and transforms dynamic imports into `import.meta.glob('/messages/*.json', { eager: true })` for lightning-fast locale loading on Cloudflare Workers.
|
|
260
|
+
2. **User-Agent Stub (`userAgentStub`)**: Prevents Next.js `user-agent` from importing `node:fs` during workerd runtime execution (which otherwise causes runtime 404 / 500 crashes in Workers proxy/middleware).
|
|
261
|
+
3. **Cloudflare Workers Client Stub (`cfWorkersClientStub`)**: Stubs `cloudflare:workers` in client builds so shared modules can be referenced without client bundling errors.
|
|
262
|
+
4. **Build ID Asset Emission (`buildIdAsset`)**: Emits `BUILD_ID` static asset in the client build directory from `process.env.__VINEXT_SHARED_BUILD_ID` or `process.env.__VINEXT_BUILD_ID`.
|
|
263
|
+
|
|
264
|
+
##### Plugin Options
|
|
265
|
+
All features are enabled by default, and can be individually configured or toggled off:
|
|
266
|
+
|
|
267
|
+
```typescript
|
|
268
|
+
import { defineConfig } from "vite";
|
|
269
|
+
import { cloudflareNextIntl } from "cloudflare-next-intl/vite";
|
|
270
|
+
|
|
271
|
+
export default defineConfig({
|
|
272
|
+
plugins: [
|
|
273
|
+
cloudflareNextIntl({
|
|
274
|
+
messagesDir: "./messages", // Path to locale JSON files (default: './messages')
|
|
275
|
+
intlConfigPath: "./src/l18n/intl_config.ts", // Path to intl config (auto-detected if omitted)
|
|
276
|
+
buildIdAsset: true, // Emit BUILD_ID asset (or custom string filename, default: true)
|
|
277
|
+
localeFiles: true, // Enable @locale-file & glob bundling (default: true)
|
|
278
|
+
userAgentStub: true, // Enable regex-based user-agent stub (default: true)
|
|
279
|
+
cfWorkersClientStub: true, // Enable client cloudflare:workers stub (default: true)
|
|
280
|
+
}),
|
|
281
|
+
],
|
|
282
|
+
});
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
Individual standalone plugins are also exported if you only need a specific feature:
|
|
286
|
+
`buildIdAsset`, `localeFilePlugin`, `userAgentStubPlugin`, `cfWorkersClientStubPlugin`.
|
|
287
|
+
|
|
258
288
|
```tsx
|
|
259
289
|
// Client Components ("use client")
|
|
260
290
|
import { useLocale } from "cloudflare-next-intl/use";
|
|
@@ -405,6 +435,7 @@ export default setIntlConfig({
|
|
|
405
435
|
},
|
|
406
436
|
cookieConsent: {
|
|
407
437
|
privacyPolicyDate: "2026-01-01",
|
|
438
|
+
// showPrivacyPolicy: false, // defaults to true; set false to hide privacy policy link in dialogs
|
|
408
439
|
// privacyPolicyPath: "/privacy-policy", // default; used by the
|
|
409
440
|
// dialogs' auto-rendered link. Set false to disable that link.
|
|
410
441
|
// country-based gating is enabled by default (reads Cloudflare geo
|
|
@@ -414,8 +445,8 @@ export default setIntlConfig({
|
|
|
414
445
|
// gdprCountries: [...], // defaults to EU/EEA + UK + Switzerland
|
|
415
446
|
// enableAnalyticsInDevMode: true, // analytics stay off in dev otherwise
|
|
416
447
|
// autoWireDialogs: false, // opt out and render the dialogs yourself
|
|
417
|
-
// dialogProps: { acceptText: "Accept" }, // forwarded to CookieConsentDialog
|
|
418
|
-
// updateDialogProps: { closeText: "Got it" }, // forwarded to PrivacyPolicyUpdateDialog
|
|
448
|
+
// dialogProps: { acceptText: "Accept", showPrivacyPolicy: true }, // forwarded to CookieConsentDialog
|
|
449
|
+
// updateDialogProps: { closeText: "Got it", showPrivacyPolicy: true }, // forwarded to PrivacyPolicyUpdateDialog
|
|
419
450
|
},
|
|
420
451
|
});
|
|
421
452
|
```
|
|
@@ -868,7 +899,7 @@ npx cfni-db-codegen --check
|
|
|
868
899
|
| `--ddl-dir=` | `CFNI_DB_DDL_DIR` | `supabase/data-base` |
|
|
869
900
|
| `--out-dir=` | `CFNI_DB_OUT_DIR` | `src/shared/db/generated` |
|
|
870
901
|
| `--out-file=` | `CFNI_DB_OUT_FILE` | `schema.ts` |
|
|
871
|
-
| `--db-url=` | `CODEGEN_DATABASE_URL` | `
|
|
902
|
+
| `--db-url=` | `CODEGEN_DATABASE_URL` | none (prefers `embedded-postgres`) |
|
|
872
903
|
| `--drizzle-config=` | `CFNI_DB_DRIZZLE_CONFIG` | none |
|
|
873
904
|
| `--rpc-dir=` | `CFNI_DB_RPC_DIR` | inside `--ddl-dir`, e.g. `supabase/data-base/rpcs` |
|
|
874
905
|
| `--rpc-file-name=` | `CFNI_DB_RPC_FILE_NAME` | `cfni_exec.sql` |
|
|
@@ -888,14 +919,9 @@ them and fails naming the first one that is stale.
|
|
|
888
919
|
npx cfni-db-codegen --out-dir=src/shared/db/generated --out-dir=../other-app/src/db/generated
|
|
889
920
|
```
|
|
890
921
|
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
prebuilt binary, no Docker required): install it once with
|
|
895
|
-
`npm install --save-dev embedded-postgres`, and no local DB setup is needed —
|
|
896
|
-
the DDL in `--ddl-dir` is loaded into it, introspected, and it's torn down
|
|
897
|
-
after. Passing an explicit `--db-url`/`CODEGEN_DATABASE_URL` skips this
|
|
898
|
-
fallback entirely and fails loudly if that target is unreachable.
|
|
922
|
+
By default, `cfni-db-codegen` uses the built-in `embedded-postgres` package to spin up a throwaway local Postgres, load your project's DDL from `--ddl-dir`, and introspect it with zero external dependencies (no Docker or running Postgres required).
|
|
923
|
+
|
|
924
|
+
If you explicitly pass `--db-url=` or set `CODEGEN_DATABASE_URL`, `cfni-db-codegen` will connect to that specific live database instead. If the provided database URL is unreachable or invalid, a warning is printed and it automatically falls back to generating the schema via `embedded-postgres`.
|
|
899
925
|
|
|
900
926
|
##### Keeping `cfni_exec.sql` in sync (`--rpc-dir`/`--rpc-file-name`/`--tests-dir`/`--tests-file-name`/`--force`/`--skip-exec`)
|
|
901
927
|
|
package/bin/db_codegen.mjs
CHANGED
|
@@ -13,11 +13,10 @@
|
|
|
13
13
|
// same schema into several projects at once (CFNI_DB_OUT_DIR accepts a
|
|
14
14
|
// comma-separated list too).
|
|
15
15
|
//
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
-
//
|
|
20
|
-
// set, it tries the local Supabase default (127.0.0.1:54322).
|
|
16
|
+
// Prefers the embedded-postgres library by default (zero setup, no Docker needed)
|
|
17
|
+
// to introspect the DDL in --ddl-dir. If the user explicitly sets --db-url or
|
|
18
|
+
// CODEGEN_DATABASE_URL, it uses that URL; if the explicit URL is unreachable,
|
|
19
|
+
// it warns and falls back to embedded-postgres.
|
|
21
20
|
// CODEGEN_CONNECT_TIMEOUT_MS overrides the 5s default reachability-check
|
|
22
21
|
// timeout — raise it for a slow/cold-starting remote or serverless target.
|
|
23
22
|
//
|
|
@@ -55,13 +54,12 @@ async function isReachable(url) {
|
|
|
55
54
|
}
|
|
56
55
|
}
|
|
57
56
|
|
|
58
|
-
function failUnreachable(
|
|
59
|
-
console.error(`❌ Could not reach Postgres at ${
|
|
60
|
-
console.error("\n drizzle-kit pull needs a
|
|
61
|
-
console.error(" -
|
|
62
|
-
console.error(" -
|
|
63
|
-
console.error(" -
|
|
64
|
-
console.error(" - Zero setup (no Docker/Postgres at all): npm install --save-dev embedded-postgres (auto-used as a fallback)");
|
|
57
|
+
function failUnreachable(target) {
|
|
58
|
+
console.error(`❌ Could not reach Postgres at ${target} and embedded-postgres could not be started.`);
|
|
59
|
+
console.error("\n drizzle-kit pull needs a Postgres to introspect. You can:");
|
|
60
|
+
console.error(" - Ensure embedded-postgres is installed (default, no Docker): npm install --save-dev embedded-postgres");
|
|
61
|
+
console.error(" - Or specify a reachable database URL: CODEGEN_DATABASE_URL=postgresql://... npm run db:codegen");
|
|
62
|
+
console.error(" - Or start local Supabase (needs Docker): ./supabase/scripts/db_start.sh --reset");
|
|
65
63
|
console.error(` Slow/cold-starting target? Raise the timeout: CODEGEN_CONNECT_TIMEOUT_MS=15000 npm run db:codegen`);
|
|
66
64
|
process.exit(1);
|
|
67
65
|
}
|
|
@@ -96,7 +94,7 @@ if (paths.check) {
|
|
|
96
94
|
process.exit(0);
|
|
97
95
|
}
|
|
98
96
|
|
|
99
|
-
let effectiveDbUrl =
|
|
97
|
+
let effectiveDbUrl = null;
|
|
100
98
|
let ephemeral = null;
|
|
101
99
|
// drizzle-kit's own default config resolution looks for `drizzle.config.json`
|
|
102
100
|
// in the cwd and errors out if it's missing — a project has no reason to
|
|
@@ -105,11 +103,32 @@ let ephemeral = null;
|
|
|
105
103
|
// when the caller didn't pass --drizzle-config, generate one on the fly.
|
|
106
104
|
let generatedConfigPath = null;
|
|
107
105
|
try {
|
|
108
|
-
if (
|
|
109
|
-
if (
|
|
106
|
+
if (paths.dbUrlExplicit && paths.dbUrl) {
|
|
107
|
+
if (await isReachable(paths.dbUrl)) {
|
|
108
|
+
effectiveDbUrl = paths.dbUrl;
|
|
109
|
+
} else {
|
|
110
|
+
console.warn(`⚠️ Database URL '${paths.dbUrl}' is unreachable or invalid. Falling back to embedded-postgres library...\n`);
|
|
111
|
+
ephemeral = await startEphemeralPostgres(orderedSqlFiles(paths.ddlDir));
|
|
112
|
+
if (ephemeral) {
|
|
113
|
+
effectiveDbUrl = ephemeral.url;
|
|
114
|
+
} else {
|
|
115
|
+
failUnreachable(paths.dbUrl);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
} else {
|
|
119
|
+
// By default, prefer embedded-postgres library directly (zero setup, no Docker/external DB dependency)
|
|
110
120
|
ephemeral = await startEphemeralPostgres(orderedSqlFiles(paths.ddlDir));
|
|
111
|
-
if (
|
|
112
|
-
|
|
121
|
+
if (ephemeral) {
|
|
122
|
+
effectiveDbUrl = ephemeral.url;
|
|
123
|
+
} else {
|
|
124
|
+
// If embedded-postgres is not available / failed, check local Supabase default as fallback
|
|
125
|
+
const localFallback = 'postgresql://postgres:postgres@127.0.0.1:54322/postgres';
|
|
126
|
+
if (await isReachable(localFallback)) {
|
|
127
|
+
effectiveDbUrl = localFallback;
|
|
128
|
+
} else {
|
|
129
|
+
failUnreachable('embedded-postgres library or local Supabase (127.0.0.1:54322)');
|
|
130
|
+
}
|
|
131
|
+
}
|
|
113
132
|
}
|
|
114
133
|
|
|
115
134
|
let configPath = paths.drizzleConfig;
|
package/bin/ephemeral_pg.mjs
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
// Spins up a throwaway, local-only Postgres (via `embedded-postgres`, a
|
|
2
2
|
// prebuilt binary — no Docker) so `cfni-db-codegen` can introspect DDL
|
|
3
|
-
// without any live Postgres
|
|
4
|
-
// no --db-url/CODEGEN_DATABASE_URL was given and nothing is reachable at the
|
|
5
|
-
// local Supabase default.
|
|
3
|
+
// without any external live Postgres running.
|
|
6
4
|
import { readFileSync, rmSync } from 'node:fs';
|
|
7
5
|
import { relative } from 'node:path';
|
|
8
6
|
import { Client } from 'pg';
|
|
@@ -44,7 +42,7 @@ export async function startEphemeralPostgres(sqlFiles) {
|
|
|
44
42
|
persistent: false,
|
|
45
43
|
});
|
|
46
44
|
|
|
47
|
-
console.log('ℹ️
|
|
45
|
+
console.log('ℹ️ Using embedded-postgres (zero setup, no Docker) to introspect DDL…');
|
|
48
46
|
try {
|
|
49
47
|
await pg.initialise();
|
|
50
48
|
await pg.start();
|
|
@@ -53,8 +51,90 @@ export async function startEphemeralPostgres(sqlFiles) {
|
|
|
53
51
|
await client.connect();
|
|
54
52
|
try {
|
|
55
53
|
for (const role of SUPABASE_ROLES) {
|
|
56
|
-
await client.query(`CREATE ROLE ${role} NOLOGIN NOINHERIT;`);
|
|
54
|
+
await client.query(`CREATE ROLE ${role} NOLOGIN NOINHERIT;`).catch(() => {});
|
|
57
55
|
}
|
|
56
|
+
await client.query(`CREATE SCHEMA IF NOT EXISTS auth;`).catch(() => {});
|
|
57
|
+
await client.query(`CREATE SCHEMA IF NOT EXISTS storage;`).catch(() => {});
|
|
58
|
+
await client.query(`CREATE SCHEMA IF NOT EXISTS extensions;`).catch(() => {});
|
|
59
|
+
await client.query(`CREATE EXTENSION IF NOT EXISTS "uuid-ossp";`).catch(() => {});
|
|
60
|
+
await client.query(`CREATE EXTENSION IF NOT EXISTS "pgcrypto";`).catch(() => {});
|
|
61
|
+
|
|
62
|
+
// Bootstrap common Supabase helper functions and tables for DDL compatibility
|
|
63
|
+
await client.query(`
|
|
64
|
+
CREATE OR REPLACE FUNCTION auth.uid() RETURNS uuid LANGUAGE sql STABLE AS $$ SELECT null::uuid $$;
|
|
65
|
+
CREATE OR REPLACE FUNCTION auth.jwt() RETURNS jsonb LANGUAGE sql STABLE AS $$ SELECT '{}'::jsonb $$;
|
|
66
|
+
CREATE OR REPLACE FUNCTION auth.role() RETURNS text LANGUAGE sql STABLE AS $$ SELECT 'anon'::text $$;
|
|
67
|
+
CREATE OR REPLACE FUNCTION auth.email() RETURNS text LANGUAGE sql STABLE AS $$ SELECT ''::text $$;
|
|
68
|
+
|
|
69
|
+
CREATE TABLE IF NOT EXISTS auth.users (
|
|
70
|
+
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
71
|
+
email text,
|
|
72
|
+
created_at timestamptz DEFAULT now(),
|
|
73
|
+
updated_at timestamptz DEFAULT now(),
|
|
74
|
+
raw_user_meta_data jsonb DEFAULT '{}'::jsonb,
|
|
75
|
+
raw_app_meta_data jsonb DEFAULT '{}'::jsonb
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
CREATE TABLE IF NOT EXISTS storage.buckets (
|
|
79
|
+
id text PRIMARY KEY,
|
|
80
|
+
name text NOT NULL,
|
|
81
|
+
owner uuid,
|
|
82
|
+
created_at timestamptz DEFAULT now(),
|
|
83
|
+
updated_at timestamptz DEFAULT now(),
|
|
84
|
+
public boolean DEFAULT false,
|
|
85
|
+
avif_autodetection boolean DEFAULT false,
|
|
86
|
+
file_size_limit bigint,
|
|
87
|
+
allowed_mime_types text[],
|
|
88
|
+
owner_id text
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
CREATE TABLE IF NOT EXISTS storage.objects (
|
|
92
|
+
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
93
|
+
bucket_id text REFERENCES storage.buckets(id),
|
|
94
|
+
name text,
|
|
95
|
+
owner uuid,
|
|
96
|
+
created_at timestamptz DEFAULT now(),
|
|
97
|
+
updated_at timestamptz DEFAULT now(),
|
|
98
|
+
last_accessed_at timestamptz DEFAULT now(),
|
|
99
|
+
metadata jsonb,
|
|
100
|
+
path_tokens text[] GENERATED ALWAYS AS (string_to_array(name, '/')) STORED,
|
|
101
|
+
version text,
|
|
102
|
+
owner_id text
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
CREATE OR REPLACE FUNCTION storage.foldername(name text) RETURNS text[] LANGUAGE plpgsql AS $$
|
|
106
|
+
BEGIN
|
|
107
|
+
RETURN string_to_array(name, '/');
|
|
108
|
+
END
|
|
109
|
+
$$;
|
|
110
|
+
|
|
111
|
+
CREATE OR REPLACE FUNCTION storage.filename(name text) RETURNS text LANGUAGE plpgsql AS $$
|
|
112
|
+
DECLARE
|
|
113
|
+
parts text[];
|
|
114
|
+
BEGIN
|
|
115
|
+
parts := string_to_array(name, '/');
|
|
116
|
+
RETURN parts[array_length(parts, 1)];
|
|
117
|
+
END
|
|
118
|
+
$$;
|
|
119
|
+
|
|
120
|
+
CREATE OR REPLACE FUNCTION storage.extension(name text) RETURNS text LANGUAGE plpgsql AS $$
|
|
121
|
+
DECLARE
|
|
122
|
+
parts text[];
|
|
123
|
+
filename text;
|
|
124
|
+
ext_parts text[];
|
|
125
|
+
BEGIN
|
|
126
|
+
parts := string_to_array(name, '/');
|
|
127
|
+
filename := parts[array_length(parts, 1)];
|
|
128
|
+
ext_parts := string_to_array(filename, '.');
|
|
129
|
+
IF array_length(ext_parts, 1) > 1 THEN
|
|
130
|
+
RETURN ext_parts[array_length(ext_parts, 1)];
|
|
131
|
+
ELSE
|
|
132
|
+
RETURN '';
|
|
133
|
+
END IF;
|
|
134
|
+
END
|
|
135
|
+
$$;
|
|
136
|
+
`).catch(() => {});
|
|
137
|
+
|
|
58
138
|
for (const file of sqlFiles) {
|
|
59
139
|
const sql = readFileSync(file, 'utf8');
|
|
60
140
|
if (sql.trim().length === 0) continue;
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "cloudflare-next-intl",
|
|
3
|
+
"version": "0.8.53",
|
|
4
|
+
"description": "Optimized Next Intl Package Special for App Router and Cloudflare",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"bin": {
|
|
9
|
+
"cfni-db-codegen": "bin/db_codegen.mjs",
|
|
10
|
+
"cfni-db-install-exec": "bin/db_install_exec.mjs"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"bin",
|
|
15
|
+
"supabase",
|
|
16
|
+
"LICENSE",
|
|
17
|
+
"README.md",
|
|
18
|
+
"llms.txt"
|
|
19
|
+
],
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"import": "./dist/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./client": {
|
|
26
|
+
"types": "./dist/src/client/index.d.ts",
|
|
27
|
+
"import": "./dist/src/client/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./server": {
|
|
30
|
+
"types": "./dist/src/server/index.d.ts",
|
|
31
|
+
"import": "./dist/src/server/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./geo": {
|
|
34
|
+
"types": "./dist/src/server/functions/geo.d.ts",
|
|
35
|
+
"import": "./dist/src/server/functions/geo.js"
|
|
36
|
+
},
|
|
37
|
+
"./getCountry": {
|
|
38
|
+
"types": "./dist/src/server/functions/geo.d.ts",
|
|
39
|
+
"import": "./dist/src/server/functions/geo.js"
|
|
40
|
+
},
|
|
41
|
+
"./getTimezone": {
|
|
42
|
+
"types": "./dist/src/server/functions/geo.d.ts",
|
|
43
|
+
"import": "./dist/src/server/functions/geo.js"
|
|
44
|
+
},
|
|
45
|
+
"./middleware": {
|
|
46
|
+
"types": "./dist/src/config/middleware.d.ts",
|
|
47
|
+
"import": "./dist/src/config/middleware.js"
|
|
48
|
+
},
|
|
49
|
+
"./setIntlConfig": {
|
|
50
|
+
"types": "./dist/src/config/init_config.d.ts",
|
|
51
|
+
"import": "./dist/src/config/init_config.js"
|
|
52
|
+
},
|
|
53
|
+
"./serverProvider": {
|
|
54
|
+
"types": "./dist/src/server/components/server_provider.d.ts",
|
|
55
|
+
"import": "./dist/src/server/components/server_provider.js"
|
|
56
|
+
},
|
|
57
|
+
"./serverProviderStatic": {
|
|
58
|
+
"types": "./dist/src/server/components/server_provider_static.d.ts",
|
|
59
|
+
"import": "./dist/src/server/components/server_provider_static.js"
|
|
60
|
+
},
|
|
61
|
+
"./Link": {
|
|
62
|
+
"types": "./dist/src/server/components/link.d.ts",
|
|
63
|
+
"import": "./dist/src/server/components/link.js"
|
|
64
|
+
},
|
|
65
|
+
"./IntlHelperScript": {
|
|
66
|
+
"types": "./dist/src/server/components/helper_script.d.ts",
|
|
67
|
+
"import": "./dist/src/server/components/helper_script.js"
|
|
68
|
+
},
|
|
69
|
+
"./LocaleLink": {
|
|
70
|
+
"types": "./dist/src/client/components/locale_link.d.ts",
|
|
71
|
+
"import": "./dist/src/client/components/locale_link.js"
|
|
72
|
+
},
|
|
73
|
+
"./usePathname": {
|
|
74
|
+
"types": "./dist/src/client/hooks/use_path_name.d.ts",
|
|
75
|
+
"import": "./dist/src/client/hooks/use_path_name.js"
|
|
76
|
+
},
|
|
77
|
+
"./metadata": {
|
|
78
|
+
"types": "./dist/src/general/metadata.d.ts",
|
|
79
|
+
"import": "./dist/src/general/metadata.js"
|
|
80
|
+
},
|
|
81
|
+
"./setCookieClient": {
|
|
82
|
+
"types": "./dist/src/client/functions/set_cookie.d.ts",
|
|
83
|
+
"import": "./dist/src/client/functions/set_cookie.js"
|
|
84
|
+
},
|
|
85
|
+
"./getCookieClient": {
|
|
86
|
+
"types": "./dist/src/client/functions/get_cookie.d.ts",
|
|
87
|
+
"import": "./dist/src/client/functions/get_cookie.js"
|
|
88
|
+
},
|
|
89
|
+
"./localeStaticParams": {
|
|
90
|
+
"types": "./dist/src/server/functions/locale_static_params.d.ts",
|
|
91
|
+
"import": "./dist/src/server/functions/locale_static_params.js"
|
|
92
|
+
},
|
|
93
|
+
"./use": {
|
|
94
|
+
"react-server": {
|
|
95
|
+
"types": "./dist/src/server/functions/use_functions.d.ts",
|
|
96
|
+
"import": "./dist/src/server/functions/use_functions.js"
|
|
97
|
+
},
|
|
98
|
+
"default": {
|
|
99
|
+
"types": "./dist/src/client/hooks/client_hooks.d.ts",
|
|
100
|
+
"import": "./dist/src/client/hooks/client_hooks.js"
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"./ThemeSwitcher": {
|
|
104
|
+
"types": "./dist/src/theme_switcher/components/theme_switcher.d.ts",
|
|
105
|
+
"import": "./dist/src/theme_switcher/components/theme_switcher.js"
|
|
106
|
+
},
|
|
107
|
+
"./firebaseAuthClient": {
|
|
108
|
+
"types": "./dist/src/firebase_auth/client/firebase_client.d.ts",
|
|
109
|
+
"import": "./dist/src/firebase_auth/client/firebase_client.js"
|
|
110
|
+
},
|
|
111
|
+
"./firebaseAuthClientProvider": {
|
|
112
|
+
"types": "./dist/src/firebase_auth/client/auth_user_provider.d.ts",
|
|
113
|
+
"import": "./dist/src/firebase_auth/client/auth_user_provider.js"
|
|
114
|
+
},
|
|
115
|
+
"./firebaseAuthServerProvider": {
|
|
116
|
+
"types": "./dist/src/firebase_auth/server/auth_user_server_provider.d.ts",
|
|
117
|
+
"import": "./dist/src/firebase_auth/server/auth_user_server_provider.js"
|
|
118
|
+
},
|
|
119
|
+
"./useFirebaseAuthUser": {
|
|
120
|
+
"react-server": {
|
|
121
|
+
"types": "./dist/src/firebase_auth/server/use_auth_user_server.d.ts",
|
|
122
|
+
"import": "./dist/src/firebase_auth/server/use_auth_user_server.js"
|
|
123
|
+
},
|
|
124
|
+
"default": {
|
|
125
|
+
"types": "./dist/src/firebase_auth/client/use_auth_user.d.ts",
|
|
126
|
+
"import": "./dist/src/firebase_auth/client/use_auth_user.js"
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"./getFirebaseAuthUser": {
|
|
130
|
+
"types": "./dist/src/firebase_auth/server/use_auth_user_server.d.ts",
|
|
131
|
+
"import": "./dist/src/firebase_auth/server/use_auth_user_server.js"
|
|
132
|
+
},
|
|
133
|
+
"./firebaseAuthActions": {
|
|
134
|
+
"types": "./dist/src/firebase_auth/client/auth_actions.d.ts",
|
|
135
|
+
"import": "./dist/src/firebase_auth/client/auth_actions.js"
|
|
136
|
+
},
|
|
137
|
+
"./firebaseAuthMiddleware": {
|
|
138
|
+
"types": "./dist/src/firebase_auth/middleware/update_session.d.ts",
|
|
139
|
+
"import": "./dist/src/firebase_auth/middleware/update_session.js"
|
|
140
|
+
},
|
|
141
|
+
"./cookieConsent": {
|
|
142
|
+
"types": "./dist/src/cookie_consent/index.d.ts",
|
|
143
|
+
"import": "./dist/src/cookie_consent/index.js"
|
|
144
|
+
},
|
|
145
|
+
"./CookieConsentProvider": {
|
|
146
|
+
"types": "./dist/src/cookie_consent/client/cookie_consent_provider.d.ts",
|
|
147
|
+
"import": "./dist/src/cookie_consent/client/cookie_consent_provider.js"
|
|
148
|
+
},
|
|
149
|
+
"./useCookieConsent": {
|
|
150
|
+
"types": "./dist/src/cookie_consent/client/use_cookie_consent.d.ts",
|
|
151
|
+
"import": "./dist/src/cookie_consent/client/use_cookie_consent.js"
|
|
152
|
+
},
|
|
153
|
+
"./CookieConsentDialog": {
|
|
154
|
+
"types": "./dist/src/cookie_consent/client/components/cookie_consent_dialog.d.ts",
|
|
155
|
+
"import": "./dist/src/cookie_consent/client/components/cookie_consent_dialog.js"
|
|
156
|
+
},
|
|
157
|
+
"./PrivacyPolicyUpdateDialog": {
|
|
158
|
+
"types": "./dist/src/cookie_consent/client/components/privacy_policy_update_dialog.d.ts",
|
|
159
|
+
"import": "./dist/src/cookie_consent/client/components/privacy_policy_update_dialog.js"
|
|
160
|
+
},
|
|
161
|
+
"./cookieConsentAnalytics": {
|
|
162
|
+
"types": "./dist/src/cookie_consent/client/components/cookie_consent_analytics.d.ts",
|
|
163
|
+
"import": "./dist/src/cookie_consent/client/components/cookie_consent_analytics.js"
|
|
164
|
+
},
|
|
165
|
+
"./errorHandling": {
|
|
166
|
+
"types": "./dist/src/error_handling/index.d.ts",
|
|
167
|
+
"import": "./dist/src/error_handling/index.js"
|
|
168
|
+
},
|
|
169
|
+
"./installConsoleErrorOverride": {
|
|
170
|
+
"types": "./dist/src/error_handling/install_console_error_override.d.ts",
|
|
171
|
+
"import": "./dist/src/error_handling/install_console_error_override.js"
|
|
172
|
+
},
|
|
173
|
+
"./installGlobalErrorOverride": {
|
|
174
|
+
"types": "./dist/src/error_handling/install_global_error_override.d.ts",
|
|
175
|
+
"import": "./dist/src/error_handling/install_global_error_override.js"
|
|
176
|
+
},
|
|
177
|
+
"./stringifyUnknown": {
|
|
178
|
+
"types": "./dist/src/error_handling/stringify_unknown.d.ts",
|
|
179
|
+
"import": "./dist/src/error_handling/stringify_unknown.js"
|
|
180
|
+
},
|
|
181
|
+
"./formatErrorMessage": {
|
|
182
|
+
"types": "./dist/src/error_handling/format_error_message.d.ts",
|
|
183
|
+
"import": "./dist/src/error_handling/format_error_message.js"
|
|
184
|
+
},
|
|
185
|
+
"./defaultIgnoredConsoleErrors": {
|
|
186
|
+
"types": "./dist/src/error_handling/default_ignored_console_errors.d.ts",
|
|
187
|
+
"import": "./dist/src/error_handling/default_ignored_console_errors.js"
|
|
188
|
+
},
|
|
189
|
+
"./createServerErrorAction": {
|
|
190
|
+
"types": "./dist/src/error_handling/create_server_error_action.d.ts",
|
|
191
|
+
"import": "./dist/src/error_handling/create_server_error_action.js"
|
|
192
|
+
},
|
|
193
|
+
"./isStaleDeployError": {
|
|
194
|
+
"types": "./dist/src/error_handling/is_stale_deploy_error.d.ts",
|
|
195
|
+
"import": "./dist/src/error_handling/is_stale_deploy_error.js"
|
|
196
|
+
},
|
|
197
|
+
"./clearClientCache": {
|
|
198
|
+
"types": "./dist/src/error_handling/clear_client_cache.d.ts",
|
|
199
|
+
"import": "./dist/src/error_handling/clear_client_cache.js"
|
|
200
|
+
},
|
|
201
|
+
"./db": {
|
|
202
|
+
"types": "./dist/src/db/index.d.ts",
|
|
203
|
+
"import": "./dist/src/db/index.js"
|
|
204
|
+
},
|
|
205
|
+
"./dbEslint": {
|
|
206
|
+
"types": "./dist/src/db/eslint_config.d.ts",
|
|
207
|
+
"import": "./dist/src/db/eslint_config.js"
|
|
208
|
+
},
|
|
209
|
+
"./dbHelpers": {
|
|
210
|
+
"types": "./dist/src/db/helpers.d.ts",
|
|
211
|
+
"import": "./dist/src/db/helpers.js"
|
|
212
|
+
},
|
|
213
|
+
"./dbTesting": {
|
|
214
|
+
"types": "./dist/src/db/testing.d.ts",
|
|
215
|
+
"import": "./dist/src/db/testing.js"
|
|
216
|
+
},
|
|
217
|
+
"./dbSchema": {
|
|
218
|
+
"types": "./dist/src/db/schema.d.ts",
|
|
219
|
+
"import": "./dist/src/db/schema.js"
|
|
220
|
+
},
|
|
221
|
+
"./vite": {
|
|
222
|
+
"types": "./dist/src/vite/index.d.ts",
|
|
223
|
+
"import": "./dist/src/vite/index.js"
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
"scripts": {
|
|
227
|
+
"test": "vitest run --coverage",
|
|
228
|
+
"bench": "vitest bench --run",
|
|
229
|
+
"build": "tsc"
|
|
230
|
+
},
|
|
231
|
+
"repository": {
|
|
232
|
+
"type": "git",
|
|
233
|
+
"url": "git+https://github.com/demian-ilnytskyi/cloudflare-next-intl.git"
|
|
234
|
+
},
|
|
235
|
+
"keywords": [
|
|
236
|
+
"nextjs",
|
|
237
|
+
"i18n",
|
|
238
|
+
"internationalization",
|
|
239
|
+
"localization",
|
|
240
|
+
"multilingual",
|
|
241
|
+
"translation",
|
|
242
|
+
"language",
|
|
243
|
+
"optimized",
|
|
244
|
+
"performance",
|
|
245
|
+
"bundle-size",
|
|
246
|
+
"fast",
|
|
247
|
+
"efficient",
|
|
248
|
+
"app-router",
|
|
249
|
+
"server-components",
|
|
250
|
+
"ssr",
|
|
251
|
+
"ssg",
|
|
252
|
+
"tree-shaking",
|
|
253
|
+
"dynamic-imports",
|
|
254
|
+
"react",
|
|
255
|
+
"next-intl",
|
|
256
|
+
"messages",
|
|
257
|
+
"formatting",
|
|
258
|
+
"icu"
|
|
259
|
+
],
|
|
260
|
+
"author": "Demian Ilnutskyi",
|
|
261
|
+
"license": "MIT",
|
|
262
|
+
"bugs": {
|
|
263
|
+
"url": "https://github.com/demian-ilnytskyi/cloudflare-next-intl/issues"
|
|
264
|
+
},
|
|
265
|
+
"homepage": "https://github.com/demian-ilnytskyi/cloudflare-next-intl#readme",
|
|
266
|
+
"dependencies": {
|
|
267
|
+
"@microsoft/clarity": "^1.0.2",
|
|
268
|
+
"@supabase/supabase-js": "^2.112.3",
|
|
269
|
+
"drizzle-kit": "^0.31.10",
|
|
270
|
+
"drizzle-orm": "^0.45.2",
|
|
271
|
+
"embedded-postgres": "^18.4.0-beta.17",
|
|
272
|
+
"firebase": "^12.17.0",
|
|
273
|
+
"jose": "^6.2.8",
|
|
274
|
+
"pg": "^8.23.0"
|
|
275
|
+
},
|
|
276
|
+
"peerDependencies": {
|
|
277
|
+
"next": ">=12.0.0",
|
|
278
|
+
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc <19.0.0 || ^19.0.0",
|
|
279
|
+
"typescript": ">=5.0.0",
|
|
280
|
+
"vite": ">=6"
|
|
281
|
+
},
|
|
282
|
+
"peerDependenciesMeta": {
|
|
283
|
+
"typescript": {
|
|
284
|
+
"optional": true
|
|
285
|
+
},
|
|
286
|
+
"vite": {
|
|
287
|
+
"optional": true
|
|
288
|
+
}
|
|
289
|
+
},
|
|
290
|
+
"devDependencies": {
|
|
291
|
+
"@eslint/eslintrc": "^3",
|
|
292
|
+
"@eslint/js": "^9.27.0",
|
|
293
|
+
"@testing-library/dom": "^10.4.1",
|
|
294
|
+
"@testing-library/jest-dom": "^7.0.0",
|
|
295
|
+
"@testing-library/react": "^16.3.2",
|
|
296
|
+
"@types/node": "^20.14.5",
|
|
297
|
+
"@types/pg": "^8.23.1",
|
|
298
|
+
"@types/react": "^19.0.0",
|
|
299
|
+
"@types/react-dom": "^19.0.0",
|
|
300
|
+
"@vitest/coverage-v8": "^3.2.7",
|
|
301
|
+
"eslint": "^9.28.0",
|
|
302
|
+
"eslint-config-next": "15.3.3",
|
|
303
|
+
"eslint-config-prettier": "^10.1.2",
|
|
304
|
+
"jsdom": "^29.1.1",
|
|
305
|
+
"next": "^15.3.0",
|
|
306
|
+
"react": "19.2.0",
|
|
307
|
+
"react-dom": "19.2.0",
|
|
308
|
+
"tsup": "^8.5.1",
|
|
309
|
+
"typescript": "^5.5.3",
|
|
310
|
+
"typescript-eslint": "^8.33.1",
|
|
311
|
+
"vite": "^7.0.0",
|
|
312
|
+
"vitest": "^3.0.8"
|
|
313
|
+
}
|
|
314
|
+
}
|