next-intl 4.3.4 → 4.3.5

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.
@@ -40,6 +40,14 @@ function runOnce(fn) {
40
40
  fn();
41
41
  }
42
42
  function createMessagesDeclaration(messagesPaths) {
43
+ const shouldRun = ['dev', 'build', 'typegen'
44
+ // Note: The 'lint' task doesn't consult the
45
+ // Next.js config, so we can't detect it here.
46
+ ].some(arg => process.argv.includes(arg));
47
+ if (!shouldRun) {
48
+ return;
49
+ }
50
+
43
51
  // Next.js can call the Next.js config multiple
44
52
  // times - ensure we only run once.
45
53
  runOnce(() => {
@@ -11,6 +11,14 @@ function runOnce(fn) {
11
11
  fn();
12
12
  }
13
13
  function createMessagesDeclaration(messagesPaths) {
14
+ const shouldRun = ['dev', 'build', 'typegen'
15
+ // Note: The 'lint' task doesn't consult the
16
+ // Next.js config, so we can't detect it here.
17
+ ].some(arg => process.argv.includes(arg));
18
+ if (!shouldRun) {
19
+ return;
20
+ }
21
+
14
22
  // Next.js can call the Next.js config multiple
15
23
  // times - ensure we only run once.
16
24
  runOnce(() => {
@@ -1 +1 @@
1
- import e from"fs";import t from"path";import{throwError as s}from"./utils.js";import o from"./watchFile.js";function n(o){var n;n=()=>{for(const n of o){const o=t.resolve(n);e.existsSync(o)||s(`\`createMessagesDeclaration\` points to a non-existent file: ${o}`),o.endsWith(".json")||s(`\`createMessagesDeclaration\` needs to point to a JSON file. Received: ${o}`);const c=process.env["NODE_ENV".trim()];r(n),"development"===c&&i(n)}},"1"!==process.env._NEXT_INTL_COMPILE_MESSAGES&&(process.env._NEXT_INTL_COMPILE_MESSAGES="1",n())}function i(e){const t=o(e,(()=>{r(e,!0)}));process.on("exit",(()=>{t.close()}))}function r(t,s=!1){const o=t.replace(/\.json$/,".d.json.ts");function n(e){return`// This file is auto-generated by next-intl, do not edit directly.\n// See: https://next-intl.dev/docs/workflows/typescript#messages-arguments\n\ndeclare const messages: ${e.trim()};\nexport default messages;`}if(s)return e.promises.readFile(t,"utf-8").then((t=>e.promises.writeFile(o,n(t))));const i=e.readFileSync(t,"utf-8");e.writeFileSync(o,n(i))}export{n as default};
1
+ import e from"fs";import s from"path";import{throwError as t}from"./utils.js";import o from"./watchFile.js";function n(o){var n;["dev","build","typegen"].some((e=>process.argv.includes(e)))&&(n=()=>{for(const n of o){const o=s.resolve(n);e.existsSync(o)||t(`\`createMessagesDeclaration\` points to a non-existent file: ${o}`),o.endsWith(".json")||t(`\`createMessagesDeclaration\` needs to point to a JSON file. Received: ${o}`);const c=process.env["NODE_ENV".trim()];r(n),"development"===c&&i(n)}},"1"!==process.env._NEXT_INTL_COMPILE_MESSAGES&&(process.env._NEXT_INTL_COMPILE_MESSAGES="1",n()))}function i(e){const s=o(e,(()=>{r(e,!0)}));process.on("exit",(()=>{s.close()}))}function r(s,t=!1){const o=s.replace(/\.json$/,".d.json.ts");function n(e){return`// This file is auto-generated by next-intl, do not edit directly.\n// See: https://next-intl.dev/docs/workflows/typescript#messages-arguments\n\ndeclare const messages: ${e.trim()};\nexport default messages;`}if(t)return e.promises.readFile(s,"utf-8").then((s=>e.promises.writeFile(o,n(s))));const i=e.readFileSync(s,"utf-8");e.writeFileSync(o,n(i))}export{n as default};
@@ -17,7 +17,7 @@ export default function createNavigation<const AppLocales extends Locales, const
17
17
  scroll?: boolean | undefined;
18
18
  shallow?: boolean | undefined;
19
19
  passHref?: boolean | undefined;
20
- prefetch?: boolean | null | undefined;
20
+ prefetch?: boolean | "auto" | null | "unstable_forceStale" | undefined;
21
21
  legacyBehavior?: boolean | undefined;
22
22
  onMouseEnter?: React.MouseEventHandler<HTMLAnchorElement> | undefined;
23
23
  onTouchStart?: React.TouchEventHandler<HTMLAnchorElement> | undefined;
@@ -18,7 +18,7 @@ export default function createNavigation<const AppLocales extends Locales, const
18
18
  scroll?: boolean | undefined;
19
19
  shallow?: boolean | undefined;
20
20
  passHref?: boolean | undefined;
21
- prefetch?: boolean | null | undefined;
21
+ prefetch?: boolean | "auto" | null | "unstable_forceStale" | undefined;
22
22
  legacyBehavior?: boolean | undefined;
23
23
  onMouseEnter?: React.MouseEventHandler<HTMLAnchorElement> | undefined;
24
24
  onTouchStart?: React.TouchEventHandler<HTMLAnchorElement> | undefined;
@@ -36,7 +36,7 @@ export default function createSharedNavigationFns<const AppLocales extends Local
36
36
  scroll?: boolean | undefined;
37
37
  shallow?: boolean | undefined;
38
38
  passHref?: boolean | undefined;
39
- prefetch?: boolean | null | undefined;
39
+ prefetch?: boolean | "auto" | null | "unstable_forceStale" | undefined;
40
40
  legacyBehavior?: boolean | undefined;
41
41
  onMouseEnter?: React.MouseEventHandler<HTMLAnchorElement> | undefined;
42
42
  onTouchStart?: React.TouchEventHandler<HTMLAnchorElement> | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-intl",
3
- "version": "4.3.4",
3
+ "version": "4.3.5",
4
4
  "sideEffects": false,
5
5
  "author": "Jan Amann <jan@amann.work>",
6
6
  "funding": [
@@ -112,7 +112,7 @@
112
112
  "dependencies": {
113
113
  "@formatjs/intl-localematcher": "^0.5.4",
114
114
  "negotiator": "^1.0.0",
115
- "use-intl": "^4.3.4"
115
+ "use-intl": "^4.3.5"
116
116
  },
117
117
  "peerDependencies": {
118
118
  "next": "^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0",
@@ -124,5 +124,5 @@
124
124
  "optional": true
125
125
  }
126
126
  },
127
- "gitHead": "44f07b236ad9b1a9d6e99e55507e7a67939efe5a"
127
+ "gitHead": "348b5b23445bd7a9f5cdce89625b042f19b69d23"
128
128
  }