@salty-css/core 0.0.1-alpha.242 → 0.0.1-alpha.244

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/bin/main.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const te=require("commander"),A=require("fs"),s=require("fs/promises"),n=require("path"),ne=require("ejs"),e=require("../index-O0uhHL8c.cjs"),ie=require("../pascal-case-iWoaJWwT.cjs"),se=require("child_process"),oe=require("ora"),ae=require("../should-restart-BPXyHnNn.cjs");var G=typeof document<"u"?document.currentScript:null;const X=y=>new Promise((C,P)=>{se.exec(y,x=>{if(x)return P(x);C()})}),I=async(...y)=>{const C=y.map(b=>b.replace("-D","").split("@").slice(0,-1).join("@").trim()).join(", "),P=oe(`Installing packages: ${C}`).start(),x=y.join(" ");await X(`npm install ${x}`),P.succeed(`Installed packages: ${C}`)},re=()=>A.existsSync(n.join(process.cwd(),"node_modules",".bin","prettier"));async function S(y){try{if(!re())return;await X(`./node_modules/.bin/prettier --write "${y}"`),e.logger.info(`Formatted ${y} with Prettier`)}catch(C){e.logger.error(`Error formatting ${y} with Prettier:`,C)}}async function ce(){const y=new te.Command;y.name("salty-css").description("Salty-CSS CLI tool to help with annoying configuration tasks.");const C={"salty.config.ts":Promise.resolve().then(()=>require("../salty.config-Dk6ZcCxI.cjs")),"saltygen/index.css":Promise.resolve().then(()=>require("../index-84Wroia-.cjs")),"react/react-styled-file.ts":Promise.resolve().then(()=>require("../react-styled-file-Dkubsz-U.cjs")),"react/react-vanilla-file.ts":Promise.resolve().then(()=>require("../react-vanilla-file-CG_WJLam.cjs"))},P=async(i,a)=>{const{default:f}=await C[i],d=ne.render(f,a);return{fileName:i,content:d}},x=async()=>{const i=n.join(process.cwd(),".saltyrc.json");return await s.readFile(i,"utf-8").then(JSON.parse).catch(()=>({}))},b=n.join(process.cwd(),"package.json"),N=async(i=b)=>{const a=await s.readFile(i,"utf-8").then(JSON.parse).catch(()=>{});if(!a)throw"Could not read package.json file!";return a},Y=async(i,a=b)=>{typeof i=="object"&&(i=JSON.stringify(i,null,2)),await s.writeFile(a,i)},B=async()=>{const i=new URL("../package.json",typeof document>"u"?require("url").pathToFileURL(__filename).href:G&&G.tagName.toUpperCase()==="SCRIPT"&&G.src||new URL("bin/main.cjs",document.baseURI).href);return N(i)},V=await(async()=>(await x()).defaultProject)(),$=await B(),D={core:`@salty-css/core@${$.version}`,react:`@salty-css/react@${$.version}`,eslintConfigCore:`@salty-css/eslint-config-core@${$.version}`,vite:`@salty-css/vite@${$.version}`,next:`@salty-css/next@${$.version}`},H=i=>{const a=i==="."?"":i,f=process.cwd();return n.join(f,a)};y.command("init [directory]").description("Initialize a new Salty-CSS project.").option("-d, --dir <dir>","Project directory to initialize the project in.").option("--css-file <css-file>","Existing CSS file where to import the generated CSS. Path must be relative to the given project directory.").option("--skip-install","Skip installing dependencies.").action(async function(i="."){if(!await N().catch(()=>{}))return e.logError("Salty CSS project must be initialized in a directory with a package.json file.");e.logger.info("Initializing a new Salty-CSS project!");const{dir:f=i,cssFile:d,skipInstall:p}=this.opts();if(!f)return e.logError("Project directory must be provided. Add it as the first argument after init command or use the --dir option.");p||await I(D.core,D.react);const c=process.cwd(),r=H(f),q=await Promise.all([P("salty.config.ts"),P("saltygen/index.css")]);await s.mkdir(r,{recursive:!0});const m=q.map(async({fileName:t,content:u})=>{const l=n.join(r,t);if(await s.readFile(l,"utf-8").catch(()=>{})!==void 0){e.logger.debug("File already exists: "+l);return}const k=t.split("/").slice(0,-1).join("/");k&&await s.mkdir(n.join(r,k),{recursive:!0}),e.logger.info("Creating file: "+l),await s.writeFile(l,u),await S(l)});await Promise.all(m);const w=n.relative(c,r)||".",h=n.join(c,".saltyrc.json"),g=await s.readFile(h,"utf-8").catch(()=>{});if(g===void 0){e.logger.info("Creating file: "+h);const u=JSON.stringify({$schema:"./node_modules/@salty-css/core/.saltyrc.schema.json",info:"This file is used to define projects and their configurations for Salty CSS cli. Do not delete, modify or add this file to .gitignore.",defaultProject:w,projects:[{dir:w,framework:"react"}]},null,2);await s.writeFile(h,u),await S(h)}else{const t=JSON.parse(g),u=(t==null?void 0:t.projects)||[];if(u.findIndex(o=>o.dir===w)===-1){u.push({dir:w,framework:"react"}),t.projects=[...u];const o=JSON.stringify(t,null,2);o!==g&&(e.logger.info("Edit file: "+h),await s.writeFile(h,o),await S(h))}}const j=n.join(c,".gitignore"),T=await s.readFile(j,"utf-8").catch(()=>{});T!==void 0&&(T.includes("saltygen")||(e.logger.info("Edit file: "+j),await s.writeFile(j,T+`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const te=require("commander"),A=require("fs"),s=require("fs/promises"),n=require("path"),ne=require("ejs"),e=require("../index-vWQ_NojW.cjs"),ie=require("../pascal-case-iWoaJWwT.cjs"),se=require("child_process"),oe=require("ora"),ae=require("../should-restart-BepJi85G.cjs");var G=typeof document<"u"?document.currentScript:null;const X=y=>new Promise((C,P)=>{se.exec(y,x=>{if(x)return P(x);C()})}),I=async(...y)=>{const C=y.map(b=>b.replace("-D","").split("@").slice(0,-1).join("@").trim()).join(", "),P=oe(`Installing packages: ${C}`).start(),x=y.join(" ");await X(`npm install ${x}`),P.succeed(`Installed packages: ${C}`)},re=()=>A.existsSync(n.join(process.cwd(),"node_modules",".bin","prettier"));async function S(y){try{if(!re())return;await X(`./node_modules/.bin/prettier --write "${y}"`),e.logger.info(`Formatted ${y} with Prettier`)}catch(C){e.logger.error(`Error formatting ${y} with Prettier:`,C)}}async function ce(){const y=new te.Command;y.name("salty-css").description("Salty-CSS CLI tool to help with annoying configuration tasks.");const C={"salty.config.ts":Promise.resolve().then(()=>require("../salty.config-Dk6ZcCxI.cjs")),"saltygen/index.css":Promise.resolve().then(()=>require("../index-84Wroia-.cjs")),"react/react-styled-file.ts":Promise.resolve().then(()=>require("../react-styled-file-Dkubsz-U.cjs")),"react/react-vanilla-file.ts":Promise.resolve().then(()=>require("../react-vanilla-file-CG_WJLam.cjs"))},P=async(i,a)=>{const{default:f}=await C[i],d=ne.render(f,a);return{fileName:i,content:d}},x=async()=>{const i=n.join(process.cwd(),".saltyrc.json");return await s.readFile(i,"utf-8").then(JSON.parse).catch(()=>({}))},b=n.join(process.cwd(),"package.json"),N=async(i=b)=>{const a=await s.readFile(i,"utf-8").then(JSON.parse).catch(()=>{});if(!a)throw"Could not read package.json file!";return a},Y=async(i,a=b)=>{typeof i=="object"&&(i=JSON.stringify(i,null,2)),await s.writeFile(a,i)},B=async()=>{const i=new URL("../package.json",typeof document>"u"?require("url").pathToFileURL(__filename).href:G&&G.tagName.toUpperCase()==="SCRIPT"&&G.src||new URL("bin/main.cjs",document.baseURI).href);return N(i)},V=await(async()=>(await x()).defaultProject)(),$=await B(),D={core:`@salty-css/core@${$.version}`,react:`@salty-css/react@${$.version}`,eslintConfigCore:`@salty-css/eslint-config-core@${$.version}`,vite:`@salty-css/vite@${$.version}`,next:`@salty-css/next@${$.version}`},H=i=>{const a=i==="."?"":i,f=process.cwd();return n.join(f,a)};y.command("init [directory]").description("Initialize a new Salty-CSS project.").option("-d, --dir <dir>","Project directory to initialize the project in.").option("--css-file <css-file>","Existing CSS file where to import the generated CSS. Path must be relative to the given project directory.").option("--skip-install","Skip installing dependencies.").action(async function(i="."){if(!await N().catch(()=>{}))return e.logError("Salty CSS project must be initialized in a directory with a package.json file.");e.logger.info("Initializing a new Salty-CSS project!");const{dir:f=i,cssFile:d,skipInstall:p}=this.opts();if(!f)return e.logError("Project directory must be provided. Add it as the first argument after init command or use the --dir option.");p||await I(D.core,D.react);const c=process.cwd(),r=H(f),q=await Promise.all([P("salty.config.ts"),P("saltygen/index.css")]);await s.mkdir(r,{recursive:!0});const m=q.map(async({fileName:t,content:u})=>{const l=n.join(r,t);if(await s.readFile(l,"utf-8").catch(()=>{})!==void 0){e.logger.debug("File already exists: "+l);return}const k=t.split("/").slice(0,-1).join("/");k&&await s.mkdir(n.join(r,k),{recursive:!0}),e.logger.info("Creating file: "+l),await s.writeFile(l,u),await S(l)});await Promise.all(m);const w=n.relative(c,r)||".",h=n.join(c,".saltyrc.json"),g=await s.readFile(h,"utf-8").catch(()=>{});if(g===void 0){e.logger.info("Creating file: "+h);const u=JSON.stringify({$schema:"./node_modules/@salty-css/core/.saltyrc.schema.json",info:"This file is used to define projects and their configurations for Salty CSS cli. Do not delete, modify or add this file to .gitignore.",defaultProject:w,projects:[{dir:w,framework:"react"}]},null,2);await s.writeFile(h,u),await S(h)}else{const t=JSON.parse(g),u=(t==null?void 0:t.projects)||[];if(u.findIndex(o=>o.dir===w)===-1){u.push({dir:w,framework:"react"}),t.projects=[...u];const o=JSON.stringify(t,null,2);o!==g&&(e.logger.info("Edit file: "+h),await s.writeFile(h,o),await S(h))}}const j=n.join(c,".gitignore"),T=await s.readFile(j,"utf-8").catch(()=>{});T!==void 0&&(T.includes("saltygen")||(e.logger.info("Edit file: "+j),await s.writeFile(j,T+`
2
2
 
3
3
  # Salty-CSS
4
4
  saltygen
package/bin/main.js CHANGED
@@ -3,11 +3,11 @@ import { existsSync as Q, watch as re } from "fs";
3
3
  import { mkdir as q, readFile as S, writeFile as C } from "fs/promises";
4
4
  import { join as a, relative as z, parse as ce, format as te } from "path";
5
5
  import { render as le } from "ejs";
6
- import { l as t, a as h, g as K, i as de, b as fe } from "../index-D8CuiJVg.js";
6
+ import { l as t, a as h, g as K, i as de, b as fe } from "../index-B8uXjJ2F.js";
7
7
  import { p as pe } from "../pascal-case-BQpR5PdN.js";
8
8
  import { exec as ue } from "child_process";
9
9
  import ge from "ora";
10
- import { c as ye } from "../should-restart-CeCqMexy.js";
10
+ import { c as ye } from "../should-restart-BJ_DZyAz.js";
11
11
  const ne = (g) => new Promise((P, x) => {
12
12
  ue(g, ($) => {
13
13
  if ($) return x($);
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("esbuild");require("child_process");require("../dash-case-BJEkFEGQ.cjs");require("path");require("fs");require("fs/promises");require("../parse-styles-3N79AOBO.cjs");const e=require("../index-O0uhHL8c.cjs");require("../css/merge.cjs");require("../define-templates-Cunsb_Tr.cjs");exports.compileSaltyFile=e.compileSaltyFile;exports.generateConfigStyles=e.generateConfigStyles;exports.generateCss=e.generateCss;exports.generateFile=e.generateFile;exports.isSaltyFile=e.isSaltyFile;exports.minimizeFile=e.minimizeFile;exports.saltyFileExtensions=e.saltyFileExtensions;exports.saltyFileRegExp=e.saltyFileRegExp;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("esbuild");require("child_process");require("../dash-case-BJEkFEGQ.cjs");require("path");require("fs");require("fs/promises");require("../parse-styles-CXclnoUS.cjs");const e=require("../index-vWQ_NojW.cjs");require("../css/merge.cjs");require("../define-templates-Cunsb_Tr.cjs");exports.compileSaltyFile=e.compileSaltyFile;exports.generateConfigStyles=e.generateConfigStyles;exports.generateCss=e.generateCss;exports.generateFile=e.generateFile;exports.isSaltyFile=e.isSaltyFile;exports.minimizeFile=e.minimizeFile;exports.saltyFileExtensions=e.saltyFileExtensions;exports.saltyFileRegExp=e.saltyFileRegExp;
package/compiler/index.js CHANGED
@@ -4,8 +4,8 @@ import "../dash-case-DBThphLm.js";
4
4
  import "path";
5
5
  import "fs";
6
6
  import "fs/promises";
7
- import "../parse-styles-Bo7fQ_SV.js";
8
- import { e as g, d as F, g as y, b as x, i as S, m as c, s as f, c as C } from "../index-D8CuiJVg.js";
7
+ import "../parse-styles-DZ-LjC9e.js";
8
+ import { e as g, d as F, g as y, b as x, i as S, m as c, s as f, c as C } from "../index-B8uXjJ2F.js";
9
9
  import "../css/merge.js";
10
10
  import "../define-templates-4A2yHcMF.js";
11
11
  export {
package/css/keyframes.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("../parse-styles-3N79AOBO.cjs"),w=require("../dash-case-BJEkFEGQ.cjs"),C=async({animationName:l,params:u,appendInitialStyles:y,...t})=>{const n=l||w.toHash(t),r=async(s={})=>{const{duration:e="500ms",easing:o="ease-in-out",delay:i="0s",iterationCount:S="1",direction:p="normal",fillMode:g="forwards",playState:b="running"}={...u,...s},a=`${n} ${e} ${o} ${i} ${S} ${p} ${g} ${b}`;if(!y)return a;const c=t.from||t["0%"];if(!c)return a;const j=await m.parseAndJoinStyles(c,"");return`${a};${j}`},$=Object.entries(t).map(async([s,e])=>{if(!e)return"";const o=await m.parseAndJoinStyles(e,"");return`${typeof s=="number"?`${s}%`:s}{${o}}`}),d=(await Promise.all($)).join(""),f=`@keyframes ${n} {${d}}`;return Object.assign(r,{toString:r,isKeyframes:!0,animationName:n,css:f,keyframes:t}),r};exports.keyframes=C;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("../parse-styles-CXclnoUS.cjs"),w=require("../dash-case-BJEkFEGQ.cjs"),C=async({animationName:l,params:u,appendInitialStyles:y,...t})=>{const n=l||w.toHash(t),r=async(s={})=>{const{duration:e="500ms",easing:o="ease-in-out",delay:i="0s",iterationCount:S="1",direction:p="normal",fillMode:g="forwards",playState:b="running"}={...u,...s},a=`${n} ${e} ${o} ${i} ${S} ${p} ${g} ${b}`;if(!y)return a;const c=t.from||t["0%"];if(!c)return a;const j=await m.parseAndJoinStyles(c,"");return`${a};${j}`},$=Object.entries(t).map(async([s,e])=>{if(!e)return"";const o=await m.parseAndJoinStyles(e,"");return`${typeof s=="number"?`${s}%`:s}{${o}}`}),d=(await Promise.all($)).join(""),f=`@keyframes ${n} {${d}}`;return Object.assign(r,{toString:r,isKeyframes:!0,animationName:n,css:f,keyframes:t}),r};exports.keyframes=C;
package/css/keyframes.js CHANGED
@@ -1,4 +1,4 @@
1
- import { p as m } from "../parse-styles-Bo7fQ_SV.js";
1
+ import { p as m } from "../parse-styles-DZ-LjC9e.js";
2
2
  import { t as j } from "../dash-case-DBThphLm.js";
3
3
  const v = async ({ animationName: $, params: f, appendInitialStyles: l, ...t }) => {
4
4
  const r = $ || j(t), o = async (n = {}) => {
@@ -1 +1 @@
1
- "use strict";var g=Object.defineProperty;var C=(a,t,s)=>t in a?g(a,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[t]=s;var m=(a,t,s)=>C(a,typeof t!="symbol"?t+"":t,s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("../parse-styles-3N79AOBO.cjs"),c=require("../dash-case-BJEkFEGQ.cjs");class y{constructor(t){m(this,"buildContext",{});this.params=t}get priority(){return 0}get isRoot(){return this.priority===0}get hash(){const{base:t,variants:s,compoundVariants:e}=this.params;return c.toHash({base:t,variants:s,compoundVariants:e})}get cssClassName(){return this.hash}get classNames(){const t=new Set([this.cssClassName]),{className:s}=this.params;return typeof s=="string"&&t.add(s),typeof s=="object"&&s.forEach(e=>t.add(e)),this.getTemplateClasses().forEach(e=>t.add(e)),this.buildContext.classNames&&this.buildContext.classNames.forEach(e=>t.add(e)),[...t].join(" ")}get cssFileName(){const{callerName:t}=this.buildContext;return t?`cl_${c.dashCase(t)}-${this.hash}.css`:`${this.hash}.css`}get css(){const{base:t={},variants:s={},compoundVariants:e=[]}=this.params,{config:i}=this.buildContext,n={...t,variants:s,compoundVariants:e};return N.parseAndJoinStyles(n,`.${this.cssClassName}`,i,this.isRoot)}getTemplateClasses(t=this.buildContext.config){if(!(t!=null&&t.templates)||!this.params.base||this.priority>0)return[];const s=Object.keys(t.templates);return Object.entries(this.params.base).reduce((e,[i,n])=>(s.includes(i)&&e.push("t_"+c.toHash(c.dashCase(`${i}-${n}`),4)),e),[])}_withBuildContext(t){return this.buildContext=t,this}}class S extends y{constructor(t){super(t),this._params=t}}class x extends y{constructor(t,s){super(s),this.tagName=t,this._params=s}get priority(){var t;return this.params.priority?this.params.priority:typeof this.tagName=="function"||typeof this.tagName=="object"?(((t=this.tagName.generator)==null?void 0:t.priority)||0)+1:0}get clientProps(){const{element:t,variants:s={},compoundVariants:e=[],defaultVariants:i={},defaultProps:n={},passProps:d}=this.params,{callerName:f,isProduction:b}=this.buildContext,h=new Set([]),l=r=>{const o=i[r];o!==void 0?h.add(`${r}=${String(o)}`):h.add(r)};Object.keys(s).forEach(l),e.map(r=>Object.keys(r).forEach(l));const p=new Set([]);if(this.params.base){const r=JSON.stringify(this.params.base).match(/\{props\.([\w\d]+)\}/gi);r&&r.forEach(o=>{const u=o.replace(/\{props\.([\w\d]+)\}/gi,"$1");u&&p.add(u)})}return{element:t,variantKeys:[...h],propValueKeys:[...p],passProps:d,defaultProps:n,attr:{"data-component-name":b?void 0:f}}}}exports.ClassNameGenerator=S;exports.StyledGenerator=x;
1
+ "use strict";var g=Object.defineProperty;var C=(a,t,s)=>t in a?g(a,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[t]=s;var m=(a,t,s)=>C(a,typeof t!="symbol"?t+"":t,s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("../parse-styles-CXclnoUS.cjs"),c=require("../dash-case-BJEkFEGQ.cjs");class y{constructor(t){m(this,"buildContext",{});this.params=t}get priority(){return 0}get isRoot(){return this.priority===0}get hash(){const{base:t,variants:s,compoundVariants:e}=this.params;return c.toHash({base:t,variants:s,compoundVariants:e})}get cssClassName(){return this.hash}get classNames(){const t=new Set([this.cssClassName]),{className:s}=this.params;return typeof s=="string"&&t.add(s),typeof s=="object"&&s.forEach(e=>t.add(e)),this.getTemplateClasses().forEach(e=>t.add(e)),this.buildContext.classNames&&this.buildContext.classNames.forEach(e=>t.add(e)),[...t].join(" ")}get cssFileName(){const{callerName:t}=this.buildContext;return t?`cl_${c.dashCase(t)}-${this.hash}.css`:`${this.hash}.css`}get css(){const{base:t={},variants:s={},compoundVariants:e=[]}=this.params,{config:i}=this.buildContext,n={...t,variants:s,compoundVariants:e};return N.parseAndJoinStyles(n,`.${this.cssClassName}`,i,this.isRoot)}getTemplateClasses(t=this.buildContext.config){if(!(t!=null&&t.templates)||!this.params.base||this.priority>0)return[];const s=Object.keys(t.templates);return Object.entries(this.params.base).reduce((e,[i,n])=>(s.includes(i)&&e.push("t_"+c.toHash(c.dashCase(`${i}-${n}`),4)),e),[])}_withBuildContext(t){return this.buildContext=t,this}}class S extends y{constructor(t){super(t),this._params=t}}class x extends y{constructor(t,s){super(s),this.tagName=t,this._params=s}get priority(){var t;return this.params.priority?this.params.priority:typeof this.tagName=="function"||typeof this.tagName=="object"?(((t=this.tagName.generator)==null?void 0:t.priority)||0)+1:0}get clientProps(){const{element:t,variants:s={},compoundVariants:e=[],defaultVariants:i={},defaultProps:n={},passProps:d}=this.params,{callerName:f,isProduction:b}=this.buildContext,h=new Set([]),l=r=>{const o=i[r];o!==void 0?h.add(`${r}=${String(o)}`):h.add(r)};Object.keys(s).forEach(l),e.map(r=>Object.keys(r).forEach(l));const p=new Set([]);if(this.params.base){const r=JSON.stringify(this.params.base).match(/\{props\.([\w\d]+)\}/gi);r&&r.forEach(o=>{const u=o.replace(/\{props\.([\w\d]+)\}/gi,"$1");u&&p.add(u)})}return{element:t,variantKeys:[...h],propValueKeys:[...p],passProps:d,defaultProps:n,attr:{"data-component-name":b?void 0:f}}}}exports.ClassNameGenerator=S;exports.StyledGenerator=x;
@@ -1,7 +1,7 @@
1
1
  var N = Object.defineProperty;
2
2
  var C = (a, t, s) => t in a ? N(a, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : a[t] = s;
3
3
  var u = (a, t, s) => C(a, typeof t != "symbol" ? t + "" : t, s);
4
- import { p as x } from "../parse-styles-Bo7fQ_SV.js";
4
+ import { p as x } from "../parse-styles-DZ-LjC9e.js";
5
5
  import { t as m, d as f } from "../dash-case-DBThphLm.js";
6
6
  class y {
7
7
  constructor(t) {
@@ -4,7 +4,7 @@ import { d as K, t as z } from "./dash-case-DBThphLm.js";
4
4
  import { join as r, parse as tt } from "path";
5
5
  import { existsSync as ft, writeFileSync as j, mkdirSync as H, readFileSync as _, statSync as Et, readdirSync as vt } from "fs";
6
6
  import { readFile as St } from "fs/promises";
7
- import { p as lt, a as Ot } from "./parse-styles-Bo7fQ_SV.js";
7
+ import { p as lt, a as Ot } from "./parse-styles-DZ-LjC9e.js";
8
8
  import { createLogger as Mt, format as ct, transports as Rt } from "winston";
9
9
  import { mergeObjects as I, mergeFactories as Jt } from "./css/merge.js";
10
10
  import { d as zt } from "./define-templates-4A2yHcMF.js";
@@ -429,7 +429,7 @@ ${nt}
429
429
  if (p.isKeyframes && p.css) {
430
430
  const C = `css/${`a_${p.animationName}.css`}`, x = r(n, C);
431
431
  j(x, await p.css);
432
- return;
432
+ continue;
433
433
  }
434
434
  if (p.isClassName) {
435
435
  const u = p.generator._withBuildContext({
@@ -441,8 +441,9 @@ ${nt}
441
441
  i[u.priority] || (i[u.priority] = []), i[u.priority].push(u.cssFileName);
442
442
  const x = `css/${u.cssFileName}`, D = r(n, x);
443
443
  j(D, C);
444
+ continue;
444
445
  }
445
- if (!p.generator) return;
446
+ if (!p.generator) continue;
446
447
  const c = p.generator._withBuildContext({
447
448
  callerName: w,
448
449
  isProduction: s,
@@ -1,5 +1,5 @@
1
- "use strict";const _e=require("esbuild"),Te=require("child_process"),D=require("./dash-case-BJEkFEGQ.cjs"),r=require("path"),l=require("fs"),he=require("fs/promises"),Z=require("./parse-styles-3N79AOBO.cjs"),Q=require("winston"),z=require("./css/merge.cjs"),Oe=require("./define-templates-Cunsb_Tr.cjs"),ae=require("typescript");var re=typeof document<"u"?document.currentScript:null;function Ee(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:()=>e[s]})}}return t.default=e,Object.freeze(t)}const we=Ee(_e),Se=async(e,t=[])=>{if(!e)return"";const s=[],n={};for(const[o,a]of Object.entries(e))if(typeof a!="function")if(a&&typeof a=="object"){const i=o.trim(),d=await Se(a,[...t,i]);s.push(d)}else n[o]=a;if(Object.keys(n).length){const o=t.map(D.dashCase).join("-"),a="t_"+D.toHash(o,4),i=await Z.parseAndJoinStyles(n,`.${o}, .${a}`);s.push(i)}return s.join(`
2
- `)},Ve=e=>e?Object.entries(e).reduce((t,[s,n])=>(typeof n=="function"?t[s]="any":typeof n=="object"&&(t[s]=je(n).map(o=>`"${o}"`).join(" | ")),t),{}):{},je=(e,t="",s=new Set)=>e?(Object.entries(e).forEach(([n,o])=>{const a=t?`${t}.${n}`:n;return typeof o=="object"?je(o,a,s):s.add(t)}),[...s]):[],be=e=>{if(!e||e==="/")throw new Error("Could not find package.json file");const t=r.join(e,"package.json");return l.existsSync(t)?t:be(r.join(e,".."))},ve=async e=>{const t=be(e);return await he.readFile(t,"utf-8").then(JSON.parse).catch(()=>{})},Re=async e=>{const t=await ve(e);if(t)return t.type};let H;const $e=async e=>{if(H)return H;const t=await Re(e);return t==="module"?H="esm":(t==="commonjs"||(typeof document>"u"?require("url").pathToFileURL(__filename).href:re&&re.tagName.toUpperCase()==="SCRIPT"&&re.src||new URL("index-O0uhHL8c.cjs",document.baseURI).href).endsWith(".cjs"))&&(H="cjs"),H||"esm"},B=Q.createLogger({level:"debug",format:Q.format.combine(Q.format.colorize(),Q.format.cli()),transports:[new Q.transports.Console({})]}),Me=e=>{B.error(e)};function Fe(e){return e?typeof e!="string"?Fe(String(e)):e.replace(/[^\d\w]/g,"."):""}const Je={"*, *::before, *::after":{boxSizing:"border-box"},"*":{margin:0},html:{lineHeight:1.15,textSizeAdjust:"100%",WebkitFontSmoothing:"antialiased"},"img, picture, video, canvas, svg":{display:"block",maxWidth:"100%"},"p, h1, h2, h3, h4, h5, h6":{overflowWrap:"break-word"},p:{textWrap:"pretty"},"h1, h2, h3, h4, h5, h6":{textWrap:"balance"},a:{color:"currentColor"},button:{lineHeight:"1em",color:"currentColor"},"input, optgroup, select, textarea":{fontFamily:"inherit",fontSize:"100%",lineHeight:"1.15em"}},ze=(e,t)=>new Promise((s,n)=>{const o=setTimeout(()=>{n(new Error("Timeout"))},100),a=ae.createSourceFile("temp.ts",e,ae.ScriptTarget.Latest,!0);function i(d){if(ae.isVariableDeclaration(d)&&d.name.getText()===t){const S=d.getStart(),m=d.getEnd();clearTimeout(o),s([S,m])}d.forEachChild(i)}i(a)}),E={externalModules:[],rcFile:void 0,destDir:void 0},Ce=e=>{if(E.externalModules.length>0)return E.externalModules;const s=l.readFileSync(e,"utf8").match(/externalModules:\s?\[(.*)\]/);if(!s)return[];const n=s[1].split(",").map(o=>o.replace(/['"`]/g,"").trim());return E.externalModules=n,n},q=async e=>{if(E.destDir)return E.destDir;const t=await le(e),s=r.join(e,(t==null?void 0:t.saltygenDir)||"saltygen");return E.destDir=s,s},ce=["salty","css","styles","styled"],Pe=(e=[])=>new RegExp(`\\.(${[...ce,...e].join("|")})\\.`),ee=(e,t=[])=>Pe(t).test(e),Ne=async e=>{if(E.rcFile)return E.rcFile;if(e==="/")throw new Error("Could not find .saltyrc.json file");const t=r.join(e,".saltyrc.json"),s=await he.readFile(t,"utf-8").then(JSON.parse).catch(()=>{});return s?(E.rcFile=s,s):Ne(r.join(e,".."))},le=async e=>{var n,o;const t=await Ne(e),s=(n=t.projects)==null?void 0:n.find(a=>e.endsWith(a.dir||""));return s||((o=t.projects)==null?void 0:o.find(a=>a.dir===t.defaultProject))},qe=async e=>{const t=await le(e),s=await q(e),n=r.join(e,(t==null?void 0:t.configDir)||"","salty.config.ts"),o=r.join(s,"salty.config.js"),a=await $e(e),i=Ce(n);await we.build({entryPoints:[n],minify:!0,treeShaking:!0,bundle:!0,outfile:o,format:a,external:i});const d=Date.now(),{config:S}=await import(`${o}?t=${d}`);return{config:S,path:o}},ke=async(e,t)=>{var de,me;const s=await q(e),n={mediaQueries:[],globalStyles:[],variables:[],templates:[]};await Promise.all([...t].map(async w=>{const{contents:$,outputFilePath:K}=await U(e,w,s);Object.entries($).forEach(([_,C])=>{C.isMedia?n.mediaQueries.push([_,C]):C.isGlobalDefine?n.globalStyles.push(C):C.isDefineVariables?n.variables.push(C):C.isDefineTemplates&&n.templates.push(C._setPath(`${_};;${K}`))})}));const{config:o,path:a}=await qe(e),i={...o},{mediaQueries:d}=n;i.mediaQueries=Object.fromEntries(d.map(([w,$])=>[`@${w}`,$]));const S=d.map(([w])=>`'@${w}'`).join(" | "),m=new Set,c=async(w,$=[])=>{if(!w)return[];const K=Object.entries(w).map(async([C,J])=>{const L=async T=>{if(!T)return;if(T instanceof Promise)return await L(await T);if(typeof T=="function")return await L(await T());if(typeof T=="object")return await c(T,[...$,C]);const ne=Fe(C),oe=D.dashCase(C),ie=[...$,ne].join(".");m.add(`"${ie}"`);const Y=[...$.map(D.dashCase),oe].join("-"),ye=Z.parseVariableTokens(T);return ye?`--${Y}: ${ye.transformed};`:`--${Y}: ${T};`};return await L(J)});return(await Promise.all(K)).flat()},g=async w=>{if(!w)return[];const $=Object.entries(w).map(async([_,C])=>{const J=await c(C);return _==="base"?J.join(""):i.mediaQueries[_]?`${i.mediaQueries[_]} { ${J.join("")} }`:`${_} { ${J.join("")} }`});return(await Promise.all($)).flat()},y=async w=>{if(!w)return[];const $=Object.entries(w).map(async([_,C])=>{const J=Object.entries(C).map(async([T,ne])=>{const oe=await c(ne,[_]),ie=`.${_}-${T}, [data-${_}="${T}"]`,Y=oe.join("");return`${ie} { ${Y} }`});return(await Promise.all(J)).flat()});return(await Promise.all($)).flat()},h=w=>({...w,responsive:void 0,conditional:void 0}),p=w=>n.variables.map($=>w==="static"?h($._current):$._current[w]),F=z.mergeObjects(h(o.variables),p("static")),k=await c(F),x=z.mergeObjects((de=o.variables)==null?void 0:de.responsive,p("responsive")),V=await g(x),v=z.mergeObjects((me=o.variables)==null?void 0:me.conditional,p("conditional")),pe=await y(v),R=r.join(s,"css/_variables.css"),te=`:root { ${k.join("")} ${V.join("")} } ${pe.join("")}`;l.writeFileSync(R,te),i.staticVariables=F;const u=r.join(s,"css/_global.css"),j=z.mergeObjects(o.global,n.globalStyles),b=await Z.parseAndJoinStyles(j,"");l.writeFileSync(u,`@layer global { ${b} }`);const f=r.join(s,"css/_reset.css"),N=o.reset==="none"?{}:typeof o.reset=="object"?o.reset:Je,O=await Z.parseAndJoinStyles(N,"");l.writeFileSync(f,`@layer reset { ${O} }`);const W=r.join(s,"css/_templates.css"),M=z.mergeObjects(o.templates,n.templates),I=await Se(M),A=Ve(M);l.writeFileSync(W,`@layer templates { ${I} }`),i.templates=M;const se=o.templates?[Oe.defineTemplates(o.templates)._setPath(`config;;${a}`)]:[],G=z.mergeFactories(n.templates,se);i.templatePaths=Object.fromEntries(Object.entries(G).map(([w,$])=>[w,$._path]));const X=r.join(s,"types/css-tokens.d.ts"),xe=`
1
+ "use strict";const _e=require("esbuild"),Te=require("child_process"),D=require("./dash-case-BJEkFEGQ.cjs"),c=require("path"),l=require("fs"),he=require("fs/promises"),Z=require("./parse-styles-CXclnoUS.cjs"),Q=require("winston"),z=require("./css/merge.cjs"),Oe=require("./define-templates-Cunsb_Tr.cjs"),ae=require("typescript");var ce=typeof document<"u"?document.currentScript:null;function Ee(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:()=>e[s]})}}return t.default=e,Object.freeze(t)}const we=Ee(_e),Se=async(e,t=[])=>{if(!e)return"";const s=[],n={};for(const[o,a]of Object.entries(e))if(typeof a!="function")if(a&&typeof a=="object"){const i=o.trim(),d=await Se(a,[...t,i]);s.push(d)}else n[o]=a;if(Object.keys(n).length){const o=t.map(D.dashCase).join("-"),a="t_"+D.toHash(o,4),i=await Z.parseAndJoinStyles(n,`.${o}, .${a}`);s.push(i)}return s.join(`
2
+ `)},Ve=e=>e?Object.entries(e).reduce((t,[s,n])=>(typeof n=="function"?t[s]="any":typeof n=="object"&&(t[s]=je(n).map(o=>`"${o}"`).join(" | ")),t),{}):{},je=(e,t="",s=new Set)=>e?(Object.entries(e).forEach(([n,o])=>{const a=t?`${t}.${n}`:n;return typeof o=="object"?je(o,a,s):s.add(t)}),[...s]):[],be=e=>{if(!e||e==="/")throw new Error("Could not find package.json file");const t=c.join(e,"package.json");return l.existsSync(t)?t:be(c.join(e,".."))},ve=async e=>{const t=be(e);return await he.readFile(t,"utf-8").then(JSON.parse).catch(()=>{})},Re=async e=>{const t=await ve(e);if(t)return t.type};let H;const $e=async e=>{if(H)return H;const t=await Re(e);return t==="module"?H="esm":(t==="commonjs"||(typeof document>"u"?require("url").pathToFileURL(__filename).href:ce&&ce.tagName.toUpperCase()==="SCRIPT"&&ce.src||new URL("index-vWQ_NojW.cjs",document.baseURI).href).endsWith(".cjs"))&&(H="cjs"),H||"esm"},B=Q.createLogger({level:"debug",format:Q.format.combine(Q.format.colorize(),Q.format.cli()),transports:[new Q.transports.Console({})]}),Me=e=>{B.error(e)};function Fe(e){return e?typeof e!="string"?Fe(String(e)):e.replace(/[^\d\w]/g,"."):""}const Je={"*, *::before, *::after":{boxSizing:"border-box"},"*":{margin:0},html:{lineHeight:1.15,textSizeAdjust:"100%",WebkitFontSmoothing:"antialiased"},"img, picture, video, canvas, svg":{display:"block",maxWidth:"100%"},"p, h1, h2, h3, h4, h5, h6":{overflowWrap:"break-word"},p:{textWrap:"pretty"},"h1, h2, h3, h4, h5, h6":{textWrap:"balance"},a:{color:"currentColor"},button:{lineHeight:"1em",color:"currentColor"},"input, optgroup, select, textarea":{fontFamily:"inherit",fontSize:"100%",lineHeight:"1.15em"}},ze=(e,t)=>new Promise((s,n)=>{const o=setTimeout(()=>{n(new Error("Timeout"))},100),a=ae.createSourceFile("temp.ts",e,ae.ScriptTarget.Latest,!0);function i(d){if(ae.isVariableDeclaration(d)&&d.name.getText()===t){const S=d.getStart(),m=d.getEnd();clearTimeout(o),s([S,m])}d.forEachChild(i)}i(a)}),E={externalModules:[],rcFile:void 0,destDir:void 0},Ce=e=>{if(E.externalModules.length>0)return E.externalModules;const s=l.readFileSync(e,"utf8").match(/externalModules:\s?\[(.*)\]/);if(!s)return[];const n=s[1].split(",").map(o=>o.replace(/['"`]/g,"").trim());return E.externalModules=n,n},q=async e=>{if(E.destDir)return E.destDir;const t=await le(e),s=c.join(e,(t==null?void 0:t.saltygenDir)||"saltygen");return E.destDir=s,s},re=["salty","css","styles","styled"],Pe=(e=[])=>new RegExp(`\\.(${[...re,...e].join("|")})\\.`),ee=(e,t=[])=>Pe(t).test(e),Ne=async e=>{if(E.rcFile)return E.rcFile;if(e==="/")throw new Error("Could not find .saltyrc.json file");const t=c.join(e,".saltyrc.json"),s=await he.readFile(t,"utf-8").then(JSON.parse).catch(()=>{});return s?(E.rcFile=s,s):Ne(c.join(e,".."))},le=async e=>{var n,o;const t=await Ne(e),s=(n=t.projects)==null?void 0:n.find(a=>e.endsWith(a.dir||""));return s||((o=t.projects)==null?void 0:o.find(a=>a.dir===t.defaultProject))},qe=async e=>{const t=await le(e),s=await q(e),n=c.join(e,(t==null?void 0:t.configDir)||"","salty.config.ts"),o=c.join(s,"salty.config.js"),a=await $e(e),i=Ce(n);await we.build({entryPoints:[n],minify:!0,treeShaking:!0,bundle:!0,outfile:o,format:a,external:i});const d=Date.now(),{config:S}=await import(`${o}?t=${d}`);return{config:S,path:o}},ke=async(e,t)=>{var de,me;const s=await q(e),n={mediaQueries:[],globalStyles:[],variables:[],templates:[]};await Promise.all([...t].map(async w=>{const{contents:$,outputFilePath:K}=await U(e,w,s);Object.entries($).forEach(([_,C])=>{C.isMedia?n.mediaQueries.push([_,C]):C.isGlobalDefine?n.globalStyles.push(C):C.isDefineVariables?n.variables.push(C):C.isDefineTemplates&&n.templates.push(C._setPath(`${_};;${K}`))})}));const{config:o,path:a}=await qe(e),i={...o},{mediaQueries:d}=n;i.mediaQueries=Object.fromEntries(d.map(([w,$])=>[`@${w}`,$]));const S=d.map(([w])=>`'@${w}'`).join(" | "),m=new Set,r=async(w,$=[])=>{if(!w)return[];const K=Object.entries(w).map(async([C,J])=>{const L=async T=>{if(!T)return;if(T instanceof Promise)return await L(await T);if(typeof T=="function")return await L(await T());if(typeof T=="object")return await r(T,[...$,C]);const ne=Fe(C),oe=D.dashCase(C),ie=[...$,ne].join(".");m.add(`"${ie}"`);const Y=[...$.map(D.dashCase),oe].join("-"),ye=Z.parseVariableTokens(T);return ye?`--${Y}: ${ye.transformed};`:`--${Y}: ${T};`};return await L(J)});return(await Promise.all(K)).flat()},g=async w=>{if(!w)return[];const $=Object.entries(w).map(async([_,C])=>{const J=await r(C);return _==="base"?J.join(""):i.mediaQueries[_]?`${i.mediaQueries[_]} { ${J.join("")} }`:`${_} { ${J.join("")} }`});return(await Promise.all($)).flat()},y=async w=>{if(!w)return[];const $=Object.entries(w).map(async([_,C])=>{const J=Object.entries(C).map(async([T,ne])=>{const oe=await r(ne,[_]),ie=`.${_}-${T}, [data-${_}="${T}"]`,Y=oe.join("");return`${ie} { ${Y} }`});return(await Promise.all(J)).flat()});return(await Promise.all($)).flat()},h=w=>({...w,responsive:void 0,conditional:void 0}),p=w=>n.variables.map($=>w==="static"?h($._current):$._current[w]),F=z.mergeObjects(h(o.variables),p("static")),k=await r(F),x=z.mergeObjects((de=o.variables)==null?void 0:de.responsive,p("responsive")),V=await g(x),v=z.mergeObjects((me=o.variables)==null?void 0:me.conditional,p("conditional")),pe=await y(v),R=c.join(s,"css/_variables.css"),te=`:root { ${k.join("")} ${V.join("")} } ${pe.join("")}`;l.writeFileSync(R,te),i.staticVariables=F;const u=c.join(s,"css/_global.css"),j=z.mergeObjects(o.global,n.globalStyles),b=await Z.parseAndJoinStyles(j,"");l.writeFileSync(u,`@layer global { ${b} }`);const f=c.join(s,"css/_reset.css"),N=o.reset==="none"?{}:typeof o.reset=="object"?o.reset:Je,O=await Z.parseAndJoinStyles(N,"");l.writeFileSync(f,`@layer reset { ${O} }`);const W=c.join(s,"css/_templates.css"),M=z.mergeObjects(o.templates,n.templates),I=await Se(M),A=Ve(M);l.writeFileSync(W,`@layer templates { ${I} }`),i.templates=M;const se=o.templates?[Oe.defineTemplates(o.templates)._setPath(`config;;${a}`)]:[],G=z.mergeFactories(n.templates,se);i.templatePaths=Object.fromEntries(Object.entries(G).map(([w,$])=>[w,$._path]));const X=c.join(s,"types/css-tokens.d.ts"),xe=`
3
3
  // Variable types
4
4
  type VariableTokens = ${[...m].join("|")};
5
5
  type PropertyValueToken = \`{\${VariableTokens}}\`;
@@ -12,27 +12,27 @@
12
12
 
13
13
  // Media query types
14
14
  type MediaQueryKeys = ${S||"''"};
15
- `;l.writeFileSync(X,xe);const De=r.join(s,"cache/config-cache.json");l.writeFileSync(De,JSON.stringify(i,null,2))},ge=e=>e.replace(/styled\(([^"'`{,]+),/g,(t,s)=>{if(/^['"`]/.test(s))return t;const o=new RegExp(`import[^;]*${s}[,\\s{][^;]*from\\s?([^{};]+);`);if(!o.test(e))return t;const i=o.exec(e);if(i){const d=i.at(1);if(ce.some(m=>d==null?void 0:d.includes(m)))return t}return"styled('div',"}),He=(e,t)=>{try{const s=l.readFileSync(r.join(t,"saltygen/cache/config-cache.json"),"utf8");return s?`globalThis.saltyConfig = ${s};
15
+ `;l.writeFileSync(X,xe);const De=c.join(s,"cache/config-cache.json");l.writeFileSync(De,JSON.stringify(i,null,2))},ge=e=>e.replace(/styled\(([^"'`{,]+),/g,(t,s)=>{if(/^['"`]/.test(s))return t;const o=new RegExp(`import[^;]*${s}[,\\s{][^;]*from\\s?([^{};]+);`);if(!o.test(e))return t;const i=o.exec(e);if(i){const d=i.at(1);if(re.some(m=>d==null?void 0:d.includes(m)))return t}return"styled('div',"}),He=(e,t)=>{try{const s=l.readFileSync(c.join(t,"saltygen/cache/config-cache.json"),"utf8");return s?`globalThis.saltyConfig = ${s};
16
16
 
17
17
  ${e}`:`globalThis.saltyConfig = {};
18
18
 
19
- ${e}`}catch{return e}},U=async(e,t,s)=>{const n=D.toHash(t),o=r.join(s,"./temp");l.existsSync(o)||l.mkdirSync(o);const a=r.parse(t);let i=l.readFileSync(t,"utf8");i=ge(i),i=He(i,e);const d=r.join(s,"js",n+".js"),S=await le(e),m=r.join(e,(S==null?void 0:S.configDir)||"","salty.config.ts"),c=Ce(m),g=await $e(e);await we.build({stdin:{contents:i,sourcefile:a.base,resolveDir:a.dir,loader:"tsx"},minify:!1,treeShaking:!0,bundle:!0,outfile:d,format:g,target:["node20"],keepNames:!0,external:c,packages:"external",plugins:[{name:"test",setup:p=>{p.onLoad({filter:/.*\.css|salty|styles|styled\.ts/},F=>{const k=l.readFileSync(F.path,"utf8");return{contents:ge(k),loader:"ts"}})}}]});const y=Date.now();return{contents:await import(`${d}?t=${y}`),outputFilePath:d}},We=async e=>{const t=await q(e),s=r.join(t,"cache/config-cache.json"),n=l.readFileSync(s,"utf8");if(!n)throw new Error("Could not find config cache file");return JSON.parse(n)},fe=async e=>{const t=await We(e),s=await q(e),n=r.join(s,"salty.config.js"),o=Date.now(),{config:a}=await import(`${n}?t=${o}`);return z.mergeObjects(a,t)},ue=()=>{try{return process.env.NODE_ENV==="production"}catch{return!1}},Ie=async(e,t=ue(),s=!0)=>{try{const n=Date.now();t?B.info("Generating CSS in production mode! 🔥"):B.info("Generating CSS in development mode! 🚀");const o=[],a=[],i=await q(e),d=r.join(i,"index.css");s&&(()=>{l.existsSync(i)&&Te.execSync("rm -rf "+i),l.mkdirSync(i,{recursive:!0}),l.mkdirSync(r.join(i,"css")),l.mkdirSync(r.join(i,"types")),l.mkdirSync(r.join(i,"js")),l.mkdirSync(r.join(i,"cache"))})();const m=new Set,c=new Set;async function g(u){const j=["node_modules","saltygen"],b=l.statSync(u);if(b.isDirectory()){const f=l.readdirSync(u);if(j.some(N=>u.includes(N)))return;await Promise.all(f.map(N=>g(r.join(u,N))))}else if(b.isFile()&&ee(u)){m.add(u);const P=l.readFileSync(u,"utf8");/define[\w\d]+\(/.test(P)&&c.add(u)}}await g(e),await ke(e,c);const y={keyframes:[],components:[],classNames:[]};await Promise.all([...m].map(async u=>{const{contents:j}=await U(e,u,i);for(let[b,f]of Object.entries(j))f instanceof Promise&&(f=await f),f.isKeyframes?y.keyframes.push({value:f,src:u,name:b}):f.isClassName?y.classNames.push({...f,src:u,name:b}):f.generator&&y.components.push({...f,src:u,name:b})}));const h=await fe(e);for(const u of y.keyframes){const{value:j}=u,b=`a_${j.animationName}.css`,f=`css/${b}`,P=r.join(i,f);o.push(b),l.writeFileSync(P,j.css)}const p={};for(const u of y.components){const{src:j,name:b}=u;p[j]||(p[j]=[]);const f=u.generator._withBuildContext({callerName:b,isProduction:t,config:h});a[f.priority]||(a[f.priority]=[]);const P=await f.css;if(!P)continue;a[f.priority].push(f.cssFileName);const N=`css/${f.cssFileName}`,O=r.join(i,N);l.writeFileSync(O,P),h.importStrategy==="component"&&p[j].push(f.cssFileName)}for(const u of y.classNames){const{src:j,name:b}=u;p[j]||(p[j]=[]);const f=u.generator._withBuildContext({callerName:b,isProduction:t,config:h}),P=await f.css;if(!P)continue;a[f.priority]||(a[f.priority]=[]),a[f.priority].push(f.cssFileName);const N=`css/${f.cssFileName}`,O=r.join(i,N);l.writeFileSync(O,P),h.importStrategy==="component"&&p[j].push(f.cssFileName)}h.importStrategy==="component"&&Object.entries(p).forEach(([u,j])=>{const b=j.map(W=>`@import url('./${W}');`).join(`
20
- `),f=D.toHash(u,6),P=r.parse(u),N=D.dashCase(P.name),O=r.join(i,`css/f_${N}-${f}.css`);l.writeFileSync(O,b||"/* Empty file */")});const F=o.map(u=>`@import url('./css/${u}');`).join(`
19
+ ${e}`}catch{return e}},U=async(e,t,s)=>{const n=D.toHash(t),o=c.join(s,"./temp");l.existsSync(o)||l.mkdirSync(o);const a=c.parse(t);let i=l.readFileSync(t,"utf8");i=ge(i),i=He(i,e);const d=c.join(s,"js",n+".js"),S=await le(e),m=c.join(e,(S==null?void 0:S.configDir)||"","salty.config.ts"),r=Ce(m),g=await $e(e);await we.build({stdin:{contents:i,sourcefile:a.base,resolveDir:a.dir,loader:"tsx"},minify:!1,treeShaking:!0,bundle:!0,outfile:d,format:g,target:["node20"],keepNames:!0,external:r,packages:"external",plugins:[{name:"test",setup:p=>{p.onLoad({filter:/.*\.css|salty|styles|styled\.ts/},F=>{const k=l.readFileSync(F.path,"utf8");return{contents:ge(k),loader:"ts"}})}}]});const y=Date.now();return{contents:await import(`${d}?t=${y}`),outputFilePath:d}},We=async e=>{const t=await q(e),s=c.join(t,"cache/config-cache.json"),n=l.readFileSync(s,"utf8");if(!n)throw new Error("Could not find config cache file");return JSON.parse(n)},fe=async e=>{const t=await We(e),s=await q(e),n=c.join(s,"salty.config.js"),o=Date.now(),{config:a}=await import(`${n}?t=${o}`);return z.mergeObjects(a,t)},ue=()=>{try{return process.env.NODE_ENV==="production"}catch{return!1}},Ie=async(e,t=ue(),s=!0)=>{try{const n=Date.now();t?B.info("Generating CSS in production mode! 🔥"):B.info("Generating CSS in development mode! 🚀");const o=[],a=[],i=await q(e),d=c.join(i,"index.css");s&&(()=>{l.existsSync(i)&&Te.execSync("rm -rf "+i),l.mkdirSync(i,{recursive:!0}),l.mkdirSync(c.join(i,"css")),l.mkdirSync(c.join(i,"types")),l.mkdirSync(c.join(i,"js")),l.mkdirSync(c.join(i,"cache"))})();const m=new Set,r=new Set;async function g(u){const j=["node_modules","saltygen"],b=l.statSync(u);if(b.isDirectory()){const f=l.readdirSync(u);if(j.some(N=>u.includes(N)))return;await Promise.all(f.map(N=>g(c.join(u,N))))}else if(b.isFile()&&ee(u)){m.add(u);const P=l.readFileSync(u,"utf8");/define[\w\d]+\(/.test(P)&&r.add(u)}}await g(e),await ke(e,r);const y={keyframes:[],components:[],classNames:[]};await Promise.all([...m].map(async u=>{const{contents:j}=await U(e,u,i);for(let[b,f]of Object.entries(j))f instanceof Promise&&(f=await f),f.isKeyframes?y.keyframes.push({value:f,src:u,name:b}):f.isClassName?y.classNames.push({...f,src:u,name:b}):f.generator&&y.components.push({...f,src:u,name:b})}));const h=await fe(e);for(const u of y.keyframes){const{value:j}=u,b=`a_${j.animationName}.css`,f=`css/${b}`,P=c.join(i,f);o.push(b),l.writeFileSync(P,j.css)}const p={};for(const u of y.components){const{src:j,name:b}=u;p[j]||(p[j]=[]);const f=u.generator._withBuildContext({callerName:b,isProduction:t,config:h});a[f.priority]||(a[f.priority]=[]);const P=await f.css;if(!P)continue;a[f.priority].push(f.cssFileName);const N=`css/${f.cssFileName}`,O=c.join(i,N);l.writeFileSync(O,P),h.importStrategy==="component"&&p[j].push(f.cssFileName)}for(const u of y.classNames){const{src:j,name:b}=u;p[j]||(p[j]=[]);const f=u.generator._withBuildContext({callerName:b,isProduction:t,config:h}),P=await f.css;if(!P)continue;a[f.priority]||(a[f.priority]=[]),a[f.priority].push(f.cssFileName);const N=`css/${f.cssFileName}`,O=c.join(i,N);l.writeFileSync(O,P),h.importStrategy==="component"&&p[j].push(f.cssFileName)}h.importStrategy==="component"&&Object.entries(p).forEach(([u,j])=>{const b=j.map(W=>`@import url('./${W}');`).join(`
20
+ `),f=D.toHash(u,6),P=c.parse(u),N=D.dashCase(P.name),O=c.join(i,`css/f_${N}-${f}.css`);l.writeFileSync(O,b||"/* Empty file */")});const F=o.map(u=>`@import url('./css/${u}');`).join(`
21
21
  `);let v=`@layer reset, global, templates, l0, l1, l2, l3, l4, l5, l6, l7, l8;
22
22
 
23
- ${["_variables.css","_reset.css","_global.css","_templates.css"].filter(u=>{try{return l.readFileSync(r.join(i,"css",u),"utf8").length>0}catch{return!1}}).map(u=>`@import url('./css/${u}');`).join(`
23
+ ${["_variables.css","_reset.css","_global.css","_templates.css"].filter(u=>{try{return l.readFileSync(c.join(i,"css",u),"utf8").length>0}catch{return!1}}).map(u=>`@import url('./css/${u}');`).join(`
24
24
  `)}
25
- ${F}`;if(h.importStrategy!=="component"){const u=a.reduce((j,b,f)=>{const P=b.reduce((M,I)=>{var X;const A=r.join(i,"css",I),se=l.readFileSync(A,"utf8"),G=((X=/.*-([^-]+)-\d+.css/.exec(I))==null?void 0:X.at(1))||D.toHash(A,6);return M.includes(G)?M:`${M}
25
+ ${F}`;if(h.importStrategy!=="component"){const u=a.reduce((j,b,f)=>{const P=b.reduce((M,I)=>{var X;const A=c.join(i,"css",I),se=l.readFileSync(A,"utf8"),G=((X=/.*-([^-]+)-\d+.css/.exec(I))==null?void 0:X.at(1))||D.toHash(A,6);return M.includes(G)?M:`${M}
26
26
  /*start:${G}-${I}*/
27
27
  ${se}
28
28
  /*end:${G}*/
29
- `},""),N=`l_${f}.css`,O=r.join(i,"css",N),W=`@layer l${f} { ${P}
29
+ `},""),N=`l_${f}.css`,O=c.join(i,"css",N),W=`@layer l${f} { ${P}
30
30
  }`;return l.writeFileSync(O,W),`${j}
31
- @import url('./css/${N}');`},"");v+=u}l.writeFileSync(d,v);const R=Date.now()-n,te=R<200?"🔥":R<500?"🚀":R<1e3?"🎉":R<2e3?"🚗":R<5e3?"🤔":"🥴";B.info(`Generated CSS in ${R}ms! ${te}`)}catch(n){console.error(n)}},Ge=async(e,t,s=ue())=>{try{const n=await q(e);if(ee(t)){const a=[],i=await fe(e),{contents:d}=await U(e,t,n);for(const[S,m]of Object.entries(d)){if(m.isKeyframes&&m.css){const F=`css/${`a_${m.animationName}.css`}`,k=r.join(n,F);l.writeFileSync(k,await m.css);return}if(m.isClassName){const p=m.generator._withBuildContext({callerName:S,isProduction:s,config:i}),F=await p.css;if(!F)continue;a[p.priority]||(a[p.priority]=[]),a[p.priority].push(p.cssFileName);const k=`css/${p.cssFileName}`,x=r.join(n,k);l.writeFileSync(x,F)}if(!m.generator)return;const c=m.generator._withBuildContext({callerName:S,isProduction:s,config:i}),g=await c.css;if(!g)continue;const y=`css/${c.cssFileName}`,h=r.join(n,y);l.writeFileSync(h,g),a[c.priority]||(a[c.priority]=[]),a[c.priority].push(c.cssFileName)}if(i.importStrategy!=="component")a.forEach((S,m)=>{const c=`l_${m}.css`,g=r.join(n,"css",c);let y=l.readFileSync(g,"utf8");S.forEach(h=>{var x;const p=r.join(n,"css",h),F=((x=/.*-([^-]+)-\d+.css/.exec(h))==null?void 0:x.at(1))||D.toHash(p,6);if(!y.includes(F)){const V=l.readFileSync(p,"utf8"),v=`/*start:${F}-${h}*/
31
+ @import url('./css/${N}');`},"");v+=u}l.writeFileSync(d,v);const R=Date.now()-n,te=R<200?"🔥":R<500?"🚀":R<1e3?"🎉":R<2e3?"🚗":R<5e3?"🤔":"🥴";B.info(`Generated CSS in ${R}ms! ${te}`)}catch(n){console.error(n)}},Ge=async(e,t,s=ue())=>{try{const n=await q(e);if(ee(t)){const a=[],i=await fe(e),{contents:d}=await U(e,t,n);for(const[S,m]of Object.entries(d)){if(m.isKeyframes&&m.css){const F=`css/${`a_${m.animationName}.css`}`,k=c.join(n,F);l.writeFileSync(k,await m.css);continue}if(m.isClassName){const p=m.generator._withBuildContext({callerName:S,isProduction:s,config:i}),F=await p.css;if(!F)continue;a[p.priority]||(a[p.priority]=[]),a[p.priority].push(p.cssFileName);const k=`css/${p.cssFileName}`,x=c.join(n,k);l.writeFileSync(x,F);continue}if(!m.generator)continue;const r=m.generator._withBuildContext({callerName:S,isProduction:s,config:i}),g=await r.css;if(!g)continue;const y=`css/${r.cssFileName}`,h=c.join(n,y);l.writeFileSync(h,g),a[r.priority]||(a[r.priority]=[]),a[r.priority].push(r.cssFileName)}if(i.importStrategy!=="component")a.forEach((S,m)=>{const r=`l_${m}.css`,g=c.join(n,"css",r);let y=l.readFileSync(g,"utf8");S.forEach(h=>{var x;const p=c.join(n,"css",h),F=((x=/.*-([^-]+)-\d+.css/.exec(h))==null?void 0:x.at(1))||D.toHash(p,6);if(!y.includes(F)){const V=l.readFileSync(p,"utf8"),v=`/*start:${F}-${h}*/
32
32
  ${V}
33
33
  /*end:${F}*/
34
34
  `;y=`${y.replace(/\}$/,"")}
35
35
  ${v}
36
36
  }`}}),l.writeFileSync(g,y)});else{const S=a.flat().map(h=>`@import url('./${h}');`).join(`
37
- `),m=D.toHash(t,6),c=r.parse(t),g=D.dashCase(c.name),y=r.join(n,`css/f_${g}-${m}.css`);l.writeFileSync(y,S||"/* Empty file */")}}}catch(n){console.error(n)}},Ke=async(e,t,s=ue())=>{var n,o;try{const a=await q(e);if(ee(t)){const d=l.readFileSync(t,"utf8"),S=await fe(e),{contents:m}=await U(e,t,a);let c=d;for(const[g,y]of Object.entries(m)){if(y.isKeyframes||!y.generator)continue;const h=y.generator._withBuildContext({callerName:g,isProduction:s,config:S}),[p,F]=await ze(c,g),k=c.slice(p,F);if(y.isClassName){const x=c,V=` ${g} = className("${h.classNames}")`;c=c.replace(k,V),x===c&&console.error("Minimize file failed to change content",{name:g})}if(k.includes("styled")){const x=(o=(n=/styled\(([^,]+),/.exec(k))==null?void 0:n.at(1))==null?void 0:o.trim(),V=c,v=` ${g} = styled(${x}, "${h.classNames}", ${JSON.stringify(h.clientProps)})`;c=c.replace(k,v),V===c&&console.error("Minimize file failed to change content",{name:g,tagName:x})}}if(S.importStrategy==="component"){const g=D.toHash(t,6),y=r.parse(t);c=`import '../../saltygen/css/${`f_${D.dashCase(y.name)}-${g}.css`}';
38
- ${c}`}return c=c.replace("@salty-css/react/class-name","@salty-css/react/class-name-client"),c=c.replace("{ styled }","{ styledClient as styled }"),c=c.replace("@salty-css/react/styled","@salty-css/react/styled-client"),c}}catch(a){console.error("Error in minimizeFile:",a)}};exports.compileSaltyFile=U;exports.generateConfigStyles=ke;exports.generateCss=Ie;exports.generateFile=Ge;exports.isSaltyFile=ee;exports.logError=Me;exports.logger=B;exports.minimizeFile=Ke;exports.saltyFileExtensions=ce;exports.saltyFileRegExp=Pe;
37
+ `),m=D.toHash(t,6),r=c.parse(t),g=D.dashCase(r.name),y=c.join(n,`css/f_${g}-${m}.css`);l.writeFileSync(y,S||"/* Empty file */")}}}catch(n){console.error(n)}},Ke=async(e,t,s=ue())=>{var n,o;try{const a=await q(e);if(ee(t)){const d=l.readFileSync(t,"utf8"),S=await fe(e),{contents:m}=await U(e,t,a);let r=d;for(const[g,y]of Object.entries(m)){if(y.isKeyframes||!y.generator)continue;const h=y.generator._withBuildContext({callerName:g,isProduction:s,config:S}),[p,F]=await ze(r,g),k=r.slice(p,F);if(y.isClassName){const x=r,V=` ${g} = className("${h.classNames}")`;r=r.replace(k,V),x===r&&console.error("Minimize file failed to change content",{name:g})}if(k.includes("styled")){const x=(o=(n=/styled\(([^,]+),/.exec(k))==null?void 0:n.at(1))==null?void 0:o.trim(),V=r,v=` ${g} = styled(${x}, "${h.classNames}", ${JSON.stringify(h.clientProps)})`;r=r.replace(k,v),V===r&&console.error("Minimize file failed to change content",{name:g,tagName:x})}}if(S.importStrategy==="component"){const g=D.toHash(t,6),y=c.parse(t);r=`import '../../saltygen/css/${`f_${D.dashCase(y.name)}-${g}.css`}';
38
+ ${r}`}return r=r.replace("@salty-css/react/class-name","@salty-css/react/class-name-client"),r=r.replace("{ styled }","{ styledClient as styled }"),r=r.replace("@salty-css/react/styled","@salty-css/react/styled-client"),r}}catch(a){console.error("Error in minimizeFile:",a)}};exports.compileSaltyFile=U;exports.generateConfigStyles=ke;exports.generateCss=Ie;exports.generateFile=Ge;exports.isSaltyFile=ee;exports.logError=Me;exports.logger=B;exports.minimizeFile=Ke;exports.saltyFileExtensions=re;exports.saltyFileRegExp=Pe;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salty-css/core",
3
- "version": "0.0.1-alpha.242",
3
+ "version": "0.0.1-alpha.244",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "typings": "./dist/index.d.ts",
@@ -1,4 +1,4 @@
1
- "use strict";const V=require("./dash-case-BJEkFEGQ.cjs"),k=a=>e=>{if(typeof e!="string"||!a)return;let t=e;const u=[];return Object.values(a).forEach(n=>{const{pattern:b,transform:y}=n;t=t.replace(b,x=>{const{value:O,css:E}=y(x);return E&&u.push(E),O})}),{transformed:t,additionalCss:u}},z=a=>e=>typeof e!="string"||!/\{[^{}]+\}/g.test(e)?void 0:{transformed:e.replace(/\{([^{}]+)\}/g,(...n)=>`var(--${V.dashCase(n[1].replaceAll(".","-"))})`)},q=z(),J=["top","right","bottom","left","min-width",/.*width.*/,/^[^line]*height.*/,/padding.*/,/margin.*/,/border.*/,/inset.*/,/.*radius.*/,/.*spacing.*/,/.*gap.*/,/.*indent.*/,/.*offset.*/,/.*size.*/,/.*thickness.*/,/.*font-size.*/],M=(a,e,t)=>{if(J.some(n=>typeof n=="string"?n===a:n.test(a))){const n=(t==null?void 0:t.defaultUnit)||"px";return`${e}${n}`}return`${e}`},Q=["Webkit","Moz","ms","O"],_=a=>a.startsWith("-")?a:Q.some(e=>a.startsWith(e))?`-${V.dashCase(a)}`:V.dashCase(a),$=async(a,e="",t,u=!1)=>{if(!a)throw new Error("No styles provided to parseStyles function!");const n=new Set,b=Object.entries(a),y=async([p,s])=>{var C;const r=p.trim(),w=_(r),l=(i,d=";")=>`${w}:${i}${d}`,P={scope:e,config:t};if(typeof s=="function")return y([p,s(P)]);if(s instanceof Promise)return y([p,await s]);if(t!=null&&t.templates&&t.templatePaths[r])try{const[i,d]=t.templatePaths[r].split(";;"),o=await import(d),c=d.includes("salty.config"),f=c?o[i].templates:o[i],h=c?f[r]:f.params[r];if(f&&typeof h=="function"){const j=await h(s),[m]=await $(j,"");return m}}catch(i){console.error(`Error loading template "${r}" from path "${t.templatePaths[r]}"`,i);return}if(t!=null&&t.templates&&t.templates[r]){if(u)return;const d=s.split(".").reduce((o,c)=>o[c],t.templates[r]);if(d){const[o]=await $(d,"");return o}console.warn(`Template "${r}" with path of "${s}" was not found in config!`);return}if(typeof s=="object"){if(!s)return;if(s.isColor)return l(s.toString());if(r==="defaultVariants")return;if(r==="variants"){const o=Object.entries(s);for(const[c,f]of o){if(!f)return;const h=Object.entries(f);for(const[j,m]of h){if(!m)return;const T=`${e}.${c}-${j}`;(await $(m,T,t)).forEach(U=>n.add(U))}}return}if(r==="compoundVariants"){for(const o of s){const{css:c,...f}=o,h=Object.entries(f).reduce((m,[T,N])=>`${m}.${T}-${N}`,e);(await $(c,h,t)).forEach(m=>n.add(m))}return}if(r.startsWith("@")){const o=((C=t==null?void 0:t.mediaQueries)==null?void 0:C[r])||r,c=await A(s,e,t),f=`${o} { ${c} }`;n.add(f);return}const i=p.includes("&")?r.replace("&",e):r.startsWith(":")?`${e}${r}`:`${e} ${r}`;(await $(s,i,t)).forEach(o=>n.add(o));return}if(typeof s=="number"){const i=M(w,s,t);return l(i)}if(typeof s!="string")if("toString"in s)s=s.toString();else throw new Error(`Invalid value type for property ${w}`);return l(s)},x=b.map(y),{modifiers:O}=t||{},E=[z(),k(O)],S=(await Promise.all(x).then(p=>Promise.all(p.map(s=>E.reduce(async(r,w)=>{const l=await r;if(!l)return l;const P=await w(l);if(!P)return l;const{transformed:C,additionalCss:i}=P;let d="";if(i)for(const o of i)d+=await A(o,"");return`${d}${C}`},Promise.resolve(s)))))).filter(p=>p!==void 0).join(`
1
+ "use strict";const V=require("./dash-case-BJEkFEGQ.cjs"),k=a=>e=>{if(typeof e!="string"||!a)return;let t=e;const u=[];return Object.values(a).forEach(n=>{const{pattern:b,transform:y}=n;t=t.replace(b,x=>{const{value:O,css:E}=y(x);return E&&u.push(E),O})}),{transformed:t,additionalCss:u}},z=a=>e=>typeof e!="string"||!/\{[^{}]+\}/g.test(e)?void 0:{transformed:e.replace(/\{([^{}]+)\}/g,(...n)=>`var(--${V.dashCase(n[1].replaceAll(".","-"))})`)},q=z(),J=["top","right","bottom","left","min-width",/.*width.*/,/^[^line]*height.*/,/padding.*/,/margin.*/,/border.*/,/inset.*/,/.*radius.*/,/.*spacing.*/,/.*gap.*/,/.*indent.*/,/.*offset.*/,/.*size.*/,/.*thickness.*/,/.*font-size.*/],M=(a,e,t)=>{if(J.some(n=>typeof n=="string"?n===a:n.test(a))){const n=(t==null?void 0:t.defaultUnit)||"px";return`${e}${n}`}return`${e}`},Q=["Webkit","Moz","ms","O"],_=a=>a.startsWith("-")?a:Q.some(e=>a.startsWith(e))?`-${V.dashCase(a)}`:V.dashCase(a),$=async(a,e="",t,u=!1)=>{if(!a)throw new Error("No styles provided to parseStyles function!");const n=new Set,b=Object.entries(a),y=async([p,s])=>{var C;const r=p.trim(),w=_(r),l=(i,d=";")=>`${w}:${i}${d}`,P={scope:e,config:t};if(typeof s=="function")return y([p,s(P)]);if(s instanceof Promise)return y([p,await s]);if(t!=null&&t.templates&&t.templatePaths[r])try{const[i,d]=t.templatePaths[r].split(";;"),o=await import(d),c=d.includes("salty.config"),f=c?o[i].templates:o[i],h=c?f[r]:f.params[r];if(f&&typeof h=="function"){const j=await h(s),[m]=await $(j,"");return m}}catch(i){console.error(`Error loading template "${r}" from path "${t.templatePaths[r]}"`,i);return}if(t!=null&&t.templates&&t.templates[r]){if(u)return;const d=s.split(".").reduce((o,c)=>o[c],t.templates[r]);if(d){const[o]=await $(d,"");return o}console.warn(`Template "${r}" with path of "${s}" was not found in config!`);return}if(typeof s=="object"){if(!s)return;if(s.isColor)return l(s.toString());if(r==="defaultVariants")return;if(r==="variants"){const o=Object.entries(s);for(const[c,f]of o){if(!f)continue;const h=Object.entries(f);for(const[j,m]of h){if(!m)continue;const T=`${e}.${c}-${j}`;(await $(m,T,t)).forEach(U=>n.add(U))}}return}if(r==="compoundVariants"){for(const o of s){const{css:c,...f}=o,h=Object.entries(f).reduce((m,[T,N])=>`${m}.${T}-${N}`,e);(await $(c,h,t)).forEach(m=>n.add(m))}return}if(r.startsWith("@")){const o=((C=t==null?void 0:t.mediaQueries)==null?void 0:C[r])||r,c=await A(s,e,t),f=`${o} { ${c} }`;n.add(f);return}const i=p.includes("&")?r.replace("&",e):r.startsWith(":")?`${e}${r}`:`${e} ${r}`;(await $(s,i,t)).forEach(o=>n.add(o));return}if(typeof s=="number"){const i=M(w,s,t);return l(i)}if(typeof s!="string")if("toString"in s)s=s.toString();else throw new Error(`Invalid value type for property ${w}`);return l(s)},x=b.map(y),{modifiers:O}=t||{},E=[z(),k(O)],S=(await Promise.all(x).then(p=>Promise.all(p.map(s=>E.reduce(async(r,w)=>{const l=await r;if(!l)return l;const P=await w(l);if(!P)return l;const{transformed:C,additionalCss:i}=P;let d="";if(i)for(const o of i)d+=await A(o,"");return`${d}${C}`},Promise.resolve(s)))))).filter(p=>p!==void 0).join(`
2
2
  `);if(!S.trim())return Array.from(n);const W=e?`${e} {
3
3
  ${S}
4
4
  }`:S;return n.has(W)?Array.from(n):[W,...n]},A=async(a,e,t,u=!1)=>(await $(a,e,t,u)).join(`
@@ -72,10 +72,10 @@ const M = (o) => (e) => {
72
72
  if (r === "variants") {
73
73
  const a = Object.entries(s);
74
74
  for (const [c, f] of a) {
75
- if (!f) return;
75
+ if (!f) continue;
76
76
  const h = Object.entries(f);
77
77
  for (const [x, m] of h) {
78
- if (!m) return;
78
+ if (!m) continue;
79
79
  const T = `${e}.${c}-${x}`;
80
80
  (await $(m, T, t)).forEach((U) => n.add(U));
81
81
  }
package/server/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../should-restart-BPXyHnNn.cjs");exports.checkShouldRestart=e.checkShouldRestart;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../should-restart-BepJi85G.cjs");exports.checkShouldRestart=e.checkShouldRestart;
package/server/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { c as o } from "../should-restart-CeCqMexy.js";
1
+ import { c as o } from "../should-restart-BJ_DZyAz.js";
2
2
  export {
3
3
  o as checkShouldRestart
4
4
  };
@@ -1,5 +1,5 @@
1
1
  import { readFile as r } from "fs/promises";
2
- import { i as e } from "./index-D8CuiJVg.js";
2
+ import { i as e } from "./index-B8uXjJ2F.js";
3
3
  const c = async (t) => {
4
4
  if (!t || t.includes("node_modules") || t.includes("saltygen")) return !1;
5
5
  if (t.includes("salty.config")) return !0;
@@ -1 +1 @@
1
- "use strict";const e=require("fs/promises"),r=require("./index-O0uhHL8c.cjs"),i=async t=>{if(!t||t.includes("node_modules")||t.includes("saltygen"))return!1;if(t.includes("salty.config"))return!0;if(!r.isSaltyFile(t))return!1;const s=await e.readFile(t,"utf-8");return!!/.+define[A-Z]\w+/.test(s)};exports.checkShouldRestart=i;
1
+ "use strict";const e=require("fs/promises"),r=require("./index-vWQ_NojW.cjs"),i=async t=>{if(!t||t.includes("node_modules")||t.includes("saltygen"))return!1;if(t.includes("salty.config"))return!0;if(!r.isSaltyFile(t))return!1;const s=await e.readFile(t,"utf-8");return!!/.+define[A-Z]\w+/.test(s)};exports.checkShouldRestart=i;