@eloqnt/cli 0.6.8 → 0.6.9

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,13 @@
1
1
  # @eloqnt/cli
2
2
 
3
+ ## 0.6.9
4
+
5
+ ### Patch Changes
6
+
7
+ - cf0fbf8: Added the `lint` config: set a rule's severity or turn it off via `lint.rules` (`'error'`, `'warn'`, `'off'`), and scope settings to matching message keys via `lint.overrides`.
8
+ - Updated dependencies [cf0fbf8]
9
+ - @eloqnt/sdk@0.6.8
10
+
3
11
  ## 0.6.8
4
12
 
5
13
  ### Patch Changes
@@ -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.8`;try{e.loadEnvFile()}catch{}const o=t({meta:{name:`eloqnt`,version:a,description:`AI-powered translations for developers`},subCommands:{lint:d(()=>import(`../lint-DbpkLEyL.mjs`)),review:d(()=>import(`../review-XgxtI6Gm.mjs`)),translate:d(()=>import(`../translate-DkSTqtOF.mjs`)),crowdin:d(()=>import(`../crowdin-DdfREp0-.mjs`)),login:d(()=>import(`../login-W60UmKbD.mjs`)),logout:d(()=>import(`../logout-BCLs2gQ-.mjs`)),whoami:d(()=>import(`../whoami-bo3bXioJ.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://studio.eloqnt.dev/docs`:`https://studio.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};
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.9`;try{e.loadEnvFile()}catch{}const o=t({meta:{name:`eloqnt`,version:a,description:`AI-powered translations for developers`},subCommands:{lint:d(()=>import(`../lint-SaT4fq-x.mjs`)),review:d(()=>import(`../review-XgxtI6Gm.mjs`)),translate:d(()=>import(`../translate-DkSTqtOF.mjs`)),crowdin:d(()=>import(`../crowdin-DdfREp0-.mjs`)),login:d(()=>import(`../login-W60UmKbD.mjs`)),logout:d(()=>import(`../logout-BCLs2gQ-.mjs`)),whoami:d(()=>import(`../whoami-bo3bXioJ.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://studio.eloqnt.dev/docs`:`https://studio.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,4 +1,4 @@
1
- import{t as e}from"./defineEloqntCommand-BNNDggcZ.mjs";import{n as t,t as n}from"./report-CEfrIjER.mjs";import{a as r,i,o as a,r as o,t as s}from"./stringWidth-DvyI3S_b.mjs";import{lint as c}from"@eloqnt/sdk";import l from"node:process";import u from"picocolors";import{relative as d,resolve as f}from"node:path";var p=e({meta:{name:`lint`,description:`Statically analyze your source code and messages for common problems.`},args:{strict:{type:`boolean`,description:`Exit with a non-zero code when warnings are found`,default:!1}},async execute({config:e,rootDir:t,args:n}){let{messages:r,srcPath:i}=e,o=await c({messagesPath:a(r.path,t),sourceLocale:r.sourceLocale,format:r.format,locales:r.locales,codes:r.codes,srcPath:i?a(i,t):void 0,rootDir:t}),s=l.cwd();return{issues:o.map(e=>{let t=e;if(t.location&&(t={...t,location:{...t.location,file:d(s,t.location.file)}}),t.rule===`undefined-key`&&t.sourceReferences?.length){let e=t.sourceReferences.map(e=>({...e,path:d(s,e.path)})),n=e[0].line?`${e[0].path}:${e[0].line}`:e[0].path,i=e.length>1?` (+${e.length-1} more)`:``;t={...t,sourceReferences:e,message:`Used in ${n}${i} but not defined for ${r.sourceLocale}`}}return t}),sourceLocale:r.sourceLocale,noSrcPath:!i,strict:!!n.strict}},render:({issues:e,sourceLocale:t,noSrcPath:n})=>{let r=h(e,t),i=n?`\n${u.dim("– Skipped source code analysis due to absent `srcPath`")}\n${r}`:r;return l.env.GITHUB_ACTIONS&&e.length>0?`${i}\n${_(e)}`:i},ok:({issues:e,strict:t})=>t?e.length===0:!e.some(e=>e.severity===`error`),json:({issues:e})=>e.map(e=>({...e,docsUrl:m(e.rule)}))});function m(e){return`https://studio.eloqnt.dev/docs/lint-rules/${e}`}function h(e,t){if(e.length===0)return`\n${u.green(`No issues found`)}\n`;let n=Object.groupBy(e,e=>e.location?.file??e.locale),r=x(Object.entries(n),t).map(([e,n])=>S(e,n,n[0].locale===t)),i=e.filter(e=>e.severity===`error`).length,a=e.length-i,o=[i>0&&u.bold(u.red(`✗ ${g(i,`error`)}`)),a>0&&u.bold(u.yellow(`! ${g(a,`warning`)}`))].filter(Boolean).join(`
1
+ import{t as e}from"./defineEloqntCommand-BNNDggcZ.mjs";import{n as t,t as n}from"./report-CEfrIjER.mjs";import{a as r,i,o as a,r as o,t as s}from"./stringWidth-DvyI3S_b.mjs";import{lint as c}from"@eloqnt/sdk";import l from"node:process";import u from"picocolors";import{relative as d,resolve as f}from"node:path";var p=e({meta:{name:`lint`,description:`Statically analyze your source code and messages for common problems.`},args:{strict:{type:`boolean`,description:`Exit with a non-zero code when warnings are found`,default:!1}},async execute({config:e,rootDir:t,args:n}){let{messages:r,srcPath:i}=e,o=await c({messagesPath:a(r.path,t),sourceLocale:r.sourceLocale,format:r.format,locales:r.locales,codes:r.codes,srcPath:i?a(i,t):void 0,rules:e.lint?.rules,overrides:e.lint?.overrides,rootDir:t}),s=l.cwd();return{issues:o.map(e=>{let t=e;if(t.location&&(t={...t,location:{...t.location,file:d(s,t.location.file)}}),t.rule===`undefined-key`&&t.sourceReferences?.length){let e=t.sourceReferences.map(e=>({...e,path:d(s,e.path)})),n=e[0].line?`${e[0].path}:${e[0].line}`:e[0].path,i=e.length>1?` (+${e.length-1} more)`:``;t={...t,sourceReferences:e,message:`Used in ${n}${i} but not defined for ${r.sourceLocale}`}}return t}),sourceLocale:r.sourceLocale,noSrcPath:!i,strict:!!n.strict}},render:({issues:e,sourceLocale:t,noSrcPath:n})=>{let r=h(e,t),i=n?`\n${u.dim("– Skipped source code analysis due to absent `srcPath`")}\n${r}`:r;return l.env.GITHUB_ACTIONS&&e.length>0?`${i}\n${_(e)}`:i},ok:({issues:e,strict:t})=>t?e.length===0:!e.some(e=>e.severity===`error`),json:({issues:e})=>e.map(e=>({...e,docsUrl:m(e.rule)}))});function m(e){return`https://studio.eloqnt.dev/docs/lint-rules/${e}`}function h(e,t){if(e.length===0)return`\n${u.green(`No issues found`)}\n`;let n=Object.groupBy(e,e=>e.location?.file??e.locale),r=x(Object.entries(n),t).map(([e,n])=>S(e,n,n[0].locale===t)),i=e.filter(e=>e.severity===`error`).length,a=e.length-i,o=[i>0&&u.bold(u.red(`✗ ${g(i,`error`)}`)),a>0&&u.bold(u.yellow(`! ${g(a,`warning`)}`))].filter(Boolean).join(`
2
2
  `),s=e.filter(e=>e.rule===`missing-translation`).length,c=[e.some(e=>e.rule!==`missing-translation`)&&u.dim(`→ Rule details: ${m(`<rule>`)}`),s>0&&u.dim(`→ Run \`eloqnt translate\` to fill in ${s} missing ${s===1?`translation`:`translations`}`)].filter(Boolean).join(`
3
3
  `);return`\n${[...r,o,c].filter(Boolean).join(`
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eloqnt/cli",
3
- "version": "0.6.8",
3
+ "version": "0.6.9",
4
4
  "description": "CLI for eloqnt/studio",
5
5
  "homepage": "https://studio.eloqnt.dev",
6
6
  "bin": {
@@ -26,7 +26,7 @@
26
26
  "citty": "^0.1.6",
27
27
  "open": "^11.0.0",
28
28
  "picocolors": "^1.1.1",
29
- "@eloqnt/sdk": "0.6.7"
29
+ "@eloqnt/sdk": "0.6.8"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/node": "^25.9.5"