@zuzjs/ui 1.0.1 → 1.0.2

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/bin.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';var chunkXJAW5JFY_cjs=require('./chunk-XJAW5JFY.cjs'),commander=require('commander'),K=require('chokidar'),l=require('path'),c=require('picocolors'),p=require('fs'),tsMorph=require('ts-morph');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var K__default=/*#__PURE__*/_interopDefault(K);var l__default=/*#__PURE__*/_interopDefault(l);var c__default=/*#__PURE__*/_interopDefault(c);var p__default=/*#__PURE__*/_interopDefault(p);/* ZuzJS UI CLI */
3
- var x=class{project;stylesToGenerate;manifest={};supportedExtensions=[".tsx",".jsx",".mdx",".md"];constructor(){this.project=new tsMorph.Project({compilerOptions:{allowJs:true,jsx:1}}),this.stylesToGenerate=new Set;}extractStyles(t,e=""){if(t.asKind(tsMorph.SyntaxKind.JsxExpression)){let s=t.getExpression();s&&this.extractStyles(s,e);return}if(t.asKind(tsMorph.SyntaxKind.StringLiteral)||t.asKind(tsMorph.SyntaxKind.NoSubstitutionTemplateLiteral)||t.asKind(tsMorph.SyntaxKind.NumericLiteral))this.stylesToGenerate.add(e+t.getLiteralValue().toString());else if(t.asKind(tsMorph.SyntaxKind.TemplateExpression)){let s=t.getHead().getLiteralText();t.getTemplateSpans().forEach(o=>{this.extractStyles(o.getExpression(),e+s);});}else t.asKind(tsMorph.SyntaxKind.ConditionalExpression)?(this.extractStyles(t.getWhenTrue(),e),this.extractStyles(t.getWhenFalse(),e)):t.asKind(tsMorph.SyntaxKind.ArrayLiteralExpression)?t.getElements().forEach(s=>this.extractStyles(s,e)):t.asKind(tsMorph.SyntaxKind.BinaryExpression)&&(this.extractStyles(t.getLeft(),e),this.extractStyles(t.getRight(),e));}processFile(t){this.stylesToGenerate.clear();let e=t.endsWith(".mdx")||t.endsWith(".md"),s;if(e){let i=p__default.default.readFileSync(t,"utf-8");s=this.project.createSourceFile(t,i,{overwrite:true,scriptKind:tsMorph.ScriptKind.TSX});}else s=this.project.addSourceFileAtPath(t),s.refreshFromFileSystemSync();[...s.getDescendantsOfKind(tsMorph.SyntaxKind.JsxOpeningElement),...s.getDescendantsOfKind(tsMorph.SyntaxKind.JsxSelfClosingElement)].forEach(i=>{let y=i.getAttribute("as")?.asKind(tsMorph.SyntaxKind.JsxAttribute)?.getInitializer();y&&this.extractStyles(y);}),s.getDescendantsOfKind(tsMorph.SyntaxKind.CallExpression).filter(i=>i.getExpression().getText()==="css").forEach(i=>{let a=i.getArguments();a.length>0&&this.extractStyles(a[0]);}),this.stylesToGenerate.forEach(i=>{chunkXJAW5JFY_cjs.h(i).filter(Boolean).forEach(y=>{let z=chunkXJAW5JFY_cjs.i.parseAndGenerate(y,t);z.length>0&&(this.manifest[y]=z.join(" "));});}),e&&this.project.removeSourceFile(s);}isSupportedFile(t){return this.supportedExtensions.some(e=>t.endsWith(e))}getStyleCount(){return this.stylesToGenerate.size}getManifestPath=()=>{let t=process.cwd(),e=[l__default.default.join(t,"src/app/css"),l__default.default.join(t,"app/css"),l__default.default.join(t,"src/css"),l__default.default.join(t,"css")],s=e.find(o=>p__default.default.existsSync(o))||e[0];return p__default.default.existsSync(s)||p__default.default.mkdirSync(s,{recursive:true}),l__default.default.join(s,"zuzmap.ts")};saveManifest(t){let e=l__default.default.dirname(t);p__default.default.existsSync(e)||p__default.default.mkdirSync(e,{recursive:true});let s=chunkXJAW5JFY_cjs.i.getCache(),o={};for(let[i,a]of Object.entries(this.manifest))s.has(a)&&(o[i]=a);this.manifest=o;let h=`/* Zuz Generated Manifest - Do not edit */
4
- export const zuzMap: Record<string, string> = ${JSON.stringify(this.manifest,null,2)};`;p__default.default.writeFileSync(t,h);}},g=new x;commander.program.opts();var f=process.cwd(),F=false,w=l__default.default.join(f,"src","app","css"),$=l__default.default.join(w,"zuz.scss"),G=l__default.default.join(w,"zuzmap.ts"),E=()=>{chunkXJAW5JFY_cjs.i.writeToDisk($),g.saveManifest(G);};commander.program.command("init").description("Initialize Zuz snippets and configuration").action(()=>{let r=l__default.default.join(f,".vscode"),t=l__default.default.join(r,"zuz.code-snippets"),e=l__default.default.join(r,"settings.json"),s=Object.keys(chunkXJAW5JFY_cjs.a).join(","),o=Object.keys(chunkXJAW5JFY_cjs.b).join(","),h={"Zuz Property":{prefix:"zp",body:[`as="\${1|${s}|}:$0"`],description:"Zuz Property (adds colon)"},"Zuz Shortcut":{prefix:"zs",body:[`as="\${1|${o}|}$0"`],description:"Zuz Direct Shortcut"}},i={};if(p__default.default.existsSync(e))try{i=JSON.parse(p__default.default.readFileSync(e,"utf-8"));}catch{i={};}i["editor.suggest.snippetsPreventQuickSuggestions"]=false,i["editor.quickSuggestions"]={...typeof i["editor.quickSuggestions"]=="object"?i["editor.quickSuggestions"]:{},strings:true},p__default.default.existsSync(r)||p__default.default.mkdirSync(r,{recursive:true}),p__default.default.writeFileSync(t,JSON.stringify(h,null,2)),p__default.default.writeFileSync(e,JSON.stringify(i,null,2)),console.log(c__default.default.green("\u2714 Zuz VS Code configuration initialized!")),console.log(c__default.default.cyan(" - .vscode/zuz.code-snippets (Splitted zp/zs)")),console.log(c__default.default.cyan(" - .vscode/settings.json (QuickSuggestions enabled)"));});commander.program.command("watch").alias("w").description("Start ZuzJS watcher").action(()=>{let r=K__default.default.watch(".",{cwd:f,ignored:[/node_modules/,/dist/,/\.next/,/\.git/],persistent:true,usePolling:true,followSymlinks:false,ignoreInitial:false});r.on("add",t=>{g.isSupportedFile(t)&&g.processFile(l__default.default.resolve(f,t)),F&&console.log(c__default.default.gray(`\u25CB File added: ${t}`));}),r.on("change",t=>{if(g.isSupportedFile(t)){console.log(c__default.default.gray(`\u25CB File changed: ${t}`));let e=l__default.default.resolve(f,t);chunkXJAW5JFY_cjs.i.clearFileCache(e),g.processFile(e),E(),console.log(c__default.default.blue("\u26A1 Zuz CSS updated."));}}),r.on("ready",()=>{F=true,E(),console.log(c__default.default.green(`
5
- \u2713 Initial Build Complete.`)),console.log(c__default.default.cyan(`\u25CB Watching: ${l.basename(f)}
6
- `));}),r.on("error",t=>console.error(c__default.default.red(`Watcher Error: ${t}`)));});commander.program.parse(process.argv);
2
+ 'use strict';var chunkBZ4B5RMW_cjs=require('./chunk-BZ4B5RMW.cjs'),commander=require('commander'),Z=require('chokidar'),d=require('path'),c=require('picocolors'),u=require('fs'),tsMorph=require('ts-morph');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Z__default=/*#__PURE__*/_interopDefault(Z);var d__default=/*#__PURE__*/_interopDefault(d);var c__default=/*#__PURE__*/_interopDefault(c);var u__default=/*#__PURE__*/_interopDefault(u);/* ZuzJS UI CLI */
3
+ var j=class{project;stylesToGenerate;manifest={};supportedExtensions=[".tsx",".jsx",".mdx",".md"];constructor(){this.project=new tsMorph.Project({compilerOptions:{allowJs:true,jsx:1}}),this.stylesToGenerate=new Set;}extractStyles(e,t=""){if(e.asKind(tsMorph.SyntaxKind.JsxExpression)){let s=e.getExpression();s&&this.extractStyles(s,t);return}if(e.asKind(tsMorph.SyntaxKind.StringLiteral)||e.asKind(tsMorph.SyntaxKind.NoSubstitutionTemplateLiteral)||e.asKind(tsMorph.SyntaxKind.NumericLiteral))this.stylesToGenerate.add(t+e.getLiteralValue().toString());else if(e.asKind(tsMorph.SyntaxKind.TemplateExpression)){let s=e.getHead().getLiteralText();e.getTemplateSpans().forEach(o=>{this.extractStyles(o.getExpression(),t+s);});}else e.asKind(tsMorph.SyntaxKind.ConditionalExpression)?(this.extractStyles(e.getWhenTrue(),t),this.extractStyles(e.getWhenFalse(),t)):e.asKind(tsMorph.SyntaxKind.ArrayLiteralExpression)?e.getElements().forEach(s=>this.extractStyles(s,t)):e.asKind(tsMorph.SyntaxKind.BinaryExpression)&&(this.extractStyles(e.getLeft(),t),this.extractStyles(e.getRight(),t));}processFile(e){this.stylesToGenerate.clear();let t=e.endsWith(".mdx")||e.endsWith(".md"),s;if(t){let i=u__default.default.readFileSync(e,"utf-8");s=this.project.createSourceFile(e,i,{overwrite:true,scriptKind:tsMorph.ScriptKind.TSX});}else s=this.project.addSourceFileAtPath(e),s.refreshFromFileSystemSync();[...s.getDescendantsOfKind(tsMorph.SyntaxKind.JsxOpeningElement),...s.getDescendantsOfKind(tsMorph.SyntaxKind.JsxSelfClosingElement)].forEach(i=>{let l=i.getAttribute("as")?.asKind(tsMorph.SyntaxKind.JsxAttribute)?.getInitializer();l&&this.extractStyles(l);}),s.getDescendantsOfKind(tsMorph.SyntaxKind.CallExpression).filter(i=>i.getExpression().getText()==="css").forEach(i=>{let a=i.getArguments();a.length>0&&this.extractStyles(a[0]);}),this.stylesToGenerate.forEach(i=>{chunkBZ4B5RMW_cjs.h(i).filter(Boolean).forEach(l=>{let b=l.match(/^([&@][\w-]+)\((.*)\)$/);if(b){let[x,k,A]=b;chunkBZ4B5RMW_cjs.h(A).filter(Boolean).forEach(G=>{let E=`${k}(${G})`,F=chunkBZ4B5RMW_cjs.i.parseAndGenerate(E,e);F.length>0&&(this.manifest[E]=F.join(" "));});let v=chunkBZ4B5RMW_cjs.i.parseAndGenerate(l,e);v.length>0&&(this.manifest[l]=v.join(" "));}else {let x=chunkBZ4B5RMW_cjs.i.parseAndGenerate(l,e);x.length>0&&(this.manifest[l]=x.join(" "));}});}),t&&this.project.removeSourceFile(s);}isSupportedFile(e){return this.supportedExtensions.some(t=>e.endsWith(t))}getStyleCount(){return this.stylesToGenerate.size}getManifestPath=()=>{let e=process.cwd(),t=[d__default.default.join(e,"src/app/css"),d__default.default.join(e,"app/css"),d__default.default.join(e,"src/css"),d__default.default.join(e,"css")],s=t.find(o=>u__default.default.existsSync(o))||t[0];return u__default.default.existsSync(s)||u__default.default.mkdirSync(s,{recursive:true}),d__default.default.join(s,"zuzmap.ts")};saveManifest(e){let t=d__default.default.dirname(e);u__default.default.existsSync(t)||u__default.default.mkdirSync(t,{recursive:true});let s=chunkBZ4B5RMW_cjs.i.getCache(),o={};for(let[i,a]of Object.entries(this.manifest))s.has(a)&&(o[i]=a);this.manifest=o;let y=`/* Zuz Generated Manifest - Do not edit */
4
+ export const zuzMap: Record<string, string> = ${JSON.stringify(this.manifest,null,2)};`;u__default.default.writeFileSync(e,y);}},m=new j;commander.program.opts();var h=process.cwd(),T=false,$=d__default.default.join(h,"src","app","css"),L=d__default.default.join($,"zuz.scss"),W=d__default.default.join($,"zuzmap.ts"),K=()=>{chunkBZ4B5RMW_cjs.i.writeToDisk(L),m.saveManifest(W);};commander.program.command("init").description("Initialize Zuz snippets and configuration").action(()=>{let r=d__default.default.join(h,".vscode"),e=d__default.default.join(r,"zuz.code-snippets"),t=d__default.default.join(r,"settings.json"),s=Object.keys(chunkBZ4B5RMW_cjs.a).join(","),o=Object.keys(chunkBZ4B5RMW_cjs.b).join(","),y={"Zuz Property":{prefix:"zp",body:[`as="\${1|${s}|}:$0"`],description:"Zuz Property (adds colon)"},"Zuz Shortcut":{prefix:"zs",body:[`as="\${1|${o}|}$0"`],description:"Zuz Direct Shortcut"}},i={};if(u__default.default.existsSync(t))try{i=JSON.parse(u__default.default.readFileSync(t,"utf-8"));}catch{i={};}i["editor.suggest.snippetsPreventQuickSuggestions"]=false,i["editor.quickSuggestions"]={...typeof i["editor.quickSuggestions"]=="object"?i["editor.quickSuggestions"]:{},strings:true},u__default.default.existsSync(r)||u__default.default.mkdirSync(r,{recursive:true}),u__default.default.writeFileSync(e,JSON.stringify(y,null,2)),u__default.default.writeFileSync(t,JSON.stringify(i,null,2)),console.log(c__default.default.green("\u2714 Zuz VS Code configuration initialized!")),console.log(c__default.default.cyan(" - .vscode/zuz.code-snippets (Splitted zp/zs)")),console.log(c__default.default.cyan(" - .vscode/settings.json (QuickSuggestions enabled)"));});commander.program.command("watch").alias("w").description("Start ZuzJS watcher").action(()=>{let r=Z__default.default.watch(".",{cwd:h,ignored:[/node_modules/,/dist/,/\.next/,/\.git/],persistent:true,usePolling:true,followSymlinks:false,ignoreInitial:false});r.on("add",e=>{m.isSupportedFile(e)&&m.processFile(d__default.default.resolve(h,e)),T&&console.log(c__default.default.gray(`\u25CB File added: ${e}`));}),r.on("change",e=>{if(m.isSupportedFile(e)){console.log(c__default.default.gray(`\u25CB File changed: ${e}`));let t=d__default.default.resolve(h,e);chunkBZ4B5RMW_cjs.i.clearFileCache(t),m.processFile(t),K(),console.log(c__default.default.blue("\u26A1 Zuz CSS updated."));}}),r.on("ready",()=>{T=true,K(),console.log(c__default.default.green(`
5
+ \u2713 Initial Build Complete.`)),console.log(c__default.default.cyan(`\u25CB Watching: ${d.basename(h)}
6
+ `));}),r.on("error",e=>console.error(c__default.default.red(`Watcher Error: ${e}`)));});commander.program.parse(process.argv);
package/dist/bin.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import {a,b,i,h}from'./chunk-ZO3T3N4K.js';import {program}from'commander';import O from'chokidar';import l,{basename}from'path';import c from'picocolors';import p from'fs';import {Project,SyntaxKind,ScriptKind}from'ts-morph';var x=class{project;stylesToGenerate;manifest={};supportedExtensions=[".tsx",".jsx",".mdx",".md"];constructor(){this.project=new Project({compilerOptions:{allowJs:true,jsx:1}}),this.stylesToGenerate=new Set;}extractStyles(t,e=""){if(t.asKind(SyntaxKind.JsxExpression)){let s=t.getExpression();s&&this.extractStyles(s,e);return}if(t.asKind(SyntaxKind.StringLiteral)||t.asKind(SyntaxKind.NoSubstitutionTemplateLiteral)||t.asKind(SyntaxKind.NumericLiteral))this.stylesToGenerate.add(e+t.getLiteralValue().toString());else if(t.asKind(SyntaxKind.TemplateExpression)){let s=t.getHead().getLiteralText();t.getTemplateSpans().forEach(o=>{this.extractStyles(o.getExpression(),e+s);});}else t.asKind(SyntaxKind.ConditionalExpression)?(this.extractStyles(t.getWhenTrue(),e),this.extractStyles(t.getWhenFalse(),e)):t.asKind(SyntaxKind.ArrayLiteralExpression)?t.getElements().forEach(s=>this.extractStyles(s,e)):t.asKind(SyntaxKind.BinaryExpression)&&(this.extractStyles(t.getLeft(),e),this.extractStyles(t.getRight(),e));}processFile(t){this.stylesToGenerate.clear();let e=t.endsWith(".mdx")||t.endsWith(".md"),s;if(e){let i=p.readFileSync(t,"utf-8");s=this.project.createSourceFile(t,i,{overwrite:true,scriptKind:ScriptKind.TSX});}else s=this.project.addSourceFileAtPath(t),s.refreshFromFileSystemSync();[...s.getDescendantsOfKind(SyntaxKind.JsxOpeningElement),...s.getDescendantsOfKind(SyntaxKind.JsxSelfClosingElement)].forEach(i=>{let y=i.getAttribute("as")?.asKind(SyntaxKind.JsxAttribute)?.getInitializer();y&&this.extractStyles(y);}),s.getDescendantsOfKind(SyntaxKind.CallExpression).filter(i=>i.getExpression().getText()==="css").forEach(i=>{let a=i.getArguments();a.length>0&&this.extractStyles(a[0]);}),this.stylesToGenerate.forEach(i$1=>{h(i$1).filter(Boolean).forEach(y=>{let z=i.parseAndGenerate(y,t);z.length>0&&(this.manifest[y]=z.join(" "));});}),e&&this.project.removeSourceFile(s);}isSupportedFile(t){return this.supportedExtensions.some(e=>t.endsWith(e))}getStyleCount(){return this.stylesToGenerate.size}getManifestPath=()=>{let t=process.cwd(),e=[l.join(t,"src/app/css"),l.join(t,"app/css"),l.join(t,"src/css"),l.join(t,"css")],s=e.find(o=>p.existsSync(o))||e[0];return p.existsSync(s)||p.mkdirSync(s,{recursive:true}),l.join(s,"zuzmap.ts")};saveManifest(t){let e=l.dirname(t);p.existsSync(e)||p.mkdirSync(e,{recursive:true});let s=i.getCache(),o={};for(let[i,a]of Object.entries(this.manifest))s.has(a)&&(o[i]=a);this.manifest=o;let h=`/* Zuz Generated Manifest - Do not edit */
3
- export const zuzMap: Record<string, string> = ${JSON.stringify(this.manifest,null,2)};`;p.writeFileSync(t,h);}},g=new x;program.opts();var f=process.cwd(),F=false,w=l.join(f,"src","app","css"),G=l.join(w,"zuz.scss"),J=l.join(w,"zuzmap.ts"),E=()=>{i.writeToDisk(G),g.saveManifest(J);};program.command("init").description("Initialize Zuz snippets and configuration").action(()=>{let r=l.join(f,".vscode"),t=l.join(r,"zuz.code-snippets"),e=l.join(r,"settings.json"),s=Object.keys(a).join(","),o=Object.keys(b).join(","),h={"Zuz Property":{prefix:"zp",body:[`as="\${1|${s}|}:$0"`],description:"Zuz Property (adds colon)"},"Zuz Shortcut":{prefix:"zs",body:[`as="\${1|${o}|}$0"`],description:"Zuz Direct Shortcut"}},i={};if(p.existsSync(e))try{i=JSON.parse(p.readFileSync(e,"utf-8"));}catch{i={};}i["editor.suggest.snippetsPreventQuickSuggestions"]=false,i["editor.quickSuggestions"]={...typeof i["editor.quickSuggestions"]=="object"?i["editor.quickSuggestions"]:{},strings:true},p.existsSync(r)||p.mkdirSync(r,{recursive:true}),p.writeFileSync(t,JSON.stringify(h,null,2)),p.writeFileSync(e,JSON.stringify(i,null,2)),console.log(c.green("\u2714 Zuz VS Code configuration initialized!")),console.log(c.cyan(" - .vscode/zuz.code-snippets (Splitted zp/zs)")),console.log(c.cyan(" - .vscode/settings.json (QuickSuggestions enabled)"));});program.command("watch").alias("w").description("Start ZuzJS watcher").action(()=>{let r=O.watch(".",{cwd:f,ignored:[/node_modules/,/dist/,/\.next/,/\.git/],persistent:true,usePolling:true,followSymlinks:false,ignoreInitial:false});r.on("add",t=>{g.isSupportedFile(t)&&g.processFile(l.resolve(f,t)),F&&console.log(c.gray(`\u25CB File added: ${t}`));}),r.on("change",t=>{if(g.isSupportedFile(t)){console.log(c.gray(`\u25CB File changed: ${t}`));let e=l.resolve(f,t);i.clearFileCache(e),g.processFile(e),E(),console.log(c.blue("\u26A1 Zuz CSS updated."));}}),r.on("ready",()=>{F=true,E(),console.log(c.green(`
4
- \u2713 Initial Build Complete.`)),console.log(c.cyan(`\u25CB Watching: ${basename(f)}
5
- `));}),r.on("error",t=>console.error(c.red(`Watcher Error: ${t}`)));});program.parse(process.argv);
2
+ import {a,b,i,h as h$1}from'./chunk-4GN6AE4D.js';import {program}from'commander';import D from'chokidar';import d,{basename}from'path';import c from'picocolors';import u from'fs';import {Project,SyntaxKind,ScriptKind}from'ts-morph';var j=class{project;stylesToGenerate;manifest={};supportedExtensions=[".tsx",".jsx",".mdx",".md"];constructor(){this.project=new Project({compilerOptions:{allowJs:true,jsx:1}}),this.stylesToGenerate=new Set;}extractStyles(e,t=""){if(e.asKind(SyntaxKind.JsxExpression)){let s=e.getExpression();s&&this.extractStyles(s,t);return}if(e.asKind(SyntaxKind.StringLiteral)||e.asKind(SyntaxKind.NoSubstitutionTemplateLiteral)||e.asKind(SyntaxKind.NumericLiteral))this.stylesToGenerate.add(t+e.getLiteralValue().toString());else if(e.asKind(SyntaxKind.TemplateExpression)){let s=e.getHead().getLiteralText();e.getTemplateSpans().forEach(o=>{this.extractStyles(o.getExpression(),t+s);});}else e.asKind(SyntaxKind.ConditionalExpression)?(this.extractStyles(e.getWhenTrue(),t),this.extractStyles(e.getWhenFalse(),t)):e.asKind(SyntaxKind.ArrayLiteralExpression)?e.getElements().forEach(s=>this.extractStyles(s,t)):e.asKind(SyntaxKind.BinaryExpression)&&(this.extractStyles(e.getLeft(),t),this.extractStyles(e.getRight(),t));}processFile(e){this.stylesToGenerate.clear();let t=e.endsWith(".mdx")||e.endsWith(".md"),s;if(t){let i=u.readFileSync(e,"utf-8");s=this.project.createSourceFile(e,i,{overwrite:true,scriptKind:ScriptKind.TSX});}else s=this.project.addSourceFileAtPath(e),s.refreshFromFileSystemSync();[...s.getDescendantsOfKind(SyntaxKind.JsxOpeningElement),...s.getDescendantsOfKind(SyntaxKind.JsxSelfClosingElement)].forEach(i=>{let l=i.getAttribute("as")?.asKind(SyntaxKind.JsxAttribute)?.getInitializer();l&&this.extractStyles(l);}),s.getDescendantsOfKind(SyntaxKind.CallExpression).filter(i=>i.getExpression().getText()==="css").forEach(i=>{let a=i.getArguments();a.length>0&&this.extractStyles(a[0]);}),this.stylesToGenerate.forEach(i$1=>{h$1(i$1).filter(Boolean).forEach(l=>{let b=l.match(/^([&@][\w-]+)\((.*)\)$/);if(b){let[x,k,A]=b;h$1(A).filter(Boolean).forEach(G=>{let E=`${k}(${G})`,F=i.parseAndGenerate(E,e);F.length>0&&(this.manifest[E]=F.join(" "));});let v=i.parseAndGenerate(l,e);v.length>0&&(this.manifest[l]=v.join(" "));}else {let x=i.parseAndGenerate(l,e);x.length>0&&(this.manifest[l]=x.join(" "));}});}),t&&this.project.removeSourceFile(s);}isSupportedFile(e){return this.supportedExtensions.some(t=>e.endsWith(t))}getStyleCount(){return this.stylesToGenerate.size}getManifestPath=()=>{let e=process.cwd(),t=[d.join(e,"src/app/css"),d.join(e,"app/css"),d.join(e,"src/css"),d.join(e,"css")],s=t.find(o=>u.existsSync(o))||t[0];return u.existsSync(s)||u.mkdirSync(s,{recursive:true}),d.join(s,"zuzmap.ts")};saveManifest(e){let t=d.dirname(e);u.existsSync(t)||u.mkdirSync(t,{recursive:true});let s=i.getCache(),o={};for(let[i,a]of Object.entries(this.manifest))s.has(a)&&(o[i]=a);this.manifest=o;let y=`/* Zuz Generated Manifest - Do not edit */
3
+ export const zuzMap: Record<string, string> = ${JSON.stringify(this.manifest,null,2)};`;u.writeFileSync(e,y);}},m=new j;program.opts();var h=process.cwd(),T=false,$=d.join(h,"src","app","css"),W=d.join($,"zuz.scss"),N=d.join($,"zuzmap.ts"),K=()=>{i.writeToDisk(W),m.saveManifest(N);};program.command("init").description("Initialize Zuz snippets and configuration").action(()=>{let r=d.join(h,".vscode"),e=d.join(r,"zuz.code-snippets"),t=d.join(r,"settings.json"),s=Object.keys(a).join(","),o=Object.keys(b).join(","),y={"Zuz Property":{prefix:"zp",body:[`as="\${1|${s}|}:$0"`],description:"Zuz Property (adds colon)"},"Zuz Shortcut":{prefix:"zs",body:[`as="\${1|${o}|}$0"`],description:"Zuz Direct Shortcut"}},i={};if(u.existsSync(t))try{i=JSON.parse(u.readFileSync(t,"utf-8"));}catch{i={};}i["editor.suggest.snippetsPreventQuickSuggestions"]=false,i["editor.quickSuggestions"]={...typeof i["editor.quickSuggestions"]=="object"?i["editor.quickSuggestions"]:{},strings:true},u.existsSync(r)||u.mkdirSync(r,{recursive:true}),u.writeFileSync(e,JSON.stringify(y,null,2)),u.writeFileSync(t,JSON.stringify(i,null,2)),console.log(c.green("\u2714 Zuz VS Code configuration initialized!")),console.log(c.cyan(" - .vscode/zuz.code-snippets (Splitted zp/zs)")),console.log(c.cyan(" - .vscode/settings.json (QuickSuggestions enabled)"));});program.command("watch").alias("w").description("Start ZuzJS watcher").action(()=>{let r=D.watch(".",{cwd:h,ignored:[/node_modules/,/dist/,/\.next/,/\.git/],persistent:true,usePolling:true,followSymlinks:false,ignoreInitial:false});r.on("add",e=>{m.isSupportedFile(e)&&m.processFile(d.resolve(h,e)),T&&console.log(c.gray(`\u25CB File added: ${e}`));}),r.on("change",e=>{if(m.isSupportedFile(e)){console.log(c.gray(`\u25CB File changed: ${e}`));let t=d.resolve(h,e);i.clearFileCache(t),m.processFile(t),K(),console.log(c.blue("\u26A1 Zuz CSS updated."));}}),r.on("ready",()=>{T=true,K(),console.log(c.green(`
4
+ \u2713 Initial Build Complete.`)),console.log(c.cyan(`\u25CB Watching: ${basename(h)}
5
+ `));}),r.on("error",e=>console.error(c.red(`Watcher Error: ${e}`)));});program.parse(process.argv);