@stacksjs/stx 0.2.349 → 0.2.351
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/cli.js +1 -1
- package/package.json +5 -5
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
-
import{Ha as a,He as F,Je as v,Ke as P,Va as r,de as s,ee as t,nb as n,o as m,oa as l,ob as p,qb as i,wb as e}from"./chunk-zhm2kje7.js";import"./chunk-10x7762t.js";import"./chunk-2ver2s2y.js";import"./chunk-v9a4frbr.js";import"./chunk-rcve4mba.js";import"./chunk-m61knfax.js";import"./chunk-ym3r8ktq.js";import"./chunk-msywnv5n.js";import"./chunk-b5hank5e.js";import"./chunk-7qp3zphs.js";import"./chunk-3r5ffd2j.js";import"./chunk-0hd9jjwa.js";import"./chunk-57atgbyq.js";import"./chunk-8bxtvsgm.js";import"./chunk-yevadf67.js";import"./chunk-rwwfzkz4.js";import"./chunk-7h9fajgs.js";import"./chunk-18018jkn.js";import"./chunk-sqvqwd0p.js";import"./chunk-7r9vgzg4.js";import"./chunk-a959m68j.js";import"./chunk-1vb2rj09.js";import"./chunk-g6czgcg4.js";import"./chunk-m0ra1wx6.js";import"./chunk-1z1efvtw.js";import"./chunk-vgfd9582.js";import"./chunk-qsbjtp60.js";import"./chunk-nf7k53ap.js";import"./chunk-zk6ghjnj.js";import"./chunk-bgrkxzr7.js";import"./chunk-2rbxt8c1.js";import"./chunk-7we3xfde.js";import"./chunk-49srwy92.js";import"./chunk-8m0g0h4x.js";import"./chunk-e4g8wz6t.js";import"./chunk-hv9rk4aj.js";import"./chunk-xqgq5jzt.js";import"./chunk-p3p4d6g1.js";import"./chunk-c0n802j1.js";import{al as u,bl as c}from"./chunk-8vw9t1rb.js";import"./chunk-vgd2k0pf.js";import"./chunk-fvsefztj.js";import"./chunk-2p24mhh0.js";import{as as f}from"./chunk-8y1ve8tc.js";import"./chunk-njx93b4z.js";import"./chunk-bqdfbwdf.js";import"./chunk-89mqnh67.js";import"./chunk-xvh1k1a4.js";import{Es as A}from"./chunk-kkmk6j16.js";import"./chunk-y2f41kaq.js";import"./chunk-xj6bcwqa.js";import"./chunk-08ttrtrb.js";import"./chunk-vhta1be7.js";import"./chunk-tc4pj651.js";import"./chunk-san1eq0r.js";import"./chunk-avwywzsj.js";import"./chunk-wj21f1e0.js";import"./chunk-d86q27j8.js";import"./chunk-72x62kch.js";import"./chunk-swvm1wgn.js";import"./chunk-9nrgjtah.js";import{Nw as B}from"./chunk-ejqpq0wc.js";import{spawn as o}from"child_process";import L from"fs";import zb from"os";import $ from"path";import w from"process";import{CLI as wb}from"@stacksjs/clapp";var N="0.2.
|
|
3
|
+
import{Ha as a,He as F,Je as v,Ke as P,Va as r,de as s,ee as t,nb as n,o as m,oa as l,ob as p,qb as i,wb as e}from"./chunk-zhm2kje7.js";import"./chunk-10x7762t.js";import"./chunk-2ver2s2y.js";import"./chunk-v9a4frbr.js";import"./chunk-rcve4mba.js";import"./chunk-m61knfax.js";import"./chunk-ym3r8ktq.js";import"./chunk-msywnv5n.js";import"./chunk-b5hank5e.js";import"./chunk-7qp3zphs.js";import"./chunk-3r5ffd2j.js";import"./chunk-0hd9jjwa.js";import"./chunk-57atgbyq.js";import"./chunk-8bxtvsgm.js";import"./chunk-yevadf67.js";import"./chunk-rwwfzkz4.js";import"./chunk-7h9fajgs.js";import"./chunk-18018jkn.js";import"./chunk-sqvqwd0p.js";import"./chunk-7r9vgzg4.js";import"./chunk-a959m68j.js";import"./chunk-1vb2rj09.js";import"./chunk-g6czgcg4.js";import"./chunk-m0ra1wx6.js";import"./chunk-1z1efvtw.js";import"./chunk-vgfd9582.js";import"./chunk-qsbjtp60.js";import"./chunk-nf7k53ap.js";import"./chunk-zk6ghjnj.js";import"./chunk-bgrkxzr7.js";import"./chunk-2rbxt8c1.js";import"./chunk-7we3xfde.js";import"./chunk-49srwy92.js";import"./chunk-8m0g0h4x.js";import"./chunk-e4g8wz6t.js";import"./chunk-hv9rk4aj.js";import"./chunk-xqgq5jzt.js";import"./chunk-p3p4d6g1.js";import"./chunk-c0n802j1.js";import{al as u,bl as c}from"./chunk-8vw9t1rb.js";import"./chunk-vgd2k0pf.js";import"./chunk-fvsefztj.js";import"./chunk-2p24mhh0.js";import{as as f}from"./chunk-8y1ve8tc.js";import"./chunk-njx93b4z.js";import"./chunk-bqdfbwdf.js";import"./chunk-89mqnh67.js";import"./chunk-xvh1k1a4.js";import{Es as A}from"./chunk-kkmk6j16.js";import"./chunk-y2f41kaq.js";import"./chunk-xj6bcwqa.js";import"./chunk-08ttrtrb.js";import"./chunk-vhta1be7.js";import"./chunk-tc4pj651.js";import"./chunk-san1eq0r.js";import"./chunk-avwywzsj.js";import"./chunk-wj21f1e0.js";import"./chunk-d86q27j8.js";import"./chunk-72x62kch.js";import"./chunk-swvm1wgn.js";import"./chunk-9nrgjtah.js";import{Nw as B}from"./chunk-ejqpq0wc.js";import{spawn as o}from"child_process";import L from"fs";import zb from"os";import $ from"path";import w from"process";import{CLI as wb}from"@stacksjs/clapp";var N="0.2.351";var __dirname="/home/runner/work/stx/stx/packages/stx/bin",E=new wb("stx");function h(J){let Z=typeof J==="string"?Number.parseInt(J,10):J;if(Number.isNaN(Z))return{isValid:!1,error:"Port must be a valid number",suggestion:"Try using a number between 1024 and 65535"};if(Z<1024||Z>65535)return{isValid:!1,error:"Port must be between 1024 and 65535",suggestion:"Try using a port between 1024 and 65535"};return{isValid:!0}}function d(J){try{if(!L.existsSync(J)){let K=$.dirname(J),x=$.basename(J);if(L.existsSync(K)){let z=L.readdirSync(K).filter((j)=>j.toLowerCase().includes(x.toLowerCase().substring(0,3))||j.endsWith(".stx")||j.endsWith(".md")),k=z.length>0?`File not found. Similar files in ${K}: ${z.slice(0,3).join(", ")}`:`File not found. Directory ${K} exists but doesn't contain the specified file.`;return{isValid:!1,error:`File does not exist: ${J}`,suggestion:k}}return{isValid:!1,error:`File does not exist: ${J}`,suggestion:"Check the file path and try again"}}if(L.statSync(J).isDirectory())return{isValid:!1,error:`Expected file but got directory: ${J}`,suggestion:"Specify a .stx or .md file path"};return{isValid:!0}}catch(Z){return{isValid:!1,error:`Cannot access file: ${J}`,suggestion:"Check file permissions and path"}}}function y(J){let Z=typeof J==="string"?Number.parseInt(J,10):J;if(Number.isNaN(Z))return{isValid:!1,error:"Timeout must be a valid number",suggestion:"Specify timeout in milliseconds (e.g., 5000 for 5 seconds)"};if(Z<100)return{isValid:!1,error:"Timeout too short (minimum 100ms)",suggestion:"Use a timeout of at least 100ms"};if(Z>300000)return{isValid:!1,error:"Timeout too long (maximum 5 minutes)",suggestion:"Use a timeout of less than 300000ms (5 minutes)"};return{isValid:!0}}var V=(J)=>J.includes("*")||J.includes("?")||J.includes("{")||J.includes("["),jb=(J)=>J.endsWith(".stx")||J.endsWith(".md");function S(J,Z=1){if(console.error(`\u274C ${J.error}`),J.suggestion)console.error(`\uD83D\uDCA1 suggestion: ${J.suggestion}`);w.exit(Z)}function kb(J){if(!J)return;let Z;try{Z=JSON.parse(J)}catch(K){console.error(`\u274C --info-plist is not valid JSON: ${K.message}`),w.exit(1)}if(typeof Z!=="object"||Z===null||Array.isArray(Z))console.error(`\u274C --info-plist must be a JSON object, e.g. '{"NSFocusStatusUsageDescription":"\u2026"}'`),w.exit(1);for(let[K,x]of Object.entries(Z))if(typeof x!=="string"&&typeof x!=="number"&&typeof x!=="boolean")console.error(`\u274C --info-plist value for "${K}" must be a string, number or boolean`),w.exit(1);return Z}async function Hb(J,Z){try{let K=["test"],x=[];if(J&&J.length>0)for(let W of J)if(V(W))try{let H=await Array.fromAsync(new Bun.Glob(W).scan({onlyFiles:!0,absolute:!0}));if(H.length===0)console.warn(`Warning: No files found matching pattern: ${W}`);else if(x.push(...H),Z.verbose)console.log(`Found ${H.length} file(s) matching pattern: ${W}`)}catch(H){return console.error(`Error expanding glob pattern ${W}:`,H),!1}else x.push(W);if(x.length===0)return console.error("Error: No test files found matching the provided patterns."),!1;if(K.push(...x),Z.filter)K.push("--pattern",Z.filter);if(Z.timeout)K.push("--timeout",Z.timeout.toString());if(Z.reporter&&Z.reporter!=="default")if(Z.reporter==="junit"){let W=$.join(zb.tmpdir(),`stx-test-report-${Date.now()}.xml`);K.push("--reporter",Z.reporter),K.push("--reporter-outfile",W)}else console.warn(`Warning: Reporter '${Z.reporter}' is not supported. Using default reporter.`);if(Z.coverage)K.push("--coverage");if(Z.watch)K.push("--watch");K.push("--preload",$.join(__dirname,"../../../test-utils/happy-dom.ts"));let b={...w.env,STX_TEST_MODE:"true",STX_TEST_UI:Z.ui?"true":"false",STX_TEST_VERBOSE:Z.verbose?"true":"false"},z="bun";if(Z.verbose)console.log(`Running: ${z} ${K.join(" ")}`);let k=performance.now(),j=o(z,K,{stdio:"inherit",shell:!1,env:b});return new Promise((W)=>{j.on("close",(H)=>{let Y=((performance.now()-k)/1000).toFixed(2);if(H===0)W(!0);else W(!1)}),w.on("SIGINT",()=>{console.log(`
|
|
4
4
|
Test run interrupted`),j.kill("SIGINT"),w.exit(1)})})}catch(K){return console.error("Error running tests:",K instanceof Error?K.message:String(K)),!1}}var Qb=w.argv.length>=3&&(jb(w.argv[2])&&L.existsSync(w.argv[2])||V(w.argv[2]));if(Qb){let J=w.argv[2],Z={port:3000,watch:!0,cache:!0,markdown:{syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0}}};for(let K=3;K<w.argv.length;K++){let x=w.argv[K];if(x==="--port"&&K+1<w.argv.length){let b=h(w.argv[++K]);if(!b.isValid)S(b);Z.port=Number.parseInt(w.argv[K],10)}else if(x==="--no-watch")Z.watch=!1;else if(x==="--highlight-theme"&&K+1<w.argv.length){if(!Z.markdown)Z.markdown={};if(!Z.markdown.syntaxHighlighting)Z.markdown.syntaxHighlighting={};Z.markdown.syntaxHighlighting.defaultTheme=w.argv[++K]}else if(x==="--no-highlight"){if(!Z.markdown)Z.markdown={};if(!Z.markdown.syntaxHighlighting)Z.markdown.syntaxHighlighting={};Z.markdown.syntaxHighlighting.enabled=!1}else if(x==="--no-highlight-unknown"){if(!Z.markdown)Z.markdown={};if(!Z.markdown.syntaxHighlighting)Z.markdown.syntaxHighlighting={};Z.markdown.syntaxHighlighting.highlightUnknownLanguages=!1}else if(x==="--no-cache")Z.cache=!1;else if(x==="--native")Z.native=!0}if(V(J))try{let K=await Array.fromAsync(new Bun.Glob(J).scan({onlyFiles:!0,absolute:!0})),x=J.endsWith(".stx")?K.filter((j)=>j.endsWith(".stx")):J.endsWith(".md")?K.filter((j)=>j.endsWith(".md")):K.filter((j)=>j.endsWith(".stx")||j.endsWith(".md")),b=J.split("*")[0].replace(/\/$/,"")||".",z=$.resolve(b);try{let j=new Bun.Glob("**/*.stx"),H=(await Array.fromAsync(j.scan({cwd:z,onlyFiles:!0,absolute:!0}))).filter((U)=>/\[.+\]/.test($.basename(U)));for(let U of H)if(!x.includes(U))x.push(U)}catch{}if(x.length===0)console.error(`Error: No STX or Markdown files found matching pattern: ${J}`),w.exit(1);if(!await v(x,Z))w.exit(1)}catch(K){console.error("Failed to process files:",K),w.exit(1)}else F(J,Z).catch((K)=>{console.error("Failed to start dev server:",K),w.exit(1)})}else{let J=function(x,b){let z=[];for(let k=0;k<=b.length;k++)z[k]=[k];for(let k=0;k<=x.length;k++)z[0][k]=k;for(let k=1;k<=b.length;k++)for(let j=1;j<=x.length;j++)if(b.charAt(k-1)===x.charAt(j-1))z[k][j]=z[k-1][j-1];else z[k][j]=Math.min(z[k-1][j-1]+1,z[k][j-1]+1,z[k-1][j]+1);return z[b.length][x.length]};E.command("docs","Generate documentation for components, templates, and directives").option("--output <dir>","Output directory for documentation",{default:"docs"}).option("--format <format>","Documentation format (markdown, html, json)",{default:"markdown"}).option("--components-dir <dir>","Components directory",{default:"components"}).option("--templates-dir <dir>","Templates directory",{default:"."}).option("--no-components","Disable components documentation").option("--no-templates","Disable templates documentation").option("--no-directives","Disable directives documentation").option("--extra-content <content>","Extra content to include in documentation").example("stx docs --output docs --format html").action(async(x)=>{try{if(await r(x))console.log("Documentation generated successfully."),w.exit(0);else console.error("Documentation generation failed."),w.exit(1)}catch(b){console.error("Error generating documentation:",b),w.exit(1)}}),E.command("iconify <command>","Generate Iconify icon packages").option("--output <dir>","Output directory for generated packages",{default:"packages"}).option("--icons <icons>","Comma-separated list of specific icons to generate").example("stx iconify list").example("stx iconify generate mdi").example("stx iconify generate lucide --icons home,settings,user").action(async(x,b)=>{try{let{fetchCollections:z,generatePackage:k}=await import("./chunk-05zfez2g.js");if(x==="list"){console.log(`
|
|
5
5
|
\uD83D\uDCDA Fetching available icon collections...
|
|
6
6
|
`);let j=await z(),W=Object.entries(j).sort((H,U)=>U[1].total-H[1].total);console.log(`Available collections:
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/stx",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.351",
|
|
5
5
|
"description": "A performant UI Framework. Powered by Bun.",
|
|
6
6
|
"author": "Chris Breuer <chris@stacksjs.org>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -117,12 +117,12 @@
|
|
|
117
117
|
"dependencies": {
|
|
118
118
|
"@stacksjs/ts-css": "^0.3.2",
|
|
119
119
|
"@stacksjs/clapp": "^0.2.16",
|
|
120
|
-
"@stacksjs/desktop": "0.2.
|
|
121
|
-
"@stacksjs/sanitizer": "0.2.
|
|
120
|
+
"@stacksjs/desktop": "0.2.351",
|
|
121
|
+
"@stacksjs/sanitizer": "0.2.351",
|
|
122
122
|
"@stacksjs/ts-i18n": "^0.1.11",
|
|
123
|
-
"bun-plugin-stx": "0.2.
|
|
123
|
+
"bun-plugin-stx": "0.2.351",
|
|
124
124
|
"bunfig": "^0.15.19",
|
|
125
|
-
"stx-router": "0.2.
|
|
125
|
+
"stx-router": "0.2.351",
|
|
126
126
|
"ts-broadcasting": "^0.0.10",
|
|
127
127
|
"ts-images": "^0.2.22",
|
|
128
128
|
"ts-syntax-highlighter": "^0.2.1"
|