adonis-intlayer 8.2.4 → 8.3.0-canary.0
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/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +14 -14
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./middleware.cjs`);let t=require(`@intlayer/chokidar/build`),n=require(`@intlayer/config/node`),r=require(`@intlayer/core/interpreter`),i=require(`cls-hooked`);const
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./middleware.cjs`);let t=require(`@intlayer/chokidar/build`),n=require(`@intlayer/config/node`),r=require(`@intlayer/core/interpreter`),i=require(`@intlayer/core/utils`),a=require(`cls-hooked`);const o=(0,n.getConfiguration)(),{internationalization:s}=o,c=(0,a.createNamespace)(`app`);(0,t.prepareIntlayer)(o);const l=e=>(0,i.getLocaleFromStorage)({getCookie:t=>e.request.cookie(t),getHeader:t=>e.request.header(t)}),u=e=>(t,n)=>{let{locale:i,defaultLocale:a}=e,o=n??i;return t===void 0?``:typeof t==`string`?t:t?.[o]===void 0?t?.[a]===void 0?t:(0,r.getTranslation)(t,a):(0,r.getTranslation)(t,o)},d=(e,t)=>{try{if(c===void 0)throw Error("Intlayer is not initialized. Add the `intlayer` middleware to your kernel before using this function.");if(typeof c.get(`t`)!=`function`)throw Error(`Using the import { t } from "adonis-intlayer" is not supported in your environment. Ensure you are within a request context.`);return c.get(`t`)(e,t)}catch(n){return process.env.NODE_ENV===`development`&&console.error(n.message),(0,r.getTranslation)(e,t??s.defaultLocale)}},f=((e,t,...n)=>{try{if(c===void 0)throw Error("Intlayer is not initialized. Add the `intlayer` middleware to your kernel before using this function.");let r=c.get(`getIntlayer`);if(typeof r!=`function`)throw Error(`Using the import { getIntlayer } from "adonis-intlayer" is not supported in your environment. Ensure you are within a request context.`);return r(e,t,...n)}catch(r){return process.env.NODE_ENV===`development`&&console.error(r.message),getIntlayerFunction(e,t,...n)}}),p=((e,t,...n)=>{try{if(c===void 0)throw Error("Intlayer is not initialized. Add the `intlayer` middleware to your kernel before using this function.");let r=c.get(`getDictionary`);if(typeof r!=`function`)throw Error(`Using the import { getDictionary } from "adonis-intlayer" is not supported in your environment. Ensure you are within a request context.`);return r(e,t,...n)}catch(i){return process.env.NODE_ENV===`development`&&console.error(i.message),(0,r.getDictionary)(e,t,...n)}}),m=e=>{try{if(c===void 0)throw Error("Intlayer is not initialized. Add the `intlayer` middleware to your kernel before using this function.");return c.get(`locale`)??e??s.defaultLocale}catch{return e??s.defaultLocale}};exports.IntlayerMiddleware=e,exports.appNamespace=c,exports.getDictionary=p,exports.getIntlayer=f,exports.getLocale=m,exports.getStorageLocale=l,exports.t=d,exports.translateFunction=u;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/index.ts"],"sourcesContent":["import type { HttpContext } from '@adonisjs/core/http';\nimport { prepareIntlayer } from '@intlayer/chokidar/build';\nimport { getConfiguration } from '@intlayer/config/node';\nimport type { getIntlayer as getIntlayerFunction } from '@intlayer/core/interpreter';\nimport {\n getDictionary as getDictionaryFunction,\n getTranslation,\n} from '@intlayer/core/interpreter';\nimport type {
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/index.ts"],"sourcesContent":["import type { HttpContext } from '@adonisjs/core/http';\nimport { prepareIntlayer } from '@intlayer/chokidar/build';\nimport { getConfiguration } from '@intlayer/config/node';\nimport type { getIntlayer as getIntlayerFunction } from '@intlayer/core/interpreter';\nimport {\n getDictionary as getDictionaryFunction,\n getTranslation,\n} from '@intlayer/core/interpreter';\nimport { getLocaleFromStorage } from '@intlayer/core/utils';\nimport type { StrictModeLocaleMap } from '@intlayer/types/module_augmentation';\nimport type { Locale } from '@intlayer/types/allLocales';\nimport { createNamespace } from 'cls-hooked';\n\nconst configuration = getConfiguration();\nconst { internationalization } = configuration;\n\nexport const appNamespace = createNamespace('app');\n\nprepareIntlayer(configuration);\n\n/**\n * Retrieves the locale from storage (cookies, headers).\n */\nexport const getStorageLocale = (ctx: HttpContext): Locale | undefined =>\n getLocaleFromStorage({\n getCookie: (name: string) => ctx.request.cookie(name),\n getHeader: (name: string) => ctx.request.header(name),\n });\n\n/**\n * Translation function for context\n */\nexport const translateFunction =\n (ctx: HttpContext) =>\n <T extends string>(\n content: StrictModeLocaleMap<T> | string,\n locale?: Locale\n ): T => {\n const { locale: currentLocale, defaultLocale } = ctx as unknown as {\n locale: Locale;\n defaultLocale: Locale;\n };\n\n const targetLocale = locale ?? currentLocale;\n\n if (typeof content === 'undefined') {\n return '' as unknown as T;\n }\n\n if (typeof content === 'string') {\n return content as unknown as T;\n }\n\n if (\n typeof content?.[\n targetLocale as unknown as keyof StrictModeLocaleMap<T>\n ] === 'undefined'\n ) {\n if (\n typeof content?.[\n defaultLocale as unknown as keyof StrictModeLocaleMap<T>\n ] === 'undefined'\n ) {\n return content as unknown as T;\n } else {\n return getTranslation(content, defaultLocale);\n }\n }\n\n return getTranslation(content, targetLocale);\n };\n\n/**\n * Translation function to retrieve content for the current locale.\n *\n * This function works within the request lifecycle managed by the `intlayer` middleware.\n *\n * @param content - A map of locales to content.\n * @param locale - Optional locale override.\n * @returns The translated content.\n *\n * @example\n * ```ts\n * import { t } from 'adonis-intlayer';\n *\n * router.get('/', async () => {\n * const greeting = t({\n * en: 'Hello',\n * fr: 'Bonjour',\n * });\n * return greeting;\n * });\n * ```\n */\nexport const t = <Content = string>(\n content: StrictModeLocaleMap<Content>,\n locale?: Locale\n): Content => {\n try {\n if (typeof appNamespace === 'undefined') {\n throw new Error(\n 'Intlayer is not initialized. Add the `intlayer` middleware to your kernel before using this function.'\n );\n }\n\n if (typeof appNamespace.get('t') !== 'function') {\n throw new Error(\n 'Using the import { t } from \"adonis-intlayer\" is not supported in your environment. Ensure you are within a request context.'\n );\n }\n\n return appNamespace.get('t')(content, locale);\n } catch (error) {\n if (process.env.NODE_ENV === 'development') {\n console.error((error as Error).message);\n }\n\n return getTranslation(\n content,\n locale ?? internationalization.defaultLocale\n );\n }\n};\n\nexport const getIntlayer: typeof getIntlayerFunction = ((\n key: any,\n localeArg?: any,\n ...props: any[]\n) => {\n try {\n if (typeof appNamespace === 'undefined') {\n throw new Error(\n 'Intlayer is not initialized. Add the `intlayer` middleware to your kernel before using this function.'\n );\n }\n\n const getIntlayerWrapped = appNamespace.get('getIntlayer');\n\n if (typeof getIntlayerWrapped !== 'function') {\n throw new Error(\n 'Using the import { getIntlayer } from \"adonis-intlayer\" is not supported in your environment. Ensure you are within a request context.'\n );\n }\n\n return getIntlayerWrapped(key, localeArg, ...props);\n } catch (error) {\n if (process.env.NODE_ENV === 'development') {\n console.error((error as Error).message);\n }\n return getIntlayerFunction(key, localeArg, ...props);\n }\n}) as typeof getIntlayerFunction;\n\nexport const getDictionary: typeof getDictionaryFunction = ((\n key: any,\n localeArg?: any,\n ...props: any[]\n) => {\n try {\n if (typeof appNamespace === 'undefined') {\n throw new Error(\n 'Intlayer is not initialized. Add the `intlayer` middleware to your kernel before using this function.'\n );\n }\n\n const getDictionaryWrapped = appNamespace.get('getDictionary');\n\n if (typeof getDictionaryWrapped !== 'function') {\n throw new Error(\n 'Using the import { getDictionary } from \"adonis-intlayer\" is not supported in your environment. Ensure you are within a request context.'\n );\n }\n\n return getDictionaryWrapped(key, localeArg, ...props);\n } catch (error) {\n if (process.env.NODE_ENV === 'development') {\n console.error((error as Error).message);\n }\n return getDictionaryFunction(key, localeArg, ...props);\n }\n}) as typeof getDictionaryFunction;\n\nexport const getLocale = (locale?: Locale): Locale => {\n try {\n if (typeof appNamespace === 'undefined') {\n throw new Error(\n 'Intlayer is not initialized. Add the `intlayer` middleware to your kernel before using this function.'\n );\n }\n\n return (\n appNamespace.get('locale') ?? locale ?? internationalization.defaultLocale\n );\n } catch (_error) {\n return locale ?? internationalization.defaultLocale;\n }\n};\n\nexport { default as IntlayerMiddleware } from './middleware';\n"],"mappings":"sRAaA,MAAM,GAAA,EAAA,EAAA,mBAAkC,CAClC,CAAE,wBAAyB,EAEpB,GAAA,EAAA,EAAA,iBAA+B,MAAM,uBAElC,EAAc,CAK9B,MAAa,EAAoB,IAAA,EAAA,EAAA,sBACV,CACnB,UAAY,GAAiB,EAAI,QAAQ,OAAO,EAAK,CACrD,UAAY,GAAiB,EAAI,QAAQ,OAAO,EAAK,CACtD,CAAC,CAKS,EACV,IAEC,EACA,IACM,CACN,GAAM,CAAE,OAAQ,EAAe,iBAAkB,EAK3C,EAAe,GAAU,EA0B/B,OAxBW,IAAY,OACd,GAGL,OAAO,GAAY,SACd,EAIA,IACL,KACI,OAGG,IACL,KACI,OAEC,GAEP,EAAA,EAAA,gBAAsB,EAAS,EAAc,EAIjD,EAAA,EAAA,gBAAsB,EAAS,EAAa,EAyBnC,GACX,EACA,IACY,CACZ,GAAI,CACF,GAAW,IAAiB,OAC1B,MAAU,MACR,wGACD,CAGH,GAAI,OAAO,EAAa,IAAI,IAAI,EAAK,WACnC,MAAU,MACR,+HACD,CAGH,OAAO,EAAa,IAAI,IAAI,CAAC,EAAS,EAAO,OACtC,EAAO,CAKd,OAJI,QAAQ,IAAI,WAAa,eAC3B,QAAQ,MAAO,EAAgB,QAAQ,EAGzC,EAAA,EAAA,gBACE,EACA,GAAU,EAAqB,cAChC,GAIQ,IACX,EACA,EACA,GAAG,IACA,CACH,GAAI,CACF,GAAW,IAAiB,OAC1B,MAAU,MACR,wGACD,CAGH,IAAM,EAAqB,EAAa,IAAI,cAAc,CAE1D,GAAI,OAAO,GAAuB,WAChC,MAAU,MACR,yIACD,CAGH,OAAO,EAAmB,EAAK,EAAW,GAAG,EAAM,OAC5C,EAAO,CAId,OAHI,QAAQ,IAAI,WAAa,eAC3B,QAAQ,MAAO,EAAgB,QAAQ,CAElC,oBAAoB,EAAK,EAAW,GAAG,EAAM,IAI3C,IACX,EACA,EACA,GAAG,IACA,CACH,GAAI,CACF,GAAW,IAAiB,OAC1B,MAAU,MACR,wGACD,CAGH,IAAM,EAAuB,EAAa,IAAI,gBAAgB,CAE9D,GAAI,OAAO,GAAyB,WAClC,MAAU,MACR,2IACD,CAGH,OAAO,EAAqB,EAAK,EAAW,GAAG,EAAM,OAC9C,EAAO,CAId,OAHI,QAAQ,IAAI,WAAa,eAC3B,QAAQ,MAAO,EAAgB,QAAQ,EAEzC,EAAA,EAAA,eAA6B,EAAK,EAAW,GAAG,EAAM,IAI7C,EAAa,GAA4B,CACpD,GAAI,CACF,GAAW,IAAiB,OAC1B,MAAU,MACR,wGACD,CAGH,OACE,EAAa,IAAI,SAAS,EAAI,GAAU,EAAqB,mBAEhD,CACf,OAAO,GAAU,EAAqB"}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"./middleware.mjs";import{prepareIntlayer as t}from"@intlayer/chokidar/build";import{getConfiguration as n}from"@intlayer/config/node";import{getDictionary as r,getTranslation as i}from"@intlayer/core/interpreter";import{
|
|
1
|
+
import e from"./middleware.mjs";import{prepareIntlayer as t}from"@intlayer/chokidar/build";import{getConfiguration as n}from"@intlayer/config/node";import{getDictionary as r,getTranslation as i}from"@intlayer/core/interpreter";import{getLocaleFromStorage as a}from"@intlayer/core/utils";import{createNamespace as o}from"cls-hooked";const s=n(),{internationalization:c}=s,l=o(`app`);t(s);const u=e=>a({getCookie:t=>e.request.cookie(t),getHeader:t=>e.request.header(t)}),d=e=>(t,n)=>{let{locale:r,defaultLocale:a}=e,o=n??r;return t===void 0?``:typeof t==`string`?t:t?.[o]===void 0?t?.[a]===void 0?t:i(t,a):i(t,o)},f=(e,t)=>{try{if(l===void 0)throw Error("Intlayer is not initialized. Add the `intlayer` middleware to your kernel before using this function.");if(typeof l.get(`t`)!=`function`)throw Error(`Using the import { t } from "adonis-intlayer" is not supported in your environment. Ensure you are within a request context.`);return l.get(`t`)(e,t)}catch{return i(e,t??c.defaultLocale)}},p=((e,t,...n)=>{try{if(l===void 0)throw Error("Intlayer is not initialized. Add the `intlayer` middleware to your kernel before using this function.");let r=l.get(`getIntlayer`);if(typeof r!=`function`)throw Error(`Using the import { getIntlayer } from "adonis-intlayer" is not supported in your environment. Ensure you are within a request context.`);return r(e,t,...n)}catch{return getIntlayerFunction(e,t,...n)}}),m=((e,t,...n)=>{try{if(l===void 0)throw Error("Intlayer is not initialized. Add the `intlayer` middleware to your kernel before using this function.");let r=l.get(`getDictionary`);if(typeof r!=`function`)throw Error(`Using the import { getDictionary } from "adonis-intlayer" is not supported in your environment. Ensure you are within a request context.`);return r(e,t,...n)}catch{return r(e,t,...n)}}),h=e=>{try{if(l===void 0)throw Error("Intlayer is not initialized. Add the `intlayer` middleware to your kernel before using this function.");return l.get(`locale`)??e??c.defaultLocale}catch{return e??c.defaultLocale}};export{e as IntlayerMiddleware,l as appNamespace,m as getDictionary,p as getIntlayer,h as getLocale,u as getStorageLocale,f as t,d as translateFunction};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["getDictionaryFunction"],"sources":["../../src/index.ts"],"sourcesContent":["import type { HttpContext } from '@adonisjs/core/http';\nimport { prepareIntlayer } from '@intlayer/chokidar/build';\nimport { getConfiguration } from '@intlayer/config/node';\nimport type { getIntlayer as getIntlayerFunction } from '@intlayer/core/interpreter';\nimport {\n getDictionary as getDictionaryFunction,\n getTranslation,\n} from '@intlayer/core/interpreter';\nimport type {
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["getDictionaryFunction"],"sources":["../../src/index.ts"],"sourcesContent":["import type { HttpContext } from '@adonisjs/core/http';\nimport { prepareIntlayer } from '@intlayer/chokidar/build';\nimport { getConfiguration } from '@intlayer/config/node';\nimport type { getIntlayer as getIntlayerFunction } from '@intlayer/core/interpreter';\nimport {\n getDictionary as getDictionaryFunction,\n getTranslation,\n} from '@intlayer/core/interpreter';\nimport { getLocaleFromStorage } from '@intlayer/core/utils';\nimport type { StrictModeLocaleMap } from '@intlayer/types/module_augmentation';\nimport type { Locale } from '@intlayer/types/allLocales';\nimport { createNamespace } from 'cls-hooked';\n\nconst configuration = getConfiguration();\nconst { internationalization } = configuration;\n\nexport const appNamespace = createNamespace('app');\n\nprepareIntlayer(configuration);\n\n/**\n * Retrieves the locale from storage (cookies, headers).\n */\nexport const getStorageLocale = (ctx: HttpContext): Locale | undefined =>\n getLocaleFromStorage({\n getCookie: (name: string) => ctx.request.cookie(name),\n getHeader: (name: string) => ctx.request.header(name),\n });\n\n/**\n * Translation function for context\n */\nexport const translateFunction =\n (ctx: HttpContext) =>\n <T extends string>(\n content: StrictModeLocaleMap<T> | string,\n locale?: Locale\n ): T => {\n const { locale: currentLocale, defaultLocale } = ctx as unknown as {\n locale: Locale;\n defaultLocale: Locale;\n };\n\n const targetLocale = locale ?? currentLocale;\n\n if (typeof content === 'undefined') {\n return '' as unknown as T;\n }\n\n if (typeof content === 'string') {\n return content as unknown as T;\n }\n\n if (\n typeof content?.[\n targetLocale as unknown as keyof StrictModeLocaleMap<T>\n ] === 'undefined'\n ) {\n if (\n typeof content?.[\n defaultLocale as unknown as keyof StrictModeLocaleMap<T>\n ] === 'undefined'\n ) {\n return content as unknown as T;\n } else {\n return getTranslation(content, defaultLocale);\n }\n }\n\n return getTranslation(content, targetLocale);\n };\n\n/**\n * Translation function to retrieve content for the current locale.\n *\n * This function works within the request lifecycle managed by the `intlayer` middleware.\n *\n * @param content - A map of locales to content.\n * @param locale - Optional locale override.\n * @returns The translated content.\n *\n * @example\n * ```ts\n * import { t } from 'adonis-intlayer';\n *\n * router.get('/', async () => {\n * const greeting = t({\n * en: 'Hello',\n * fr: 'Bonjour',\n * });\n * return greeting;\n * });\n * ```\n */\nexport const t = <Content = string>(\n content: StrictModeLocaleMap<Content>,\n locale?: Locale\n): Content => {\n try {\n if (typeof appNamespace === 'undefined') {\n throw new Error(\n 'Intlayer is not initialized. Add the `intlayer` middleware to your kernel before using this function.'\n );\n }\n\n if (typeof appNamespace.get('t') !== 'function') {\n throw new Error(\n 'Using the import { t } from \"adonis-intlayer\" is not supported in your environment. Ensure you are within a request context.'\n );\n }\n\n return appNamespace.get('t')(content, locale);\n } catch (error) {\n if (process.env.NODE_ENV === 'development') {\n console.error((error as Error).message);\n }\n\n return getTranslation(\n content,\n locale ?? internationalization.defaultLocale\n );\n }\n};\n\nexport const getIntlayer: typeof getIntlayerFunction = ((\n key: any,\n localeArg?: any,\n ...props: any[]\n) => {\n try {\n if (typeof appNamespace === 'undefined') {\n throw new Error(\n 'Intlayer is not initialized. Add the `intlayer` middleware to your kernel before using this function.'\n );\n }\n\n const getIntlayerWrapped = appNamespace.get('getIntlayer');\n\n if (typeof getIntlayerWrapped !== 'function') {\n throw new Error(\n 'Using the import { getIntlayer } from \"adonis-intlayer\" is not supported in your environment. Ensure you are within a request context.'\n );\n }\n\n return getIntlayerWrapped(key, localeArg, ...props);\n } catch (error) {\n if (process.env.NODE_ENV === 'development') {\n console.error((error as Error).message);\n }\n return getIntlayerFunction(key, localeArg, ...props);\n }\n}) as typeof getIntlayerFunction;\n\nexport const getDictionary: typeof getDictionaryFunction = ((\n key: any,\n localeArg?: any,\n ...props: any[]\n) => {\n try {\n if (typeof appNamespace === 'undefined') {\n throw new Error(\n 'Intlayer is not initialized. Add the `intlayer` middleware to your kernel before using this function.'\n );\n }\n\n const getDictionaryWrapped = appNamespace.get('getDictionary');\n\n if (typeof getDictionaryWrapped !== 'function') {\n throw new Error(\n 'Using the import { getDictionary } from \"adonis-intlayer\" is not supported in your environment. Ensure you are within a request context.'\n );\n }\n\n return getDictionaryWrapped(key, localeArg, ...props);\n } catch (error) {\n if (process.env.NODE_ENV === 'development') {\n console.error((error as Error).message);\n }\n return getDictionaryFunction(key, localeArg, ...props);\n }\n}) as typeof getDictionaryFunction;\n\nexport const getLocale = (locale?: Locale): Locale => {\n try {\n if (typeof appNamespace === 'undefined') {\n throw new Error(\n 'Intlayer is not initialized. Add the `intlayer` middleware to your kernel before using this function.'\n );\n }\n\n return (\n appNamespace.get('locale') ?? locale ?? internationalization.defaultLocale\n );\n } catch (_error) {\n return locale ?? internationalization.defaultLocale;\n }\n};\n\nexport { default as IntlayerMiddleware } from './middleware';\n"],"mappings":"4UAaA,MAAM,EAAgB,GAAkB,CAClC,CAAE,wBAAyB,EAEpB,EAAe,EAAgB,MAAM,CAElD,EAAgB,EAAc,CAK9B,MAAa,EAAoB,GAC/B,EAAqB,CACnB,UAAY,GAAiB,EAAI,QAAQ,OAAO,EAAK,CACrD,UAAY,GAAiB,EAAI,QAAQ,OAAO,EAAK,CACtD,CAAC,CAKS,EACV,IAEC,EACA,IACM,CACN,GAAM,CAAE,OAAQ,EAAe,iBAAkB,EAK3C,EAAe,GAAU,EA0B/B,OAxBW,IAAY,OACd,GAGL,OAAO,GAAY,SACd,EAIA,IACL,KACI,OAGG,IACL,KACI,OAEC,EAEA,EAAe,EAAS,EAAc,CAI1C,EAAe,EAAS,EAAa,EAyBnC,GACX,EACA,IACY,CACZ,GAAI,CACF,GAAW,IAAiB,OAC1B,MAAU,MACR,wGACD,CAGH,GAAI,OAAO,EAAa,IAAI,IAAI,EAAK,WACnC,MAAU,MACR,+HACD,CAGH,OAAO,EAAa,IAAI,IAAI,CAAC,EAAS,EAAO,MAC/B,CAKd,OAAO,EACL,EACA,GAAU,EAAqB,cAChC,GAIQ,IACX,EACA,EACA,GAAG,IACA,CACH,GAAI,CACF,GAAW,IAAiB,OAC1B,MAAU,MACR,wGACD,CAGH,IAAM,EAAqB,EAAa,IAAI,cAAc,CAE1D,GAAI,OAAO,GAAuB,WAChC,MAAU,MACR,yIACD,CAGH,OAAO,EAAmB,EAAK,EAAW,GAAG,EAAM,MACrC,CAId,OAAO,oBAAoB,EAAK,EAAW,GAAG,EAAM,IAI3C,IACX,EACA,EACA,GAAG,IACA,CACH,GAAI,CACF,GAAW,IAAiB,OAC1B,MAAU,MACR,wGACD,CAGH,IAAM,EAAuB,EAAa,IAAI,gBAAgB,CAE9D,GAAI,OAAO,GAAyB,WAClC,MAAU,MACR,2IACD,CAGH,OAAO,EAAqB,EAAK,EAAW,GAAG,EAAM,MACvC,CAId,OAAOA,EAAsB,EAAK,EAAW,GAAG,EAAM,IAI7C,EAAa,GAA4B,CACpD,GAAI,CACF,GAAW,IAAiB,OAC1B,MAAU,MACR,wGACD,CAGH,OACE,EAAa,IAAI,SAAS,EAAI,GAAU,EAAqB,mBAEhD,CACf,OAAO,GAAU,EAAqB"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -2,7 +2,8 @@ import IntlayerMiddleware from "./middleware.js";
|
|
|
2
2
|
import * as cls_hooked0 from "cls-hooked";
|
|
3
3
|
import { HttpContext } from "@adonisjs/core/http";
|
|
4
4
|
import { getDictionary as getDictionary$1, getIntlayer as getIntlayer$1 } from "@intlayer/core/interpreter";
|
|
5
|
-
import {
|
|
5
|
+
import { StrictModeLocaleMap } from "@intlayer/types/module_augmentation";
|
|
6
|
+
import { Locale } from "@intlayer/types/allLocales";
|
|
6
7
|
|
|
7
8
|
//#region src/index.d.ts
|
|
8
9
|
declare const appNamespace: cls_hooked0.Namespace<Record<string, any>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/index.ts"],"mappings":";;;;;;;;cAgBa,YAAA,EAAY,WAAA,CAAA,SAAA,CAAA,MAAA;;;AAAzB;cAOa,gBAAA,GAAoB,GAAA,EAAK,WAAA,KAAc,MAAA;;;;cASvC,iBAAA,GACV,GAAA,EAAK,WAAA,wBAEJ,OAAA,EAAS,mBAAA,CAAoB,CAAA,YAC7B,MAAA,GAAS,MAAA,KACR,CAAA;;;;;;;;;AALL;;;;;;;;;;;;;;cA8Da,CAAA,qBACX,OAAA,EAAS,mBAAA,CAAoB,OAAA,GAC7B,MAAA,GAAS,MAAA,KACR,OAAA;AAAA,cA2BU,WAAA,SAAoB,aAAA;AAAA,cA6BpB,aAAA,SAAsB,eAAA;AAAA,cA6BtB,SAAA,GAAa,MAAA,GAAS,MAAA,KAAS,MAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "adonis-intlayer",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.3.0-canary.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Manage internationalization i18n in a simple way for AdonisJS application.",
|
|
6
6
|
"keywords": [
|
|
@@ -65,27 +65,27 @@
|
|
|
65
65
|
"scripts": {
|
|
66
66
|
"build": "tsdown --config tsdown.config.ts",
|
|
67
67
|
"build:ci": "tsdown --config tsdown.config.ts",
|
|
68
|
-
"clean": "rimraf ./dist .turbo",
|
|
68
|
+
"clean": "bun --bun rimraf ./dist .turbo",
|
|
69
69
|
"dev": "tsdown --config tsdown.config.ts --watch",
|
|
70
|
-
"format": "biome format . --check",
|
|
71
|
-
"format:fix": "biome format --write .",
|
|
72
|
-
"lint": "biome lint .",
|
|
73
|
-
"lint:fix": "biome lint --write .",
|
|
70
|
+
"format": "bun --bun biome format . --check",
|
|
71
|
+
"format:fix": "bun --bun biome format --write .",
|
|
72
|
+
"lint": "bun --bun biome lint .",
|
|
73
|
+
"lint:fix": "bun --bun biome lint --write .",
|
|
74
74
|
"prepublish": "cp -f ../../README.md ./README.md",
|
|
75
75
|
"publish": "bun publish || true",
|
|
76
76
|
"publish:canary": "bun publish --access public --tag canary || true",
|
|
77
77
|
"publish:latest": "bun publish --access public --tag latest || true",
|
|
78
|
-
"test": "vitest run",
|
|
79
|
-
"test:watch": "vitest",
|
|
78
|
+
"test": "bun --bun vitest run",
|
|
79
|
+
"test:watch": "bun --bun vitest",
|
|
80
80
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
81
81
|
},
|
|
82
82
|
"dependencies": {
|
|
83
|
-
"@intlayer/chokidar": "8.
|
|
84
|
-
"@intlayer/config": "8.
|
|
85
|
-
"@intlayer/core": "8.
|
|
86
|
-
"@intlayer/types": "8.
|
|
83
|
+
"@intlayer/chokidar": "8.3.0-canary.0",
|
|
84
|
+
"@intlayer/config": "8.3.0-canary.0",
|
|
85
|
+
"@intlayer/core": "8.3.0-canary.0",
|
|
86
|
+
"@intlayer/types": "8.3.0-canary.0",
|
|
87
87
|
"cls-hooked": "4.2.2",
|
|
88
|
-
"intlayer": "8.
|
|
88
|
+
"intlayer": "8.3.0-canary.0"
|
|
89
89
|
},
|
|
90
90
|
"devDependencies": {
|
|
91
91
|
"@adonisjs/core": "6.17.1",
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"@utils/ts-config-types": "1.0.4",
|
|
96
96
|
"@utils/tsdown-config": "1.0.4",
|
|
97
97
|
"rimraf": "6.1.3",
|
|
98
|
-
"tsdown": "0.21.
|
|
98
|
+
"tsdown": "0.21.1",
|
|
99
99
|
"typescript": "5.9.3",
|
|
100
100
|
"vitest": "4.0.18"
|
|
101
101
|
},
|