@aurodesignsystem-dev/auro-cli 0.0.0-pr71.0

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.
Files changed (26) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +2 -0
  3. package/README.md +60 -0
  4. package/dist/auro-cli.js +29 -0
  5. package/dist/auro-cli.js.map +7 -0
  6. package/dist/migrations/auro-template-sync-v2/multi-gitter.yml +179 -0
  7. package/dist/migrations/auro-template-sync-v2/script.sh +3 -0
  8. package/dist/migrations/github-config-and-gitignore-changes/migration.d.ts +1 -0
  9. package/dist/migrations/github-config-and-gitignore-changes/migration.js +6 -0
  10. package/dist/migrations/github-config-and-gitignore-changes/multi-gitter.yml +181 -0
  11. package/dist/migrations/github-config-and-gitignore-changes/script.sh +4 -0
  12. package/dist/migrations/package-update-dropdown-v3-2-2/multi-gitter.yml +180 -0
  13. package/dist/migrations/package-update-dropdown-v3-2-2/script.sh +12 -0
  14. package/dist/migrations/package-update-node/migration.d.ts +1 -0
  15. package/dist/migrations/package-update-node/migration.js +2 -0
  16. package/dist/migrations/package-update-node/multi-gitter.yml +180 -0
  17. package/dist/migrations/package-update-node/script.sh +5 -0
  18. package/dist/migrations/token-formatting/migration.d.ts +1 -0
  19. package/dist/migrations/token-formatting/migration.js +8 -0
  20. package/dist/migrations/token-formatting/multi-gitter.yml +173 -0
  21. package/dist/migrations/token-formatting/script.sh +3 -0
  22. package/dist/migrations/wca-script-update/migration.d.ts +1 -0
  23. package/dist/migrations/wca-script-update/migration.js +2 -0
  24. package/dist/migrations/wca-script-update/multi-gitter.yml +164 -0
  25. package/dist/migrations/wca-script-update/script.sh +9 -0
  26. package/package.json +92 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2025 Alaska Airlines, Inc. or its affiliates. All Rights Reserved.
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/NOTICE ADDED
@@ -0,0 +1,2 @@
1
+ Alaska Airlines Auro Design System
2
+ Copyright 2025 Alaska Airlines, Inc. or its affiliates. All Rights Reserved.
package/README.md ADDED
@@ -0,0 +1,60 @@
1
+ # Auro CLI
2
+
3
+ Auro CLI is a command-line interface designed to help consumers of the Auro Design System and the developers maintaining it.
4
+
5
+ ## `Dev` Command Features
6
+
7
+ - **Start Development Server**: Quickly launch a web development server with default or custom configurations.
8
+ - **Customizable Options**: Specify the port and the directory to open when the server starts.
9
+ - **Hot Module Replacement**: Integrates with HMR (Hot Module Replacement) for a better development experience.
10
+ - **Graceful Error Handling**: Handles invalid inputs and missing options gracefully.
11
+
12
+ ## Table of Contents
13
+
14
+ - [Installation](#installation)
15
+ - [Usage](#usage)
16
+ - [Commands](#commands)
17
+ - [Options](#options)
18
+ - [Examples](#examples)
19
+
20
+ ## Installation
21
+
22
+ To install Auro CLI, clone the repository and install the dependencies:
23
+
24
+ ```bash
25
+ npm install @aurodesignsystem/auro-cli
26
+ ```
27
+
28
+ ## Usage
29
+
30
+ To use Auro CLI, run the following command in your terminal:
31
+
32
+ ```bash
33
+ auro dev
34
+ ```
35
+
36
+ This will start the development server with default options.
37
+
38
+ ## Commands
39
+
40
+ `auro dev`
41
+ Runs the web development server.
42
+
43
+ #### Options
44
+
45
+ - `-o, --open <type>` Open the server to a specific directory (default: demo/).
46
+ - `-p, --port <type>` Change the server port (default: undefined).
47
+
48
+ #### Examples
49
+
50
+ Start the server on a specific port:
51
+
52
+ ```
53
+ auro dev --port 8000
54
+ ```
55
+
56
+ Open the server to a specific directory:
57
+
58
+ ```
59
+ auro dev --open src/
60
+ ```
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env node
2
+ import{program as Z}from"commander";import _e from"figlet";import{mind as Re}from"gradient-string";var ee=()=>Re(_e.textSync("Auro CLI"));import te from"node:fs";import re from"node:path";import{fileURLToPath as Be}from"node:url";function P(e){process.env.DEBUG&&console.log(`[DEBUG] ${e}`)}function U(){try{let e=Be(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 mt}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 st from"@rollup/plugin-terser";import{watch as at}from"rollup";import{rmSync as Me}from"node:fs";import{join as We}from"node:path";import W from"ora";import{rollup as M}from"rollup";import{spawn as Ie}from"node:child_process";import Oe from"ora";var T=(e,t)=>{let r=`${e} ${t?t.join(" "):""}`,o=Oe(),n=[],i=Ie(e,t||[],{stdio:"pipe",shell:!0});i.stdout.on("data",s=>{let a=s.toString();n.push(a),process.stdout.write(a)}),i.stderr.on("data",s=>{let a=s.toString();n.push(a),process.stderr.write(a)}),i.on("close",s=>{s!==0?o.fail(`${r} failed (code ${s})`):o.succeed(`${r} completed successfully`)})};async function _(e,t){T(`npx wca analyze ${e||"scripts/wca/*"} --outFiles ${t||"docs/api.md"}`)}import{Logger as Fe}from"@aurodesignsystem/auro-library/scripts/utils/logger.mjs";import{generateReadmeUrl as Ne,processContentForFile as je,templateFiller as ne}from"@aurodesignsystem/auro-library/scripts/utils/sharedFileProcessorUtils.mjs";var Le={overwriteLocalCopies:!0,remoteReadmeVersion:"master",remoteReadmeVariant:"_updated_paths"};function x(e){return`${process.cwd()}/${e}`}var Ge=e=>[{identifier:"README.md",input:{remoteUrl:Ne(e.remoteReadmeVersion,e.remoteReadmeVariant),fileName:x("/docTemplates/README.md"),overwrite:e.overwriteLocalCopies},output:x("/README.md")},{identifier:"index.md",input:x("/docs/partials/index.md"),output:x("/demo/index.md"),mdMagicConfig:{output:{directory:x("/demo")}}},{identifier:"api.md",input:x("/docs/partials/api.md"),output:x("/demo/api.md"),preProcessors:[ne.formatApiTable]}];async function Ue(e=Le){await ne.extractNames();for(let t of Ge(e))try{await je(t)}catch(r){Fe.error(`Error processing ${t.identifier}: ${r.message}`)}}async function ie(){await Ue()}function se(){let e=We("./dist"),t=W("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=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 qe}from"node:path";import{nodeResolve as Ve}from"@rollup/plugin-node-resolve";import{glob as Je}from"glob";import{dts as Ye}from"rollup-plugin-dts";import{litScss as Ke}from"rollup-plugin-scss-lit";import He from"node:path";import{glob as ze}from"glob";function le(e){return{name:"watch-globs",buildStart(){let t=Array.isArray(e)?e:[e];for(let r of t)try{for(let o of ze.sync(He.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 me(e=[],t={}){let{watchPatterns:r=z.watchPatterns,dedupe:o=["lit","lit-element","lit-html"]}=t,n=[...z.modulePaths,...e];return[Ve({dedupe:o,preferBuiltins:!1,moduleDirectories:z.moduleDirectories}),Ke({minify:{fast:!0},options:{loadPaths:n}}),le(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:Xe(),plugins:me(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(Je.sync(o,{ignore:n}).map(s=>[qe(s,".js"),s])),output:{format:"esm",dir:i,entryFileNames:"[name].min.js",chunkFileNames:"[name].min.js"},plugins:me(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:[Ye()]}}}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 Xe(e=[]){return[...[/node_modules\/lit/,/node_modules\/lit-element/,/node_modules\/lit-html/,/node_modules\/@lit/],...e]}import{startDevServer as Qe}from"@web/dev-server";import{hmrPlugin as Ze}from"@web/dev-server-hmr";import et from"ora";var v={watch:!0,nodeResolve:!0,basePath:"/",rootDir:"./demo",hmrInclude:["src/**/*","demo/**/*","apiExamples/**/*","docs/**/*"]};async function de(e={}){let t=et(`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:[Ze({include:e.hmrInclude??v.hmrInclude})]},o=await Qe({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 w from"ora";import{rollup as tt}from"rollup";var B=!1,rt={dts:{active:!1,lastTime:0},analyze:{active:!1,lastTime:0},docs:{active:!1,lastTime:0}},ot=5e3,I=new Set,nt=["/dist/index.d.ts","/custom-elements.json","/demo/api.md","/docs/api.md","/demo/index.min.js"];function it(e){if(!e||typeof e!="string")return!1;try{let t=pe.normalize(e);return nt.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=rt[e];if(r.active||Date.now()-r.lastTime<ot)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,a=w("Activating watch mode...").start(),c={dts:async()=>{let l=w("Crafting type definitions...").start();try{let m=await tt(C().config);return await m.write(C().config.output),await m.close(),l.succeed("Type files built."),!0}catch(m){return l.fail("Types trouble! Build failed."),console.error("TypeScript definition build error:",m),!1}},analyze:async()=>{let{wcaInput:l,wcaOutput:m,skipDocs:h}=t;if(h){let y=w("Skipping component analysis...").start();return setTimeout(()=>{y.succeed("Component analysis skipped.")},0),!0}let $=w("Detective work: analyzing components...").start();try{return await _(l,m),$.succeed("Component analysis complete! API generated."),!0}catch(y){return $.fail("Analysis hiccup! Something went wrong."),console.error("Component analysis error:",y),!1}},docs:async()=>{if(B)return!1;if(t.skipDocs){let m=w("Skipping docs generation...").start();return setTimeout(()=>{m.succeed("Docs generation skipped.")},0),!0}let l=w("Refreshing docs...").start();try{return await R(t),l.succeed("Documentation refreshed!"),!0}catch(m){l.fail("Docs stumble! Couldn't refresh."),console.error("Documentation rebuild error:",m)}}},f=()=>{o&&n.dts&&n.analyze&&n.docs&&typeof r=="function"&&(o=!1,r())};function d(l=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),f()},1e3)},1e3)},l)}e.on("event",async l=>{switch(l.code){case"START":a.succeed("Watch mode active! Eyes peeled.");break;case"BUNDLE_START":if(I.clear(),l.input)try{let m=Array.isArray(l.input)?l.input:typeof l.input=="string"?[l.input]:typeof l.input=="object"&&l.input!==null?Object.values(l.input):[];for(let h of m)typeof h=="string"&&!it(h)&&I.add(pe.normalize(h))}catch(m){console.error("Error processing input paths:",m)}s=w("Weaving bundles...").start(),B=!0;break;case"BUNDLE_END":s&&s.succeed(`Bundle ${Array.isArray(l.input)?`of ${l.input.join("& ")} `:""}done in ${l.duration}ms! \u{1F680}`),B=!1,I.size>0&&d();break;case"END":break;case"ERROR":B=!1,s?s.fail(`Oops! Bundle hit a snag: ${l.error.message}`):w().fail(`Watch mode hiccup: ${l.error.message}`),I.clear();break}})}function ge(e){return process.on("SIGINT",()=>{let t=w("Wrapping up...").start();e.close(),t.succeed("All done! See you next time. \u2728"),process.exit(0)}),e}async function ct(e){let t=q(e),r=V(e),o=C();t.config.plugins.push(st()),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=at([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 ct(e):await lt(e)}catch(t){throw new Error(`Build failed: ${t.message}`)}}var k=mt.command("dev").description("Runs development server for auro components");k=A(k,{watch:!0});k=oe(k);var Jr=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 ut}from"commander";import ye from"ora";var Y=ut.command("build").description("Builds auro components");Y=A(Y,{watch:!1});var eo=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 dt}from"node:child_process";import we from"node:path";import pt from"node:process";import{fileURLToPath as ft}from"node:url";import gt from"node:util";import{program as ht}from"commander";import yt from"inquirer";var mo=ht.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=ft(import.meta.url),r=we.dirname(t),o=we.resolve(r,"migrations",e.id);if(e.multiGitter){let n=gt.promisify(dt);try{await n("command -v multi-gitter")}catch{console.error("multi-gitter is not installed."),pt.exit(1)}(await yt.prompt([{type:"confirm",name:"dryRun",message:"Run migration in dry-run mode? (no changes will be committed)",default:!0}])).dryRun?T(`multi-gitter run ${o}/script.sh --config "${o}/multi-gitter.yml" --dry-run`):T(`multi-gitter run ${o}/script.sh --config "${o}/multi-gitter.yml"`)}else T(`${o}/script.sh`)});import kt from"node:process";import{program as Dt}from"commander";import{readFile as St,writeFile as Pt}from"node:fs/promises";import{Logger as X}from"@aurodesignsystem/auro-library/scripts/utils/logger.mjs";import wt from"node:fs/promises";import{Logger as b}from"@aurodesignsystem/auro-library/scripts/utils/logger.mjs";import{processContentForFile as bt,templateFiller as $t}from"@aurodesignsystem/auro-library/scripts/utils/sharedFileProcessorUtils.mjs";var K="https://raw.githubusercontent.com/AlaskaAirlines/auro-templates",be="main",xt="main",Et="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 Tt(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=Tt(t,e);return{identifier:e.split("/").pop(),input:{remoteUrl:o,fileName:r,overwrite:!0},output:r,overwrite:!0}}async function vt(e){try{await wt.rm(e,{recursive:!0,force:!0}),b.log(`Successfully removed directory: ${e}`)}catch(t){throw b.error(`Error removing directory ${e}: ${t.message}`),t}}async function xe(e){e||(b.error("Root directory must be specified"),process.exit(1));let t=".github";try{await vt(t),b.log(".github directory removed successfully")}catch(n){b.error(`Error removing .github directory: ${n.message}`),process.exit(1)}await $t.extractNames();let r=[],o=[];for(let n of Object.keys($e))for(let i of $e[n]){let s=`${n==="_root"?"":`${n}/`}${i}`,a=`${e}/.github/${s}`,c=Ct(`templates/${Et}/.github/${s}`,xt,a);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
+ `);b.error(`Failed to sync .github directory. Confirm githubDirShape object is up to date:
5
+ ${n}`),process.exit(1)}try{await Promise.all(r.map(n=>bt(n))),b.log("All files processed.")}catch(n){b.error(`Error processing files: ${n.message}`),process.exit(1)}}var Eo=Dt.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=kt.cwd();await xe(e);let t=`${e}/.github/CODEOWNERS`,o=(await St(t,{encoding:"utf-8"})).replace(/\r\n/gu,`
6
+ `).replace(/\n\n/gu,`
7
+ `);await Pt(t,o,{encoding:"utf-8"}),(o.includes("\r")||o.includes(`
8
+
9
+ `))&&X.error("CODEOWNERS file still has Windows line endings.")});import F from"node:fs";import D from"node:path";import{Logger as Te}from"@aurodesignsystem/auro-library/scripts/utils/logger.mjs";import{program as At}from"commander";import{glob as _t}from"glob";var Ee=(e,t)=>{let r=(e.match(/static register\(name \= (.+)\)/)||e.match(/customElements.get\((.+?)\)/))[1],o=e.match(/export class (.+) extends/)?.[1],n=e.match(/\/\*\*((.|\n)*?)(\*\n|\*\/|[@])/)?.[1]||"";return!r||!o?e:`
10
+ import { ${o} } from '${t}';
11
+
12
+ /**${n}*/
13
+ class ${o}WCA extends ${o} {}
14
+
15
+ if (!customElements.get(${r})) {
16
+ customElements.define(${r}, ${o}WCA);
17
+ }
18
+ `};var N=D.resolve(process.cwd(),"./scripts/wca");async function Rt(e){try{return(await Promise.all(e.map(r=>_t(r)))).flat()}catch(t){throw console.error("Error processing glob patterns:",t),t}}async function Bt(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 It(){let e=await Rt(["./src/auro-*.js"]);await Bt(e)}var _o=At.command("wca-setup").description("Set up WCA (Web Component Analyzer) for the project").action(()=>{It().then(()=>{Te.success("WCA setup completed successfully.")}).catch(e=>{Te.error(`WCA setup failed: ${e.message}`)})});import{program as Mt}from"commander";import Gt from"chalk";import De from"ora";import{appendFile as Ot,readFile as Ft}from"node:fs/promises";import{Logger as u}from"@aurodesignsystem/auro-library/scripts/utils/logger.mjs";import{simpleGit as Nt}from"simple-git";var g;try{g=Nt({baseDir:process.cwd(),binary:"git",maxConcurrentProcesses:1})}catch(e){u.error(`Failed to initialize git: ${e}`),g={}}var j=class e{static async checkGitignore(t){if(t==="")return!1;try{return(await Ft(".gitignore","utf-8")).includes(t)}catch(r){return u.error(`Error reading file: ${r}`),!1}}static async getCommitMessages(){try{let t=await g.branchLocal();u.info(`Current branch: ${t.current}`);let r="main",o="";if(!!process.env.GITHUB_ACTIONS){u.info("Running in GitHub Actions environment"),r=process.env.GITHUB_BASE_REF||"main";try{await g.fetch("origin",r),u.info(`Fetched target branch: origin/${r}`),o=`${(await g.raw(["merge-base",`origin/${r}`,"HEAD"])).trim()}..HEAD`,u.info(`Using commit range: ${o}`)}catch(i){u.warn(`Error setting up commit range in CI: ${i}`),o=`origin/${r}..HEAD`,u.info(`Falling back to commit range: ${o}`)}}else{u.info("Running in local environment");try{try{await g.raw(["rev-parse","--verify",`origin/${r}`])}catch{u.info(`Fetching ${r} from origin`),await g.fetch("origin",r)}o=`${(await g.raw(["merge-base",`origin/${r}`,t.current])).trim()}..HEAD`,u.info(`Using commit range for PR commits: ${o}`)}catch(i){u.warn(`Error determining PR commits locally: ${i}`),u.info("Falling back to analyzing recent commits"),o="HEAD~10..HEAD",u.info(`Using fallback commit range: ${o}`)}}return await e.getFormattedCommits(o)}catch(t){return u.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
+ `).filter(i=>i.trim()!==""),n=[];for(let i of o){let s=i.split(`
20
+ `);if(s.length>=4){let a=s[0],c=s[1],f=s[2],d=s[3],l=s.slice(4).filter(G=>G!=="COMMIT_END"),m=l.length>0?l.join(""):"",h=a.substring(0,7),$=d.match(/^(feat|fix|docs|style|refactor|perf|test|build|ci|chore)(\(.+\))?:/),y=$?$[1]:"unknown";m.includes("BREAKING CHANGE")&&(y="breaking"),n.push({type:y,hash:h,date:c,subject:d,body:m,message:`${d}${m?`
21
+
22
+ ${m}`:""}`,author_name:f})}}return n}static async addToGitignore(t,r=!0){await e.checkGitignore(t).then(async o=>{if(o)u.warn(`${t} already exists`);else try{await Ot(".gitignore",`
23
+ ${t}`),r&&u.success(`${t} added to .gitignore`)}catch(n){u.error(n)}})}static async removeFromGitCache(t){try{await g.rmKeepLocal(t),u.success(`${t.join(", ")} are removed from git cache`)}catch(r){u.error(r)}}static async createBranch(t){try{await g.checkoutLocalBranch(t),u.success(`Created and switched to ${t} branch`)}catch(r){u.error(r)}}static async commitStagedFiles(t){try{await g.add("."),await g.commit(t),u.success(`Committed with message: ${t}`)}catch(r){u.error(r)}}};import p from"chalk";var jt=60,Lt=100;function S(e){switch(e){case"breaking":return p.bold.red(e);case"feat":return p.bold.green(e);case"fix":return p.bold.green(e);case"perf":return p.bold.green(e);case"docs":return p.bold.cyan(e);case"style":return p.bold.cyan(e);case"refactor":return p.bold.cyan(e);case"test":return p.bold.cyan(e);case"build":return p.bold.cyan(e);case"ci":return p.bold.cyan(e);case"chore":return p.bold.cyan(e);default:return p.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,jt),o=Ce(t.body,Lt);console.log(p.bold(`${S(t.type)}`)),console.log(p.dim(`${t.hash} | ${t.date} | ${t.author_name}`)),console.log(p.bold(`${p.white(r)}`)),t.body&&console.log(p.dim(o))}console.log("\u2500".repeat(60)),console.log(`
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(a=>a.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,a=`semantic-status: ${e}`,c=await Q();if(c.includes(a))return;let f=c.filter(d=>d.startsWith("semantic-status:")&&d!==a);for(let d of f)await r.rest.issues.removeLabel({owner:n,repo:i,issue_number:s,name:d});await r.rest.issues.addLabels({owner:n,repo:i,issue_number:s,labels:[a]});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(a=>a.type),s=Array.from(new Set(n)).map(a=>S(a)).join(", ");r.succeed(`Found commit types: ${s}`)}else r.info(`The list of commits is created by comparing the current branch
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 Ut(o,r)}catch(o){r.fail("Error getting commit messages"),console.error(o)}}async function Ut(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 a=r.indexOf(s);a<i&&(i=a,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(a){let c=a instanceof Error?a.message:String(a);s.fail(c)}}else t.warn(Gt.yellow("No semantic commit type found to apply as label."))}var Yo=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 E from"chalk";import{program as Wt}from"commander";import Ht from"ora";var rn=Wt.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 zt(e)}),zt=async e=>{let{namespace:t,prNumber:r}=e,o=Ht("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}`,a=i.name.split("/")[1],c=`${t}/${a}`,f=await qt(s,c,o),d=`${s}.${f}`;i.name=c,i.version=d,o.text="Writing updated package.json...",Pe.writeFileSync(n,`${JSON.stringify(i,null,2)}
29
+ `,"utf8"),o.succeed(`Package.json updated to use ${E.green(d)} and ${E.green(c)}`),process.exit(0)}catch(n){o.fail(`Failed to update package.json: ${n}`),process.exit(1)}},qt=(e,t,r)=>new Promise(o=>{try{let a=function(c){if(c.statusCode!==200){r.info(`Package not found. Status code: ${E.red(c.statusCode)}, defaulting to version 0`),o(0);return}r.text="Processing version information...";let f="";c.on("data",d=>{f+=d}),c.on("end",()=>{try{let d=JSON.parse(f),l=d.versions?Object.keys(d.versions):[];r.text="Calculating next version number...";let m=-1,h=new RegExp(`^${e}\\.(\\d+)$`);for(let $ of l){let y=$.match(h);if(y){let G=Number.parseInt(y[1],10);m=Math.max(m,G)}}m>=0?r.info(`Found existing version ${E.green(`${e}.${m}`)}. Incrementing to ${E.green(`${e}.${m+1}`)}`):r.info(`No existing version found for ${E.green(e)}. Starting with ${E.green(`${e}.0`)}`),o(m+1)}catch(d){r.warn(`Failed to parse NPM registry response: ${d instanceof Error?d.message:"Unknown error"}, defaulting to version 0`),o(0)}})};var n=a;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"}},a).on("error",f=>{r.warn(`Error following redirect: ${f.message}, defaulting to version 0`),o(0)}).end()}catch(f){r.warn(`Redirect request failed: ${f instanceof Error?f.message:"Unknown error"}, defaulting to version 0`),o(0)}return}a(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)}});Z.name("auro").version(U()).description("A cli tool to support the Auro Design System");Z.addHelpText("beforeAll",ee());Z.parse();