@intlayer/chokidar 8.3.3 → 8.3.4
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/filterInvalidDictionaries.cjs +1 -1
- package/dist/cjs/filterInvalidDictionaries.cjs.map +1 -1
- package/dist/cjs/utils/runParallel/index.cjs +1 -1
- package/dist/cjs/utils/runParallel/index.cjs.map +1 -1
- package/dist/esm/filterInvalidDictionaries.mjs +1 -1
- package/dist/esm/filterInvalidDictionaries.mjs.map +1 -1
- package/dist/esm/utils/runParallel/index.mjs +1 -1
- package/dist/esm/utils/runParallel/index.mjs.map +1 -1
- package/package.json +9 -9
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./_virtual/_rolldown/runtime.cjs`);const e=require(`./utils/formatter.cjs`);let t=require(`@intlayer/config/logger`),n=require(`@intlayer/core/interpreter`);const r=(r,i,a)=>{let o=(0,t.getAppLogger)(i);if(!r)return!1;let s=r.location===`local`||typeof r.filePath==`string`?`Local`:`Remote`,c=!!r.key,l=!!r.content;if(!c)return o(`${s} dictionary has no key`,{level:`error`}),!1;if(!l)return o(`${s} dictionary ${(0,t.colorizeKey)(r.key)} has no content - ${r.filePath?e.formatPath(r.filePath):(0,t.colorizePath)(`Remote`)}`,{level:`error`}),!1;if(r.schema&&a?.checkSchema&&!(typeof r.content==`function`||typeof r.content==`object`&&r.content!==null&&typeof r.content.then==`function`)){let a=i?.internationalization?.locales??[],c=i?.internationalization.strictMode===`strict`,l=typeof r.schema==`string`?i?.schemas?.[r.schema]:void 0;if(l&&typeof l.safeParse==`function`)for(let i of a){let a=(0,n.getContent)(r.content,{dictionaryKey:r.key,keyPath:[]},i,!c),u=l.safeParse(a);if(!u.success)return o(`${s} dictionary ${(0,t.colorizeKey)(r.key)} has invalid content according to schema ${(0,t.colorize)(r.schema,t.ANSIColors.ORANGE)} for locale ${e.formatLocale(i)} - ${r.filePath?e.formatPath(r.filePath):(0,t.colorizePath)(`Remote`)}`,{level:`error`}),u.error.issues.forEach(n=>{o(`${t.x} Error: ${(0,t.colorizeKey)(r.key)} - ${e.formatLocale(i)} - ${(0,t.colorize)(`${n.path.join(`.`)}:`,t.ANSIColors.BLUE)} ${(0,t.colorize)(n.message,t.ANSIColors.GREY)}`,{level:`error`})}),!1}}return!0},i=(e,t,n)=>(e??[])?.filter(e=>r(e,t,n));exports.filterInvalidDictionaries=i,exports.isInvalidDictionary=r;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./_virtual/_rolldown/runtime.cjs`);const e=require(`./utils/formatter.cjs`);let t=require(`@intlayer/config/logger`),n=require(`@intlayer/core/interpreter`);const r=(r,i,a)=>{let o=(0,t.getAppLogger)(i);if(!r)return!1;let s=r.location===`local`||typeof r.filePath==`string`?`Local`:`Remote`,c=!!r.key,l=!!r.content;if(!c)return o(`${s} dictionary has no key`,{level:`error`}),!1;if(!l)return o(`${s} dictionary ${(0,t.colorizeKey)(r.key)} has no content - ${r.filePath?e.formatPath(r.filePath):(0,t.colorizePath)(`Remote`)}`,{level:`error`}),!1;if(r.schema&&a?.checkSchema&&!(typeof r.content==`function`||typeof r.content==`object`&&r.content!==null&&typeof r.content.then==`function`)){let a=i?.internationalization?.locales??[],c=i?.internationalization.strictMode===`strict`,l=typeof r.schema==`string`?i?.schemas?.[r.schema]:void 0;if(l&&typeof l.safeParse==`function`)for(let i of a){let a=(0,n.getContent)(r.content,{dictionaryKey:r.key,keyPath:[],locale:i},(0,n.getBasePlugins)(i,!c)),u=l.safeParse(a);if(!u.success)return o(`${s} dictionary ${(0,t.colorizeKey)(r.key)} has invalid content according to schema ${(0,t.colorize)(r.schema,t.ANSIColors.ORANGE)} for locale ${e.formatLocale(i)} - ${r.filePath?e.formatPath(r.filePath):(0,t.colorizePath)(`Remote`)}`,{level:`error`}),u.error.issues.forEach(n=>{o(`${t.x} Error: ${(0,t.colorizeKey)(r.key)} - ${e.formatLocale(i)} - ${(0,t.colorize)(`${n.path.join(`.`)}:`,t.ANSIColors.BLUE)} ${(0,t.colorize)(n.message,t.ANSIColors.GREY)}`,{level:`error`})}),!1}}return!0},i=(e,t,n)=>(e??[])?.filter(e=>r(e,t,n));exports.filterInvalidDictionaries=i,exports.isInvalidDictionary=r;
|
|
2
2
|
//# sourceMappingURL=filterInvalidDictionaries.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filterInvalidDictionaries.cjs","names":["formatPath","ANSIColors","formatLocale","x"],"sources":["../../src/filterInvalidDictionaries.ts"],"sourcesContent":["import {\n ANSIColors,\n colorize,\n colorizeKey,\n colorizePath,\n getAppLogger,\n x,\n} from '@intlayer/config/logger';\nimport { getContent } from '@intlayer/core/interpreter';\nimport type {
|
|
1
|
+
{"version":3,"file":"filterInvalidDictionaries.cjs","names":["formatPath","ANSIColors","formatLocale","x"],"sources":["../../src/filterInvalidDictionaries.ts"],"sourcesContent":["import {\n ANSIColors,\n colorize,\n colorizeKey,\n colorizePath,\n getAppLogger,\n x,\n} from '@intlayer/config/logger';\nimport { getBasePlugins, getContent } from '@intlayer/core/interpreter';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport { formatLocale, formatPath } from './utils/formatter';\n\ntype IsInvalidDictionaryOptions = { checkSchema: boolean };\n\nexport const isInvalidDictionary = (\n dictionary: Dictionary | undefined,\n configuration?: IntlayerConfig,\n options?: IsInvalidDictionaryOptions\n): boolean => {\n const appLogger = getAppLogger(configuration);\n\n if (!dictionary) return false;\n\n const isLocal = Boolean(\n dictionary.location === 'local' || typeof dictionary.filePath === 'string'\n );\n const location = isLocal ? 'Local' : 'Remote';\n const hasKey = Boolean(dictionary.key);\n const hasContent = Boolean(dictionary.content);\n\n if (!hasKey) {\n appLogger(`${location} dictionary has no key`, {\n level: 'error',\n });\n\n return false;\n }\n\n if (!hasContent) {\n appLogger(\n `${location} dictionary ${colorizeKey(dictionary.key)} has no content - ${dictionary.filePath ? formatPath(dictionary.filePath) : colorizePath('Remote')}`,\n {\n level: 'error',\n }\n );\n return false;\n }\n\n if (dictionary.schema && options?.checkSchema) {\n const isAsync =\n typeof dictionary.content === 'function' ||\n (typeof dictionary.content === 'object' &&\n dictionary.content !== null &&\n typeof (dictionary.content as any).then === 'function');\n\n if (!isAsync) {\n const locales = configuration?.internationalization?.locales ?? [];\n const isStrict =\n configuration?.internationalization.strictMode === 'strict';\n\n const schema =\n typeof dictionary.schema === 'string'\n ? configuration?.schemas?.[dictionary.schema]\n : undefined;\n\n if (schema && typeof schema.safeParse === 'function') {\n for (const locale of locales) {\n const resolvedContent = getContent(\n dictionary.content,\n {\n dictionaryKey: dictionary.key,\n keyPath: [],\n locale,\n },\n getBasePlugins(locale, !isStrict)\n );\n const result = (schema as any).safeParse(resolvedContent);\n\n if (!result.success) {\n appLogger(\n `${location} dictionary ${colorizeKey(dictionary.key)} has invalid content according to schema ${colorize(dictionary.schema as string, ANSIColors.ORANGE)} for locale ${formatLocale(locale)} - ${dictionary.filePath ? formatPath(dictionary.filePath) : colorizePath('Remote')}`,\n {\n level: 'error',\n }\n );\n\n result.error.issues.forEach((issue: any) => {\n appLogger(\n `${x} Error: ${colorizeKey(dictionary.key)} - ${formatLocale(locale)} - ${colorize(`${issue.path.join('.')}:`, ANSIColors.BLUE)} ${colorize(issue.message, ANSIColors.GREY)}`,\n {\n level: 'error',\n }\n );\n });\n\n return false;\n }\n }\n }\n }\n }\n\n return true;\n};\n\nexport const filterInvalidDictionaries = (\n dictionaries: (Dictionary | undefined)[] | undefined,\n configuration: IntlayerConfig,\n options?: IsInvalidDictionaryOptions\n): Dictionary[] =>\n (dictionaries ?? [])?.filter((dictionary) =>\n isInvalidDictionary(dictionary, configuration, options)\n ) as Dictionary[];\n"],"mappings":"yOAeA,MAAa,GACX,EACA,EACA,IACY,CACZ,IAAM,GAAA,EAAA,EAAA,cAAyB,EAAc,CA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gB,SAAS,GAChR,CACE,MAAO,QACR,CACF,CAED,EAAO,MAAM,OAAO,QAAS,GAAe,CAC1C,EACE,GAAGG,EAAAA,EAAE,WAAA,EAAA,EAAA,aAAsB,EAAW,IAAI,CAAC,KAAKD,EAAAA,aAAa,EAAO,CAAC,MAAA,EAAA,EAAA,UAAc,GAAG,EAAM,KAAK,KAAK,IAAI,CAAC,GAAID,EAAAA,WAAW,KAAK,CAAC,IAAA,EAAA,EAAA,UAAY,EAAM,QAASA,EAAAA,WAAW,KAAK,GAC3K,CACE,MAAO,QACR,CACF,EACD,CAEK,IAOjB,MAAO,IAGI,GACX,EACA,EACA,KAEC,GAAgB,EAAE,GAAG,OAAQ,GAC5B,EAAoB,EAAY,EAAe,EAAQ,CACxD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`./spawnPosix.cjs`),t=require(`./spawnWin32.cjs`);let n=require(`node:path`);const r=r=>{if(!r||Array.isArray(r)&&r.length===0)throw Error(`Invalid command`);let i=Array.isArray(r)?r.join(` `):r,a=Array.isArray(r),o=a?r[0]:i,s=a?r.slice(1):[],c=(0,n.join)(process.cwd(),`node_modules`,`.bin`),l=Object.keys(process.env).find(e=>e.toLowerCase()===`path`)??`PATH`,u=[c,process.env[l]??``].filter(Boolean).join(n.delimiter),d={...process.env,[l]:u},f=process.platform===`win32`,p=f?t.spawnWin32:e.spawnPosix,m={cwd:process.cwd(),stdio:`inherit`,env:d,shell:f},h=a?s.length===0&&/\s/.test(o)?f?p(process.env.ComSpec??`cmd.exe`,[`/d`,`/s`,`/c`,o],m):p(process.env.SHELL??`/bin/sh`,[`-c`,o],m):p(o,s,m):f?p(process.env.ComSpec??`cmd.exe`,[`/d`,`/s`,`/c`,i],m):p(process.env.SHELL??`/bin/sh`,[`-c`,i],m),g=new Promise((e,t)=>{h.on(`error`,e=>{try{console.error(`[runParallel] Failed to start: ${e?.message??String(e)}`)}catch{}y(),t(e)}),h.on(`exit`,(n,r)=>{y(),n===0||r&&[`SIGINT`,`SIGTERM`,`SIGQUIT`,`SIGHUP`].includes(r)?e():t(Object.assign(Error(`Parallel process failed`),{code:n,signal:r}))})}),_=()=>{try{h.kill(`SIGTERM`)}catch{}},v=[{event:`SIGINT`,handler:_},{event:`SIGTERM`,handler:_},{event:`SIGQUIT`,handler:_},{event:`SIGHUP`,handler:_}];v.forEach(({event:e,handler:t})=>{process.on(e,t)});let y=()=>{v.forEach(({event:e,handler:t})=>{process.off(e,t)})};return{kill:()=>{try{h.kill(`SIGTERM`)}catch{}},result:g,commandText:i}};exports.runParallel=r;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`./spawnPosix.cjs`),t=require(`./spawnWin32.cjs`);let n=require(`node:path`);const r=r=>{if(!r||Array.isArray(r)&&r.length===0)throw Error(`Invalid command`);let i=Array.isArray(r)?r.join(` `):r,a=Array.isArray(r),o=a?r[0]:i,s=a?r.slice(1):[],c=(0,n.join)(process.cwd(),`node_modules`,`.bin`),l=Object.keys(process.env).find(e=>e.toLowerCase()===`path`)??`PATH`,u=[c,process.env[l]??``].filter(Boolean).join(n.delimiter),d={...process.env,[l]:u},f=process.platform===`win32`,p=f?t.spawnWin32:e.spawnPosix,m={cwd:process.cwd(),stdio:`inherit`,env:d,shell:f},h=a?s.length===0&&/\s/.test(o)?f?p(process.env.ComSpec??`cmd.exe`,[`/d`,`/s`,`/c`,o],m):p(process.env.SHELL??`/bin/sh`,[`-c`,o],m):p(o,s,m):f?p(process.env.ComSpec??`cmd.exe`,[`/d`,`/s`,`/c`,i],m):p(process.env.SHELL??`/bin/sh`,[`-c`,i],m),g=new Promise((e,t)=>{h.on(`error`,e=>{try{console.error(`[runParallel] Failed to start: ${e?.message??String(e)}`)}catch{}y(),t(e)}),h.on(`exit`,(n,r)=>{y(),n===0||new Set([129,130,131,143]).has(n??-1)||r&&[`SIGINT`,`SIGTERM`,`SIGQUIT`,`SIGHUP`].includes(r)?e():t(Object.assign(Error(`Parallel process failed`),{code:n,signal:r}))})}),_=()=>{try{h.kill(`SIGTERM`)}catch{}},v=[{event:`SIGINT`,handler:_},{event:`SIGTERM`,handler:_},{event:`SIGQUIT`,handler:_},{event:`SIGHUP`,handler:_}];v.forEach(({event:e,handler:t})=>{process.on(e,t)});let y=()=>{v.forEach(({event:e,handler:t})=>{process.off(e,t)})};return{kill:()=>{try{h.kill(`SIGTERM`)}catch{}},result:g,commandText:i}};exports.runParallel=r;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["delimiter","spawnWin32","spawnPosix"],"sources":["../../../../src/utils/runParallel/index.ts"],"sourcesContent":["import { delimiter, join } from 'node:path';\nimport { spawnPosix } from './spawnPosix';\nimport { spawnWin32 } from './spawnWin32';\n\nexport type ParallelHandle = {\n kill: () => void;\n result: Promise<any>;\n commandText: string;\n};\n\n/**\n * Start a cross-platform parallel process using npm-run-all approach.\n * Accepts either a single string (e.g., 'next start') or an array of tokens (e.g., ['next', 'start']).\n */\nexport const runParallel = (proc?: string | string[]): ParallelHandle => {\n if (!proc || (Array.isArray(proc) && proc.length === 0))\n throw new Error('Invalid command');\n\n const commandText = Array.isArray(proc) ? proc.join(' ') : proc;\n\n const isArray = Array.isArray(proc);\n const command = isArray ? (proc as string[])[0] : commandText;\n const args = isArray ? (proc as string[]).slice(1) : [];\n\n // Ensure local binaries (node_modules/.bin) are resolvable\n const cwdBin = join(process.cwd(), 'node_modules', '.bin');\n const PATH_KEY =\n Object.keys(process.env).find((key) => key.toLowerCase() === 'path') ??\n 'PATH';\n\n const extendedPath = [cwdBin, process.env[PATH_KEY] ?? '']\n .filter(Boolean)\n .join(delimiter);\n\n const childEnv = {\n ...process.env,\n [PATH_KEY]: extendedPath,\n } as NodeJS.ProcessEnv;\n\n const isWin = process.platform === 'win32';\n const spawnFunc = isWin ? spawnWin32 : spawnPosix;\n\n // Spawn options\n const spawnOptions = {\n cwd: process.cwd(),\n stdio: 'inherit' as const,\n env: childEnv,\n shell: isWin,\n };\n\n // Spawn the child process\n const child = isArray\n ? // If provided as a single string element that includes spaces, treat it like a shell command\n args.length === 0 && /\\s/.test(command)\n ? isWin\n ? spawnFunc(\n process.env.ComSpec ?? 'cmd.exe',\n ['/d', '/s', '/c', command],\n spawnOptions\n )\n : spawnFunc(\n process.env.SHELL ?? '/bin/sh',\n ['-c', command],\n spawnOptions\n )\n : spawnFunc(command, args, spawnOptions)\n : isWin\n ? spawnFunc(\n process.env.ComSpec ?? 'cmd.exe',\n ['/d', '/s', '/c', commandText],\n spawnOptions\n )\n : spawnFunc(\n process.env.SHELL ?? '/bin/sh',\n ['-c', commandText],\n spawnOptions\n );\n\n const result = new Promise<void>((resolve, reject) => {\n child.on('error', (err) => {\n try {\n console.error(\n `[runParallel] Failed to start: ${err?.message ?? String(err)}`\n );\n } catch {}\n cleanupHandlers();\n reject(err);\n });\n\n child.on('exit', (code, signal) => {\n cleanupHandlers();\n\n // Treat common termination signals as graceful exits, not failures\n const gracefulSignals = ['SIGINT', 'SIGTERM', 'SIGQUIT', 'SIGHUP'];\n if (code === 0
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["delimiter","spawnWin32","spawnPosix"],"sources":["../../../../src/utils/runParallel/index.ts"],"sourcesContent":["import { delimiter, join } from 'node:path';\nimport { spawnPosix } from './spawnPosix';\nimport { spawnWin32 } from './spawnWin32';\n\nexport type ParallelHandle = {\n kill: () => void;\n result: Promise<any>;\n commandText: string;\n};\n\n/**\n * Start a cross-platform parallel process using npm-run-all approach.\n * Accepts either a single string (e.g., 'next start') or an array of tokens (e.g., ['next', 'start']).\n */\nexport const runParallel = (proc?: string | string[]): ParallelHandle => {\n if (!proc || (Array.isArray(proc) && proc.length === 0))\n throw new Error('Invalid command');\n\n const commandText = Array.isArray(proc) ? proc.join(' ') : proc;\n\n const isArray = Array.isArray(proc);\n const command = isArray ? (proc as string[])[0] : commandText;\n const args = isArray ? (proc as string[]).slice(1) : [];\n\n // Ensure local binaries (node_modules/.bin) are resolvable\n const cwdBin = join(process.cwd(), 'node_modules', '.bin');\n const PATH_KEY =\n Object.keys(process.env).find((key) => key.toLowerCase() === 'path') ??\n 'PATH';\n\n const extendedPath = [cwdBin, process.env[PATH_KEY] ?? '']\n .filter(Boolean)\n .join(delimiter);\n\n const childEnv = {\n ...process.env,\n [PATH_KEY]: extendedPath,\n } as NodeJS.ProcessEnv;\n\n const isWin = process.platform === 'win32';\n const spawnFunc = isWin ? spawnWin32 : spawnPosix;\n\n // Spawn options\n const spawnOptions = {\n cwd: process.cwd(),\n stdio: 'inherit' as const,\n env: childEnv,\n shell: isWin,\n };\n\n // Spawn the child process\n const child = isArray\n ? // If provided as a single string element that includes spaces, treat it like a shell command\n args.length === 0 && /\\s/.test(command)\n ? isWin\n ? spawnFunc(\n process.env.ComSpec ?? 'cmd.exe',\n ['/d', '/s', '/c', command],\n spawnOptions\n )\n : spawnFunc(\n process.env.SHELL ?? '/bin/sh',\n ['-c', command],\n spawnOptions\n )\n : spawnFunc(command, args, spawnOptions)\n : isWin\n ? spawnFunc(\n process.env.ComSpec ?? 'cmd.exe',\n ['/d', '/s', '/c', commandText],\n spawnOptions\n )\n : spawnFunc(\n process.env.SHELL ?? '/bin/sh',\n ['-c', commandText],\n spawnOptions\n );\n\n const result = new Promise<void>((resolve, reject) => {\n child.on('error', (err) => {\n try {\n console.error(\n `[runParallel] Failed to start: ${err?.message ?? String(err)}`\n );\n } catch {}\n cleanupHandlers();\n reject(err);\n });\n\n child.on('exit', (code, signal) => {\n cleanupHandlers();\n\n // Treat common termination signals as graceful exits, not failures\n const gracefulSignals = ['SIGINT', 'SIGTERM', 'SIGQUIT', 'SIGHUP'];\n // Also treat shell-convention exit codes (128 + signal number) as graceful:\n // 129 = SIGHUP, 130 = SIGINT, 131 = SIGQUIT, 143 = SIGTERM\n const gracefulSignalCodes = new Set([129, 130, 131, 143]);\n if (\n code === 0 ||\n gracefulSignalCodes.has(code ?? -1) ||\n (signal && gracefulSignals.includes(signal))\n ) {\n resolve();\n } else {\n reject(\n Object.assign(new Error('Parallel process failed'), { code, signal })\n );\n }\n });\n });\n\n const cleanup = () => {\n try {\n child.kill('SIGTERM');\n } catch {\n // Best effort\n }\n };\n\n const signalHandlers: { event: string; handler: (...args: any[]) => void }[] =\n [\n { event: 'SIGINT', handler: cleanup },\n { event: 'SIGTERM', handler: cleanup },\n { event: 'SIGQUIT', handler: cleanup },\n { event: 'SIGHUP', handler: cleanup },\n ];\n\n // Register signal handlers\n signalHandlers.forEach(({ event, handler }) => {\n process.on(event as any, handler as any);\n });\n\n const cleanupHandlers = () => {\n signalHandlers.forEach(({ event, handler }) => {\n process.off(event as any, handler as any);\n });\n };\n\n const kill = () => {\n try {\n child.kill('SIGTERM');\n } catch {\n // Best effort\n }\n };\n\n return { kill, result, commandText };\n};\n"],"mappings":"gNAcA,MAAa,EAAe,GAA6C,CACvE,GAAI,CAAC,GAAS,MAAM,QAAQ,EAAK,EAAI,EAAK,SAAW,EACnD,MAAU,MAAM,kBAAkB,CAEpC,IAAM,EAAc,MAAM,QAAQ,EAAK,CAAG,EAAK,KAAK,IAAI,CAAG,EAErD,EAAU,MAAM,QAAQ,EAAK,CAC7B,EAAU,EAAW,EAAkB,GAAK,EAC5C,EAAO,EAAW,EAAkB,MAAM,EAAE,CAAG,EAAE,CAGjD,GAAA,EAAA,EAAA,MAAc,QAAQ,KAAK,CAAE,eAAgB,OAAO,CACpD,EACJ,OAAO,KAAK,QAAQ,IAAI,CAAC,KAAM,GAAQ,EAAI,aAAa,GAAK,OAAO,EACpE,OAEI,EAAe,CAAC,EAAQ,QAAQ,IAAI,IAAa,GAAG,CACvD,OAAO,QAAQ,CACf,KAAKA,EAAAA,UAAU,CAEZ,EAAW,CACf,GAAG,QAAQ,KACV,GAAW,EACb,C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AS,CAAE,QAAO,aAAc,CAC7C,QAAQ,GAAG,EAAc,EAAe,EACxC,CAEF,IAAM,MAAwB,CAC5B,EAAe,SAAS,CAAE,QAAO,aAAc,CAC7C,QAAQ,IAAI,EAAc,EAAe,EACzC,EAWJ,MAAO,CAAE,SARU,CACjB,GAAI,CACF,EAAM,KAAK,UAAU,MACf,IAKK,SAAQ,cAAa"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{formatLocale as e,formatPath as t}from"./utils/formatter.mjs";import{ANSIColors as n,colorize as r,colorizeKey as i,colorizePath as a,getAppLogger as o,x as s}from"@intlayer/config/logger";import{getContent as
|
|
1
|
+
import{formatLocale as e,formatPath as t}from"./utils/formatter.mjs";import{ANSIColors as n,colorize as r,colorizeKey as i,colorizePath as a,getAppLogger as o,x as s}from"@intlayer/config/logger";import{getBasePlugins as c,getContent as l}from"@intlayer/core/interpreter";const u=(u,d,f)=>{let p=o(d);if(!u)return!1;let m=u.location===`local`||typeof u.filePath==`string`?`Local`:`Remote`,h=!!u.key,g=!!u.content;if(!h)return p(`${m} dictionary has no key`,{level:`error`}),!1;if(!g)return p(`${m} dictionary ${i(u.key)} has no content - ${u.filePath?t(u.filePath):a(`Remote`)}`,{level:`error`}),!1;if(u.schema&&f?.checkSchema&&!(typeof u.content==`function`||typeof u.content==`object`&&u.content!==null&&typeof u.content.then==`function`)){let o=d?.internationalization?.locales??[],f=d?.internationalization.strictMode===`strict`,h=typeof u.schema==`string`?d?.schemas?.[u.schema]:void 0;if(h&&typeof h.safeParse==`function`)for(let d of o){let o=l(u.content,{dictionaryKey:u.key,keyPath:[],locale:d},c(d,!f)),g=h.safeParse(o);if(!g.success)return p(`${m} dictionary ${i(u.key)} has invalid content according to schema ${r(u.schema,n.ORANGE)} for locale ${e(d)} - ${u.filePath?t(u.filePath):a(`Remote`)}`,{level:`error`}),g.error.issues.forEach(t=>{p(`${s} Error: ${i(u.key)} - ${e(d)} - ${r(`${t.path.join(`.`)}:`,n.BLUE)} ${r(t.message,n.GREY)}`,{level:`error`})}),!1}}return!0},d=(e,t,n)=>(e??[])?.filter(e=>u(e,t,n));export{d as filterInvalidDictionaries,u as isInvalidDictionary};
|
|
2
2
|
//# sourceMappingURL=filterInvalidDictionaries.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filterInvalidDictionaries.mjs","names":[],"sources":["../../src/filterInvalidDictionaries.ts"],"sourcesContent":["import {\n ANSIColors,\n colorize,\n colorizeKey,\n colorizePath,\n getAppLogger,\n x,\n} from '@intlayer/config/logger';\nimport { getContent } from '@intlayer/core/interpreter';\nimport type {
|
|
1
|
+
{"version":3,"file":"filterInvalidDictionaries.mjs","names":[],"sources":["../../src/filterInvalidDictionaries.ts"],"sourcesContent":["import {\n ANSIColors,\n colorize,\n colorizeKey,\n colorizePath,\n getAppLogger,\n x,\n} from '@intlayer/config/logger';\nimport { getBasePlugins, getContent } from '@intlayer/core/interpreter';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport { formatLocale, formatPath } from './utils/formatter';\n\ntype IsInvalidDictionaryOptions = { checkSchema: boolean };\n\nexport const isInvalidDictionary = (\n dictionary: Dictionary | undefined,\n configuration?: IntlayerConfig,\n options?: IsInvalidDictionaryOptions\n): boolean => {\n const appLogger = getAppLogger(configuration);\n\n if (!dictionary) return false;\n\n const isLocal = Boolean(\n dictionary.location === 'local' || typeof dictionary.filePath === 'string'\n );\n const location = isLocal ? 'Local' : 'Remote';\n const hasKey = Boolean(dictionary.key);\n const hasContent = Boolean(dictionary.content);\n\n if (!hasKey) {\n appLogger(`${location} dictionary has no key`, {\n level: 'error',\n });\n\n return false;\n }\n\n if (!hasContent) {\n appLogger(\n `${location} dictionary ${colorizeKey(dictionary.key)} has no content - ${dictionary.filePath ? formatPath(dictionary.filePath) : colorizePath('Remote')}`,\n {\n level: 'error',\n }\n );\n return false;\n }\n\n if (dictionary.schema && options?.checkSchema) {\n const isAsync =\n typeof dictionary.content === 'function' ||\n (typeof dictionary.content === 'object' &&\n dictionary.content !== null &&\n typeof (dictionary.content as any).then === 'function');\n\n if (!isAsync) {\n const locales = configuration?.internationalization?.locales ?? [];\n const isStrict =\n configuration?.internationalization.strictMode === 'strict';\n\n const schema =\n typeof dictionary.schema === 'string'\n ? configuration?.schemas?.[dictionary.schema]\n : undefined;\n\n if (schema && typeof schema.safeParse === 'function') {\n for (const locale of locales) {\n const resolvedContent = getContent(\n dictionary.content,\n {\n dictionaryKey: dictionary.key,\n keyPath: [],\n locale,\n },\n getBasePlugins(locale, !isStrict)\n );\n const result = (schema as any).safeParse(resolvedContent);\n\n if (!result.success) {\n appLogger(\n `${location} dictionary ${colorizeKey(dictionary.key)} has invalid content according to schema ${colorize(dictionary.schema as string, ANSIColors.ORANGE)} for locale ${formatLocale(locale)} - ${dictionary.filePath ? formatPath(dictionary.filePath) : colorizePath('Remote')}`,\n {\n level: 'error',\n }\n );\n\n result.error.issues.forEach((issue: any) => {\n appLogger(\n `${x} Error: ${colorizeKey(dictionary.key)} - ${formatLocale(locale)} - ${colorize(`${issue.path.join('.')}:`, ANSIColors.BLUE)} ${colorize(issue.message, ANSIColors.GREY)}`,\n {\n level: 'error',\n }\n );\n });\n\n return false;\n }\n }\n }\n }\n }\n\n return true;\n};\n\nexport const filterInvalidDictionaries = (\n dictionaries: (Dictionary | undefined)[] | undefined,\n configuration: IntlayerConfig,\n options?: IsInvalidDictionaryOptions\n): Dictionary[] =>\n (dictionaries ?? [])?.filter((dictionary) =>\n isInvalidDictionary(dictionary, configuration, options)\n ) as Dictionary[];\n"],"mappings":"gRAeA,MAAa,GACX,EACA,EACA,IACY,CACZ,IAAM,EAAY,EAAa,EAAc,CAE7C,GAAI,CAAC,EAAY,MAAO,GAKxB,IAAM,EAFJ,EAAW,WAAa,SAAW,OAAO,EAAW,UAAa,SAEzC,QAAU,SAC/B,EAAS,EAAQ,EAAW,IAC5B,EAAa,EAAQ,EAAW,QAEt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,CACF,EACD,CAEK,IAOjB,MAAO,IAGI,GACX,EACA,EACA,KAEC,GAAgB,EAAE,GAAG,OAAQ,GAC5B,EAAoB,EAAY,EAAe,EAAQ,CACxD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{spawnPosix as e}from"./spawnPosix.mjs";import{spawnWin32 as t}from"./spawnWin32.mjs";import{delimiter as n,join as r}from"node:path";const i=i=>{if(!i||Array.isArray(i)&&i.length===0)throw Error(`Invalid command`);let a=Array.isArray(i)?i.join(` `):i,o=Array.isArray(i),s=o?i[0]:a,c=o?i.slice(1):[],l=r(process.cwd(),`node_modules`,`.bin`),u=Object.keys(process.env).find(e=>e.toLowerCase()===`path`)??`PATH`,d=[l,process.env[u]??``].filter(Boolean).join(n),f={...process.env,[u]:d},p=process.platform===`win32`,m=p?t:e,h={cwd:process.cwd(),stdio:`inherit`,env:f,shell:p},g=o?c.length===0&&/\s/.test(s)?p?m(process.env.ComSpec??`cmd.exe`,[`/d`,`/s`,`/c`,s],h):m(process.env.SHELL??`/bin/sh`,[`-c`,s],h):m(s,c,h):p?m(process.env.ComSpec??`cmd.exe`,[`/d`,`/s`,`/c`,a],h):m(process.env.SHELL??`/bin/sh`,[`-c`,a],h),_=new Promise((e,t)=>{g.on(`error`,e=>{try{console.error(`[runParallel] Failed to start: ${e?.message??String(e)}`)}catch{}b(),t(e)}),g.on(`exit`,(n,r)=>{b(),n===0||r&&[`SIGINT`,`SIGTERM`,`SIGQUIT`,`SIGHUP`].includes(r)?e():t(Object.assign(Error(`Parallel process failed`),{code:n,signal:r}))})}),v=()=>{try{g.kill(`SIGTERM`)}catch{}},y=[{event:`SIGINT`,handler:v},{event:`SIGTERM`,handler:v},{event:`SIGQUIT`,handler:v},{event:`SIGHUP`,handler:v}];y.forEach(({event:e,handler:t})=>{process.on(e,t)});let b=()=>{y.forEach(({event:e,handler:t})=>{process.off(e,t)})};return{kill:()=>{try{g.kill(`SIGTERM`)}catch{}},result:_,commandText:a}};export{i as runParallel};
|
|
1
|
+
import{spawnPosix as e}from"./spawnPosix.mjs";import{spawnWin32 as t}from"./spawnWin32.mjs";import{delimiter as n,join as r}from"node:path";const i=i=>{if(!i||Array.isArray(i)&&i.length===0)throw Error(`Invalid command`);let a=Array.isArray(i)?i.join(` `):i,o=Array.isArray(i),s=o?i[0]:a,c=o?i.slice(1):[],l=r(process.cwd(),`node_modules`,`.bin`),u=Object.keys(process.env).find(e=>e.toLowerCase()===`path`)??`PATH`,d=[l,process.env[u]??``].filter(Boolean).join(n),f={...process.env,[u]:d},p=process.platform===`win32`,m=p?t:e,h={cwd:process.cwd(),stdio:`inherit`,env:f,shell:p},g=o?c.length===0&&/\s/.test(s)?p?m(process.env.ComSpec??`cmd.exe`,[`/d`,`/s`,`/c`,s],h):m(process.env.SHELL??`/bin/sh`,[`-c`,s],h):m(s,c,h):p?m(process.env.ComSpec??`cmd.exe`,[`/d`,`/s`,`/c`,a],h):m(process.env.SHELL??`/bin/sh`,[`-c`,a],h),_=new Promise((e,t)=>{g.on(`error`,e=>{try{console.error(`[runParallel] Failed to start: ${e?.message??String(e)}`)}catch{}b(),t(e)}),g.on(`exit`,(n,r)=>{b(),n===0||new Set([129,130,131,143]).has(n??-1)||r&&[`SIGINT`,`SIGTERM`,`SIGQUIT`,`SIGHUP`].includes(r)?e():t(Object.assign(Error(`Parallel process failed`),{code:n,signal:r}))})}),v=()=>{try{g.kill(`SIGTERM`)}catch{}},y=[{event:`SIGINT`,handler:v},{event:`SIGTERM`,handler:v},{event:`SIGQUIT`,handler:v},{event:`SIGHUP`,handler:v}];y.forEach(({event:e,handler:t})=>{process.on(e,t)});let b=()=>{y.forEach(({event:e,handler:t})=>{process.off(e,t)})};return{kill:()=>{try{g.kill(`SIGTERM`)}catch{}},result:_,commandText:a}};export{i as runParallel};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/utils/runParallel/index.ts"],"sourcesContent":["import { delimiter, join } from 'node:path';\nimport { spawnPosix } from './spawnPosix';\nimport { spawnWin32 } from './spawnWin32';\n\nexport type ParallelHandle = {\n kill: () => void;\n result: Promise<any>;\n commandText: string;\n};\n\n/**\n * Start a cross-platform parallel process using npm-run-all approach.\n * Accepts either a single string (e.g., 'next start') or an array of tokens (e.g., ['next', 'start']).\n */\nexport const runParallel = (proc?: string | string[]): ParallelHandle => {\n if (!proc || (Array.isArray(proc) && proc.length === 0))\n throw new Error('Invalid command');\n\n const commandText = Array.isArray(proc) ? proc.join(' ') : proc;\n\n const isArray = Array.isArray(proc);\n const command = isArray ? (proc as string[])[0] : commandText;\n const args = isArray ? (proc as string[]).slice(1) : [];\n\n // Ensure local binaries (node_modules/.bin) are resolvable\n const cwdBin = join(process.cwd(), 'node_modules', '.bin');\n const PATH_KEY =\n Object.keys(process.env).find((key) => key.toLowerCase() === 'path') ??\n 'PATH';\n\n const extendedPath = [cwdBin, process.env[PATH_KEY] ?? '']\n .filter(Boolean)\n .join(delimiter);\n\n const childEnv = {\n ...process.env,\n [PATH_KEY]: extendedPath,\n } as NodeJS.ProcessEnv;\n\n const isWin = process.platform === 'win32';\n const spawnFunc = isWin ? spawnWin32 : spawnPosix;\n\n // Spawn options\n const spawnOptions = {\n cwd: process.cwd(),\n stdio: 'inherit' as const,\n env: childEnv,\n shell: isWin,\n };\n\n // Spawn the child process\n const child = isArray\n ? // If provided as a single string element that includes spaces, treat it like a shell command\n args.length === 0 && /\\s/.test(command)\n ? isWin\n ? spawnFunc(\n process.env.ComSpec ?? 'cmd.exe',\n ['/d', '/s', '/c', command],\n spawnOptions\n )\n : spawnFunc(\n process.env.SHELL ?? '/bin/sh',\n ['-c', command],\n spawnOptions\n )\n : spawnFunc(command, args, spawnOptions)\n : isWin\n ? spawnFunc(\n process.env.ComSpec ?? 'cmd.exe',\n ['/d', '/s', '/c', commandText],\n spawnOptions\n )\n : spawnFunc(\n process.env.SHELL ?? '/bin/sh',\n ['-c', commandText],\n spawnOptions\n );\n\n const result = new Promise<void>((resolve, reject) => {\n child.on('error', (err) => {\n try {\n console.error(\n `[runParallel] Failed to start: ${err?.message ?? String(err)}`\n );\n } catch {}\n cleanupHandlers();\n reject(err);\n });\n\n child.on('exit', (code, signal) => {\n cleanupHandlers();\n\n // Treat common termination signals as graceful exits, not failures\n const gracefulSignals = ['SIGINT', 'SIGTERM', 'SIGQUIT', 'SIGHUP'];\n if (code === 0
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/utils/runParallel/index.ts"],"sourcesContent":["import { delimiter, join } from 'node:path';\nimport { spawnPosix } from './spawnPosix';\nimport { spawnWin32 } from './spawnWin32';\n\nexport type ParallelHandle = {\n kill: () => void;\n result: Promise<any>;\n commandText: string;\n};\n\n/**\n * Start a cross-platform parallel process using npm-run-all approach.\n * Accepts either a single string (e.g., 'next start') or an array of tokens (e.g., ['next', 'start']).\n */\nexport const runParallel = (proc?: string | string[]): ParallelHandle => {\n if (!proc || (Array.isArray(proc) && proc.length === 0))\n throw new Error('Invalid command');\n\n const commandText = Array.isArray(proc) ? proc.join(' ') : proc;\n\n const isArray = Array.isArray(proc);\n const command = isArray ? (proc as string[])[0] : commandText;\n const args = isArray ? (proc as string[]).slice(1) : [];\n\n // Ensure local binaries (node_modules/.bin) are resolvable\n const cwdBin = join(process.cwd(), 'node_modules', '.bin');\n const PATH_KEY =\n Object.keys(process.env).find((key) => key.toLowerCase() === 'path') ??\n 'PATH';\n\n const extendedPath = [cwdBin, process.env[PATH_KEY] ?? '']\n .filter(Boolean)\n .join(delimiter);\n\n const childEnv = {\n ...process.env,\n [PATH_KEY]: extendedPath,\n } as NodeJS.ProcessEnv;\n\n const isWin = process.platform === 'win32';\n const spawnFunc = isWin ? spawnWin32 : spawnPosix;\n\n // Spawn options\n const spawnOptions = {\n cwd: process.cwd(),\n stdio: 'inherit' as const,\n env: childEnv,\n shell: isWin,\n };\n\n // Spawn the child process\n const child = isArray\n ? // If provided as a single string element that includes spaces, treat it like a shell command\n args.length === 0 && /\\s/.test(command)\n ? isWin\n ? spawnFunc(\n process.env.ComSpec ?? 'cmd.exe',\n ['/d', '/s', '/c', command],\n spawnOptions\n )\n : spawnFunc(\n process.env.SHELL ?? '/bin/sh',\n ['-c', command],\n spawnOptions\n )\n : spawnFunc(command, args, spawnOptions)\n : isWin\n ? spawnFunc(\n process.env.ComSpec ?? 'cmd.exe',\n ['/d', '/s', '/c', commandText],\n spawnOptions\n )\n : spawnFunc(\n process.env.SHELL ?? '/bin/sh',\n ['-c', commandText],\n spawnOptions\n );\n\n const result = new Promise<void>((resolve, reject) => {\n child.on('error', (err) => {\n try {\n console.error(\n `[runParallel] Failed to start: ${err?.message ?? String(err)}`\n );\n } catch {}\n cleanupHandlers();\n reject(err);\n });\n\n child.on('exit', (code, signal) => {\n cleanupHandlers();\n\n // Treat common termination signals as graceful exits, not failures\n const gracefulSignals = ['SIGINT', 'SIGTERM', 'SIGQUIT', 'SIGHUP'];\n // Also treat shell-convention exit codes (128 + signal number) as graceful:\n // 129 = SIGHUP, 130 = SIGINT, 131 = SIGQUIT, 143 = SIGTERM\n const gracefulSignalCodes = new Set([129, 130, 131, 143]);\n if (\n code === 0 ||\n gracefulSignalCodes.has(code ?? -1) ||\n (signal && gracefulSignals.includes(signal))\n ) {\n resolve();\n } else {\n reject(\n Object.assign(new Error('Parallel process failed'), { code, signal })\n );\n }\n });\n });\n\n const cleanup = () => {\n try {\n child.kill('SIGTERM');\n } catch {\n // Best effort\n }\n };\n\n const signalHandlers: { event: string; handler: (...args: any[]) => void }[] =\n [\n { event: 'SIGINT', handler: cleanup },\n { event: 'SIGTERM', handler: cleanup },\n { event: 'SIGQUIT', handler: cleanup },\n { event: 'SIGHUP', handler: cleanup },\n ];\n\n // Register signal handlers\n signalHandlers.forEach(({ event, handler }) => {\n process.on(event as any, handler as any);\n });\n\n const cleanupHandlers = () => {\n signalHandlers.forEach(({ event, handler }) => {\n process.off(event as any, handler as any);\n });\n };\n\n const kill = () => {\n try {\n child.kill('SIGTERM');\n } catch {\n // Best effort\n }\n };\n\n return { kill, result, commandText };\n};\n"],"mappings":"4IAcA,MAAa,EAAe,GAA6C,CACvE,GAAI,CAAC,GAAS,MAAM,QAAQ,EAAK,EAAI,EAAK,SAAW,EACnD,MAAU,MAAM,kBAAkB,CAEpC,IAAM,EAAc,MAAM,QAAQ,EAAK,CAAG,EAAK,KAAK,IAAI,CAAG,EAErD,EAAU,MAAM,QAAQ,EAAK,CAC7B,EAAU,EAAW,EAAkB,GAAK,EAC5C,EAAO,EAAW,EAAkB,MAAM,EAAE,CAAG,EAAE,CAGjD,EAAS,EAAK,QAAQ,KAAK,CAAE,eAAgB,OAAO,CACpD,EACJ,OAAO,KAAK,QAAQ,IAAI,CAAC,KAAM,GAAQ,EAAI,aAAa,GAAK,OAAO,EACpE,OAEI,EAAe,CAAC,EAAQ,QAAQ,IAAI,IAAa,GAAG,CACvD,OAAO,QAAQ,CACf,KAAK,EAAU,CAEZ,EAAW,CACf,GAAG,QAAQ,KACV,GAAW,EACb,CAEK,EAAQ,QAAQ,WAAa,QAC7B,EAAY,EAAQ,EAAa,EAGjC,EAAe,CACnB,IAAK,QAAQ,KAAK,CAClB,MAAO,UACP,IAAK,EACL,MAAO,EACR,CAGK,EAAQ,EAEV,EAAK,SAAW,GAAK,KAAK,KAAK,EAAQ,CACrC,EACE,EACE,QAAQ,IAAI,SAAW,UACvB,CAAC,KAAM,KAAM,KAAM,EAAQ,CAC3B,EACD,CACD,EACE,QAAQ,IAAI,OAAS,UACrB,CAAC,KAAM,EAAQ,CACf,EACD,CACH,EAAU,EAAS,EAAM,EAAa,CACxC,EACE,EACE,QAAQ,IAAI,SAAW,UACvB,CAAC,KAAM,KAAM,KAAM,EAAY,CAC/B,EACD,CACD,EACE,QAAQ,IAAI,OAAS,UACrB,CAAC,KAAM,EAAY,CACnB,EACD,CAED,EAAS,IAAI,SAAe,EAAS,IAAW,CACpD,EAAM,GAAG,QAAU,GAAQ,CACzB,GAAI,CACF,QAAQ,MACN,kCAAkC,GAAK,SAAW,OAAO,EAAI,GAC9D,MACK,EACR,GAAiB,CACjB,EAAO,EAAI,EACX,CAEF,EAAM,GAAG,QAAS,EAAM,IAAW,CACjC,GAAiB,CAQf,IAAS,GAFiB,IAAI,IAAI,CAAC,IAAK,IAAK,IAAK,IAAI,CAAC,CAGnC,IAAI,GAAQ,GAAG,EAClC,GAPqB,CAAC,SAAU,UAAW,UAAW,SAAS,CAOrC,SAAS,EAAO,CAE3C,GAAS,CAET,EACE,OAAO,OAAW,MAAM,0BAA0B,CAAE,CAAE,OAAM,SAAQ,CAAC,CACtE,EAEH,EACF,CAEI,MAAgB,CACpB,GAAI,CACF,EAAM,KAAK,UAAU,MACf,IAKJ,EACJ,CACE,CAAE,MAAO,SAAU,QAAS,EAAS,CACrC,CAAE,MAAO,UAAW,QAAS,EAAS,CACtC,CAAE,MAAO,UAAW,QAAS,EAAS,CACtC,CAAE,MAAO,SAAU,QAAS,EAAS,CACtC,CAGH,EAAe,SAAS,CAAE,QAAO,aAAc,CAC7C,QAAQ,GAAG,EAAc,EAAe,EACxC,CAEF,IAAM,MAAwB,CAC5B,EAAe,SAAS,CAAE,QAAO,aAAc,CAC7C,QAAQ,IAAI,EAAc,EAAe,EACzC,EAWJ,MAAO,CAAE,SARU,CACjB,GAAI,CACF,EAAM,KAAK,UAAU,MACf,IAKK,SAAQ,cAAa"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/chokidar",
|
|
3
|
-
"version": "8.3.
|
|
3
|
+
"version": "8.3.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Uses chokidar to scan and build Intlayer declaration files into dictionaries based on Intlayer configuration.",
|
|
6
6
|
"keywords": [
|
|
@@ -102,13 +102,13 @@
|
|
|
102
102
|
},
|
|
103
103
|
"dependencies": {
|
|
104
104
|
"@babel/parser": "7.29.0",
|
|
105
|
-
"@intlayer/api": "8.3.
|
|
106
|
-
"@intlayer/config": "8.3.
|
|
107
|
-
"@intlayer/core": "8.3.
|
|
108
|
-
"@intlayer/dictionaries-entry": "8.3.
|
|
109
|
-
"@intlayer/remote-dictionaries-entry": "8.3.
|
|
110
|
-
"@intlayer/types": "8.3.
|
|
111
|
-
"@intlayer/unmerged-dictionaries-entry": "8.3.
|
|
105
|
+
"@intlayer/api": "8.3.4",
|
|
106
|
+
"@intlayer/config": "8.3.4",
|
|
107
|
+
"@intlayer/core": "8.3.4",
|
|
108
|
+
"@intlayer/dictionaries-entry": "8.3.4",
|
|
109
|
+
"@intlayer/remote-dictionaries-entry": "8.3.4",
|
|
110
|
+
"@intlayer/types": "8.3.4",
|
|
111
|
+
"@intlayer/unmerged-dictionaries-entry": "8.3.4",
|
|
112
112
|
"chokidar": "3.6.0",
|
|
113
113
|
"defu": "6.1.4",
|
|
114
114
|
"fast-glob": "3.3.3",
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
"@utils/ts-config-types": "1.0.4",
|
|
123
123
|
"@utils/tsdown-config": "1.0.4",
|
|
124
124
|
"rimraf": "6.1.3",
|
|
125
|
-
"tsdown": "0.21.
|
|
125
|
+
"tsdown": "0.21.4",
|
|
126
126
|
"typescript": "5.9.3",
|
|
127
127
|
"vitest": "4.1.0",
|
|
128
128
|
"zod": "4.3.6"
|