@salty-css/webpack 0.0.1-alpha.39 → 0.0.1-alpha.40

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.
@@ -127,7 +127,7 @@ const Y = (t, s) => {
127
127
  return `${D} { ${O} }`;
128
128
  })) : [], $ = n(s.variables), a = r(s.responsiveVariables), f = u(s.conditionalVariables), o = k(t), i = p(o, "css/variables.css"), y = `:root { ${$.join("")} ${a.join("")} } ${f.join("")}`;
129
129
  x(i, y);
130
- const h = p(o, "types/css-tokens.d.ts"), j = `type VariableTokens = ${[...e].join("|")}; type PropertyValueToken = \`{\${VariableTokens}}\``;
130
+ const h = p(o, "types/css-tokens.d.ts"), j = `type VariableTokens = ${[...e].join("|") || '""'}; type PropertyValueToken = \`{\${VariableTokens}}\``;
131
131
  x(h, j);
132
132
  const S = p(o, "css/global.css"), F = N(s.global, "");
133
133
  x(S, F);
@@ -5,7 +5,7 @@
5
5
  }`;return r.push(c),a}const j=f.includes("&")?i.replace("&",s):i.startsWith(":")?`${s}${i}`:`${s} ${i}`,O=D(o,j);return r.push(O),a}const y=i.startsWith("-")?i:N(i),h=(j,O=";")=>a=`${a}${j}${O}`,b=j=>h(`${y}:${j}`);if(typeof o=="number")return b(o);if(typeof o!="string")if("toString"in o)o=o.toString();else return a;const{modifiers:S}={},C=function*(){yield q(o),yield U(o,S)}();for(const{result:j,additionalCss:O=[]}of C)o=j,O.forEach(g=>{const c=D(g,"");h(c,"")});return b(o)},"");if(!u)return r.join(`
6
6
  `);if(!s)return u;let d="";return d=`${s} { ${u} }`,[d,...r].join(`
7
7
  `)},Z=(t,s=[])=>{if(!t)return"";const e=[],n={};if(Object.entries(t).forEach(([r,u])=>{if(typeof u=="object"){if(!u)return;const d=r.trim(),a=Z(u,[...s,d]);e.push(a)}else n[r]=u}),Object.keys(n).length){const r=s.map(N).join("-"),u=D(n,`.${r}`);e.push(u)}return e.join(`
8
- `)},E=t=>p.join(t,"./saltygen"),X=["salty","css","styles","styled"],z=(t=[])=>new RegExp(`\\.(${[...X,...t].join("|")})\\.`),T=(t,s=[])=>z(s).test(t),Y=async t=>{const s=E(t),e=p.join(t,"salty.config.ts"),n=p.join(s,"salty.config.js");await M.build({entryPoints:[e],minify:!0,treeShaking:!0,bundle:!0,outfile:n,format:"esm",external:["react"]});const r=Date.now(),{config:u}=await import(`${n}?t=${r}`);return u},Q=async t=>{const s=await Y(t),e=new Set,n=(g,c=[])=>g?Object.entries(g).flatMap(([m,l])=>{if(!l)return;if(typeof l=="object")return n(l,[...c,m]);const F=[...c,m].join(".");e.add(`"${F}"`);const x=[...c.map(N),N(m)].join("-"),{result:P}=q(l);return`--${x}: ${P};`}):[],r=g=>g?Object.entries(g).flatMap(([c,m])=>{const l=n(m);return c==="base"?l.join(""):`${c} { ${l.join("")} }`}):[],u=g=>g?Object.entries(g).flatMap(([c,m])=>Object.entries(m).flatMap(([l,F])=>{const x=n(F,[c]),P=`.${c}-${l}, [data-${c}="${l}"]`,k=x.join("");return`${P} { ${k} }`})):[],d=n(s.variables),a=r(s.responsiveVariables),f=u(s.conditionalVariables),o=E(t),i=p.join(o,"css/variables.css"),y=`:root { ${d.join("")} ${a.join("")} } ${f.join("")}`;$.writeFileSync(i,y);const h=p.join(o,"types/css-tokens.d.ts"),S=`type VariableTokens = ${[...e].join("|")}; type PropertyValueToken = \`{\${VariableTokens}}\``;$.writeFileSync(h,S);const w=p.join(o,"css/global.css"),C=D(s.global,"");$.writeFileSync(w,C);const j=p.join(o,"css/templates.css"),O=Z(s.templates);$.writeFileSync(j,O)},_=async(t,s)=>{const e=V(t),n=p.join(s,"js",e+".js");await M.build({entryPoints:[t],minify:!0,treeShaking:!0,bundle:!0,outfile:n,format:"esm",target:["es2022"],keepNames:!0,external:["react"]});const r=Date.now();return await import(`${n}?t=${r}`)},A=async t=>{const s=E(t),e=p.join(s,"salty.config.js"),{config:n}=await import(e);return n},v=async t=>{try{const s=[],e=[],n=E(t),r=p.join(n,"index.css");(()=>{$.existsSync(n)&&W.execSync("rm -rf "+n),$.mkdirSync(n),$.mkdirSync(p.join(n,"css")),$.mkdirSync(p.join(n,"types"))})(),await Q(t);const d=await A(t);async function a(y,h){const b=$.statSync(y);if(b.isDirectory()){const S=$.readdirSync(y);await Promise.all(S.map(w=>a(p.join(y,w),p.join(h,w))))}else if(b.isFile()&&T(y)){const w=await _(y,n),C=[];Object.entries(w).forEach(([c,m])=>{if(m.isKeyframes&&m.css){const k=`${m.animationName}.css`,I=`css/${k}`,B=p.join(n,I);s.push(k),$.writeFileSync(B,m.css);return}if(!m.generator)return;const l=m.generator._withBuildContext({name:c,config:d}),F=`${l.hash}-${l.priority}.css`;e[l.priority]||(e[l.priority]=[]),e[l.priority].push(F),C.push(F);const x=`css/${F}`,P=p.join(n,x);$.writeFileSync(P,l.css)});const j=C.map(c=>`@import url('./${c}');`).join(`
8
+ `)},E=t=>p.join(t,"./saltygen"),X=["salty","css","styles","styled"],z=(t=[])=>new RegExp(`\\.(${[...X,...t].join("|")})\\.`),T=(t,s=[])=>z(s).test(t),Y=async t=>{const s=E(t),e=p.join(t,"salty.config.ts"),n=p.join(s,"salty.config.js");await M.build({entryPoints:[e],minify:!0,treeShaking:!0,bundle:!0,outfile:n,format:"esm",external:["react"]});const r=Date.now(),{config:u}=await import(`${n}?t=${r}`);return u},Q=async t=>{const s=await Y(t),e=new Set,n=(g,c=[])=>g?Object.entries(g).flatMap(([m,l])=>{if(!l)return;if(typeof l=="object")return n(l,[...c,m]);const F=[...c,m].join(".");e.add(`"${F}"`);const x=[...c.map(N),N(m)].join("-"),{result:P}=q(l);return`--${x}: ${P};`}):[],r=g=>g?Object.entries(g).flatMap(([c,m])=>{const l=n(m);return c==="base"?l.join(""):`${c} { ${l.join("")} }`}):[],u=g=>g?Object.entries(g).flatMap(([c,m])=>Object.entries(m).flatMap(([l,F])=>{const x=n(F,[c]),P=`.${c}-${l}, [data-${c}="${l}"]`,k=x.join("");return`${P} { ${k} }`})):[],d=n(s.variables),a=r(s.responsiveVariables),f=u(s.conditionalVariables),o=E(t),i=p.join(o,"css/variables.css"),y=`:root { ${d.join("")} ${a.join("")} } ${f.join("")}`;$.writeFileSync(i,y);const h=p.join(o,"types/css-tokens.d.ts"),S=`type VariableTokens = ${[...e].join("|")||'""'}; type PropertyValueToken = \`{\${VariableTokens}}\``;$.writeFileSync(h,S);const w=p.join(o,"css/global.css"),C=D(s.global,"");$.writeFileSync(w,C);const j=p.join(o,"css/templates.css"),O=Z(s.templates);$.writeFileSync(j,O)},_=async(t,s)=>{const e=V(t),n=p.join(s,"js",e+".js");await M.build({entryPoints:[t],minify:!0,treeShaking:!0,bundle:!0,outfile:n,format:"esm",target:["es2022"],keepNames:!0,external:["react"]});const r=Date.now();return await import(`${n}?t=${r}`)},A=async t=>{const s=E(t),e=p.join(s,"salty.config.js"),{config:n}=await import(e);return n},v=async t=>{try{const s=[],e=[],n=E(t),r=p.join(n,"index.css");(()=>{$.existsSync(n)&&W.execSync("rm -rf "+n),$.mkdirSync(n),$.mkdirSync(p.join(n,"css")),$.mkdirSync(p.join(n,"types"))})(),await Q(t);const d=await A(t);async function a(y,h){const b=$.statSync(y);if(b.isDirectory()){const S=$.readdirSync(y);await Promise.all(S.map(w=>a(p.join(y,w),p.join(h,w))))}else if(b.isFile()&&T(y)){const w=await _(y,n),C=[];Object.entries(w).forEach(([c,m])=>{if(m.isKeyframes&&m.css){const k=`${m.animationName}.css`,I=`css/${k}`,B=p.join(n,I);s.push(k),$.writeFileSync(B,m.css);return}if(!m.generator)return;const l=m.generator._withBuildContext({name:c,config:d}),F=`${l.hash}-${l.priority}.css`;e[l.priority]||(e[l.priority]=[]),e[l.priority].push(F),C.push(F);const x=`css/${F}`,P=p.join(n,x);$.writeFileSync(P,l.css)});const j=C.map(c=>`@import url('./${c}');`).join(`
9
9
  `),O=V(y,6),g=p.join(n,`css/${O}.css`);$.writeFileSync(g,j)}}await a(t,n);const f=s.map(y=>`@import url('./css/${y}');`).join(`
10
10
  `);let i=`@layer l0, l1, l2, l3, l4, l5, l6, l7, l8;
11
11
 
package/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const p=require("path"),u=require("./index-BAmrXaUF.cjs"),r=(e,s,o=!1,n=!1)=>{var a,l,t;(l=(a=e.module)==null?void 0:a.rules)==null||l.push({test:u.saltyFileRegExp(),use:[{loader:p.resolve(__dirname,n?"./loader.cjs":"./loader.js"),options:{dir:s}}]}),o||(t=e.plugins)==null||t.push({apply:i=>{i.hooks.afterPlugins.tap({name:"generateCss"},async()=>{await u.generateCss(s)})}})};exports.default=r;exports.saltyPlugin=r;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const p=require("path"),u=require("./index-zWFfFoCI.cjs"),r=(e,s,o=!1,n=!1)=>{var a,l,t;(l=(a=e.module)==null?void 0:a.rules)==null||l.push({test:u.saltyFileRegExp(),use:[{loader:p.resolve(__dirname,n?"./loader.cjs":"./loader.js"),options:{dir:s}}]}),o||(t=e.plugins)==null||t.push({apply:i=>{i.hooks.afterPlugins.tap({name:"generateCss"},async()=>{await u.generateCss(s)})}})};exports.default=r;exports.saltyPlugin=r;
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { resolve as n } from "path";
2
- import { s as u, g as i } from "./index-Cy7vv0Gm.js";
2
+ import { s as u, g as i } from "./index-BDOd3CmD.js";
3
3
  const g = (s, e, o = !1, r = !1) => {
4
4
  var a, l, t;
5
5
  (l = (a = s.module) == null ? void 0 : a.rules) == null || l.push({
package/loader.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const i=require("./index-BAmrXaUF.cjs");async function n(){const{dir:e}=this.getOptions(),{resourcePath:t}=this;return await i.generateFile(e,t),await i.minimizeFile(e,t)}module.exports=n;
1
+ "use strict";const i=require("./index-zWFfFoCI.cjs");async function n(){const{dir:e}=this.getOptions(),{resourcePath:t}=this;return await i.generateFile(e,t),await i.minimizeFile(e,t)}module.exports=n;
package/loader.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as e, m as i } from "./index-Cy7vv0Gm.js";
1
+ import { a as e, m as i } from "./index-BDOd3CmD.js";
2
2
  async function s() {
3
3
  const { dir: t } = this.getOptions(), { resourcePath: a } = this;
4
4
  return await e(t, a), await i(t, a);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salty-css/webpack",
3
- "version": "0.0.1-alpha.39",
3
+ "version": "0.0.1-alpha.40",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "typings": "./dist/index.d.ts",
@@ -29,7 +29,7 @@
29
29
  }
30
30
  },
31
31
  "dependencies": {
32
- "@salty-css/core": "^0.0.1-alpha.39",
32
+ "@salty-css/core": "^0.0.1-alpha.40",
33
33
  "webpack": ">=5.x"
34
34
  }
35
35
  }