@salty-css/vite 0.0.1-alpha.139 → 0.0.1-alpha.140
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/index.cjs +16 -16
- package/index.js +236 -219
- package/package.json +2 -2
package/index.cjs
CHANGED
@@ -1,29 +1,29 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
2
|
-
${
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const pe=require("esbuild"),de=require("child_process"),a=require("path"),u=require("fs"),X=require("fs/promises"),J=require("winston");var Z=typeof document<"u"?document.currentScript:null;function ye(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 Y=ye(pe),U=e=>String.fromCharCode(e+(e>25?39:97)),ge=(e,t)=>{let s="",n;for(n=Math.abs(e);n>52;n=n/52|0)s=U(n%52)+s;return s=U(n%52)+s,s.length<t?s=s.padStart(t,"a"):s.length>t&&(s=s.slice(-t)),s},me=(e,t)=>{let s=t.length;for(;s;)e=e*33^t.charCodeAt(--s);return e},L=(e,t=5)=>{const s=me(5381,JSON.stringify(e))>>>0;return ge(s,t)};function E(e){return e?typeof e!="string"?E(String(e)):e.replace(/[\s.]/g,"-").replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g,(t,s)=>(s>0?"-":"")+t.toLowerCase()):""}const he=(e,t)=>{if(typeof e!="string")return{result:e};if(!t)return{result:e};const s=[];return Object.values(t).forEach(n=>{const{pattern:i,transform:o}=n;e=e.replace(i,l=>{const{value:d,css:c}=o(l);return c&&s.push(c),d})}),{result:e,additionalCss:s}},Q=e=>typeof e!="string"?{result:e}:/\{[^{}]+\}/g.test(e)?{result:e.replace(/\{([^{}]+)\}/g,(...n)=>`var(--${E(n[1].replaceAll(".","-"))})`)}:{result:e},D=(e,t,s)=>{if(!e)return"";const n=[],i=Object.entries(e).reduce((l,[d,c])=>{const r=d.trim();if(typeof c=="function"&&(c=c()),typeof c=="object"){if(!c)return l;if(r==="variants")return Object.entries(c).forEach(([f,g])=>{g&&Object.entries(g).forEach(([N,b])=>{if(!b)return;const T=`${t}.${f}-${N}`,k=D(b,T);n.push(k)})}),l;if(r==="defaultVariants")return l;if(r==="compoundVariants")return c.forEach(f=>{const{css:g,...N}=f,b=Object.entries(N).reduce((k,[p,m])=>`${k}.${p}-${m}`,t),T=D(g,b);n.push(T)}),l;if(r.startsWith("@")){const f=D(c,t),g=`${r} {
|
2
|
+
${f.replace(`
|
3
3
|
`,`
|
4
4
|
`)}
|
5
|
-
}`;return n.push(
|
5
|
+
}`;return n.push(g),l}const y=d.includes("&")?r.replace("&",t):r.startsWith(":")?`${t}${r}`:`${t} ${r}`,w=D(c,y);return n.push(w),l}const h=r.startsWith("-")?r:E(r),F=(y,w=";")=>l=`${l}${y}${w}`,j=y=>F(`${h}:${y}`);if(typeof c=="number")return j(c);if(typeof c!="string")if("toString"in c)c=c.toString();else return l;const{modifiers:S}={},_=function*(){yield Q(c),yield he(c,S)}();for(const{result:y,additionalCss:w=[]}of _)c=y,w.forEach(f=>{const g=D(f,"");F(g,"")});return j(c)},"");return i?t?[`${t} { ${i} }`,...n].join(`
|
6
6
|
`):i:n.join(`
|
7
|
-
`)},
|
8
|
-
`)},
|
7
|
+
`)},v=(e,t=[])=>{if(!e)return"";const s=[],n={};if(Object.entries(e).forEach(([i,o])=>{if(typeof o=="object"){if(!o)return;const l=i.trim(),d=v(o,[...t,l]);s.push(d)}else n[i]=o}),Object.keys(n).length){const i=t.map(E).join("-"),o=D(n,`.${i}`);s.push(o)}return s.join(`
|
8
|
+
`)},Se=e=>Object.entries(e).reduce((t,[s,n])=>(typeof n=="object"&&(t[s]=ee(n).map(i=>`"${i}"`).join(" | ")),t),{}),ee=(e,t="",s=new Set)=>e?(Object.entries(e).forEach(([n,i])=>{const o=t?`${t}.${n}`:n;return typeof i=="object"?ee(i,o,s):s.add(t)}),[...s]):[],te=e=>{if(!e||e==="/")throw new Error("Could not find package.json file");const t=a.join(e,"package.json");return u.existsSync(t)?t:te(a.join(e,".."))},$e=async e=>{const t=te(e);return await X.readFile(t,"utf-8").then(JSON.parse).catch(()=>{})},be=async e=>{const t=await $e(e);if(t)return t.type};let R;const se=async e=>{if(R)return R;const t=await be(e);return t==="module"?R="esm":(t==="commonjs"||(typeof document>"u"?require("url").pathToFileURL(__filename).href:Z&&Z.tagName.toUpperCase()==="SCRIPT"&&Z.src||new URL("index.cjs",document.baseURI).href).endsWith(".cjs"))&&(R="cjs"),R||"esm"},I=J.createLogger({level:"debug",format:J.format.combine(J.format.colorize(),J.format.cli()),transports:[new J.transports.Console({})]});function ne(e){return e?typeof e!="string"?ne(String(e)):e.replace(/[\s-]/g,".").replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g,(t,s)=>(s>0?".":"")+t.toLowerCase()):""}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"}},q={externalModules:[]},oe=e=>{if(q.externalModules.length>0)return q.externalModules;const t=a.join(e,"salty.config.ts"),n=u.readFileSync(t,"utf8").match(/externalModules:\s?\[(.*)\]/);if(!n)return[];const i=n[1].split(",").map(o=>o.replace(/['"`]/g,"").trim());return q.externalModules=i,i},z=e=>a.join(e,"./saltygen"),re=["salty","css","styles","styled"],we=(e=[])=>new RegExp(`\\.(${[...re,...e].join("|")})\\.`),W=(e,t=[])=>we(t).test(e),Fe=async e=>{const t=z(e),s=a.join(e,"salty.config.ts"),n=a.join(t,"salty.config.js"),i=await se(e),o=oe(e);await Y.build({entryPoints:[s],minify:!0,treeShaking:!0,bundle:!0,outfile:n,format:i,external:o});const l=Date.now(),{config:d}=await import(`${n}?t=${l}`);return d},xe=async e=>{const t=await Fe(e),s=new Set,n=(p,m=[])=>p?Object.entries(p).flatMap(([C,$])=>{if(!$)return;if(typeof $=="object")return n($,[...m,C]);const M=ne(C),A=E(C),V=[...m,M].join(".");s.add(`"${V}"`);const P=[...m.map(E),A].join("-"),{result:O}=Q($);return`--${P}: ${O};`}):[],i=p=>p?Object.entries(p).flatMap(([m,C])=>{const $=n(C);return m==="base"?$.join(""):`${m} { ${$.join("")} }`}):[],o=p=>p?Object.entries(p).flatMap(([m,C])=>Object.entries(C).flatMap(([$,M])=>{const A=n(M,[m]),V=`.${m}-${$}, [data-${m}="${$}"]`,P=A.join("");return`${V} { ${P} }`})):[],l=n(t.variables),d=i(t.responsiveVariables),c=o(t.conditionalVariables),r=z(e),h=a.join(r,"css/_variables.css"),F=`:root { ${l.join("")} ${d.join("")} } ${c.join("")}`;u.writeFileSync(h,F);const j=a.join(r,"css/_global.css"),S=D(t.global,"");u.writeFileSync(j,`@layer global { ${S} }`);const x=a.join(r,"css/_reset.css"),y=t.reset==="none"?{}:typeof t.reset=="object"?t.reset:je,w=D(y,"");u.writeFileSync(x,`@layer reset { ${w} }`);const f=a.join(r,"css/_templates.css"),g=v(t.templates),N=Se(t.templates);u.writeFileSync(f,g);const b=a.join(r,"types/css-tokens.d.ts"),k=`
|
9
9
|
// Variable types
|
10
10
|
type VariableTokens = ${[...s].join("|")};
|
11
11
|
type PropertyValueToken = \`{\${VariableTokens}}\`;
|
12
12
|
|
13
13
|
// Template types
|
14
14
|
type TemplateTokens = {
|
15
|
-
${Object.entries(
|
15
|
+
${Object.entries(N).map(([p,m])=>`${p}?: ${m}`).join(`
|
16
16
|
`)}
|
17
17
|
}
|
18
|
-
`;u.writeFileSync(
|
19
|
-
`),C=
|
20
|
-
`);let
|
18
|
+
`;u.writeFileSync(b,k)},G=e=>e.replace(/styled\(([^"'`{,]+),/g,(t,s)=>{const n=/^['"`]/.test(s);if(n&&console.log("String tag",s),n)return t;const i=new RegExp(`import[^;]*${s}[,\\s{][^;]*from\\s?([^{};]+);`),o=i.test(e);if(o||console.log("Not imported",s),!o)return t;const l=i.exec(e);if(l){const d=l.at(1),c=re.some(r=>d==null?void 0:d.includes(r));if(c&&console.log("Salty import for",s,`"${l.at(0)}"`),c)return t}return console.log("Replacing",s),"styled('div',"}),H=async(e,t,s)=>{console.log({sourceFilePath:t});const n=L(t),i=a.join(s,"./temp");u.existsSync(i)||u.mkdirSync(i);const o=a.parse(t);let l=u.readFileSync(t,"utf8");l=G(l);const d=a.join(s,"js",n+".js"),c=oe(e),r=await se(e);await Y.build({stdin:{contents:l,sourcefile:o.base,resolveDir:o.dir,loader:"tsx"},minify:!1,treeShaking:!0,bundle:!0,outfile:d,format:r,target:["node20"],keepNames:!0,external:c,packages:"external",plugins:[{name:"test",setup:j=>{j.onLoad({filter:/.*.css.ts/},S=>{console.log("Loading",{sourceFilePath:t,args:S});const x=u.readFileSync(S.path,"utf8");return{contents:G(x)}})}}]});const h=Date.now();return await import(`${d}?t=${h}`)},B=async e=>{const t=z(e),s=a.join(t,"salty.config.js"),n=Date.now(),{config:i}=await import(`${s}?t=${n}`);return i},ie=()=>{try{return process.env.NODE_ENV==="production"}catch{return!1}},Ce=async(e,t=ie())=>{try{const s=Date.now();t?I.info("Generating CSS in production mode! 🔥"):I.info("Generating CSS in development mode! 🚀");const n=[],i=[],o=z(e),l=a.join(o,"index.css");(()=>{u.existsSync(o)&&de.execSync("rm -rf "+o),u.mkdirSync(o),u.mkdirSync(a.join(o,"css")),u.mkdirSync(a.join(o,"types"))})(),await xe(e);const c=await B(e);async function r(f,g){const N=["node_modules","saltygen"],b=u.statSync(f);if(b.isDirectory()){const T=u.readdirSync(f);if(N.some(p=>f.includes(p)))return;await Promise.all(T.map(p=>r(a.join(f,p),a.join(g,p))))}else if(b.isFile()&&W(f)){const k=await H(e,f,o),p=[];Object.entries(k).forEach(([V,P])=>{if(P.isKeyframes&&P.css){const K=`a_${P.animationName}.css`,fe=`css/${K}`,ue=a.join(o,fe);n.push(K),u.writeFileSync(ue,P.css);return}if(!P.generator)return;const O=P.generator._withBuildContext({name:V,config:c,prod:t});i[O.priority]||(i[O.priority]=[]),i[O.priority].push(O.cssFileName),p.push(O.cssFileName);const ae=`css/${O.cssFileName}`,le=a.join(o,ae);u.writeFileSync(le,O.css)});const m=p.map(V=>`@import url('./${V}');`).join(`
|
19
|
+
`),C=L(f,6),$=a.parse(f),M=E($.name),A=a.join(o,`css/f_${M}-${C}.css`);u.writeFileSync(A,m)}}await r(e,o);const h=n.map(f=>`@import url('./css/${f}');`).join(`
|
20
|
+
`);let x=`@layer reset, global, l0, l1, l2, l3, l4, l5, l6, l7, l8;
|
21
21
|
|
22
|
-
${["_variables.css","_reset.css","_global.css","_templates.css"].filter(
|
22
|
+
${["_variables.css","_reset.css","_global.css","_templates.css"].filter(f=>{try{return u.readFileSync(a.join(o,"css",f),"utf8").length>0}catch{return!1}}).map(f=>`@import url('./css/${f}');`).join(`
|
23
23
|
`)}
|
24
|
-
${
|
25
|
-
${M}`},""),
|
26
|
-
@import url('./css/${
|
27
|
-
`),r=s.map(j=>`@import url('../saltygen/css/${j}');`),F=[...new Set([...
|
28
|
-
`);u.writeFileSync(i,F)}}catch(s){console.error(s)}},
|
29
|
-
${r}`}return r=r.replace("{ styled }","{ styledClient as styled }"),r=r.replace("@salty-css/react/styled","@salty-css/react/styled-client"),r}}catch(n){console.error("Error in minimizeFile:",n)}},
|
24
|
+
${h}`;if(c.importStrategy!=="component"){const f=i.reduce((g,N,b)=>{const T=N.reduce((C,$)=>{const M=u.readFileSync(a.join(o,"css",$),"utf8");return`${C}
|
25
|
+
${M}`},""),k=`l_${b}.css`,p=a.join(o,"css",k),m=`@layer l${b} { ${T} }`;return u.writeFileSync(p,m),`${g}
|
26
|
+
@import url('./css/${k}');`},"");x+=f}u.writeFileSync(l,x);const y=Date.now()-s,w=y<200?"🔥":y<500?"🚀":y<1e3?"🎉":y<2e3?"🚗":y<5e3?"🤔":"🥴";I.info(`Generated CSS in ${y}ms! ${w}`)}catch(s){console.error(s)}},ke=async(e,t)=>{try{const s=[],n=a.join(e,"./saltygen"),i=a.join(n,"index.css");if(W(t)){const l=await B(e),d=await H(e,t,n);Object.entries(d).forEach(([j,S])=>{if(S.isKeyframes&&S.css){const f=`css/${`a_${S.animationName}.css`}`,g=a.join(n,f);u.writeFileSync(g,S.css);return}if(!S.generator)return;const x=S.generator._withBuildContext({name:j,config:l}),_=`css/${x.cssFileName}`,y=a.join(n,_);s.push(x.cssFileName),u.writeFileSync(y,x.css)});const c=u.readFileSync(i,"utf8").split(`
|
27
|
+
`),r=s.map(j=>`@import url('../saltygen/css/${j}');`),F=[...new Set([...c,...r])].join(`
|
28
|
+
`);u.writeFileSync(i,F)}}catch(s){console.error(s)}},Ne=async(e,t,s=ie())=>{try{const n=a.join(e,"./saltygen");if(W(t)){const o=u.readFileSync(t,"utf8");o.replace(/^(?!export\s)const\s.*/gm,h=>`export ${h}`)!==o&&await X.writeFile(t,o);const d=await B(e),c=await H(e,t,n);let r=o;if(Object.entries(c).forEach(([h,F])=>{var C;if(F.isKeyframes||!F.generator)return;const j=F.generator._withBuildContext({name:h,config:d,prod:s}),S=new RegExp(`\\s${h}[=\\s]+[^()]+styled\\(([^,]+),`,"g").exec(o);if(!S)return console.error("Could not find the original declaration");const x=(C=S.at(1))==null?void 0:C.trim(),_=new RegExp(`\\s${h}[=\\s]+styled\\(`,"g").exec(r);if(!_)return console.error("Could not find the original declaration");const{index:y}=_;let w=!1;const f=setTimeout(()=>w=!0,5e3);let g=0,N=!1,b=0;for(;!N&&!w;){const $=r[y+g];$==="("&&b++,$===")"&&b--,b===0&&$===")"&&(N=!0),g>r.length&&(w=!0),g++}if(!w)clearTimeout(f);else throw new Error("Failed to find the end of the styled call and timed out");const T=y+g,k=r.slice(y,T),p=r,m=` ${h} = styled(${x}, "${j.classNames}", ${JSON.stringify(j.props)});`;r=r.replace(k,m),p===r&&console.error("Minimize file failed to change content",{name:h,tagName:x})}),d.importStrategy==="component"){const h=L(t,6),F=a.parse(t);r=`import '../../saltygen/css/${`f_${E(F.name)}-${h}.css`}';
|
29
|
+
${r}`}return r=r.replace("{ styled }","{ styledClient as styled }"),r=r.replace("@salty-css/react/styled","@salty-css/react/styled-client"),r}}catch(n){console.error("Error in minimizeFile:",n)}},ce=e=>({name:"stylegen",buildStart:()=>Ce(e),load:async t=>{if(W(t))return await Ne(e,t)},handleHotUpdate:async({file:t,server:s})=>{t.includes("salty.config")&&await s.restart()},watchChange:{handler:async t=>{W(t)&&await ke(e,t)}}});exports.default=ce;exports.saltyPlugin=ce;
|
package/index.js
CHANGED
@@ -1,93 +1,93 @@
|
|
1
|
-
import * as
|
2
|
-
import { execSync as
|
3
|
-
import { join as
|
4
|
-
import { existsSync as
|
5
|
-
import { readFile as
|
6
|
-
import { createLogger as
|
7
|
-
const Y = (t) => String.fromCharCode(t + (t > 25 ? 39 : 97)),
|
1
|
+
import * as v from "esbuild";
|
2
|
+
import { execSync as dt } from "child_process";
|
3
|
+
import { join as f, parse as B } from "path";
|
4
|
+
import { existsSync as K, mkdirSync as z, statSync as gt, readdirSync as yt, writeFileSync as k, readFileSync as A } from "fs";
|
5
|
+
import { readFile as mt, writeFile as ht } from "fs/promises";
|
6
|
+
import { createLogger as $t, format as H, transports as bt } from "winston";
|
7
|
+
const Y = (t) => String.fromCharCode(t + (t > 25 ? 39 : 97)), St = (t, e) => {
|
8
8
|
let s = "", n;
|
9
9
|
for (n = Math.abs(t); n > 52; n = n / 52 | 0) s = Y(n % 52) + s;
|
10
10
|
return s = Y(n % 52) + s, s.length < e ? s = s.padStart(e, "a") : s.length > e && (s = s.slice(-e)), s;
|
11
|
-
},
|
11
|
+
}, wt = (t, e) => {
|
12
12
|
let s = e.length;
|
13
13
|
for (; s; ) t = t * 33 ^ e.charCodeAt(--s);
|
14
14
|
return t;
|
15
|
-
},
|
16
|
-
const s =
|
17
|
-
return
|
15
|
+
}, G = (t, e = 5) => {
|
16
|
+
const s = wt(5381, JSON.stringify(t)) >>> 0;
|
17
|
+
return St(s, e);
|
18
18
|
};
|
19
19
|
function V(t) {
|
20
20
|
return t ? typeof t != "string" ? V(String(t)) : t.replace(/[\s.]/g, "-").replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g, (e, s) => (s > 0 ? "-" : "") + e.toLowerCase()) : "";
|
21
21
|
}
|
22
|
-
const
|
22
|
+
const jt = (t, e) => {
|
23
23
|
if (typeof t != "string") return { result: t };
|
24
24
|
if (!e) return { result: t };
|
25
25
|
const s = [];
|
26
26
|
return Object.values(e).forEach((n) => {
|
27
27
|
const { pattern: i, transform: o } = n;
|
28
|
-
t = t.replace(i, (
|
29
|
-
const { value:
|
30
|
-
return
|
28
|
+
t = t.replace(i, (a) => {
|
29
|
+
const { value: u, css: c } = o(a);
|
30
|
+
return c && s.push(c), u;
|
31
31
|
});
|
32
32
|
}), { result: t, additionalCss: s };
|
33
|
-
},
|
33
|
+
}, tt = (t) => typeof t != "string" ? { result: t } : /\{[^{}]+\}/g.test(t) ? { result: t.replace(/\{([^{}]+)\}/g, (...n) => `var(--${V(n[1].replaceAll(".", "-"))})`) } : { result: t }, O = (t, e, s) => {
|
34
34
|
if (!t) return "";
|
35
|
-
const n = [], i = Object.entries(t).reduce((
|
36
|
-
const r =
|
37
|
-
if (typeof
|
38
|
-
if (!
|
35
|
+
const n = [], i = Object.entries(t).reduce((a, [u, c]) => {
|
36
|
+
const r = u.trim();
|
37
|
+
if (typeof c == "function" && (c = c()), typeof c == "object") {
|
38
|
+
if (!c) return a;
|
39
39
|
if (r === "variants")
|
40
|
-
return Object.entries(
|
41
|
-
|
42
|
-
if (!
|
43
|
-
const T = `${e}.${
|
44
|
-
n.push(
|
40
|
+
return Object.entries(c).forEach(([l, g]) => {
|
41
|
+
g && Object.entries(g).forEach(([N, b]) => {
|
42
|
+
if (!b) return;
|
43
|
+
const T = `${e}.${l}-${N}`, F = O(b, T);
|
44
|
+
n.push(F);
|
45
45
|
});
|
46
|
-
}),
|
46
|
+
}), a;
|
47
47
|
if (r === "defaultVariants")
|
48
|
-
return
|
48
|
+
return a;
|
49
49
|
if (r === "compoundVariants")
|
50
|
-
return
|
51
|
-
const { css:
|
50
|
+
return c.forEach((l) => {
|
51
|
+
const { css: g, ...N } = l, b = Object.entries(N).reduce((F, [p, y]) => `${F}.${p}-${y}`, e), T = O(g, b);
|
52
52
|
n.push(T);
|
53
|
-
}),
|
53
|
+
}), a;
|
54
54
|
if (r.startsWith("@")) {
|
55
|
-
const
|
56
|
-
${
|
55
|
+
const l = O(c, e), g = `${r} {
|
56
|
+
${l.replace(`
|
57
57
|
`, `
|
58
58
|
`)}
|
59
59
|
}`;
|
60
|
-
return n.push(
|
60
|
+
return n.push(g), a;
|
61
61
|
}
|
62
|
-
const
|
63
|
-
return n.push(
|
62
|
+
const d = u.includes("&") ? r.replace("&", e) : r.startsWith(":") ? `${e}${r}` : `${e} ${r}`, w = O(c, d);
|
63
|
+
return n.push(w), a;
|
64
64
|
}
|
65
|
-
const
|
66
|
-
if (typeof
|
67
|
-
if (typeof
|
68
|
-
if ("toString" in
|
69
|
-
else return
|
70
|
-
const { modifiers:
|
71
|
-
yield
|
65
|
+
const m = r.startsWith("-") ? r : V(r), j = (d, w = ";") => a = `${a}${d}${w}`, S = (d) => j(`${m}:${d}`);
|
66
|
+
if (typeof c == "number") return S(c);
|
67
|
+
if (typeof c != "string")
|
68
|
+
if ("toString" in c) c = c.toString();
|
69
|
+
else return a;
|
70
|
+
const { modifiers: h } = {}, D = function* () {
|
71
|
+
yield tt(c), yield jt(c, h);
|
72
72
|
}();
|
73
|
-
for (const { result:
|
74
|
-
|
75
|
-
const
|
76
|
-
j(
|
73
|
+
for (const { result: d, additionalCss: w = [] } of D)
|
74
|
+
c = d, w.forEach((l) => {
|
75
|
+
const g = O(l, "");
|
76
|
+
j(g, "");
|
77
77
|
});
|
78
|
-
return S(
|
78
|
+
return S(c);
|
79
79
|
}, "");
|
80
80
|
return i ? e ? [`${e} { ${i} }`, ...n].join(`
|
81
81
|
`) : i : n.join(`
|
82
82
|
`);
|
83
|
-
},
|
83
|
+
}, et = (t, e = []) => {
|
84
84
|
if (!t) return "";
|
85
85
|
const s = [], n = {};
|
86
86
|
if (Object.entries(t).forEach(([i, o]) => {
|
87
87
|
if (typeof o == "object") {
|
88
88
|
if (!o) return;
|
89
|
-
const
|
90
|
-
s.push(
|
89
|
+
const a = i.trim(), u = et(o, [...e, a]);
|
90
|
+
s.push(u);
|
91
91
|
} else
|
92
92
|
n[i] = o;
|
93
93
|
}), Object.keys(n).length) {
|
@@ -96,36 +96,36 @@ const wt = (t, e) => {
|
|
96
96
|
}
|
97
97
|
return s.join(`
|
98
98
|
`);
|
99
|
-
},
|
99
|
+
}, xt = (t) => Object.entries(t).reduce((e, [s, n]) => (typeof n == "object" && (e[s] = st(n).map((i) => `"${i}"`).join(" | ")), e), {}), st = (t, e = "", s = /* @__PURE__ */ new Set()) => t ? (Object.entries(t).forEach(([n, i]) => {
|
100
100
|
const o = e ? `${e}.${n}` : n;
|
101
|
-
return typeof i == "object" ?
|
102
|
-
}), [...s]) : [],
|
101
|
+
return typeof i == "object" ? st(i, o, s) : s.add(e);
|
102
|
+
}), [...s]) : [], nt = (t) => {
|
103
103
|
if (!t || t === "/") throw new Error("Could not find package.json file");
|
104
|
-
const e =
|
105
|
-
return
|
106
|
-
},
|
107
|
-
const e =
|
108
|
-
return await
|
104
|
+
const e = f(t, "package.json");
|
105
|
+
return K(e) ? e : nt(f(t, ".."));
|
106
|
+
}, Ct = async (t) => {
|
107
|
+
const e = nt(t);
|
108
|
+
return await mt(e, "utf-8").then(JSON.parse).catch(() => {
|
109
109
|
});
|
110
|
-
},
|
111
|
-
const e = await
|
110
|
+
}, Ft = async (t) => {
|
111
|
+
const e = await Ct(t);
|
112
112
|
if (e)
|
113
113
|
return e.type;
|
114
114
|
};
|
115
|
-
let
|
116
|
-
const
|
117
|
-
if (
|
118
|
-
const e = await
|
119
|
-
return e === "module" ?
|
120
|
-
}, I =
|
115
|
+
let R;
|
116
|
+
const ot = async (t) => {
|
117
|
+
if (R) return R;
|
118
|
+
const e = await Ft(t);
|
119
|
+
return e === "module" ? R = "esm" : (e === "commonjs" || import.meta.url.endsWith(".cjs")) && (R = "cjs"), R || "esm";
|
120
|
+
}, I = $t({
|
121
121
|
level: "debug",
|
122
122
|
format: H.combine(H.colorize(), H.cli()),
|
123
|
-
transports: [new
|
123
|
+
transports: [new bt.Console({})]
|
124
124
|
});
|
125
|
-
function
|
126
|
-
return t ? typeof t != "string" ?
|
125
|
+
function rt(t) {
|
126
|
+
return t ? typeof t != "string" ? rt(String(t)) : t.replace(/[\s-]/g, ".").replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g, (e, s) => (s > 0 ? "." : "") + e.toLowerCase()) : "";
|
127
127
|
}
|
128
|
-
const
|
128
|
+
const kt = {
|
129
129
|
/** Set box model to border-box */
|
130
130
|
"*, *::before, *::after": {
|
131
131
|
boxSizing: "border-box"
|
@@ -171,17 +171,17 @@ const Ct = {
|
|
171
171
|
fontSize: "100%",
|
172
172
|
lineHeight: "1.15em"
|
173
173
|
}
|
174
|
-
},
|
174
|
+
}, L = {
|
175
175
|
externalModules: []
|
176
|
-
},
|
177
|
-
if (
|
178
|
-
const e =
|
176
|
+
}, it = (t) => {
|
177
|
+
if (L.externalModules.length > 0) return L.externalModules;
|
178
|
+
const e = f(t, "salty.config.ts"), n = A(e, "utf8").match(/externalModules:\s?\[(.*)\]/);
|
179
179
|
if (!n) return [];
|
180
180
|
const i = n[1].split(",").map((o) => o.replace(/['"`]/g, "").trim());
|
181
|
-
return
|
182
|
-
}, Z = (t) =>
|
183
|
-
const e = Z(t), s =
|
184
|
-
await
|
181
|
+
return L.externalModules = i, i;
|
182
|
+
}, Z = (t) => f(t, "./saltygen"), ct = ["salty", "css", "styles", "styled"], Nt = (t = []) => new RegExp(`\\.(${[...ct, ...t].join("|")})\\.`), W = (t, e = []) => Nt(e).test(t), Tt = async (t) => {
|
183
|
+
const e = Z(t), s = f(t, "salty.config.ts"), n = f(e, "salty.config.js"), i = await ot(t), o = it(t);
|
184
|
+
await v.build({
|
185
185
|
entryPoints: [s],
|
186
186
|
minify: !0,
|
187
187
|
treeShaking: !0,
|
@@ -190,62 +190,64 @@ const Ct = {
|
|
190
190
|
format: i,
|
191
191
|
external: o
|
192
192
|
});
|
193
|
-
const
|
194
|
-
return
|
193
|
+
const a = Date.now(), { config: u } = await import(`${n}?t=${a}`);
|
194
|
+
return u;
|
195
195
|
}, Pt = async (t) => {
|
196
|
-
const e = await
|
197
|
-
if (
|
198
|
-
if (typeof
|
199
|
-
const M =
|
196
|
+
const e = await Tt(t), s = /* @__PURE__ */ new Set(), n = (p, y = []) => p ? Object.entries(p).flatMap(([C, $]) => {
|
197
|
+
if (!$) return;
|
198
|
+
if (typeof $ == "object") return n($, [...y, C]);
|
199
|
+
const M = rt(C), J = V(C), _ = [...y, M].join(".");
|
200
200
|
s.add(`"${_}"`);
|
201
|
-
const
|
202
|
-
return `--${
|
203
|
-
}) : [], i = (
|
204
|
-
const
|
205
|
-
return y === "base" ?
|
206
|
-
}) : [], o = (
|
207
|
-
const J = n(M, [y]), _ = `.${y}-${
|
208
|
-
return `${_} { ${
|
209
|
-
})) : [],
|
210
|
-
|
211
|
-
const S =
|
212
|
-
|
213
|
-
const
|
214
|
-
|
215
|
-
const
|
216
|
-
|
217
|
-
const
|
201
|
+
const P = [...y.map(V), J].join("-"), { result: E } = tt($);
|
202
|
+
return `--${P}: ${E};`;
|
203
|
+
}) : [], i = (p) => p ? Object.entries(p).flatMap(([y, C]) => {
|
204
|
+
const $ = n(C);
|
205
|
+
return y === "base" ? $.join("") : `${y} { ${$.join("")} }`;
|
206
|
+
}) : [], o = (p) => p ? Object.entries(p).flatMap(([y, C]) => Object.entries(C).flatMap(([$, M]) => {
|
207
|
+
const J = n(M, [y]), _ = `.${y}-${$}, [data-${y}="${$}"]`, P = J.join("");
|
208
|
+
return `${_} { ${P} }`;
|
209
|
+
})) : [], a = n(e.variables), u = i(e.responsiveVariables), c = o(e.conditionalVariables), r = Z(t), m = f(r, "css/_variables.css"), j = `:root { ${a.join("")} ${u.join("")} } ${c.join("")}`;
|
210
|
+
k(m, j);
|
211
|
+
const S = f(r, "css/_global.css"), h = O(e.global, "");
|
212
|
+
k(S, `@layer global { ${h} }`);
|
213
|
+
const x = f(r, "css/_reset.css"), d = e.reset === "none" ? {} : typeof e.reset == "object" ? e.reset : kt, w = O(d, "");
|
214
|
+
k(x, `@layer reset { ${w} }`);
|
215
|
+
const l = f(r, "css/_templates.css"), g = et(e.templates), N = xt(e.templates);
|
216
|
+
k(l, g);
|
217
|
+
const b = f(r, "types/css-tokens.d.ts"), F = `
|
218
218
|
// Variable types
|
219
219
|
type VariableTokens = ${[...s].join("|")};
|
220
220
|
type PropertyValueToken = \`{\${VariableTokens}}\`;
|
221
221
|
|
222
222
|
// Template types
|
223
223
|
type TemplateTokens = {
|
224
|
-
${Object.entries(
|
224
|
+
${Object.entries(N).map(([p, y]) => `${p}?: ${y}`).join(`
|
225
225
|
`)}
|
226
226
|
}
|
227
227
|
`;
|
228
|
-
|
229
|
-
},
|
230
|
-
const n =
|
231
|
-
|
232
|
-
const o =
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
const
|
237
|
-
if (
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
228
|
+
k(b, F);
|
229
|
+
}, Q = (t) => t.replace(/styled\(([^"'`{,]+),/g, (e, s) => {
|
230
|
+
const n = /^['"`]/.test(s);
|
231
|
+
if (n && console.log("String tag", s), n) return e;
|
232
|
+
const i = new RegExp(`import[^;]*${s}[,\\s{][^;]*from\\s?([^{};]+);`), o = i.test(t);
|
233
|
+
if (o || console.log("Not imported", s), !o) return e;
|
234
|
+
const a = i.exec(t);
|
235
|
+
if (a) {
|
236
|
+
const u = a.at(1), c = ct.some((r) => u == null ? void 0 : u.includes(r));
|
237
|
+
if (c && console.log("Salty import for", s, `"${a.at(0)}"`), c) return e;
|
238
|
+
}
|
239
|
+
return console.log("Replacing", s), "styled('div',";
|
240
|
+
}), q = async (t, e, s) => {
|
241
|
+
console.log({ sourceFilePath: e });
|
242
|
+
const n = G(e), i = f(s, "./temp");
|
243
|
+
K(i) || z(i);
|
244
|
+
const o = B(e);
|
245
|
+
let a = A(e, "utf8");
|
246
|
+
a = Q(a);
|
247
|
+
const u = f(s, "js", n + ".js"), c = it(t), r = await ot(t);
|
248
|
+
await v.build({
|
247
249
|
stdin: {
|
248
|
-
contents:
|
250
|
+
contents: a,
|
249
251
|
sourcefile: o.base,
|
250
252
|
resolveDir: o.dir,
|
251
253
|
loader: "tsx"
|
@@ -253,154 +255,169 @@ const Ct = {
|
|
253
255
|
minify: !1,
|
254
256
|
treeShaking: !0,
|
255
257
|
bundle: !0,
|
256
|
-
outfile:
|
258
|
+
outfile: u,
|
257
259
|
format: r,
|
258
260
|
target: ["node20"],
|
259
261
|
keepNames: !0,
|
260
|
-
external:
|
261
|
-
packages: "external"
|
262
|
+
external: c,
|
263
|
+
packages: "external",
|
264
|
+
plugins: [
|
265
|
+
{
|
266
|
+
name: "test",
|
267
|
+
setup: (S) => {
|
268
|
+
S.onLoad({ filter: /.*.css.ts/ }, (h) => {
|
269
|
+
console.log("Loading", {
|
270
|
+
sourceFilePath: e,
|
271
|
+
args: h
|
272
|
+
});
|
273
|
+
const x = A(h.path, "utf8");
|
274
|
+
return { contents: Q(x) };
|
275
|
+
});
|
276
|
+
}
|
277
|
+
}
|
278
|
+
]
|
262
279
|
});
|
263
|
-
const
|
264
|
-
return await import(`${
|
280
|
+
const m = Date.now();
|
281
|
+
return await import(`${u}?t=${m}`);
|
265
282
|
}, U = async (t) => {
|
266
|
-
const e = Z(t), s =
|
283
|
+
const e = Z(t), s = f(e, "salty.config.js"), n = Date.now(), { config: i } = await import(`${s}?t=${n}`);
|
267
284
|
return i;
|
268
|
-
},
|
285
|
+
}, at = () => {
|
269
286
|
try {
|
270
287
|
return process.env.NODE_ENV === "production";
|
271
288
|
} catch {
|
272
289
|
return !1;
|
273
290
|
}
|
274
|
-
},
|
291
|
+
}, Dt = async (t, e = at()) => {
|
275
292
|
try {
|
276
293
|
const s = Date.now();
|
277
294
|
e ? I.info("Generating CSS in production mode! 🔥") : I.info("Generating CSS in development mode! 🚀");
|
278
|
-
const n = [], i = [], o = Z(t),
|
295
|
+
const n = [], i = [], o = Z(t), a = f(o, "index.css");
|
279
296
|
(() => {
|
280
|
-
|
297
|
+
K(o) && dt("rm -rf " + o), z(o), z(f(o, "css")), z(f(o, "types"));
|
281
298
|
})(), await Pt(t);
|
282
|
-
const
|
283
|
-
async function r(
|
284
|
-
const
|
285
|
-
if (
|
286
|
-
const T =
|
287
|
-
if (
|
288
|
-
await Promise.all(T.map((
|
289
|
-
} else if (
|
290
|
-
const
|
291
|
-
Object.entries(
|
292
|
-
if (
|
293
|
-
const X = `a_${
|
294
|
-
n.push(X),
|
299
|
+
const c = await U(t);
|
300
|
+
async function r(l, g) {
|
301
|
+
const N = ["node_modules", "saltygen"], b = gt(l);
|
302
|
+
if (b.isDirectory()) {
|
303
|
+
const T = yt(l);
|
304
|
+
if (N.some((p) => l.includes(p))) return;
|
305
|
+
await Promise.all(T.map((p) => r(f(l, p), f(g, p))));
|
306
|
+
} else if (b.isFile() && W(l)) {
|
307
|
+
const F = await q(t, l, o), p = [];
|
308
|
+
Object.entries(F).forEach(([_, P]) => {
|
309
|
+
if (P.isKeyframes && P.css) {
|
310
|
+
const X = `a_${P.animationName}.css`, pt = `css/${X}`, ut = f(o, pt);
|
311
|
+
n.push(X), k(ut, P.css);
|
295
312
|
return;
|
296
313
|
}
|
297
|
-
if (!
|
298
|
-
const E =
|
314
|
+
if (!P.generator) return;
|
315
|
+
const E = P.generator._withBuildContext({
|
299
316
|
name: _,
|
300
|
-
config:
|
317
|
+
config: c,
|
301
318
|
prod: e
|
302
319
|
});
|
303
|
-
i[E.priority] || (i[E.priority] = []), i[E.priority].push(E.cssFileName),
|
304
|
-
const
|
305
|
-
|
320
|
+
i[E.priority] || (i[E.priority] = []), i[E.priority].push(E.cssFileName), p.push(E.cssFileName);
|
321
|
+
const lt = `css/${E.cssFileName}`, ft = f(o, lt);
|
322
|
+
k(ft, E.css);
|
306
323
|
});
|
307
|
-
const y =
|
308
|
-
`),
|
309
|
-
|
324
|
+
const y = p.map((_) => `@import url('./${_}');`).join(`
|
325
|
+
`), C = G(l, 6), $ = B(l), M = V($.name), J = f(o, `css/f_${M}-${C}.css`);
|
326
|
+
k(J, y);
|
310
327
|
}
|
311
328
|
}
|
312
329
|
await r(t, o);
|
313
|
-
const
|
330
|
+
const m = n.map((l) => `@import url('./css/${l}');`).join(`
|
314
331
|
`);
|
315
|
-
let
|
332
|
+
let x = `@layer reset, global, l0, l1, l2, l3, l4, l5, l6, l7, l8;
|
316
333
|
|
317
|
-
${["_variables.css", "_reset.css", "_global.css", "_templates.css"].filter((
|
334
|
+
${["_variables.css", "_reset.css", "_global.css", "_templates.css"].filter((l) => {
|
318
335
|
try {
|
319
|
-
return
|
336
|
+
return A(f(o, "css", l), "utf8").length > 0;
|
320
337
|
} catch {
|
321
338
|
return !1;
|
322
339
|
}
|
323
|
-
}).map((
|
340
|
+
}).map((l) => `@import url('./css/${l}');`).join(`
|
324
341
|
`)}
|
325
|
-
${
|
326
|
-
if (
|
327
|
-
const
|
328
|
-
const T =
|
329
|
-
const M =
|
330
|
-
return `${
|
342
|
+
${m}`;
|
343
|
+
if (c.importStrategy !== "component") {
|
344
|
+
const l = i.reduce((g, N, b) => {
|
345
|
+
const T = N.reduce((C, $) => {
|
346
|
+
const M = A(f(o, "css", $), "utf8");
|
347
|
+
return `${C}
|
331
348
|
${M}`;
|
332
|
-
}, ""),
|
333
|
-
return
|
334
|
-
@import url('./css/${
|
349
|
+
}, ""), F = `l_${b}.css`, p = f(o, "css", F), y = `@layer l${b} { ${T} }`;
|
350
|
+
return k(p, y), `${g}
|
351
|
+
@import url('./css/${F}');`;
|
335
352
|
}, "");
|
336
|
-
|
353
|
+
x += l;
|
337
354
|
}
|
338
|
-
|
339
|
-
const
|
340
|
-
I.info(`Generated CSS in ${
|
355
|
+
k(a, x);
|
356
|
+
const d = Date.now() - s, w = d < 200 ? "🔥" : d < 500 ? "🚀" : d < 1e3 ? "🎉" : d < 2e3 ? "🚗" : d < 5e3 ? "🤔" : "🥴";
|
357
|
+
I.info(`Generated CSS in ${d}ms! ${w}`);
|
341
358
|
} catch (s) {
|
342
359
|
console.error(s);
|
343
360
|
}
|
344
|
-
},
|
361
|
+
}, Et = async (t, e) => {
|
345
362
|
try {
|
346
|
-
const s = [], n =
|
363
|
+
const s = [], n = f(t, "./saltygen"), i = f(n, "index.css");
|
347
364
|
if (W(e)) {
|
348
|
-
const
|
349
|
-
Object.entries(
|
350
|
-
if (
|
351
|
-
const
|
352
|
-
|
365
|
+
const a = await U(t), u = await q(t, e, n);
|
366
|
+
Object.entries(u).forEach(([S, h]) => {
|
367
|
+
if (h.isKeyframes && h.css) {
|
368
|
+
const l = `css/${`a_${h.animationName}.css`}`, g = f(n, l);
|
369
|
+
k(g, h.css);
|
353
370
|
return;
|
354
371
|
}
|
355
|
-
if (!
|
356
|
-
const
|
372
|
+
if (!h.generator) return;
|
373
|
+
const x = h.generator._withBuildContext({
|
357
374
|
name: S,
|
358
|
-
config:
|
359
|
-
}),
|
360
|
-
s.push(
|
375
|
+
config: a
|
376
|
+
}), D = `css/${x.cssFileName}`, d = f(n, D);
|
377
|
+
s.push(x.cssFileName), k(d, x.css);
|
361
378
|
});
|
362
|
-
const
|
363
|
-
`), r = s.map((S) => `@import url('../saltygen/css/${S}');`), j = [.../* @__PURE__ */ new Set([...
|
379
|
+
const c = A(i, "utf8").split(`
|
380
|
+
`), r = s.map((S) => `@import url('../saltygen/css/${S}');`), j = [.../* @__PURE__ */ new Set([...c, ...r])].join(`
|
364
381
|
`);
|
365
|
-
|
382
|
+
k(i, j);
|
366
383
|
}
|
367
384
|
} catch (s) {
|
368
385
|
console.error(s);
|
369
386
|
}
|
370
|
-
},
|
387
|
+
}, Ot = async (t, e, s = at()) => {
|
371
388
|
try {
|
372
|
-
const n =
|
389
|
+
const n = f(t, "./saltygen");
|
373
390
|
if (W(e)) {
|
374
|
-
const o =
|
375
|
-
o.replace(/^(?!export\s)const\s.*/gm, (
|
376
|
-
const
|
391
|
+
const o = A(e, "utf8");
|
392
|
+
o.replace(/^(?!export\s)const\s.*/gm, (m) => `export ${m}`) !== o && await ht(e, o);
|
393
|
+
const u = await U(t), c = await q(t, e, n);
|
377
394
|
let r = o;
|
378
|
-
if (Object.entries(
|
379
|
-
var
|
395
|
+
if (Object.entries(c).forEach(([m, j]) => {
|
396
|
+
var C;
|
380
397
|
if (j.isKeyframes || !j.generator) return;
|
381
398
|
const S = j.generator._withBuildContext({
|
382
|
-
name:
|
383
|
-
config:
|
399
|
+
name: m,
|
400
|
+
config: u,
|
384
401
|
prod: s
|
385
|
-
}),
|
386
|
-
if (!
|
387
|
-
const
|
388
|
-
if (!
|
389
|
-
const { index:
|
390
|
-
let
|
391
|
-
const
|
392
|
-
let
|
393
|
-
for (; !
|
394
|
-
const
|
395
|
-
|
402
|
+
}), h = new RegExp(`\\s${m}[=\\s]+[^()]+styled\\(([^,]+),`, "g").exec(o);
|
403
|
+
if (!h) return console.error("Could not find the original declaration");
|
404
|
+
const x = (C = h.at(1)) == null ? void 0 : C.trim(), D = new RegExp(`\\s${m}[=\\s]+styled\\(`, "g").exec(r);
|
405
|
+
if (!D) return console.error("Could not find the original declaration");
|
406
|
+
const { index: d } = D;
|
407
|
+
let w = !1;
|
408
|
+
const l = setTimeout(() => w = !0, 5e3);
|
409
|
+
let g = 0, N = !1, b = 0;
|
410
|
+
for (; !N && !w; ) {
|
411
|
+
const $ = r[d + g];
|
412
|
+
$ === "(" && b++, $ === ")" && b--, b === 0 && $ === ")" && (N = !0), g > r.length && (w = !0), g++;
|
396
413
|
}
|
397
|
-
if (!
|
414
|
+
if (!w) clearTimeout(l);
|
398
415
|
else throw new Error("Failed to find the end of the styled call and timed out");
|
399
|
-
const T =
|
400
|
-
r = r.replace(
|
401
|
-
}),
|
402
|
-
const
|
403
|
-
r = `import '../../saltygen/css/${`f_${V(j.name)}-${
|
416
|
+
const T = d + g, F = r.slice(d, T), p = r, y = ` ${m} = styled(${x}, "${S.classNames}", ${JSON.stringify(S.props)});`;
|
417
|
+
r = r.replace(F, y), p === r && console.error("Minimize file failed to change content", { name: m, tagName: x });
|
418
|
+
}), u.importStrategy === "component") {
|
419
|
+
const m = G(e, 6), j = B(e);
|
420
|
+
r = `import '../../saltygen/css/${`f_${V(j.name)}-${m}.css`}';
|
404
421
|
${r}`;
|
405
422
|
}
|
406
423
|
return r = r.replace("{ styled }", "{ styledClient as styled }"), r = r.replace("@salty-css/react/styled", "@salty-css/react/styled-client"), r;
|
@@ -408,23 +425,23 @@ ${r}`;
|
|
408
425
|
} catch (n) {
|
409
426
|
console.error("Error in minimizeFile:", n);
|
410
427
|
}
|
411
|
-
},
|
428
|
+
}, Jt = (t) => ({
|
412
429
|
name: "stylegen",
|
413
|
-
buildStart: () =>
|
430
|
+
buildStart: () => Dt(t),
|
414
431
|
load: async (e) => {
|
415
432
|
if (W(e))
|
416
|
-
return await
|
433
|
+
return await Ot(t, e);
|
417
434
|
},
|
418
435
|
handleHotUpdate: async ({ file: e, server: s }) => {
|
419
436
|
e.includes("salty.config") && await s.restart();
|
420
437
|
},
|
421
438
|
watchChange: {
|
422
439
|
handler: async (e) => {
|
423
|
-
W(e) && await
|
440
|
+
W(e) && await Et(t, e);
|
424
441
|
}
|
425
442
|
}
|
426
443
|
});
|
427
444
|
export {
|
428
|
-
|
429
|
-
|
445
|
+
Jt as default,
|
446
|
+
Jt as saltyPlugin
|
430
447
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@salty-css/vite",
|
3
|
-
"version": "0.0.1-alpha.
|
3
|
+
"version": "0.0.1-alpha.140",
|
4
4
|
"main": "./dist/index.js",
|
5
5
|
"module": "./dist/index.mjs",
|
6
6
|
"typings": "./dist/index.d.ts",
|
@@ -34,6 +34,6 @@
|
|
34
34
|
}
|
35
35
|
},
|
36
36
|
"dependencies": {
|
37
|
-
"@salty-css/core": "^0.0.1-alpha.
|
37
|
+
"@salty-css/core": "^0.0.1-alpha.140"
|
38
38
|
}
|
39
39
|
}
|