@lionrapid/core 0.6.4 → 0.6.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.
- package/dist/browser/auto-init.d.ts.map +1 -1
- package/dist/browser/auto-init.js +2 -1
- package/dist/browser/auto-init.js.map +1 -1
- package/dist/browser/lionrapid.auto.dev.js +73 -9
- package/dist/browser/lionrapid.auto.dev.js.map +3 -3
- package/dist/browser/lionrapid.auto.js +73 -9
- package/dist/browser/lionrapid.auto.js.map +3 -3
- package/dist/browser/lionrapid.auto.min.js +4 -4
- package/dist/browser/lionrapid.auto.min.js.map +4 -4
- package/dist/browser/lionrapid.esm.js +77 -9
- package/dist/browser/lionrapid.esm.js.map +3 -3
- package/dist/browser/lionrapid.esm.min.js +3 -3
- package/dist/browser/lionrapid.esm.min.js.map +4 -4
- package/dist/browser/lionrapid.iife.dev.js +77 -9
- package/dist/browser/lionrapid.iife.dev.js.map +3 -3
- package/dist/browser/lionrapid.iife.js +77 -9
- package/dist/browser/lionrapid.iife.js.map +3 -3
- package/dist/browser/lionrapid.iife.min.js +3 -3
- package/dist/browser/lionrapid.iife.min.js.map +4 -4
- package/dist/browser/lionrapid.umd.js +77 -9
- package/dist/browser/lionrapid.umd.js.map +3 -3
- package/dist/browser/lionrapid.umd.min.js +3 -3
- package/dist/browser/lionrapid.umd.min.js.map +4 -4
- package/dist/browser/storage/cache-names.d.ts +51 -0
- package/dist/browser/storage/cache-names.d.ts.map +1 -0
- package/dist/browser/storage/cache-names.js +51 -0
- package/dist/browser/storage/cache-names.js.map +1 -0
- package/dist/browser/storage/cache-storage-repository.d.ts.map +1 -1
- package/dist/browser/storage/cache-storage-repository.js +6 -2
- package/dist/browser/storage/cache-storage-repository.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -5
- package/dist/index.js.map +1 -1
- package/dist/utils/locale.d.ts +50 -7
- package/dist/utils/locale.d.ts.map +1 -1
- package/dist/utils/locale.js +83 -15
- package/dist/utils/locale.js.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Cache API caches that @lionrapid/core owns, and the key prefix its
|
|
3
|
+
* entries live under.
|
|
4
|
+
*
|
|
5
|
+
* WHY THIS MODULE EXISTS
|
|
6
|
+
*
|
|
7
|
+
* Core and @lionrapid/storage's optional Service Worker both use the Cache API
|
|
8
|
+
* in the same origin, and both used to hardcode the literal `lionrapid-v1`
|
|
9
|
+
* independently, with nothing asserting they agreed. They did agree, which was
|
|
10
|
+
* the bug: the SW treated core's persisted translation store as its own HTTP
|
|
11
|
+
* response cache and deleted it (`CLEAR_ALL`, an unfiltered `INVALIDATE_CACHE`,
|
|
12
|
+
* and an `activate` sweep of every `lionrapid-`-prefixed cache).
|
|
13
|
+
*
|
|
14
|
+
* The fix is an OWNERSHIP RULE rather than a single shared name — see
|
|
15
|
+
* `@lionrapid/storage`'s `sw-cache-policy.ts`. A shared constant cannot solve
|
|
16
|
+
* the important half of the problem: a consumer who sets a custom `cacheName`
|
|
17
|
+
* to escape the collision picks a name we cannot enumerate, so the only rule
|
|
18
|
+
* that protects them is "the SW touches nothing it does not own".
|
|
19
|
+
*
|
|
20
|
+
* This module is still the single source of truth for the names CORE owns, so
|
|
21
|
+
* the SW's ownership pattern can be asserted against them in a test and the two
|
|
22
|
+
* packages cannot silently drift back into agreement.
|
|
23
|
+
*
|
|
24
|
+
* @module browser/storage/cache-names
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* Cache API cache names created by core.
|
|
28
|
+
*
|
|
29
|
+
* `translations` is the default store for `CacheStorageRepository` — a
|
|
30
|
+
* consumer may override it via `options.cacheName`, so this is a default and
|
|
31
|
+
* not an exhaustive list of caches core may end up using.
|
|
32
|
+
*
|
|
33
|
+
* `offlineFloor` is the never-expiring "last known good" layer that browser
|
|
34
|
+
* auto-init installs by default (`data-offline="false"` disables it). It is
|
|
35
|
+
* NOT overridable, so it is always exactly this string when present — which
|
|
36
|
+
* made it the first real-world casualty of the SW's `lionrapid-` sweep.
|
|
37
|
+
*/
|
|
38
|
+
export declare const CORE_CACHE_NAMES: Readonly<{
|
|
39
|
+
readonly translations: "lionrapid-v1";
|
|
40
|
+
readonly offlineFloor: "lionrapid-offline-v1";
|
|
41
|
+
}>;
|
|
42
|
+
/**
|
|
43
|
+
* Synthetic https origin every core cache ENTRY is keyed under.
|
|
44
|
+
*
|
|
45
|
+
* The Cache API only accepts http/https URLs as keys, so core namespaces its
|
|
46
|
+
* entries beneath this host rather than using a bare `lionrapid:` scheme. The
|
|
47
|
+
* host never resolves; it only marks an entry as core-owned. Any code sharing a
|
|
48
|
+
* cache with core can use this to tell core's entries apart from its own.
|
|
49
|
+
*/
|
|
50
|
+
export declare const CORE_CACHE_ENTRY_PREFIX = "https://cache.lionrapid.internal/";
|
|
51
|
+
//# sourceMappingURL=cache-names.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache-names.d.ts","sourceRoot":"","sources":["../../../src/browser/storage/cache-names.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB;;;EAGlB,CAAC;AAEZ;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,sCAAsC,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Cache API caches that @lionrapid/core owns, and the key prefix its
|
|
3
|
+
* entries live under.
|
|
4
|
+
*
|
|
5
|
+
* WHY THIS MODULE EXISTS
|
|
6
|
+
*
|
|
7
|
+
* Core and @lionrapid/storage's optional Service Worker both use the Cache API
|
|
8
|
+
* in the same origin, and both used to hardcode the literal `lionrapid-v1`
|
|
9
|
+
* independently, with nothing asserting they agreed. They did agree, which was
|
|
10
|
+
* the bug: the SW treated core's persisted translation store as its own HTTP
|
|
11
|
+
* response cache and deleted it (`CLEAR_ALL`, an unfiltered `INVALIDATE_CACHE`,
|
|
12
|
+
* and an `activate` sweep of every `lionrapid-`-prefixed cache).
|
|
13
|
+
*
|
|
14
|
+
* The fix is an OWNERSHIP RULE rather than a single shared name — see
|
|
15
|
+
* `@lionrapid/storage`'s `sw-cache-policy.ts`. A shared constant cannot solve
|
|
16
|
+
* the important half of the problem: a consumer who sets a custom `cacheName`
|
|
17
|
+
* to escape the collision picks a name we cannot enumerate, so the only rule
|
|
18
|
+
* that protects them is "the SW touches nothing it does not own".
|
|
19
|
+
*
|
|
20
|
+
* This module is still the single source of truth for the names CORE owns, so
|
|
21
|
+
* the SW's ownership pattern can be asserted against them in a test and the two
|
|
22
|
+
* packages cannot silently drift back into agreement.
|
|
23
|
+
*
|
|
24
|
+
* @module browser/storage/cache-names
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* Cache API cache names created by core.
|
|
28
|
+
*
|
|
29
|
+
* `translations` is the default store for `CacheStorageRepository` — a
|
|
30
|
+
* consumer may override it via `options.cacheName`, so this is a default and
|
|
31
|
+
* not an exhaustive list of caches core may end up using.
|
|
32
|
+
*
|
|
33
|
+
* `offlineFloor` is the never-expiring "last known good" layer that browser
|
|
34
|
+
* auto-init installs by default (`data-offline="false"` disables it). It is
|
|
35
|
+
* NOT overridable, so it is always exactly this string when present — which
|
|
36
|
+
* made it the first real-world casualty of the SW's `lionrapid-` sweep.
|
|
37
|
+
*/
|
|
38
|
+
export const CORE_CACHE_NAMES = Object.freeze({
|
|
39
|
+
translations: 'lionrapid-v1',
|
|
40
|
+
offlineFloor: 'lionrapid-offline-v1',
|
|
41
|
+
});
|
|
42
|
+
/**
|
|
43
|
+
* Synthetic https origin every core cache ENTRY is keyed under.
|
|
44
|
+
*
|
|
45
|
+
* The Cache API only accepts http/https URLs as keys, so core namespaces its
|
|
46
|
+
* entries beneath this host rather than using a bare `lionrapid:` scheme. The
|
|
47
|
+
* host never resolves; it only marks an entry as core-owned. Any code sharing a
|
|
48
|
+
* cache with core can use this to tell core's entries apart from its own.
|
|
49
|
+
*/
|
|
50
|
+
export const CORE_CACHE_ENTRY_PREFIX = 'https://cache.lionrapid.internal/';
|
|
51
|
+
//# sourceMappingURL=cache-names.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache-names.js","sourceRoot":"","sources":["../../../src/browser/storage/cache-names.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC5C,YAAY,EAAE,cAAc;IAC5B,YAAY,EAAE,sBAAsB;CAC5B,CAAC,CAAC;AAEZ;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,mCAAmC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache-storage-repository.d.ts","sourceRoot":"","sources":["../../../src/browser/storage/cache-storage-repository.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"cache-storage-repository.d.ts","sourceRoot":"","sources":["../../../src/browser/storage/cache-storage-repository.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAwB7E;;GAEG;AACH,MAAM,WAAW,4BAA6B,SAAQ,uBAAuB;IAC3E,OAAO,CAAC,EAAE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;IACH,WAAW,IAAI,OAAO;IAItB;;;OAGG;IACG,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IA6BnD;;OAEG;IACG,aAAa,IAAI,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;CAepE"}
|
|
@@ -6,13 +6,17 @@
|
|
|
6
6
|
* 1. Memory (sync) → 2. LocalStorage (sync) → 3. CacheStorage (async) → 4. Network (async)
|
|
7
7
|
*/
|
|
8
8
|
import { TranslationNotFoundError } from '../../errors/translation-errors.js';
|
|
9
|
-
|
|
9
|
+
import { CORE_CACHE_NAMES, CORE_CACHE_ENTRY_PREFIX } from './cache-names.js';
|
|
10
|
+
// Single source of truth for both names — see cache-names.ts. These were
|
|
11
|
+
// module-private literals duplicated by @lionrapid/storage's Service Worker,
|
|
12
|
+
// which is how the SW came to delete this repository's store.
|
|
13
|
+
const CACHE_NAME = CORE_CACHE_NAMES.translations;
|
|
10
14
|
// The Cache API only accepts http/https request URLs as keys — `cache.put`
|
|
11
15
|
// throws `TypeError: Request scheme '…' is unsupported` for a bare string like
|
|
12
16
|
// `lionrapid:…`, which silently killed every write (caught by set()'s guard).
|
|
13
17
|
// Use a synthetic https origin so keys are valid Requests. The host never
|
|
14
18
|
// resolves; it only namespaces entries inside the named cache.
|
|
15
|
-
const CACHE_PREFIX =
|
|
19
|
+
const CACHE_PREFIX = CORE_CACHE_ENTRY_PREFIX;
|
|
16
20
|
/**
|
|
17
21
|
* Cache API-based repository for persistent translation caching
|
|
18
22
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache-storage-repository.js","sourceRoot":"","sources":["../../../src/browser/storage/cache-storage-repository.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"cache-storage-repository.js","s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ist/index.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export { generateAutoKey, md5 } from './browser/md5.js';
|
|
|
20
20
|
export { ExcludeFilter } from './browser/exclude-filter.js';
|
|
21
21
|
export type { ExcludePatterns } from './browser/exclude-filter.js';
|
|
22
22
|
export { sanitizeElement, sanitizeStyleSheetText } from './browser/sanitizer.js';
|
|
23
|
-
export { normalizeLocale, matchLocale, parseAcceptLanguage, localeDir, primarySubtag, LOCALE_TAG_REGEX, } from './utils/locale.js';
|
|
23
|
+
export { normalizeLocale, matchLocale, parseAcceptLanguage, localeDir, primarySubtag, localeCandidates, ISO639_2_TO_1, LOCALE_TAG_REGEX, } from './utils/locale.js';
|
|
24
24
|
export { CacheManager } from './cache/index.js';
|
|
25
25
|
export type { CacheEventPayloads, CacheManagerEntry, InvalidateOptions, } from './cache/index.js';
|
|
26
26
|
export { isClientError, isRetryableError, isTranslationError, NetworkError, ServerError, TranslationError, TranslationLockedError, TranslationNotFoundError, } from './errors/translation-errors.js';
|
|
@@ -34,10 +34,11 @@ export { LocalStorageRepository } from './browser/storage/localstorage-repositor
|
|
|
34
34
|
export type { LocalStorageRepositoryConfig } from './browser/storage/localstorage-repository.js';
|
|
35
35
|
export { CacheStorageRepository } from './browser/storage/cache-storage-repository.js';
|
|
36
36
|
export type { CacheStorageRepositoryConfig } from './browser/storage/cache-storage-repository.js';
|
|
37
|
+
export { CORE_CACHE_NAMES, CORE_CACHE_ENTRY_PREFIX } from './browser/storage/cache-names.js';
|
|
37
38
|
export { parseKeyPath, prepareTranslationRequest, resolveNestedKey, } from './utils/index.js';
|
|
38
39
|
export { Colors, createPackageLogger, Logger, logger, measure, } from './utils/logger.js';
|
|
39
40
|
export { LoggerConfig, LogLevel } from './config/logger.config.js';
|
|
40
41
|
export type { CallSite, PackageLoggerConfig } from './utils/logger.js';
|
|
41
42
|
export type { MemoryRepositoryConfig, NetworkRepositoryConfig, PreloadNamespaces, ProjectConfig, StorageRepositoryConfig, SyncMissingConfig, } from './config/repository.config.js';
|
|
42
|
-
export declare const VERSION = "
|
|
43
|
+
export declare const VERSION = "0.6.5";
|
|
43
44
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAG/C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,YAAY,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAGxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,YAAY,EACV,sBAAsB,EACtB,6BAA6B,GAC9B,MAAM,qCAAqC,CAAC;AAG7C,YAAY,EACV,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,YAAY,EACZ,OAAO,EACP,YAAY,EACZ,aAAa,GACd,MAAM,uBAAuB,CAAC;AAG/B,YAAY,EACV,eAAe,EACf,gBAAgB,EAChB,cAAc,GACf,MAAM,sCAAsC,CAAC;AAG9C,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAG9E,YAAY,EACV,WAAW,EACX,SAAS,EACT,OAAO,EACP,WAAW,EACX,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,YAAY,EAGZ,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export { ExcludeFilter } from './browser/exclude-filter.js';
|
|
|
38
38
|
// snapshot viewer and by react `<Trans>` as a defense-in-depth pass over
|
|
39
39
|
// tHtml output. Callers must guard `typeof document !== 'undefined'`.
|
|
40
40
|
export { sanitizeElement, sanitizeStyleSheetText } from './browser/sanitizer.js';
|
|
41
|
-
// BCP-47 locale utilities (Node-safe, pure).
|
|
42
|
-
//
|
|
43
|
-
//
|
|
44
|
-
|
|
41
|
+
// BCP-47 locale utilities (Node-safe, pure). Matching mirrors @lionrapid/edge's
|
|
42
|
+
// resolveLocale (incl. the ISO 639-2 table, which all three surfaces share);
|
|
43
|
+
// the tag grammar is deliberately broader than edge's — see locale.ts. RTL set
|
|
44
|
+
// mirrors tm-server. Consumers: browser auto-init, and any package needing to
|
|
45
|
+
// negotiate/normalize locales identically.
|
|
46
|
+
export { normalizeLocale, matchLocale, parseAcceptLanguage, localeDir, primarySubtag, localeCandidates, ISO639_2_TO_1, LOCALE_TAG_REGEX, } from './utils/locale.js';
|
|
45
47
|
// Cache module (TanStack Query-inspired)
|
|
46
48
|
export { CacheManager } from './cache/index.js';
|
|
47
49
|
// Error classes
|
|
@@ -50,11 +52,15 @@ export { isClientError, isRetryableError, isTranslationError, NetworkError, Serv
|
|
|
50
52
|
// Browser storage repositories
|
|
51
53
|
export { LocalStorageRepository } from './browser/storage/localstorage-repository.js';
|
|
52
54
|
export { CacheStorageRepository } from './browser/storage/cache-storage-repository.js';
|
|
55
|
+
// The Cache API names/prefix core owns. Exported so a package sharing the
|
|
56
|
+
// origin (notably @lionrapid/storage's Service Worker) can assert it stays out
|
|
57
|
+
// of core's caches instead of re-declaring the literals and drifting.
|
|
58
|
+
export { CORE_CACHE_NAMES, CORE_CACHE_ENTRY_PREFIX } from './browser/storage/cache-names.js';
|
|
53
59
|
// Essential utilities
|
|
54
60
|
export { parseKeyPath, prepareTranslationRequest, resolveNestedKey, } from './utils/index.js';
|
|
55
61
|
// Internal utilities (for package development)
|
|
56
62
|
export { Colors, createPackageLogger, Logger, logger, measure, } from './utils/logger.js';
|
|
57
63
|
export { LogLevel } from './config/logger.config.js';
|
|
58
64
|
// Version information
|
|
59
|
-
export const VERSION = '
|
|
65
|
+
export const VERSION = '0.6.5';
|
|
60
66
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc;AACd,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,sBAAsB;AACtB,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAGvE,iBAAiB;AACjB,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AA0C9E,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,YAAY;AACZ,sEAAsE;AACtE,kEAAkE;AAClE,SAAS,EACT,mBAAmB,EACnB,cAAc,EACd,YAAY;AACZ,wEAAwE;AACxE,0EAA0E;AAC1E,gDAAgD;AAChD,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,mBAAmB;AACnB,2EAA2E;AAC3E,2EAA2E;AAC3E,oEAAoE;AACpE,WAAW,EACX,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAE5B,0EAA0E;AAC1E,oEAAoE;AACpE,0EAA0E;AAC1E,+EAA+E;AAC/E,uEAAuE;AACvE,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAExD,6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CHANGED
|
@@ -19,9 +19,19 @@
|
|
|
19
19
|
* @module utils/locale
|
|
20
20
|
*/
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
22
|
+
* Locale grammar: 2–3 letter language + zero or more `-XXXX` subtags
|
|
23
|
+
* (script/region/variant), each 2–4 alphanumerics. Anchored, case-insensitive.
|
|
24
|
+
*
|
|
25
|
+
* DELIBERATELY BROADER THAN EDGE, and the difference is not parity rot. This
|
|
26
|
+
* used to claim it was the "same grammar as `@lionrapid/edge`'s `LOCALE_BODY`";
|
|
27
|
+
* that was false — edge uses `?` (AT MOST ONE subtag) where this uses `*`, so
|
|
28
|
+
* `zh-Hant-TW` and `de-CH-1901` are accepted here and rejected there.
|
|
29
|
+
*
|
|
30
|
+
* The claim was corrected rather than the regex: language-script-region is
|
|
31
|
+
* ordinary BCP-47, so narrowing core to one subtag would reject legitimate tags
|
|
32
|
+
* to match a narrower peer. The practical consequence to know is that a
|
|
33
|
+
* two-subtag tag core accepts will not round-trip through edge's cookie/path
|
|
34
|
+
* matching — if that ever needs to hold, widen edge, do not narrow this.
|
|
25
35
|
*/
|
|
26
36
|
export declare const LOCALE_TAG_REGEX: RegExp;
|
|
27
37
|
/** The primary language subtag, lowercased: `pt-BR → pt`, `ZH-Hant → zh`. */
|
|
@@ -32,15 +42,48 @@ export declare function primarySubtag(tag: string): string;
|
|
|
32
42
|
* only — subtags are not validated here (that's `matchLocale`/the grammar).
|
|
33
43
|
*/
|
|
34
44
|
export declare function normalizeLocale(tag: string): string;
|
|
45
|
+
/**
|
|
46
|
+
* ISO 639-2/T -> 639-1 for the languages this product ships.
|
|
47
|
+
*
|
|
48
|
+
* MUST stay in lockstep with `ISO639_2_TO_1` in
|
|
49
|
+
* packages/edge/src/language-detector.ts and `LocalePattern::ISO639_2_TO_1` in
|
|
50
|
+
* packages/wordpress/src/Runtime/LocalePattern.php — same table, same reason.
|
|
51
|
+
* All three are asserted identical by
|
|
52
|
+
* src/__tests__/parity/locale-table-parity.test.ts, which reads the other two
|
|
53
|
+
* as text; see that file for what a test can and cannot enforce here.
|
|
54
|
+
*
|
|
55
|
+
* Curated rather than derived: there is no safe rule for reducing a 3-letter
|
|
56
|
+
* code to a 2-letter one. `est` (Estonian) would become `es` (Spanish) under
|
|
57
|
+
* any prefix heuristic. An unlisted code simply does not match, so this can
|
|
58
|
+
* only widen matching, never mis-match.
|
|
59
|
+
*
|
|
60
|
+
* It is needed because tm-server canonicalises to ISO 639-2 (`eng`, `fin`)
|
|
61
|
+
* while configured language lists carry 2-letter codes, and a `lionrapid_locale`
|
|
62
|
+
* cookie already in a visitor's browser cannot be recalled.
|
|
63
|
+
*/
|
|
64
|
+
export declare const ISO639_2_TO_1: Readonly<Record<string, string>>;
|
|
65
|
+
/**
|
|
66
|
+
* Every form of `tag` worth testing against a configured language list, most
|
|
67
|
+
* specific first: longest-prefix reduction (`pt-br-x` -> `pt-br` -> `pt`) with
|
|
68
|
+
* each 3-letter primary subtag also standing for its 2-letter form.
|
|
69
|
+
*
|
|
70
|
+
* Mirrors edge's `resolveLocale` candidate generation and WordPress's
|
|
71
|
+
* `LocalePattern::candidates`. Used for BOTH the cookie and the browser
|
|
72
|
+
* negotiation paths, so an explicit choice is never resolved less tolerantly
|
|
73
|
+
* than an inferred preference — the rule the other two surfaces already follow.
|
|
74
|
+
*/
|
|
75
|
+
export declare function localeCandidates(tag: string): string[];
|
|
35
76
|
/**
|
|
36
77
|
* Negotiate a locale: for each requested tag (in preference order), return the
|
|
37
|
-
* best `available` match
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
78
|
+
* best `available` match, trying `localeCandidates(tag)` most-specific first —
|
|
79
|
+
* exact full tag (case-insensitive), its ISO 639-2 alias if it has one, then the
|
|
80
|
+
* shortened prefixes down to the bare primary subtag. Returns `fallback` when
|
|
81
|
+
* nothing matches. Mirrors edge's `resolveLocale` so both packages resolve
|
|
82
|
+
* identically.
|
|
41
83
|
*
|
|
42
84
|
* Note (matches edge + the server): a bare requested `pt` does NOT match an
|
|
43
85
|
* available `pt-BR` — region-specific availability is not silently widened.
|
|
86
|
+
* Widening only ever goes the other way (`por`/`pt-BR` -> `pt`).
|
|
44
87
|
*/
|
|
45
88
|
export declare function matchLocale(requested: string[], available: string[], fallback: string): string;
|
|
46
89
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locale.d.ts","sourceRoot":"","sources":["../../src/utils/locale.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH
|
|
1
|
+
{"version":3,"file":"locale.d.ts","sourceRoot":"","sources":["../../src/utils/locale.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,gBAAgB,QAAqC,CAAC;AAQnE,6EAA6E;AAC7E,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAenD;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAUzD,CAAC;AAEH;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAgBtD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CACzB,SAAS,EAAE,MAAM,EAAE,EACnB,SAAS,EAAE,MAAM,EAAE,EACnB,QAAQ,EAAE,MAAM,GACf,MAAM,CAgBR;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAY5D;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,GAAG,KAAK,CAEpD"}
|
package/dist/utils/locale.js
CHANGED
|
@@ -19,9 +19,19 @@
|
|
|
19
19
|
* @module utils/locale
|
|
20
20
|
*/
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
22
|
+
* Locale grammar: 2–3 letter language + zero or more `-XXXX` subtags
|
|
23
|
+
* (script/region/variant), each 2–4 alphanumerics. Anchored, case-insensitive.
|
|
24
|
+
*
|
|
25
|
+
* DELIBERATELY BROADER THAN EDGE, and the difference is not parity rot. This
|
|
26
|
+
* used to claim it was the "same grammar as `@lionrapid/edge`'s `LOCALE_BODY`";
|
|
27
|
+
* that was false — edge uses `?` (AT MOST ONE subtag) where this uses `*`, so
|
|
28
|
+
* `zh-Hant-TW` and `de-CH-1901` are accepted here and rejected there.
|
|
29
|
+
*
|
|
30
|
+
* The claim was corrected rather than the regex: language-script-region is
|
|
31
|
+
* ordinary BCP-47, so narrowing core to one subtag would reject legitimate tags
|
|
32
|
+
* to match a narrower peer. The practical consequence to know is that a
|
|
33
|
+
* two-subtag tag core accepts will not round-trip through edge's cookie/path
|
|
34
|
+
* matching — if that ever needs to hold, widen edge, do not narrow this.
|
|
25
35
|
*/
|
|
26
36
|
export const LOCALE_TAG_REGEX = /^[a-z]{2,3}(?:-[a-z0-9]{2,4})*$/i;
|
|
27
37
|
/**
|
|
@@ -57,15 +67,74 @@ export function normalizeLocale(tag) {
|
|
|
57
67
|
}
|
|
58
68
|
return out.join('-');
|
|
59
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* ISO 639-2/T -> 639-1 for the languages this product ships.
|
|
72
|
+
*
|
|
73
|
+
* MUST stay in lockstep with `ISO639_2_TO_1` in
|
|
74
|
+
* packages/edge/src/language-detector.ts and `LocalePattern::ISO639_2_TO_1` in
|
|
75
|
+
* packages/wordpress/src/Runtime/LocalePattern.php — same table, same reason.
|
|
76
|
+
* All three are asserted identical by
|
|
77
|
+
* src/__tests__/parity/locale-table-parity.test.ts, which reads the other two
|
|
78
|
+
* as text; see that file for what a test can and cannot enforce here.
|
|
79
|
+
*
|
|
80
|
+
* Curated rather than derived: there is no safe rule for reducing a 3-letter
|
|
81
|
+
* code to a 2-letter one. `est` (Estonian) would become `es` (Spanish) under
|
|
82
|
+
* any prefix heuristic. An unlisted code simply does not match, so this can
|
|
83
|
+
* only widen matching, never mis-match.
|
|
84
|
+
*
|
|
85
|
+
* It is needed because tm-server canonicalises to ISO 639-2 (`eng`, `fin`)
|
|
86
|
+
* while configured language lists carry 2-letter codes, and a `lionrapid_locale`
|
|
87
|
+
* cookie already in a visitor's browser cannot be recalled.
|
|
88
|
+
*/
|
|
89
|
+
export const ISO639_2_TO_1 = Object.freeze({
|
|
90
|
+
ara: 'ar', ben: 'bn', bul: 'bg', ces: 'cs', cmn: 'zh',
|
|
91
|
+
dan: 'da', deu: 'de', ell: 'el', eng: 'en', est: 'et',
|
|
92
|
+
fas: 'fa', fin: 'fi', fra: 'fr', heb: 'he', hin: 'hi',
|
|
93
|
+
hrv: 'hr', hun: 'hu', ind: 'id', isl: 'is', ita: 'it',
|
|
94
|
+
jpn: 'ja', kor: 'ko', lav: 'lv', lit: 'lt', msa: 'ms',
|
|
95
|
+
nld: 'nl', nor: 'no', pol: 'pl', por: 'pt', ron: 'ro',
|
|
96
|
+
rus: 'ru', slk: 'sk', slv: 'sl', spa: 'es', srp: 'sr',
|
|
97
|
+
swe: 'sv', tha: 'th', tur: 'tr', ukr: 'uk', urd: 'ur',
|
|
98
|
+
vie: 'vi', yid: 'yi', zho: 'zh',
|
|
99
|
+
});
|
|
100
|
+
/**
|
|
101
|
+
* Every form of `tag` worth testing against a configured language list, most
|
|
102
|
+
* specific first: longest-prefix reduction (`pt-br-x` -> `pt-br` -> `pt`) with
|
|
103
|
+
* each 3-letter primary subtag also standing for its 2-letter form.
|
|
104
|
+
*
|
|
105
|
+
* Mirrors edge's `resolveLocale` candidate generation and WordPress's
|
|
106
|
+
* `LocalePattern::candidates`. Used for BOTH the cookie and the browser
|
|
107
|
+
* negotiation paths, so an explicit choice is never resolved less tolerantly
|
|
108
|
+
* than an inferred preference — the rule the other two surfaces already follow.
|
|
109
|
+
*/
|
|
110
|
+
export function localeCandidates(tag) {
|
|
111
|
+
const normalized = tag.trim().toLowerCase();
|
|
112
|
+
if (!normalized)
|
|
113
|
+
return [];
|
|
114
|
+
const parts = normalized.split('-');
|
|
115
|
+
const out = [];
|
|
116
|
+
while (parts.length > 0) {
|
|
117
|
+
const candidate = parts.join('-');
|
|
118
|
+
if (!out.includes(candidate))
|
|
119
|
+
out.push(candidate);
|
|
120
|
+
const twoLetter = ISO639_2_TO_1[candidate];
|
|
121
|
+
if (twoLetter && !out.includes(twoLetter))
|
|
122
|
+
out.push(twoLetter);
|
|
123
|
+
parts.pop();
|
|
124
|
+
}
|
|
125
|
+
return out;
|
|
126
|
+
}
|
|
60
127
|
/**
|
|
61
128
|
* Negotiate a locale: for each requested tag (in preference order), return the
|
|
62
|
-
* best `available` match
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
129
|
+
* best `available` match, trying `localeCandidates(tag)` most-specific first —
|
|
130
|
+
* exact full tag (case-insensitive), its ISO 639-2 alias if it has one, then the
|
|
131
|
+
* shortened prefixes down to the bare primary subtag. Returns `fallback` when
|
|
132
|
+
* nothing matches. Mirrors edge's `resolveLocale` so both packages resolve
|
|
133
|
+
* identically.
|
|
66
134
|
*
|
|
67
135
|
* Note (matches edge + the server): a bare requested `pt` does NOT match an
|
|
68
136
|
* available `pt-BR` — region-specific availability is not silently widened.
|
|
137
|
+
* Widening only ever goes the other way (`por`/`pt-BR` -> `pt`).
|
|
69
138
|
*/
|
|
70
139
|
export function matchLocale(requested, available, fallback) {
|
|
71
140
|
if (available.length === 0)
|
|
@@ -77,14 +146,13 @@ export function matchLocale(requested, available, fallback) {
|
|
|
77
146
|
for (const req of requested) {
|
|
78
147
|
if (!req)
|
|
79
148
|
continue;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
return byPrimary.raw;
|
|
149
|
+
// Most specific first: exact tag, then any 639-2 alias of it, then the
|
|
150
|
+
// shortened prefixes. `localeCandidates` owns that order.
|
|
151
|
+
for (const candidate of localeCandidates(req)) {
|
|
152
|
+
const hit = avail.find((a) => a.lower === candidate);
|
|
153
|
+
if (hit)
|
|
154
|
+
return hit.raw;
|
|
155
|
+
}
|
|
88
156
|
}
|
|
89
157
|
return fallback;
|
|
90
158
|
}
|
package/dist/utils/locale.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locale.js","sourceRoot":"","sources":["../../src/utils/locale.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH
|
|
1
|
+
{"version":3,"file":"locale.js","sourceRoot":"","sources":["../../src/utils/locale.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,kCAAkC,CAAC;AAEnE;;;GAGG;AACH,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAE9D,6EAA6E;AAC7E,MAAM,UAAU,aAAa,CAAC,GAAW;IACvC,OAAO,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,CAAC,WAAW,EAAE,CAAC;AAC1C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,GAAW;IACzC,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;IAC3B,IAAI,CAAC,OAAO;QAAE,OAAO,OAAO,CAAC;IAC7B,MAAM,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC3C,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,IAAI,CAAC,CAAC,CAAC;QAC7D,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1D,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACzD,CAAC,CAAC;SACD,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC;SAChD,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;SACzB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AACvB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,GAAW;IACnC,OAAO,aAAa,CAAC,GAAG,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;AAC/D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lionrapid/core",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.5",
|
|
4
4
|
"description": "Core functionality for LionRapid localization library with fixed dist publishing",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
"@vitest/ui": "^1.0.0",
|
|
50
50
|
"dotenv-cli": "^7.3.0",
|
|
51
51
|
"happy-dom": "^20.1.0",
|
|
52
|
+
"semver": "^7.6.0",
|
|
52
53
|
"typescript": "^5.2.0",
|
|
53
54
|
"vitest": "^1.0.0"
|
|
54
55
|
},
|