remix-intlayer 9.7.1 → 9.7.2

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.
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- let _intlayer_core_localization = require("@intlayer/core/localization");
3
2
  let _intlayer_config_defaultValues = require("@intlayer/config/defaultValues");
3
+ let _intlayer_core_localization = require("@intlayer/core/localization");
4
4
  let _intlayer_core_utils = require("@intlayer/core/utils");
5
5
 
6
6
  // src/localeRouting.ts
@@ -4,8 +4,8 @@ const require_localeRouting = require("./localeRouting.cjs");
4
4
  const require_persistLocale = require("./persistLocale.cjs");
5
5
  const require_requestStorage = require("./requestStorage.cjs");
6
6
  let _intlayer_config_built = require("@intlayer/config/built");
7
- let _intlayer_config_node = require("@intlayer/config/node");
8
7
  let _intlayer_core_localization = require("@intlayer/core/localization");
8
+ let _intlayer_config_node = require("@intlayer/config/node");
9
9
  let _intlayer_engine_build = require("@intlayer/engine/build");
10
10
 
11
11
  // src/middleware.ts
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- let _intlayer_config_built = require("@intlayer/config/built");
3
2
  let _intlayer_core_interpreter = require("@intlayer/core/interpreter");
3
+ let _intlayer_config_built = require("@intlayer/config/built");
4
4
  let vanilla_intlayer = require("vanilla-intlayer");
5
5
 
6
6
  // src/plugins.ts
@@ -1 +1 @@
1
- {"version":3,"file":"useDictionary.cjs","names":["resolveDictionaryArgument","getRequestLocale","parseDictionarySelector","getDictionary","getPlugins"],"sources":["../../src/useDictionary.ts"],"sourcesContent":["import {\n parseDictionarySelector,\n resolveDictionaryArgument,\n} from '@intlayer/core/dictionaryManipulator';\nimport { getDictionary } from '@intlayer/core/interpreter';\nimport type {\n Dictionary,\n DictionarySelectorForGroup,\n QualifiedDictionaryGroup,\n ResolveQualifiedDictionaryContent,\n} from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n ExtractSelectorLocale,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { type DeepTransformContent, getPlugins } from './plugins';\nimport { getRequestLocale } from './requestStorage';\n\n/**\n * Transforms an imported dictionary (or qualified dictionary group) and returns\n * its content for the locale of the request being handled.\n *\n * The second argument is either a locale or a selector object\n * (`{ item }`, `{ variant }`, optionally with `locale`); it takes precedence\n * over the request locale.\n *\n * `md()` and `html()` nodes render to HTML strings: read `.value`, or call\n * `.use(components)` to override tags, and inject the result with `html.raw`\n * or `innerHTML`.\n *\n * @example\n * ```ts\n * import homeContent from './home.content';\n *\n * router.get('/', () => {\n * const { title } = useDictionary(homeContent);\n * return new Response(title);\n * });\n * ```\n */\nexport const useDictionary = <\n const T extends Dictionary | QualifiedDictionaryGroup,\n const A extends\n | LocalesValues\n | DictionarySelectorForGroup<T> = DeclaredLocales,\n>(\n dictionary: T,\n localeOrSelector?: A\n): DeepTransformContent<\n ResolveQualifiedDictionaryContent<T, A>,\n ExtractSelectorLocale<A>\n> => {\n // Selectors disabled project-wide (build-time flag) ⇒ the argument can only\n // be a locale, so the selector resolution is dropped by the bundler.\n const argument =\n process.env.INTLAYER_DICTIONARY_SELECTOR !== 'false'\n ? resolveDictionaryArgument({\n localeOrSelector,\n contextLocale: getRequestLocale(),\n dictionaryKey: dictionary.key,\n })\n : (localeOrSelector ?? getRequestLocale());\n const locale =\n process.env.INTLAYER_DICTIONARY_SELECTOR !== 'false'\n ? parseDictionarySelector(argument).locale\n : (argument as LocalesValues | undefined);\n\n return getDictionary<T, A>(\n dictionary,\n argument as A,\n getPlugins(locale)\n ) as DeepTransformContent<\n ResolveQualifiedDictionaryContent<T, A>,\n ExtractSelectorLocale<A>\n >;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,MAAa,iBAMX,YACA,qBAIG;CAGH,MAAM,WACJ,QAAQ,IAAI,iCAAiC,cACzCA,gEAA0B;EACxB;EACA,eAAeC,wCAAiB;EAChC,eAAe,WAAW;CAC5B,CAAC,IACA,oBAAoBA,wCAAiB;CAC5C,MAAM,SACJ,QAAQ,IAAI,iCAAiC,cACzCC,8DAAwB,QAAQ,CAAC,CAAC,SACjC;CAEP,WAAOC,0CACL,YACA,UACAC,2BAAW,MAAM,CACnB;AAIF"}
1
+ {"version":3,"file":"useDictionary.cjs","names":["resolveDictionaryArgument","getRequestLocale","parseDictionarySelector","getDictionary","getPlugins"],"sources":["../../src/useDictionary.ts"],"sourcesContent":["import {\n parseDictionarySelector,\n resolveDictionaryArgument,\n} from '@intlayer/core/dictionaryManipulator';\nimport { getDictionary } from '@intlayer/core/interpreter';\nimport type {\n Dictionary,\n DictionarySelectorForGroup,\n QualifiedDictionaryGroup,\n ResolveQualifiedDictionaryContent,\n} from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n ExtractSelectorLocale,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { type DeepTransformContent, getPlugins } from './plugins';\nimport { getRequestLocale } from './requestStorage';\n\n/**\n * Transforms an imported dictionary (or qualified dictionary group) and returns\n * its content for the locale of the request being handled.\n *\n * The second argument is either a locale or a selector object\n * (`{ item }`, `{ variant }`, optionally with `locale`); it takes precedence\n * over the request locale.\n *\n * `md()` and `html()` nodes render to HTML strings: read `.value`, or call\n * `.use(components)` to override tags, and inject the result with `html.raw`\n * or `innerHTML`.\n *\n * @example\n * ```ts\n * import homeContent from './home.content';\n *\n * router.get('/', () => {\n * const { title } = useDictionary(homeContent);\n * return new Response(title);\n * });\n * ```\n */\nexport const useDictionary = <\n const T extends Dictionary | QualifiedDictionaryGroup,\n const A extends LocalesValues | DictionarySelectorForGroup<T> =\n DeclaredLocales,\n>(\n dictionary: T,\n localeOrSelector?: A\n): DeepTransformContent<\n ResolveQualifiedDictionaryContent<T, A>,\n ExtractSelectorLocale<A>\n> => {\n // Selectors disabled project-wide (build-time flag) ⇒ the argument can only\n // be a locale, so the selector resolution is dropped by the bundler.\n const argument =\n process.env.INTLAYER_DICTIONARY_SELECTOR !== 'false'\n ? resolveDictionaryArgument({\n localeOrSelector,\n contextLocale: getRequestLocale(),\n dictionaryKey: dictionary.key,\n })\n : (localeOrSelector ?? getRequestLocale());\n const locale =\n process.env.INTLAYER_DICTIONARY_SELECTOR !== 'false'\n ? parseDictionarySelector(argument).locale\n : (argument as LocalesValues | undefined);\n\n return getDictionary<T, A>(\n dictionary,\n argument as A,\n getPlugins(locale)\n ) as DeepTransformContent<\n ResolveQualifiedDictionaryContent<T, A>,\n ExtractSelectorLocale<A>\n >;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,MAAa,iBAKX,YACA,qBAIG;CAGH,MAAM,WACJ,QAAQ,IAAI,iCAAiC,cACzCA,gEAA0B;EACxB;EACA,eAAeC,wCAAiB;EAChC,eAAe,WAAW;CAC5B,CAAC,IACA,oBAAoBA,wCAAiB;CAC5C,MAAM,SACJ,QAAQ,IAAI,iCAAiC,cACzCC,8DAAwB,QAAQ,CAAC,CAAC,SACjC;CAEP,WAAOC,0CACL,YACA,UACAC,2BAAW,MAAM,CACnB;AAIF"}
@@ -1,5 +1,5 @@
1
- import { getCanonicalPath, getDomainHostname, getDomainOrigin, getLocaleFromDomain, getRewriteRules, isProxyStorageLocaleEnabled, localeDetector, resolveLocalizedPath, resolveProxyMode } from "@intlayer/core/localization";
2
1
  import { ROUTING_MODE } from "@intlayer/config/defaultValues";
2
+ import { getCanonicalPath, getDomainHostname, getDomainOrigin, getLocaleFromDomain, getRewriteRules, isProxyStorageLocaleEnabled, localeDetector, resolveLocalizedPath, resolveProxyMode } from "@intlayer/core/localization";
3
3
  import { getCookie, getLocaleFromStorageServer } from "@intlayer/core/utils";
4
4
 
5
5
  // src/localeRouting.ts
@@ -3,8 +3,8 @@ import { createLocaleRouting } from "./localeRouting.mjs";
3
3
  import { withLocaleHeaders, writeLocaleHeaders } from "./persistLocale.mjs";
4
4
  import { requestStorage } from "./requestStorage.mjs";
5
5
  import { internationalization, routing } from "@intlayer/config/built";
6
- import { getConfiguration } from "@intlayer/config/node";
7
6
  import { getLocaleFromRequest } from "@intlayer/core/localization";
7
+ import { getConfiguration } from "@intlayer/config/node";
8
8
  import { prepareIntlayerServer } from "@intlayer/engine/build";
9
9
 
10
10
  // src/middleware.ts
@@ -1,5 +1,5 @@
1
- import { internationalization } from "@intlayer/config/built";
2
1
  import { fallbackPlugin, getBasePlugins } from "@intlayer/core/interpreter";
2
+ import { internationalization } from "@intlayer/config/built";
3
3
  import { htmlPlugin, markdownPlugin } from "vanilla-intlayer";
4
4
 
5
5
  // src/plugins.ts
@@ -1 +1 @@
1
- {"version":3,"file":"useDictionary.mjs","names":[],"sources":["../../src/useDictionary.ts"],"sourcesContent":["import {\n parseDictionarySelector,\n resolveDictionaryArgument,\n} from '@intlayer/core/dictionaryManipulator';\nimport { getDictionary } from '@intlayer/core/interpreter';\nimport type {\n Dictionary,\n DictionarySelectorForGroup,\n QualifiedDictionaryGroup,\n ResolveQualifiedDictionaryContent,\n} from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n ExtractSelectorLocale,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { type DeepTransformContent, getPlugins } from './plugins';\nimport { getRequestLocale } from './requestStorage';\n\n/**\n * Transforms an imported dictionary (or qualified dictionary group) and returns\n * its content for the locale of the request being handled.\n *\n * The second argument is either a locale or a selector object\n * (`{ item }`, `{ variant }`, optionally with `locale`); it takes precedence\n * over the request locale.\n *\n * `md()` and `html()` nodes render to HTML strings: read `.value`, or call\n * `.use(components)` to override tags, and inject the result with `html.raw`\n * or `innerHTML`.\n *\n * @example\n * ```ts\n * import homeContent from './home.content';\n *\n * router.get('/', () => {\n * const { title } = useDictionary(homeContent);\n * return new Response(title);\n * });\n * ```\n */\nexport const useDictionary = <\n const T extends Dictionary | QualifiedDictionaryGroup,\n const A extends\n | LocalesValues\n | DictionarySelectorForGroup<T> = DeclaredLocales,\n>(\n dictionary: T,\n localeOrSelector?: A\n): DeepTransformContent<\n ResolveQualifiedDictionaryContent<T, A>,\n ExtractSelectorLocale<A>\n> => {\n // Selectors disabled project-wide (build-time flag) ⇒ the argument can only\n // be a locale, so the selector resolution is dropped by the bundler.\n const argument =\n process.env.INTLAYER_DICTIONARY_SELECTOR !== 'false'\n ? resolveDictionaryArgument({\n localeOrSelector,\n contextLocale: getRequestLocale(),\n dictionaryKey: dictionary.key,\n })\n : (localeOrSelector ?? getRequestLocale());\n const locale =\n process.env.INTLAYER_DICTIONARY_SELECTOR !== 'false'\n ? parseDictionarySelector(argument).locale\n : (argument as LocalesValues | undefined);\n\n return getDictionary<T, A>(\n dictionary,\n argument as A,\n getPlugins(locale)\n ) as DeepTransformContent<\n ResolveQualifiedDictionaryContent<T, A>,\n ExtractSelectorLocale<A>\n >;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,MAAa,iBAMX,YACA,qBAIG;CAGH,MAAM,WACJ,QAAQ,IAAI,iCAAiC,UACzC,0BAA0B;EACxB;EACA,eAAe,iBAAiB;EAChC,eAAe,WAAW;CAC5B,CAAC,IACA,oBAAoB,iBAAiB;CAC5C,MAAM,SACJ,QAAQ,IAAI,iCAAiC,UACzC,wBAAwB,QAAQ,CAAC,CAAC,SACjC;CAEP,OAAO,cACL,YACA,UACA,WAAW,MAAM,CACnB;AAIF"}
1
+ {"version":3,"file":"useDictionary.mjs","names":[],"sources":["../../src/useDictionary.ts"],"sourcesContent":["import {\n parseDictionarySelector,\n resolveDictionaryArgument,\n} from '@intlayer/core/dictionaryManipulator';\nimport { getDictionary } from '@intlayer/core/interpreter';\nimport type {\n Dictionary,\n DictionarySelectorForGroup,\n QualifiedDictionaryGroup,\n ResolveQualifiedDictionaryContent,\n} from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n ExtractSelectorLocale,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { type DeepTransformContent, getPlugins } from './plugins';\nimport { getRequestLocale } from './requestStorage';\n\n/**\n * Transforms an imported dictionary (or qualified dictionary group) and returns\n * its content for the locale of the request being handled.\n *\n * The second argument is either a locale or a selector object\n * (`{ item }`, `{ variant }`, optionally with `locale`); it takes precedence\n * over the request locale.\n *\n * `md()` and `html()` nodes render to HTML strings: read `.value`, or call\n * `.use(components)` to override tags, and inject the result with `html.raw`\n * or `innerHTML`.\n *\n * @example\n * ```ts\n * import homeContent from './home.content';\n *\n * router.get('/', () => {\n * const { title } = useDictionary(homeContent);\n * return new Response(title);\n * });\n * ```\n */\nexport const useDictionary = <\n const T extends Dictionary | QualifiedDictionaryGroup,\n const A extends LocalesValues | DictionarySelectorForGroup<T> =\n DeclaredLocales,\n>(\n dictionary: T,\n localeOrSelector?: A\n): DeepTransformContent<\n ResolveQualifiedDictionaryContent<T, A>,\n ExtractSelectorLocale<A>\n> => {\n // Selectors disabled project-wide (build-time flag) ⇒ the argument can only\n // be a locale, so the selector resolution is dropped by the bundler.\n const argument =\n process.env.INTLAYER_DICTIONARY_SELECTOR !== 'false'\n ? resolveDictionaryArgument({\n localeOrSelector,\n contextLocale: getRequestLocale(),\n dictionaryKey: dictionary.key,\n })\n : (localeOrSelector ?? getRequestLocale());\n const locale =\n process.env.INTLAYER_DICTIONARY_SELECTOR !== 'false'\n ? parseDictionarySelector(argument).locale\n : (argument as LocalesValues | undefined);\n\n return getDictionary<T, A>(\n dictionary,\n argument as A,\n getPlugins(locale)\n ) as DeepTransformContent<\n ResolveQualifiedDictionaryContent<T, A>,\n ExtractSelectorLocale<A>\n >;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,MAAa,iBAKX,YACA,qBAIG;CAGH,MAAM,WACJ,QAAQ,IAAI,iCAAiC,UACzC,0BAA0B;EACxB;EACA,eAAe,iBAAiB;EAChC,eAAe,WAAW;CAC5B,CAAC,IACA,oBAAoB,iBAAiB;CAC5C,MAAM,SACJ,QAAQ,IAAI,iCAAiC,UACzC,wBAAwB,QAAQ,CAAC,CAAC,SACjC;CAEP,OAAO,cACL,YACA,UACA,WAAW,MAAM,CACnB;AAIF"}
@@ -1,7 +1,7 @@
1
1
  import { IntlayerState } from "./context.js";
2
+ import { AsyncLocalStorage } from "node:async_hooks";
2
3
  import { DeclaredLocales } from "@intlayer/types/module_augmentation";
3
4
  import { RequestContext } from "remix/router";
4
- import { AsyncLocalStorage } from "node:async_hooks";
5
5
  /**
6
6
  * Request context of the request being handled, made available to every
7
7
  * function running inside the `intlayer()` middleware scope — route handlers,
@@ -1 +1 @@
1
- {"version":3,"file":"useDictionary.d.ts","names":[],"sources":["../../src/useDictionary.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;qBAyCa,sBACL,UAAU,aAAa,gCACvB,UACF,gBACA,2BAA2B,KAAK,iBAAe,YAEvC,GAAC,mBACM,MAClB,qBACD,kCAAkC,GAAG,IACrC,sBAAsB"}
1
+ {"version":3,"file":"useDictionary.d.ts","names":[],"sources":["../../src/useDictionary.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;qBAyCa,sBACL,UAAU,aAAa,gCACvB,UAAU,gBAAgB,2BAA2B,KACzD,iBAAe,YAEL,GAAC,mBACM,MAClB,qBACD,kCAAkC,GAAG,IACrC,sBAAsB"}
package/package.json CHANGED
@@ -1,26 +1,22 @@
1
1
  {
2
2
  "name": "remix-intlayer",
3
- "version": "9.7.1",
3
+ "version": "9.7.2",
4
4
  "private": false,
5
5
  "description": "Manage internationalization i18n in a simple way for Remix 3 applications.",
6
6
  "keywords": [
7
+ "i18n",
8
+ "internationalization",
7
9
  "intlayer",
10
+ "javascript",
11
+ "middleware",
8
12
  "remix",
9
13
  "remix-3",
10
- "internationalization",
11
- "i18n",
12
- "typescript",
13
- "javascript",
14
- "middleware"
14
+ "typescript"
15
15
  ],
16
16
  "homepage": "https://intlayer.org",
17
17
  "bugs": {
18
18
  "url": "https://github.com/aymericzip/intlayer/issues"
19
19
  },
20
- "repository": {
21
- "type": "git",
22
- "url": "git+https://github.com/aymericzip/intlayer.git"
23
- },
24
20
  "license": "Apache-2.0",
25
21
  "author": {
26
22
  "name": "Aymeric PINEAU",
@@ -33,7 +29,34 @@
33
29
  "url": "https://github.com/aymericzip"
34
30
  }
35
31
  ],
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "git+https://github.com/aymericzip/intlayer.git"
35
+ },
36
+ "files": [
37
+ "./dist",
38
+ "./package.json"
39
+ ],
36
40
  "sideEffects": false,
41
+ "main": "dist/cjs/index.cjs",
42
+ "module": "dist/esm/index.mjs",
43
+ "types": "dist/types/index.d.ts",
44
+ "typesVersions": {
45
+ "*": {
46
+ "format": [
47
+ "./dist/types/format/index.d.ts"
48
+ ],
49
+ "html": [
50
+ "./dist/types/html/index.d.ts"
51
+ ],
52
+ "markdown": [
53
+ "./dist/types/markdown/index.d.ts"
54
+ ],
55
+ "package.json": [
56
+ "./package.json"
57
+ ]
58
+ }
59
+ },
37
60
  "exports": {
38
61
  ".": {
39
62
  "types": "./dist/types/index.d.ts",
@@ -57,38 +80,15 @@
57
80
  },
58
81
  "./package.json": "./package.json"
59
82
  },
60
- "main": "dist/cjs/index.cjs",
61
- "module": "dist/esm/index.mjs",
62
- "types": "dist/types/index.d.ts",
63
- "typesVersions": {
64
- "*": {
65
- "format": [
66
- "./dist/types/format/index.d.ts"
67
- ],
68
- "html": [
69
- "./dist/types/html/index.d.ts"
70
- ],
71
- "markdown": [
72
- "./dist/types/markdown/index.d.ts"
73
- ],
74
- "package.json": [
75
- "./package.json"
76
- ]
77
- }
78
- },
79
- "files": [
80
- "./dist",
81
- "./package.json"
82
- ],
83
83
  "scripts": {
84
84
  "build": "bun --bun tsdown --config tsdown.config.ts",
85
85
  "build:ci": "bun --bun tsdown --config tsdown.config.ts",
86
86
  "clean": "bun --bun rimraf ./dist .turbo",
87
87
  "dev": "bun --bun tsdown --config tsdown.config.ts --watch",
88
- "format": "bun --bun biome format . --check",
89
- "format:fix": "bun --bun biome format --write .",
90
- "lint": "bun --bun biome lint .",
91
- "lint:fix": "bun --bun biome lint --write .",
88
+ "format": "oxfmt --check .",
89
+ "format:fix": "oxfmt .",
90
+ "lint": "oxlint .",
91
+ "lint:fix": "oxlint --fix .",
92
92
  "prepublish": "cp -f ../../README.md ./README.md",
93
93
  "publish": "bun publish || true",
94
94
  "publish:canary": "bun publish --access public --tag canary || true",
@@ -99,21 +99,21 @@
99
99
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
100
100
  },
101
101
  "dependencies": {
102
- "@intlayer/config": "9.7.1",
103
- "@intlayer/core": "9.7.1",
104
- "@intlayer/engine": "9.7.1",
105
- "@intlayer/types": "9.7.1",
106
- "vanilla-intlayer": "9.7.1"
102
+ "@intlayer/config": "9.7.2",
103
+ "@intlayer/core": "9.7.2",
104
+ "@intlayer/engine": "9.7.2",
105
+ "@intlayer/types": "9.7.2",
106
+ "vanilla-intlayer": "9.7.2"
107
107
  },
108
108
  "devDependencies": {
109
- "@intlayer/dictionaries-entry": "9.7.1",
109
+ "@intlayer/dictionaries-entry": "9.7.2",
110
110
  "@types/node": "^26",
111
111
  "@utils/ts-config": "1.0.4",
112
112
  "@utils/ts-config-types": "1.0.4",
113
113
  "@utils/tsdown-config": "1.0.4",
114
114
  "remix": "3.1.0",
115
- "rimraf": "6.1.3",
116
- "tsdown": "0.23.4",
115
+ "rimraf": "6.1.4",
116
+ "tsdown": "0.23.7",
117
117
  "typescript": "7.0.2",
118
118
  "vitest": "5.1.0"
119
119
  },