@aurodesignsystem-dev/auro-cli 0.0.0-pr79.1 → 0.0.0-pr81.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import{program as Z}from"commander";import Re from"figlet";import{mind as Be}from"gradient-string";var ee=()=>Be(Re.textSync("Auro CLI"));import te from"node:fs";import re from"node:path";import{fileURLToPath as Ie}from"node:url";function P(e){process.env.DEBUG&&console.log(`[DEBUG] ${e}`)}function U(){try{let e=Ie(import.meta.url),t=re.dirname(e);P(`Current module path: ${t}`);let r=re.resolve(t,"..","package.json");return P(`Checking package.json at: ${r}`),te.existsSync(r)?(P(`Found package.json at: ${r}`),JSON.parse(te.readFileSync(r,"utf8")).version):(P("Could not find package.json in the standard installed module location, using default version"),"0.0.0")}catch(e){return console.error("Error retrieving package version:",e),"0.0.0"}}import{program as ut}from"commander";import he from"ora";function A(e,{watch:t=!1}){return e.option("-m, --module-paths [paths...]","Path(s) to node_modules folder").option("--watch","Watch for changes - default for dev mode, opt-in for build",t).option("--skip-docs","Skip documentation generation",!1).option("--wca-input [files...]","Source file(s) to analyze for API documentation").option("--wca-output [files...]","Output file(s) for API documentation")}function oe(e){return e.option("-p, --port <number>","Port for the dev server").option("-o, --open","Open the browser after starting the server")}import at from"@rollup/plugin-terser";import{watch as ct}from"rollup";import{rmSync as We}from"node:fs";import{join as He}from"node:path";import W from"ora";import{rollup as M}from"rollup";import{spawn as Oe}from"node:child_process";import Fe from"ora";var w=(e,t)=>{let r=`${e} ${t?t.join(" "):""}`,o=Fe(),n=e,i=t||[];if(!t&&typeof e=="string"){let d=e.split(" ");n=d[0],i=d.slice(1)}let s=r.includes("--watch")||r.includes(" -w"),c=Oe(n,i,{stdio:s?"inherit":["inherit","pipe","pipe"],shell:!0});if(!s){let d=[];c.stdout?.on("data",l=>{let a=l.toString();d.push(a),process.stdout.write(a)}),c.stderr?.on("data",l=>{let a=l.toString();d.push(a),process.stderr.write(a)})}return new Promise((d,l)=>{c.on("close",a=>{a!==0?s?(o.info(`Watch mode terminated with code ${a}`),d()):(o.fail(`${r} failed (code ${a})`),l(new Error(`Command failed with exit code ${a}`))):(o.succeed(`${r} completed successfully`),d())})})};async function _(e,t){w(`npx wca analyze ${e||"scripts/wca/*"} --outFiles ${t||"docs/api.md"}`)}import{Logger as Ne}from"@aurodesignsystem/auro-library/scripts/utils/logger.mjs";import{generateReadmeUrl as je,processContentForFile as Le,templateFiller as ne}from"@aurodesignsystem/auro-library/scripts/utils/sharedFileProcessorUtils.mjs";var Ge={overwriteLocalCopies:!0,remoteReadmeVersion:"master",remoteReadmeVariant:"_updated_paths"};function E(e){return`${process.cwd()}/${e}`}var Ue=e=>[{identifier:"README.md",input:{remoteUrl:je(e.remoteReadmeVersion,e.remoteReadmeVariant),fileName:E("/docTemplates/README.md"),overwrite:e.overwriteLocalCopies},output:E("/README.md")},{identifier:"index.md",input:E("/docs/partials/index.md"),output:E("/demo/index.md"),mdMagicConfig:{output:{directory:E("/demo")}}},{identifier:"api.md",input:E("/docs/partials/api.md"),output:E("/demo/api.md"),preProcessors:[ne.formatApiTable]}];async function Me(e=Ge){await ne.extractNames();for(let t of Ue(e))try{await Le(t)}catch(r){Ne.error(`Error processing ${t.identifier}: ${r.message}`)}}async function ie(){await Me()}function se(){let e=He("./dist"),t=W("Cleaning dist folder...").start();try{return We(e,{recursive:!0,force:!0}),t.succeed("All clean! Dist folder wiped."),!0}catch(r){return t.fail(`Oops! Couldn't clean dist/ folder: ${r.message}`),console.error(r),!1}}async function H(e,t,r,o){let n=W(e).start();try{let i=await t();return n.succeed(r),i}catch(i){throw n.fail(o),console.error(`Error: ${i.message}`),i}}async function ae(e,t){return H("Creating type definitions...",async()=>{let r=await M(e);await r.write(t),await r.close()},"Types files built.","Darn! Type definitions failed.")}async function ce(e,t){return H(`Bundling ${e.name||"main"} and ${t.name||"demo"}...`,async()=>{let r=await M(e);await r.write(e.output),await r.close();let o=await M(t);await o.write(t.output),await o.close()},`Bundles ready! ${e.name||"Main"} and ${t.name||"demo"} built.`,"Bundle hiccup! Build failed.")}async function R(e){let{wcaInput:t,wcaOutput:r,skipDocs:o}=e;if(o){let n=W("Skipping docs generation...").start();setTimeout(()=>{n.succeed("Docs generation skipped.")},0);return}return H("Analyzing components and making docs...",async()=>{await _(t,r),await ie()},"Docs ready! Looking good.","Doc troubles!")}import{basename as Ve}from"node:path";import{nodeResolve as Je}from"@rollup/plugin-node-resolve";import{glob as Ye}from"glob";import{dts as Ke}from"rollup-plugin-dts";import{litScss as Xe}from"rollup-plugin-scss-lit";import ze from"node:path";import{glob as qe}from"glob";function me(e){return{name:"watch-globs",buildStart(){let t=Array.isArray(e)?e:[e];for(let r of t)try{for(let o of qe.sync(ze.resolve(r)))this.addWatchFile(o)}catch(o){this.error(`Error watching glob pattern "${r}": ${o.message}`)}}}}var z={moduleDirectories:["node_modules"],modulePaths:["../../node_modules","../node_modules","node_modules"],watchPatterns:["./apiExamples/**/*","./docs/**/*"]};function le(e=[],t={}){let{watchPatterns:r=z.watchPatterns,dedupe:o=["lit","lit-element","lit-html"]}=t,n=[...z.modulePaths,...e];return[Je({dedupe:o,preferBuiltins:!1,moduleDirectories:z.moduleDirectories}),Xe({minify:{fast:!0},options:{loadPaths:n}}),me(r)]}function q(e={}){let{modulePaths:t=[],watch:r=!1,input:o=["./src/index.js","./src/registered.js"],outputDir:n="./dist",format:i="esm"}=e;return{name:"Main",config:{input:o,output:{format:i,dir:n,entryFileNames:"[name].js"},external:Qe(),plugins:le(t),watch:ue(r)}}}function V(e={}){let{modulePaths:t=[],watch:r=!1,globPattern:o="./demo/*.js",ignorePattern:n=["./demo/*.min.js"],outputDir:i="./demo"}=e;return{name:"Demo",config:{input:Object.fromEntries(Ye.sync(o,{ignore:n}).map(s=>[Ve(s,".js"),s])),output:{format:"esm",dir:i,entryFileNames:"[name].min.js",chunkFileNames:"[name].min.js"},plugins:le(t),watch:ue(r)}}}function C(e={}){let{input:t=["./dist/index.js"],outputDir:r="./dist"}=e;return{name:"DTS",config:{input:t,output:{format:"esm",dir:r,entryFileNames:"[name].d.ts"},plugins:[Ke()]}}}function ue(e){if(!e)return!1;let t=typeof e=="object"?e:{};return{clearScreen:t.clearScreen??!0,buildDelay:t.buildDelay??500,chokidar:{ignoreInitial:!0,ignored:t.ignored??["**/dist/**/*.d.ts","**/custom-elements.json","**/demo/*.md","**/demo/**/*.min.js","**/docs/api.md","**/node_modules/**","**/.git/**"],awaitWriteFinish:t.awaitWriteFinish??{stabilityThreshold:1e3,pollInterval:100}},include:t.include??["./src/**/*.js","./src/**/*.ts","./demo/**/*.js","./apiExamples/**/*","./docs/**/*.md"],exclude:t.exclude??["./dist/**/*","./node_modules/**/*"]}}function Qe(e=[]){return[...[/node_modules\/lit/,/node_modules\/lit-element/,/node_modules\/lit-html/,/node_modules\/@lit/],...e]}import{startDevServer as Ze}from"@web/dev-server";import{hmrPlugin as et}from"@web/dev-server-hmr";import tt from"ora";var v={watch:!0,nodeResolve:!0,basePath:"/",rootDir:"./demo",hmrInclude:["src/**/*","demo/**/*","apiExamples/**/*","docs/**/*"]};async function de(e={}){let t=tt(`Firing up dev server...
3
- `).start();try{let r={port:Number(e.port)||void 0,open:e.open?"/":void 0,watch:e.watch??v.watch,nodeResolve:e.nodeResolve??v.nodeResolve,basePath:e.basePath??v.basePath,rootDir:e.rootDir??v.rootDir,middleware:[function(i,s){return!i.url.endsWith("/")&&!i.url.includes(".")&&(i.url+=".html"),s()}],plugins:[et({include:e.hmrInclude??v.hmrInclude})]},o=await Ze({config:r,readCliArgs:!1,readFileConfig:!1});return t.stop(),o}catch(r){throw t.fail("Server snag! Couldn't start dev server."),console.error("Error starting development server:",r),new Error(`Development server failed to start: ${r.message}`)}}import pe from"node:path";import b from"ora";import{rollup as rt}from"rollup";var B=!1,ot={dts:{active:!1,lastTime:0},analyze:{active:!1,lastTime:0},docs:{active:!1,lastTime:0}},nt=5e3,I=new Set,it=["/dist/index.d.ts","/custom-elements.json","/demo/api.md","/docs/api.md","/demo/index.min.js"];function st(e){if(!e||typeof e!="string")return!1;try{let t=pe.normalize(e);return it.some(r=>t.endsWith(r))||t.includes("/dist/")||t.endsWith(".min.js")||t.endsWith(".d.ts")}catch(t){return console.error(`Error checking path (${typeof e}):`,t.message),!1}}async function J(e,t){let r=ot[e];if(r.active||Date.now()-r.lastTime<nt)return!1;try{return r.active=!0,r.lastTime=Date.now(),await t()}catch(o){return console.error(`Error in ${e} task:`,o),!1}finally{r.active=!1}}async function fe(e,t,r){let o=!0,n={dts:!1,analyze:!1,docs:!1},i=null,s,m=b("Activating watch mode...").start(),c={dts:async()=>{let a=b("Crafting type definitions...").start();try{let u=await rt(C().config);return await u.write(C().config.output),await u.close(),a.succeed("Type files built."),!0}catch(u){return a.fail("Types trouble! Build failed."),console.error("TypeScript definition build error:",u),!1}},analyze:async()=>{let{wcaInput:a,wcaOutput:u,skipDocs:h}=t;if(h){let y=b("Skipping component analysis...").start();return setTimeout(()=>{y.succeed("Component analysis skipped.")},0),!0}let x=b("Detective work: analyzing components...").start();try{return await _(a,u),x.succeed("Component analysis complete! API generated."),!0}catch(y){return x.fail("Analysis hiccup! Something went wrong."),console.error("Component analysis error:",y),!1}},docs:async()=>{if(B)return!1;if(t.skipDocs){let u=b("Skipping docs generation...").start();return setTimeout(()=>{u.succeed("Docs generation skipped.")},0),!0}let a=b("Refreshing docs...").start();try{return await R(t),a.succeed("Documentation refreshed!"),!0}catch(u){a.fail("Docs stumble! Couldn't refresh."),console.error("Documentation rebuild error:",u)}}},d=()=>{o&&n.dts&&n.analyze&&n.docs&&typeof r=="function"&&(o=!1,r())};function l(a=1e3){i&&clearTimeout(i),i=setTimeout(async()=>{n.dts=await J("dts",c.dts),setTimeout(async()=>{n.analyze=await J("analyze",c.analyze),setTimeout(async()=>{n.docs=await J("docs",c.docs),d()},1e3)},1e3)},a)}e.on("event",async a=>{switch(a.code){case"START":m.succeed("Watch mode active! Eyes peeled.");break;case"BUNDLE_START":if(I.clear(),a.input)try{let u=Array.isArray(a.input)?a.input:typeof a.input=="string"?[a.input]:typeof a.input=="object"&&a.input!==null?Object.values(a.input):[];for(let h of u)typeof h=="string"&&!st(h)&&I.add(pe.normalize(h))}catch(u){console.error("Error processing input paths:",u)}s=b("Weaving bundles...").start(),B=!0;break;case"BUNDLE_END":s&&s.succeed(`Bundle ${Array.isArray(a.input)?`of ${a.input.join("& ")} `:""}done in ${a.duration}ms! \u{1F680}`),B=!1,I.size>0&&l();break;case"END":break;case"ERROR":B=!1,s?s.fail(`Oops! Bundle hit a snag: ${a.error.message}`):b().fail(`Watch mode hiccup: ${a.error.message}`),I.clear();break}})}function ge(e){return process.on("SIGINT",()=>{let t=b("Wrapping up...").start();e.close(),t.succeed("All done! See you next time. \u2728"),process.exit(0)}),e}async function mt(e){let t=q(e),r=V(e),o=C();t.config.plugins.push(at()),await R(e),await ce(t.config,r.config),await ae(o.config,o.config.output)}async function lt(e){let{dev:t}=e,r=q({...e,watch:!0}),o=V({...e,watch:!0}),n=ct([r.config,o.config]);return fe(n,e,t?async()=>de(e):void 0),ge(n),n}async function O(e={}){try{let{dev:t=!1,watch:r=t}=e;return se(),!t&&!r?await mt(e):await lt(e)}catch(t){throw new Error(`Build failed: ${t.message}`)}}var k=ut.command("dev").description("Runs development server for auro components");k=A(k,{watch:!0});k=oe(k);var Zr=k.action(async e=>{try{let t=he("Initializing...");e.watch?(t.text="Waiting for changes...",t.spinner="bouncingBar",t.color="green"):t.text=e.docs===!1?"Building component (docs disabled)":"Building component",t.start(),await O({...e,dev:!0,watch:!0})}catch(t){he().fail(`Build failed: ${t.message}`),console.error(t),process.exit(1)}});import{program as dt}from"commander";import ye from"ora";var Y=dt.command("build").description("Builds auro components");Y=A(Y,{watch:!1});var io=Y.action(async e=>{try{let t=ye("Initializing...");e.watch?(t.text="Waiting for changes...",t.spinner="bouncingBar",t.color="green"):t.text=e.docs===!1?"Building component (docs disabled)":"Building component",t.start(),await O(e),e.watch||t.succeed("Build completed!")}catch(t){ye().fail(`Build failed: ${t.message}`),console.error(t),process.exit(1)}});import{exec as pt}from"node:child_process";import we from"node:path";import ft from"node:process";import{fileURLToPath as gt}from"node:url";import ht from"node:util";import{program as yt}from"commander";import wt from"inquirer";var ho=yt.command("migrate").description("Script runner to perform repetitive code change tasks").requiredOption("-i, --id <string>","Select the migration you would like to run by id").option("-m, --multi-gitter","Run the migration on all repositories in the multi-gitter config").action(async e=>{let t=gt(import.meta.url),r=we.dirname(t),o=we.resolve(r,"migrations",e.id);if(e.multiGitter){let n=ht.promisify(pt);try{await n("command -v multi-gitter")}catch{console.error("multi-gitter is not installed."),ft.exit(1)}(await wt.prompt([{type:"confirm",name:"dryRun",message:"Run migration in dry-run mode? (no changes will be committed)",default:!0}])).dryRun?w(`multi-gitter run ${o}/script.sh --config "${o}/multi-gitter.yml" --dry-run`):w(`multi-gitter run ${o}/script.sh --config "${o}/multi-gitter.yml"`)}else w(`${o}/script.sh`)});import Dt from"node:process";import{program as St}from"commander";import{readFile as Pt,writeFile as At}from"node:fs/promises";import{Logger as X}from"@aurodesignsystem/auro-library/scripts/utils/logger.mjs";import bt from"node:fs/promises";import{Logger as $}from"@aurodesignsystem/auro-library/scripts/utils/logger.mjs";import{processContentForFile as $t,templateFiller as xt}from"@aurodesignsystem/auro-library/scripts/utils/sharedFileProcessorUtils.mjs";var K="https://raw.githubusercontent.com/AlaskaAirlines/auro-templates",be="main",Et="main",Tt="default",$e={ISSUE_TEMPLATE:["bug_report.yaml","config.yml","feature_request.yaml","general-support.yaml","group.yaml","story.yaml","task.yaml"],workflows:["codeql.yml","publishDemo.yml","testPublish.yml"],_root:["CODEOWNERS","CODE_OF_CONDUCT.md","CONTRIBUTING.md","PULL_REQUEST_TEMPLATE.md","SECURITY.md","settings.yml","stale.yml"]};function Ct(e,t){return e.startsWith("v")&&/^\d+\.\d+\.\d+(?<_>-.*)?$/u.test(e.slice(1))?`${K}/refs/tags/${e}/${t}`:e!==be?`${K}/refs/heads/${e}/${t}`:`${K}/${be}/${t}`}function vt(e,t,r){let o=Ct(t,e);return{identifier:e.split("/").pop(),input:{remoteUrl:o,fileName:r,overwrite:!0},output:r,overwrite:!0}}async function kt(e){try{await bt.rm(e,{recursive:!0,force:!0}),$.log(`Successfully removed directory: ${e}`)}catch(t){throw $.error(`Error removing directory ${e}: ${t.message}`),t}}async function xe(e){e||($.error("Root directory must be specified"),process.exit(1));let t=".github";try{await kt(t),$.log(".github directory removed successfully")}catch(n){$.error(`Error removing .github directory: ${n.message}`),process.exit(1)}await xt.extractNames();let r=[],o=[];for(let n of Object.keys($e))for(let i of $e[n]){let s=`${n==="_root"?"":`${n}/`}${i}`,m=`${e}/.github/${s}`,c=vt(`templates/${Tt}/.github/${s}`,Et,m);r.push(c)}if(await Promise.all(r.map(async n=>{try{(await fetch(n.input.remoteUrl,{method:"HEAD"})).ok||o.push(n.input.remoteUrl)}catch{o.push(n.input.remoteUrl)}})),o.length>0){let n=o.map(i=>`File not found: ${i}`).join(`
2
+ import{program as Z}from"commander";import Re from"figlet";import{mind as Be}from"gradient-string";var ee=()=>Be(Re.textSync("Auro CLI"));import te from"node:fs";import re from"node:path";import{fileURLToPath as Ie}from"node:url";function P(e){process.env.DEBUG&&console.log(`[DEBUG] ${e}`)}function U(){try{let e=Ie(import.meta.url),t=re.dirname(e);P(`Current module path: ${t}`);let r=re.resolve(t,"..","package.json");return P(`Checking package.json at: ${r}`),te.existsSync(r)?(P(`Found package.json at: ${r}`),JSON.parse(te.readFileSync(r,"utf8")).version):(P("Could not find package.json in the standard installed module location, using default version"),"0.0.0")}catch(e){return console.error("Error retrieving package version:",e),"0.0.0"}}import{program as ut}from"commander";import he from"ora";function A(e,{watch:t=!1}){return e.option("-m, --module-paths [paths...]","Path(s) to node_modules folder").option("--watch","Watch for changes - default for dev mode, opt-in for build",t).option("--skip-docs","Skip documentation generation",!1).option("--wca-input [files...]","Source file(s) to analyze for API documentation").option("--wca-output [files...]","Output file(s) for API documentation")}function oe(e){return e.option("-p, --port <number>","Port for the dev server").option("-o, --open","Open the browser after starting the server")}import at from"@rollup/plugin-terser";import{watch as ct}from"rollup";import{rmSync as Me}from"node:fs";import{join as He}from"node:path";import M from"ora";import{rollup as W}from"rollup";import{spawn as Oe}from"node:child_process";import Fe from"ora";var w=(e,t)=>{let r=`${e} ${t?t.join(" "):""}`,o=Fe(),n=e,i=t||[];if(!t&&typeof e=="string"){let d=e.split(" ");n=d[0],i=d.slice(1)}let s=r.includes("--watch")||r.includes(" -w"),c=Oe(n,i,{stdio:s?"inherit":["inherit","pipe","pipe"],shell:!0});if(!s){let d=[];c.stdout?.on("data",l=>{let a=l.toString();d.push(a),process.stdout.write(a)}),c.stderr?.on("data",l=>{let a=l.toString();d.push(a),process.stderr.write(a)})}return new Promise((d,l)=>{c.on("close",a=>{a!==0?s?(o.info(`Watch mode terminated with code ${a}`),d()):(o.fail(`${r} failed (code ${a})`),l(new Error(`Command failed with exit code ${a}`))):(o.succeed(`${r} completed successfully`),d())})})};async function _(e,t){w(`npx wca analyze ${e||"scripts/wca/*"} --outFiles ${t||"docs/api.md"}`)}import{Logger as Ne}from"@aurodesignsystem/auro-library/scripts/utils/logger.mjs";import{generateReadmeUrl as je,processContentForFile as Le,templateFiller as ne}from"@aurodesignsystem/auro-library/scripts/utils/sharedFileProcessorUtils.mjs";var Ge={overwriteLocalCopies:!0,remoteReadmeVersion:"master",remoteReadmeVariant:"_updated_paths"};function E(e){return`${process.cwd()}/${e}`}var Ue=e=>[{identifier:"README.md",input:{remoteUrl:je(e.remoteReadmeVersion,e.remoteReadmeVariant),fileName:E("/docTemplates/README.md"),overwrite:e.overwriteLocalCopies},output:E("/README.md")},{identifier:"index.md",input:E("/docs/partials/index.md"),output:E("/demo/index.md"),mdMagicConfig:{output:{directory:E("/demo")}}},{identifier:"api.md",input:E("/docs/partials/api.md"),output:E("/demo/api.md"),preProcessors:[ne.formatApiTable]}];async function We(e=Ge){await ne.extractNames();for(let t of Ue(e))try{await Le(t)}catch(r){Ne.error(`Error processing ${t.identifier}: ${r.message}`)}}async function ie(){await We()}function se(){let e=He("./dist"),t=M("Cleaning dist folder...").start();try{return Me(e,{recursive:!0,force:!0}),t.succeed("All clean! Dist folder wiped."),!0}catch(r){return t.fail(`Oops! Couldn't clean dist/ folder: ${r.message}`),console.error(r),!1}}async function H(e,t,r,o){let n=M(e).start();try{let i=await t();return n.succeed(r),i}catch(i){throw n.fail(o),console.error(`Error: ${i.message}`),i}}async function ae(e,t){return H("Creating type definitions...",async()=>{let r=await W(e);await r.write(t),await r.close()},"Types files built.","Darn! Type definitions failed.")}async function ce(e,t){return H(`Bundling ${e.name||"main"} and ${t.name||"demo"}...`,async()=>{let r=await W(e);await r.write(e.output),await r.close();let o=await W(t);await o.write(t.output),await o.close()},`Bundles ready! ${e.name||"Main"} and ${t.name||"demo"} built.`,"Bundle hiccup! Build failed.")}async function R(e){let{wcaInput:t,wcaOutput:r,skipDocs:o}=e;if(o){let n=M("Skipping docs generation...").start();setTimeout(()=>{n.succeed("Docs generation skipped.")},0);return}return H("Analyzing components and making docs...",async()=>{await _(t,r),await ie()},"Docs ready! Looking good.","Doc troubles!")}import{basename as Ve}from"node:path";import{nodeResolve as Je}from"@rollup/plugin-node-resolve";import{glob as Ye}from"glob";import{dts as Ke}from"rollup-plugin-dts";import{litScss as Xe}from"rollup-plugin-scss-lit";import ze from"node:path";import{glob as qe}from"glob";function me(e){return{name:"watch-globs",buildStart(){let t=Array.isArray(e)?e:[e];for(let r of t)try{for(let o of qe.sync(ze.resolve(r)))this.addWatchFile(o)}catch(o){this.error(`Error watching glob pattern "${r}": ${o.message}`)}}}}var z={moduleDirectories:["node_modules"],modulePaths:["../../node_modules","../node_modules","node_modules"],watchPatterns:["./apiExamples/**/*","./docs/**/*"]};function le(e=[],t={}){let{watchPatterns:r=z.watchPatterns,dedupe:o=["lit","lit-element","lit-html"]}=t,n=[...z.modulePaths,...e];return[Je({dedupe:o,preferBuiltins:!1,moduleDirectories:z.moduleDirectories}),Xe({minify:{fast:!0},options:{loadPaths:n}}),me(r)]}function q(e={}){let{modulePaths:t=[],watch:r=!1,input:o=["./src/index.js","./src/registered.js"],outputDir:n="./dist",format:i="esm"}=e;return{name:"Main",config:{input:o,output:{format:i,dir:n,entryFileNames:"[name].js"},external:Qe(),plugins:le(t),watch:ue(r)}}}function V(e={}){let{modulePaths:t=[],watch:r=!1,globPattern:o="./demo/*.js",ignorePattern:n=["./demo/*.min.js"],outputDir:i="./demo"}=e;return{name:"Demo",config:{input:Object.fromEntries(Ye.sync(o,{ignore:n}).map(s=>[Ve(s,".js"),s])),output:{format:"esm",dir:i,entryFileNames:"[name].min.js",chunkFileNames:"[name].min.js"},plugins:le(t),watch:ue(r)}}}function v(e={}){let{input:t=["./dist/index.js"],outputDir:r="./dist"}=e;return{name:"DTS",config:{input:t,output:{format:"esm",dir:r,entryFileNames:"[name].d.ts"},plugins:[Ke()]}}}function ue(e){if(!e)return!1;let t=typeof e=="object"?e:{};return{clearScreen:t.clearScreen??!0,buildDelay:t.buildDelay??500,chokidar:{ignoreInitial:!0,ignored:t.ignored??["**/dist/**/*.d.ts","**/custom-elements.json","**/demo/*.md","**/demo/**/*.min.js","**/docs/api.md","**/node_modules/**","**/.git/**"],awaitWriteFinish:t.awaitWriteFinish??{stabilityThreshold:1e3,pollInterval:100}},include:t.include??["./src/**/*.js","./src/**/*.ts","./demo/**/*.js","./apiExamples/**/*","./docs/**/*.md"],exclude:t.exclude??["./dist/**/*","./node_modules/**/*"]}}function Qe(e=[]){return[...[/node_modules\/lit/,/node_modules\/lit-element/,/node_modules\/lit-html/,/node_modules\/@lit/],...e]}import{startDevServer as Ze}from"@web/dev-server";import{hmrPlugin as et}from"@web/dev-server-hmr";import tt from"ora";var C={watch:!0,nodeResolve:!0,basePath:"/",rootDir:"./demo",hmrInclude:["src/**/*","demo/**/*","apiExamples/**/*","docs/**/*"]};async function de(e={}){let t=tt(`Firing up dev server...
3
+ `).start();try{let r={port:Number(e.port)||void 0,open:e.open?"/":void 0,watch:e.watch??C.watch,nodeResolve:e.nodeResolve??C.nodeResolve,basePath:e.basePath??C.basePath,rootDir:e.rootDir??C.rootDir,middleware:[function(i,s){if(i.url.endsWith("coverage")){i.redirect("/coverage/index.html");return}return!i.url.endsWith("/")&&!i.url.includes(".")&&(i.url+=".html"),s()}],plugins:[et({include:e.hmrInclude??C.hmrInclude})]},o=await Ze({config:r,readCliArgs:!1,readFileConfig:!1});return t.stop(),o}catch(r){throw t.fail("Server snag! Couldn't start dev server."),console.error("Error starting development server:",r),new Error(`Development server failed to start: ${r.message}`)}}import pe from"node:path";import b from"ora";import{rollup as rt}from"rollup";var B=!1,ot={dts:{active:!1,lastTime:0},analyze:{active:!1,lastTime:0},docs:{active:!1,lastTime:0}},nt=5e3,I=new Set,it=["/dist/index.d.ts","/custom-elements.json","/demo/api.md","/docs/api.md","/demo/index.min.js"];function st(e){if(!e||typeof e!="string")return!1;try{let t=pe.normalize(e);return it.some(r=>t.endsWith(r))||t.includes("/dist/")||t.endsWith(".min.js")||t.endsWith(".d.ts")}catch(t){return console.error(`Error checking path (${typeof e}):`,t.message),!1}}async function J(e,t){let r=ot[e];if(r.active||Date.now()-r.lastTime<nt)return!1;try{return r.active=!0,r.lastTime=Date.now(),await t()}catch(o){return console.error(`Error in ${e} task:`,o),!1}finally{r.active=!1}}async function fe(e,t,r){let o=!0,n={dts:!1,analyze:!1,docs:!1},i=null,s,m=b("Activating watch mode...").start(),c={dts:async()=>{let a=b("Crafting type definitions...").start();try{let u=await rt(v().config);return await u.write(v().config.output),await u.close(),a.succeed("Type files built."),!0}catch(u){return a.fail("Types trouble! Build failed."),console.error("TypeScript definition build error:",u),!1}},analyze:async()=>{let{wcaInput:a,wcaOutput:u,skipDocs:h}=t;if(h){let y=b("Skipping component analysis...").start();return setTimeout(()=>{y.succeed("Component analysis skipped.")},0),!0}let x=b("Detective work: analyzing components...").start();try{return await _(a,u),x.succeed("Component analysis complete! API generated."),!0}catch(y){return x.fail("Analysis hiccup! Something went wrong."),console.error("Component analysis error:",y),!1}},docs:async()=>{if(B)return!1;if(t.skipDocs){let u=b("Skipping docs generation...").start();return setTimeout(()=>{u.succeed("Docs generation skipped.")},0),!0}let a=b("Refreshing docs...").start();try{return await R(t),a.succeed("Documentation refreshed!"),!0}catch(u){a.fail("Docs stumble! Couldn't refresh."),console.error("Documentation rebuild error:",u)}}},d=()=>{o&&n.dts&&n.analyze&&n.docs&&typeof r=="function"&&(o=!1,r())};function l(a=1e3){i&&clearTimeout(i),i=setTimeout(async()=>{n.dts=await J("dts",c.dts),setTimeout(async()=>{n.analyze=await J("analyze",c.analyze),setTimeout(async()=>{n.docs=await J("docs",c.docs),d()},1e3)},1e3)},a)}e.on("event",async a=>{switch(a.code){case"START":m.succeed("Watch mode active! Eyes peeled.");break;case"BUNDLE_START":if(I.clear(),a.input)try{let u=Array.isArray(a.input)?a.input:typeof a.input=="string"?[a.input]:typeof a.input=="object"&&a.input!==null?Object.values(a.input):[];for(let h of u)typeof h=="string"&&!st(h)&&I.add(pe.normalize(h))}catch(u){console.error("Error processing input paths:",u)}s=b("Weaving bundles...").start(),B=!0;break;case"BUNDLE_END":s&&s.succeed(`Bundle ${Array.isArray(a.input)?`of ${a.input.join("& ")} `:""}done in ${a.duration}ms! \u{1F680}`),B=!1,I.size>0&&l();break;case"END":break;case"ERROR":B=!1,s?s.fail(`Oops! Bundle hit a snag: ${a.error.message}`):b().fail(`Watch mode hiccup: ${a.error.message}`),I.clear();break}})}function ge(e){return process.on("SIGINT",()=>{let t=b("Wrapping up...").start();e.close(),t.succeed("All done! See you next time. \u2728"),process.exit(0)}),e}async function mt(e){let t=q(e),r=V(e),o=v();t.config.plugins.push(at()),await R(e),await ce(t.config,r.config),await ae(o.config,o.config.output)}async function lt(e){let{dev:t}=e,r=q({...e,watch:!0}),o=V({...e,watch:!0}),n=ct([r.config,o.config]);return fe(n,e,t?async()=>de(e):void 0),ge(n),n}async function O(e={}){try{let{dev:t=!1,watch:r=t}=e;return se(),!t&&!r?await mt(e):await lt(e)}catch(t){throw new Error(`Build failed: ${t.message}`)}}var k=ut.command("dev").description("Runs development server for auro components");k=A(k,{watch:!0});k=oe(k);var Zr=k.action(async e=>{try{let t=he("Initializing...");e.watch?(t.text="Waiting for changes...",t.spinner="bouncingBar",t.color="green"):t.text=e.docs===!1?"Building component (docs disabled)":"Building component",t.start(),await O({...e,dev:!0,watch:!0})}catch(t){he().fail(`Build failed: ${t.message}`),console.error(t),process.exit(1)}});import{program as dt}from"commander";import ye from"ora";var Y=dt.command("build").description("Builds auro components");Y=A(Y,{watch:!1});var io=Y.action(async e=>{try{let t=ye("Initializing...");e.watch?(t.text="Waiting for changes...",t.spinner="bouncingBar",t.color="green"):t.text=e.docs===!1?"Building component (docs disabled)":"Building component",t.start(),await O(e),e.watch||t.succeed("Build completed!")}catch(t){ye().fail(`Build failed: ${t.message}`),console.error(t),process.exit(1)}});import{exec as pt}from"node:child_process";import we from"node:path";import ft from"node:process";import{fileURLToPath as gt}from"node:url";import ht from"node:util";import{program as yt}from"commander";import wt from"inquirer";var ho=yt.command("migrate").description("Script runner to perform repetitive code change tasks").requiredOption("-i, --id <string>","Select the migration you would like to run by id").option("-m, --multi-gitter","Run the migration on all repositories in the multi-gitter config").action(async e=>{let t=gt(import.meta.url),r=we.dirname(t),o=we.resolve(r,"migrations",e.id);if(e.multiGitter){let n=ht.promisify(pt);try{await n("command -v multi-gitter")}catch{console.error("multi-gitter is not installed."),ft.exit(1)}(await wt.prompt([{type:"confirm",name:"dryRun",message:"Run migration in dry-run mode? (no changes will be committed)",default:!0}])).dryRun?w(`multi-gitter run ${o}/script.sh --config "${o}/multi-gitter.yml" --dry-run`):w(`multi-gitter run ${o}/script.sh --config "${o}/multi-gitter.yml"`)}else w(`${o}/script.sh`)});import Dt from"node:process";import{program as St}from"commander";import{readFile as Pt,writeFile as At}from"node:fs/promises";import{Logger as X}from"@aurodesignsystem/auro-library/scripts/utils/logger.mjs";import bt from"node:fs/promises";import{Logger as $}from"@aurodesignsystem/auro-library/scripts/utils/logger.mjs";import{processContentForFile as $t,templateFiller as xt}from"@aurodesignsystem/auro-library/scripts/utils/sharedFileProcessorUtils.mjs";var K="https://raw.githubusercontent.com/AlaskaAirlines/auro-templates",be="main",Et="main",Tt="default",$e={ISSUE_TEMPLATE:["bug_report.yaml","config.yml","feature_request.yaml","general-support.yaml","group.yaml","story.yaml","task.yaml"],workflows:["codeql.yml","publishDemo.yml","testPublish.yml"],_root:["CODEOWNERS","CODE_OF_CONDUCT.md","CONTRIBUTING.md","PULL_REQUEST_TEMPLATE.md","SECURITY.md","settings.yml","stale.yml"]};function vt(e,t){return e.startsWith("v")&&/^\d+\.\d+\.\d+(?<_>-.*)?$/u.test(e.slice(1))?`${K}/refs/tags/${e}/${t}`:e!==be?`${K}/refs/heads/${e}/${t}`:`${K}/${be}/${t}`}function Ct(e,t,r){let o=vt(t,e);return{identifier:e.split("/").pop(),input:{remoteUrl:o,fileName:r,overwrite:!0},output:r,overwrite:!0}}async function kt(e){try{await bt.rm(e,{recursive:!0,force:!0}),$.log(`Successfully removed directory: ${e}`)}catch(t){throw $.error(`Error removing directory ${e}: ${t.message}`),t}}async function xe(e){e||($.error("Root directory must be specified"),process.exit(1));let t=".github";try{await kt(t),$.log(".github directory removed successfully")}catch(n){$.error(`Error removing .github directory: ${n.message}`),process.exit(1)}await xt.extractNames();let r=[],o=[];for(let n of Object.keys($e))for(let i of $e[n]){let s=`${n==="_root"?"":`${n}/`}${i}`,m=`${e}/.github/${s}`,c=Ct(`templates/${Tt}/.github/${s}`,Et,m);r.push(c)}if(await Promise.all(r.map(async n=>{try{(await fetch(n.input.remoteUrl,{method:"HEAD"})).ok||o.push(n.input.remoteUrl)}catch{o.push(n.input.remoteUrl)}})),o.length>0){let n=o.map(i=>`File not found: ${i}`).join(`
4
4
  `);$.error(`Failed to sync .github directory. Confirm githubDirShape object is up to date:
5
5
  ${n}`),process.exit(1)}try{await Promise.all(r.map(n=>$t(n))),$.log("All files processed.")}catch(n){$.error(`Error processing files: ${n.message}`),process.exit(1)}}var Do=St.command("sync").description("Script runner to synchronize local repository configuration files").action(async()=>{X.info("Synchronizing repository configuration files..."),X.warn("Note: sync does not create a new git branch. Changes are added to the current branch.");let e=Dt.cwd();await xe(e);let t=`${e}/.github/CODEOWNERS`,o=(await Pt(t,{encoding:"utf-8"})).replace(/\r\n/gu,`
6
6
  `).replace(/\n\n/gu,`
@@ -15,15 +15,15 @@ class ${o}WCA extends ${o} {}
15
15
  if (!customElements.get(${r})) {
16
16
  customElements.define(${r}, ${o}WCA);
17
17
  }
18
- `};var N=D.resolve(process.cwd(),"./scripts/wca");async function Bt(e){try{return(await Promise.all(e.map(r=>Rt(r)))).flat()}catch(t){throw console.error("Error processing glob patterns:",t),t}}async function It(e){F.existsSync(N)||await F.promises.mkdir(N,{recursive:!0});for(let t of e){let r=D.resolve(process.cwd(),t),o=await F.promises.readFile(r,"utf-8"),n=D.resolve(N,`${D.basename(t)}`),i=Ee(o,D.relative(N,t));await F.promises.writeFile(n,i)}}async function Ot(){let e=await Bt(["./src/auro-*.js"]);await It(e)}var Fo=_t.command("wca-setup").description("Set up WCA (Web Component Analyzer) for the project").action(()=>{Ot().then(()=>{Te.success("WCA setup completed successfully.")}).catch(e=>{Te.error(`WCA setup failed: ${e.message}`)})});import{program as Wt}from"commander";import Ut from"chalk";import De from"ora";import{appendFile as Ft,readFile as Nt}from"node:fs/promises";import{Logger as p}from"@aurodesignsystem/auro-library/scripts/utils/logger.mjs";import{simpleGit as jt}from"simple-git";var g;try{g=jt({baseDir:process.cwd(),binary:"git",maxConcurrentProcesses:1})}catch(e){p.error(`Failed to initialize git: ${e}`),g={}}var j=class e{static async checkGitignore(t){if(t==="")return!1;try{return(await Nt(".gitignore","utf-8")).includes(t)}catch(r){return p.error(`Error reading file: ${r}`),!1}}static async getCommitMessages(){try{let t=await g.branchLocal();p.info(`Current branch: ${t.current}`);let r="main",o="";if(!!process.env.GITHUB_ACTIONS){p.info("Running in GitHub Actions environment"),r=process.env.GITHUB_BASE_REF||"main";try{await g.fetch("origin",r),p.info(`Fetched target branch: origin/${r}`),o=`${(await g.raw(["merge-base",`origin/${r}`,"HEAD"])).trim()}..HEAD`,p.info(`Using commit range: ${o}`)}catch(i){p.warn(`Error setting up commit range in CI: ${i}`),o=`origin/${r}..HEAD`,p.info(`Falling back to commit range: ${o}`)}}else{p.info("Running in local environment");try{try{await g.raw(["rev-parse","--verify",`origin/${r}`])}catch{p.info(`Fetching ${r} from origin`),await g.fetch("origin",r)}o=`${(await g.raw(["merge-base",`origin/${r}`,t.current])).trim()}..HEAD`,p.info(`Using commit range for PR commits: ${o}`)}catch(i){p.warn(`Error determining PR commits locally: ${i}`),p.info("Falling back to analyzing recent commits"),o="HEAD~10..HEAD",p.info(`Using fallback commit range: ${o}`)}}return await e.getFormattedCommits(o)}catch(t){return p.error(`Error getting commit messages: ${t}`),[]}}static async getFormattedCommits(t){let o=(await g.raw(["log","--pretty=format:COMMIT_START%n%H%n%ad%n%an%n%s%n%b%nCOMMIT_END","--date=short",t])).split(`COMMIT_START
18
+ `};var N=D.resolve(process.cwd(),"./scripts/wca");async function Bt(e){try{return(await Promise.all(e.map(r=>Rt(r)))).flat()}catch(t){throw console.error("Error processing glob patterns:",t),t}}async function It(e){F.existsSync(N)||await F.promises.mkdir(N,{recursive:!0});for(let t of e){let r=D.resolve(process.cwd(),t),o=await F.promises.readFile(r,"utf-8"),n=D.resolve(N,`${D.basename(t)}`),i=Ee(o,D.relative(N,t));await F.promises.writeFile(n,i)}}async function Ot(){let e=await Bt(["./src/auro-*.js"]);await It(e)}var Fo=_t.command("wca-setup").description("Set up WCA (Web Component Analyzer) for the project").action(()=>{Ot().then(()=>{Te.success("WCA setup completed successfully.")}).catch(e=>{Te.error(`WCA setup failed: ${e.message}`)})});import{program as Mt}from"commander";import Ut from"chalk";import De from"ora";import{appendFile as Ft,readFile as Nt}from"node:fs/promises";import{Logger as p}from"@aurodesignsystem/auro-library/scripts/utils/logger.mjs";import{simpleGit as jt}from"simple-git";var g;try{g=jt({baseDir:process.cwd(),binary:"git",maxConcurrentProcesses:1})}catch(e){p.error(`Failed to initialize git: ${e}`),g={}}var j=class e{static async checkGitignore(t){if(t==="")return!1;try{return(await Nt(".gitignore","utf-8")).includes(t)}catch(r){return p.error(`Error reading file: ${r}`),!1}}static async getCommitMessages(){try{let t=await g.branchLocal();p.info(`Current branch: ${t.current}`);let r="main",o="";if(!!process.env.GITHUB_ACTIONS){p.info("Running in GitHub Actions environment"),r=process.env.GITHUB_BASE_REF||"main";try{await g.fetch("origin",r),p.info(`Fetched target branch: origin/${r}`),o=`${(await g.raw(["merge-base",`origin/${r}`,"HEAD"])).trim()}..HEAD`,p.info(`Using commit range: ${o}`)}catch(i){p.warn(`Error setting up commit range in CI: ${i}`),o=`origin/${r}..HEAD`,p.info(`Falling back to commit range: ${o}`)}}else{p.info("Running in local environment");try{try{await g.raw(["rev-parse","--verify",`origin/${r}`])}catch{p.info(`Fetching ${r} from origin`),await g.fetch("origin",r)}o=`${(await g.raw(["merge-base",`origin/${r}`,t.current])).trim()}..HEAD`,p.info(`Using commit range for PR commits: ${o}`)}catch(i){p.warn(`Error determining PR commits locally: ${i}`),p.info("Falling back to analyzing recent commits"),o="HEAD~10..HEAD",p.info(`Using fallback commit range: ${o}`)}}return await e.getFormattedCommits(o)}catch(t){return p.error(`Error getting commit messages: ${t}`),[]}}static async getFormattedCommits(t){let o=(await g.raw(["log","--pretty=format:COMMIT_START%n%H%n%ad%n%an%n%s%n%b%nCOMMIT_END","--date=short",t])).split(`COMMIT_START
19
19
  `).filter(i=>i.trim()!==""),n=[];for(let i of o){let s=i.split(`
20
20
  `);if(s.length>=4){let m=s[0],c=s[1],d=s[2],l=s[3],a=s.slice(4).filter(G=>G!=="COMMIT_END"),u=a.length>0?a.join(""):"",h=m.substring(0,7),x=l.match(/^(feat|fix|docs|style|refactor|perf|test|build|ci|chore)(\(.+\))?:/),y=x?x[1]:"unknown";u.includes("BREAKING CHANGE")&&(y="breaking"),n.push({type:y,hash:h,date:c,subject:l,body:u,message:`${l}${u?`
21
21
 
22
22
  ${u}`:""}`,author_name:d})}}return n}static async addToGitignore(t,r=!0){await e.checkGitignore(t).then(async o=>{if(o)p.warn(`${t} already exists`);else try{await Ft(".gitignore",`
23
- ${t}`),r&&p.success(`${t} added to .gitignore`)}catch(n){p.error(n)}})}static async removeFromGitCache(t){try{await g.rmKeepLocal(t),p.success(`${t.join(", ")} are removed from git cache`)}catch(r){p.error(r)}}static async createBranch(t){try{await g.checkoutLocalBranch(t),p.success(`Created and switched to ${t} branch`)}catch(r){p.error(r)}}static async commitStagedFiles(t){try{await g.add("."),await g.commit(t),p.success(`Committed with message: ${t}`)}catch(r){p.error(r)}}};import f from"chalk";var Lt=60,Gt=100;function S(e){switch(e){case"breaking":return f.bold.red(e);case"feat":return f.bold.green(e);case"fix":return f.bold.green(e);case"perf":return f.bold.green(e);case"docs":return f.bold.cyan(e);case"style":return f.bold.cyan(e);case"refactor":return f.bold.cyan(e);case"test":return f.bold.cyan(e);case"build":return f.bold.cyan(e);case"ci":return f.bold.cyan(e);case"chore":return f.bold.cyan(e);default:return f.bold.white(e)}}function Ce(e,t){if(!e)return"";if(e.length<=t)return e;let r=e.split(" "),o="",n="";for(let i of r)(n+i).length>t&&n.length>0&&(o+=`${n.trim()}
24
- `,n=""),n=`${n}${i} `;return n.length>0&&(o+=n.trim()),o}function ve(e){for(let t of e){console.log("\u2500".repeat(60));let r=Ce(t.subject,Lt),o=Ce(t.body,Gt);console.log(f.bold(`${S(t.type)}`)),console.log(f.dim(`${t.hash} | ${t.date} | ${t.author_name}`)),console.log(f.bold(`${f.white(r)}`)),t.body&&console.log(f.dim(o))}console.log("\u2500".repeat(60)),console.log(`
23
+ ${t}`),r&&p.success(`${t} added to .gitignore`)}catch(n){p.error(n)}})}static async removeFromGitCache(t){try{await g.rmKeepLocal(t),p.success(`${t.join(", ")} are removed from git cache`)}catch(r){p.error(r)}}static async createBranch(t){try{await g.checkoutLocalBranch(t),p.success(`Created and switched to ${t} branch`)}catch(r){p.error(r)}}static async commitStagedFiles(t){try{await g.add("."),await g.commit(t),p.success(`Committed with message: ${t}`)}catch(r){p.error(r)}}};import f from"chalk";var Lt=60,Gt=100;function S(e){switch(e){case"breaking":return f.bold.red(e);case"feat":return f.bold.green(e);case"fix":return f.bold.green(e);case"perf":return f.bold.green(e);case"docs":return f.bold.cyan(e);case"style":return f.bold.cyan(e);case"refactor":return f.bold.cyan(e);case"test":return f.bold.cyan(e);case"build":return f.bold.cyan(e);case"ci":return f.bold.cyan(e);case"chore":return f.bold.cyan(e);default:return f.bold.white(e)}}function ve(e,t){if(!e)return"";if(e.length<=t)return e;let r=e.split(" "),o="",n="";for(let i of r)(n+i).length>t&&n.length>0&&(o+=`${n.trim()}
24
+ `,n=""),n=`${n}${i} `;return n.length>0&&(o+=n.trim()),o}function Ce(e){for(let t of e){console.log("\u2500".repeat(60));let r=ve(t.subject,Lt),o=ve(t.body,Gt);console.log(f.bold(`${S(t.type)}`)),console.log(f.dim(`${t.hash} | ${t.date} | ${t.author_name}`)),console.log(f.bold(`${f.white(r)}`)),t.body&&console.log(f.dim(o))}console.log("\u2500".repeat(60)),console.log(`
25
25
  `)}import L from"@actions/github";async function Q(){try{let e=process.env.GITHUB_TOKEN;if(!e)throw new Error("GITHUB_TOKEN environment variable is not set");if(!process.env.GITHUB_REPOSITORY||!process.env.GITHUB_EVENT_PATH)throw new Error("This function can only be used in a GitHub Actions environment");let t=L.getOctokit(e),{context:r}=L;if(!r.payload.pull_request)throw new Error("No pull request found in the GitHub context");let[o,n]=process.env.GITHUB_REPOSITORY.split("/"),i=r.payload.pull_request.number,{data:s}=await t.rest.issues.listLabelsOnIssue({owner:o,repo:n,issue_number:i});return s.map(m=>m.name)}catch(e){throw e instanceof Error?new Error(`Failed to get existing labels: ${e.message}`):e}}async function ke(e){try{let t=process.env.GITHUB_TOKEN;if(!t)throw new Error("GITHUB_TOKEN environment variable is not set");if(!process.env.GITHUB_REPOSITORY||!process.env.GITHUB_EVENT_PATH)throw new Error("This function can only be used in a GitHub Actions environment");let r=L.getOctokit(t),{context:o}=L;if(!o.payload.pull_request)throw new Error("No pull request found in the GitHub context");let[n,i]=process.env.GITHUB_REPOSITORY.split("/"),s=o.payload.pull_request.number,m=`semantic-status: ${e}`,c=await Q();if(c.includes(m))return;let d=c.filter(l=>l.startsWith("semantic-status:")&&l!==m);for(let l of d)await r.rest.issues.removeLabel({owner:n,repo:i,issue_number:s,name:l});await r.rest.issues.addLabels({owner:n,repo:i,issue_number:s,labels:[m]});return}catch(t){throw t instanceof Error?new Error(`Failed to apply label: ${t.message}`):t}}async function Se(e=!1,t=!1){let r=De(`Checking commits...
26
- `).start();try{let o=await j.getCommitMessages();if(e&&ve(o),r.succeed(`Total commits analyzed: ${o.length}`),o.length!==0){let n=o.map(m=>m.type),s=Array.from(new Set(n)).map(m=>S(m)).join(", ");r.succeed(`Found commit types: ${s}`)}else r.info(`The list of commits is created by comparing the current branch
26
+ `).start();try{let o=await j.getCommitMessages();if(e&&Ce(o),r.succeed(`Total commits analyzed: ${o.length}`),o.length!==0){let n=o.map(m=>m.type),s=Array.from(new Set(n)).map(m=>S(m)).join(", ");r.succeed(`Found commit types: ${s}`)}else r.info(`The list of commits is created by comparing the current branch
27
27
  with the main branch. If you are on a new branch, please
28
- make sure to commit some changes before running this command.`);t&&await Mt(o,r)}catch(o){r.fail("Error getting commit messages"),console.error(o)}}async function Mt(e,t){let r=["breaking","feat","fix","perf","docs","style","refactor","test","build","ci","chore"],o=e.map(s=>s.type).filter(s=>r.includes(s)),n=null,i=Number.POSITIVE_INFINITY;for(let s of o){let m=r.indexOf(s);m<i&&(i=m,n=s)}if(n){let s=De("Checking existing labels on pull request...").start();try{if((await Q()).includes(`semantic-status: ${n}`)){s.info(`Label "semantic-status: ${S(n)}" already exists on the pull request.`);return}s.text="Applying label to pull request...",await ke(n),s.succeed(`Label "semantic-status: ${S(n)}" applied to the pull request.`)}catch(m){let c=m instanceof Error?m.message:String(m);s.fail(c)}}else t.warn(Ut.yellow("No semantic commit type found to apply as label."))}var en=Wt.command("check-commits").alias("cc").option("-l, --set-label","Set label on the pull request based on the commit message type").option("-d, --debug","Display detailed commit information for debugging").description("Check commits in the local repository for the types of semantic commit messages made and return the results.").action(async e=>{await Se(e.debug,e.setLabel)});import Pe from"node:fs";import{get as Ae}from"node:https";import T from"chalk";import{program as Ht}from"commander";import zt from"ora";var cn=Ht.command("pr-release").option("-n, --namespace <package-namespace>","Set namespace of the package release","@aurodesignsystem-dev").option("-p, --pr-number <number>","Set pull request number for the release","0").description("Generate the package version based off of PR number then update the package.json file. Note: this does not publish the package.").action(async e=>{await qt(e)}),qt=async e=>{let{namespace:t,prNumber:r}=e,o=zt("Updating package.json").start();try{let n="package.json",i=JSON.parse(Pe.readFileSync(n,"utf8"));o.text="Checking npm registry for version information...";let s=`0.0.0-pr${r}`,m=i.name.split("/")[1],c=`${t}/${m}`,d=await Vt(s,c,o),l=`${s}.${d}`;i.name=c,i.version=l,o.text="Writing updated package.json...",Pe.writeFileSync(n,`${JSON.stringify(i,null,2)}
29
- `,"utf8"),o.succeed(`Package.json updated to use ${T.green(l)} and ${T.green(c)}`),process.exit(0)}catch(n){o.fail(`Failed to update package.json: ${n}`),process.exit(1)}},Vt=(e,t,r)=>new Promise(o=>{try{let m=function(c){if(c.statusCode!==200){r.info(`Package not found. Status code: ${T.red(c.statusCode)}, defaulting to version 0`),o(0);return}r.text="Processing version information...";let d="";c.on("data",l=>{d+=l}),c.on("end",()=>{try{let l=JSON.parse(d),a=l.versions?Object.keys(l.versions):[];r.text="Calculating next version number...";let u=-1,h=new RegExp(`^${e}\\.(\\d+)$`);for(let x of a){let y=x.match(h);if(y){let G=Number.parseInt(y[1],10);u=Math.max(u,G)}}u>=0?r.info(`Found existing version ${T.green(`${e}.${u}`)}. Incrementing to ${T.green(`${e}.${u+1}`)}`):r.info(`No existing version found for ${T.green(e)}. Starting with ${T.green(`${e}.0`)}`),o(u+1)}catch(l){r.warn(`Failed to parse NPM registry response: ${l instanceof Error?l.message:"Unknown error"}, defaulting to version 0`),o(0)}})};var n=m;let i=`https://registry.npmjs.org/${t}`,s=Ae(i,{headers:{Accept:"application/json"}},c=>{if((c.statusCode===301||c.statusCode===302)&&c.headers.location){r.info(`Following redirect to ${c.headers.location}...`);try{Ae(c.headers.location,{headers:{Accept:"application/json"}},m).on("error",d=>{r.warn(`Error following redirect: ${d.message}, defaulting to version 0`),o(0)}).end()}catch(d){r.warn(`Redirect request failed: ${d instanceof Error?d.message:"Unknown error"}, defaulting to version 0`),o(0)}return}m(c)});s.on("error",c=>{r.warn(`Request error: ${c.message}, defaulting to version 0`),o(0)}),s.end()}catch{r.warn("Error checking version in npm registry, defaulting to version 0"),o(0)}});import _e from"node:path";import{fileURLToPath as Jt}from"node:url";import{program as Yt}from"commander";var Kt=Jt(import.meta.url),Xt=_e.resolve(_e.dirname(Kt),".."),fn=Yt.command("test").option("-w, --watch","Set watch number for the test").description("Run the web test runner to test the component library").action(async e=>{let t=`npx wtr --config ${Xt}/dist/configs/web-test-runner.config.mjs`;if(e.watch){w(`${t} --watch`);return}w(t)});Z.name("auro").version(U()).description("A cli tool to support the Auro Design System");Z.addHelpText("beforeAll",ee());Z.parse();
28
+ make sure to commit some changes before running this command.`);t&&await Wt(o,r)}catch(o){r.fail("Error getting commit messages"),console.error(o)}}async function Wt(e,t){let r=["breaking","feat","fix","perf","docs","style","refactor","test","build","ci","chore"],o=e.map(s=>s.type).filter(s=>r.includes(s)),n=null,i=Number.POSITIVE_INFINITY;for(let s of o){let m=r.indexOf(s);m<i&&(i=m,n=s)}if(n){let s=De("Checking existing labels on pull request...").start();try{if((await Q()).includes(`semantic-status: ${n}`)){s.info(`Label "semantic-status: ${S(n)}" already exists on the pull request.`);return}s.text="Applying label to pull request...",await ke(n),s.succeed(`Label "semantic-status: ${S(n)}" applied to the pull request.`)}catch(m){let c=m instanceof Error?m.message:String(m);s.fail(c)}}else t.warn(Ut.yellow("No semantic commit type found to apply as label."))}var en=Mt.command("check-commits").alias("cc").option("-l, --set-label","Set label on the pull request based on the commit message type").option("-d, --debug","Display detailed commit information for debugging").description("Check commits in the local repository for the types of semantic commit messages made and return the results.").action(async e=>{await Se(e.debug,e.setLabel)});import Pe from"node:fs";import{get as Ae}from"node:https";import T from"chalk";import{program as Ht}from"commander";import zt from"ora";var cn=Ht.command("pr-release").option("-n, --namespace <package-namespace>","Set namespace of the package release","@aurodesignsystem-dev").option("-p, --pr-number <number>","Set pull request number for the release","0").description("Generate the package version based off of PR number then update the package.json file. Note: this does not publish the package.").action(async e=>{await qt(e)}),qt=async e=>{let{namespace:t,prNumber:r}=e,o=zt("Updating package.json").start();try{let n="package.json",i=JSON.parse(Pe.readFileSync(n,"utf8"));o.text="Checking npm registry for version information...";let s=`0.0.0-pr${r}`,m=i.name.split("/")[1],c=`${t}/${m}`,d=await Vt(s,c,o),l=`${s}.${d}`;i.name=c,i.version=l,o.text="Writing updated package.json...",Pe.writeFileSync(n,`${JSON.stringify(i,null,2)}
29
+ `,"utf8"),o.succeed(`Package.json updated to use ${T.green(l)} and ${T.green(c)}`),process.exit(0)}catch(n){o.fail(`Failed to update package.json: ${n}`),process.exit(1)}},Vt=(e,t,r)=>new Promise(o=>{try{let m=function(c){if(c.statusCode!==200){r.info(`Package not found. Status code: ${T.red(c.statusCode)}, defaulting to version 0`),o(0);return}r.text="Processing version information...";let d="";c.on("data",l=>{d+=l}),c.on("end",()=>{try{let l=JSON.parse(d),a=l.versions?Object.keys(l.versions):[];r.text="Calculating next version number...";let u=-1,h=new RegExp(`^${e}\\.(\\d+)$`);for(let x of a){let y=x.match(h);if(y){let G=Number.parseInt(y[1],10);u=Math.max(u,G)}}u>=0?r.info(`Found existing version ${T.green(`${e}.${u}`)}. Incrementing to ${T.green(`${e}.${u+1}`)}`):r.info(`No existing version found for ${T.green(e)}. Starting with ${T.green(`${e}.0`)}`),o(u+1)}catch(l){r.warn(`Failed to parse NPM registry response: ${l instanceof Error?l.message:"Unknown error"}, defaulting to version 0`),o(0)}})};var n=m;let i=`https://registry.npmjs.org/${t}`,s=Ae(i,{headers:{Accept:"application/json"}},c=>{if((c.statusCode===301||c.statusCode===302)&&c.headers.location){r.info(`Following redirect to ${c.headers.location}...`);try{Ae(c.headers.location,{headers:{Accept:"application/json"}},m).on("error",d=>{r.warn(`Error following redirect: ${d.message}, defaulting to version 0`),o(0)}).end()}catch(d){r.warn(`Redirect request failed: ${d instanceof Error?d.message:"Unknown error"}, defaulting to version 0`),o(0)}return}m(c)});s.on("error",c=>{r.warn(`Request error: ${c.message}, defaulting to version 0`),o(0)}),s.end()}catch{r.warn("Error checking version in npm registry, defaulting to version 0"),o(0)}});import _e from"node:path";import{fileURLToPath as Jt}from"node:url";import{program as Yt}from"commander";var Kt=Jt(import.meta.url),Xt=_e.resolve(_e.dirname(Kt),".."),fn=Yt.command("test").option("-w, --watch","Set watch number for the test").description("Run the web test runner to test the component library").action(async e=>{let t=`npx wtr --config ${Xt}/dist/configs/web-test-runner.config.mjs --coverage`;if(e.watch){w(`${t} --watch`);return}w(t)});Z.name("auro").version(U()).description("A cli tool to support the Auro Design System");Z.addHelpText("beforeAll",ee());Z.parse();
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts", "../src/utils/auroSplash.js", "../src/utils/packageVersion.js", "../src/commands/dev.js", "../src/commands/_sharedOptions.js", "../src/scripts/build/index.js", "../src/scripts/build/bundleHandlers.js", "../src/utils/shell.js", "../src/scripts/analyze.js", "../src/scripts/build/defaultDocsBuild.js", "../src/scripts/build/configUtils.js", "../src/scripts/build/plugins.js", "../src/scripts/build/devServerUtils.js", "../src/scripts/build/watchModeHandlers.js", "../src/commands/build.js", "../src/commands/migrate.js", "../src/commands/sync.js", "../src/scripts/syncDotGithubDir.js", "../src/commands/wca-setup.js", "../src/scripts/prepWcaCompatibleCode.mjs", "../src/commands/check-commits.ts", "../src/scripts/check-commits/commit-analyzer.ts", "../src/utils/gitUtils.ts", "../src/scripts/check-commits/display-utils.ts", "../src/scripts/check-commits/github-labels.ts", "../src/commands/pr-release.ts", "../src/commands/test.ts"],
4
- "sourcesContent": ["import { program } from \"commander\";\nimport auroSplash from \"#utils/auroSplash.js\";\nimport getPackageVersion from \"#utils/packageVersion.js\";\n\n// Register commands (importing them will register them)\nimport \"#commands/dev.js\";\nimport \"#commands/build.js\";\nimport \"#commands/migrate.js\";\nimport \"#commands/sync.js\";\nimport \"#commands/wca-setup.js\";\nimport \"#commands/check-commits.ts\";\nimport \"#commands/pr-release.ts\";\nimport \"#commands/test.js\";\n\nprogram\n .name(\"auro\")\n .version(getPackageVersion())\n .description(\"A cli tool to support the Auro Design System\");\n\nprogram.addHelpText(\"beforeAll\", auroSplash());\n\nprogram.parse();\n", "import figlet from \"figlet\";\nimport { mind } from \"gradient-string\";\n\nexport default () => {\n return mind(figlet.textSync(\"Auro CLI\"));\n};\n", "/* eslint-disable no-underscore-dangle, no-undef */\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\n/**\n * Simple debug logger that only prints when DEBUG environment variable is set.\n * @param {string} message - The message to log.\n */\nfunction debugLog(message) {\n if (process.env.DEBUG) {\n console.log(`[DEBUG] ${message}`);\n }\n}\n\n/**\n * Retrieves the version from the package.json file.\n * @returns {string} The version from package.json.\n */\nexport default function getPackageVersion() {\n try {\n // Get the directory path of the current module\n const __filename = fileURLToPath(import.meta.url);\n const __dirname = path.dirname(__filename);\n debugLog(`Current module path: ${__dirname}`);\n\n // Standard installed module location - current directory\n const packagePath = path.resolve(__dirname, \"..\", \"package.json\");\n\n debugLog(`Checking package.json at: ${packagePath}`);\n if (fs.existsSync(packagePath)) {\n debugLog(`Found package.json at: ${packagePath}`);\n const packageJson = JSON.parse(fs.readFileSync(packagePath, \"utf8\"));\n return packageJson.version;\n }\n\n // Fallback to a default version if we can't find the package.json\n debugLog(\n \"Could not find package.json in the standard installed module location, using default version\",\n );\n return \"0.0.0\";\n } catch (error) {\n console.error(\"Error retrieving package version:\", error);\n return \"0.0.0\";\n }\n}\n", "import { program } from \"commander\";\nimport ora from \"ora\";\nimport {\n withBuildOptions,\n withServerOptions,\n} from \"#commands/_sharedOptions.js\";\nimport { buildWithRollup } from \"#scripts/build/index.js\";\n\nlet devCommand = program\n .command(\"dev\")\n .description(\"Runs development server for auro components\");\n\ndevCommand = withBuildOptions(devCommand, {\n watch: true,\n});\ndevCommand = withServerOptions(devCommand);\n\nexport default devCommand.action(async (options) => {\n try {\n const build = ora(\"Initializing...\");\n\n if (options.watch) {\n build.text = \"Waiting for changes...\";\n build.spinner = \"bouncingBar\";\n build.color = \"green\";\n } else {\n build.text =\n options.docs === false\n ? \"Building component (docs disabled)\"\n : \"Building component\";\n }\n\n build.start();\n\n await buildWithRollup({ ...options, dev: true, watch: true });\n } catch (error) {\n // If there's any active spinner, we need to fail it\n ora().fail(`Build failed: ${error.message}`);\n console.error(error);\n process.exit(1);\n }\n});\n", "/**\n * @param {import('commander').Command} command\n * @param {{ watch: boolean }} options\n * @returns {import('commander').Command}\n */\nexport function withBuildOptions(command, { watch = false }) {\n return command\n .option(\"-m, --module-paths [paths...]\", \"Path(s) to node_modules folder\")\n .option(\n \"--watch\",\n \"Watch for changes - default for dev mode, opt-in for build\",\n watch,\n )\n .option(\"--skip-docs\", \"Skip documentation generation\", false)\n .option(\n \"--wca-input [files...]\",\n \"Source file(s) to analyze for API documentation\",\n )\n .option(\"--wca-output [files...]\", \"Output file(s) for API documentation\");\n}\n\n/**\n * @param {import('commander').Command} command\n */\nexport function withServerOptions(command) {\n return command\n .option(\"-p, --port <number>\", \"Port for the dev server\")\n .option(\"-o, --open\", \"Open the browser after starting the server\");\n}\n", "import terser from \"@rollup/plugin-terser\";\nimport { watch } from \"rollup\";\nimport {\n buildCombinedBundle,\n buildTypeDefinitions,\n cleanupDist,\n generateDocs,\n} from \"./bundleHandlers.js\";\nimport {\n getDemoConfig,\n getDtsConfig,\n getMainBundleConfig,\n} from \"./configUtils.js\";\nimport { startDevelopmentServer } from \"./devServerUtils.js\";\nimport {\n handleWatcherEvents,\n setupWatchModeListeners,\n} from \"./watchModeHandlers.js\";\n\n/**\n * Run a production build once\n * @param {object} options - Build options\n * @returns {Promise<void>}\n */\nasync function runProductionBuild(options) {\n const mainBundleConfig = getMainBundleConfig(options);\n const demoConfig = getDemoConfig(options);\n const dtsConfig = getDtsConfig();\n\n // Add terser for minification in production\n mainBundleConfig.config.plugins.push(terser());\n\n // Generate docs if enabled\n await generateDocs(options);\n\n // Build main and demo bundles\n await buildCombinedBundle(mainBundleConfig.config, demoConfig.config);\n\n // Build TypeScript definitions\n await buildTypeDefinitions(dtsConfig.config, dtsConfig.config.output);\n}\n\n/**\n * Set up watch mode for development\n * @param {object} options - Build options\n * @returns {Promise<object>} - Rollup watcher\n */\nasync function setupWatchMode(options) {\n const { dev: isDevMode } = options;\n const mainBundleConfig = getMainBundleConfig({ ...options, watch: true });\n const demoConfig = getDemoConfig({ ...options, watch: true });\n\n // Create and configure the watcher\n const watcher = watch([mainBundleConfig.config, demoConfig.config]);\n\n // Set up watcher event handlers\n handleWatcherEvents(\n watcher,\n options,\n isDevMode ? async () => startDevelopmentServer(options) : undefined,\n );\n\n // Set up clean shutdown\n setupWatchModeListeners(watcher);\n\n return watcher;\n}\n\n/**\n * Build the component using Rollup with the provided options\n * @param {object} options - Build configuration options\n * @param {boolean} [options.dev=false] - Whether to run in development mode\n * @param {boolean} [options.watch] - Whether to run in watch mode (defaults to value of dev)\n * @param {boolean} [options.docs=true] - Whether to generate documentation\n * @returns {Promise<object|void>} - Rollup watcher if in watch mode\n */\nexport async function buildWithRollup(options = {}) {\n try {\n const { dev: isDevMode = false, watch: isWatchMode = isDevMode } = options;\n\n // Clean output directory\n cleanupDist();\n\n // Run production build once or set up watch mode\n if (!isDevMode && !isWatchMode) {\n return await runProductionBuild(options);\n // biome-ignore lint/style/noUselessElse: This else is the difference between build or dev.\n } else {\n return await setupWatchMode(options);\n }\n } catch (error) {\n throw new Error(`Build failed: ${error.message}`);\n }\n}\n\n// Re-export utilities for backward compatibility\nexport { cleanupDist };\n", "import { rmSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport ora from \"ora\";\nimport { rollup } from \"rollup\";\nimport { analyzeComponents } from \"#scripts/analyze.js\";\nimport { runDefaultDocsBuild } from \"#scripts/build/defaultDocsBuild.js\";\n\n/**\n * Clean up the dist folder\n * @returns {boolean} Success status\n */\nexport function cleanupDist() {\n const distPath = join(\"./dist\");\n const spinner = ora(\"Cleaning dist folder...\").start();\n\n try {\n rmSync(distPath, { recursive: true, force: true });\n spinner.succeed(\"All clean! Dist folder wiped.\");\n return true;\n } catch (error) {\n spinner.fail(`Oops! Couldn't clean dist/ folder: ${error.message}`);\n console.error(error);\n return false;\n }\n}\n\n/**\n * Run a build step with spinner feedback\n * @param {string} taskName - Name of the task for spinner text\n * @param {Function} taskFn - Async function to execute the task\n * @param {string} successMsg - Message to show on success\n * @param {string} failMsg - Message to show on failure\n * @returns {Promise<any>} - Result of the task function or throws error\n */\nasync function runBuildStep(taskName, taskFn, successMsg, failMsg) {\n const spinner = ora(taskName).start();\n\n try {\n const result = await taskFn();\n spinner.succeed(successMsg);\n return result;\n } catch (error) {\n spinner.fail(failMsg);\n console.error(`Error: ${error.message}`);\n throw error;\n }\n}\n\n/**\n * Builds the TypeScript definition files\n * @param {object} config - Rollup config for d.ts generation\n * @param {object} outputConfig - Output configuration for d.ts files\n */\nexport async function buildTypeDefinitions(config, outputConfig) {\n return runBuildStep(\n \"Creating type definitions...\",\n async () => {\n const bundle = await rollup(config);\n await bundle.write(outputConfig);\n await bundle.close();\n },\n \"Types files built.\",\n \"Darn! Type definitions failed.\",\n );\n}\n\n/**\n * Builds both the main bundle and demo files in one operation\n * @param {object} mainConfig - Rollup config for the main bundle\n * @param {object} demoConfig - Rollup config for the demo files\n */\nexport async function buildCombinedBundle(mainConfig, demoConfig) {\n return runBuildStep(\n `Bundling ${mainConfig.name || \"main\"} and ${demoConfig.name || \"demo\"}...`,\n async () => {\n // Build main bundle\n const mainBundle = await rollup(mainConfig);\n await mainBundle.write(mainConfig.output);\n await mainBundle.close();\n\n // Build demo files\n const demoBundle = await rollup(demoConfig);\n await demoBundle.write(demoConfig.output);\n await demoBundle.close();\n },\n `Bundles ready! ${mainConfig.name || \"Main\"} and ${demoConfig.name || \"demo\"} built.`,\n \"Bundle hiccup! Build failed.\",\n );\n}\n\n/**\n * Analyzes web components and generates API documentation.\n * @param {object} options - Options containing wcaInput and wcaOutput\n */\nexport async function generateDocs(options) {\n const { wcaInput: sourceFiles, wcaOutput: outFile, skipDocs } = options;\n\n if (skipDocs) {\n const skipSpinner = ora(\"Skipping docs generation...\").start();\n\n setTimeout(() => {\n skipSpinner.succeed(\"Docs generation skipped.\");\n }, 0);\n return;\n }\n\n return runBuildStep(\n \"Analyzing components and making docs...\",\n async () => {\n await analyzeComponents(sourceFiles, outFile);\n await runDefaultDocsBuild();\n },\n \"Docs ready! Looking good.\",\n \"Doc troubles!\",\n );\n}\n", "import { spawn } from \"node:child_process\";\nimport ora from \"ora\";\n\nconst shell = (command, _args) => {\n const commandString = `${command} ${_args ? _args.join(\" \") : \"\"}`;\n\n // Initialize the spinner but don't start it - we'll just use it for completion status\n const spinner = ora();\n\n // Parse command string if no args are provided\n let finalCommand = command;\n let finalArgs = _args || [];\n\n if (!_args && typeof command === \"string\") {\n const parts = command.split(\" \");\n finalCommand = parts[0];\n finalArgs = parts.slice(1);\n }\n\n // Simple check for watch mode - if the command contains --watch or -w flags\n const isWatchMode =\n commandString.includes(\"--watch\") || commandString.includes(\" -w\");\n\n // Use different stdio configurations based on watch mode\n const stdio = isWatchMode\n ? \"inherit\" // Full TTY support for watch mode\n : [\"inherit\", \"pipe\", \"pipe\"]; // Capture output but allow input for normal mode\n\n const child = spawn(finalCommand, finalArgs, {\n stdio,\n shell: true,\n });\n\n // Only set up output capture if we're not in watch mode (stdio isn't 'inherit')\n if (!isWatchMode) {\n // Store command output to display after completion\n const commandOutput = [];\n\n child.stdout?.on(\"data\", (data) => {\n // Convert buffer to string\n const output = data.toString();\n\n // Store full output\n commandOutput.push(output);\n\n // Output directly to console\n process.stdout.write(output);\n });\n\n child.stderr?.on(\"data\", (data) => {\n const output = data.toString();\n commandOutput.push(output);\n process.stderr.write(output);\n });\n }\n\n // Set up a promise to track command completion\n return new Promise((resolve, reject) => {\n child.on(\"close\", (code) => {\n if (code !== 0) {\n // In watch mode, don't treat exit codes as errors - these are typically user terminations\n if (isWatchMode) {\n spinner.info(`Watch mode terminated with code ${code}`);\n resolve(); // Resolve without an error for watch mode commands\n } else {\n spinner.fail(`${commandString} failed (code ${code})`);\n reject(new Error(`Command failed with exit code ${code}`));\n }\n } else {\n spinner.succeed(`${commandString} completed successfully`);\n resolve();\n }\n });\n });\n};\n\nexport { shell };\n", "import { shell } from \"#utils/shell.js\";\n\n/**\n * Analyzes web components and generates API documentation.\n * @param {string[]} sourceFiles - Array of file paths to analyze.\n * @param {string} outFile - Output file path.\n */\nexport async function analyzeComponents(sourceFiles, outFile) {\n shell(\n `npx wca analyze ${sourceFiles || \"scripts/wca/*\"} --outFiles ${outFile || \"docs/api.md\"}`,\n );\n}\n", "import { Logger } from \"@aurodesignsystem/auro-library/scripts/utils/logger.mjs\";\nimport {\n generateReadmeUrl,\n processContentForFile,\n templateFiller,\n} from \"@aurodesignsystem/auro-library/scripts/utils/sharedFileProcessorUtils.mjs\";\n\n/**\n * Processor config object.\n * @typedef {Object} ProcessorConfig\n * @property {boolean} [overwriteLocalCopies=true] - The release version tag to use instead of master.\n * @property {string} [remoteReadmeVersion=\"master\"] - The release version tag to use instead of master.\n * @property {string} [remoteReadmeVariant=\"\"] - The variant string to use for the README source.\n * (like \"_esm\" to make README_esm.md).\n */\n\n/**\n * @param {ProcessorConfig} config - The configuration for this processor.\n */\nexport const defaultDocsProcessorConfig = {\n overwriteLocalCopies: true,\n remoteReadmeVersion: \"master\",\n // eslint-disable-next-line no-warning-comments\n // TODO: remove this variant when all components are updated to use latest auro-library\n // AND the default README.md is updated to use the new paths\n remoteReadmeVariant: \"_updated_paths\",\n};\n\nfunction pathFromCwd(pathLike) {\n const cwd = process.cwd();\n return `${cwd}/${pathLike}`;\n}\n\n/**\n * @param {ProcessorConfig} config - The configuration for this processor.\n * @returns {import('../utils/sharedFileProcessorUtils').FileProcessorConfig[]}\n */\nexport const fileConfigs = (config) => [\n // README.md\n {\n identifier: \"README.md\",\n input: {\n remoteUrl: generateReadmeUrl(\n config.remoteReadmeVersion,\n config.remoteReadmeVariant,\n ),\n fileName: pathFromCwd(\"/docTemplates/README.md\"),\n overwrite: config.overwriteLocalCopies,\n },\n output: pathFromCwd(\"/README.md\"),\n },\n // index.md\n {\n identifier: \"index.md\",\n input: pathFromCwd(\"/docs/partials/index.md\"),\n output: pathFromCwd(\"/demo/index.md\"),\n mdMagicConfig: {\n output: {\n directory: pathFromCwd(\"/demo\"),\n },\n },\n },\n // api.md\n {\n identifier: \"api.md\",\n input: pathFromCwd(\"/docs/partials/api.md\"),\n output: pathFromCwd(\"/demo/api.md\"),\n preProcessors: [templateFiller.formatApiTable],\n },\n];\n\n/**\n *\n * @param {ProcessorConfig} config - The configuration for this processor.\n * @return {Promise<void>}\n */\nexport async function processDocFiles(config = defaultDocsProcessorConfig) {\n // setup\n await templateFiller.extractNames();\n\n for (const fileConfig of fileConfigs(config)) {\n try {\n // eslint-disable-next-line no-await-in-loop\n await processContentForFile(fileConfig);\n } catch (err) {\n Logger.error(`Error processing ${fileConfig.identifier}: ${err.message}`);\n }\n }\n}\n\nexport async function runDefaultDocsBuild() {\n await processDocFiles();\n}\n", "import { basename } from \"node:path\";\nimport { nodeResolve } from \"@rollup/plugin-node-resolve\";\nimport { glob } from \"glob\";\nimport { dts } from \"rollup-plugin-dts\";\nimport { litScss } from \"rollup-plugin-scss-lit\";\nimport { watchGlobs } from \"./plugins.js\";\n\n// Default paths used across configurations\nconst DEFAULTS = {\n moduleDirectories: [\"node_modules\"],\n modulePaths: [\"../../node_modules\", \"../node_modules\", \"node_modules\"],\n watchPatterns: [\"./apiExamples/**/*\", \"./docs/**/*\"],\n};\n\n/**\n * Creates Rollup plugins configuration.\n * @param {string[]} modulePaths - Additional paths to include in litScss.\n * @param {object} options - Additional options for plugins\n * @returns {object[]} - Array of Rollup plugins.\n */\nexport function getPluginsConfig(modulePaths = [], options = {}) {\n const {\n watchPatterns = DEFAULTS.watchPatterns,\n dedupe = [\"lit\", \"lit-element\", \"lit-html\"],\n } = options;\n\n // Combine default paths with any user-provided paths\n const allModulePaths = [...DEFAULTS.modulePaths, ...modulePaths];\n\n return [\n nodeResolve({\n dedupe,\n preferBuiltins: false,\n moduleDirectories: DEFAULTS.moduleDirectories,\n }),\n litScss({\n minify: { fast: true },\n options: {\n loadPaths: allModulePaths,\n },\n }),\n watchGlobs(watchPatterns),\n ];\n}\n\n/**\n * Creates Rollup configuration for the main bundle with output options.\n * @param {object} options - Build options.\n * @returns {object} - Complete Rollup configuration object with input and output.\n */\nexport function getMainBundleConfig(options = {}) {\n const {\n modulePaths = [],\n watch = false,\n input = [\"./src/index.js\", \"./src/registered.js\"],\n outputDir = \"./dist\",\n format = \"esm\",\n } = options;\n\n return {\n name: \"Main\",\n config: {\n input,\n output: {\n format,\n dir: outputDir,\n entryFileNames: \"[name].js\",\n },\n external: getExternalConfig(),\n plugins: getPluginsConfig(modulePaths),\n watch: getWatcherConfig(watch),\n },\n };\n}\n\n/**\n * Creates Rollup configuration for demo files.\n * @param {object} options - Build options.\n * @returns {object} - Rollup configuration object.\n */\nexport function getDemoConfig(options = {}) {\n const {\n modulePaths = [],\n watch = false,\n globPattern = \"./demo/*.js\",\n ignorePattern = [\"./demo/*.min.js\"],\n outputDir = \"./demo\",\n } = options;\n\n return {\n name: \"Demo\",\n config: {\n input: Object.fromEntries(\n glob.sync(globPattern, { ignore: ignorePattern }).map((file) => {\n const name = basename(file, \".js\");\n return [name, file];\n }),\n ),\n output: {\n format: \"esm\",\n dir: outputDir,\n entryFileNames: \"[name].min.js\",\n chunkFileNames: \"[name].min.js\",\n },\n plugins: getPluginsConfig(modulePaths),\n watch: getWatcherConfig(watch),\n },\n };\n}\n\n/**\n * Creates Rollup configuration for the d.ts files with output options.\n * @param {object} options - Configuration options\n * @returns {object} - Complete Rollup configuration object with input and output.\n */\nexport function getDtsConfig(options = {}) {\n const { input = [\"./dist/index.js\"], outputDir = \"./dist\" } = options;\n\n return {\n name: \"DTS\",\n config: {\n input,\n output: {\n format: \"esm\",\n dir: outputDir,\n entryFileNames: \"[name].d.ts\",\n },\n plugins: [dts()],\n },\n };\n}\n\n/**\n * Creates Rollup configuration for watch mode.\n * @param {boolean|object} watchOptions - Whether to enable watch mode or watch options\n * @returns {object|false} - Watch configuration for Rollup or false if disabled\n */\nexport function getWatcherConfig(watchOptions) {\n // Return false if watch mode is disabled\n if (!watchOptions) {\n return false;\n }\n\n // Allow passing a configuration object or use defaults\n const options = typeof watchOptions === \"object\" ? watchOptions : {};\n\n return {\n clearScreen: options.clearScreen ?? true,\n buildDelay: options.buildDelay ?? 500,\n chokidar: {\n ignoreInitial: true,\n // Ignore common output files that cause feedback loops\n ignored: options.ignored ?? [\n \"**/dist/**/*.d.ts\",\n \"**/custom-elements.json\",\n \"**/demo/*.md\",\n \"**/demo/**/*.min.js\",\n \"**/docs/api.md\",\n \"**/node_modules/**\",\n \"**/.git/**\",\n ],\n // Reduce watcher's sensitivity to prevent loops\n awaitWriteFinish: options.awaitWriteFinish ?? {\n stabilityThreshold: 1000,\n pollInterval: 100,\n },\n },\n include: options.include ?? [\n \"./src/**/*.js\",\n \"./src/**/*.ts\",\n \"./demo/**/*.js\",\n \"./apiExamples/**/*\",\n \"./docs/**/*.md\",\n ],\n exclude: options.exclude ?? [\"./dist/**/*\", \"./node_modules/**/*\"],\n };\n}\n\n/**\n * Creates external configuration for Rollup.\n * @param {string[]} additional - Additional external patterns\n * @returns {(string|RegExp)[]} - Array of external dependencies.\n */\nexport function getExternalConfig(additional = []) {\n const defaults = [\n // externalize all lit dependencies\n /node_modules\\/lit/,\n /node_modules\\/lit-element/,\n /node_modules\\/lit-html/,\n /node_modules\\/@lit/,\n ];\n\n return [...defaults, ...additional];\n}\n", "import path from \"node:path\";\nimport { glob } from \"glob\";\n\n/**\n * Creates a plugin that watches file globs and adds them to Rollup's watch list.\n * @param {string|string[]} globs - Glob pattern(s) to watch\n * @returns {object} - Rollup plugin\n */\nexport function watchGlobs(globs) {\n return {\n name: \"watch-globs\",\n buildStart() {\n const items = Array.isArray(globs) ? globs : [globs];\n\n for (const item of items) {\n try {\n for (const filename of glob.sync(path.resolve(item))) {\n this.addWatchFile(filename);\n }\n } catch (error) {\n this.error(`Error watching glob pattern \"${item}\": ${error.message}`);\n }\n }\n },\n };\n}\n", "import { startDevServer } from \"@web/dev-server\";\nimport { hmrPlugin } from \"@web/dev-server-hmr\";\nimport ora from \"ora\";\n\n/**\n * Default server configuration\n */\nconst DEFAULT_CONFIG = {\n watch: true,\n nodeResolve: true,\n basePath: \"/\",\n rootDir: \"./demo\",\n hmrInclude: [\"src/**/*\", \"demo/**/*\", \"apiExamples/**/*\", \"docs/**/*\"],\n};\n\n/**\n * Starts the development server\n * @param {object} options - Server options\n * @param {number} [options.port] - Port number for the server\n * @param {boolean} [options.open] - Whether to open the browser\n * @param {string} [options.rootDir] - Root directory for serving files\n * @param {string[]} [options.hmrInclude] - Patterns to include for HMR\n * @returns {Promise<object>} - The server instance\n */\nexport async function startDevelopmentServer(options = {}) {\n const serverSpinner = ora(\"Firing up dev server...\\n\").start();\n\n try {\n // Merge options with defaults\n const serverConfig = {\n port: Number(options.port) || undefined,\n open: options.open ? \"/\" : undefined,\n watch: options.watch ?? DEFAULT_CONFIG.watch,\n nodeResolve: options.nodeResolve ?? DEFAULT_CONFIG.nodeResolve,\n basePath: options.basePath ?? DEFAULT_CONFIG.basePath,\n rootDir: options.rootDir ?? DEFAULT_CONFIG.rootDir,\n\n // HTML file extension middleware\n middleware: [\n function rewriteIndex(context, next) {\n if (!context.url.endsWith(\"/\") && !context.url.includes(\".\")) {\n context.url += \".html\";\n }\n return next();\n },\n ],\n\n // Hot Module Replacement plugin\n plugins: [\n hmrPlugin({\n include: options.hmrInclude ?? DEFAULT_CONFIG.hmrInclude,\n }),\n ],\n };\n\n // Start the server with our configuration\n const server = await startDevServer({\n config: serverConfig,\n readCliArgs: false,\n readFileConfig: false,\n });\n\n serverSpinner.stop();\n return server;\n } catch (error) {\n serverSpinner.fail(\"Server snag! Couldn't start dev server.\");\n console.error(\"Error starting development server:\", error);\n throw new Error(`Development server failed to start: ${error.message}`);\n }\n}\n", "import path from \"node:path\";\nimport ora from \"ora\";\nimport { rollup } from \"rollup\";\nimport { analyzeComponents } from \"#scripts/analyze.js\";\nimport { generateDocs } from \"./bundleHandlers.js\";\nimport { getDtsConfig } from \"./configUtils.js\";\n\n// Track if any build is in progress to prevent overlapping operations\nlet buildInProgress = false;\n\n// Track build states and times in a single object for cleaner management\nconst builds = {\n dts: { active: false, lastTime: 0 },\n analyze: { active: false, lastTime: 0 },\n docs: { active: false, lastTime: 0 },\n};\n\n// Minimum time between builds of the same type (in ms)\nconst MIN_BUILD_INTERVAL = 5000;\n\n// Track source paths of files that triggered a watch event\nconst sourceEventPaths = new Set();\n\n// Known output files that should never trigger a rebuild\nconst OUTPUT_PATHS = [\n \"/dist/index.d.ts\",\n \"/custom-elements.json\",\n \"/demo/api.md\",\n \"/docs/api.md\",\n \"/demo/index.min.js\",\n];\n\n// Path matching checks - handle any non-string input safely\nfunction isOutputFile(filePath) {\n if (!filePath || typeof filePath !== \"string\") return false;\n\n try {\n const normalizedPath = path.normalize(filePath);\n\n // Check if it's in our known output paths\n return (\n OUTPUT_PATHS.some((outputPath) => normalizedPath.endsWith(outputPath)) ||\n normalizedPath.includes(\"/dist/\") ||\n normalizedPath.endsWith(\".min.js\") ||\n normalizedPath.endsWith(\".d.ts\")\n );\n } catch (error) {\n console.error(`Error checking path (${typeof filePath}):`, error.message);\n return false; // If any error occurs, assume it's not an output file\n }\n}\n\n/**\n * Runs a build task with proper tracking of state\n * @param {string} taskName - Type of task (dts, analyze, docs)\n * @param {Function} taskFn - The actual task function to run\n * @returns {Promise<boolean>} - Success status\n */\nasync function runBuildTask(taskName, taskFn) {\n const task = builds[taskName];\n\n // Skip if build is active or within throttle time\n if (task.active || Date.now() - task.lastTime < MIN_BUILD_INTERVAL) {\n return false;\n }\n\n try {\n task.active = true;\n task.lastTime = Date.now();\n return await taskFn();\n } catch (error) {\n console.error(`Error in ${taskName} task:`, error);\n return false;\n } finally {\n task.active = false;\n }\n}\n\n/**\n * Handles the watcher events.\n * @param {object} watcher - Rollup watcher object.\n * @param {object} options - Build options.\n * @param {Function} [onInitialBuildComplete] - Callback to run after initial build completes.\n */\nexport async function handleWatcherEvents(\n watcher,\n options,\n onInitialBuildComplete,\n) {\n // Track if this is the first build\n let isInitialBuild = true;\n // biome-ignore lint/style/useConst: This is an object that is mutated.\n let buildTasksResults = { dts: false, analyze: false, docs: false };\n let scheduledTasksTimer = null;\n let bundleSpinner;\n\n // Create a spinner for watch mode\n const watchSpinner = ora(\"Activating watch mode...\").start();\n\n // The actual task functions\n const buildTasks = {\n // Function to build d.ts files\n dts: async () => {\n const dtsSpinner = ora(\"Crafting type definitions...\").start();\n try {\n const create_dts = await rollup(getDtsConfig().config);\n await create_dts.write(getDtsConfig().config.output);\n await create_dts.close();\n dtsSpinner.succeed(\"Type files built.\");\n return true;\n } catch (error) {\n dtsSpinner.fail(\"Types trouble! Build failed.\");\n console.error(\"TypeScript definition build error:\", error);\n return false;\n }\n },\n\n // Function to analyze components\n analyze: async () => {\n const { wcaInput: sourceFiles, wcaOutput: outFile, skipDocs } = options;\n if (skipDocs) {\n const skipSpinner = ora(\"Skipping component analysis...\").start();\n setTimeout(() => {\n skipSpinner.succeed(\"Component analysis skipped.\");\n }, 0);\n return true;\n }\n\n const analyzeSpinner = ora(\n \"Detective work: analyzing components...\",\n ).start();\n try {\n await analyzeComponents(sourceFiles, outFile);\n analyzeSpinner.succeed(\"Component analysis complete! API generated.\");\n return true;\n } catch (error) {\n analyzeSpinner.fail(\"Analysis hiccup! Something went wrong.\");\n console.error(\"Component analysis error:\", error);\n return false;\n }\n },\n\n // Function to rebuild documentation\n docs: async () => {\n // Skip if main bundle is still building\n if (buildInProgress) {\n return false;\n }\n\n // Check if docs generation is skipped\n if (options.skipDocs) {\n const skipSpinner = ora(\"Skipping docs generation...\").start();\n setTimeout(() => {\n skipSpinner.succeed(\"Docs generation skipped.\");\n }, 0);\n return true;\n }\n\n const docsSpinner = ora(\"Refreshing docs...\").start();\n try {\n await generateDocs(options);\n docsSpinner.succeed(\"Documentation refreshed!\");\n return true;\n } catch (error) {\n docsSpinner.fail(\"Docs stumble! Couldn't refresh.\");\n console.error(\"Documentation rebuild error:\", error);\n }\n },\n };\n\n // Check if all initial build tasks completed successfully\n const checkInitialBuildComplete = () => {\n if (\n isInitialBuild &&\n buildTasksResults.dts &&\n buildTasksResults.analyze &&\n buildTasksResults.docs &&\n typeof onInitialBuildComplete === \"function\"\n ) {\n isInitialBuild = false;\n onInitialBuildComplete();\n }\n };\n\n // Schedule the post-bundle tasks with proper sequencing\n function schedulePostBundleTasks(delay = 1000) {\n if (scheduledTasksTimer) {\n clearTimeout(scheduledTasksTimer);\n }\n\n scheduledTasksTimer = setTimeout(async () => {\n // Run tasks with delays between them to avoid race conditions\n buildTasksResults.dts = await runBuildTask(\"dts\", buildTasks.dts);\n\n setTimeout(async () => {\n buildTasksResults.analyze = await runBuildTask(\n \"analyze\",\n buildTasks.analyze,\n );\n\n setTimeout(async () => {\n buildTasksResults.docs = await runBuildTask(\"docs\", buildTasks.docs);\n checkInitialBuildComplete();\n }, 1000);\n }, 1000);\n }, delay);\n }\n\n // Set up event handlers for the watcher\n watcher.on(\"event\", async (event) => {\n switch (event.code) {\n case \"START\":\n watchSpinner.succeed(\"Watch mode active! Eyes peeled.\");\n break;\n\n case \"BUNDLE_START\":\n // Clear source paths from the previous bundle operation\n sourceEventPaths.clear();\n\n // Store source file paths that triggered this build\n if (event.input) {\n try {\n // Handle different input formats safely\n const inputs = Array.isArray(event.input)\n ? event.input\n : typeof event.input === \"string\"\n ? [event.input]\n : typeof event.input === \"object\" && event.input !== null\n ? Object.values(event.input)\n : [];\n\n for (const input of inputs) {\n // Only process string inputs and skip non-string values\n if (typeof input === \"string\" && !isOutputFile(input)) {\n sourceEventPaths.add(path.normalize(input));\n }\n }\n } catch (error) {\n console.error(\"Error processing input paths:\", error);\n }\n }\n\n bundleSpinner = ora(\"Weaving bundles...\").start();\n buildInProgress = true;\n break;\n\n case \"BUNDLE_END\":\n if (bundleSpinner) {\n bundleSpinner.succeed(\n `Bundle ${Array.isArray(event.input) ? `of ${event.input.join(\"& \")} ` : \"\"}done in ${event.duration}ms! \uD83D\uDE80`,\n );\n }\n buildInProgress = false;\n\n // Schedule post-bundle tasks if source files triggered this build\n if (sourceEventPaths.size > 0) {\n schedulePostBundleTasks();\n }\n break;\n\n case \"END\":\n // We've already scheduled tasks in BUNDLE_END, nothing to do here\n break;\n\n case \"ERROR\":\n buildInProgress = false;\n if (bundleSpinner) {\n bundleSpinner.fail(`Oops! Bundle hit a snag: ${event.error.message}`);\n } else {\n ora().fail(`Watch mode hiccup: ${event.error.message}`);\n }\n sourceEventPaths.clear();\n break;\n }\n });\n}\n\n/**\n * Setup watch mode for rollup\n * @param {object} watcher - Rollup watcher instance\n */\nexport function setupWatchModeListeners(watcher) {\n process.on(\"SIGINT\", () => {\n const closeSpinner = ora(\"Wrapping up...\").start();\n watcher.close();\n closeSpinner.succeed(\"All done! See you next time. \u2728\");\n process.exit(0);\n });\n\n return watcher;\n}\n", "import { program } from \"commander\";\nimport ora from \"ora\";\nimport { withBuildOptions } from \"#commands/_sharedOptions.js\";\nimport { buildWithRollup } from \"#scripts/build/index.js\";\n\nlet buildCommand = program\n .command(\"build\")\n .description(\"Builds auro components\");\n\nbuildCommand = withBuildOptions(buildCommand, {\n watch: false,\n});\n\nexport default buildCommand.action(async (options) => {\n try {\n const build = ora(\"Initializing...\");\n\n if (options.watch) {\n build.text = \"Waiting for changes...\";\n build.spinner = \"bouncingBar\";\n build.color = \"green\";\n } else {\n build.text =\n options.docs === false\n ? \"Building component (docs disabled)\"\n : \"Building component\";\n }\n\n build.start();\n\n await buildWithRollup(options);\n\n if (!options.watch) {\n build.succeed(\"Build completed!\");\n }\n } catch (error) {\n // If there's any active spinner, we need to fail it\n ora().fail(`Build failed: ${error.message}`);\n console.error(error);\n process.exit(1);\n }\n});\n", "import { exec } from \"node:child_process\";\nimport path from \"node:path\";\nimport process from \"node:process\";\nimport { fileURLToPath } from \"node:url\";\nimport util from \"node:util\";\nimport { program } from \"commander\";\nimport inquirer from \"inquirer\";\nimport { shell } from \"#utils/shell.js\";\n\nexport default program\n .command(\"migrate\")\n .description(\"Script runner to perform repetitive code change tasks\")\n .requiredOption(\n \"-i, --id <string>\",\n \"Select the migration you would like to run by id\",\n )\n .option(\n \"-m, --multi-gitter\",\n \"Run the migration on all repositories in the multi-gitter config\",\n )\n .action(async (options) => {\n const filename = fileURLToPath(import.meta.url);\n const dirname = path.dirname(filename);\n const scriptPath = path.resolve(dirname, \"migrations\", options.id);\n\n if (options.multiGitter) {\n // Check if multi-gitter CLI command is available\n const execPromise = util.promisify(exec);\n\n try {\n await execPromise(\"command -v multi-gitter\");\n } catch {\n console.error(\"multi-gitter is not installed.\");\n process.exit(1);\n }\n\n const answers = await inquirer.prompt([\n {\n type: \"confirm\",\n name: \"dryRun\",\n message:\n \"Run migration in dry-run mode? (no changes will be committed)\",\n default: true,\n },\n ]);\n\n if (answers.dryRun) {\n shell(\n `multi-gitter run ${scriptPath}/script.sh --config \"${scriptPath}/multi-gitter.yml\" --dry-run`,\n );\n } else {\n shell(\n `multi-gitter run ${scriptPath}/script.sh --config \"${scriptPath}/multi-gitter.yml\"`,\n );\n }\n } else {\n shell(`${scriptPath}/script.sh`);\n }\n });\n", "import process from \"node:process\";\nimport { program } from \"commander\";\n\nimport { readFile, writeFile } from \"node:fs/promises\";\nimport { Logger } from \"@aurodesignsystem/auro-library/scripts/utils/logger.mjs\";\nimport { syncDotGithubDir } from \"#scripts/syncDotGithubDir.js\";\n\nexport default program\n .command(\"sync\")\n .description(\n \"Script runner to synchronize local repository configuration files\",\n )\n .action(async () => {\n Logger.info(\"Synchronizing repository configuration files...\");\n\n Logger.warn(\n \"Note: sync does not create a new git branch. Changes are added to the current branch.\",\n );\n\n const cwd = process.cwd();\n\n await syncDotGithubDir(cwd);\n\n // Cleanup for specific files\n // ------------------------------------------------------\n\n // Some files have specific cleanup tasks that need to be run after syncing\n\n // CODEOWNERS - has a bizarre issue with line endings. This is a workaround!\n // Maybe it has to do with the file type since there's no ending?\n const codeownersPath = `${cwd}/.github/CODEOWNERS`;\n const codeowners = await readFile(codeownersPath, { encoding: \"utf-8\" });\n\n // Convert line endings to \\n\n const codeownersFixed = codeowners\n .replace(/\\r\\n/gu, \"\\n\")\n .replace(/\\n\\n/gu, \"\\n\");\n await writeFile(codeownersPath, codeownersFixed, { encoding: \"utf-8\" });\n\n if (codeownersFixed.includes(\"\\r\") || codeownersFixed.includes(\"\\n\\n\")) {\n Logger.error(\"CODEOWNERS file still has Windows line endings.\");\n }\n });\n", "import fs from \"node:fs/promises\";\nimport { Logger } from \"@aurodesignsystem/auro-library/scripts/utils/logger.mjs\";\nimport {\n processContentForFile,\n templateFiller,\n} from \"@aurodesignsystem/auro-library/scripts/utils/sharedFileProcessorUtils.mjs\";\n\nconst REMOTE_TEMPLATE_BASE_URL =\n \"https://raw.githubusercontent.com/AlaskaAirlines/auro-templates\";\n\n// Constants for configuring sync branch and template selection\n// ------------------------------------------------------------\nconst BRANCH_BASE = \"main\";\nconst TARGET_BRANCH_TO_COPY = \"main\";\nconst CONFIG_TEMPLATE = \"default\";\n\n/**\n * @typedef {Object} GithubDirectory\n * @property {string[]} ISSUE_TEMPLATE - The issue template directory.\n * @property {string[]} workflows - The workflows directory.\n * @property {string} _root - The root directory (places files in .github directly).\n */\n\n/**\n * @type {GithubDirectory} githubDirectory\n */\nconst githubDirShape = {\n ISSUE_TEMPLATE: [\n \"bug_report.yaml\",\n \"config.yml\",\n \"feature_request.yaml\",\n \"general-support.yaml\",\n \"group.yaml\",\n \"story.yaml\",\n \"task.yaml\",\n ],\n workflows: [\"codeql.yml\", \"publishDemo.yml\", \"testPublish.yml\"],\n _root: [\n \"CODEOWNERS\",\n \"CODE_OF_CONDUCT.md\",\n \"CONTRIBUTING.md\",\n \"PULL_REQUEST_TEMPLATE.md\",\n \"SECURITY.md\",\n \"settings.yml\",\n \"stale.yml\",\n ],\n};\n\n// BELOW TYPES ARE COPIED DIRECTLY FROM THE LIBRARY\n// How can we import JSDoc types from the library?\n\n/**\n * This is the expected object type when passing something other than a string.\n * @typedef {Object} InputFileType\n * @property {string} remoteUrl - The remote template to fetch.\n * @property {string} fileName - Path including file name to store.\n * @property {boolean} [overwrite] - Default is true. Choose to overwrite the file if it exists.\n */\n\n/**\n * @typedef {Object} FileProcessorConfig\n * @property {string} identifier - A unique identifier for this file (used for logging).\n * @property {string | InputFileType} input - Path to an input file, including filename.\n * @property {string} output - Path to an output file, including filename.\n * @property {Partial<MarkdownMagicOptions>} [mdMagicConfig] - Extra configuration options for md magic.\n * @property {Array<(contents: string) => string>} [preProcessors] - Extra processor functions to run on content AFTER markdownmagic and BEFORE templateFiller.\n * @property {Array<(contents: string) => string>} [postProcessors] - Extra processor functions to run on content.\n */\n\n// BELOW NEEDS TO BE UPSTREAMED OR REMOVED FROM THE LIBRARY\n/**\n * Take a branch or tag name and return the URL for the README file.\n * @param {string} branchOrTag - The git branch or tag to use for the README source.\n * @param {string} filePath - The path to the file in the remote repository.\n * @returns {string} The complete URL for the remote file.\n */\nfunction branchNameToRemoteUrl(branchOrTag, filePath) {\n // check if tag starts with 'vX' since our tags are `v4.0.0`\n const isTag =\n branchOrTag.startsWith(\"v\") &&\n /^\\d+\\.\\d+\\.\\d+(?<_>-.*)?$/u.test(branchOrTag.slice(1));\n\n if (isTag) {\n return `${REMOTE_TEMPLATE_BASE_URL}/refs/tags/${branchOrTag}/${filePath}`;\n }\n\n if (branchOrTag !== BRANCH_BASE) {\n return `${REMOTE_TEMPLATE_BASE_URL}/refs/heads/${branchOrTag}/${filePath}`;\n }\n\n return `${REMOTE_TEMPLATE_BASE_URL}/${BRANCH_BASE}/${filePath}`;\n}\n\n/**\n * Take a branch or tag name and return the URL for the remote file.\n * @param {string} filePath - The name of the file to fetch.\n * @param {string} branchOrTag - The git branch or tag to use for the README source.\n * @param {string} outputPath - The path to the file in the local repository.\n * @returns {FileProcessorConfig} Configuration object for file processing.\n */\nfunction filePathToRemoteInput(filePath, branchOrTag, outputPath) {\n const remoteUrl = branchNameToRemoteUrl(branchOrTag, filePath);\n\n return {\n // Identifier is only used for logging\n identifier: filePath.split(\"/\").pop(),\n input: {\n remoteUrl,\n fileName: outputPath,\n overwrite: true,\n },\n output: outputPath,\n overwrite: true,\n };\n}\n\n/**\n * Recursively removes a directory and all its contents.\n * @param {string} dirPath - The path to the directory to remove.\n * @returns {Promise<void>} A promise that resolves when the directory is removed or rejects if an error occurs.\n * @throws {Error} If the directory cannot be removed.\n */\nasync function removeDirectory(dirPath) {\n try {\n await fs.rm(dirPath, { recursive: true, force: true });\n Logger.log(`Successfully removed directory: ${dirPath}`);\n } catch (error) {\n Logger.error(`Error removing directory ${dirPath}: ${error.message}`);\n throw error;\n }\n}\n\n/**\n * Sync the .github directory with the remote repository.\n * @param {string} rootDir - The root directory of the local repository.\n * @returns {Promise<void>} A promise that resolves when syncing is complete.\n */\nexport async function syncDotGithubDir(rootDir) {\n if (!rootDir) {\n Logger.error(\"Root directory must be specified\");\n // eslint-disable-next-line no-undef\n process.exit(1);\n }\n\n // Remove .github directory if it exists\n const githubPath = \".github\";\n\n try {\n await removeDirectory(githubPath);\n Logger.log(\".github directory removed successfully\");\n } catch (error) {\n Logger.error(`Error removing .github directory: ${error.message}`);\n // eslint-disable-next-line no-undef\n process.exit(1);\n }\n\n // Setup\n await templateFiller.extractNames();\n\n const fileConfigs = [];\n const missingFiles = [];\n\n for (const dir of Object.keys(githubDirShape)) {\n for (const file of githubDirShape[dir]) {\n const inputPath = `${dir === \"_root\" ? \"\" : `${dir}/`}${file}`;\n const outputPath = `${rootDir}/.github/${inputPath}`;\n\n const fileConfig = filePathToRemoteInput(\n `templates/${CONFIG_TEMPLATE}/.github/${inputPath}`,\n TARGET_BRANCH_TO_COPY,\n outputPath,\n );\n fileConfigs.push(fileConfig);\n }\n }\n\n // Check if files exist\n await Promise.all(\n fileConfigs.map(async (config) => {\n try {\n const response = await fetch(config.input.remoteUrl, {\n method: \"HEAD\",\n });\n if (!response.ok) {\n missingFiles.push(config.input.remoteUrl);\n }\n } catch {\n missingFiles.push(config.input.remoteUrl);\n }\n }),\n );\n\n // If missing, log and exit\n if (missingFiles.length > 0) {\n const errorMessage = missingFiles\n .map((file) => `File not found: ${file}`)\n .join(\"\\n\");\n Logger.error(\n `Failed to sync .github directory. Confirm githubDirShape object is up to date:\\n${errorMessage}`,\n );\n // eslint-disable-next-line no-undef\n process.exit(1);\n }\n\n // Process all files\n try {\n await Promise.all(\n fileConfigs.map((config) => processContentForFile(config)),\n );\n Logger.log(\"All files processed.\");\n } catch (error) {\n Logger.error(`Error processing files: ${error.message}`);\n // eslint-disable-next-line no-undef\n process.exit(1);\n }\n}\n", "/* eslint-disable no-await-in-loop, line-comment-position, no-inline-comments, jsdoc/require-jsdoc, no-undef */\n\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport { Logger } from \"@aurodesignsystem/auro-library/scripts/utils/logger.mjs\";\nimport { program } from \"commander\";\nimport { glob } from \"glob\";\nimport getTemplatedComponentCode from \"#scripts/prepWcaCompatibleCode.mjs\";\n\n// Use glob directly as it's already promised-based in newer versions\n\nconst WAC_DIR = path.resolve(process.cwd(), \"./scripts/wca\");\n\nasync function globPath(sources) {\n try {\n const fileArrays = await Promise.all(sources.map((source) => glob(source)));\n return fileArrays.flat();\n } catch (err) {\n console.error(\"Error processing glob patterns:\", err);\n throw err; // Re-throw to handle failure at caller\n }\n}\n\nasync function createExtendsFile(filePaths) {\n if (!fs.existsSync(WAC_DIR)) {\n await fs.promises.mkdir(WAC_DIR, { recursive: true });\n }\n\n for (const filePath of filePaths) {\n const resolvedPath = path.resolve(process.cwd(), filePath);\n const fileContent = await fs.promises.readFile(resolvedPath, \"utf-8\");\n const newPath = path.resolve(WAC_DIR, `${path.basename(filePath)}`);\n const newCode = getTemplatedComponentCode(\n fileContent,\n path.relative(WAC_DIR, filePath),\n );\n await fs.promises.writeFile(newPath, newCode);\n }\n}\n\nasync function main() {\n // files to analyze\n const filePaths = await globPath([\"./src/auro-*.js\"]);\n await createExtendsFile(filePaths);\n}\n\nexport default program\n .command(\"wca-setup\")\n .description(\"Set up WCA (Web Component Analyzer) for the project\")\n .action(() => {\n main()\n .then(() => {\n Logger.success(\"WCA setup completed successfully.\");\n })\n .catch((error) => {\n Logger.error(`WCA setup failed: ${error.message}`);\n });\n });\n", "/* eslint-disable require-unicode-regexp, prefer-named-capture-group, prefer-destructuring, prettier/prettier */\n\nexport default (code, sourcePath) => {\n const defaultTag = (code.match(/static register\\(name \\= (.+)\\)/) ||\n code.match(/customElements.get\\((.+?)\\)/))[1];\n const className = code.match(/export class (.+) extends/)?.[1];\n const classDesc = code.match(/\\/\\*\\*((.|\\n)*?)(\\*\\n|\\*\\/|[@])/)?.[1] || \"\";\n\n if (!defaultTag || !className) {\n return code;\n }\n return `\nimport { ${className} } from '${sourcePath}';\n\n/**${classDesc}*/\nclass ${className}WCA extends ${className} {}\n\nif (!customElements.get(${defaultTag})) {\n customElements.define(${defaultTag}, ${className}WCA);\n}\n`;\n};\n", "import { program } from \"commander\";\nimport { analyzeCommits } from \"#scripts/check-commits/commit-analyzer.ts\";\n\nexport default program\n .command(\"check-commits\")\n .alias(\"cc\")\n .option(\n \"-l, --set-label\",\n \"Set label on the pull request based on the commit message type\",\n )\n .option(\"-d, --debug\", \"Display detailed commit information for debugging\")\n .description(\n \"Check commits in the local repository for the types of semantic commit messages made and return the results.\",\n )\n .action(async (option) => {\n await analyzeCommits(option.debug, option.setLabel);\n });\n", "import chalk from \"chalk\";\nimport ora from \"ora\";\nimport type { Ora } from \"ora\";\nimport { Git } from \"#utils/gitUtils.ts\";\nimport type { CommitInfo } from \"./display-utils.ts\";\nimport { displayDebugView, getColoredType } from \"./display-utils.ts\";\nimport { applyLabelToPR, getExistingLabels } from \"./github-labels.ts\";\n\n/**\n * Analyze commit messages in the repository\n * @param debug Whether to display detailed debug information\n * @param verbose Whether to display verbose commit messages without truncation\n * @param setLabel Whether to apply a label to the PR based on commit types\n * @returns A promise that resolves when analysis is complete\n */\nexport async function analyzeCommits(\n debug = false,\n setLabel = false,\n): Promise<void> {\n const spinner = ora(\"Checking commits...\\n\").start();\n\n try {\n const commitList = await Git.getCommitMessages();\n\n // Only display commit details if debug mode is enabled\n if (debug) {\n displayDebugView(commitList);\n }\n\n spinner.succeed(`Total commits analyzed: ${commitList.length}`);\n\n if (commitList.length !== 0) {\n const commitTypes = commitList.map((commit) => commit.type);\n const uniqueTypes = Array.from(new Set(commitTypes));\n const formattedTypes = uniqueTypes\n .map((type) => getColoredType(type))\n .join(\", \");\n spinner.succeed(`Found commit types: ${formattedTypes}`);\n } else {\n spinner.info(\n \"The list of commits is created by comparing the current branch\\n\" +\n \"with the main branch. If you are on a new branch, please\\n\" +\n \"make sure to commit some changes before running this command.\",\n );\n }\n\n if (setLabel) {\n await handleLabels(commitList, spinner);\n }\n } catch (error) {\n spinner.fail(\"Error getting commit messages\");\n console.error(error);\n }\n}\n\n/**\n * Handle applying labels based on commit types\n * @param commitList The list of commits to analyze\n * @param spinner The ora spinner instance for status updates\n */\nasync function handleLabels(\n commitList: CommitInfo[],\n spinner: Ora,\n): Promise<void> {\n const validCommitTypes = [\n \"breaking\",\n \"feat\",\n \"fix\",\n \"perf\",\n \"docs\",\n \"style\",\n \"refactor\",\n \"test\",\n \"build\",\n \"ci\",\n \"chore\",\n ];\n\n const foundCommitTypes = commitList\n .map((commit) => commit.type)\n .filter((type) => validCommitTypes.includes(type));\n\n let selectedLabel = null;\n let highestPriorityIndex = Number.POSITIVE_INFINITY;\n\n for (const type of foundCommitTypes) {\n const priorityIndex = validCommitTypes.indexOf(type);\n if (priorityIndex < highestPriorityIndex) {\n highestPriorityIndex = priorityIndex;\n selectedLabel = type;\n }\n }\n\n if (selectedLabel) {\n const labelSpinner = ora(\n \"Checking existing labels on pull request...\",\n ).start();\n try {\n const existingLabels = await getExistingLabels();\n\n if (existingLabels.includes(`semantic-status: ${selectedLabel}`)) {\n labelSpinner.info(\n `Label \"semantic-status: ${getColoredType(selectedLabel)}\" already exists on the pull request.`,\n );\n return;\n }\n\n labelSpinner.text = \"Applying label to pull request...\";\n await applyLabelToPR(selectedLabel);\n labelSpinner.succeed(\n `Label \"semantic-status: ${getColoredType(selectedLabel)}\" applied to the pull request.`,\n );\n } catch (error: unknown) {\n const errorMessage =\n error instanceof Error ? error.message : String(error);\n labelSpinner.fail(errorMessage);\n }\n } else {\n spinner.warn(\n chalk.yellow(\"No semantic commit type found to apply as label.\"),\n );\n }\n}\n", "import { appendFile, readFile } from \"node:fs/promises\";\nimport { Logger } from \"@aurodesignsystem/auro-library/scripts/utils/logger.mjs\";\nimport { simpleGit } from \"simple-git\";\nimport type { SimpleGit } from \"simple-git\";\n\n// Initialize simple-git with proper typing\nlet git: SimpleGit;\ntry {\n git = simpleGit({\n baseDir: process.cwd(),\n binary: \"git\",\n maxConcurrentProcesses: 1,\n });\n} catch (error) {\n Logger.error(`Failed to initialize git: ${error}`);\n // Provide a minimal implementation to prevent runtime errors\n git = {} as SimpleGit;\n}\n\nexport class Git {\n static async checkGitignore(pattern: string) {\n if (pattern === \"\") {\n return false;\n }\n try {\n const fileContent = await readFile(\".gitignore\", \"utf-8\");\n return fileContent.includes(pattern);\n } catch (err) {\n Logger.error(`Error reading file: ${err}`);\n return false;\n }\n }\n\n static async getCommitMessages(): Promise<\n Array<{\n type: string;\n hash: string;\n date: string;\n subject: string;\n body: string;\n message: string;\n author_name: string;\n }>\n > {\n try {\n interface GitCommitType {\n hash: string;\n date: string;\n subject: string;\n body: string;\n message: string;\n author_name: string;\n type: string;\n }\n\n const currentBranch = await git.branchLocal();\n Logger.info(`Current branch: ${currentBranch.current}`);\n\n // ---- Get target branch (main) and PR commits ----\n let targetBranch = \"main\";\n let commitRange = \"\";\n\n // Check if we're in a GitHub Actions environment\n const isGitHubAction = !!process.env.GITHUB_ACTIONS;\n\n if (isGitHubAction) {\n Logger.info(\"Running in GitHub Actions environment\");\n // In GitHub Actions, we can use environment variables to determine the PR branch and base\n targetBranch = process.env.GITHUB_BASE_REF || \"main\";\n\n try {\n // Ensure target branch is fetched\n await git.fetch(\"origin\", targetBranch);\n Logger.info(`Fetched target branch: origin/${targetBranch}`);\n\n // Use the merge base between target branch and current HEAD to get PR-specific commits\n const mergeBase = await git.raw([\n \"merge-base\",\n `origin/${targetBranch}`,\n \"HEAD\",\n ]);\n\n // Get commits between merge base and HEAD - these are the PR commits\n commitRange = `${mergeBase.trim()}..HEAD`;\n Logger.info(`Using commit range: ${commitRange}`);\n } catch (error) {\n Logger.warn(`Error setting up commit range in CI: ${error}`);\n // Fall back to simpler approach (just compare with origin/targetBranch)\n commitRange = `origin/${targetBranch}..HEAD`;\n Logger.info(`Falling back to commit range: ${commitRange}`);\n }\n } else {\n // Local environment - try to determine PR commits\n Logger.info(\"Running in local environment\");\n\n try {\n // First check if origin/main exists, fetch it if needed\n try {\n await git.raw([\"rev-parse\", \"--verify\", `origin/${targetBranch}`]);\n } catch {\n Logger.info(`Fetching ${targetBranch} from origin`);\n await git.fetch(\"origin\", targetBranch);\n }\n\n // Find merge base between current branch and target branch\n const mergeBase = await git.raw([\n \"merge-base\",\n `origin/${targetBranch}`,\n currentBranch.current,\n ]);\n\n commitRange = `${mergeBase.trim()}..HEAD`;\n Logger.info(`Using commit range for PR commits: ${commitRange}`);\n } catch (error) {\n Logger.warn(`Error determining PR commits locally: ${error}`);\n\n // Fallback - use last few commits\n Logger.info(\"Falling back to analyzing recent commits\");\n commitRange = \"HEAD~10..HEAD\";\n Logger.info(`Using fallback commit range: ${commitRange}`);\n }\n }\n\n // Get and format the PR commits\n return await Git.getFormattedCommits(commitRange);\n } catch (err) {\n Logger.error(`Error getting commit messages: ${err}`);\n return [];\n }\n }\n\n // Helper function to get formatted commits for a given git range\n static async getFormattedCommits(commitRange: string): Promise<\n Array<{\n type: string;\n hash: string;\n date: string;\n subject: string;\n body: string;\n message: string;\n author_name: string;\n }>\n > {\n interface GitCommitType {\n hash: string;\n date: string;\n subject: string;\n body: string;\n message: string;\n author_name: string;\n type: string;\n }\n\n // Use a format that will let us parse each commit separately\n // %H = hash, %ad = author date, %an = author name, %s = subject, %b = body\n const branchCommitsRaw = await git.raw([\n \"log\",\n \"--pretty=format:COMMIT_START%n%H%n%ad%n%an%n%s%n%b%nCOMMIT_END\",\n \"--date=short\",\n commitRange,\n ]);\n\n // Split by our custom delimiter to get individual commits\n const commitChunks = branchCommitsRaw\n .split(\"COMMIT_START\\n\")\n .filter((chunk: string) => chunk.trim() !== \"\");\n\n const commits: GitCommitType[] = [];\n\n for (const chunk of commitChunks) {\n const parts = chunk.split(\"\\n\");\n if (parts.length >= 4) {\n const hash = parts[0];\n const date = parts[1];\n const author_name = parts[2];\n const subject = parts[3];\n\n // The rest is the body (may contain breaking changes)\n // Filter out the COMMIT_END marker\n const bodyLines = parts\n .slice(4)\n .filter((line: string) => line !== \"COMMIT_END\");\n const body = bodyLines.length > 0 ? bodyLines.join(\"\") : \"\";\n\n // Use a shorter hash format for better readability (7 characters)\n const shortHash = hash.substring(0, 7);\n\n // Determine commit type from subject\n const typeMatch = subject.match(\n /^(feat|fix|docs|style|refactor|perf|test|build|ci|chore)(\\(.+\\))?:/,\n );\n let type = typeMatch ? typeMatch[1] : \"unknown\";\n\n // Check for breaking changes\n if (body.includes(\"BREAKING CHANGE\")) {\n type = \"breaking\";\n }\n\n commits.push({\n type,\n hash: shortHash,\n date,\n subject,\n body,\n message: `${subject}${body ? `\\n\\n${body}` : \"\"}`,\n author_name,\n });\n }\n }\n\n return commits;\n }\n\n // Function to add file to .gitignore\n static async addToGitignore(pattern: string, log = true) {\n await Git.checkGitignore(pattern).then(async (result) => {\n if (result) {\n Logger.warn(`${pattern} already exists`);\n } else {\n try {\n await appendFile(\".gitignore\", `\\n${pattern}`);\n if (log) {\n Logger.success(`${pattern} added to .gitignore`);\n }\n } catch (err) {\n Logger.error(err);\n }\n }\n });\n }\n\n // Function to remove file from git cache\n static async removeFromGitCache(files: string[]) {\n try {\n await git.rmKeepLocal(files);\n Logger.success(`${files.join(\", \")} are removed from git cache`);\n } catch (err) {\n Logger.error(err);\n }\n }\n\n static async createBranch(branchName: string) {\n try {\n await git.checkoutLocalBranch(branchName);\n Logger.success(`Created and switched to ${branchName} branch`);\n } catch (err) {\n Logger.error(err);\n }\n }\n\n static async commitStagedFiles(message: string) {\n try {\n await git.add(\".\");\n await git.commit(message);\n Logger.success(`Committed with message: ${message}`);\n } catch (err) {\n Logger.error(err);\n }\n }\n}\n", "import chalk from \"chalk\";\n\n// Configuration constants for display\nexport const MAX_SUBJECT_LENGTH = 60;\nexport const MAX_BODY_LENGTH = 100;\n\nexport interface CommitInfo {\n type: string;\n hash: string;\n date: string;\n subject: string;\n body: string;\n message: string;\n author_name: string;\n}\n\n// Define valid commit types for better type checking\nexport type CommitType =\n | \"breaking\"\n | \"feat\"\n | \"fix\"\n | \"perf\"\n | \"docs\"\n | \"style\"\n | \"refactor\"\n | \"test\"\n | \"build\"\n | \"ci\"\n | \"chore\"\n | \"unknown\";\n\n/**\n * Get colored text for commit type using a more harmonious color scheme\n */\nexport function getColoredType(type: string): string {\n switch (type) {\n case \"breaking\":\n return chalk.bold.red(type);\n case \"feat\":\n return chalk.bold.green(type);\n case \"fix\":\n return chalk.bold.green(type);\n case \"perf\":\n return chalk.bold.green(type);\n case \"docs\":\n return chalk.bold.cyan(type);\n case \"style\":\n return chalk.bold.cyan(type);\n case \"refactor\":\n return chalk.bold.cyan(type);\n case \"test\":\n return chalk.bold.cyan(type);\n case \"build\":\n return chalk.bold.cyan(type);\n case \"ci\":\n return chalk.bold.cyan(type);\n case \"chore\":\n return chalk.bold.cyan(type);\n default:\n return chalk.bold.white(type);\n }\n}\n\n/**\n * Helper function to wrap long strings to new lines\n */\nexport function wrapString(str: string, maxLength: number): string {\n if (!str) {\n return \"\";\n }\n\n // If the string is shorter than maxLength, return it as is\n if (str.length <= maxLength) {\n return str;\n }\n\n // Split the string into words\n const words = str.split(\" \");\n let result = \"\";\n let currentLine = \"\";\n\n // Build wrapped text with line breaks\n for (const word of words) {\n // If adding this word would exceed maxLength, start a new line\n if ((currentLine + word).length > maxLength && currentLine.length > 0) {\n result += `${currentLine.trim()}\\n`;\n currentLine = \"\";\n }\n currentLine = `${currentLine}${word} `;\n }\n\n // Add the last line\n if (currentLine.length > 0) {\n result += currentLine.trim();\n }\n\n return result;\n}\n\n/**\n * Display commits in a debug format with detailed information\n */\nexport function displayDebugView(commitList: CommitInfo[]): void {\n for (const commit of commitList) {\n console.log(\"\u2500\".repeat(60));\n\n // Use a consistent color theme for metadata\n const subject = wrapString(commit.subject, MAX_SUBJECT_LENGTH);\n const body = wrapString(commit.body, MAX_BODY_LENGTH);\n\n // Display commit info in a more compact format\n console.log(chalk.bold(`${getColoredType(commit.type)}`));\n console.log(\n chalk.dim(`${commit.hash} | ${commit.date} | ${commit.author_name}`),\n );\n console.log(chalk.bold(`${chalk.white(subject)}`));\n\n // Only add body if it exists and keep it more compact\n if (commit.body) {\n console.log(chalk.dim(body));\n }\n }\n console.log(\"\u2500\".repeat(60));\n console.log(\"\\n\");\n}\n", "import github from \"@actions/github\";\n\n/**\n * Get existing labels from the current pull request in a GitHub Actions environment\n * @returns Promise that resolves with an array of label names\n */\nexport async function getExistingLabels(): Promise<string[]> {\n try {\n // Get the GitHub token from environment\n const token = process.env.GITHUB_TOKEN;\n\n if (!token) {\n throw new Error(\"GITHUB_TOKEN environment variable is not set\");\n }\n\n // Check if we're in a GitHub Actions environment\n if (!process.env.GITHUB_REPOSITORY || !process.env.GITHUB_EVENT_PATH) {\n throw new Error(\n \"This function can only be used in a GitHub Actions environment\",\n );\n }\n\n const octokit = github.getOctokit(token);\n const { context } = github;\n\n // Make sure we're in a pull request context\n if (!context.payload.pull_request) {\n throw new Error(\"No pull request found in the GitHub context\");\n }\n\n const [owner, repo] = process.env.GITHUB_REPOSITORY.split(\"/\");\n const prNumber = context.payload.pull_request.number;\n\n // Get existing labels\n const { data: existingLabels } =\n await octokit.rest.issues.listLabelsOnIssue({\n owner,\n repo,\n issue_number: prNumber,\n });\n\n // Return array of label names\n return existingLabels.map((label) => label.name);\n } catch (error) {\n if (error instanceof Error) {\n throw new Error(`Failed to get existing labels: ${error.message}`);\n }\n throw error;\n }\n}\n\n/**\n * Apply a label to the current pull request in a GitHub Actions environment\n * @param label The label to apply to the pull request\n * @returns Promise that resolves when the label is applied\n */\nexport async function applyLabelToPR(label: string): Promise<void> {\n try {\n // Get the GitHub token from environment\n const token = process.env.GITHUB_TOKEN;\n\n if (!token) {\n throw new Error(\"GITHUB_TOKEN environment variable is not set\");\n }\n\n // Check if we're in a GitHub Actions environment\n if (!process.env.GITHUB_REPOSITORY || !process.env.GITHUB_EVENT_PATH) {\n throw new Error(\n \"This function can only be used in a GitHub Actions environment\",\n );\n }\n\n const octokit = github.getOctokit(token);\n const { context } = github;\n\n // Make sure we're in a pull request context\n if (!context.payload.pull_request) {\n throw new Error(\"No pull request found in the GitHub context\");\n }\n\n const [owner, repo] = process.env.GITHUB_REPOSITORY.split(\"/\");\n const prNumber = context.payload.pull_request.number;\n\n // Add prefix to the label\n const prefixedLabel = `semantic-status: ${label}`;\n\n // Get existing labels\n const existingLabels = await getExistingLabels();\n\n // If the label we want to apply already exists, do nothing\n if (existingLabels.includes(prefixedLabel)) {\n return;\n }\n\n // Find existing semantic status labels that are different from the one we want to apply\n const existingSemanticLabels = existingLabels.filter(\n (existingLabel) =>\n existingLabel.startsWith(\"semantic-status:\") &&\n existingLabel !== prefixedLabel,\n );\n\n // Remove existing semantic status labels that don't match the new one\n for (const existingLabel of existingSemanticLabels) {\n await octokit.rest.issues.removeLabel({\n owner,\n repo,\n issue_number: prNumber,\n name: existingLabel,\n });\n }\n\n // Add the new semantic status label\n await octokit.rest.issues.addLabels({\n owner,\n repo,\n issue_number: prNumber,\n labels: [prefixedLabel],\n });\n\n return;\n } catch (error) {\n if (error instanceof Error) {\n throw new Error(`Failed to apply label: ${error.message}`);\n }\n throw error;\n }\n}\n", "import fs from \"node:fs\";\nimport { get } from \"node:https\"; // Change to https\nimport chalk from \"chalk\";\nimport { program } from \"commander\";\nimport ora from \"ora\";\nimport type { Ora } from \"ora\";\n\nexport default program\n .command(\"pr-release\")\n .option(\n \"-n, --namespace <package-namespace>\",\n \"Set namespace of the package release\",\n \"@aurodesignsystem-dev\",\n )\n .option(\n \"-p, --pr-number <number>\",\n \"Set pull request number for the release\",\n \"0\",\n )\n .description(\n \"Generate the package version based off of PR number then update the package.json file. Note: this does not publish the package.\",\n )\n .action(async (option) => {\n await updatePackageJson(option);\n });\n\ninterface ReleaseOptions {\n namespace: string;\n prNumber: number;\n}\n\nconst updatePackageJson = async (option: ReleaseOptions): Promise<void> => {\n const { namespace, prNumber } = option;\n\n const packageSpinner = ora(\"Updating package.json\").start();\n\n try {\n const packageJsonPath = \"package.json\";\n\n // Read package.json\n const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, \"utf8\"));\n\n // Check if release version is on npmjs already\n packageSpinner.text = \"Checking npm registry for version information...\";\n\n const releaseVersion = `0.0.0-pr${prNumber}`;\n const packageComponent = packageJson.name.split(\"/\")[1];\n const packageName = `${namespace}/${packageComponent}`;\n const incrementVersion = await getIncrementVersion(\n releaseVersion,\n packageName,\n packageSpinner,\n );\n const packageVersion = `${releaseVersion}.${incrementVersion}`;\n\n packageJson.name = packageName;\n packageJson.version = packageVersion;\n\n packageSpinner.text = \"Writing updated package.json...\";\n\n // Write the updated package.json back to the file\n fs.writeFileSync(\n packageJsonPath,\n `${JSON.stringify(packageJson, null, 2)}\\n`,\n \"utf8\",\n );\n\n packageSpinner.succeed(\n `Package.json updated to use ${chalk.green(packageVersion)} and ${chalk.green(packageName)}`,\n );\n\n // Explicitly exit with success code to ensure terminal prompt returns\n process.exit(0);\n } catch (error: unknown) {\n packageSpinner.fail(`Failed to update package.json: ${error}`);\n process.exit(1); // Exit with error code\n }\n};\n\n// checks if version exists on npmjs and returns the next available increment version\nconst getIncrementVersion = (\n releaseVersion: string,\n packageName: string,\n spinner: Ora,\n): Promise<number> => {\n return new Promise((resolve) => {\n try {\n // Use the registry URL to get all versions for the package\n const registryUrl = `https://registry.npmjs.org/${packageName}`;\n\n const req = get(\n registryUrl,\n {\n headers: { Accept: \"application/json\" },\n },\n (res) => {\n // Handle redirects\n if (\n (res.statusCode === 301 || res.statusCode === 302) &&\n res.headers.location\n ) {\n // Persist redirect message\n spinner.info(`Following redirect to ${res.headers.location}...`);\n try {\n get(\n res.headers.location,\n { headers: { Accept: \"application/json\" } },\n handleResponse,\n )\n .on(\"error\", (err) => {\n // On redirect error, default to 0\n spinner.warn(\n `Error following redirect: ${err.message}, defaulting to version 0`,\n );\n resolve(0);\n })\n .end();\n } catch (error) {\n // If redirect request fails, default to 0\n spinner.warn(\n `Redirect request failed: ${error instanceof Error ? error.message : \"Unknown error\"}, defaulting to version 0`,\n );\n resolve(0);\n }\n return;\n }\n\n handleResponse(res);\n },\n );\n\n function handleResponse(res: import(\"http\").IncomingMessage) {\n if (res.statusCode !== 200) {\n // If package not found or other error, we can start with version 0\n spinner.info(\n `Package not found. Status code: ${chalk.red(res.statusCode)}, defaulting to version 0`,\n );\n resolve(0);\n return;\n }\n\n spinner.text = \"Processing version information...\";\n let data = \"\";\n res.on(\"data\", (chunk: Buffer | string) => {\n data += chunk;\n });\n\n res.on(\"end\", () => {\n try {\n const packageData = JSON.parse(data);\n const versions = packageData.versions\n ? Object.keys(packageData.versions)\n : [];\n\n spinner.text = \"Calculating next version number...\";\n\n // Find the highest existing iteration for this release version\n let maxIteration = -1;\n const versionRegex = new RegExp(`^${releaseVersion}\\\\.(\\\\d+)$`);\n\n for (const version of versions) {\n const match = version.match(versionRegex);\n if (match) {\n const iteration = Number.parseInt(match[1], 10);\n maxIteration = Math.max(maxIteration, iteration);\n }\n }\n\n // Return the next iteration number and persist this important info\n if (maxIteration >= 0) {\n spinner.info(\n `Found existing version ${chalk.green(`${releaseVersion}.${maxIteration}`)}. Incrementing to ${chalk.green(`${releaseVersion}.${maxIteration + 1}`)}`,\n );\n } else {\n spinner.info(\n `No existing version found for ${chalk.green(releaseVersion)}. Starting with ${chalk.green(`${releaseVersion}.0`)}`,\n );\n }\n resolve(maxIteration + 1);\n } catch (error) {\n // In case of parsing error, default to 0\n spinner.warn(\n `Failed to parse NPM registry response: ${error instanceof Error ? error.message : \"Unknown error\"}, defaulting to version 0`,\n );\n resolve(0);\n }\n });\n }\n\n req.on(\"error\", (err) => {\n // On request error, default to 0\n spinner.warn(`Request error: ${err.message}, defaulting to version 0`);\n resolve(0);\n });\n\n req.end();\n } catch (error) {\n // Catch any other errors and default to 0\n spinner.warn(\n \"Error checking version in npm registry, defaulting to version 0\",\n );\n resolve(0);\n }\n });\n};\n", "import path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { program } from \"commander\";\nimport { shell } from \"#utils/shell.js\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst cliRootDir = path.resolve(path.dirname(__filename), \"..\");\n\nexport default program\n .command(\"test\")\n .option(\"-w, --watch\", \"Set watch number for the test\")\n .description(\"Run the web test runner to test the component library\")\n .action(async (option) => {\n const command = `npx wtr --config ${cliRootDir}/dist/configs/web-test-runner.config.mjs`;\n\n if (option.watch) {\n shell(`${command} --watch`);\n return;\n }\n\n shell(command);\n });\n"],
5
- "mappings": ";AAAA,OAAS,WAAAA,MAAe,YCAxB,OAAOC,OAAY,SACnB,OAAS,QAAAC,OAAY,kBAErB,IAAOC,GAAQ,IACND,GAAKD,GAAO,SAAS,UAAU,CAAC,ECHzC,OAAOG,OAAQ,UACf,OAAOC,OAAU,YACjB,OAAS,iBAAAC,OAAqB,WAM9B,SAASC,EAASC,EAAS,CACrB,QAAQ,IAAI,OACd,QAAQ,IAAI,WAAWA,CAAO,EAAE,CAEpC,CAMe,SAARC,GAAqC,CAC1C,GAAI,CAEF,IAAMC,EAAaJ,GAAc,YAAY,GAAG,EAC1CK,EAAYN,GAAK,QAAQK,CAAU,EACzCH,EAAS,wBAAwBI,CAAS,EAAE,EAG5C,IAAMC,EAAcP,GAAK,QAAQM,EAAW,KAAM,cAAc,EAGhE,OADAJ,EAAS,6BAA6BK,CAAW,EAAE,EAC/CR,GAAG,WAAWQ,CAAW,GAC3BL,EAAS,0BAA0BK,CAAW,EAAE,EAC5B,KAAK,MAAMR,GAAG,aAAaQ,EAAa,MAAM,CAAC,EAChD,UAIrBL,EACE,8FACF,EACO,QACT,OAASM,EAAO,CACd,eAAQ,MAAM,oCAAqCA,CAAK,EACjD,OACT,CACF,CC7CA,OAAS,WAAAC,OAAe,YACxB,OAAOC,OAAS,MCIT,SAASC,EAAiBC,EAAS,CAAE,MAAAC,EAAQ,EAAM,EAAG,CAC3D,OAAOD,EACJ,OAAO,gCAAiC,gCAAgC,EACxE,OACC,UACA,6DACAC,CACF,EACC,OAAO,cAAe,gCAAiC,EAAK,EAC5D,OACC,yBACA,iDACF,EACC,OAAO,0BAA2B,sCAAsC,CAC7E,CAKO,SAASC,GAAkBF,EAAS,CACzC,OAAOA,EACJ,OAAO,sBAAuB,yBAAyB,EACvD,OAAO,aAAc,4CAA4C,CACtE,C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YAAY,YAAaE,GAAW,CAAC,EAE7CF,EAAQ,MAAM",
4
+ "sourcesContent": ["import { program } from \"commander\";\nimport auroSplash from \"#utils/auroSplash.js\";\nimport getPackageVersion from \"#utils/packageVersion.js\";\n\n// Register commands (importing them will register them)\nimport \"#commands/dev.js\";\nimport \"#commands/build.js\";\nimport \"#commands/migrate.js\";\nimport \"#commands/sync.js\";\nimport \"#commands/wca-setup.js\";\nimport \"#commands/check-commits.ts\";\nimport \"#commands/pr-release.ts\";\nimport \"#commands/test.js\";\n\nprogram\n .name(\"auro\")\n .version(getPackageVersion())\n .description(\"A cli tool to support the Auro Design System\");\n\nprogram.addHelpText(\"beforeAll\", auroSplash());\n\nprogram.parse();\n", "import figlet from \"figlet\";\nimport { mind } from \"gradient-string\";\n\nexport default () => {\n return mind(figlet.textSync(\"Auro CLI\"));\n};\n", "/* eslint-disable no-underscore-dangle, no-undef */\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\n/**\n * Simple debug logger that only prints when DEBUG environment variable is set.\n * @param {string} message - The message to log.\n */\nfunction debugLog(message) {\n if (process.env.DEBUG) {\n console.log(`[DEBUG] ${message}`);\n }\n}\n\n/**\n * Retrieves the version from the package.json file.\n * @returns {string} The version from package.json.\n */\nexport default function getPackageVersion() {\n try {\n // Get the directory path of the current module\n const __filename = fileURLToPath(import.meta.url);\n const __dirname = path.dirname(__filename);\n debugLog(`Current module path: ${__dirname}`);\n\n // Standard installed module location - current directory\n const packagePath = path.resolve(__dirname, \"..\", \"package.json\");\n\n debugLog(`Checking package.json at: ${packagePath}`);\n if (fs.existsSync(packagePath)) {\n debugLog(`Found package.json at: ${packagePath}`);\n const packageJson = JSON.parse(fs.readFileSync(packagePath, \"utf8\"));\n return packageJson.version;\n }\n\n // Fallback to a default version if we can't find the package.json\n debugLog(\n \"Could not find package.json in the standard installed module location, using default version\",\n );\n return \"0.0.0\";\n } catch (error) {\n console.error(\"Error retrieving package version:\", error);\n return \"0.0.0\";\n }\n}\n", "import { program } from \"commander\";\nimport ora from \"ora\";\nimport {\n withBuildOptions,\n withServerOptions,\n} from \"#commands/_sharedOptions.js\";\nimport { buildWithRollup } from \"#scripts/build/index.js\";\n\nlet devCommand = program\n .command(\"dev\")\n .description(\"Runs development server for auro components\");\n\ndevCommand = withBuildOptions(devCommand, {\n watch: true,\n});\ndevCommand = withServerOptions(devCommand);\n\nexport default devCommand.action(async (options) => {\n try {\n const build = ora(\"Initializing...\");\n\n if (options.watch) {\n build.text = \"Waiting for changes...\";\n build.spinner = \"bouncingBar\";\n build.color = \"green\";\n } else {\n build.text =\n options.docs === false\n ? \"Building component (docs disabled)\"\n : \"Building component\";\n }\n\n build.start();\n\n await buildWithRollup({ ...options, dev: true, watch: true });\n } catch (error) {\n // If there's any active spinner, we need to fail it\n ora().fail(`Build failed: ${error.message}`);\n console.error(error);\n process.exit(1);\n }\n});\n", "/**\n * @param {import('commander').Command} command\n * @param {{ watch: boolean }} options\n * @returns {import('commander').Command}\n */\nexport function withBuildOptions(command, { watch = false }) {\n return command\n .option(\"-m, --module-paths [paths...]\", \"Path(s) to node_modules folder\")\n .option(\n \"--watch\",\n \"Watch for changes - default for dev mode, opt-in for build\",\n watch,\n )\n .option(\"--skip-docs\", \"Skip documentation generation\", false)\n .option(\n \"--wca-input [files...]\",\n \"Source file(s) to analyze for API documentation\",\n )\n .option(\"--wca-output [files...]\", \"Output file(s) for API documentation\");\n}\n\n/**\n * @param {import('commander').Command} command\n */\nexport function withServerOptions(command) {\n return command\n .option(\"-p, --port <number>\", \"Port for the dev server\")\n .option(\"-o, --open\", \"Open the browser after starting the server\");\n}\n", "import terser from \"@rollup/plugin-terser\";\nimport { watch } from \"rollup\";\nimport {\n buildCombinedBundle,\n buildTypeDefinitions,\n cleanupDist,\n generateDocs,\n} from \"./bundleHandlers.js\";\nimport {\n getDemoConfig,\n getDtsConfig,\n getMainBundleConfig,\n} from \"./configUtils.js\";\nimport { startDevelopmentServer } from \"./devServerUtils.js\";\nimport {\n handleWatcherEvents,\n setupWatchModeListeners,\n} from \"./watchModeHandlers.js\";\n\n/**\n * Run a production build once\n * @param {object} options - Build options\n * @returns {Promise<void>}\n */\nasync function runProductionBuild(options) {\n const mainBundleConfig = getMainBundleConfig(options);\n const demoConfig = getDemoConfig(options);\n const dtsConfig = getDtsConfig();\n\n // Add terser for minification in production\n mainBundleConfig.config.plugins.push(terser());\n\n // Generate docs if enabled\n await generateDocs(options);\n\n // Build main and demo bundles\n await buildCombinedBundle(mainBundleConfig.config, demoConfig.config);\n\n // Build TypeScript definitions\n await buildTypeDefinitions(dtsConfig.config, dtsConfig.config.output);\n}\n\n/**\n * Set up watch mode for development\n * @param {object} options - Build options\n * @returns {Promise<object>} - Rollup watcher\n */\nasync function setupWatchMode(options) {\n const { dev: isDevMode } = options;\n const mainBundleConfig = getMainBundleConfig({ ...options, watch: true });\n const demoConfig = getDemoConfig({ ...options, watch: true });\n\n // Create and configure the watcher\n const watcher = watch([mainBundleConfig.config, demoConfig.config]);\n\n // Set up watcher event handlers\n handleWatcherEvents(\n watcher,\n options,\n isDevMode ? async () => startDevelopmentServer(options) : undefined,\n );\n\n // Set up clean shutdown\n setupWatchModeListeners(watcher);\n\n return watcher;\n}\n\n/**\n * Build the component using Rollup with the provided options\n * @param {object} options - Build configuration options\n * @param {boolean} [options.dev=false] - Whether to run in development mode\n * @param {boolean} [options.watch] - Whether to run in watch mode (defaults to value of dev)\n * @param {boolean} [options.docs=true] - Whether to generate documentation\n * @returns {Promise<object|void>} - Rollup watcher if in watch mode\n */\nexport async function buildWithRollup(options = {}) {\n try {\n const { dev: isDevMode = false, watch: isWatchMode = isDevMode } = options;\n\n // Clean output directory\n cleanupDist();\n\n // Run production build once or set up watch mode\n if (!isDevMode && !isWatchMode) {\n return await runProductionBuild(options);\n // biome-ignore lint/style/noUselessElse: This else is the difference between build or dev.\n } else {\n return await setupWatchMode(options);\n }\n } catch (error) {\n throw new Error(`Build failed: ${error.message}`);\n }\n}\n\n// Re-export utilities for backward compatibility\nexport { cleanupDist };\n", "import { rmSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport ora from \"ora\";\nimport { rollup } from \"rollup\";\nimport { analyzeComponents } from \"#scripts/analyze.js\";\nimport { runDefaultDocsBuild } from \"#scripts/build/defaultDocsBuild.js\";\n\n/**\n * Clean up the dist folder\n * @returns {boolean} Success status\n */\nexport function cleanupDist() {\n const distPath = join(\"./dist\");\n const spinner = ora(\"Cleaning dist folder...\").start();\n\n try {\n rmSync(distPath, { recursive: true, force: true });\n spinner.succeed(\"All clean! Dist folder wiped.\");\n return true;\n } catch (error) {\n spinner.fail(`Oops! Couldn't clean dist/ folder: ${error.message}`);\n console.error(error);\n return false;\n }\n}\n\n/**\n * Run a build step with spinner feedback\n * @param {string} taskName - Name of the task for spinner text\n * @param {Function} taskFn - Async function to execute the task\n * @param {string} successMsg - Message to show on success\n * @param {string} failMsg - Message to show on failure\n * @returns {Promise<any>} - Result of the task function or throws error\n */\nasync function runBuildStep(taskName, taskFn, successMsg, failMsg) {\n const spinner = ora(taskName).start();\n\n try {\n const result = await taskFn();\n spinner.succeed(successMsg);\n return result;\n } catch (error) {\n spinner.fail(failMsg);\n console.error(`Error: ${error.message}`);\n throw error;\n }\n}\n\n/**\n * Builds the TypeScript definition files\n * @param {object} config - Rollup config for d.ts generation\n * @param {object} outputConfig - Output configuration for d.ts files\n */\nexport async function buildTypeDefinitions(config, outputConfig) {\n return runBuildStep(\n \"Creating type definitions...\",\n async () => {\n const bundle = await rollup(config);\n await bundle.write(outputConfig);\n await bundle.close();\n },\n \"Types files built.\",\n \"Darn! Type definitions failed.\",\n );\n}\n\n/**\n * Builds both the main bundle and demo files in one operation\n * @param {object} mainConfig - Rollup config for the main bundle\n * @param {object} demoConfig - Rollup config for the demo files\n */\nexport async function buildCombinedBundle(mainConfig, demoConfig) {\n return runBuildStep(\n `Bundling ${mainConfig.name || \"main\"} and ${demoConfig.name || \"demo\"}...`,\n async () => {\n // Build main bundle\n const mainBundle = await rollup(mainConfig);\n await mainBundle.write(mainConfig.output);\n await mainBundle.close();\n\n // Build demo files\n const demoBundle = await rollup(demoConfig);\n await demoBundle.write(demoConfig.output);\n await demoBundle.close();\n },\n `Bundles ready! ${mainConfig.name || \"Main\"} and ${demoConfig.name || \"demo\"} built.`,\n \"Bundle hiccup! Build failed.\",\n );\n}\n\n/**\n * Analyzes web components and generates API documentation.\n * @param {object} options - Options containing wcaInput and wcaOutput\n */\nexport async function generateDocs(options) {\n const { wcaInput: sourceFiles, wcaOutput: outFile, skipDocs } = options;\n\n if (skipDocs) {\n const skipSpinner = ora(\"Skipping docs generation...\").start();\n\n setTimeout(() => {\n skipSpinner.succeed(\"Docs generation skipped.\");\n }, 0);\n return;\n }\n\n return runBuildStep(\n \"Analyzing components and making docs...\",\n async () => {\n await analyzeComponents(sourceFiles, outFile);\n await runDefaultDocsBuild();\n },\n \"Docs ready! Looking good.\",\n \"Doc troubles!\",\n );\n}\n", "import { spawn } from \"node:child_process\";\nimport ora from \"ora\";\n\nconst shell = (command, _args) => {\n const commandString = `${command} ${_args ? _args.join(\" \") : \"\"}`;\n\n // Initialize the spinner but don't start it - we'll just use it for completion status\n const spinner = ora();\n\n // Parse command string if no args are provided\n let finalCommand = command;\n let finalArgs = _args || [];\n\n if (!_args && typeof command === \"string\") {\n const parts = command.split(\" \");\n finalCommand = parts[0];\n finalArgs = parts.slice(1);\n }\n\n // Simple check for watch mode - if the command contains --watch or -w flags\n const isWatchMode =\n commandString.includes(\"--watch\") || commandString.includes(\" -w\");\n\n // Use different stdio configurations based on watch mode\n const stdio = isWatchMode\n ? \"inherit\" // Full TTY support for watch mode\n : [\"inherit\", \"pipe\", \"pipe\"]; // Capture output but allow input for normal mode\n\n const child = spawn(finalCommand, finalArgs, {\n stdio,\n shell: true,\n });\n\n // Only set up output capture if we're not in watch mode (stdio isn't 'inherit')\n if (!isWatchMode) {\n // Store command output to display after completion\n const commandOutput = [];\n\n child.stdout?.on(\"data\", (data) => {\n // Convert buffer to string\n const output = data.toString();\n\n // Store full output\n commandOutput.push(output);\n\n // Output directly to console\n process.stdout.write(output);\n });\n\n child.stderr?.on(\"data\", (data) => {\n const output = data.toString();\n commandOutput.push(output);\n process.stderr.write(output);\n });\n }\n\n // Set up a promise to track command completion\n return new Promise((resolve, reject) => {\n child.on(\"close\", (code) => {\n if (code !== 0) {\n // In watch mode, don't treat exit codes as errors - these are typically user terminations\n if (isWatchMode) {\n spinner.info(`Watch mode terminated with code ${code}`);\n resolve(); // Resolve without an error for watch mode commands\n } else {\n spinner.fail(`${commandString} failed (code ${code})`);\n reject(new Error(`Command failed with exit code ${code}`));\n }\n } else {\n spinner.succeed(`${commandString} completed successfully`);\n resolve();\n }\n });\n });\n};\n\nexport { shell };\n", "import { shell } from \"#utils/shell.js\";\n\n/**\n * Analyzes web components and generates API documentation.\n * @param {string[]} sourceFiles - Array of file paths to analyze.\n * @param {string} outFile - Output file path.\n */\nexport async function analyzeComponents(sourceFiles, outFile) {\n shell(\n `npx wca analyze ${sourceFiles || \"scripts/wca/*\"} --outFiles ${outFile || \"docs/api.md\"}`,\n );\n}\n", "import { Logger } from \"@aurodesignsystem/auro-library/scripts/utils/logger.mjs\";\nimport {\n generateReadmeUrl,\n processContentForFile,\n templateFiller,\n} from \"@aurodesignsystem/auro-library/scripts/utils/sharedFileProcessorUtils.mjs\";\n\n/**\n * Processor config object.\n * @typedef {Object} ProcessorConfig\n * @property {boolean} [overwriteLocalCopies=true] - The release version tag to use instead of master.\n * @property {string} [remoteReadmeVersion=\"master\"] - The release version tag to use instead of master.\n * @property {string} [remoteReadmeVariant=\"\"] - The variant string to use for the README source.\n * (like \"_esm\" to make README_esm.md).\n */\n\n/**\n * @param {ProcessorConfig} config - The configuration for this processor.\n */\nexport const defaultDocsProcessorConfig = {\n overwriteLocalCopies: true,\n remoteReadmeVersion: \"master\",\n // eslint-disable-next-line no-warning-comments\n // TODO: remove this variant when all components are updated to use latest auro-library\n // AND the default README.md is updated to use the new paths\n remoteReadmeVariant: \"_updated_paths\",\n};\n\nfunction pathFromCwd(pathLike) {\n const cwd = process.cwd();\n return `${cwd}/${pathLike}`;\n}\n\n/**\n * @param {ProcessorConfig} config - The configuration for this processor.\n * @returns {import('../utils/sharedFileProcessorUtils').FileProcessorConfig[]}\n */\nexport const fileConfigs = (config) => [\n // README.md\n {\n identifier: \"README.md\",\n input: {\n remoteUrl: generateReadmeUrl(\n config.remoteReadmeVersion,\n config.remoteReadmeVariant,\n ),\n fileName: pathFromCwd(\"/docTemplates/README.md\"),\n overwrite: config.overwriteLocalCopies,\n },\n output: pathFromCwd(\"/README.md\"),\n },\n // index.md\n {\n identifier: \"index.md\",\n input: pathFromCwd(\"/docs/partials/index.md\"),\n output: pathFromCwd(\"/demo/index.md\"),\n mdMagicConfig: {\n output: {\n directory: pathFromCwd(\"/demo\"),\n },\n },\n },\n // api.md\n {\n identifier: \"api.md\",\n input: pathFromCwd(\"/docs/partials/api.md\"),\n output: pathFromCwd(\"/demo/api.md\"),\n preProcessors: [templateFiller.formatApiTable],\n },\n];\n\n/**\n *\n * @param {ProcessorConfig} config - The configuration for this processor.\n * @return {Promise<void>}\n */\nexport async function processDocFiles(config = defaultDocsProcessorConfig) {\n // setup\n await templateFiller.extractNames();\n\n for (const fileConfig of fileConfigs(config)) {\n try {\n // eslint-disable-next-line no-await-in-loop\n await processContentForFile(fileConfig);\n } catch (err) {\n Logger.error(`Error processing ${fileConfig.identifier}: ${err.message}`);\n }\n }\n}\n\nexport async function runDefaultDocsBuild() {\n await processDocFiles();\n}\n", "import { basename } from \"node:path\";\nimport { nodeResolve } from \"@rollup/plugin-node-resolve\";\nimport { glob } from \"glob\";\nimport { dts } from \"rollup-plugin-dts\";\nimport { litScss } from \"rollup-plugin-scss-lit\";\nimport { watchGlobs } from \"./plugins.js\";\n\n// Default paths used across configurations\nconst DEFAULTS = {\n moduleDirectories: [\"node_modules\"],\n modulePaths: [\"../../node_modules\", \"../node_modules\", \"node_modules\"],\n watchPatterns: [\"./apiExamples/**/*\", \"./docs/**/*\"],\n};\n\n/**\n * Creates Rollup plugins configuration.\n * @param {string[]} modulePaths - Additional paths to include in litScss.\n * @param {object} options - Additional options for plugins\n * @returns {object[]} - Array of Rollup plugins.\n */\nexport function getPluginsConfig(modulePaths = [], options = {}) {\n const {\n watchPatterns = DEFAULTS.watchPatterns,\n dedupe = [\"lit\", \"lit-element\", \"lit-html\"],\n } = options;\n\n // Combine default paths with any user-provided paths\n const allModulePaths = [...DEFAULTS.modulePaths, ...modulePaths];\n\n return [\n nodeResolve({\n dedupe,\n preferBuiltins: false,\n moduleDirectories: DEFAULTS.moduleDirectories,\n }),\n litScss({\n minify: { fast: true },\n options: {\n loadPaths: allModulePaths,\n },\n }),\n watchGlobs(watchPatterns),\n ];\n}\n\n/**\n * Creates Rollup configuration for the main bundle with output options.\n * @param {object} options - Build options.\n * @returns {object} - Complete Rollup configuration object with input and output.\n */\nexport function getMainBundleConfig(options = {}) {\n const {\n modulePaths = [],\n watch = false,\n input = [\"./src/index.js\", \"./src/registered.js\"],\n outputDir = \"./dist\",\n format = \"esm\",\n } = options;\n\n return {\n name: \"Main\",\n config: {\n input,\n output: {\n format,\n dir: outputDir,\n entryFileNames: \"[name].js\",\n },\n external: getExternalConfig(),\n plugins: getPluginsConfig(modulePaths),\n watch: getWatcherConfig(watch),\n },\n };\n}\n\n/**\n * Creates Rollup configuration for demo files.\n * @param {object} options - Build options.\n * @returns {object} - Rollup configuration object.\n */\nexport function getDemoConfig(options = {}) {\n const {\n modulePaths = [],\n watch = false,\n globPattern = \"./demo/*.js\",\n ignorePattern = [\"./demo/*.min.js\"],\n outputDir = \"./demo\",\n } = options;\n\n return {\n name: \"Demo\",\n config: {\n input: Object.fromEntries(\n glob.sync(globPattern, { ignore: ignorePattern }).map((file) => {\n const name = basename(file, \".js\");\n return [name, file];\n }),\n ),\n output: {\n format: \"esm\",\n dir: outputDir,\n entryFileNames: \"[name].min.js\",\n chunkFileNames: \"[name].min.js\",\n },\n plugins: getPluginsConfig(modulePaths),\n watch: getWatcherConfig(watch),\n },\n };\n}\n\n/**\n * Creates Rollup configuration for the d.ts files with output options.\n * @param {object} options - Configuration options\n * @returns {object} - Complete Rollup configuration object with input and output.\n */\nexport function getDtsConfig(options = {}) {\n const { input = [\"./dist/index.js\"], outputDir = \"./dist\" } = options;\n\n return {\n name: \"DTS\",\n config: {\n input,\n output: {\n format: \"esm\",\n dir: outputDir,\n entryFileNames: \"[name].d.ts\",\n },\n plugins: [dts()],\n },\n };\n}\n\n/**\n * Creates Rollup configuration for watch mode.\n * @param {boolean|object} watchOptions - Whether to enable watch mode or watch options\n * @returns {object|false} - Watch configuration for Rollup or false if disabled\n */\nexport function getWatcherConfig(watchOptions) {\n // Return false if watch mode is disabled\n if (!watchOptions) {\n return false;\n }\n\n // Allow passing a configuration object or use defaults\n const options = typeof watchOptions === \"object\" ? watchOptions : {};\n\n return {\n clearScreen: options.clearScreen ?? true,\n buildDelay: options.buildDelay ?? 500,\n chokidar: {\n ignoreInitial: true,\n // Ignore common output files that cause feedback loops\n ignored: options.ignored ?? [\n \"**/dist/**/*.d.ts\",\n \"**/custom-elements.json\",\n \"**/demo/*.md\",\n \"**/demo/**/*.min.js\",\n \"**/docs/api.md\",\n \"**/node_modules/**\",\n \"**/.git/**\",\n ],\n // Reduce watcher's sensitivity to prevent loops\n awaitWriteFinish: options.awaitWriteFinish ?? {\n stabilityThreshold: 1000,\n pollInterval: 100,\n },\n },\n include: options.include ?? [\n \"./src/**/*.js\",\n \"./src/**/*.ts\",\n \"./demo/**/*.js\",\n \"./apiExamples/**/*\",\n \"./docs/**/*.md\",\n ],\n exclude: options.exclude ?? [\"./dist/**/*\", \"./node_modules/**/*\"],\n };\n}\n\n/**\n * Creates external configuration for Rollup.\n * @param {string[]} additional - Additional external patterns\n * @returns {(string|RegExp)[]} - Array of external dependencies.\n */\nexport function getExternalConfig(additional = []) {\n const defaults = [\n // externalize all lit dependencies\n /node_modules\\/lit/,\n /node_modules\\/lit-element/,\n /node_modules\\/lit-html/,\n /node_modules\\/@lit/,\n ];\n\n return [...defaults, ...additional];\n}\n", "import path from \"node:path\";\nimport { glob } from \"glob\";\n\n/**\n * Creates a plugin that watches file globs and adds them to Rollup's watch list.\n * @param {string|string[]} globs - Glob pattern(s) to watch\n * @returns {object} - Rollup plugin\n */\nexport function watchGlobs(globs) {\n return {\n name: \"watch-globs\",\n buildStart() {\n const items = Array.isArray(globs) ? globs : [globs];\n\n for (const item of items) {\n try {\n for (const filename of glob.sync(path.resolve(item))) {\n this.addWatchFile(filename);\n }\n } catch (error) {\n this.error(`Error watching glob pattern \"${item}\": ${error.message}`);\n }\n }\n },\n };\n}\n", "import { startDevServer } from \"@web/dev-server\";\nimport { hmrPlugin } from \"@web/dev-server-hmr\";\nimport ora from \"ora\";\n/**\n * Default server configuration\n */\nconst DEFAULT_CONFIG = {\n watch: true,\n nodeResolve: true,\n basePath: \"/\",\n rootDir: \"./demo\",\n hmrInclude: [\"src/**/*\", \"demo/**/*\", \"apiExamples/**/*\", \"docs/**/*\"],\n};\n\n/**\n * Starts the development server\n * @param {object} options - Server options\n * @param {number} [options.port] - Port number for the server\n * @param {boolean} [options.open] - Whether to open the browser\n * @param {string} [options.rootDir] - Root directory for serving files\n * @param {string[]} [options.hmrInclude] - Patterns to include for HMR\n * @returns {Promise<object>} - The server instance\n */\nexport async function startDevelopmentServer(options = {}) {\n const serverSpinner = ora(\"Firing up dev server...\\n\").start();\n\n try {\n // Merge options with defaults\n const serverConfig = {\n port: Number(options.port) || undefined,\n open: options.open ? \"/\" : undefined,\n watch: options.watch ?? DEFAULT_CONFIG.watch,\n nodeResolve: options.nodeResolve ?? DEFAULT_CONFIG.nodeResolve,\n basePath: options.basePath ?? DEFAULT_CONFIG.basePath,\n rootDir: options.rootDir ?? DEFAULT_CONFIG.rootDir,\n\n // HTML file extension middleware\n middleware: [\n function rewriteIndex(context, next) {\n if (context.url.endsWith(\"coverage\")) {\n context.redirect(\"/coverage/index.html\");\n return;\n }\n\n if (!context.url.endsWith(\"/\") && !context.url.includes(\".\")) {\n context.url += \".html\";\n }\n return next();\n },\n ],\n\n // Hot Module Replacement plugin\n plugins: [\n hmrPlugin({\n include: options.hmrInclude ?? DEFAULT_CONFIG.hmrInclude,\n }),\n ],\n };\n\n // Start the server with our configuration\n const server = await startDevServer({\n config: serverConfig,\n readCliArgs: false,\n readFileConfig: false,\n });\n\n serverSpinner.stop();\n return server;\n } catch (error) {\n serverSpinner.fail(\"Server snag! Couldn't start dev server.\");\n console.error(\"Error starting development server:\", error);\n throw new Error(`Development server failed to start: ${error.message}`);\n }\n}\n", "import path from \"node:path\";\nimport ora from \"ora\";\nimport { rollup } from \"rollup\";\nimport { analyzeComponents } from \"#scripts/analyze.js\";\nimport { generateDocs } from \"./bundleHandlers.js\";\nimport { getDtsConfig } from \"./configUtils.js\";\n\n// Track if any build is in progress to prevent overlapping operations\nlet buildInProgress = false;\n\n// Track build states and times in a single object for cleaner management\nconst builds = {\n dts: { active: false, lastTime: 0 },\n analyze: { active: false, lastTime: 0 },\n docs: { active: false, lastTime: 0 },\n};\n\n// Minimum time between builds of the same type (in ms)\nconst MIN_BUILD_INTERVAL = 5000;\n\n// Track source paths of files that triggered a watch event\nconst sourceEventPaths = new Set();\n\n// Known output files that should never trigger a rebuild\nconst OUTPUT_PATHS = [\n \"/dist/index.d.ts\",\n \"/custom-elements.json\",\n \"/demo/api.md\",\n \"/docs/api.md\",\n \"/demo/index.min.js\",\n];\n\n// Path matching checks - handle any non-string input safely\nfunction isOutputFile(filePath) {\n if (!filePath || typeof filePath !== \"string\") return false;\n\n try {\n const normalizedPath = path.normalize(filePath);\n\n // Check if it's in our known output paths\n return (\n OUTPUT_PATHS.some((outputPath) => normalizedPath.endsWith(outputPath)) ||\n normalizedPath.includes(\"/dist/\") ||\n normalizedPath.endsWith(\".min.js\") ||\n normalizedPath.endsWith(\".d.ts\")\n );\n } catch (error) {\n console.error(`Error checking path (${typeof filePath}):`, error.message);\n return false; // If any error occurs, assume it's not an output file\n }\n}\n\n/**\n * Runs a build task with proper tracking of state\n * @param {string} taskName - Type of task (dts, analyze, docs)\n * @param {Function} taskFn - The actual task function to run\n * @returns {Promise<boolean>} - Success status\n */\nasync function runBuildTask(taskName, taskFn) {\n const task = builds[taskName];\n\n // Skip if build is active or within throttle time\n if (task.active || Date.now() - task.lastTime < MIN_BUILD_INTERVAL) {\n return false;\n }\n\n try {\n task.active = true;\n task.lastTime = Date.now();\n return await taskFn();\n } catch (error) {\n console.error(`Error in ${taskName} task:`, error);\n return false;\n } finally {\n task.active = false;\n }\n}\n\n/**\n * Handles the watcher events.\n * @param {object} watcher - Rollup watcher object.\n * @param {object} options - Build options.\n * @param {Function} [onInitialBuildComplete] - Callback to run after initial build completes.\n */\nexport async function handleWatcherEvents(\n watcher,\n options,\n onInitialBuildComplete,\n) {\n // Track if this is the first build\n let isInitialBuild = true;\n // biome-ignore lint/style/useConst: This is an object that is mutated.\n let buildTasksResults = { dts: false, analyze: false, docs: false };\n let scheduledTasksTimer = null;\n let bundleSpinner;\n\n // Create a spinner for watch mode\n const watchSpinner = ora(\"Activating watch mode...\").start();\n\n // The actual task functions\n const buildTasks = {\n // Function to build d.ts files\n dts: async () => {\n const dtsSpinner = ora(\"Crafting type definitions...\").start();\n try {\n const create_dts = await rollup(getDtsConfig().config);\n await create_dts.write(getDtsConfig().config.output);\n await create_dts.close();\n dtsSpinner.succeed(\"Type files built.\");\n return true;\n } catch (error) {\n dtsSpinner.fail(\"Types trouble! Build failed.\");\n console.error(\"TypeScript definition build error:\", error);\n return false;\n }\n },\n\n // Function to analyze components\n analyze: async () => {\n const { wcaInput: sourceFiles, wcaOutput: outFile, skipDocs } = options;\n if (skipDocs) {\n const skipSpinner = ora(\"Skipping component analysis...\").start();\n setTimeout(() => {\n skipSpinner.succeed(\"Component analysis skipped.\");\n }, 0);\n return true;\n }\n\n const analyzeSpinner = ora(\n \"Detective work: analyzing components...\",\n ).start();\n try {\n await analyzeComponents(sourceFiles, outFile);\n analyzeSpinner.succeed(\"Component analysis complete! API generated.\");\n return true;\n } catch (error) {\n analyzeSpinner.fail(\"Analysis hiccup! Something went wrong.\");\n console.error(\"Component analysis error:\", error);\n return false;\n }\n },\n\n // Function to rebuild documentation\n docs: async () => {\n // Skip if main bundle is still building\n if (buildInProgress) {\n return false;\n }\n\n // Check if docs generation is skipped\n if (options.skipDocs) {\n const skipSpinner = ora(\"Skipping docs generation...\").start();\n setTimeout(() => {\n skipSpinner.succeed(\"Docs generation skipped.\");\n }, 0);\n return true;\n }\n\n const docsSpinner = ora(\"Refreshing docs...\").start();\n try {\n await generateDocs(options);\n docsSpinner.succeed(\"Documentation refreshed!\");\n return true;\n } catch (error) {\n docsSpinner.fail(\"Docs stumble! Couldn't refresh.\");\n console.error(\"Documentation rebuild error:\", error);\n }\n },\n };\n\n // Check if all initial build tasks completed successfully\n const checkInitialBuildComplete = () => {\n if (\n isInitialBuild &&\n buildTasksResults.dts &&\n buildTasksResults.analyze &&\n buildTasksResults.docs &&\n typeof onInitialBuildComplete === \"function\"\n ) {\n isInitialBuild = false;\n onInitialBuildComplete();\n }\n };\n\n // Schedule the post-bundle tasks with proper sequencing\n function schedulePostBundleTasks(delay = 1000) {\n if (scheduledTasksTimer) {\n clearTimeout(scheduledTasksTimer);\n }\n\n scheduledTasksTimer = setTimeout(async () => {\n // Run tasks with delays between them to avoid race conditions\n buildTasksResults.dts = await runBuildTask(\"dts\", buildTasks.dts);\n\n setTimeout(async () => {\n buildTasksResults.analyze = await runBuildTask(\n \"analyze\",\n buildTasks.analyze,\n );\n\n setTimeout(async () => {\n buildTasksResults.docs = await runBuildTask(\"docs\", buildTasks.docs);\n checkInitialBuildComplete();\n }, 1000);\n }, 1000);\n }, delay);\n }\n\n // Set up event handlers for the watcher\n watcher.on(\"event\", async (event) => {\n switch (event.code) {\n case \"START\":\n watchSpinner.succeed(\"Watch mode active! Eyes peeled.\");\n break;\n\n case \"BUNDLE_START\":\n // Clear source paths from the previous bundle operation\n sourceEventPaths.clear();\n\n // Store source file paths that triggered this build\n if (event.input) {\n try {\n // Handle different input formats safely\n const inputs = Array.isArray(event.input)\n ? event.input\n : typeof event.input === \"string\"\n ? [event.input]\n : typeof event.input === \"object\" && event.input !== null\n ? Object.values(event.input)\n : [];\n\n for (const input of inputs) {\n // Only process string inputs and skip non-string values\n if (typeof input === \"string\" && !isOutputFile(input)) {\n sourceEventPaths.add(path.normalize(input));\n }\n }\n } catch (error) {\n console.error(\"Error processing input paths:\", error);\n }\n }\n\n bundleSpinner = ora(\"Weaving bundles...\").start();\n buildInProgress = true;\n break;\n\n case \"BUNDLE_END\":\n if (bundleSpinner) {\n bundleSpinner.succeed(\n `Bundle ${Array.isArray(event.input) ? `of ${event.input.join(\"& \")} ` : \"\"}done in ${event.duration}ms! \uD83D\uDE80`,\n );\n }\n buildInProgress = false;\n\n // Schedule post-bundle tasks if source files triggered this build\n if (sourceEventPaths.size > 0) {\n schedulePostBundleTasks();\n }\n break;\n\n case \"END\":\n // We've already scheduled tasks in BUNDLE_END, nothing to do here\n break;\n\n case \"ERROR\":\n buildInProgress = false;\n if (bundleSpinner) {\n bundleSpinner.fail(`Oops! Bundle hit a snag: ${event.error.message}`);\n } else {\n ora().fail(`Watch mode hiccup: ${event.error.message}`);\n }\n sourceEventPaths.clear();\n break;\n }\n });\n}\n\n/**\n * Setup watch mode for rollup\n * @param {object} watcher - Rollup watcher instance\n */\nexport function setupWatchModeListeners(watcher) {\n process.on(\"SIGINT\", () => {\n const closeSpinner = ora(\"Wrapping up...\").start();\n watcher.close();\n closeSpinner.succeed(\"All done! See you next time. \u2728\");\n process.exit(0);\n });\n\n return watcher;\n}\n", "import { program } from \"commander\";\nimport ora from \"ora\";\nimport { withBuildOptions } from \"#commands/_sharedOptions.js\";\nimport { buildWithRollup } from \"#scripts/build/index.js\";\n\nlet buildCommand = program\n .command(\"build\")\n .description(\"Builds auro components\");\n\nbuildCommand = withBuildOptions(buildCommand, {\n watch: false,\n});\n\nexport default buildCommand.action(async (options) => {\n try {\n const build = ora(\"Initializing...\");\n\n if (options.watch) {\n build.text = \"Waiting for changes...\";\n build.spinner = \"bouncingBar\";\n build.color = \"green\";\n } else {\n build.text =\n options.docs === false\n ? \"Building component (docs disabled)\"\n : \"Building component\";\n }\n\n build.start();\n\n await buildWithRollup(options);\n\n if (!options.watch) {\n build.succeed(\"Build completed!\");\n }\n } catch (error) {\n // If there's any active spinner, we need to fail it\n ora().fail(`Build failed: ${error.message}`);\n console.error(error);\n process.exit(1);\n }\n});\n", "import { exec } from \"node:child_process\";\nimport path from \"node:path\";\nimport process from \"node:process\";\nimport { fileURLToPath } from \"node:url\";\nimport util from \"node:util\";\nimport { program } from \"commander\";\nimport inquirer from \"inquirer\";\nimport { shell } from \"#utils/shell.js\";\n\nexport default program\n .command(\"migrate\")\n .description(\"Script runner to perform repetitive code change tasks\")\n .requiredOption(\n \"-i, --id <string>\",\n \"Select the migration you would like to run by id\",\n )\n .option(\n \"-m, --multi-gitter\",\n \"Run the migration on all repositories in the multi-gitter config\",\n )\n .action(async (options) => {\n const filename = fileURLToPath(import.meta.url);\n const dirname = path.dirname(filename);\n const scriptPath = path.resolve(dirname, \"migrations\", options.id);\n\n if (options.multiGitter) {\n // Check if multi-gitter CLI command is available\n const execPromise = util.promisify(exec);\n\n try {\n await execPromise(\"command -v multi-gitter\");\n } catch {\n console.error(\"multi-gitter is not installed.\");\n process.exit(1);\n }\n\n const answers = await inquirer.prompt([\n {\n type: \"confirm\",\n name: \"dryRun\",\n message:\n \"Run migration in dry-run mode? (no changes will be committed)\",\n default: true,\n },\n ]);\n\n if (answers.dryRun) {\n shell(\n `multi-gitter run ${scriptPath}/script.sh --config \"${scriptPath}/multi-gitter.yml\" --dry-run`,\n );\n } else {\n shell(\n `multi-gitter run ${scriptPath}/script.sh --config \"${scriptPath}/multi-gitter.yml\"`,\n );\n }\n } else {\n shell(`${scriptPath}/script.sh`);\n }\n });\n", "import process from \"node:process\";\nimport { program } from \"commander\";\n\nimport { readFile, writeFile } from \"node:fs/promises\";\nimport { Logger } from \"@aurodesignsystem/auro-library/scripts/utils/logger.mjs\";\nimport { syncDotGithubDir } from \"#scripts/syncDotGithubDir.js\";\n\nexport default program\n .command(\"sync\")\n .description(\n \"Script runner to synchronize local repository configuration files\",\n )\n .action(async () => {\n Logger.info(\"Synchronizing repository configuration files...\");\n\n Logger.warn(\n \"Note: sync does not create a new git branch. Changes are added to the current branch.\",\n );\n\n const cwd = process.cwd();\n\n await syncDotGithubDir(cwd);\n\n // Cleanup for specific files\n // ------------------------------------------------------\n\n // Some files have specific cleanup tasks that need to be run after syncing\n\n // CODEOWNERS - has a bizarre issue with line endings. This is a workaround!\n // Maybe it has to do with the file type since there's no ending?\n const codeownersPath = `${cwd}/.github/CODEOWNERS`;\n const codeowners = await readFile(codeownersPath, { encoding: \"utf-8\" });\n\n // Convert line endings to \\n\n const codeownersFixed = codeowners\n .replace(/\\r\\n/gu, \"\\n\")\n .replace(/\\n\\n/gu, \"\\n\");\n await writeFile(codeownersPath, codeownersFixed, { encoding: \"utf-8\" });\n\n if (codeownersFixed.includes(\"\\r\") || codeownersFixed.includes(\"\\n\\n\")) {\n Logger.error(\"CODEOWNERS file still has Windows line endings.\");\n }\n });\n", "import fs from \"node:fs/promises\";\nimport { Logger } from \"@aurodesignsystem/auro-library/scripts/utils/logger.mjs\";\nimport {\n processContentForFile,\n templateFiller,\n} from \"@aurodesignsystem/auro-library/scripts/utils/sharedFileProcessorUtils.mjs\";\n\nconst REMOTE_TEMPLATE_BASE_URL =\n \"https://raw.githubusercontent.com/AlaskaAirlines/auro-templates\";\n\n// Constants for configuring sync branch and template selection\n// ------------------------------------------------------------\nconst BRANCH_BASE = \"main\";\nconst TARGET_BRANCH_TO_COPY = \"main\";\nconst CONFIG_TEMPLATE = \"default\";\n\n/**\n * @typedef {Object} GithubDirectory\n * @property {string[]} ISSUE_TEMPLATE - The issue template directory.\n * @property {string[]} workflows - The workflows directory.\n * @property {string} _root - The root directory (places files in .github directly).\n */\n\n/**\n * @type {GithubDirectory} githubDirectory\n */\nconst githubDirShape = {\n ISSUE_TEMPLATE: [\n \"bug_report.yaml\",\n \"config.yml\",\n \"feature_request.yaml\",\n \"general-support.yaml\",\n \"group.yaml\",\n \"story.yaml\",\n \"task.yaml\",\n ],\n workflows: [\"codeql.yml\", \"publishDemo.yml\", \"testPublish.yml\"],\n _root: [\n \"CODEOWNERS\",\n \"CODE_OF_CONDUCT.md\",\n \"CONTRIBUTING.md\",\n \"PULL_REQUEST_TEMPLATE.md\",\n \"SECURITY.md\",\n \"settings.yml\",\n \"stale.yml\",\n ],\n};\n\n// BELOW TYPES ARE COPIED DIRECTLY FROM THE LIBRARY\n// How can we import JSDoc types from the library?\n\n/**\n * This is the expected object type when passing something other than a string.\n * @typedef {Object} InputFileType\n * @property {string} remoteUrl - The remote template to fetch.\n * @property {string} fileName - Path including file name to store.\n * @property {boolean} [overwrite] - Default is true. Choose to overwrite the file if it exists.\n */\n\n/**\n * @typedef {Object} FileProcessorConfig\n * @property {string} identifier - A unique identifier for this file (used for logging).\n * @property {string | InputFileType} input - Path to an input file, including filename.\n * @property {string} output - Path to an output file, including filename.\n * @property {Partial<MarkdownMagicOptions>} [mdMagicConfig] - Extra configuration options for md magic.\n * @property {Array<(contents: string) => string>} [preProcessors] - Extra processor functions to run on content AFTER markdownmagic and BEFORE templateFiller.\n * @property {Array<(contents: string) => string>} [postProcessors] - Extra processor functions to run on content.\n */\n\n// BELOW NEEDS TO BE UPSTREAMED OR REMOVED FROM THE LIBRARY\n/**\n * Take a branch or tag name and return the URL for the README file.\n * @param {string} branchOrTag - The git branch or tag to use for the README source.\n * @param {string} filePath - The path to the file in the remote repository.\n * @returns {string} The complete URL for the remote file.\n */\nfunction branchNameToRemoteUrl(branchOrTag, filePath) {\n // check if tag starts with 'vX' since our tags are `v4.0.0`\n const isTag =\n branchOrTag.startsWith(\"v\") &&\n /^\\d+\\.\\d+\\.\\d+(?<_>-.*)?$/u.test(branchOrTag.slice(1));\n\n if (isTag) {\n return `${REMOTE_TEMPLATE_BASE_URL}/refs/tags/${branchOrTag}/${filePath}`;\n }\n\n if (branchOrTag !== BRANCH_BASE) {\n return `${REMOTE_TEMPLATE_BASE_URL}/refs/heads/${branchOrTag}/${filePath}`;\n }\n\n return `${REMOTE_TEMPLATE_BASE_URL}/${BRANCH_BASE}/${filePath}`;\n}\n\n/**\n * Take a branch or tag name and return the URL for the remote file.\n * @param {string} filePath - The name of the file to fetch.\n * @param {string} branchOrTag - The git branch or tag to use for the README source.\n * @param {string} outputPath - The path to the file in the local repository.\n * @returns {FileProcessorConfig} Configuration object for file processing.\n */\nfunction filePathToRemoteInput(filePath, branchOrTag, outputPath) {\n const remoteUrl = branchNameToRemoteUrl(branchOrTag, filePath);\n\n return {\n // Identifier is only used for logging\n identifier: filePath.split(\"/\").pop(),\n input: {\n remoteUrl,\n fileName: outputPath,\n overwrite: true,\n },\n output: outputPath,\n overwrite: true,\n };\n}\n\n/**\n * Recursively removes a directory and all its contents.\n * @param {string} dirPath - The path to the directory to remove.\n * @returns {Promise<void>} A promise that resolves when the directory is removed or rejects if an error occurs.\n * @throws {Error} If the directory cannot be removed.\n */\nasync function removeDirectory(dirPath) {\n try {\n await fs.rm(dirPath, { recursive: true, force: true });\n Logger.log(`Successfully removed directory: ${dirPath}`);\n } catch (error) {\n Logger.error(`Error removing directory ${dirPath}: ${error.message}`);\n throw error;\n }\n}\n\n/**\n * Sync the .github directory with the remote repository.\n * @param {string} rootDir - The root directory of the local repository.\n * @returns {Promise<void>} A promise that resolves when syncing is complete.\n */\nexport async function syncDotGithubDir(rootDir) {\n if (!rootDir) {\n Logger.error(\"Root directory must be specified\");\n // eslint-disable-next-line no-undef\n process.exit(1);\n }\n\n // Remove .github directory if it exists\n const githubPath = \".github\";\n\n try {\n await removeDirectory(githubPath);\n Logger.log(\".github directory removed successfully\");\n } catch (error) {\n Logger.error(`Error removing .github directory: ${error.message}`);\n // eslint-disable-next-line no-undef\n process.exit(1);\n }\n\n // Setup\n await templateFiller.extractNames();\n\n const fileConfigs = [];\n const missingFiles = [];\n\n for (const dir of Object.keys(githubDirShape)) {\n for (const file of githubDirShape[dir]) {\n const inputPath = `${dir === \"_root\" ? \"\" : `${dir}/`}${file}`;\n const outputPath = `${rootDir}/.github/${inputPath}`;\n\n const fileConfig = filePathToRemoteInput(\n `templates/${CONFIG_TEMPLATE}/.github/${inputPath}`,\n TARGET_BRANCH_TO_COPY,\n outputPath,\n );\n fileConfigs.push(fileConfig);\n }\n }\n\n // Check if files exist\n await Promise.all(\n fileConfigs.map(async (config) => {\n try {\n const response = await fetch(config.input.remoteUrl, {\n method: \"HEAD\",\n });\n if (!response.ok) {\n missingFiles.push(config.input.remoteUrl);\n }\n } catch {\n missingFiles.push(config.input.remoteUrl);\n }\n }),\n );\n\n // If missing, log and exit\n if (missingFiles.length > 0) {\n const errorMessage = missingFiles\n .map((file) => `File not found: ${file}`)\n .join(\"\\n\");\n Logger.error(\n `Failed to sync .github directory. Confirm githubDirShape object is up to date:\\n${errorMessage}`,\n );\n // eslint-disable-next-line no-undef\n process.exit(1);\n }\n\n // Process all files\n try {\n await Promise.all(\n fileConfigs.map((config) => processContentForFile(config)),\n );\n Logger.log(\"All files processed.\");\n } catch (error) {\n Logger.error(`Error processing files: ${error.message}`);\n // eslint-disable-next-line no-undef\n process.exit(1);\n }\n}\n", "/* eslint-disable no-await-in-loop, line-comment-position, no-inline-comments, jsdoc/require-jsdoc, no-undef */\n\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport { Logger } from \"@aurodesignsystem/auro-library/scripts/utils/logger.mjs\";\nimport { program } from \"commander\";\nimport { glob } from \"glob\";\nimport getTemplatedComponentCode from \"#scripts/prepWcaCompatibleCode.mjs\";\n\n// Use glob directly as it's already promised-based in newer versions\n\nconst WAC_DIR = path.resolve(process.cwd(), \"./scripts/wca\");\n\nasync function globPath(sources) {\n try {\n const fileArrays = await Promise.all(sources.map((source) => glob(source)));\n return fileArrays.flat();\n } catch (err) {\n console.error(\"Error processing glob patterns:\", err);\n throw err; // Re-throw to handle failure at caller\n }\n}\n\nasync function createExtendsFile(filePaths) {\n if (!fs.existsSync(WAC_DIR)) {\n await fs.promises.mkdir(WAC_DIR, { recursive: true });\n }\n\n for (const filePath of filePaths) {\n const resolvedPath = path.resolve(process.cwd(), filePath);\n const fileContent = await fs.promises.readFile(resolvedPath, \"utf-8\");\n const newPath = path.resolve(WAC_DIR, `${path.basename(filePath)}`);\n const newCode = getTemplatedComponentCode(\n fileContent,\n path.relative(WAC_DIR, filePath),\n );\n await fs.promises.writeFile(newPath, newCode);\n }\n}\n\nasync function main() {\n // files to analyze\n const filePaths = await globPath([\"./src/auro-*.js\"]);\n await createExtendsFile(filePaths);\n}\n\nexport default program\n .command(\"wca-setup\")\n .description(\"Set up WCA (Web Component Analyzer) for the project\")\n .action(() => {\n main()\n .then(() => {\n Logger.success(\"WCA setup completed successfully.\");\n })\n .catch((error) => {\n Logger.error(`WCA setup failed: ${error.message}`);\n });\n });\n", "/* eslint-disable require-unicode-regexp, prefer-named-capture-group, prefer-destructuring, prettier/prettier */\n\nexport default (code, sourcePath) => {\n const defaultTag = (code.match(/static register\\(name \\= (.+)\\)/) ||\n code.match(/customElements.get\\((.+?)\\)/))[1];\n const className = code.match(/export class (.+) extends/)?.[1];\n const classDesc = code.match(/\\/\\*\\*((.|\\n)*?)(\\*\\n|\\*\\/|[@])/)?.[1] || \"\";\n\n if (!defaultTag || !className) {\n return code;\n }\n return `\nimport { ${className} } from '${sourcePath}';\n\n/**${classDesc}*/\nclass ${className}WCA extends ${className} {}\n\nif (!customElements.get(${defaultTag})) {\n customElements.define(${defaultTag}, ${className}WCA);\n}\n`;\n};\n", "import { program } from \"commander\";\nimport { analyzeCommits } from \"#scripts/check-commits/commit-analyzer.ts\";\n\nexport default program\n .command(\"check-commits\")\n .alias(\"cc\")\n .option(\n \"-l, --set-label\",\n \"Set label on the pull request based on the commit message type\",\n )\n .option(\"-d, --debug\", \"Display detailed commit information for debugging\")\n .description(\n \"Check commits in the local repository for the types of semantic commit messages made and return the results.\",\n )\n .action(async (option) => {\n await analyzeCommits(option.debug, option.setLabel);\n });\n", "import chalk from \"chalk\";\nimport ora from \"ora\";\nimport type { Ora } from \"ora\";\nimport { Git } from \"#utils/gitUtils.ts\";\nimport type { CommitInfo } from \"./display-utils.ts\";\nimport { displayDebugView, getColoredType } from \"./display-utils.ts\";\nimport { applyLabelToPR, getExistingLabels } from \"./github-labels.ts\";\n\n/**\n * Analyze commit messages in the repository\n * @param debug Whether to display detailed debug information\n * @param verbose Whether to display verbose commit messages without truncation\n * @param setLabel Whether to apply a label to the PR based on commit types\n * @returns A promise that resolves when analysis is complete\n */\nexport async function analyzeCommits(\n debug = false,\n setLabel = false,\n): Promise<void> {\n const spinner = ora(\"Checking commits...\\n\").start();\n\n try {\n const commitList = await Git.getCommitMessages();\n\n // Only display commit details if debug mode is enabled\n if (debug) {\n displayDebugView(commitList);\n }\n\n spinner.succeed(`Total commits analyzed: ${commitList.length}`);\n\n if (commitList.length !== 0) {\n const commitTypes = commitList.map((commit) => commit.type);\n const uniqueTypes = Array.from(new Set(commitTypes));\n const formattedTypes = uniqueTypes\n .map((type) => getColoredType(type))\n .join(\", \");\n spinner.succeed(`Found commit types: ${formattedTypes}`);\n } else {\n spinner.info(\n \"The list of commits is created by comparing the current branch\\n\" +\n \"with the main branch. If you are on a new branch, please\\n\" +\n \"make sure to commit some changes before running this command.\",\n );\n }\n\n if (setLabel) {\n await handleLabels(commitList, spinner);\n }\n } catch (error) {\n spinner.fail(\"Error getting commit messages\");\n console.error(error);\n }\n}\n\n/**\n * Handle applying labels based on commit types\n * @param commitList The list of commits to analyze\n * @param spinner The ora spinner instance for status updates\n */\nasync function handleLabels(\n commitList: CommitInfo[],\n spinner: Ora,\n): Promise<void> {\n const validCommitTypes = [\n \"breaking\",\n \"feat\",\n \"fix\",\n \"perf\",\n \"docs\",\n \"style\",\n \"refactor\",\n \"test\",\n \"build\",\n \"ci\",\n \"chore\",\n ];\n\n const foundCommitTypes = commitList\n .map((commit) => commit.type)\n .filter((type) => validCommitTypes.includes(type));\n\n let selectedLabel = null;\n let highestPriorityIndex = Number.POSITIVE_INFINITY;\n\n for (const type of foundCommitTypes) {\n const priorityIndex = validCommitTypes.indexOf(type);\n if (priorityIndex < highestPriorityIndex) {\n highestPriorityIndex = priorityIndex;\n selectedLabel = type;\n }\n }\n\n if (selectedLabel) {\n const labelSpinner = ora(\n \"Checking existing labels on pull request...\",\n ).start();\n try {\n const existingLabels = await getExistingLabels();\n\n if (existingLabels.includes(`semantic-status: ${selectedLabel}`)) {\n labelSpinner.info(\n `Label \"semantic-status: ${getColoredType(selectedLabel)}\" already exists on the pull request.`,\n );\n return;\n }\n\n labelSpinner.text = \"Applying label to pull request...\";\n await applyLabelToPR(selectedLabel);\n labelSpinner.succeed(\n `Label \"semantic-status: ${getColoredType(selectedLabel)}\" applied to the pull request.`,\n );\n } catch (error: unknown) {\n const errorMessage =\n error instanceof Error ? error.message : String(error);\n labelSpinner.fail(errorMessage);\n }\n } else {\n spinner.warn(\n chalk.yellow(\"No semantic commit type found to apply as label.\"),\n );\n }\n}\n", "import { appendFile, readFile } from \"node:fs/promises\";\nimport { Logger } from \"@aurodesignsystem/auro-library/scripts/utils/logger.mjs\";\nimport { simpleGit } from \"simple-git\";\nimport type { SimpleGit } from \"simple-git\";\n\n// Initialize simple-git with proper typing\nlet git: SimpleGit;\ntry {\n git = simpleGit({\n baseDir: process.cwd(),\n binary: \"git\",\n maxConcurrentProcesses: 1,\n });\n} catch (error) {\n Logger.error(`Failed to initialize git: ${error}`);\n // Provide a minimal implementation to prevent runtime errors\n git = {} as SimpleGit;\n}\n\nexport class Git {\n static async checkGitignore(pattern: string) {\n if (pattern === \"\") {\n return false;\n }\n try {\n const fileContent = await readFile(\".gitignore\", \"utf-8\");\n return fileContent.includes(pattern);\n } catch (err) {\n Logger.error(`Error reading file: ${err}`);\n return false;\n }\n }\n\n static async getCommitMessages(): Promise<\n Array<{\n type: string;\n hash: string;\n date: string;\n subject: string;\n body: string;\n message: string;\n author_name: string;\n }>\n > {\n try {\n interface GitCommitType {\n hash: string;\n date: string;\n subject: string;\n body: string;\n message: string;\n author_name: string;\n type: string;\n }\n\n const currentBranch = await git.branchLocal();\n Logger.info(`Current branch: ${currentBranch.current}`);\n\n // ---- Get target branch (main) and PR commits ----\n let targetBranch = \"main\";\n let commitRange = \"\";\n\n // Check if we're in a GitHub Actions environment\n const isGitHubAction = !!process.env.GITHUB_ACTIONS;\n\n if (isGitHubAction) {\n Logger.info(\"Running in GitHub Actions environment\");\n // In GitHub Actions, we can use environment variables to determine the PR branch and base\n targetBranch = process.env.GITHUB_BASE_REF || \"main\";\n\n try {\n // Ensure target branch is fetched\n await git.fetch(\"origin\", targetBranch);\n Logger.info(`Fetched target branch: origin/${targetBranch}`);\n\n // Use the merge base between target branch and current HEAD to get PR-specific commits\n const mergeBase = await git.raw([\n \"merge-base\",\n `origin/${targetBranch}`,\n \"HEAD\",\n ]);\n\n // Get commits between merge base and HEAD - these are the PR commits\n commitRange = `${mergeBase.trim()}..HEAD`;\n Logger.info(`Using commit range: ${commitRange}`);\n } catch (error) {\n Logger.warn(`Error setting up commit range in CI: ${error}`);\n // Fall back to simpler approach (just compare with origin/targetBranch)\n commitRange = `origin/${targetBranch}..HEAD`;\n Logger.info(`Falling back to commit range: ${commitRange}`);\n }\n } else {\n // Local environment - try to determine PR commits\n Logger.info(\"Running in local environment\");\n\n try {\n // First check if origin/main exists, fetch it if needed\n try {\n await git.raw([\"rev-parse\", \"--verify\", `origin/${targetBranch}`]);\n } catch {\n Logger.info(`Fetching ${targetBranch} from origin`);\n await git.fetch(\"origin\", targetBranch);\n }\n\n // Find merge base between current branch and target branch\n const mergeBase = await git.raw([\n \"merge-base\",\n `origin/${targetBranch}`,\n currentBranch.current,\n ]);\n\n commitRange = `${mergeBase.trim()}..HEAD`;\n Logger.info(`Using commit range for PR commits: ${commitRange}`);\n } catch (error) {\n Logger.warn(`Error determining PR commits locally: ${error}`);\n\n // Fallback - use last few commits\n Logger.info(\"Falling back to analyzing recent commits\");\n commitRange = \"HEAD~10..HEAD\";\n Logger.info(`Using fallback commit range: ${commitRange}`);\n }\n }\n\n // Get and format the PR commits\n return await Git.getFormattedCommits(commitRange);\n } catch (err) {\n Logger.error(`Error getting commit messages: ${err}`);\n return [];\n }\n }\n\n // Helper function to get formatted commits for a given git range\n static async getFormattedCommits(commitRange: string): Promise<\n Array<{\n type: string;\n hash: string;\n date: string;\n subject: string;\n body: string;\n message: string;\n author_name: string;\n }>\n > {\n interface GitCommitType {\n hash: string;\n date: string;\n subject: string;\n body: string;\n message: string;\n author_name: string;\n type: string;\n }\n\n // Use a format that will let us parse each commit separately\n // %H = hash, %ad = author date, %an = author name, %s = subject, %b = body\n const branchCommitsRaw = await git.raw([\n \"log\",\n \"--pretty=format:COMMIT_START%n%H%n%ad%n%an%n%s%n%b%nCOMMIT_END\",\n \"--date=short\",\n commitRange,\n ]);\n\n // Split by our custom delimiter to get individual commits\n const commitChunks = branchCommitsRaw\n .split(\"COMMIT_START\\n\")\n .filter((chunk: string) => chunk.trim() !== \"\");\n\n const commits: GitCommitType[] = [];\n\n for (const chunk of commitChunks) {\n const parts = chunk.split(\"\\n\");\n if (parts.length >= 4) {\n const hash = parts[0];\n const date = parts[1];\n const author_name = parts[2];\n const subject = parts[3];\n\n // The rest is the body (may contain breaking changes)\n // Filter out the COMMIT_END marker\n const bodyLines = parts\n .slice(4)\n .filter((line: string) => line !== \"COMMIT_END\");\n const body = bodyLines.length > 0 ? bodyLines.join(\"\") : \"\";\n\n // Use a shorter hash format for better readability (7 characters)\n const shortHash = hash.substring(0, 7);\n\n // Determine commit type from subject\n const typeMatch = subject.match(\n /^(feat|fix|docs|style|refactor|perf|test|build|ci|chore)(\\(.+\\))?:/,\n );\n let type = typeMatch ? typeMatch[1] : \"unknown\";\n\n // Check for breaking changes\n if (body.includes(\"BREAKING CHANGE\")) {\n type = \"breaking\";\n }\n\n commits.push({\n type,\n hash: shortHash,\n date,\n subject,\n body,\n message: `${subject}${body ? `\\n\\n${body}` : \"\"}`,\n author_name,\n });\n }\n }\n\n return commits;\n }\n\n // Function to add file to .gitignore\n static async addToGitignore(pattern: string, log = true) {\n await Git.checkGitignore(pattern).then(async (result) => {\n if (result) {\n Logger.warn(`${pattern} already exists`);\n } else {\n try {\n await appendFile(\".gitignore\", `\\n${pattern}`);\n if (log) {\n Logger.success(`${pattern} added to .gitignore`);\n }\n } catch (err) {\n Logger.error(err);\n }\n }\n });\n }\n\n // Function to remove file from git cache\n static async removeFromGitCache(files: string[]) {\n try {\n await git.rmKeepLocal(files);\n Logger.success(`${files.join(\", \")} are removed from git cache`);\n } catch (err) {\n Logger.error(err);\n }\n }\n\n static async createBranch(branchName: string) {\n try {\n await git.checkoutLocalBranch(branchName);\n Logger.success(`Created and switched to ${branchName} branch`);\n } catch (err) {\n Logger.error(err);\n }\n }\n\n static async commitStagedFiles(message: string) {\n try {\n await git.add(\".\");\n await git.commit(message);\n Logger.success(`Committed with message: ${message}`);\n } catch (err) {\n Logger.error(err);\n }\n }\n}\n", "import chalk from \"chalk\";\n\n// Configuration constants for display\nexport const MAX_SUBJECT_LENGTH = 60;\nexport const MAX_BODY_LENGTH = 100;\n\nexport interface CommitInfo {\n type: string;\n hash: string;\n date: string;\n subject: string;\n body: string;\n message: string;\n author_name: string;\n}\n\n// Define valid commit types for better type checking\nexport type CommitType =\n | \"breaking\"\n | \"feat\"\n | \"fix\"\n | \"perf\"\n | \"docs\"\n | \"style\"\n | \"refactor\"\n | \"test\"\n | \"build\"\n | \"ci\"\n | \"chore\"\n | \"unknown\";\n\n/**\n * Get colored text for commit type using a more harmonious color scheme\n */\nexport function getColoredType(type: string): string {\n switch (type) {\n case \"breaking\":\n return chalk.bold.red(type);\n case \"feat\":\n return chalk.bold.green(type);\n case \"fix\":\n return chalk.bold.green(type);\n case \"perf\":\n return chalk.bold.green(type);\n case \"docs\":\n return chalk.bold.cyan(type);\n case \"style\":\n return chalk.bold.cyan(type);\n case \"refactor\":\n return chalk.bold.cyan(type);\n case \"test\":\n return chalk.bold.cyan(type);\n case \"build\":\n return chalk.bold.cyan(type);\n case \"ci\":\n return chalk.bold.cyan(type);\n case \"chore\":\n return chalk.bold.cyan(type);\n default:\n return chalk.bold.white(type);\n }\n}\n\n/**\n * Helper function to wrap long strings to new lines\n */\nexport function wrapString(str: string, maxLength: number): string {\n if (!str) {\n return \"\";\n }\n\n // If the string is shorter than maxLength, return it as is\n if (str.length <= maxLength) {\n return str;\n }\n\n // Split the string into words\n const words = str.split(\" \");\n let result = \"\";\n let currentLine = \"\";\n\n // Build wrapped text with line breaks\n for (const word of words) {\n // If adding this word would exceed maxLength, start a new line\n if ((currentLine + word).length > maxLength && currentLine.length > 0) {\n result += `${currentLine.trim()}\\n`;\n currentLine = \"\";\n }\n currentLine = `${currentLine}${word} `;\n }\n\n // Add the last line\n if (currentLine.length > 0) {\n result += currentLine.trim();\n }\n\n return result;\n}\n\n/**\n * Display commits in a debug format with detailed information\n */\nexport function displayDebugView(commitList: CommitInfo[]): void {\n for (const commit of commitList) {\n console.log(\"\u2500\".repeat(60));\n\n // Use a consistent color theme for metadata\n const subject = wrapString(commit.subject, MAX_SUBJECT_LENGTH);\n const body = wrapString(commit.body, MAX_BODY_LENGTH);\n\n // Display commit info in a more compact format\n console.log(chalk.bold(`${getColoredType(commit.type)}`));\n console.log(\n chalk.dim(`${commit.hash} | ${commit.date} | ${commit.author_name}`),\n );\n console.log(chalk.bold(`${chalk.white(subject)}`));\n\n // Only add body if it exists and keep it more compact\n if (commit.body) {\n console.log(chalk.dim(body));\n }\n }\n console.log(\"\u2500\".repeat(60));\n console.log(\"\\n\");\n}\n", "import github from \"@actions/github\";\n\n/**\n * Get existing labels from the current pull request in a GitHub Actions environment\n * @returns Promise that resolves with an array of label names\n */\nexport async function getExistingLabels(): Promise<string[]> {\n try {\n // Get the GitHub token from environment\n const token = process.env.GITHUB_TOKEN;\n\n if (!token) {\n throw new Error(\"GITHUB_TOKEN environment variable is not set\");\n }\n\n // Check if we're in a GitHub Actions environment\n if (!process.env.GITHUB_REPOSITORY || !process.env.GITHUB_EVENT_PATH) {\n throw new Error(\n \"This function can only be used in a GitHub Actions environment\",\n );\n }\n\n const octokit = github.getOctokit(token);\n const { context } = github;\n\n // Make sure we're in a pull request context\n if (!context.payload.pull_request) {\n throw new Error(\"No pull request found in the GitHub context\");\n }\n\n const [owner, repo] = process.env.GITHUB_REPOSITORY.split(\"/\");\n const prNumber = context.payload.pull_request.number;\n\n // Get existing labels\n const { data: existingLabels } =\n await octokit.rest.issues.listLabelsOnIssue({\n owner,\n repo,\n issue_number: prNumber,\n });\n\n // Return array of label names\n return existingLabels.map((label) => label.name);\n } catch (error) {\n if (error instanceof Error) {\n throw new Error(`Failed to get existing labels: ${error.message}`);\n }\n throw error;\n }\n}\n\n/**\n * Apply a label to the current pull request in a GitHub Actions environment\n * @param label The label to apply to the pull request\n * @returns Promise that resolves when the label is applied\n */\nexport async function applyLabelToPR(label: string): Promise<void> {\n try {\n // Get the GitHub token from environment\n const token = process.env.GITHUB_TOKEN;\n\n if (!token) {\n throw new Error(\"GITHUB_TOKEN environment variable is not set\");\n }\n\n // Check if we're in a GitHub Actions environment\n if (!process.env.GITHUB_REPOSITORY || !process.env.GITHUB_EVENT_PATH) {\n throw new Error(\n \"This function can only be used in a GitHub Actions environment\",\n );\n }\n\n const octokit = github.getOctokit(token);\n const { context } = github;\n\n // Make sure we're in a pull request context\n if (!context.payload.pull_request) {\n throw new Error(\"No pull request found in the GitHub context\");\n }\n\n const [owner, repo] = process.env.GITHUB_REPOSITORY.split(\"/\");\n const prNumber = context.payload.pull_request.number;\n\n // Add prefix to the label\n const prefixedLabel = `semantic-status: ${label}`;\n\n // Get existing labels\n const existingLabels = await getExistingLabels();\n\n // If the label we want to apply already exists, do nothing\n if (existingLabels.includes(prefixedLabel)) {\n return;\n }\n\n // Find existing semantic status labels that are different from the one we want to apply\n const existingSemanticLabels = existingLabels.filter(\n (existingLabel) =>\n existingLabel.startsWith(\"semantic-status:\") &&\n existingLabel !== prefixedLabel,\n );\n\n // Remove existing semantic status labels that don't match the new one\n for (const existingLabel of existingSemanticLabels) {\n await octokit.rest.issues.removeLabel({\n owner,\n repo,\n issue_number: prNumber,\n name: existingLabel,\n });\n }\n\n // Add the new semantic status label\n await octokit.rest.issues.addLabels({\n owner,\n repo,\n issue_number: prNumber,\n labels: [prefixedLabel],\n });\n\n return;\n } catch (error) {\n if (error instanceof Error) {\n throw new Error(`Failed to apply label: ${error.message}`);\n }\n throw error;\n }\n}\n", "import fs from \"node:fs\";\nimport { get } from \"node:https\"; // Change to https\nimport chalk from \"chalk\";\nimport { program } from \"commander\";\nimport ora from \"ora\";\nimport type { Ora } from \"ora\";\n\nexport default program\n .command(\"pr-release\")\n .option(\n \"-n, --namespace <package-namespace>\",\n \"Set namespace of the package release\",\n \"@aurodesignsystem-dev\",\n )\n .option(\n \"-p, --pr-number <number>\",\n \"Set pull request number for the release\",\n \"0\",\n )\n .description(\n \"Generate the package version based off of PR number then update the package.json file. Note: this does not publish the package.\",\n )\n .action(async (option) => {\n await updatePackageJson(option);\n });\n\ninterface ReleaseOptions {\n namespace: string;\n prNumber: number;\n}\n\nconst updatePackageJson = async (option: ReleaseOptions): Promise<void> => {\n const { namespace, prNumber } = option;\n\n const packageSpinner = ora(\"Updating package.json\").start();\n\n try {\n const packageJsonPath = \"package.json\";\n\n // Read package.json\n const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, \"utf8\"));\n\n // Check if release version is on npmjs already\n packageSpinner.text = \"Checking npm registry for version information...\";\n\n const releaseVersion = `0.0.0-pr${prNumber}`;\n const packageComponent = packageJson.name.split(\"/\")[1];\n const packageName = `${namespace}/${packageComponent}`;\n const incrementVersion = await getIncrementVersion(\n releaseVersion,\n packageName,\n packageSpinner,\n );\n const packageVersion = `${releaseVersion}.${incrementVersion}`;\n\n packageJson.name = packageName;\n packageJson.version = packageVersion;\n\n packageSpinner.text = \"Writing updated package.json...\";\n\n // Write the updated package.json back to the file\n fs.writeFileSync(\n packageJsonPath,\n `${JSON.stringify(packageJson, null, 2)}\\n`,\n \"utf8\",\n );\n\n packageSpinner.succeed(\n `Package.json updated to use ${chalk.green(packageVersion)} and ${chalk.green(packageName)}`,\n );\n\n // Explicitly exit with success code to ensure terminal prompt returns\n process.exit(0);\n } catch (error: unknown) {\n packageSpinner.fail(`Failed to update package.json: ${error}`);\n process.exit(1); // Exit with error code\n }\n};\n\n// checks if version exists on npmjs and returns the next available increment version\nconst getIncrementVersion = (\n releaseVersion: string,\n packageName: string,\n spinner: Ora,\n): Promise<number> => {\n return new Promise((resolve) => {\n try {\n // Use the registry URL to get all versions for the package\n const registryUrl = `https://registry.npmjs.org/${packageName}`;\n\n const req = get(\n registryUrl,\n {\n headers: { Accept: \"application/json\" },\n },\n (res) => {\n // Handle redirects\n if (\n (res.statusCode === 301 || res.statusCode === 302) &&\n res.headers.location\n ) {\n // Persist redirect message\n spinner.info(`Following redirect to ${res.headers.location}...`);\n try {\n get(\n res.headers.location,\n { headers: { Accept: \"application/json\" } },\n handleResponse,\n )\n .on(\"error\", (err) => {\n // On redirect error, default to 0\n spinner.warn(\n `Error following redirect: ${err.message}, defaulting to version 0`,\n );\n resolve(0);\n })\n .end();\n } catch (error) {\n // If redirect request fails, default to 0\n spinner.warn(\n `Redirect request failed: ${error instanceof Error ? error.message : \"Unknown error\"}, defaulting to version 0`,\n );\n resolve(0);\n }\n return;\n }\n\n handleResponse(res);\n },\n );\n\n function handleResponse(res: import(\"http\").IncomingMessage) {\n if (res.statusCode !== 200) {\n // If package not found or other error, we can start with version 0\n spinner.info(\n `Package not found. Status code: ${chalk.red(res.statusCode)}, defaulting to version 0`,\n );\n resolve(0);\n return;\n }\n\n spinner.text = \"Processing version information...\";\n let data = \"\";\n res.on(\"data\", (chunk: Buffer | string) => {\n data += chunk;\n });\n\n res.on(\"end\", () => {\n try {\n const packageData = JSON.parse(data);\n const versions = packageData.versions\n ? Object.keys(packageData.versions)\n : [];\n\n spinner.text = \"Calculating next version number...\";\n\n // Find the highest existing iteration for this release version\n let maxIteration = -1;\n const versionRegex = new RegExp(`^${releaseVersion}\\\\.(\\\\d+)$`);\n\n for (const version of versions) {\n const match = version.match(versionRegex);\n if (match) {\n const iteration = Number.parseInt(match[1], 10);\n maxIteration = Math.max(maxIteration, iteration);\n }\n }\n\n // Return the next iteration number and persist this important info\n if (maxIteration >= 0) {\n spinner.info(\n `Found existing version ${chalk.green(`${releaseVersion}.${maxIteration}`)}. Incrementing to ${chalk.green(`${releaseVersion}.${maxIteration + 1}`)}`,\n );\n } else {\n spinner.info(\n `No existing version found for ${chalk.green(releaseVersion)}. Starting with ${chalk.green(`${releaseVersion}.0`)}`,\n );\n }\n resolve(maxIteration + 1);\n } catch (error) {\n // In case of parsing error, default to 0\n spinner.warn(\n `Failed to parse NPM registry response: ${error instanceof Error ? error.message : \"Unknown error\"}, defaulting to version 0`,\n );\n resolve(0);\n }\n });\n }\n\n req.on(\"error\", (err) => {\n // On request error, default to 0\n spinner.warn(`Request error: ${err.message}, defaulting to version 0`);\n resolve(0);\n });\n\n req.end();\n } catch (error) {\n // Catch any other errors and default to 0\n spinner.warn(\n \"Error checking version in npm registry, defaulting to version 0\",\n );\n resolve(0);\n }\n });\n};\n", "import path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { program } from \"commander\";\nimport { shell } from \"#utils/shell.js\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst cliRootDir = path.resolve(path.dirname(__filename), \"..\");\n\nexport default program\n .command(\"test\")\n .option(\"-w, --watch\", \"Set watch number for the test\")\n .description(\"Run the web test runner to test the component library\")\n .action(async (option) => {\n const command = `npx wtr --config ${cliRootDir}/dist/configs/web-test-runner.config.mjs --coverage`;\n\n if (option.watch) {\n shell(`${command} --watch`);\n return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YAAaE,GAAW,CAAC,EAE7CF,EAAQ,MAAM",
6
6
  "names": ["program", "figlet", "mind", "auroSplash_default", "fs", "path", "fileURLToPath", "debugLog", "message", "getPackageVersion", "__filename", "__dirname", "packagePath", "error", "program", "ora", "withBuildOptions", "command", "watch", "withServerOptions", "terser", "watch", "rmSync", "join", "ora", "rollup", "spawn", "ora", "shell", "command", "_args", "commandString", "spinner", "finalCommand", "finalArgs", "parts", "isWatchMode", "child", "commandOutput", "data", "output", "resolve", "reject", "code", "analyzeComponents", "sourceFiles", "outFile", "shell", "Logger", "generateReadmeUrl", "processContentForFile", "templateFiller", "defaultDocsProcessorConfig", "pathFromCwd", "pathLike", "fileConfigs", "config", "processDocFiles", "fileConfig", "err", "runDefaultDocsBuild", "cleanupDist", "distPath", "join", "spinner", "ora", "rmSync", "error", "runBuildStep", "taskName", "taskFn", "successMsg", "failMsg", "result", "buildTypeDefinitions", "config", "outputConfig", "bundle", "rollup", "buildCombinedBundle", "mainConfig", "demoConfig", "mainBundle", "demoBundle", "generateDocs", "options", "sourceFiles", "outFile", "skipDocs", "skipSpinner", "analyzeComponents", "runDefaultDocsBuild", "basename", "nodeResolve", "glob", "dts", "litScss", "path", "glob", "watchGlobs", "globs", "items", "item", "filename", "error", "DEFAULTS", "getPluginsConfig", "modulePaths", "options", "watchPatterns", "dedupe", "allModulePaths", "nodeResolve", "litScss", "watchGlobs", "getMainBundleConfig", "watch", "input", "outputDir", "format", "getExternalConfig", "getWatcherConfig", "getDemoConfig", "globPattern", "ignorePattern", "glob", "file", "basename", "getDtsConfig", "dts", "watchOptions", "additional", "startDevServer", "hmrPlugin", "ora", "DEFAULT_CONFIG", "startDevelopmentServer", "options", "serverSpinner", "serverConfig", "context", "next", "server", "error", "path", "ora", "rollup", "buildInProgress", "builds", "MIN_BUILD_INTERVAL", "sourceEventPaths", "OUTPUT_PATHS", "isOutputFile", "filePath", "normalizedPath", "path", "outputPath", "error", "runBuildTask", "taskName", "taskFn", "task", "handleWatcherEvents", "watcher", "options", "onInitialBuildComplete", "isInitialBuild", "buildTasksResults", "scheduledTasksTimer", "bundleSpinner", "watchSpinner", "ora", "buildTasks", "dtsSpinner", "create_dts", "rollup", "getDtsConfig", "sourceFiles", "outFile", "skipDocs", "skipSpinner", "analyzeSpinner", "analyzeComponents", "docsSpinner", "generateDocs", "checkInitialBuildComplete", "schedulePostBundleTasks", "delay", "event", "inputs", "input", "setupWatchModeListeners", "closeSpinner", "runProductionBuild", "options", "mainBundleConfig", "getMainBundleConfig", "demoConfig", "getDemoConfig", "dtsConfig", "getDtsConfig", "terser", "generateDocs", "buildCombinedBundle", "buildTypeDefinitions", "setupWatchMode", "isDevMode", "watcher", "watch", "handleWatcherEvents", "startDevelopmentServer", "setupWatchModeListeners", "buildWithRollup", "isWatchMode", "cleanupDist", "error", "devCommand", "program", "withBuildOptions", "withServerOptions", "dev_default", "options", "build", "ora", "buildWithRollup", "error", "program", "ora", "buildCommand", "program", "withBuildOptions", "build_default", "options", "build", "ora", "buildWithRollup", "error", "exec", "path", "process", "fileURLToPath", "util", "program", "inquirer", "migrate_default", "program", "options", "filename", "fileURLToPath", "dirname", "path", "scriptPath", "execPromise", "util", "exec", "process", "inquirer", "shell", "process", "program", "readFile", "writeFile", "Logger", "fs", "Logger", "processContentForFile", "templateFiller", "REMOTE_TEMPLATE_BASE_URL", "BRANCH_BASE", "TARGET_BRANCH_TO_COPY", "CONFIG_TEMPLATE", "githubDirShape", "branchNameToRemoteUrl", "branchOrTag", "filePath", "filePathToRemoteInput", "outputPath", "remoteUrl", "removeDirectory", "dirPath", "error", "syncDotGithubDir", "rootDir", "githubPath", "fileConfigs", "missingFiles", "dir", "file", "inputPath", "fileConfig", "config", "errorMessage", "sync_default", "program", "Logger", "cwd", "process", "syncDotGithubDir", "codeownersPath", "codeownersFixed", "readFile", "writeFile", "fs", "path", "Logger", "program", "glob", "prepWcaCompatibleCode_default", "code", "sourcePath", "defaultTag", "className", "classDesc", "WAC_DIR", "path", "globPath", "sources", "source", "glob", "err", "createExtendsFile", "filePaths", "fs", "filePath", "resolvedPath", "fileContent", "newPath", "newCode", "prepWcaCompatibleCode_default", "main", "wca_setup_default", "program", "Logger", "error", "program", "chalk", "ora", "appendFile", "readFile", "Logger", "simpleGit", "git", "error", "Git", "_Git", "pattern", "err", "currentBranch", "targetBranch", "commitRange", "commitChunks", "chunk", "commits", "parts", "hash", "date", "author_name", "subject", "bodyLines", "line", "body", "shortHash", "typeMatch", "type", "log", "result", "files", "branchName", "message", "chalk", "MAX_SUBJECT_LENGTH", "MAX_BODY_LENGTH", "getColoredType", "type", "wrapString", "str", "maxLength", "words", "result", "currentLine", "word", "displayDebugView", "commitList", "commit", "subject", "body", "github", "getExistingLabels", "token", "octokit", "context", "owner", "repo", "prNumber", "existingLabels", "label", "error", "applyLabelToPR", "prefixedLabel", "existingSemanticLabels", "existingLabel", "analyzeCommits", "debug", "setLabel", "spinner", "ora", "commitList", "Git", "displayDebugView", "commitTypes", "commit", "formattedTypes", "type", "getColoredType", "handleLabels", "error", "validCommitTypes", "foundCommitTypes", "selectedLabel", "highestPriorityIndex", "priorityIndex", "labelSpinner", "getExistingLabels", "applyLabelToPR", "errorMessage", "chalk", "check_commits_default", "program", "option", "analyzeCommits", "fs", "get", "chalk", "program", "ora", "pr_release_default", "option", "updatePackageJson", "namespace", "prNumber", "packageSpinner", "packageJsonPath", "packageJson", "releaseVersion", "packageComponent", "packageName", "incrementVersion", "getIncrementVersion", "packageVersion", "error", "spinner", "resolve", "handleResponse", "res", "data", "chunk", "packageData", "versions", "maxIteration", "versionRegex", "version", "match", "iteration", "registryUrl", "req", "err", "path", "fileURLToPath", "program", "__filename", "fileURLToPath", "cliRootDir", "path", "test_default", "program", "option", "command", "shell", "program", "getPackageVersion", "auroSplash_default"]
7
7
  }
@@ -1,9 +1,9 @@
1
- import{rollupAdapter as e}from"@web/dev-server-rollup";import{litScss as t}from"rollup-plugin-scss-lit";var n={files:"test/**/*.test.js",nodeResolve:!0,coverageConfig:{threshold:{statements:80,branches:80,functions:80,lines:80}},mimeTypes:{"**/*.scss":"js"},plugins:[e(t({options:{loadPaths:["../../node_modules","../node_modules","node_modules"]}}))],testRunnerHtml:s=>`<html>
1
+ import{rollupAdapter as s}from"@web/dev-server-rollup";import{litScss as t}from"rollup-plugin-scss-lit";var l={files:"test/**/*.test.js",nodeResolve:!0,coverageConfig:{threshold:{statements:80,branches:80,functions:80,lines:80},reportDir:"demo/coverage",reporters:["html"]},mimeTypes:{"**/*.scss":"js"},plugins:[s(t({options:{loadPaths:["../../node_modules","../node_modules","node_modules"]}}))],testRunnerHtml:e=>`<html>
2
2
  <head>
3
3
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/auro-classic/CSSCustomProperties.css">
4
4
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/alaska/CSSCustomProperties--alaska.css">
5
5
  </head>
6
6
  <body>
7
- <script type="module" src="${s}"></script>
7
+ <script type="module" src="${e}"></script>
8
8
  </body>
9
- </html>`};export{n as default};
9
+ </html>`};export{l as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aurodesignsystem-dev/auro-cli",
3
- "version": "0.0.0-pr79.1",
3
+ "version": "0.0.0-pr81.1",
4
4
  "description": "A cli tool to support the Auro Design System",
5
5
  "scripts": {
6
6
  "lint": "biome check --fix --no-errors-on-unmatched",