next-intl 3.12.0-provided-locale.1 → 3.12.1

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.
Files changed (42) hide show
  1. package/dist/development/middleware/utils.js +52 -1
  2. package/dist/development/react-server/useConfig.js +3 -1
  3. package/dist/development/react-server/useLocale.js +2 -3
  4. package/dist/development/server/react-server/getConfig.js +14 -18
  5. package/dist/development/server/react-server/getFormatter.js +3 -1
  6. package/dist/development/server/react-server/getLocale.js +3 -7
  7. package/dist/development/server/react-server/getMessages.js +3 -1
  8. package/dist/development/server/react-server/getNow.js +3 -1
  9. package/dist/development/server/react-server/getTimeZone.js +3 -1
  10. package/dist/development/server/react-server/getTranslations.js +2 -1
  11. package/dist/development/server/react-server/resolveLocaleArg.js +15 -0
  12. package/dist/esm/middleware/utils.js +1 -1
  13. package/dist/esm/react-server/useConfig.js +1 -1
  14. package/dist/esm/react-server/useLocale.js +1 -1
  15. package/dist/esm/server/react-server/getConfig.js +1 -1
  16. package/dist/esm/server/react-server/getFormatter.js +1 -1
  17. package/dist/esm/server/react-server/getLocale.js +1 -1
  18. package/dist/esm/server/react-server/getMessages.js +1 -1
  19. package/dist/esm/server/react-server/getNow.js +1 -1
  20. package/dist/esm/server/react-server/getTimeZone.js +1 -1
  21. package/dist/esm/server/react-server/getTranslations.js +1 -1
  22. package/dist/esm/server/react-server/resolveLocaleArg.js +1 -0
  23. package/dist/production/middleware/utils.js +1 -1
  24. package/dist/production/react-server/useConfig.js +1 -1
  25. package/dist/production/react-server/useLocale.js +1 -1
  26. package/dist/production/server/react-server/getConfig.js +1 -1
  27. package/dist/production/server/react-server/getFormatter.js +1 -1
  28. package/dist/production/server/react-server/getLocale.js +1 -1
  29. package/dist/production/server/react-server/getMessages.js +1 -1
  30. package/dist/production/server/react-server/getNow.js +1 -1
  31. package/dist/production/server/react-server/getTimeZone.js +1 -1
  32. package/dist/production/server/react-server/getTranslations.js +1 -1
  33. package/dist/production/server/react-server/resolveLocaleArg.js +1 -0
  34. package/dist/types/src/middleware/utils.d.ts +2 -0
  35. package/dist/types/src/navigation/react-client/ClientLink.d.ts +1 -1
  36. package/dist/types/src/navigation/react-client/createLocalizedPathnamesNavigation.d.ts +1 -1
  37. package/dist/types/src/navigation/react-client/createSharedPathnamesNavigation.d.ts +2 -2
  38. package/dist/types/src/server/react-client/index.d.ts +2 -2
  39. package/dist/types/src/server/react-server/getConfig.d.ts +1 -1
  40. package/dist/types/src/server/react-server/getLocale.d.ts +1 -3
  41. package/dist/types/src/server/react-server/resolveLocaleArg.d.ts +3 -0
  42. package/package.json +23 -20
@@ -7,9 +7,58 @@ var utils = require('../shared/utils.js');
7
7
  function getFirstPathnameSegment(pathname) {
8
8
  return pathname.split('/')[1];
9
9
  }
10
+ function isOptionalCatchAllSegment(pathname) {
11
+ return pathname.includes('[[...');
12
+ }
13
+ function isCatchAllSegment(pathname) {
14
+ return pathname.includes('[...');
15
+ }
16
+ function isDynamicSegment(pathname) {
17
+ return pathname.includes('[');
18
+ }
19
+ function comparePathnamePairs(a, b) {
20
+ const pathA = a.split('/');
21
+ const pathB = b.split('/');
22
+ const maxLength = Math.max(pathA.length, pathB.length);
23
+ for (let i = 0; i < maxLength; i++) {
24
+ const segmentA = pathA[i];
25
+ const segmentB = pathB[i];
26
+
27
+ // If one of the paths ends, prioritize the shorter path
28
+ if (!segmentA && segmentB) return -1;
29
+ if (segmentA && !segmentB) return 1;
30
+
31
+ // Prioritize static segments over dynamic segments
32
+ if (!isDynamicSegment(segmentA) && isDynamicSegment(segmentB)) return -1;
33
+ if (isDynamicSegment(segmentA) && !isDynamicSegment(segmentB)) return 1;
34
+
35
+ // Prioritize non-catch-all segments over catch-all segments
36
+ if (!isCatchAllSegment(segmentA) && isCatchAllSegment(segmentB)) return -1;
37
+ if (isCatchAllSegment(segmentA) && !isCatchAllSegment(segmentB)) return 1;
38
+
39
+ // Prioritize non-optional catch-all segments over optional catch-all segments
40
+ if (!isOptionalCatchAllSegment(segmentA) && isOptionalCatchAllSegment(segmentB)) {
41
+ return -1;
42
+ }
43
+ if (isOptionalCatchAllSegment(segmentA) && !isOptionalCatchAllSegment(segmentB)) {
44
+ return 1;
45
+ }
46
+ if (segmentA === segmentB) continue;
47
+ }
48
+
49
+ // Both pathnames are completely static
50
+ return 0;
51
+ }
52
+ function getSortedPathnames(pathnames) {
53
+ const sortedPathnames = pathnames.sort(comparePathnamePairs);
54
+ return sortedPathnames;
55
+ }
10
56
  function getInternalTemplate(pathnames, pathname, locale) {
57
+ const sortedPathnames = getSortedPathnames(Object.keys(pathnames));
58
+
11
59
  // Try to find a localized pathname that matches
12
- for (const [internalPathname, localizedPathnamesOrPathname] of Object.entries(pathnames)) {
60
+ for (const internalPathname of sortedPathnames) {
61
+ const localizedPathnamesOrPathname = pathnames[internalPathname];
13
62
  if (typeof localizedPathnamesOrPathname === 'string') {
14
63
  const localizedPathname = localizedPathnamesOrPathname;
15
64
  if (utils.matchesPathname(localizedPathname, pathname)) {
@@ -159,6 +208,7 @@ function normalizeTrailingSlash(pathname) {
159
208
  }
160
209
 
161
210
  exports.applyBasePath = applyBasePath;
211
+ exports.comparePathnamePairs = comparePathnamePairs;
162
212
  exports.findCaseInsensitiveLocale = findCaseInsensitiveLocale;
163
213
  exports.formatPathname = formatPathname;
164
214
  exports.formatTemplatePathname = formatTemplatePathname;
@@ -170,4 +220,5 @@ exports.getNormalizedPathname = getNormalizedPathname;
170
220
  exports.getPathWithSearch = getPathWithSearch;
171
221
  exports.getPathnameLocale = getPathnameLocale;
172
222
  exports.getRouteParams = getRouteParams;
223
+ exports.getSortedPathnames = getSortedPathnames;
173
224
  exports.isLocaleSupportedOnDomain = isLocaleSupportedOnDomain;
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
6
  var getConfig = require('../server/react-server/getConfig.js');
7
+ var useLocale = require('./useLocale.js');
7
8
 
8
9
  function useHook(hookName, promise) {
9
10
  try {
@@ -19,7 +20,8 @@ function useHook(hookName, promise) {
19
20
  }
20
21
  }
21
22
  function useConfig(hookName) {
22
- return useHook(hookName, getConfig.default());
23
+ const locale = useLocale.default();
24
+ return useHook(hookName, getConfig.default(locale));
23
25
  }
24
26
 
25
27
  exports.default = useConfig;
@@ -2,14 +2,13 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var useConfig = require('./useConfig.js');
5
+ var RequestLocale = require('../server/react-server/RequestLocale.js');
6
6
 
7
7
  function useLocale() {
8
8
  for (var _len = arguments.length, _ref = new Array(_len), _key = 0; _key < _len; _key++) {
9
9
  _ref[_key] = arguments[_key];
10
10
  }
11
- const config = useConfig.default('useLocale');
12
- return config.locale;
11
+ return RequestLocale.getRequestLocale();
13
12
  }
14
13
 
15
14
  exports.default = useLocale;
@@ -4,7 +4,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
6
  var core = require('use-intl/core');
7
- var RequestLocale = require('./RequestLocale.js');
8
7
  var getRuntimeConfig = require('next-intl/config');
9
8
 
10
9
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
@@ -23,31 +22,28 @@ function getDefaultTimeZoneImpl() {
23
22
  return Intl.DateTimeFormat().resolvedOptions().timeZone;
24
23
  }
25
24
  const getDefaultTimeZone = React.cache(getDefaultTimeZoneImpl);
26
- async function receiveRuntimeConfigImpl(localeOverride, getConfig) {
27
- var _result, _result2, _result3;
28
- // In case the consumer doesn't read `params.locale` and instead provides the
29
- // `locale` (either in a single-language workflow or because the locale is
30
- // read from the user settings), don't attempt to read the request locale.
31
- const params = {
32
- get locale() {
33
- return localeOverride || RequestLocale.getRequestLocale();
34
- }
35
- };
36
- let result = getConfig === null || getConfig === void 0 ? void 0 : getConfig(params);
25
+ async function receiveRuntimeConfigImpl(locale, getConfig) {
26
+ var _result, _result2;
27
+ let result = getConfig === null || getConfig === void 0 ? void 0 : getConfig({
28
+ locale
29
+ });
37
30
  if (result instanceof Promise) {
38
31
  result = await result;
39
32
  }
40
33
  return {
41
34
  ...result,
42
- locale: ((_result = result) === null || _result === void 0 ? void 0 : _result.locale) || params.locale,
43
- now: ((_result2 = result) === null || _result2 === void 0 ? void 0 : _result2.now) || getDefaultNow(),
44
- timeZone: ((_result3 = result) === null || _result3 === void 0 ? void 0 : _result3.timeZone) || getDefaultTimeZone()
35
+ now: ((_result = result) === null || _result === void 0 ? void 0 : _result.now) || getDefaultNow(),
36
+ timeZone: ((_result2 = result) === null || _result2 === void 0 ? void 0 : _result2.timeZone) || getDefaultTimeZone()
45
37
  };
46
38
  }
47
39
  const receiveRuntimeConfig = React.cache(receiveRuntimeConfigImpl);
48
- async function getConfigImpl(localeOverride) {
49
- const runtimeConfig = await receiveRuntimeConfig(localeOverride, getRuntimeConfig__default.default);
50
- return core.initializeConfig(runtimeConfig);
40
+ async function getConfigImpl(locale) {
41
+ const runtimeConfig = await receiveRuntimeConfig(locale, getRuntimeConfig__default.default);
42
+ const opts = {
43
+ ...runtimeConfig,
44
+ locale
45
+ };
46
+ return core.initializeConfig(opts);
51
47
  }
52
48
  const getConfig = React.cache(getConfigImpl);
53
49
  var getConfig$1 = getConfig;
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var React = require('react');
6
6
  var core = require('use-intl/core');
7
7
  var getConfig = require('./getConfig.js');
8
+ var resolveLocaleArg = require('./resolveLocaleArg.js');
8
9
 
9
10
  async function getFormatterCachedImpl(locale) {
10
11
  const config = await getConfig.default(locale);
@@ -19,7 +20,8 @@ const getFormatterCached = React.cache(getFormatterCachedImpl);
19
20
  * you can override it by passing in additional options.
20
21
  */
21
22
  async function getFormatter(opts) {
22
- return getFormatterCached(opts === null || opts === void 0 ? void 0 : opts.locale);
23
+ const locale = await resolveLocaleArg.default(opts);
24
+ return getFormatterCached(locale);
23
25
  }
24
26
 
25
27
  exports.default = getFormatter;
@@ -2,14 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var React = require('react');
6
- var getConfig = require('./getConfig.js');
5
+ var RequestLocale = require('./RequestLocale.js');
7
6
 
8
- async function getLocaleCachedImpl() {
9
- const config = await getConfig.default();
10
- return Promise.resolve(config.locale);
7
+ function getLocale() {
8
+ return Promise.resolve(RequestLocale.getRequestLocale());
11
9
  }
12
- const getLocaleCached = React.cache(getLocaleCachedImpl);
13
- var getLocale = getLocaleCached;
14
10
 
15
11
  exports.default = getLocale;
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
6
  var getConfig = require('./getConfig.js');
7
+ var resolveLocaleArg = require('./resolveLocaleArg.js');
7
8
 
8
9
  function getMessagesFromConfig(config) {
9
10
  if (!config.messages) {
@@ -17,7 +18,8 @@ async function getMessagesCachedImpl(locale) {
17
18
  }
18
19
  const getMessagesCached = React.cache(getMessagesCachedImpl);
19
20
  async function getMessages(opts) {
20
- return getMessagesCached(opts === null || opts === void 0 ? void 0 : opts.locale);
21
+ const locale = await resolveLocaleArg.default(opts);
22
+ return getMessagesCached(locale);
21
23
  }
22
24
 
23
25
  exports.default = getMessages;
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
6
  var getConfig = require('./getConfig.js');
7
+ var resolveLocaleArg = require('./resolveLocaleArg.js');
7
8
 
8
9
  async function getNowCachedImpl(locale) {
9
10
  const config = await getConfig.default(locale);
@@ -11,7 +12,8 @@ async function getNowCachedImpl(locale) {
11
12
  }
12
13
  const getNowCached = React.cache(getNowCachedImpl);
13
14
  async function getNow(opts) {
14
- return getNowCached(opts === null || opts === void 0 ? void 0 : opts.locale);
15
+ const locale = await resolveLocaleArg.default(opts);
16
+ return getNowCached(locale);
15
17
  }
16
18
 
17
19
  exports.default = getNow;
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
6
  var getConfig = require('./getConfig.js');
7
+ var resolveLocaleArg = require('./resolveLocaleArg.js');
7
8
 
8
9
  async function getTimeZoneCachedImpl(locale) {
9
10
  const config = await getConfig.default(locale);
@@ -11,7 +12,8 @@ async function getTimeZoneCachedImpl(locale) {
11
12
  }
12
13
  const getTimeZoneCached = React.cache(getTimeZoneCachedImpl);
13
14
  async function getTimeZone(opts) {
14
- return getTimeZoneCached(opts === null || opts === void 0 ? void 0 : opts.locale);
15
+ const locale = await resolveLocaleArg.default(opts);
16
+ return getTimeZoneCached(locale);
15
17
  }
16
18
 
17
19
  exports.default = getTimeZone;
@@ -6,6 +6,7 @@ var React = require('react');
6
6
  var core = require('use-intl/core');
7
7
  var messageFormatCache = require('../../shared/messageFormatCache.js');
8
8
  var getConfig = require('./getConfig.js');
9
+ var getLocale = require('./getLocale.js');
9
10
 
10
11
  // Maintainer note: `getTranslations` has two different call signatures.
11
12
  // We need to define these with function overloads, otherwise TypeScript
@@ -23,7 +24,7 @@ async function getTranslations(namespaceOrOpts) {
23
24
  locale = namespaceOrOpts.locale;
24
25
  namespace = namespaceOrOpts.namespace;
25
26
  }
26
- const config = await getConfig.default(locale);
27
+ const config = await getConfig.default(locale || (await getLocale.default()));
27
28
  return core.createTranslator({
28
29
  ...config,
29
30
  messageFormatCache: messageFormatCache.getMessageFormatCache(),
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var getLocale = require('./getLocale.js');
6
+
7
+ function resolveLocaleArg(opts) {
8
+ if (opts !== null && opts !== void 0 && opts.locale) {
9
+ return Promise.resolve(opts.locale);
10
+ } else {
11
+ return getLocale.default();
12
+ }
13
+ }
14
+
15
+ exports.default = resolveLocaleArg;
@@ -1 +1 @@
1
- import{matchesPathname as n,templateToRegex as t}from"../shared/utils.js";function e(n){return n.split("/")[1]}function o(t,e,o){for(const[r,c]of Object.entries(t))if("string"==typeof c){if(n(c,e))return[void 0,r]}else{const t=Object.entries(c),i=t.findIndex((n=>{let[t]=n;return t===o}));i>0&&t.unshift(t.splice(i,1)[0]);for(const[o,c]of t)if(n(c,e))return[o,r]}for(const o of Object.keys(t))if(n(o,e))return[void 0,o];return[void 0,void 0]}function r(n,t,e,o){const r=u(t,n);let c="";return o&&(c="/".concat(o)),c+=f(e,r),c=p(c),c}function c(n,t){n.endsWith("/")||(n+="/");const e=n.match(new RegExp("^/(".concat(t.join("|"),")/(.*)"),"i"));let o=e?"/"+e[2]:n;return"/"!==o&&(o=p(o)),o}function i(n,t){return t.find((t=>t.toLowerCase()===n.toLowerCase()))}function l(n,t){const o=e(n);return i(o,t)?o:void 0}function u(n,e){const o=t(n).exec(e);if(!o)return;const r={};for(let t=1;t<o.length;t++){var c;const e=null===(c=n.match(/\[([^\]]+)\]/g))||void 0===c?void 0:c[t-1].replace(/[[\]]/g,"");e&&(r[e]=o[t])}return r}function f(n,t){if(!t)return n;let e=n=n.replace(/\[\[/g,"[").replace(/\]\]/g,"]");return Object.entries(t).forEach((n=>{let[t,o]=n;e=e.replace("[".concat(t,"]"),o)})),e}function s(n,t){let e=n;return t&&(e+=t),e}function a(n){var t,e;return null!==(t=null!==(e=n.get("x-forwarded-host"))&&void 0!==e?e:n.get("host"))&&void 0!==t?t:void 0}function d(n,t){return t.defaultLocale===n||!t.locales||t.locales.includes(n)}function v(n,t,e){let o;return n&&d(t,n)&&(o=n),o||(o=e.find((n=>n.defaultLocale===t))),o||(o=e.find((n=>null!=n.locales&&n.locales.includes(t)))),o||null!=(null==n?void 0:n.locales)||(o=n),o||(o=e.find((n=>!n.locales))),o}function h(n,t){return p(t+n)}function p(n){return n.endsWith("/")&&(n=n.slice(0,-1)),n}export{h as applyBasePath,i as findCaseInsensitiveLocale,f as formatPathname,r as formatTemplatePathname,v as getBestMatchingDomain,e as getFirstPathnameSegment,a as getHost,o as getInternalTemplate,c as getNormalizedPathname,s as getPathWithSearch,l as getPathnameLocale,u as getRouteParams,d as isLocaleSupportedOnDomain};
1
+ import{matchesPathname as n,templateToRegex as t}from"../shared/utils.js";function e(n){return n.split("/")[1]}function r(n){return n.includes("[[...")}function o(n){return n.includes("[...")}function i(n){return n.includes("[")}function u(n,t){const e=n.split("/"),u=t.split("/"),c=Math.max(e.length,u.length);for(let n=0;n<c;n++){const t=e[n],c=u[n];if(!t&&c)return-1;if(t&&!c)return 1;if(!i(t)&&i(c))return-1;if(i(t)&&!i(c))return 1;if(!o(t)&&o(c))return-1;if(o(t)&&!o(c))return 1;if(!r(t)&&r(c))return-1;if(r(t)&&!r(c))return 1}return 0}function c(n){return n.sort(u)}function l(t,e,r){const o=c(Object.keys(t));for(const i of o){const o=t[i];if("string"==typeof o){if(n(o,e))return[void 0,i]}else{const t=Object.entries(o),u=t.findIndex((n=>{let[t]=n;return t===r}));u>0&&t.unshift(t.splice(u,1)[0]);for(const[r,o]of t)if(n(o,e))return[r,i]}}for(const r of Object.keys(t))if(n(r,e))return[void 0,r];return[void 0,void 0]}function f(n,t,e,r){const o=h(t,n);let i="";return r&&(i="/".concat(r)),i+=v(e,o),i=b(i),i}function s(n,t){n.endsWith("/")||(n+="/");const e=n.match(new RegExp("^/(".concat(t.join("|"),")/(.*)"),"i"));let r=e?"/"+e[2]:n;return"/"!==r&&(r=b(r)),r}function d(n,t){return t.find((t=>t.toLowerCase()===n.toLowerCase()))}function a(n,t){const r=e(n);return d(r,t)?r:void 0}function h(n,e){const r=t(n).exec(e);if(!r)return;const o={};for(let t=1;t<r.length;t++){var i;const e=null===(i=n.match(/\[([^\]]+)\]/g))||void 0===i?void 0:i[t-1].replace(/[[\]]/g,"");e&&(o[e]=r[t])}return o}function v(n,t){if(!t)return n;let e=n=n.replace(/\[\[/g,"[").replace(/\]\]/g,"]");return Object.entries(t).forEach((n=>{let[t,r]=n;e=e.replace("[".concat(t,"]"),r)})),e}function p(n,t){let e=n;return t&&(e+=t),e}function g(n){var t,e;return null!==(t=null!==(e=n.get("x-forwarded-host"))&&void 0!==e?e:n.get("host"))&&void 0!==t?t:void 0}function j(n,t){return t.defaultLocale===n||!t.locales||t.locales.includes(n)}function x(n,t,e){let r;return n&&j(t,n)&&(r=n),r||(r=e.find((n=>n.defaultLocale===t))),r||(r=e.find((n=>null!=n.locales&&n.locales.includes(t)))),r||null!=(null==n?void 0:n.locales)||(r=n),r||(r=e.find((n=>!n.locales))),r}function m(n,t){return b(t+n)}function b(n){return n.endsWith("/")&&(n=n.slice(0,-1)),n}export{m as applyBasePath,u as comparePathnamePairs,d as findCaseInsensitiveLocale,v as formatPathname,f as formatTemplatePathname,x as getBestMatchingDomain,e as getFirstPathnameSegment,g as getHost,l as getInternalTemplate,s as getNormalizedPathname,p as getPathWithSearch,a as getPathnameLocale,h as getRouteParams,c as getSortedPathnames,j as isLocaleSupportedOnDomain};
@@ -1 +1 @@
1
- import{use as e}from"react";import n from"../server/react-server/getConfig.js";function r(r){return function(n,r){try{return e(r)}catch(e){throw e instanceof TypeError&&e.message.includes("Cannot read properties of null (reading 'use')")?new Error("`".concat(n,"` is not callable within an async component. Please refer to https://next-intl-docs.vercel.app/docs/environments/server-client-components#async-components"),{cause:e}):e}}(r,n())}export{r as default};
1
+ import{use as e}from"react";import r from"../server/react-server/getConfig.js";import n from"./useLocale.js";function t(t){const o=n();return function(r,n){try{return e(n)}catch(e){throw e instanceof TypeError&&e.message.includes("Cannot read properties of null (reading 'use')")?new Error("`".concat(r,"` is not callable within an async component. Please refer to https://next-intl-docs.vercel.app/docs/environments/server-client-components#async-components"),{cause:e}):e}}(t,r(o))}export{t as default};
@@ -1 +1 @@
1
- import e from"./useConfig.js";function r(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];return e("useLocale").locale}export{r as default};
1
+ import{getRequestLocale as r}from"../server/react-server/RequestLocale.js";function e(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];return r()}export{e as default};
@@ -1 +1 @@
1
- import{cache as o}from"react";import{initializeConfig as n}from"use-intl/core";import{getRequestLocale as t}from"./RequestLocale.js";import e from"next-intl/config";const i=o((function(){return new Date}));const r=o((function(){return Intl.DateTimeFormat().resolvedOptions().timeZone}));const l=o((async function(o,n){var e,l,a;const c={get locale(){return o||t()}};let u=null==n?void 0:n(c);return u instanceof Promise&&(u=await u),{...u,locale:(null===(e=u)||void 0===e?void 0:e.locale)||c.locale,now:(null===(l=u)||void 0===l?void 0:l.now)||i(),timeZone:(null===(a=u)||void 0===a?void 0:a.timeZone)||r()}}));var a=o((async function(o){const t=await l(o,e);return n(t)}));export{a as default};
1
+ import{cache as n}from"react";import{initializeConfig as o}from"use-intl/core";import t from"next-intl/config";const e=n((function(){return new Date}));const i=n((function(){return Intl.DateTimeFormat().resolvedOptions().timeZone}));const r=n((async function(n,o){var t,r;let a=null==o?void 0:o({locale:n});return a instanceof Promise&&(a=await a),{...a,now:(null===(t=a)||void 0===t?void 0:t.now)||e(),timeZone:(null===(r=a)||void 0===r?void 0:r.timeZone)||i()}}));var a=n((async function(n){const e={...await r(n,t),locale:n};return o(e)}));export{a as default};
@@ -1 +1 @@
1
- import{cache as o}from"react";import{createFormatter as t}from"use-intl/core";import n from"./getConfig.js";const r=o((async function(o){const r=await n(o);return t(r)}));async function c(o){return r(null==o?void 0:o.locale)}export{c as default};
1
+ import{cache as o}from"react";import{createFormatter as t}from"use-intl/core";import r from"./getConfig.js";import n from"./resolveLocaleArg.js";const e=o((async function(o){const n=await r(o);return t(n)}));async function a(o){const t=await n(o);return e(t)}export{a as default};
@@ -1 +1 @@
1
- import{cache as o}from"react";import r from"./getConfig.js";var t=o((async function(){const o=await r();return Promise.resolve(o.locale)}));export{t as default};
1
+ import{getRequestLocale as e}from"./RequestLocale.js";function o(){return Promise.resolve(e())}export{o as default};
@@ -1 +1 @@
1
- import{cache as e}from"react";import o from"./getConfig.js";function t(e){if(!e.messages)throw new Error("No messages found. Have you configured them correctly? See https://next-intl-docs.vercel.app/docs/configuration#messages");return e.messages}const n=e((async function(e){return t(await o(e))}));async function r(e){return n(null==e?void 0:e.locale)}export{r as default,t as getMessagesFromConfig};
1
+ import{cache as e}from"react";import o from"./getConfig.js";import r from"./resolveLocaleArg.js";function t(e){if(!e.messages)throw new Error("No messages found. Have you configured them correctly? See https://next-intl-docs.vercel.app/docs/configuration#messages");return e.messages}const s=e((async function(e){return t(await o(e))}));async function n(e){const o=await r(e);return s(o)}export{n as default,t as getMessagesFromConfig};
@@ -1 +1 @@
1
- import{cache as n}from"react";import o from"./getConfig.js";const t=n((async function(n){return(await o(n)).now}));async function r(n){return t(null==n?void 0:n.locale)}export{r as default};
1
+ import{cache as o}from"react";import t from"./getConfig.js";import r from"./resolveLocaleArg.js";const n=o((async function(o){return(await t(o)).now}));async function a(o){const t=await r(o);return n(t)}export{a as default};
@@ -1 +1 @@
1
- import{cache as t}from"react";import n from"./getConfig.js";const o=t((async function(t){return(await n(t)).timeZone}));async function r(t){return o(null==t?void 0:t.locale)}export{r as default};
1
+ import{cache as t}from"react";import o from"./getConfig.js";import r from"./resolveLocaleArg.js";const n=t((async function(t){return(await o(t)).timeZone}));async function e(t){const o=await r(t);return n(o)}export{e as default};
@@ -1 +1 @@
1
- import{cache as e}from"react";import{createTranslator as a}from"use-intl/core";import{getMessageFormatCache as s}from"../../shared/messageFormatCache.js";import r from"./getConfig.js";var t=e((async function(e){let t,o;"string"==typeof e?t=e:e&&(o=e.locale,t=e.namespace);const m=await r(o);return a({...m,messageFormatCache:s(),namespace:t,messages:m.messages})}));export{t as default};
1
+ import{cache as e}from"react";import{createTranslator as a}from"use-intl/core";import{getMessageFormatCache as s}from"../../shared/messageFormatCache.js";import t from"./getConfig.js";import o from"./getLocale.js";var r=e((async function(e){let r,m;"string"==typeof e?r=e:e&&(m=e.locale,r=e.namespace);const c=await t(m||await o());return a({...c,messageFormatCache:s(),namespace:r,messages:c.messages})}));export{r as default};
@@ -0,0 +1 @@
1
+ import e from"./getLocale.js";function l(l){return null!=l&&l.locale?Promise.resolve(l.locale):e()}export{l as default};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../shared/utils.js");function t(e){return e.split("/")[1]}function n(e,t){return t.find((t=>t.toLowerCase()===e.toLowerCase()))}function o(t,n){const o=e.templateToRegex(t).exec(n);if(!o)return;const r={};for(let e=1;e<o.length;e++){var a;const n=null===(a=t.match(/\[([^\]]+)\]/g))||void 0===a?void 0:a[e-1].replace(/[[\]]/g,"");n&&(r[n]=o[e])}return r}function r(e,t){if(!t)return e;let n=e=e.replace(/\[\[/g,"[").replace(/\]\]/g,"]");return Object.entries(t).forEach((e=>{let[t,o]=e;n=n.replace("[".concat(t,"]"),o)})),n}function a(e,t){return t.defaultLocale===e||!t.locales||t.locales.includes(e)}function s(e){return e.endsWith("/")&&(e=e.slice(0,-1)),e}exports.applyBasePath=function(e,t){return s(t+e)},exports.findCaseInsensitiveLocale=n,exports.formatPathname=r,exports.formatTemplatePathname=function(e,t,n,a){const c=o(t,e);let i="";return a&&(i="/".concat(a)),i+=r(n,c),i=s(i),i},exports.getBestMatchingDomain=function(e,t,n){let o;return e&&a(t,e)&&(o=e),o||(o=n.find((e=>e.defaultLocale===t))),o||(o=n.find((e=>null!=e.locales&&e.locales.includes(t)))),o||null!=(null==e?void 0:e.locales)||(o=e),o||(o=n.find((e=>!e.locales))),o},exports.getFirstPathnameSegment=t,exports.getHost=function(e){var t,n;return null!==(t=null!==(n=e.get("x-forwarded-host"))&&void 0!==n?n:e.get("host"))&&void 0!==t?t:void 0},exports.getInternalTemplate=function(t,n,o){for(const[r,a]of Object.entries(t))if("string"==typeof a){const t=a;if(e.matchesPathname(t,n))return[void 0,r]}else{const t=Object.entries(a),s=t.findIndex((e=>{let[t]=e;return t===o}));s>0&&t.unshift(t.splice(s,1)[0]);for(const[o,a]of t)if(e.matchesPathname(a,n))return[o,r]}for(const o of Object.keys(t))if(e.matchesPathname(o,n))return[void 0,o];return[void 0,void 0]},exports.getNormalizedPathname=function(e,t){e.endsWith("/")||(e+="/");const n=e.match(new RegExp("^/(".concat(t.join("|"),")/(.*)"),"i"));let o=n?"/"+n[2]:e;return"/"!==o&&(o=s(o)),o},exports.getPathWithSearch=function(e,t){let n=e;return t&&(n+=t),n},exports.getPathnameLocale=function(e,o){const r=t(e);return n(r,o)?r:void 0},exports.getRouteParams=o,exports.isLocaleSupportedOnDomain=a;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../shared/utils.js");function t(e){return e.split("/")[1]}function n(e){return e.includes("[[...")}function r(e){return e.includes("[...")}function o(e){return e.includes("[")}function i(e,t){const i=e.split("/"),s=t.split("/"),c=Math.max(i.length,s.length);for(let e=0;e<c;e++){const t=i[e],c=s[e];if(!t&&c)return-1;if(t&&!c)return 1;if(!o(t)&&o(c))return-1;if(o(t)&&!o(c))return 1;if(!r(t)&&r(c))return-1;if(r(t)&&!r(c))return 1;if(!n(t)&&n(c))return-1;if(n(t)&&!n(c))return 1}return 0}function s(e){return e.sort(i)}function c(e,t){return t.find((t=>t.toLowerCase()===e.toLowerCase()))}function a(t,n){const r=e.templateToRegex(t).exec(n);if(!r)return;const o={};for(let e=1;e<r.length;e++){var i;const n=null===(i=t.match(/\[([^\]]+)\]/g))||void 0===i?void 0:i[e-1].replace(/[[\]]/g,"");n&&(o[n]=r[e])}return o}function u(e,t){if(!t)return e;let n=e=e.replace(/\[\[/g,"[").replace(/\]\]/g,"]");return Object.entries(t).forEach((e=>{let[t,r]=e;n=n.replace("[".concat(t,"]"),r)})),n}function l(e,t){return t.defaultLocale===e||!t.locales||t.locales.includes(e)}function f(e){return e.endsWith("/")&&(e=e.slice(0,-1)),e}exports.applyBasePath=function(e,t){return f(t+e)},exports.comparePathnamePairs=i,exports.findCaseInsensitiveLocale=c,exports.formatPathname=u,exports.formatTemplatePathname=function(e,t,n,r){const o=a(t,e);let i="";return r&&(i="/".concat(r)),i+=u(n,o),i=f(i),i},exports.getBestMatchingDomain=function(e,t,n){let r;return e&&l(t,e)&&(r=e),r||(r=n.find((e=>e.defaultLocale===t))),r||(r=n.find((e=>null!=e.locales&&e.locales.includes(t)))),r||null!=(null==e?void 0:e.locales)||(r=e),r||(r=n.find((e=>!e.locales))),r},exports.getFirstPathnameSegment=t,exports.getHost=function(e){var t,n;return null!==(t=null!==(n=e.get("x-forwarded-host"))&&void 0!==n?n:e.get("host"))&&void 0!==t?t:void 0},exports.getInternalTemplate=function(t,n,r){const o=s(Object.keys(t));for(const i of o){const o=t[i];if("string"==typeof o){const t=o;if(e.matchesPathname(t,n))return[void 0,i]}else{const t=Object.entries(o),s=t.findIndex((e=>{let[t]=e;return t===r}));s>0&&t.unshift(t.splice(s,1)[0]);for(const[r,o]of t)if(e.matchesPathname(o,n))return[r,i]}}for(const r of Object.keys(t))if(e.matchesPathname(r,n))return[void 0,r];return[void 0,void 0]},exports.getNormalizedPathname=function(e,t){e.endsWith("/")||(e+="/");const n=e.match(new RegExp("^/(".concat(t.join("|"),")/(.*)"),"i"));let r=n?"/"+n[2]:e;return"/"!==r&&(r=f(r)),r},exports.getPathWithSearch=function(e,t){let n=e;return t&&(n+=t),n},exports.getPathnameLocale=function(e,n){const r=t(e);return c(r,n)?r:void 0},exports.getRouteParams=a,exports.getSortedPathnames=s,exports.isLocaleSupportedOnDomain=l;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("../server/react-server/getConfig.js");exports.default=function(n){return function(r,n){try{return e.use(n)}catch(e){throw e instanceof TypeError&&e.message.includes("Cannot read properties of null (reading 'use')")?new Error("`".concat(r,"` is not callable within an async component. Please refer to https://next-intl-docs.vercel.app/docs/environments/server-client-components#async-components"),{cause:e}):e}}(n,r.default())};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("../server/react-server/getConfig.js"),t=require("./useLocale.js");exports.default=function(n){const s=t.default();return function(r,t){try{return e.use(t)}catch(e){throw e instanceof TypeError&&e.message.includes("Cannot read properties of null (reading 'use')")?new Error("`".concat(r,"` is not callable within an async component. Please refer to https://next-intl-docs.vercel.app/docs/environments/server-client-components#async-components"),{cause:e}):e}}(n,r.default(s))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./useConfig.js");exports.default=function(){for(var r=arguments.length,t=new Array(r),u=0;u<r;u++)t[u]=arguments[u];return e.default("useLocale").locale};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../server/react-server/RequestLocale.js");exports.default=function(){for(var r=arguments.length,t=new Array(r),s=0;s<r;s++)t[s]=arguments[s];return e.getRequestLocale()};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("use-intl/core"),n=require("./RequestLocale.js");function o(e){return e&&e.__esModule?e:{default:e}}var i=o(require("next-intl/config"));const r=e.cache((function(){return new Date}));const c=e.cache((function(){return Intl.DateTimeFormat().resolvedOptions().timeZone}));const a=e.cache((async function(e,t){var o,i,a;const l={get locale(){return e||n.getRequestLocale()}};let u=null==t?void 0:t(l);return u instanceof Promise&&(u=await u),{...u,locale:(null===(o=u)||void 0===o?void 0:o.locale)||l.locale,now:(null===(i=u)||void 0===i?void 0:i.now)||r(),timeZone:(null===(a=u)||void 0===a?void 0:a.timeZone)||c()}}));var l=e.cache((async function(e){const n=await a(e,i.default);return t.initializeConfig(n)}));exports.default=l;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),n=require("use-intl/core");function t(e){return e&&e.__esModule?e:{default:e}}var o=t(require("next-intl/config"));const i=e.cache((function(){return new Date}));const r=e.cache((function(){return Intl.DateTimeFormat().resolvedOptions().timeZone}));const c=e.cache((async function(e,n){var t,o;let c=null==n?void 0:n({locale:e});return c instanceof Promise&&(c=await c),{...c,now:(null===(t=c)||void 0===t?void 0:t.now)||i(),timeZone:(null===(o=c)||void 0===o?void 0:o.timeZone)||r()}}));var a=e.cache((async function(e){const t={...await c(e,o.default),locale:e};return n.initializeConfig(t)}));exports.default=a;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("use-intl/core"),t=require("./getConfig.js");const c=e.cache((async function(e){const c=await t.default(e);return r.createFormatter(c)}));exports.default=async function(e){return c(null==e?void 0:e.locale)};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("use-intl/core"),t=require("./getConfig.js"),a=require("./resolveLocaleArg.js");const c=e.cache((async function(e){const a=await t.default(e);return r.createFormatter(a)}));exports.default=async function(e){const r=await a.default(e);return c(r)};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("./getConfig.js");var t=e.cache((async function(){const e=await r.default();return Promise.resolve(e.locale)}));exports.default=t;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./RequestLocale.js");exports.default=function(){return Promise.resolve(e.getRequestLocale())};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("./getConfig.js");function s(e){if(!e.messages)throw new Error("No messages found. Have you configured them correctly? See https://next-intl-docs.vercel.app/docs/configuration#messages");return e.messages}const t=e.cache((async function(e){return s(await r.default(e))}));exports.default=async function(e){return t(null==e?void 0:e.locale)},exports.getMessagesFromConfig=s;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("./getConfig.js"),s=require("./resolveLocaleArg.js");function t(e){if(!e.messages)throw new Error("No messages found. Have you configured them correctly? See https://next-intl-docs.vercel.app/docs/configuration#messages");return e.messages}const o=e.cache((async function(e){return t(await r.default(e))}));exports.default=async function(e){const r=await s.default(e);return o(r)},exports.getMessagesFromConfig=t;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("./getConfig.js");const r=e.cache((async function(e){return(await t.default(e)).now}));exports.default=async function(e){return r(null==e?void 0:e.locale)};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("./getConfig.js"),t=require("./resolveLocaleArg.js");const a=e.cache((async function(e){return(await r.default(e)).now}));exports.default=async function(e){const r=await t.default(e);return a(r)};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("./getConfig.js");const r=e.cache((async function(e){return(await t.default(e)).timeZone}));exports.default=async function(e){return r(null==e?void 0:e.locale)};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("./getConfig.js"),r=require("./resolveLocaleArg.js");const a=e.cache((async function(e){return(await t.default(e)).timeZone}));exports.default=async function(e){const t=await r.default(e);return a(t)};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),a=require("use-intl/core"),r=require("../../shared/messageFormatCache.js"),s=require("./getConfig.js");var t=e.cache((async function(e){let t,c;"string"==typeof e?t=e:e&&(c=e.locale,t=e.namespace);const o=await s.default(c);return a.createTranslator({...o,messageFormatCache:r.getMessageFormatCache(),namespace:t,messages:o.messages})}));exports.default=t;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),a=require("use-intl/core"),r=require("../../shared/messageFormatCache.js"),s=require("./getConfig.js"),t=require("./getLocale.js");var c=e.cache((async function(e){let c,o;"string"==typeof e?c=e:e&&(o=e.locale,c=e.namespace);const u=await s.default(o||await t.default());return a.createTranslator({...u,messageFormatCache:r.getMessageFormatCache(),namespace:c,messages:u.messages})}));exports.default=c;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./getLocale.js");exports.default=function(l){return null!=l&&l.locale?Promise.resolve(l.locale):e.default()};
@@ -1,6 +1,8 @@
1
1
  import { AllLocales } from '../shared/types';
2
2
  import { DomainConfig, MiddlewareConfigWithDefaults } from './NextIntlMiddlewareConfig';
3
3
  export declare function getFirstPathnameSegment(pathname: string): string;
4
+ export declare function comparePathnamePairs(a: string, b: string): number;
5
+ export declare function getSortedPathnames(pathnames: Array<string>): string[];
4
6
  export declare function getInternalTemplate<Locales extends AllLocales, Pathnames extends NonNullable<MiddlewareConfigWithDefaults<Locales>['pathnames']>>(pathnames: Pathnames, pathname: string, locale: Locales[number]): [Locales[number] | undefined, keyof Pathnames | undefined];
5
7
  export declare function formatTemplatePathname(sourcePathname: string, sourceTemplate: string, targetTemplate: string, localePrefix?: string): string;
6
8
  /**
@@ -59,6 +59,6 @@ declare const ClientLinkWithRef: <Locales extends AllLocales>(props: Omit<Omit<O
59
59
  }, "ref"> & React.RefAttributes<HTMLAnchorElement>, "locale"> & {
60
60
  locale?: Locales[number] | undefined;
61
61
  } & {
62
- ref?: React.Ref<HTMLAnchorElement> | undefined;
62
+ ref?: React.LegacyRef<HTMLAnchorElement> | undefined;
63
63
  }) => ReactElement;
64
64
  export default ClientLinkWithRef;
@@ -42,7 +42,7 @@ export default function createLocalizedPathnamesNavigation<Locales extends AllLo
42
42
  }, "ref"> & React.RefAttributes<HTMLAnchorElement>, "locale"> & {
43
43
  locale?: string | undefined;
44
44
  } & {
45
- ref?: React.Ref<HTMLAnchorElement> | undefined;
45
+ ref?: React.LegacyRef<HTMLAnchorElement> | undefined;
46
46
  }, "href" | "name"> & {
47
47
  href: Pathname extends `${string}[[...${string}` ? Pathname | ({
48
48
  pathname: Pathname;
@@ -40,9 +40,9 @@ export default function createSharedPathnamesNavigation<Locales extends AllLocal
40
40
  }, "ref"> & React.RefAttributes<HTMLAnchorElement>, "locale"> & {
41
41
  locale?: Locales[number] | undefined;
42
42
  } & {
43
- ref?: React.Ref<HTMLAnchorElement> | undefined;
43
+ ref?: React.LegacyRef<HTMLAnchorElement> | undefined;
44
44
  }, "localePrefix"> & {
45
- ref?: React.Ref<HTMLAnchorElement> | undefined;
45
+ ref?: React.LegacyRef<HTMLAnchorElement> | undefined;
46
46
  }) => ReactElement;
47
47
  redirect: (pathname: string, type?: import("next/navigation").RedirectType | undefined) => never;
48
48
  permanentRedirect: (pathname: string, type?: import("next/navigation").RedirectType | undefined) => never;
@@ -1,9 +1,9 @@
1
- import type { getRequestConfig as getRequestConfig_type, getFormatter as getFormatter_type, getNow as getNow_type, getTimeZone as getTimeZone_type, getMessages as getMessages_type, unstable_setRequestLocale as unstable_setRequestLocale_type } from '../react-server';
1
+ import type { getRequestConfig as getRequestConfig_type, getFormatter as getFormatter_type, getNow as getNow_type, getTimeZone as getTimeZone_type, getMessages as getMessages_type, getLocale as getLocale_type, unstable_setRequestLocale as unstable_setRequestLocale_type } from '../react-server';
2
2
  export declare function getRequestConfig(...args: Parameters<typeof getRequestConfig_type>): ReturnType<typeof getRequestConfig_type>;
3
3
  export declare const getFormatter: typeof getFormatter_type;
4
4
  export declare const getNow: typeof getNow_type;
5
5
  export declare const getTimeZone: typeof getTimeZone_type;
6
6
  export declare const getMessages: typeof getMessages_type;
7
- export declare const getLocale: () => Promise<string>;
7
+ export declare const getLocale: typeof getLocale_type;
8
8
  export declare const getTranslations: () => never;
9
9
  export declare const unstable_setRequestLocale: typeof unstable_setRequestLocale_type;
@@ -1,5 +1,5 @@
1
1
  import { IntlConfig } from 'use-intl/core';
2
- declare function getConfigImpl(localeOverride?: string): Promise<IntlConfig & {
2
+ declare function getConfigImpl(locale: string): Promise<IntlConfig & {
3
3
  getMessageFallback: NonNullable<IntlConfig['getMessageFallback']>;
4
4
  now: NonNullable<IntlConfig['now']>;
5
5
  onError: NonNullable<IntlConfig['onError']>;
@@ -1,3 +1 @@
1
- declare function getLocaleCachedImpl(): Promise<string>;
2
- declare const getLocaleCached: typeof getLocaleCachedImpl;
3
- export default getLocaleCached;
1
+ export default function getLocale(): Promise<string>;
@@ -0,0 +1,3 @@
1
+ export default function resolveLocaleArg(opts?: {
2
+ locale?: string;
3
+ }): Promise<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-intl",
3
- "version": "3.12.0-provided-locale.1",
3
+ "version": "3.12.1",
4
4
  "sideEffects": false,
5
5
  "author": "Jan Amann <jan@amann.work>",
6
6
  "funding": [
@@ -16,6 +16,16 @@
16
16
  "type": "git",
17
17
  "url": "https://github.com/amannn/next-intl"
18
18
  },
19
+ "scripts": {
20
+ "build": "rm -rf dist && rollup -c",
21
+ "test": "TZ=Europe/Berlin vitest",
22
+ "lint": "pnpm run lint:source && pnpm run lint:package",
23
+ "lint:source": "eslint src test && tsc --noEmit",
24
+ "lint:package": "publint && attw --pack",
25
+ "prepublishOnly": "CI=true turbo test && turbo lint && turbo build && cp ../../README.md .",
26
+ "postpublish": "git checkout . && rm ./README.md",
27
+ "size": "size-limit"
28
+ },
19
29
  "main": "./dist/index.react-client.js",
20
30
  "module": "./dist/esm/index.react-client.js",
21
31
  "typings": "./dist/types/src/index.react-client.d.ts",
@@ -72,7 +82,7 @@
72
82
  "dependencies": {
73
83
  "@formatjs/intl-localematcher": "^0.2.32",
74
84
  "negotiator": "^0.6.3",
75
- "use-intl": "^3.11.3"
85
+ "use-intl": "^3.12.1"
76
86
  },
77
87
  "peerDependencies": {
78
88
  "next": "^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0",
@@ -85,16 +95,16 @@
85
95
  "@testing-library/react": "^13.0.0",
86
96
  "@types/negotiator": "^0.6.1",
87
97
  "@types/node": "^20.1.2",
88
- "@types/react": "18.2.34",
89
- "@types/react-dom": "^18.2.17",
98
+ "@types/react": "^18.3.0",
99
+ "@types/react-dom": "^18.3.0",
90
100
  "eslint": "^8.54.0",
91
101
  "eslint-config-molindo": "^7.0.0",
92
102
  "eslint-plugin-deprecation": "^1.4.1",
93
103
  "next": "^14.2.1",
94
104
  "path-to-regexp": "^6.2.1",
95
105
  "publint": "^0.2.7",
96
- "react": "^18.2.0",
97
- "react-dom": "^18.2.0",
106
+ "react": "^18.3.0",
107
+ "react-dom": "^18.3.0",
98
108
  "rollup": "^3.28.1",
99
109
  "rollup-plugin-preserve-directives": "0.2.0",
100
110
  "size-limit": "^8.2.6",
@@ -104,11 +114,11 @@
104
114
  "size-limit": [
105
115
  {
106
116
  "path": "dist/production/index.react-client.js",
107
- "limit": "13.055 KB"
117
+ "limit": "15.735 KB"
108
118
  },
109
119
  {
110
120
  "path": "dist/production/index.react-server.js",
111
- "limit": "13.8 KB"
121
+ "limit": "16.5 KB"
112
122
  },
113
123
  {
114
124
  "path": "dist/production/navigation.react-client.js",
@@ -116,7 +126,7 @@
116
126
  },
117
127
  {
118
128
  "path": "dist/production/navigation.react-server.js",
119
- "limit": "14.8 KB"
129
+ "limit": "3.06 KB"
120
130
  },
121
131
  {
122
132
  "path": "dist/production/server.react-client.js",
@@ -124,19 +134,12 @@
124
134
  },
125
135
  {
126
136
  "path": "dist/production/server.react-server.js",
127
- "limit": "13.05 KB"
137
+ "limit": "15.645 KB"
128
138
  },
129
139
  {
130
140
  "path": "dist/production/middleware.js",
131
- "limit": "6 KB"
141
+ "limit": "6.19 KB"
132
142
  }
133
143
  ],
134
- "scripts": {
135
- "build": "rm -rf dist && rollup -c",
136
- "test": "TZ=Europe/Berlin vitest",
137
- "lint": "pnpm run lint:source && pnpm run lint:package",
138
- "lint:source": "eslint src test && tsc --noEmit",
139
- "lint:package": "publint && attw --pack",
140
- "size": "size-limit"
141
- }
142
- }
144
+ "gitHead": "35f327e201596aba228da2aefaeeef71e7fe3e44"
145
+ }