@aurodesignsystem-dev/auro-cli 0.0.0-pr319.8 → 0.0.0-pr319.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/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
|
@@ -63,7 +63,7 @@ ${i.map(c=>` - ${c.replace("@aurodesignsystem","AlaskaAirlines").replace("@alas
|
|
|
63
63
|
`)}`).join(`
|
|
64
64
|
|
|
65
65
|
`);console.log(s),r.text="Running migrations on dependency batches...",new Promise(i=>setTimeout(i,2e3)),r.succeed("Migration process completed successfully.");break}default:console.error("Unknown action selected.")}});import{writeFile as ca}from"node:fs/promises";import la from"node:path";import nt from"node:process";import{Logger as Gn}from"@aurodesignsystem/auro-library/scripts/utils/logger.mjs";import{program as ua}from"commander";import ma from"ora";import{readFile as Mn}from"node:fs/promises";import ne from"node:path";import ra from"node:process";var na="https://unpkg.com",oa="https://registry.npmjs.org",or=1e4;function sa(e){let t=e.lastIndexOf("@");return t>0?{pkg:e.slice(0,t),ref:e.slice(t+1)}:{pkg:e}}function On(e,t){let r=ne.relative(e,t);return r===""||!r.startsWith("..")&&!ne.isAbsolute(r)}async function ia(e){let t=ne.join(ra.cwd(),"node_modules"),r=ne.join(t,...e.split("/"));if(!On(t,r))return null;let n,o="custom-elements.json";try{let s=JSON.parse(await Mn(ne.join(r,"package.json"),"utf-8"));typeof s.version=="string"&&(n=s.version),typeof s.customElements=="string"&&On(r,ne.resolve(r,s.customElements))&&(o=s.customElements)}catch{return null}try{let s=JSON.parse(await Mn(ne.join(r,o),"utf-8"));return{target:e,manifest:s,source:"local",version:n}}catch{return null}}async function M(e,t={}){let{preferLocal:r=!0,allowNetwork:n=!0}=t,{ref:o}=sa(e);if(r&&!o){let a=await ia(e);if(a)return{...a,target:e}}if(!n)return{target:e,manifest:null,reason:"not installed locally and network fetching is disabled"};let s=`${na}/${e}/custom-elements.json`,i;try{i=await fetch(s,{signal:AbortSignal.timeout(or)})}catch(a){let l=a instanceof DOMException&&a.name==="TimeoutError"?`timed out after ${or/1e3}s`:a instanceof Error?a.message:String(a);return{target:e,manifest:null,reason:`request failed (${l})`,transient:!0}}if(i.status===404)return{target:e,manifest:null,reason:"no custom-elements.json published"};if(!i.ok)return{target:e,manifest:null,reason:`HTTP ${i.status}`,transient:!0};try{return{target:e,manifest:await i.json(),source:"unpkg"}}catch{return{target:e,manifest:null,reason:"custom-elements.json is not valid JSON",transient:!0}}}function _n(e){let t=e.filter(r=>!r.manifest);return{skipped:t,transientFailures:t.filter(r=>r.transient)}}async function jn(e){try{let t=await fetch(`${oa}/${e}/latest`,{signal:AbortSignal.timeout(or)});if(!t.ok)return null;let r=await t.json();return typeof r.version=="string"?r.version:null}catch{return null}}import{Logger as aa}from"@aurodesignsystem/auro-library/scripts/utils/logger.mjs";function sr(e,t){if(Array.isArray(e))return e.map(r=>sr(r,t));if(e&&typeof e=="object"){let r=e,n={};for(let[o,s]of Object.entries(r))o==="module"&&typeof s=="string"&&r.package==null?n[o]=`${t}/${s}`:n[o]=sr(s,t);return n}return e}function Fn(e,t=aa.warn){let r=[];for(let{pkg:o,manifest:s}of e)for(let i of s.modules??[]){let a=sr(i,o);typeof i.path=="string"&&(a.path=`${o}/${i.path}`),r.push(a)}let n=new Set(e.map(o=>o.manifest.schemaVersion).filter(Boolean));return n.size>1&&t(`Merging mixed CEM schema versions: ${[...n].join(", ")}`),{schemaVersion:e[0]?.manifest.schemaVersion??"1.0.0",modules:r}}async function Ln(e,t={}){let r=await Promise.all(e.map(i=>M(i,t))),n=[];for(let i of r)i.manifest&&n.push({pkg:i.target,manifest:i.manifest});let{skipped:o,transientFailures:s}=_n(r);return{manifest:Fn(n),sources:n,skipped:o,transientFailures:s}}async function pa(e){let t=ma(`Fetching manifests for ${N.length} components...`).start(),{manifest:r,sources:n,skipped:o,transientFailures:s}=await Ln(N,{preferLocal:!1});n.length===0&&(t.fail("No component manifests could be fetched."),nt.exit(1));let i=la.resolve(nt.cwd(),e.output);try{await ca(i,`${JSON.stringify(r,null,2)}
|
|
66
|
-
`,"utf-8")}catch(a){let c=a instanceof Error?a.message:String(a);t.fail(`Failed to write ${e.output}: ${c}`),nt.exit(1)}t.succeed(`Aggregated ${n.length}/${N.length} component manifests (${r.modules?.length??0} modules) to ${e.output}`);for(let a of o)a.transient||Gn.info(`Skipped ${a.target}: ${a.reason}`);s.length>0&&(Gn.error(`${s.length} component(s) failed to fetch transiently; the aggregate may be incomplete. Re-run to retry.`),nt.exit(1))}var Wd=ua.command("cem").description("Fetch every published Auro component's custom-elements.json and merge them into a single aggregated manifest").option("-o, --output <file>","Path to write the aggregated manifest","custom-elements.aggregate.json").action(pa);import{readFileSync as no}from"node:fs";import{dirname as sc,join as ic,resolve as oo}from"node:path";import mt from"node:process";import{program as ac}from"commander";import cc from"ora";import{mkdtempSync as da,rmSync as fa}from"node:fs";import{tmpdir as ga}from"node:os";import{join as ha}from"node:path";function ar(e){return e.replace(/(['"`])(?:\\.|(?!\1)[\s\S])*\1/gu," ")}function cr(e){let t={")":"(","]":"[","}":"{",">":"<"},r=[],n="";for(let o of ar(e)){if(o===">"&&n==="="){n=o;continue}if(o==="("||o==="["||o==="{"||o==="<")r.push(o);else if((o===")"||o==="]"||o==="}"||o===">")&&r.pop()!==t[o])return!1;n=o}return r.length===0}function ir(e){let t=e.type?.text;if(typeof t=="string"&&t!==""&&!cr(t)){let{type:r,...n}=e;return n}return e}function lr(e,t){let{fieldName:r,description:n}=e;if(typeof r!="string"||r===""||typeof n=="string"&&n!=="")return!1;if(!t.has(r))return!0;let o=t.get(r);return o==="private"||o==="protected"}function ya(e){let t=o=>typeof o.name=="string",r=e.members?.filter(t).map(ir),n=new Map((r??[]).map(o=>[o.name,o.privacy]));return{...e,...r&&{members:r},...e.attributes&&{attributes:e.attributes.filter(t).filter(o=>!lr(o,n)).map(ir)},...e.slots&&{slots:e.slots.filter(t)},...e.events&&{events:e.events.filter(t).map(ir)},...e.cssParts&&{cssParts:e.cssParts.filter(t)},...e.cssProperties&&{cssProperties:e.cssProperties.filter(t)}}}function ur(e,t){return t.get(e.tagName)??e.tagName}function Un(e){return new Map(e.map(t=>[t.declaration.name,t.importPath]))}function ue(e,t){return{schemaVersion:"1.0.0",modules:e.map(r=>{let n=ya({...r.declaration,tagName:t?ur(r,t):r.tagName});return{kind:"javascript-module",path:r.importPath,declarations:[n],exports:[{kind:"js",name:n.name,declaration:{name:n.name,module:r.importPath}}]}})}}function z(e){let t=da(ha(ga(),"auro-editors-"));try{return e(t)}finally{fa(t,{recursive:!0,force:!0,maxRetries:10,retryDelay:100})}}function K(e){return e.endsWith(`
|
|
66
|
+
`,"utf-8")}catch(a){let c=a instanceof Error?a.message:String(a);t.fail(`Failed to write ${e.output}: ${c}`),nt.exit(1)}t.succeed(`Aggregated ${n.length}/${N.length} component manifests (${r.modules?.length??0} modules) to ${e.output}`);for(let a of o)a.transient||Gn.info(`Skipped ${a.target}: ${a.reason}`);s.length>0&&(Gn.error(`${s.length} component(s) failed to fetch transiently; the aggregate may be incomplete. Re-run to retry.`),nt.exit(1))}var Wd=ua.command("cem").description("Fetch every published Auro component's custom-elements.json and merge them into a single aggregated manifest").option("-o, --output <file>","Path to write the aggregated manifest","custom-elements.aggregate.json").action(pa);import{readFileSync as no}from"node:fs";import{dirname as sc,join as ic,resolve as oo}from"node:path";import mt from"node:process";import{program as ac}from"commander";import cc from"ora";import{mkdtempSync as da,rmSync as fa}from"node:fs";import{tmpdir as ga}from"node:os";import{join as ha}from"node:path";function ar(e){return e.replace(/(['"`])(?:\\.|(?!\1)[\s\S])*\1/gu," ")}function cr(e){let t={")":"(","]":"[","}":"{",">":"<"},r=[],n="";for(let o of ar(e)){if(o===">"&&n==="="){n=o;continue}if(o==="("||o==="["||o==="{"||o==="<")r.push(o);else if((o===")"||o==="]"||o==="}"||o===">")&&r.pop()!==t[o])return!1;n=o}return r.length===0}function ir(e){let t=e.type?.text;if(typeof t=="string"&&t!==""&&!cr(t)){let{type:r,...n}=e;return n}return e}function lr(e,t){let{fieldName:r,description:n}=e;if(typeof r!="string"||r===""||typeof n=="string"&&n!=="")return!1;if(!t.has(r))return!0;let o=t.get(r);return o==="private"||o==="protected"}function ya(e){let t=o=>typeof o.name=="string",r=e.members?.filter(t).map(ir),n=new Map((r??[]).map(o=>[o.name,o.privacy]));return{...e,...r&&{members:r},...e.attributes&&{attributes:e.attributes.filter(t).filter(o=>!lr(o,n)).map(ir)},...e.slots&&{slots:e.slots.filter(t)},...e.events&&{events:e.events.filter(t).map(ir)},...e.cssParts&&{cssParts:e.cssParts.filter(t)},...e.cssProperties&&{cssProperties:e.cssProperties.filter(t)}}}function ur(e,t){return t.get(e.tagName)??e.tagName}function Un(e){return new Map(e.map(t=>[t.declaration.name,t.importPath]))}function ue(e,t){return{schemaVersion:"1.0.0",modules:e.map(r=>{let n=ya({...r.declaration,tagName:t?ur(r,t):r.tagName});return{kind:"javascript-module",path:r.importPath,declarations:[n],exports:[{kind:"js",name:n.name,declaration:{name:n.name,module:r.importPath}}]}})}}function z(e){let t=da(ha(ga(),"auro-editors-"));try{return e(t)}finally{try{fa(t,{recursive:!0,force:!0,maxRetries:10,retryDelay:100})}catch{}}}function K(e){return e.endsWith(`
|
|
67
67
|
`)?e:`${e}
|
|
68
68
|
`}var ba=` /** Identifies the currently active descendant of a composite widget. */
|
|
69
69
|
"aria-activedescendant"?: string;
|