@terai/dev 0.0.6 → 0.0.8

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.
Files changed (61) hide show
  1. package/dist/chunk-27YGPZZO.mjs +30 -0
  2. package/dist/chunk-27YGPZZO.mjs.map +1 -0
  3. package/dist/chunk-3ELQZT5F.js +17773 -0
  4. package/dist/chunk-3ELQZT5F.js.map +1 -0
  5. package/dist/chunk-42NIF5EX.js +8 -0
  6. package/dist/chunk-42NIF5EX.js.map +1 -0
  7. package/dist/chunk-6YEMZ7V4.mjs +120 -0
  8. package/dist/chunk-6YEMZ7V4.mjs.map +1 -0
  9. package/dist/chunk-73E3KEZD.js +199 -0
  10. package/dist/chunk-73E3KEZD.js.map +1 -0
  11. package/dist/chunk-7KUNFJIY.mjs +563 -0
  12. package/dist/chunk-7KUNFJIY.mjs.map +1 -0
  13. package/dist/chunk-K2FH2SX6.mjs +17755 -0
  14. package/dist/chunk-K2FH2SX6.mjs.map +1 -0
  15. package/dist/chunk-KYDPPJQL.js +86 -0
  16. package/dist/chunk-KYDPPJQL.js.map +1 -0
  17. package/dist/chunk-LIRTPATK.js +52 -0
  18. package/dist/chunk-LIRTPATK.js.map +1 -0
  19. package/dist/chunk-M6WICIYM.js +571 -0
  20. package/dist/chunk-M6WICIYM.js.map +1 -0
  21. package/dist/chunk-OF7BELAL.js +32 -0
  22. package/dist/chunk-OF7BELAL.js.map +1 -0
  23. package/dist/chunk-QC3QM3MM.mjs +192 -0
  24. package/dist/chunk-QC3QM3MM.mjs.map +1 -0
  25. package/dist/chunk-RKCAHME2.mjs +6 -0
  26. package/dist/chunk-RKCAHME2.mjs.map +1 -0
  27. package/dist/chunk-RWH4GVGM.mjs +83 -0
  28. package/dist/chunk-RWH4GVGM.mjs.map +1 -0
  29. package/dist/chunk-SSJE2GTB.js +123 -0
  30. package/dist/chunk-SSJE2GTB.js.map +1 -0
  31. package/dist/chunk-UOKEQCV3.mjs +50 -0
  32. package/dist/chunk-UOKEQCV3.mjs.map +1 -0
  33. package/dist/cli.default.js +24 -18291
  34. package/dist/cli.default.js.map +1 -1
  35. package/dist/cli.default.mjs +20 -18308
  36. package/dist/cli.default.mjs.map +1 -1
  37. package/dist/cli.js +13 -18285
  38. package/dist/cli.js.map +1 -1
  39. package/dist/cli.mjs +9 -18298
  40. package/dist/cli.mjs.map +1 -1
  41. package/dist/commands/extract.js +12 -682
  42. package/dist/commands/extract.js.map +1 -1
  43. package/dist/commands/extract.mjs +5 -656
  44. package/dist/commands/extract.mjs.map +1 -1
  45. package/dist/commands/index.js +31 -992
  46. package/dist/commands/index.js.map +1 -1
  47. package/dist/commands/index.mjs +8 -960
  48. package/dist/commands/index.mjs.map +1 -1
  49. package/dist/commands/init.js +12 -773
  50. package/dist/commands/init.js.map +1 -1
  51. package/dist/commands/init.mjs +4 -742
  52. package/dist/commands/init.mjs.map +1 -1
  53. package/dist/commands/translate.js +12 -719
  54. package/dist/commands/translate.js.map +1 -1
  55. package/dist/commands/translate.mjs +5 -687
  56. package/dist/commands/translate.mjs.map +1 -1
  57. package/dist/index.js +21 -79
  58. package/dist/index.js.map +1 -1
  59. package/dist/index.mjs +6 -79
  60. package/dist/index.mjs.map +1 -1
  61. package/package.json +8 -8
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../generator/src/generate.ts","../../src/commands/translate.ts","../../../logger/src/logger.ts","../../../../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/ansi-styles/index.js","../../../../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/supports-color/index.js","../../../../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/utilities.js","../../../../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/index.js"],"sourcesContent":["// Dependencies\nimport { runtime } from '@terai/runtime'\nimport { stringify } from '@terai/utils'\n\n// Types\nimport type { Config, Locale, Dictionaries } from '@terai/types'\n\ntype GenerateOptions = {\n\tcwd: string\n\tlocale: Locale\n\tdictionaries: Dictionaries\n} & Pick<Config, 'outDir'>\n\nexport async function generate({\n\tdictionaries,\n\tlocale,\n\tcwd,\n\toutDir\n}: GenerateOptions) {\n\tconst folderPath = runtime.path.resolve(cwd, outDir, locale)\n\tconst output = []\n\n\tfor (const id in dictionaries) {\n\t\tconst fileDir = runtime.path.resolve(folderPath, `${id}.json`)\n\t\tconst fileContent = dictionaries[id]\n\t\tconst idOutput = stringify(fileContent)\n\n\t\truntime.fs.write(fileDir, idOutput)\n\n\t\toutput.push(idOutput)\n\t}\n\n\treturn output\n}\n","// Dependencies\nimport { generate } from '@terai/generator'\nimport { loadConfig, runtime } from '@terai/runtime'\nimport { logger } from '@terai/logger'\nimport { translate } from '@terai/translator'\nimport { merge, stringify, groupDictionaryByChunks } from '@terai/utils'\n\n// Types\nimport type { CAC } from 'cac'\nimport type { Dictionary, BuildManifest } from '@terai/types'\n\nexport type TranslateOptions = {\n\tcwd: string\n}\n\nexport function createTranslateCommand(cli: CAC, cwd: string) {\n\treturn cli\n\t\t.command('translate', 'Translate messages from your project')\n\t\t.option('--cwd <cwd>', 'Current working directory', { default: cwd })\n\t\t.action(translateCmd)\n}\n\nexport async function translateCmd({ cwd }: TranslateOptions) {\n\tlogger.heading('translate', 'Translate messages from your project')\n\tconst done = logger.time.success()\n\n\tconst config = await loadConfig({ cwd })\n\n\tconst outDirPath = runtime.path.resolve(cwd, config.outDir)\n\tconst tmuDirPath = runtime.path.resolve(cwd, config.outDir, '.terai')\n\tconst manifestPath = runtime.path.resolve(tmuDirPath, 'locale-manifest.json')\n\tconst existsManifest = runtime.fs.exists(manifestPath)\n\tif (!existsManifest) {\n\t\treturn logger.error(\n\t\t\t'translate',\n\t\t\t`No locale-manifest.json found in ${tmuDirPath}. Please run \"extract\" first.`\n\t\t)\n\t}\n\n\tconst buildManifest = JSON.parse(\n\t\truntime.fs.readFile(manifestPath)\n\t) as BuildManifest\n\n\tlet totalTranslatedMsgs = 0\n\tlet totalCachedMsgs = 0\n\n\tawait Promise.all(\n\t\tconfig.outLocales.map(async (locale) => {\n\t\t\ttry {\n\t\t\t\tlet translatedDictionary: Dictionary = {}\n\t\t\t\tconst untranslatedDictionary: Dictionary = {}\n\t\t\t\tconst localeDirPath = runtime.path.resolve(outDirPath, locale)\n\t\t\t\tconst localeCachePath = runtime.path.resolve(\n\t\t\t\t\ttmuDirPath,\n\t\t\t\t\t'cache',\n\t\t\t\t\t`${locale}.cache.json`\n\t\t\t\t)\n\t\t\t\tconst cacheExists = runtime.fs.exists(localeCachePath)\n\t\t\t\tlet cache: Dictionary = cacheExists\n\t\t\t\t\t? JSON.parse(runtime.fs.readFile(localeCachePath))\n\t\t\t\t\t: {}\n\n\t\t\t\tlet localeCachedMsgs = 0\n\t\t\t\tlet localeTranslatedMsgs = 0\n\n\t\t\t\tfor (const id in buildManifest.messages) {\n\t\t\t\t\tconst { value, chunksIds } = buildManifest.messages[id]\n\t\t\t\t\tconst chnks = chunksIds.length ? chunksIds : [locale]\n\n\t\t\t\t\tfor (const chunkId of chnks) {\n\t\t\t\t\t\tconst chunkPath = runtime.path.resolve(\n\t\t\t\t\t\t\tlocaleDirPath,\n\t\t\t\t\t\t\t`${chunkId}.json`\n\t\t\t\t\t\t)\n\t\t\t\t\t\tconst existsChunk = runtime.fs.exists(chunkPath)\n\t\t\t\t\t\tconst chunk: Dictionary = existsChunk\n\t\t\t\t\t\t\t? JSON.parse(runtime.fs.readFile(chunkPath))\n\t\t\t\t\t\t\t: {}\n\t\t\t\t\t\tconst localeValue = chunk[id] ?? cache[id]\n\n\t\t\t\t\t\tif (!localeValue) {\n\t\t\t\t\t\t\tuntranslatedDictionary[id] = value\n\t\t\t\t\t\t\tlocaleTranslatedMsgs++\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttranslatedDictionary[id] = localeValue\n\t\t\t\t\t\t\t// Update cache in case local value is different\n\t\t\t\t\t\t\tcache[id] = localeValue\n\t\t\t\t\t\t\tlocaleCachedMsgs++\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (localeTranslatedMsgs > 0) {\n\t\t\t\t\tconst translation = await translate({\n\t\t\t\t\t\t...config,\n\t\t\t\t\t\tdictionary: untranslatedDictionary,\n\t\t\t\t\t\tlocale\n\t\t\t\t\t})\n\n\t\t\t\t\ttranslatedDictionary = merge(translation, translatedDictionary)\n\t\t\t\t}\n\n\t\t\t\tcache = {\n\t\t\t\t\t...cache,\n\t\t\t\t\t...translatedDictionary\n\t\t\t\t}\n\n\t\t\t\truntime.fs.remove(localeDirPath)\n\n\t\t\t\tconst dictionaries = groupDictionaryByChunks(\n\t\t\t\t\ttranslatedDictionary,\n\t\t\t\t\tbuildManifest,\n\t\t\t\t\tlocale\n\t\t\t\t)\n\n\t\t\t\tawait generate({\n\t\t\t\t\t...config,\n\t\t\t\t\tdictionaries: dictionaries,\n\t\t\t\t\tlocale,\n\t\t\t\t\tcwd\n\t\t\t\t})\n\n\t\t\t\truntime.fs.write(localeCachePath, stringify(cache))\n\n\t\t\t\ttotalTranslatedMsgs += localeTranslatedMsgs\n\t\t\t\ttotalCachedMsgs += localeCachedMsgs\n\n\t\t\t\tlogger.info(\n\t\t\t\t\t`Locale ${locale.toUpperCase()}:`,\n\t\t\t\t\t`${localeTranslatedMsgs} new messages translated, ${localeCachedMsgs} recovered from cache`\n\t\t\t\t)\n\t\t\t} catch (err) {\n\t\t\t\tif (err instanceof Error) {\n\t\t\t\t\tlogger.error(\n\t\t\t\t\t\t`${locale} translation:`,\n\t\t\t\t\t\t`Error translating to ${locale}: ${err.message}\\n`\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t)\n\n\tif (!totalTranslatedMsgs) {\n\t\treturn done('Everything up-to-date')\n\t}\n\n\tdone(\n\t\t`Translated ${totalTranslatedMsgs} messages, ${totalCachedMsgs} read from cache`\n\t)\n}\n","// Dependencies\nimport process from 'node:process'\nimport chalk from 'chalk'\n\nfunction log(message: string) {\n\treturn process.stdout.write(`${message}\\n`)\n}\n\nfunction logError(message: string) {\n\treturn process.stderr.write(`${message}\\n`)\n}\n\nfunction logBullet(\n\tlogger: typeof log | typeof logError,\n\tcolorizePrefix: typeof chalk,\n\tcolorizeText: typeof chalk,\n\tsymbol: string,\n\tprefix: string,\n\ttext?: string | string[]\n) {\n\tconst textParts = Array.isArray(text) ? text : [text || ''].filter(Boolean)\n\tconst formattedText = textParts\n\t\t.map((textPart) => colorizeText(textPart))\n\t\t.join('')\n\n\tlogger(\n\t\t`${' '.repeat(3)} ${colorizePrefix(symbol)} ${colorizePrefix(\n\t\t\tprefix\n\t\t)} ${formattedText}`\n\t)\n}\n\nfunction warn(prefix: string, text?: string | string[]) {\n\tlogBullet(log, chalk.yellow, chalk.yellow, '●', prefix, text)\n}\n\nfunction debug(prefix: string, text?: string | string[]) {\n\tlogBullet(log, chalk.yellow, chalk.dim, '●', prefix, text)\n}\n\nfunction info(prefix: string, text?: string | string[]) {\n\tlogBullet(log, chalk.cyan, chalk.dim, '◼', prefix, text)\n}\n\nfunction success(text: string) {\n\tlogBullet(log, chalk.green, chalk.dim, '✔', text)\n}\n\nfunction error(prefix: string, text?: string | string[]) {\n\tlog('')\n\tlogBullet(logError, chalk.red, chalk.red, '▲', prefix, text)\n}\n\nfunction heading(heading: string, description?: string) {\n\treturn log(\n\t\t`\\n${chalk.bgWhite(` ${chalk.whiteBright(heading)} `)} ${chalk.bold(\n\t\t\tdescription\n\t\t)}\\n`\n\t)\n}\n\nconst timing = (fn: (str: string) => any) => () => {\n\tconst start = performance.now()\n\treturn (msg: string) => {\n\t\tconst end = performance.now()\n\t\tconst ms = end - start\n\t\tfn(`${msg} ${chalk.gray(`(${ms.toFixed(2)}ms)`)}`)\n\t}\n}\n\nexport const logger = {\n\tcolors: chalk,\n\tlog,\n\theading,\n\tdebug,\n\tinfo,\n\twarn,\n\tsuccess,\n\terror,\n\ttime: {\n\t\tsuccess: timing(success),\n\t\tinfo: timing(info),\n\t\tdebug: timing(debug)\n\t}\n}\n","const ANSI_BACKGROUND_OFFSET = 10;\n\nconst wrapAnsi16 = (offset = 0) => code => `\\u001B[${code + offset}m`;\n\nconst wrapAnsi256 = (offset = 0) => code => `\\u001B[${38 + offset};5;${code}m`;\n\nconst wrapAnsi16m = (offset = 0) => (red, green, blue) => `\\u001B[${38 + offset};2;${red};${green};${blue}m`;\n\nconst styles = {\n\tmodifier: {\n\t\treset: [0, 0],\n\t\t// 21 isn't widely supported and 22 does the same thing\n\t\tbold: [1, 22],\n\t\tdim: [2, 22],\n\t\titalic: [3, 23],\n\t\tunderline: [4, 24],\n\t\toverline: [53, 55],\n\t\tinverse: [7, 27],\n\t\thidden: [8, 28],\n\t\tstrikethrough: [9, 29],\n\t},\n\tcolor: {\n\t\tblack: [30, 39],\n\t\tred: [31, 39],\n\t\tgreen: [32, 39],\n\t\tyellow: [33, 39],\n\t\tblue: [34, 39],\n\t\tmagenta: [35, 39],\n\t\tcyan: [36, 39],\n\t\twhite: [37, 39],\n\n\t\t// Bright color\n\t\tblackBright: [90, 39],\n\t\tgray: [90, 39], // Alias of `blackBright`\n\t\tgrey: [90, 39], // Alias of `blackBright`\n\t\tredBright: [91, 39],\n\t\tgreenBright: [92, 39],\n\t\tyellowBright: [93, 39],\n\t\tblueBright: [94, 39],\n\t\tmagentaBright: [95, 39],\n\t\tcyanBright: [96, 39],\n\t\twhiteBright: [97, 39],\n\t},\n\tbgColor: {\n\t\tbgBlack: [40, 49],\n\t\tbgRed: [41, 49],\n\t\tbgGreen: [42, 49],\n\t\tbgYellow: [43, 49],\n\t\tbgBlue: [44, 49],\n\t\tbgMagenta: [45, 49],\n\t\tbgCyan: [46, 49],\n\t\tbgWhite: [47, 49],\n\n\t\t// Bright color\n\t\tbgBlackBright: [100, 49],\n\t\tbgGray: [100, 49], // Alias of `bgBlackBright`\n\t\tbgGrey: [100, 49], // Alias of `bgBlackBright`\n\t\tbgRedBright: [101, 49],\n\t\tbgGreenBright: [102, 49],\n\t\tbgYellowBright: [103, 49],\n\t\tbgBlueBright: [104, 49],\n\t\tbgMagentaBright: [105, 49],\n\t\tbgCyanBright: [106, 49],\n\t\tbgWhiteBright: [107, 49],\n\t},\n};\n\nexport const modifierNames = Object.keys(styles.modifier);\nexport const foregroundColorNames = Object.keys(styles.color);\nexport const backgroundColorNames = Object.keys(styles.bgColor);\nexport const colorNames = [...foregroundColorNames, ...backgroundColorNames];\n\nfunction assembleStyles() {\n\tconst codes = new Map();\n\n\tfor (const [groupName, group] of Object.entries(styles)) {\n\t\tfor (const [styleName, style] of Object.entries(group)) {\n\t\t\tstyles[styleName] = {\n\t\t\t\topen: `\\u001B[${style[0]}m`,\n\t\t\t\tclose: `\\u001B[${style[1]}m`,\n\t\t\t};\n\n\t\t\tgroup[styleName] = styles[styleName];\n\n\t\t\tcodes.set(style[0], style[1]);\n\t\t}\n\n\t\tObject.defineProperty(styles, groupName, {\n\t\t\tvalue: group,\n\t\t\tenumerable: false,\n\t\t});\n\t}\n\n\tObject.defineProperty(styles, 'codes', {\n\t\tvalue: codes,\n\t\tenumerable: false,\n\t});\n\n\tstyles.color.close = '\\u001B[39m';\n\tstyles.bgColor.close = '\\u001B[49m';\n\n\tstyles.color.ansi = wrapAnsi16();\n\tstyles.color.ansi256 = wrapAnsi256();\n\tstyles.color.ansi16m = wrapAnsi16m();\n\tstyles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);\n\tstyles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);\n\tstyles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);\n\n\t// From https://github.com/Qix-/color-convert/blob/3f0e0d4e92e235796ccb17f6e85c72094a651f49/conversions.js\n\tObject.defineProperties(styles, {\n\t\trgbToAnsi256: {\n\t\t\tvalue(red, green, blue) {\n\t\t\t\t// We use the extended greyscale palette here, with the exception of\n\t\t\t\t// black and white. normal palette only has 4 greyscale shades.\n\t\t\t\tif (red === green && green === blue) {\n\t\t\t\t\tif (red < 8) {\n\t\t\t\t\t\treturn 16;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (red > 248) {\n\t\t\t\t\t\treturn 231;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn Math.round(((red - 8) / 247) * 24) + 232;\n\t\t\t\t}\n\n\t\t\t\treturn 16\n\t\t\t\t\t+ (36 * Math.round(red / 255 * 5))\n\t\t\t\t\t+ (6 * Math.round(green / 255 * 5))\n\t\t\t\t\t+ Math.round(blue / 255 * 5);\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToRgb: {\n\t\t\tvalue(hex) {\n\t\t\t\tconst matches = /[a-f\\d]{6}|[a-f\\d]{3}/i.exec(hex.toString(16));\n\t\t\t\tif (!matches) {\n\t\t\t\t\treturn [0, 0, 0];\n\t\t\t\t}\n\n\t\t\t\tlet [colorString] = matches;\n\n\t\t\t\tif (colorString.length === 3) {\n\t\t\t\t\tcolorString = [...colorString].map(character => character + character).join('');\n\t\t\t\t}\n\n\t\t\t\tconst integer = Number.parseInt(colorString, 16);\n\n\t\t\t\treturn [\n\t\t\t\t\t/* eslint-disable no-bitwise */\n\t\t\t\t\t(integer >> 16) & 0xFF,\n\t\t\t\t\t(integer >> 8) & 0xFF,\n\t\t\t\t\tinteger & 0xFF,\n\t\t\t\t\t/* eslint-enable no-bitwise */\n\t\t\t\t];\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToAnsi256: {\n\t\t\tvalue: hex => styles.rgbToAnsi256(...styles.hexToRgb(hex)),\n\t\t\tenumerable: false,\n\t\t},\n\t\tansi256ToAnsi: {\n\t\t\tvalue(code) {\n\t\t\t\tif (code < 8) {\n\t\t\t\t\treturn 30 + code;\n\t\t\t\t}\n\n\t\t\t\tif (code < 16) {\n\t\t\t\t\treturn 90 + (code - 8);\n\t\t\t\t}\n\n\t\t\t\tlet red;\n\t\t\t\tlet green;\n\t\t\t\tlet blue;\n\n\t\t\t\tif (code >= 232) {\n\t\t\t\t\tred = (((code - 232) * 10) + 8) / 255;\n\t\t\t\t\tgreen = red;\n\t\t\t\t\tblue = red;\n\t\t\t\t} else {\n\t\t\t\t\tcode -= 16;\n\n\t\t\t\t\tconst remainder = code % 36;\n\n\t\t\t\t\tred = Math.floor(code / 36) / 5;\n\t\t\t\t\tgreen = Math.floor(remainder / 6) / 5;\n\t\t\t\t\tblue = (remainder % 6) / 5;\n\t\t\t\t}\n\n\t\t\t\tconst value = Math.max(red, green, blue) * 2;\n\n\t\t\t\tif (value === 0) {\n\t\t\t\t\treturn 30;\n\t\t\t\t}\n\n\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\tlet result = 30 + ((Math.round(blue) << 2) | (Math.round(green) << 1) | Math.round(red));\n\n\t\t\t\tif (value === 2) {\n\t\t\t\t\tresult += 60;\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\trgbToAnsi: {\n\t\t\tvalue: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToAnsi: {\n\t\t\tvalue: hex => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),\n\t\t\tenumerable: false,\n\t\t},\n\t});\n\n\treturn styles;\n}\n\nconst ansiStyles = assembleStyles();\n\nexport default ansiStyles;\n","import process from 'node:process';\nimport os from 'node:os';\nimport tty from 'node:tty';\n\n// From: https://github.com/sindresorhus/has-flag/blob/main/index.js\n/// function hasFlag(flag, argv = globalThis.Deno?.args ?? process.argv) {\nfunction hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process.argv) {\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst position = argv.indexOf(prefix + flag);\n\tconst terminatorPosition = argv.indexOf('--');\n\treturn position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);\n}\n\nconst {env} = process;\n\nlet flagForceColor;\nif (\n\thasFlag('no-color')\n\t|| hasFlag('no-colors')\n\t|| hasFlag('color=false')\n\t|| hasFlag('color=never')\n) {\n\tflagForceColor = 0;\n} else if (\n\thasFlag('color')\n\t|| hasFlag('colors')\n\t|| hasFlag('color=true')\n\t|| hasFlag('color=always')\n) {\n\tflagForceColor = 1;\n}\n\nfunction envForceColor() {\n\tif ('FORCE_COLOR' in env) {\n\t\tif (env.FORCE_COLOR === 'true') {\n\t\t\treturn 1;\n\t\t}\n\n\t\tif (env.FORCE_COLOR === 'false') {\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);\n\t}\n}\n\nfunction translateLevel(level) {\n\tif (level === 0) {\n\t\treturn false;\n\t}\n\n\treturn {\n\t\tlevel,\n\t\thasBasic: true,\n\t\thas256: level >= 2,\n\t\thas16m: level >= 3,\n\t};\n}\n\nfunction _supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) {\n\tconst noFlagForceColor = envForceColor();\n\tif (noFlagForceColor !== undefined) {\n\t\tflagForceColor = noFlagForceColor;\n\t}\n\n\tconst forceColor = sniffFlags ? flagForceColor : noFlagForceColor;\n\n\tif (forceColor === 0) {\n\t\treturn 0;\n\t}\n\n\tif (sniffFlags) {\n\t\tif (hasFlag('color=16m')\n\t\t\t|| hasFlag('color=full')\n\t\t\t|| hasFlag('color=truecolor')) {\n\t\t\treturn 3;\n\t\t}\n\n\t\tif (hasFlag('color=256')) {\n\t\t\treturn 2;\n\t\t}\n\t}\n\n\t// Check for Azure DevOps pipelines.\n\t// Has to be above the `!streamIsTTY` check.\n\tif ('TF_BUILD' in env && 'AGENT_NAME' in env) {\n\t\treturn 1;\n\t}\n\n\tif (haveStream && !streamIsTTY && forceColor === undefined) {\n\t\treturn 0;\n\t}\n\n\tconst min = forceColor || 0;\n\n\tif (env.TERM === 'dumb') {\n\t\treturn min;\n\t}\n\n\tif (process.platform === 'win32') {\n\t\t// Windows 10 build 10586 is the first Windows release that supports 256 colors.\n\t\t// Windows 10 build 14931 is the first release that supports 16m/TrueColor.\n\t\tconst osRelease = os.release().split('.');\n\t\tif (\n\t\t\tNumber(osRelease[0]) >= 10\n\t\t\t&& Number(osRelease[2]) >= 10_586\n\t\t) {\n\t\t\treturn Number(osRelease[2]) >= 14_931 ? 3 : 2;\n\t\t}\n\n\t\treturn 1;\n\t}\n\n\tif ('CI' in env) {\n\t\tif ('GITHUB_ACTIONS' in env || 'GITEA_ACTIONS' in env) {\n\t\t\treturn 3;\n\t\t}\n\n\t\tif (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'BUILDKITE', 'DRONE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn min;\n\t}\n\n\tif ('TEAMCITY_VERSION' in env) {\n\t\treturn /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;\n\t}\n\n\tif (env.COLORTERM === 'truecolor') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'xterm-kitty') {\n\t\treturn 3;\n\t}\n\n\tif ('TERM_PROGRAM' in env) {\n\t\tconst version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);\n\n\t\tswitch (env.TERM_PROGRAM) {\n\t\t\tcase 'iTerm.app': {\n\t\t\t\treturn version >= 3 ? 3 : 2;\n\t\t\t}\n\n\t\t\tcase 'Apple_Terminal': {\n\t\t\t\treturn 2;\n\t\t\t}\n\t\t\t// No default\n\t\t}\n\t}\n\n\tif (/-256(color)?$/i.test(env.TERM)) {\n\t\treturn 2;\n\t}\n\n\tif (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {\n\t\treturn 1;\n\t}\n\n\tif ('COLORTERM' in env) {\n\t\treturn 1;\n\t}\n\n\treturn min;\n}\n\nexport function createSupportsColor(stream, options = {}) {\n\tconst level = _supportsColor(stream, {\n\t\tstreamIsTTY: stream && stream.isTTY,\n\t\t...options,\n\t});\n\n\treturn translateLevel(level);\n}\n\nconst supportsColor = {\n\tstdout: createSupportsColor({isTTY: tty.isatty(1)}),\n\tstderr: createSupportsColor({isTTY: tty.isatty(2)}),\n};\n\nexport default supportsColor;\n","// TODO: When targeting Node.js 16, use `String.prototype.replaceAll`.\nexport function stringReplaceAll(string, substring, replacer) {\n\tlet index = string.indexOf(substring);\n\tif (index === -1) {\n\t\treturn string;\n\t}\n\n\tconst substringLength = substring.length;\n\tlet endIndex = 0;\n\tlet returnValue = '';\n\tdo {\n\t\treturnValue += string.slice(endIndex, index) + substring + replacer;\n\t\tendIndex = index + substringLength;\n\t\tindex = string.indexOf(substring, endIndex);\n\t} while (index !== -1);\n\n\treturnValue += string.slice(endIndex);\n\treturn returnValue;\n}\n\nexport function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {\n\tlet endIndex = 0;\n\tlet returnValue = '';\n\tdo {\n\t\tconst gotCR = string[index - 1] === '\\r';\n\t\treturnValue += string.slice(endIndex, (gotCR ? index - 1 : index)) + prefix + (gotCR ? '\\r\\n' : '\\n') + postfix;\n\t\tendIndex = index + 1;\n\t\tindex = string.indexOf('\\n', endIndex);\n\t} while (index !== -1);\n\n\treturnValue += string.slice(endIndex);\n\treturn returnValue;\n}\n","import ansiStyles from '#ansi-styles';\nimport supportsColor from '#supports-color';\nimport { // eslint-disable-line import/order\n\tstringReplaceAll,\n\tstringEncaseCRLFWithFirstIndex,\n} from './utilities.js';\n\nconst {stdout: stdoutColor, stderr: stderrColor} = supportsColor;\n\nconst GENERATOR = Symbol('GENERATOR');\nconst STYLER = Symbol('STYLER');\nconst IS_EMPTY = Symbol('IS_EMPTY');\n\n// `supportsColor.level` → `ansiStyles.color[name]` mapping\nconst levelMapping = [\n\t'ansi',\n\t'ansi',\n\t'ansi256',\n\t'ansi16m',\n];\n\nconst styles = Object.create(null);\n\nconst applyOptions = (object, options = {}) => {\n\tif (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {\n\t\tthrow new Error('The `level` option should be an integer from 0 to 3');\n\t}\n\n\t// Detect level if not set manually\n\tconst colorLevel = stdoutColor ? stdoutColor.level : 0;\n\tobject.level = options.level === undefined ? colorLevel : options.level;\n};\n\nexport class Chalk {\n\tconstructor(options) {\n\t\t// eslint-disable-next-line no-constructor-return\n\t\treturn chalkFactory(options);\n\t}\n}\n\nconst chalkFactory = options => {\n\tconst chalk = (...strings) => strings.join(' ');\n\tapplyOptions(chalk, options);\n\n\tObject.setPrototypeOf(chalk, createChalk.prototype);\n\n\treturn chalk;\n};\n\nfunction createChalk(options) {\n\treturn chalkFactory(options);\n}\n\nObject.setPrototypeOf(createChalk.prototype, Function.prototype);\n\nfor (const [styleName, style] of Object.entries(ansiStyles)) {\n\tstyles[styleName] = {\n\t\tget() {\n\t\t\tconst builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);\n\t\t\tObject.defineProperty(this, styleName, {value: builder});\n\t\t\treturn builder;\n\t\t},\n\t};\n}\n\nstyles.visible = {\n\tget() {\n\t\tconst builder = createBuilder(this, this[STYLER], true);\n\t\tObject.defineProperty(this, 'visible', {value: builder});\n\t\treturn builder;\n\t},\n};\n\nconst getModelAnsi = (model, level, type, ...arguments_) => {\n\tif (model === 'rgb') {\n\t\tif (level === 'ansi16m') {\n\t\t\treturn ansiStyles[type].ansi16m(...arguments_);\n\t\t}\n\n\t\tif (level === 'ansi256') {\n\t\t\treturn ansiStyles[type].ansi256(ansiStyles.rgbToAnsi256(...arguments_));\n\t\t}\n\n\t\treturn ansiStyles[type].ansi(ansiStyles.rgbToAnsi(...arguments_));\n\t}\n\n\tif (model === 'hex') {\n\t\treturn getModelAnsi('rgb', level, type, ...ansiStyles.hexToRgb(...arguments_));\n\t}\n\n\treturn ansiStyles[type][model](...arguments_);\n};\n\nconst usedModels = ['rgb', 'hex', 'ansi256'];\n\nfor (const model of usedModels) {\n\tstyles[model] = {\n\t\tget() {\n\t\t\tconst {level} = this;\n\t\t\treturn function (...arguments_) {\n\t\t\t\tconst styler = createStyler(getModelAnsi(model, levelMapping[level], 'color', ...arguments_), ansiStyles.color.close, this[STYLER]);\n\t\t\t\treturn createBuilder(this, styler, this[IS_EMPTY]);\n\t\t\t};\n\t\t},\n\t};\n\n\tconst bgModel = 'bg' + model[0].toUpperCase() + model.slice(1);\n\tstyles[bgModel] = {\n\t\tget() {\n\t\t\tconst {level} = this;\n\t\t\treturn function (...arguments_) {\n\t\t\t\tconst styler = createStyler(getModelAnsi(model, levelMapping[level], 'bgColor', ...arguments_), ansiStyles.bgColor.close, this[STYLER]);\n\t\t\t\treturn createBuilder(this, styler, this[IS_EMPTY]);\n\t\t\t};\n\t\t},\n\t};\n}\n\nconst proto = Object.defineProperties(() => {}, {\n\t...styles,\n\tlevel: {\n\t\tenumerable: true,\n\t\tget() {\n\t\t\treturn this[GENERATOR].level;\n\t\t},\n\t\tset(level) {\n\t\t\tthis[GENERATOR].level = level;\n\t\t},\n\t},\n});\n\nconst createStyler = (open, close, parent) => {\n\tlet openAll;\n\tlet closeAll;\n\tif (parent === undefined) {\n\t\topenAll = open;\n\t\tcloseAll = close;\n\t} else {\n\t\topenAll = parent.openAll + open;\n\t\tcloseAll = close + parent.closeAll;\n\t}\n\n\treturn {\n\t\topen,\n\t\tclose,\n\t\topenAll,\n\t\tcloseAll,\n\t\tparent,\n\t};\n};\n\nconst createBuilder = (self, _styler, _isEmpty) => {\n\t// Single argument is hot path, implicit coercion is faster than anything\n\t// eslint-disable-next-line no-implicit-coercion\n\tconst builder = (...arguments_) => applyStyle(builder, (arguments_.length === 1) ? ('' + arguments_[0]) : arguments_.join(' '));\n\n\t// We alter the prototype because we must return a function, but there is\n\t// no way to create a function with a different prototype\n\tObject.setPrototypeOf(builder, proto);\n\n\tbuilder[GENERATOR] = self;\n\tbuilder[STYLER] = _styler;\n\tbuilder[IS_EMPTY] = _isEmpty;\n\n\treturn builder;\n};\n\nconst applyStyle = (self, string) => {\n\tif (self.level <= 0 || !string) {\n\t\treturn self[IS_EMPTY] ? '' : string;\n\t}\n\n\tlet styler = self[STYLER];\n\n\tif (styler === undefined) {\n\t\treturn string;\n\t}\n\n\tconst {openAll, closeAll} = styler;\n\tif (string.includes('\\u001B')) {\n\t\twhile (styler !== undefined) {\n\t\t\t// Replace any instances already present with a re-opening code\n\t\t\t// otherwise only the part of the string until said closing code\n\t\t\t// will be colored, and the rest will simply be 'plain'.\n\t\t\tstring = stringReplaceAll(string, styler.close, styler.open);\n\n\t\t\tstyler = styler.parent;\n\t\t}\n\t}\n\n\t// We can move both next actions out of loop, because remaining actions in loop won't have\n\t// any/visible effect on parts we add here. Close the styling before a linebreak and reopen\n\t// after next line to fix a bleed issue on macOS: https://github.com/chalk/chalk/pull/92\n\tconst lfIndex = string.indexOf('\\n');\n\tif (lfIndex !== -1) {\n\t\tstring = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);\n\t}\n\n\treturn openAll + string + closeAll;\n};\n\nObject.defineProperties(createChalk.prototype, styles);\n\nconst chalk = createChalk();\nexport const chalkStderr = createChalk({level: stderrColor ? stderrColor.level : 0});\n\nexport {\n\tmodifierNames,\n\tforegroundColorNames,\n\tbackgroundColorNames,\n\tcolorNames,\n\n\t// TODO: Remove these aliases in the next major version\n\tmodifierNames as modifiers,\n\tforegroundColorNames as foregroundColors,\n\tbackgroundColorNames as backgroundColors,\n\tcolorNames as colors,\n} from './vendor/ansi-styles/index.js';\n\nexport {\n\tstdoutColor as supportsColor,\n\tstderrColor as supportsColorStderr,\n};\n\nexport default chalk;\n"],"mappings":";AACA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAW1B,eAAsB,SAAS;EAC9B;EACA;EACA;EACA;AACD,GAAoB;AACnB,QAAM,aAAa,QAAQ,KAAK,QAAQ,KAAK,QAAQ,MAAM;AAC3D,QAAM,SAAS,CAAC;AAEhB,aAAW,MAAM,cA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A,UACH,GAAG;AAAA,QACJ;AAEA,QAAAA,SAAQ,GAAG,OAAO,aAAa;AAE/B,cAAM,eAAe;AAAA,UACpB;AAAA,UACA;AAAA,UACA;AAAA,QACD;AAEA,cAAM,SAAS;AAAA,UACd,GAAG;AAAA,UACH;AAAA,UACA;AAAA,UACA;AAAA,QACD,CAAC;AAED,QAAAA,SAAQ,GAAG,MAAM,iBAAiBD,WAAU,KAAK,CAAC;AAElD,+BAAuB;AACvB,2BAAmB;AAEnB,eAAO;AAAA,UACN,UAAU,OAAO,YAAY,CAAC;AAAA,UAC9B,GAAG,oBAAoB,6BAA6B,gBAAgB;AAAA,QACrE;AAAA,MACD,SAAS,KAAK;AACb,YAAI,eAAe,OAAO;AACzB,iBAAO;AAAA,YACN,GAAG,MAAM;AAAA,YACT,wBAAwB,MAAM,KAAK,IAAI,OAAO;AAAA;AAAA,UAC/C;AAAA,QACD;AAAA,MACD;AAAA,IACD,CAAC;AAAA,EACF;AAEA,MAAI,CAAC,qBAAqB;AACzB,WAAO,KAAK,uBAAuB;AAAA,EACpC;AAEA;AAAA,IACC,cAAc,mBAAmB,cAAc,eAAe;AAAA,EAC/D;AACD;","names":["runtime","process","styles","chalk","logger","heading","stringify","runtime"]}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"translate.mjs"}
package/dist/index.js CHANGED
@@ -1,87 +1,29 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __esm = (fn, res) => function __init() {
9
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
10
- };
11
- var __commonJS = (cb, mod) => function __require() {
12
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
13
- };
14
- var __export = (target, all) => {
15
- for (var name in all)
16
- __defProp(target, name, { get: all[name], enumerable: true });
17
- };
18
- var __copyProps = (to, from, except, desc) => {
19
- if (from && typeof from === "object" || typeof from === "function") {
20
- for (let key of __getOwnPropNames(from))
21
- if (!__hasOwnProp.call(to, key) && key !== except)
22
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
- }
24
- return to;
25
- };
26
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
27
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
28
- // If the importer is in node compatibility mode or this is not an ESM
29
- // file that has been converted to a CommonJS file using a Babel-
30
- // compatible transform (i.e. "__esModule" has not been set), then set
31
- // "default" to the CommonJS "module.exports" for node compatibility.
32
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
33
- mod
34
- ));
35
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
1
+ 'use strict';
36
2
 
37
- // ../../node_modules/.pnpm/tsup@8.1.0_typescript@5.4.5/node_modules/tsup/assets/cjs_shims.js
38
- var init_cjs_shims = __esm({
39
- "../../node_modules/.pnpm/tsup@8.1.0_typescript@5.4.5/node_modules/tsup/assets/cjs_shims.js"() {
40
- "use strict";
41
- }
42
- });
43
-
44
- // ../types/dist/index.js
45
- var require_dist = __commonJS({
46
- "../types/dist/index.js"(exports2, module2) {
47
- "use strict";
48
- init_cjs_shims();
49
- var __defProp2 = Object.defineProperty;
50
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
51
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
52
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
53
- var __copyProps2 = (to, from, except, desc) => {
54
- if (from && typeof from === "object" || typeof from === "function") {
55
- for (let key of __getOwnPropNames2(from))
56
- if (!__hasOwnProp2.call(to, key) && key !== except)
57
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
58
- }
59
- return to;
60
- };
61
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
62
- var src_exports2 = {};
63
- module2.exports = __toCommonJS2(src_exports2);
64
- }
65
- });
3
+ var chunkLIRTPATK_js = require('./chunk-LIRTPATK.js');
4
+ var translators = require('@terai/translator/translators');
5
+ var types = require('@terai/types');
66
6
 
67
7
  // src/index.ts
68
- var src_exports = {};
69
- __export(src_exports, {
70
- createChatGptTranslator: () => import_translators.createChatGptTranslator,
71
- createGoogleCloudTranslator: () => import_translators.createGoogleCloudTranslator,
72
- defineConfig: () => defineConfig
73
- });
74
- module.exports = __toCommonJS(src_exports);
75
- init_cjs_shims();
76
- var import_translators = require("@terai/translator/translators");
77
- __reExport(src_exports, __toESM(require_dist()), module.exports);
8
+ chunkLIRTPATK_js.init_cjs_shims();
78
9
  function defineConfig(config) {
79
10
  return config;
80
11
  }
81
- // Annotate the CommonJS export names for ESM import in node:
82
- 0 && (module.exports = {
83
- createChatGptTranslator,
84
- createGoogleCloudTranslator,
85
- defineConfig
12
+
13
+ Object.defineProperty(exports, "createChatGptTranslator", {
14
+ enumerable: true,
15
+ get: function () { return translators.createChatGptTranslator; }
16
+ });
17
+ Object.defineProperty(exports, "createGoogleCloudTranslator", {
18
+ enumerable: true,
19
+ get: function () { return translators.createGoogleCloudTranslator; }
20
+ });
21
+ exports.defineConfig = defineConfig;
22
+ Object.keys(types).forEach(function (k) {
23
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
24
+ enumerable: true,
25
+ get: function () { return types[k]; }
26
+ });
86
27
  });
28
+ //# sourceMappingURL=index.js.map
87
29
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../node_modules/.pnpm/tsup@8.1.0_typescript@5.4.5/node_modules/tsup/assets/cjs_shims.js","../../types/dist/index.js","../src/index.ts"],"sourcesContent":["// Shim globals in cjs bundle\n// There's a weird bug that esbuild will always inject importMetaUrl\n// if we export it as `const importMetaUrl = ... __filename ...`\n// But using a function will not cause this issue\n\nconst getImportMetaUrl = () =>\n typeof document === 'undefined'\n ? new URL('file:' + __filename).href\n : (document.currentScript && document.currentScript.src) ||\n new URL('main.js', document.baseURI).href\n\nexport const importMetaUrl = /* @__PURE__ */ getImportMetaUrl()\n","\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/index.ts\nvar src_exports = {};\nmodule.exports = __toCommonJS(src_exports);\n","import type { Config } from '@terai/types'\n\nexport function defineConfig(config: Config) {\n\treturn config\n}\n\nexport {\n\tcreateChatGptTranslator,\n\tcreateGoogleCloudTranslator\n} from '@terai/translator/translators'\n\nexport * from '@terai/types'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA,2BAAAA,UAAAC,SAAA;AAAA;AAAA;AACA,QAAIC,aAAY,OAAO;AACvB,QAAIC,oBAAmB,OAAO;AAC9B,QAAIC,qBAAoB,OAAO;AAC/B,QAAIC,gBAAe,OAAO,UAAU;AACpC,QAAIC,eAAc,CAAC,IAAI,MAAM,QAAQ,SAAS;AAC5C,UAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;AAClE,iBAAS,OAAOF,mBAAkB,IAAI;AACpC,cAAI,CAACC,cAAa,KAAK,IAAI,GAAG,KAAK,QAAQ;AACzC,YAAAH,WAAU,IAAI,KAAK,EAAE,KAAK,MAAM,KAAK,GAAG,GAAG,YAAY,EAAE,OAAOC,kBAAiB,MAAM,GAAG,MAAM,KAAK,WAAW,CAAC;AAAA,MACvH;AACA,aAAO;AAAA,IACT;AACA,QAAII,gBAAe,CAAC,QAAQD,aAAYJ,WAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AAGzF,QAAIM,eAAc,CAAC;AACnB,IAAAP,QAAO,UAAUM,cAAaC,YAAW;AAAA;AAAA;;;ACjBzC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,yBAGO;AAEP,wBAAc,yBAXd;AAEO,SAAS,aAAa,QAAgB;AAC5C,SAAO;AACR;","names":["exports","module","__defProp","__getOwnPropDesc","__getOwnPropNames","__hasOwnProp","__copyProps","__toCommonJS","src_exports"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":["init_cjs_shims"],"mappings":";;;;;;;AAAAA,+BAAA,EAAA;AAEO,SAAS,aAAa,MAAA,EAAgB;AAC5C,EAAA,OAAO,MAAA;AACR","file":"index.js","sourcesContent":["import type { Config } from '@terai/types'\n\nexport function defineConfig(config: Config) {\n\treturn config\n}\n\nexport {\n\tcreateChatGptTranslator,\n\tcreateGoogleCloudTranslator\n} from '@terai/translator/translators'\n\nexport * from '@terai/types'\n"]}
package/dist/index.mjs CHANGED
@@ -1,86 +1,13 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __esm = (fn, res) => function __init() {
8
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
9
- };
10
- var __commonJS = (cb, mod) => function __require() {
11
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
12
- };
13
- var __export = (target, all) => {
14
- for (var name in all)
15
- __defProp(target, name, { get: all[name], enumerable: true });
16
- };
17
- var __copyProps = (to, from, except, desc) => {
18
- if (from && typeof from === "object" || typeof from === "function") {
19
- for (let key of __getOwnPropNames(from))
20
- if (!__hasOwnProp.call(to, key) && key !== except)
21
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
22
- }
23
- return to;
24
- };
25
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
26
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
27
- // If the importer is in node compatibility mode or this is not an ESM
28
- // file that has been converted to a CommonJS file using a Babel-
29
- // compatible transform (i.e. "__esModule" has not been set), then set
30
- // "default" to the CommonJS "module.exports" for node compatibility.
31
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
32
- mod
33
- ));
34
-
35
- // ../../node_modules/.pnpm/tsup@8.1.0_typescript@5.4.5/node_modules/tsup/assets/esm_shims.js
36
- var init_esm_shims = __esm({
37
- "../../node_modules/.pnpm/tsup@8.1.0_typescript@5.4.5/node_modules/tsup/assets/esm_shims.js"() {
38
- "use strict";
39
- }
40
- });
41
-
42
- // ../types/dist/index.js
43
- var require_dist = __commonJS({
44
- "../types/dist/index.js"(exports, module) {
45
- "use strict";
46
- init_esm_shims();
47
- var __defProp2 = Object.defineProperty;
48
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
49
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
50
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
51
- var __copyProps2 = (to, from, except, desc) => {
52
- if (from && typeof from === "object" || typeof from === "function") {
53
- for (let key of __getOwnPropNames2(from))
54
- if (!__hasOwnProp2.call(to, key) && key !== except)
55
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
56
- }
57
- return to;
58
- };
59
- var __toCommonJS = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
60
- var src_exports2 = {};
61
- module.exports = __toCommonJS(src_exports2);
62
- }
63
- });
1
+ import { init_esm_shims } from './chunk-UOKEQCV3.mjs';
2
+ export { createChatGptTranslator, createGoogleCloudTranslator } from '@terai/translator/translators';
3
+ export * from '@terai/types';
64
4
 
65
5
  // src/index.ts
66
- var src_exports = {};
67
- __export(src_exports, {
68
- createChatGptTranslator: () => createChatGptTranslator,
69
- createGoogleCloudTranslator: () => createGoogleCloudTranslator,
70
- defineConfig: () => defineConfig
71
- });
72
6
  init_esm_shims();
73
- __reExport(src_exports, __toESM(require_dist()));
74
- import {
75
- createChatGptTranslator,
76
- createGoogleCloudTranslator
77
- } from "@terai/translator/translators";
78
7
  function defineConfig(config) {
79
8
  return config;
80
9
  }
81
- export {
82
- createChatGptTranslator,
83
- createGoogleCloudTranslator,
84
- defineConfig
85
- };
10
+
11
+ export { defineConfig };
12
+ //# sourceMappingURL=index.mjs.map
86
13
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../node_modules/.pnpm/tsup@8.1.0_typescript@5.4.5/node_modules/tsup/assets/esm_shims.js","../../types/dist/index.js","../src/index.ts"],"sourcesContent":["// Shim globals in esm bundle\nimport { fileURLToPath } from 'url'\nimport path from 'path'\n\nconst getFilename = () => fileURLToPath(import.meta.url)\nconst getDirname = () => path.dirname(getFilename())\n\nexport const __dirname = /* @__PURE__ */ getDirname()\nexport const __filename = /* @__PURE__ */ getFilename()\n","\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/index.ts\nvar src_exports = {};\nmodule.exports = __toCommonJS(src_exports);\n","import type { Config } from '@terai/types'\n\nexport function defineConfig(config: Config) {\n\treturn config\n}\n\nexport {\n\tcreateChatGptTranslator,\n\tcreateGoogleCloudTranslator\n} from '@terai/translator/translators'\n\nexport * from '@terai/types'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AACA,QAAIA,aAAY,OAAO;AACvB,QAAIC,oBAAmB,OAAO;AAC9B,QAAIC,qBAAoB,OAAO;AAC/B,QAAIC,gBAAe,OAAO,UAAU;AACpC,QAAIC,eAAc,CAAC,IAAI,MAAM,QAAQ,SAAS;AAC5C,UAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;AAClE,iBAAS,OAAOF,mBAAkB,IAAI;AACpC,cAAI,CAACC,cAAa,KAAK,IAAI,GAAG,KAAK,QAAQ;AACzC,YAAAH,WAAU,IAAI,KAAK,EAAE,KAAK,MAAM,KAAK,GAAG,GAAG,YAAY,EAAE,OAAOC,kBAAiB,MAAM,GAAG,MAAM,KAAK,WAAW,CAAC;AAAA,MACvH;AACA,aAAO;AAAA,IACT;AACA,QAAI,eAAe,CAAC,QAAQG,aAAYJ,WAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AAGzF,QAAIK,eAAc,CAAC;AACnB,WAAO,UAAU,aAAaA,YAAW;AAAA;AAAA;;;ACjBzC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA,wBAAc;AALd;AAAA,EACC;AAAA,EACA;AAAA,OACM;AAPA,SAAS,aAAa,QAAgB;AAC5C,SAAO;AACR;","names":["__defProp","__getOwnPropDesc","__getOwnPropNames","__hasOwnProp","__copyProps","src_exports"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAAA,cAAA,EAAA;AAEO,SAAS,aAAa,MAAA,EAAgB;AAC5C,EAAA,OAAO,MAAA;AACR","file":"index.mjs","sourcesContent":["import type { Config } from '@terai/types'\n\nexport function defineConfig(config: Config) {\n\treturn config\n}\n\nexport {\n\tcreateChatGptTranslator,\n\tcreateGoogleCloudTranslator\n} from '@terai/translator/translators'\n\nexport * from '@terai/types'\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@terai/dev",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "description": "The user-facing package for Terai",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -33,17 +33,17 @@
33
33
  "kleur": "^4",
34
34
  "perfect-debounce": "^1",
35
35
  "preferred-pm": "^3",
36
- "@terai/extractor": "0.0.6",
37
- "@terai/runtime": "0.0.6",
38
- "@terai/translator": "0.0.6",
39
- "@terai/utils": "0.0.6"
36
+ "@terai/extractor": "0.0.8",
37
+ "@terai/runtime": "0.0.8",
38
+ "@terai/translator": "0.0.8",
39
+ "@terai/utils": "0.0.8",
40
+ "@terai/types": "0.0.8"
40
41
  },
41
42
  "devDependencies": {
42
43
  "@types/update-notifier": "^6",
43
44
  "update-notifier": "^6",
44
- "@terai/generator": "0.0.6",
45
- "@terai/logger": "0.0.6",
46
- "@terai/types": "0.0.6"
45
+ "@terai/generator": "0.0.8",
46
+ "@terai/logger": "0.0.8"
47
47
  },
48
48
  "scripts": {
49
49
  "dev": "tsup --format=esm,cjs --no-dts --watch",