@aurodesignsystem-dev/auro-cli 0.0.0-pr302.3 → 0.0.0-pr302.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/auro-cli.js +1 -1
- package/dist/auro-cli.js.map +2 -2
- package/package.json +1 -1
package/dist/auro-cli.js
CHANGED
|
@@ -147,7 +147,7 @@ document.querySelector('#confirmDialog').show();
|
|
|
147
147
|
${r}
|
|
148
148
|
|
|
149
149
|
${go}`}var kc=tt(fo);function b(r){return(r??"").replace(/\s+/gu," ").trim()}async function bo(r){let t=new Map;for(let s of Qe)t.set(s.tag,{...s});let e=await Promise.all(x.map(s=>j(s,{allowNetwork:r}))),n=new Map,o=0;for(let s of e){if(!s.manifest)continue;s.source==="local"&&s.version&&n.set(s.target,s.version);let i=(s.manifest.modules??[]).flatMap(a=>a.declarations??[]).filter(a=>a.customElement&&a.tagName);for(let a of i){let c=a.tagName,m=b(a.summary||a.description),d=t.get(c);t.set(c,{tag:c,pkg:s.target,description:m||d?.description||""}),m&&(o+=1)}}return{rows:et([...t.values()]),enriched:o,local:n}}async function ko(r){let t=rt("Checking for newer component releases...").start(),e=[...r.entries()],n=await Promise.all(e.map(([s])=>rr(s))),o=[];if(e.forEach(([s,i],a)=>{let c=n[a];c&&c!==i&&o.push(` ${s}: installed ${i}, latest ${c}`)}),o.length===0){t.succeed("All installed Auro components are on the latest release.");return}t.warn(`${o.length} installed Auro component(s) are not on the latest release:`),console.error(o.join(`
|
|
150
|
-
`))}var Ic=wo.command("context").description("Generate an AI assistant context document for the Auro Design System").option("-o, --output <path>","Write context to a file instead of stdout (e.g. AURO_CONTEXT.md)").option("--offline","Skip network fetches; use locally installed manifests and the built-in table",!1).action(async r=>{let t=!r.offline,e=rt(t?"Resolving component manifests...":"Reading installed component manifests...").start(),{rows:n,enriched:o,local:s}=await bo(t),i=tt(n);if(o>0?e.succeed(
|
|
150
|
+
`))}var Ic=wo.command("context").description("Generate an AI assistant context document for the Auro Design System").option("-o, --output <path>","Write context to a file instead of stdout (e.g. AURO_CONTEXT.md)").option("--offline","Skip network fetches; use locally installed manifests and the built-in table",!1).action(async r=>{let t=!r.offline,e=rt(t?"Resolving component manifests...":"Reading installed component manifests...").start(),{rows:n,enriched:o,local:s}=await bo(t),i=tt(n);if(t?o>0?e.succeed(`Enriched ${o} component description(s) (${s.size} from local node_modules).`):e.warn("No manifests available; using the built-in component table."):s.size>0?e.succeed(o>0?`Read ${s.size} installed component manifest(s) from local node_modules; enriched ${o} description(s).`:`Read ${s.size} installed component manifest(s) from local node_modules; none documented a description, using the built-in table.`):e.warn("No installed component manifests found; using the built-in component table."),r.output){let a=rt(`Writing context to ${r.output}...`).start();try{let c=yo.resolve(process.cwd(),r.output);await ho.writeFile(c,i,"utf-8"),a.succeed(`Auro context written to ${r.output}`),console.log(`
|
|
151
151
|
Paste this file into your AI coding tool (Claude, Cursor, Copilot, etc.) to prime it on Auro components.`)}catch(c){let m=c instanceof Error?c.message:String(c);a.fail(`Failed to write context: ${m}`),process.exit(1)}}else process.stdout.write(i);t&&s.size>0&&await ko(s)});import be from"node:process";import{Logger as $o}from"@aurodesignsystem/auro-library/scripts/utils/logger.mjs";import{program as Ao}from"commander";import Eo from"ora";var nr="@aurodesignsystem";function Co(r){let t=r.trim();if(t.startsWith("@"))return t;let e=t.toLowerCase();return e.startsWith("auro-")?`${nr}/${e}`:`${nr}/auro-${e}`}function vo(r){return r.replace(/-([a-z])/gu,(t,e)=>e.toUpperCase())}function or(r){return r?typeof r=="string"?` [deprecated: ${b(r)}]`:" [deprecated]":""}function M(r){if(r.length===0)return" (none)";let t=Math.max(...r.map(([e])=>e.length));return r.map(([e,n])=>` ${e.padEnd(t)} ${n}`.trimEnd()).join(`
|
|
152
152
|
`)}function To(r,t){let e=[];e.push(`${t.tagName} (${r})`);let n=t.summary||t.description;n&&e.push(b(n));let o=t.superclass?.name?`${t.name} extends ${t.superclass.name}`:t.name;e.push(`Class: ${o}`),e.push(""),e.push("Install:"),e.push(` npm i ${r}`),e.push(` import "${r}";`);let s=t.attributes??[];e.push(""),e.push(`Attributes (${s.length}):`),e.push(M(s.map(u=>{let p=u.type?.text?` {${b(u.type.text)}}`:"",f=u.default?` = ${b(u.default)}`:"";return[u.name,`${b(u.description)}${p}${f}${or(u.deprecated)}`.trim()]})));let i=new Set(s.flatMap(u=>u.fieldName?[u.fieldName]:[u.name,vo(u.name)])),a=(t.members??[]).filter(u=>(u.privacy===void 0||u.privacy==="public")&&!u.static&&!(u.kind==="field"&&i.has(u.name)));e.push(""),e.push(`Properties & Methods (${a.length}):`),e.push(M(a.map(u=>{let p=u.kind==="method",f=p?`${u.name}()`:u.name,g=p?u.return?.type?.text:u.type?.text,k=g?` {${b(g)}}`:"",D=!p&&u.default?` = ${b(u.default)}`:"";return[f,`${b(u.description)}${k}${D}${or(u.deprecated)}`.trim()]})));let c=t.slots??[];e.push(""),e.push(`Slots (${c.length}):`),e.push(M(c.map(u=>[u.name||"(default)",b(u.description)])));let m=t.events??[];e.push(""),e.push(`Events (${m.length}):`),e.push(M(m.map(u=>{let p=u.type?.text?` {${b(u.type.text)}}`:"";return[u.name,`${b(u.description)}${p}`.trim()]})));let d=t.cssParts??[];d.length>0&&(e.push(""),e.push(`CSS Parts (${d.length}):`),e.push(M(d.map(u=>[u.name,b(u.description)]))));let l=t.cssProperties??[];return l.length>0&&(e.push(""),e.push(`CSS Custom Properties (${l.length}):`),e.push(M(l.map(u=>[u.name,b(u.description)])))),e.join(`
|
|
153
153
|
`)}var Bc=Ao.command("component <name>").description("Look up an Auro component's API (attributes, properties, slots, events, CSS parts) from its published Custom Elements Manifest").option("-t, --tag <version>","npm dist-tag or version to look up (default: latest)").option("--json","Output the raw manifest declaration(s) as JSON",!1).action(async(r,t)=>{let e=Co(r),n=t.tag?`${e}@${t.tag}`:e,o=Eo(`Fetching ${n}...`).start(),s=await j(n);s.manifest||(o.fail(s.transient?`Failed to fetch ${n}: ${s.reason}.`:`No custom-elements.json published for ${n}. It may not exist or may not publish a manifest yet.`),be.exit(1));let a=(s.manifest.modules??[]).flatMap(m=>m.declarations??[]).filter(m=>m.customElement&&m.tagName);a.length===0&&(o.fail(`No registered custom elements found for ${n}.`),be.exit(1));let c=s.source==="local"?` (local${s.version?` v${s.version}`:""})`:" (unpkg)";if(o.succeed(`${n} \u2014 ${a.length} custom element${a.length===1?"":"s"}${c}`),t.json){be.stdout.write(`${JSON.stringify(a,null,2)}
|