@eloqnt/cli 0.6.29 → 0.6.31
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @eloqnt/cli
|
|
2
2
|
|
|
3
|
+
## 0.6.31
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 6ba6cc6: `eloqnt review` now reports its post-review checks as a step of their own, the way `eloqnt translate` does for its post-translation checks.
|
|
8
|
+
- Updated dependencies [21293f8]
|
|
9
|
+
- Updated dependencies [6ba6cc6]
|
|
10
|
+
- Updated dependencies [934d7c6]
|
|
11
|
+
- Updated dependencies [6ba6cc6]
|
|
12
|
+
- @eloqnt/sdk@0.6.29
|
|
13
|
+
|
|
14
|
+
## 0.6.30
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies [54c9ea8]
|
|
19
|
+
- @eloqnt/sdk@0.6.28
|
|
20
|
+
|
|
3
21
|
## 0.6.29
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/dist/bin/eloqnt.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import e from"node:process";import{defineCommand as t,renderUsage as n,runMain as r}from"citty";import i from"picocolors";var a=`0.6.
|
|
2
|
+
import e from"node:process";import{defineCommand as t,renderUsage as n,runMain as r}from"citty";import i from"picocolors";var a=`0.6.31`;try{e.loadEnvFile()}catch{}const o=t({meta:{name:`eloqnt`,version:a,description:`AI-powered translations for developers`},subCommands:{lint:d(()=>import(`../lint-Wu02Ge85.mjs`)),review:d(()=>import(`../review-hRnF51uJ.mjs`)),translate:d(()=>import(`../translate-D4A7TVLU.mjs`)),crowdin:d(()=>import(`../crowdin-DdfREp0-.mjs`)),login:d(()=>import(`../login-cvA1zw4B.mjs`)),logout:d(()=>import(`../logout-BAr7ojyZ.mjs`)),whoami:d(()=>import(`../whoami-CUFPZPY4.mjs`))}}),s=e.argv.slice(2);r(o,{rawArgs:s.length===1&&s[0]===`-v`?[`--version`]:s,async showUsage(e,t){console.log(await n(e,t)),console.log(i.dim(`Docs: ${await c(e,t)}`))}});async function c(e,t){let n=(await u(e.meta))?.name,r=(await u(t?.meta))?.name,i=r===void 0||r===`eloqnt`?n:r;return i===void 0||i===`eloqnt`?`https://cli.eloqnt.dev/docs`:`https://cli.eloqnt.dev/docs/cli/${await l(i)}`}async function l(e){let t=o.subCommands??{};if(e in t)return e;for(let[n,r]of Object.entries(t)){let t=(await u(r))?.subCommands;if(t&&e in t)return n}return e}function u(e){return typeof e==`function`?e():e}function d(e){return()=>e().then(e=>e.default)}export{a as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineCommand as e}from"citty";var t=e({meta:{name:`review`,description:`Review source strings and fix issues in place.`},setup({rawArgs:e}){e.find(e=>!e.startsWith(`-`))!==`source`&&e.unshift(`source`)},subCommands:{source:()=>import(`./source-
|
|
1
|
+
import{defineCommand as e}from"citty";var t=e({meta:{name:`review`,description:`Review source strings and fix issues in place.`},setup({rawArgs:e}){e.find(e=>!e.startsWith(`-`))!==`source`&&e.unshift(`source`)},subCommands:{source:()=>import(`./source-CNaJNsTq.mjs`).then(e=>e.default)}});export{t as default};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import{t as e}from"./defineEloqntCommand-BNNDggcZ.mjs";import{t}from"./parseListArg-p5H1s5JC.mjs";import{t as n}from"./createSpinner-BBkrpcrh.mjs";import{n as r,t as i}from"./report-CEfrIjER.mjs";import{a,i as o,n as s,o as c,r as l}from"./stringWidth-DvyI3S_b.mjs";import{a as u,r as d}from"./urls-qvEAJDcV.mjs";import{n as f,r as p,t as m}from"./writeStep-CerCYWGN.mjs";import{reviewSource as h}from"@eloqnt/sdk";import g from"node:process";import _ from"picocolors";import{basename as v,dirname as y,relative as b}from"node:path";import{loadStyleguide as x}from"@eloqnt/sdk/_internal";var S=e({meta:{name:`source`,description:`Review source strings for errors and fix them in place.`,requiresLogin:!0},args:{id:{type:`string`,description:`(Re-)review these message ids (comma-separated)`}},async execute({config:e,rootDir:r,args:i}){let{messages:a,srcPath:o}=e,s=c(a.path,r),l=o?c(o,r):void 0,f=await x({rootDir:r,path:e.styleguides}),v=p(f,[a.sourceLocale]),y=e.model?`eloqnt/engine (${typeof e.model==`string`?e.model:e.model.modelId})`:`eloqnt/engine (hosted)`,S=g.stderr.isTTY&&!i.json,C;function w(e){if(!i.json){if(e.phase===`context-enrichment`){e.state===`started`?(g.stderr.write(`
|
|
2
2
|
`),S?(C=n({withGuide:!1}),C.start(`Context enrichment running`)):g.stderr.write(_.dim(`Context enrichment running …
|
|
3
3
|
`))):e.state===`completed`?(C?.clear(),C=void 0,m(_.green(`✔`),`Context enrichment complete`)):(g.stderr.write(`
|
|
4
|
-
`),m(_.dim(`–`),"Skipped source code analysis due to absent `srcPath`"));return}e.state===`started`?
|
|
4
|
+
`),m(_.dim(`–`),"Skipped source code analysis due to absent `srcPath`"));return}if(e.phase===`post-checks`){e.state===`started`?S?(C=n({withGuide:!1}),C.start(`Post-review checks running`)):g.stderr.write(_.dim(`Post-review checks running …
|
|
5
|
+
`)):(C?.clear(),C=void 0,m(_.green(`✔`),`Post-review checks done`));return}e.state===`started`?(v?m(_.green(`✔`),v):m(_.dim(`–`),`No styleguides found`),S?(C=n({withGuide:!1}),C.start(`Reviewing source strings via ${y}`)):g.stderr.write(_.dim(`Reviewing source strings via ${y} …\n`))):(C?.clear(),C=void 0,m(_.green(`✔`),`Reviewed source strings via ${y}`))}}let T;try{T=await h({messagesPath:s,sourceLocale:a.sourceLocale,format:a.format,locales:a.locales,codes:a.codes,rootDir:r,engineUrl:d(),languageModel:e.model,authToken:await u(),styleguide:f,ids:t(i.id),srcPath:l,onProgress:w})}catch(e){throw C?.clear(),e}let E=g.cwd();return{result:{...T,files:T.files.map(e=>({...e,file:b(E,e.file)})),findings:T.findings.map(e=>({...e,file:e.file?b(E,e.file):void 0,sourceFiles:e.sourceFiles.map(e=>b(E,e))}))}}},render:({result:e})=>C(e),ok:({result:e})=>e.findings.every(e=>e.status===`fixed`),json:({result:e})=>e});function C(e,t=o()){let{findings:n,reviewed:r,missingTranslations:i,quota:a}=e,s=[],c=new Map;for(let t of n){let n=t.file??e.sourceLocale,r=c.get(n)??[];r.push(t),c.set(n,r)}for(let[e,n]of c){let r=[`${_.cyan(e)} ${_.dim(`(source locale)`)}`];for(let e of n)r.push(_.dim(`│`)),r.push(...w(e,t));s.push(r.join(`
|
|
5
6
|
`))}let l=O(n,e.sourceLocale),u=Object.groupBy(e.files,e=>y(e.file)),d=Object.entries(u).map(([e,t=[]])=>{let n=Math.max(0,...t.map(e=>v(e.file).length)),r=t.map(e=>{let t=v(e.file).padEnd(n),r=l.get(e.file);return` ${t} ${k(e.reviewed,r?.fixed??0,r?.reported??0,a!==void 0)}`});return[_.dim(`${e}/`),...r].join(`
|
|
6
7
|
`)}).join(`
|
|
7
8
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eloqnt/cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.31",
|
|
4
4
|
"description": "A linter for your translation files, with AI translation built in.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"i18n",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"citty": "^0.1.6",
|
|
38
38
|
"open": "^11.0.0",
|
|
39
39
|
"picocolors": "^1.1.1",
|
|
40
|
-
"@eloqnt/sdk": "0.6.
|
|
40
|
+
"@eloqnt/sdk": "0.6.29"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "^25.9.5"
|