@salty-css/astro 0.2.1 → 0.2.2-refactor-vite-8.4

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.
Files changed (84) hide show
  1. package/README.md +355 -374
  2. package/dist/astro-template.d.ts +7 -0
  3. package/dist/astro-template.d.ts.map +1 -0
  4. package/dist/astro-vite-plugin-DDl_IdJa.js +193 -0
  5. package/dist/astro-vite-plugin-goCXCXLG.cjs +10 -0
  6. package/dist/astro-vite-plugin.cjs +1 -0
  7. package/{astro-vite-plugin.d.ts → dist/astro-vite-plugin.d.ts} +2 -1
  8. package/dist/astro-vite-plugin.d.ts.map +1 -0
  9. package/dist/astro-vite-plugin.js +2 -0
  10. package/dist/class-name.cjs +1 -0
  11. package/{class-name.d.ts → dist/class-name.d.ts} +3 -2
  12. package/dist/class-name.d.ts.map +1 -0
  13. package/dist/class-name.js +18 -0
  14. package/dist/config.cjs +1 -0
  15. package/dist/config.d.ts +2 -0
  16. package/dist/config.d.ts.map +1 -0
  17. package/dist/element-props.cjs +1 -0
  18. package/{element-props.d.ts → dist/element-props.d.ts} +2 -1
  19. package/dist/element-props.d.ts.map +1 -0
  20. package/dist/element-props.js +40 -0
  21. package/dist/factories.cjs +1 -0
  22. package/dist/factories.d.ts +2 -0
  23. package/dist/factories.d.ts.map +1 -0
  24. package/{framework-registry.d.ts → dist/framework-registry.d.ts} +3 -3
  25. package/dist/framework-registry.d.ts.map +1 -0
  26. package/dist/helpers.cjs +1 -0
  27. package/dist/helpers.d.ts +2 -0
  28. package/dist/helpers.d.ts.map +1 -0
  29. package/dist/index.cjs +1 -0
  30. package/dist/index.d.ts +2 -0
  31. package/dist/index.d.ts.map +1 -0
  32. package/dist/integration.cjs +1 -0
  33. package/{integration.d.ts → dist/integration.d.ts} +1 -0
  34. package/dist/integration.d.ts.map +1 -0
  35. package/dist/integration.js +12 -0
  36. package/dist/keyframes.cjs +1 -0
  37. package/dist/keyframes.d.ts +2 -0
  38. package/dist/keyframes.d.ts.map +1 -0
  39. package/dist/load-salty-file.d.ts +14 -0
  40. package/dist/load-salty-file.d.ts.map +1 -0
  41. package/dist/media.cjs +1 -0
  42. package/dist/media.d.ts +2 -0
  43. package/dist/media.d.ts.map +1 -0
  44. package/dist/runtime.cjs +1 -0
  45. package/dist/runtime.d.ts +2 -0
  46. package/dist/runtime.d.ts.map +1 -0
  47. package/dist/styled.cjs +1 -0
  48. package/{styled.d.ts → dist/styled.d.ts} +2 -1
  49. package/dist/styled.d.ts.map +1 -0
  50. package/dist/styled.js +8 -0
  51. package/dist/watch-handlers.d.ts +9 -0
  52. package/dist/watch-handlers.d.ts.map +1 -0
  53. package/package.json +53 -50
  54. package/astro-vite-plugin.cjs +0 -12
  55. package/astro-vite-plugin.js +0 -157
  56. package/class-name.cjs +0 -1
  57. package/class-name.js +0 -24
  58. package/config.cjs +0 -1
  59. package/config.d.ts +0 -1
  60. package/element-props.cjs +0 -1
  61. package/element-props.js +0 -57
  62. package/factories.cjs +0 -1
  63. package/factories.d.ts +0 -1
  64. package/helpers.cjs +0 -1
  65. package/helpers.d.ts +0 -1
  66. package/index.cjs +0 -1
  67. package/index.d.ts +0 -1
  68. package/integration.cjs +0 -1
  69. package/integration.js +0 -19
  70. package/keyframes.cjs +0 -1
  71. package/keyframes.d.ts +0 -1
  72. package/media.cjs +0 -1
  73. package/media.d.ts +0 -1
  74. package/runtime.cjs +0 -1
  75. package/runtime.d.ts +0 -1
  76. package/styled.cjs +0 -1
  77. package/styled.js +0 -11
  78. /package/{config.js → dist/config.js} +0 -0
  79. /package/{factories.js → dist/factories.js} +0 -0
  80. /package/{helpers.js → dist/helpers.js} +0 -0
  81. /package/{index.js → dist/index.js} +0 -0
  82. /package/{keyframes.js → dist/keyframes.js} +0 -0
  83. /package/{media.js → dist/media.js} +0 -0
  84. /package/{runtime.js → dist/runtime.js} +0 -0
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Render the `.astro` component template for a styled/className component from its
3
+ * stored `<hash>.config` file. Returns `undefined` when the config cannot be read
4
+ * or parsed so the caller can fall through.
5
+ */
6
+ export declare const renderAstroComponent: (destDir: string, configFile: string) => Promise<string | undefined>;
7
+ //# sourceMappingURL=astro-template.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"astro-template.d.ts","sourceRoot":"","sources":["../src/astro-template.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAAU,SAAS,MAAM,EAAE,YAAY,MAAM,KAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAwB1G,CAAC"}
@@ -0,0 +1,193 @@
1
+ import { SaltyCompiler as e } from "@salty-css/core/compiler/salty-compiler";
2
+ import { isSaltyFile as t, resolveExportValue as n } from "@salty-css/core/compiler/helpers";
3
+ import { getFunctionRange as r } from "@salty-css/core/compiler/get-function-range";
4
+ import { toHash as i } from "@salty-css/core/util";
5
+ import { mkdir as a, readFile as o, writeFile as s } from "fs/promises";
6
+ import { join as c } from "path";
7
+ import { checkShouldRestart as l } from "@salty-css/core/server";
8
+ import { ViteNodeServer as u } from "vite-node/server";
9
+ import { ViteNodeRunner as d } from "vite-node/client";
10
+ import { installSourcemapsSupport as f } from "vite-node/source-map";
11
+ //#region src/framework-registry.ts
12
+ var p = [{
13
+ name: "react",
14
+ importMarkers: [/['"]@salty-css\/react(\/[^'"]*)?['"]/],
15
+ loadTransform: async (e) => {
16
+ let t = "@salty-css/react/transform-salty-file";
17
+ return (e ? await e(t) : await import(
18
+ /* @vite-ignore */
19
+ t
20
+ )).transformSaltyFile;
21
+ }
22
+ }], m = /* @__PURE__ */ new Map(), h = (e, t) => {
23
+ let n = m.get(e.name);
24
+ if (n) return n;
25
+ let r = e.loadTransform(t);
26
+ return m.set(e.name, r), r;
27
+ }, g = (e) => {
28
+ for (let t of p) for (let n of t.importMarkers) if (n.test(e)) return t;
29
+ }, _ = async (e, t) => {
30
+ let n = await o(c(e, "astro", t), "utf-8");
31
+ if (n) try {
32
+ let e = JSON.parse(n), { clientProps: t = {}, classNames: r = "", tagIsComponent: i, tagName: a = "div" } = e, o = ["import { resolveAstroProps } from '@salty-css/astro/element-props';", ...e.imports || []], s = i ? a : `__r.element || ${JSON.stringify(t.element || a)}`;
33
+ return `---
34
+ ${o.join("\n")}
35
+ const __gp = ${JSON.stringify(t)};
36
+ const __r = resolveAstroProps(Astro.props, __gp, ${JSON.stringify(r)});
37
+ const Element = ${s};
38
+ ---
39
+ <Element class:list={__r.class} style={__r.style} {...__r.rest}><slot/></Element>`;
40
+ } catch (e) {
41
+ console.error("Error parsing config file:", e);
42
+ return;
43
+ }
44
+ }, v = async (e, l) => {
45
+ let { compiler: u } = e;
46
+ try {
47
+ if (t(l, [], !l.includes("configFile="))) {
48
+ let t = await u.getDestDir();
49
+ if (/.+\?configFile=(\w+).+/.test(l)) {
50
+ let e = new URLSearchParams(l.split("?")[1]).get("configFile");
51
+ return e ? await _(t, e) : void 0;
52
+ }
53
+ let d = await o(l, "utf-8"), f = g(d);
54
+ if (f) return await (await h(f, e.importer))(u, l);
55
+ let p = ["import { classNameInstance } from '@salty-css/core/instances/classname-instance';"], m = [], v = [], y = await u.compileSaltyFile(l, t), b = Object.entries(y.contents);
56
+ for (let [e, f] of b) {
57
+ let h = await n(f, 1);
58
+ if (!h.generator) continue;
59
+ if (h.isClassName) {
60
+ let t = h.generator._withBuildContext({
61
+ callerName: e,
62
+ isProduction: u.isProduction,
63
+ config: {}
64
+ });
65
+ m.push(`const ${e} = classNameInstance(${JSON.stringify(t.params)});`), v.push(e);
66
+ continue;
67
+ }
68
+ let [g, _] = await r(d, e), y = d.slice(g, _), x = /styled\(([^,]+),/.exec(y)?.at(1)?.trim();
69
+ if (!x) {
70
+ console.warn(`Could not determine tag name for ${e} in ${l}`);
71
+ continue;
72
+ }
73
+ let S = h.generator._withBuildContext({
74
+ callerName: e,
75
+ isProduction: u.isProduction,
76
+ config: {}
77
+ }), C = {
78
+ componentName: e,
79
+ tagName: x.replace(/['"`]/g, ""),
80
+ tagIsComponent: !1,
81
+ classNames: S.classNames,
82
+ imports: [],
83
+ clientProps: S.clientProps
84
+ }, w = /^\w+$/.test(x);
85
+ if (C.tagIsComponent = w, w) {
86
+ let e = b.some(([e]) => e === x), t = d.match(RegExp(`import[^;]*${x}[^;]*;`));
87
+ e ? C.imports = [`import ${x} from '${l}.astro?configFile=${i(x)}.config';`] : t && (C.imports = [t.at(0)]);
88
+ }
89
+ let T = c(t, "astro");
90
+ await o(T, "utf-8").catch(() => !1) || await a(T, { recursive: !0 });
91
+ let E = i(e);
92
+ await s(c(t, "astro", `${E}.config`), JSON.stringify(C)), p.push(`import ${e} from '${l}.astro?configFile=${E}.config';`), v.push(e);
93
+ }
94
+ return `${p.join("\n")}\n${m.join("\n")}\nexport { ${v.join(", ")} };`;
95
+ }
96
+ return;
97
+ } catch (e) {
98
+ console.error("Error during file compilation:", e);
99
+ return;
100
+ }
101
+ }, y = async (e, { file: n, server: r, modules: i }) => {
102
+ try {
103
+ if (await l(n)) return await e.generateCss(!1);
104
+ if (!t(n)) return;
105
+ let a = await e.getDestDir(), o = [];
106
+ for (let [e, t] of r.moduleGraph.idToModuleMap) e.startsWith(n + ".astro?configFile=") && (r.moduleGraph.invalidateModule(t), o.push(t));
107
+ for (let e of r.moduleGraph.urlToModuleMap.values()) e.file && e.file.startsWith(a) && (r.moduleGraph.invalidateModule(e), o.push(e));
108
+ return r.ws.send({
109
+ type: "update",
110
+ updates: []
111
+ }), [...i, ...o];
112
+ } catch (e) {
113
+ console.error("Error during hot update handling:", e);
114
+ }
115
+ }, b = async (e, n, r) => {
116
+ try {
117
+ t(n) && r.event !== "delete" && (await l(n) || await e.generateFile(n));
118
+ } catch (e) {
119
+ console.error("Error during watch change handling:", e);
120
+ }
121
+ }, x = (t, n = {}) => {
122
+ let r, i, a, o, s = new e(t, { mode: n.mode }), c = {
123
+ compiler: s,
124
+ importer: void 0
125
+ }, l = async () => {
126
+ if (a && i && r) return a;
127
+ if (!o) throw Error("[stylegen] vite-node runner requested before configResolved ran");
128
+ let { createServer: e, version: t } = await import("vite");
129
+ r = await e({
130
+ resolve: { alias: o.resolve.alias },
131
+ server: {
132
+ middlewareMode: !0,
133
+ hmr: !1,
134
+ ws: !1,
135
+ watch: null
136
+ },
137
+ optimizeDeps: {
138
+ noDiscovery: !0,
139
+ include: []
140
+ }
141
+ }), Number(t.split(".")[0]) < 6 && await r.pluginContainer.buildStart({});
142
+ let n = new u(r);
143
+ return i = n, f({ getSourceMap: (e) => n.getSourceMap(e) }), a = new d({
144
+ root: r.config.root,
145
+ base: r.config.base,
146
+ fetchModule: (e) => n.fetchModule(e),
147
+ resolveId: (e, t) => n.resolveId(e, t)
148
+ }), a;
149
+ }, p = (e, t) => {
150
+ let n = e.moduleCache;
151
+ n.invalidateDepTree ? n.invalidateDepTree([t]) : n.deleteByModuleId ? n.deleteByModuleId(t) : n.clear();
152
+ };
153
+ s.importFile = async (e) => {
154
+ let t = await l();
155
+ return p(t, e), t.executeFile(e);
156
+ }, c.importer = s.importFile;
157
+ let m = async () => {
158
+ let e = r;
159
+ if (r = void 0, i = void 0, a = void 0, e) try {
160
+ await e.close();
161
+ } catch {}
162
+ }, h, g = () => (h ||= s.generateCss().catch((e) => {
163
+ throw h = void 0, e;
164
+ }), h);
165
+ return {
166
+ name: "stylegen",
167
+ configResolved: async function(e) {
168
+ o = e, await l();
169
+ try {
170
+ await g();
171
+ } catch (e) {
172
+ throw console.error("Error during initial CSS generation:", e), e;
173
+ }
174
+ },
175
+ resolveId: function(e) {
176
+ return e.includes(".astro?configFile=") ? e : null;
177
+ },
178
+ load: function(e) {
179
+ return v(c, e);
180
+ },
181
+ handleHotUpdate: function(e) {
182
+ return y(s, e);
183
+ },
184
+ watchChange: { handler: function(e, t) {
185
+ return b(s, e, t);
186
+ } },
187
+ closeBundle: async function() {
188
+ await m();
189
+ }
190
+ };
191
+ };
192
+ //#endregion
193
+ export { x as t };
@@ -0,0 +1,10 @@
1
+ let e=require("@salty-css/core/compiler/salty-compiler"),t=require("@salty-css/core/compiler/helpers"),n=require("@salty-css/core/compiler/get-function-range"),r=require("@salty-css/core/util"),i=require("fs/promises"),a=require("path"),o=require("@salty-css/core/server"),s=require("vite-node/server"),c=require("vite-node/client"),l=require("vite-node/source-map");var u=[{name:`react`,importMarkers:[/['"]@salty-css\/react(\/[^'"]*)?['"]/],loadTransform:async e=>{let t=`@salty-css/react/transform-salty-file`;return(e?await e(t):await import(t)).transformSaltyFile}}],d=new Map,f=(e,t)=>{let n=d.get(e.name);if(n)return n;let r=e.loadTransform(t);return d.set(e.name,r),r},p=e=>{for(let t of u)for(let n of t.importMarkers)if(n.test(e))return t},m=async(e,t)=>{let n=await(0,i.readFile)((0,a.join)(e,`astro`,t),`utf-8`);if(n)try{let e=JSON.parse(n),{clientProps:t={},classNames:r=``,tagIsComponent:i,tagName:a=`div`}=e,o=[`import { resolveAstroProps } from '@salty-css/astro/element-props';`,...e.imports||[]],s=i?a:`__r.element || ${JSON.stringify(t.element||a)}`;return`---
2
+ ${o.join(`
3
+ `)}
4
+ const __gp = ${JSON.stringify(t)};
5
+ const __r = resolveAstroProps(Astro.props, __gp, ${JSON.stringify(r)});
6
+ const Element = ${s};
7
+ ---
8
+ <Element class:list={__r.class} style={__r.style} {...__r.rest}><slot/></Element>`}catch(e){console.error(`Error parsing config file:`,e);return}},h=async(e,o)=>{let{compiler:s}=e;try{if((0,t.isSaltyFile)(o,[],!o.includes(`configFile=`))){let c=await s.getDestDir();if(/.+\?configFile=(\w+).+/.test(o)){let e=new URLSearchParams(o.split(`?`)[1]).get(`configFile`);return e?await m(c,e):void 0}let l=await(0,i.readFile)(o,`utf-8`),u=p(l);if(u)return await(await f(u,e.importer))(s,o);let d=[`import { classNameInstance } from '@salty-css/core/instances/classname-instance';`],h=[],g=[],_=await s.compileSaltyFile(o,c),v=Object.entries(_.contents);for(let[e,u]of v){let f=await(0,t.resolveExportValue)(u,1);if(!f.generator)continue;if(f.isClassName){let t=f.generator._withBuildContext({callerName:e,isProduction:s.isProduction,config:{}});h.push(`const ${e} = classNameInstance(${JSON.stringify(t.params)});`),g.push(e);continue}let[p,m]=await(0,n.getFunctionRange)(l,e),_=l.slice(p,m),y=/styled\(([^,]+),/.exec(_)?.at(1)?.trim();if(!y){console.warn(`Could not determine tag name for ${e} in ${o}`);continue}let b=f.generator._withBuildContext({callerName:e,isProduction:s.isProduction,config:{}}),x={componentName:e,tagName:y.replace(/['"`]/g,``),tagIsComponent:!1,classNames:b.classNames,imports:[],clientProps:b.clientProps},S=/^\w+$/.test(y);if(x.tagIsComponent=S,S){let e=v.some(([e])=>e===y),t=l.match(RegExp(`import[^;]*${y}[^;]*;`));e?x.imports=[`import ${y} from '${o}.astro?configFile=${(0,r.toHash)(y)}.config';`]:t&&(x.imports=[t.at(0)])}let C=(0,a.join)(c,`astro`);await(0,i.readFile)(C,`utf-8`).catch(()=>!1)||await(0,i.mkdir)(C,{recursive:!0});let w=(0,r.toHash)(e);await(0,i.writeFile)((0,a.join)(c,`astro`,`${w}.config`),JSON.stringify(x)),d.push(`import ${e} from '${o}.astro?configFile=${w}.config';`),g.push(e)}return`${d.join(`
9
+ `)}\n${h.join(`
10
+ `)}\nexport { ${g.join(`, `)} };`}return}catch(e){console.error(`Error during file compilation:`,e);return}},g=async(e,{file:n,server:r,modules:i})=>{try{if(await(0,o.checkShouldRestart)(n))return await e.generateCss(!1);if(!(0,t.isSaltyFile)(n))return;let a=await e.getDestDir(),s=[];for(let[e,t]of r.moduleGraph.idToModuleMap)e.startsWith(n+`.astro?configFile=`)&&(r.moduleGraph.invalidateModule(t),s.push(t));for(let e of r.moduleGraph.urlToModuleMap.values())e.file&&e.file.startsWith(a)&&(r.moduleGraph.invalidateModule(e),s.push(e));return r.ws.send({type:`update`,updates:[]}),[...i,...s]}catch(e){console.error(`Error during hot update handling:`,e)}},_=async(e,n,r)=>{try{(0,t.isSaltyFile)(n)&&r.event!==`delete`&&(await(0,o.checkShouldRestart)(n)||await e.generateFile(n))}catch(e){console.error(`Error during watch change handling:`,e)}},v=(t,n={})=>{let r,i,a,o,u=new e.SaltyCompiler(t,{mode:n.mode}),d={compiler:u,importer:void 0},f=async()=>{if(a&&i&&r)return a;if(!o)throw Error(`[stylegen] vite-node runner requested before configResolved ran`);let{createServer:e,version:t}=await import(`vite`);r=await e({resolve:{alias:o.resolve.alias},server:{middlewareMode:!0,hmr:!1,ws:!1,watch:null},optimizeDeps:{noDiscovery:!0,include:[]}}),Number(t.split(`.`)[0])<6&&await r.pluginContainer.buildStart({});let n=new s.ViteNodeServer(r);return i=n,(0,l.installSourcemapsSupport)({getSourceMap:e=>n.getSourceMap(e)}),a=new c.ViteNodeRunner({root:r.config.root,base:r.config.base,fetchModule:e=>n.fetchModule(e),resolveId:(e,t)=>n.resolveId(e,t)}),a},p=(e,t)=>{let n=e.moduleCache;n.invalidateDepTree?n.invalidateDepTree([t]):n.deleteByModuleId?n.deleteByModuleId(t):n.clear()};u.importFile=async e=>{let t=await f();return p(t,e),t.executeFile(e)},d.importer=u.importFile;let m=async()=>{let e=r;if(r=void 0,i=void 0,a=void 0,e)try{await e.close()}catch{}},v,y=()=>(v||=u.generateCss().catch(e=>{throw v=void 0,e}),v);return{name:`stylegen`,configResolved:async function(e){o=e,await f();try{await y()}catch(e){throw console.error(`Error during initial CSS generation:`,e),e}},resolveId:function(e){return e.includes(`.astro?configFile=`)?e:null},load:function(e){return h(d,e)},handleHotUpdate:function(e){return g(u,e)},watchChange:{handler:function(e,t){return _(u,e,t)}},closeBundle:async function(){await m()}}};Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return v}});
@@ -0,0 +1 @@
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./astro-vite-plugin-goCXCXLG.cjs");exports.default=e.t,exports.saltyPlugin=e.t;
@@ -1,4 +1,4 @@
1
- import { SaltyCompilerMode } from '@salty-css/core/compiler/salty-compiler';
1
+ import { SaltyCompilerMode } from '../../core/dist/compiler/salty-compiler';
2
2
  import { PluginOption } from 'vite';
3
3
  export interface SaltyAstroPluginOptions {
4
4
  /**
@@ -8,3 +8,4 @@ export interface SaltyAstroPluginOptions {
8
8
  }
9
9
  export declare const saltyPlugin: (dir: string, options?: SaltyAstroPluginOptions) => PluginOption;
10
10
  export default saltyPlugin;
11
+ //# sourceMappingURL=astro-vite-plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"astro-vite-plugin.d.ts","sourceRoot":"","sources":["../src/astro-vite-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAiC,MAAM,MAAM,CAAC;AAQnE,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,IAAI,CAAC,EAAE,iBAAiB,CAAC;CAC1B;AAED,eAAO,MAAM,WAAW,GAAI,KAAK,MAAM,EAAE,UAAS,uBAA4B,KAAG,YAwMhF,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { t as e } from "./astro-vite-plugin-DDl_IdJa.js";
2
+ export { e as default, e as saltyPlugin };
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@salty-css/core/generators");var t=t=>{let n=new e.ClassNameGenerator(t),r=e=>{let t=new String(e);return Object.assign(t,{get isClassName(){return!0},variant:(e,n)=>r(`${t} ${`${e}-${n}`}`),variants:e=>r(`${t}${Object.entries(e).reduce((e,[t,n])=>(e+=` ${t}-${n}`,e),``)}`.trim()),generator:n}),t};return r(n.cssClassName)};exports.className=t;
@@ -1,5 +1,5 @@
1
- import { StyledParams } from '@salty-css/core/types';
2
- import { ClassNameGenerator } from '@salty-css/core/generators';
1
+ import { StyledParams } from '../../core/dist/types';
2
+ import { ClassNameGenerator } from '../../core/dist/generators';
3
3
  interface ClassNameMethods<STYLE_PARAMS extends StyledParams> {
4
4
  generator: ClassNameGenerator<STYLE_PARAMS>;
5
5
  isClassName: boolean;
@@ -9,3 +9,4 @@ interface ClassNameMethods<STYLE_PARAMS extends StyledParams> {
9
9
  type ClassNameFunction<STYLE_PARAMS extends StyledParams> = string & ClassNameMethods<STYLE_PARAMS>;
10
10
  export declare const className: <const STYLE_PARAMS extends StyledParams>(params: STYLE_PARAMS) => ClassNameFunction<STYLE_PARAMS>;
11
11
  export {};
12
+ //# sourceMappingURL=class-name.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"class-name.d.ts","sourceRoot":"","sources":["../src/class-name.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,UAAU,gBAAgB,CAAC,YAAY,SAAS,YAAY;IAC1D,SAAS,EAAE,kBAAkB,CAAC,YAAY,CAAC,CAAC;IAC5C,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,iBAAiB,CAAC,YAAY,CAAC,CAAC;IACnF,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,MAAM,GAAG,iBAAiB,CAAC,YAAY,CAAC,CAAC;CAC1F;AAED,KAAK,iBAAiB,CAAC,YAAY,SAAS,YAAY,IAAI,MAAM,GAAG,gBAAgB,CAAC,YAAY,CAAC,CAAC;AAEpG,eAAO,MAAM,SAAS,GAAI,KAAK,CAAC,YAAY,SAAS,YAAY,EAAE,QAAQ,YAAY,oCA4BtF,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { ClassNameGenerator as e } from "@salty-css/core/generators";
2
+ //#region src/class-name.ts
3
+ var t = (t) => {
4
+ let n = new e(t), r = (e) => {
5
+ let t = new String(e);
6
+ return Object.assign(t, {
7
+ get isClassName() {
8
+ return !0;
9
+ },
10
+ variant: (e, n) => r(`${t} ${`${e}-${n}`}`),
11
+ variants: (e) => r(`${t}${Object.entries(e).reduce((e, [t, n]) => (e += ` ${t}-${n}`, e), "")}`.trim()),
12
+ generator: n
13
+ }), t;
14
+ };
15
+ return r(n.cssClassName);
16
+ };
17
+ //#endregion
18
+ export { t as className };
@@ -0,0 +1 @@
1
+ var e=require("@salty-css/core/config");Object.keys(e).forEach(function(t){t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})});
@@ -0,0 +1,2 @@
1
+ export * from '../../core/dist/config';
2
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC"}
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@salty-css/core/util"),t=require("@salty-css/core/parsers");var n=[`passProps`],r=(r={},i={},a=``,o)=>{let{class:s=``,className:c,element:l,as:u,passProps:d=i.passProps,_vks:f,style:p,...m}=r,h={passProps:d};if(i.attr)for(let[e,t]of Object.entries(i.attr))t!==void 0&&(h[e]=t);o&&Object.assign(h,o);let g={...m};if(i.defaultProps)for(let[e,t]of Object.entries(i.defaultProps))g[e]===void 0&&(g[e]=t);Object.assign(h,g);let _=new Set;for(let e of String(a).split(` `))e&&_.add(e);for(let e of String(s||``).split(` `))e&&_.add(e);for(let e of String(c||``).split(` `))e&&_.add(e);let v={};if(p&&typeof p==`object`)for(let[e,n]of Object.entries(p)){let r=(0,t.parseVariableTokens)(n);v[e]=r?r.transformed:n}let y=new Set(Array.isArray(f)?f:[]);if(i.propValueKeys)for(let t of i.propValueKeys){let n=`css-${t}`,r=g[n];r!==void 0&&(v[`--props-${(0,e.dashCase)(t)}`]=r,y.add(n))}if(i.variantKeys)for(let e of i.variantKeys){let[t,n]=e.split(`=`);g[t]===void 0?n!==void 0&&_.add(`${t}-${n}`):(_.add(`${t}-${g[t]}`),y.add(t))}for(let e of y)d!==!0&&(Array.isArray(d)&&d.includes(e)||typeof d==`string`&&d===e||delete h[e]);for(let e of n)delete h[e];return{class:[..._],style:v,rest:h,element:u??l??i.element,_vks:[...y]}};exports.resolveAstroProps=r;
@@ -1,4 +1,4 @@
1
- import { StyledGeneratorClientProps } from '@salty-css/core/generators';
1
+ import { StyledGeneratorClientProps } from '../../core/dist/generators';
2
2
  export interface ResolvedAstroProps {
3
3
  class: string[];
4
4
  style: Record<string, any>;
@@ -18,3 +18,4 @@ export interface ResolvedAstroProps {
18
18
  * - `_vks` — variant keys consumed at this level, forwarded so wrapping styled components can keep stripping them
19
19
  */
20
20
  export declare const resolveAstroProps: (astroProps?: Record<string, any>, generatorProps?: StyledGeneratorClientProps, baseClassName?: string, additionalProps?: Record<string, any>) => ResolvedAstroProps;
21
+ //# sourceMappingURL=element-props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"element-props.d.ts","sourceRoot":"","sources":["../src/element-props.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAIxE,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,GAC5B,aAAY,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,EACpC,iBAAgB,0BAA+B,EAC/C,sBAAkB,EAClB,kBAAkB,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KACpC,kBAgFF,CAAC"}
@@ -0,0 +1,40 @@
1
+ import { dashCase as e } from "@salty-css/core/util";
2
+ import { parseVariableTokens as t } from "@salty-css/core/parsers";
3
+ //#region src/element-props.ts
4
+ var n = ["passProps"], r = (r = {}, i = {}, a = "", o) => {
5
+ let { class: s = "", className: c, element: l, as: u, passProps: d = i.passProps, _vks: f, style: p, ...m } = r, h = { passProps: d };
6
+ if (i.attr) for (let [e, t] of Object.entries(i.attr)) t !== void 0 && (h[e] = t);
7
+ o && Object.assign(h, o);
8
+ let g = { ...m };
9
+ if (i.defaultProps) for (let [e, t] of Object.entries(i.defaultProps)) g[e] === void 0 && (g[e] = t);
10
+ Object.assign(h, g);
11
+ let _ = /* @__PURE__ */ new Set();
12
+ for (let e of String(a).split(" ")) e && _.add(e);
13
+ for (let e of String(s || "").split(" ")) e && _.add(e);
14
+ for (let e of String(c || "").split(" ")) e && _.add(e);
15
+ let v = {};
16
+ if (p && typeof p == "object") for (let [e, n] of Object.entries(p)) {
17
+ let r = t(n);
18
+ v[e] = r ? r.transformed : n;
19
+ }
20
+ let y = new Set(Array.isArray(f) ? f : []);
21
+ if (i.propValueKeys) for (let t of i.propValueKeys) {
22
+ let n = `css-${t}`, r = g[n];
23
+ r !== void 0 && (v[`--props-${e(t)}`] = r, y.add(n));
24
+ }
25
+ if (i.variantKeys) for (let e of i.variantKeys) {
26
+ let [t, n] = e.split("=");
27
+ g[t] === void 0 ? n !== void 0 && _.add(`${t}-${n}`) : (_.add(`${t}-${g[t]}`), y.add(t));
28
+ }
29
+ for (let e of y) d !== !0 && (Array.isArray(d) && d.includes(e) || typeof d == "string" && d === e || delete h[e]);
30
+ for (let e of n) delete h[e];
31
+ return {
32
+ class: [..._],
33
+ style: v,
34
+ rest: h,
35
+ element: u ?? l ?? i.element,
36
+ _vks: [...y]
37
+ };
38
+ };
39
+ //#endregion
40
+ export { r as resolveAstroProps };
@@ -0,0 +1 @@
1
+ var e=require("@salty-css/core/factories");Object.keys(e).forEach(function(t){t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})});
@@ -0,0 +1,2 @@
1
+ export * from '../../core/dist/factories';
2
+ //# sourceMappingURL=factories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factories.d.ts","sourceRoot":"","sources":["../src/factories.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC"}
@@ -1,5 +1,5 @@
1
- import { SaltyCompiler } from '@salty-css/core/compiler/salty-compiler';
2
- type Importer = undefined | ((path: string) => Promise<any>);
1
+ import { SaltyCompiler } from '../../core/dist/compiler/salty-compiler';
2
+ export type Importer = undefined | ((path: string) => Promise<any>);
3
3
  export type SaltyFileTransform = (compiler: SaltyCompiler, file: string) => Promise<string | undefined>;
4
4
  export interface FrameworkEntry {
5
5
  name: string;
@@ -9,4 +9,4 @@ export interface FrameworkEntry {
9
9
  export declare const frameworkRegistry: FrameworkEntry[];
10
10
  export declare const getFrameworkTransform: (entry: FrameworkEntry, importer: Importer) => Promise<SaltyFileTransform>;
11
11
  export declare const detectFramework: (source: string) => FrameworkEntry | undefined;
12
- export {};
12
+ //# sourceMappingURL=framework-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"framework-registry.d.ts","sourceRoot":"","sources":["../src/framework-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAE7E,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;AAEpE,MAAM,MAAM,kBAAkB,GAAG,CAAC,QAAQ,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;AAExG,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC;CACpE;AAED,eAAO,MAAM,iBAAiB,EAAE,cAAc,EAU7C,CAAC;AAIF,eAAO,MAAM,qBAAqB,GAAI,OAAO,cAAc,EAAE,UAAU,QAAQ,KAAG,OAAO,CAAC,kBAAkB,CAM3G,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,QAAQ,MAAM,KAAG,cAAc,GAAG,SAOjE,CAAC"}
@@ -0,0 +1 @@
1
+ var e=require("@salty-css/core/helpers");Object.keys(e).forEach(function(t){t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})});
@@ -0,0 +1,2 @@
1
+ export * from '../../core/dist/helpers';
2
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC"}
package/dist/index.cjs ADDED
@@ -0,0 +1 @@
1
+ var e=require("@salty-css/core/css");Object.keys(e).forEach(function(t){t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})});
@@ -0,0 +1,2 @@
1
+ export * from '../../core/dist/css';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1 @@
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./astro-vite-plugin-goCXCXLG.cjs");let t=require("path");var n=(n={})=>({name:`astro-salty-integration`,hooks:{"astro:config:setup":({config:r,updateConfig:i})=>{let{srcDir:a=`src`,rootDir:o=r.root.pathname}=n;i({vite:{plugins:[e.t((0,t.join)(o,a))]}})}}});exports.default=n,exports.saltyIntegration=n;
@@ -13,3 +13,4 @@ interface SaltyIntegrationOptions {
13
13
  }
14
14
  export declare const saltyIntegration: (options?: SaltyIntegrationOptions) => AstroIntegration;
15
15
  export default saltyIntegration;
16
+ //# sourceMappingURL=integration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../src/integration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAIzC,UAAU,uBAAuB;IAC/B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,gBAAgB,GAAI,UAAS,uBAA4B,KAAG,gBAgBxE,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { t as e } from "./astro-vite-plugin-DDl_IdJa.js";
2
+ import { join as t } from "path";
3
+ //#region src/integration.ts
4
+ var n = (n = {}) => ({
5
+ name: "astro-salty-integration",
6
+ hooks: { "astro:config:setup": ({ config: r, updateConfig: i }) => {
7
+ let { srcDir: a = "src", rootDir: o = r.root.pathname } = n;
8
+ i({ vite: { plugins: [e(t(o, a))] } });
9
+ } }
10
+ });
11
+ //#endregion
12
+ export { n as default, n as saltyIntegration };
@@ -0,0 +1 @@
1
+ var e=require("@salty-css/core/css/keyframes");Object.keys(e).forEach(function(t){t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})});
@@ -0,0 +1,2 @@
1
+ export * from '../../core/dist/css/keyframes';
2
+ //# sourceMappingURL=keyframes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyframes.d.ts","sourceRoot":"","sources":["../src/keyframes.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { SaltyCompiler } from '../../core/dist/compiler/salty-compiler';
2
+ import { Importer } from './framework-registry';
3
+ export interface AstroPluginContext {
4
+ compiler: SaltyCompiler;
5
+ /** Updated just-in-time by the plugin's importFile, read here for dev transforms. */
6
+ importer: Importer;
7
+ }
8
+ /**
9
+ * Vite `load` hook body: resolves stored `.astro` component configs, delegates to
10
+ * framework-specific transforms, or compiles a salty file into a styled/className
11
+ * module while writing per-component `.config` files.
12
+ */
13
+ export declare const loadSaltyFile: (ctx: AstroPluginContext, filePath: string) => Promise<string | undefined>;
14
+ //# sourceMappingURL=load-salty-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"load-salty-file.d.ts","sourceRoot":"","sources":["../src/load-salty-file.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAIxE,OAAO,EAA0C,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAGxF,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,aAAa,CAAC;IACxB,qFAAqF;IACrF,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAU,KAAK,kBAAkB,EAAE,UAAU,MAAM,KAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAwGzG,CAAC"}
package/dist/media.cjs ADDED
@@ -0,0 +1 @@
1
+ var e=require("@salty-css/core/css/media");Object.keys(e).forEach(function(t){t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})});
@@ -0,0 +1,2 @@
1
+ export * from '../../core/dist/css/media';
2
+ //# sourceMappingURL=media.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../src/media.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC"}
@@ -0,0 +1 @@
1
+ var e=require("@salty-css/core/runtime");Object.keys(e).forEach(function(t){t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})});
@@ -0,0 +1,2 @@
1
+ export * from '../../core/dist/runtime';
2
+ //# sourceMappingURL=runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC"}
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@salty-css/core/generators");var t=(t,n)=>({tagName:t,generator:new e.StyledGenerator(t,n)});exports.styled=t;
@@ -1,2 +1,3 @@
1
- import { Tag, StyledComponentProps, StyledParams } from '@salty-css/core/types';
1
+ import { Tag, StyledComponentProps, StyledParams } from '../../core/dist/types';
2
2
  export declare const styled: <const PROPS extends StyledComponentProps, const TAG extends Tag<Required<PROPS>>, const STYLE_PARAMS extends StyledParams>(tagName: TAG, params: STYLE_PARAMS) => any;
3
+ //# sourceMappingURL=styled.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styled.d.ts","sourceRoot":"","sources":["../src/styled.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGhF,eAAO,MAAM,MAAM,GAAI,KAAK,CAAC,KAAK,SAAS,oBAAoB,EAAE,KAAK,CAAC,GAAG,SAAS,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,YAAY,SAAS,YAAY,EAC9I,SAAS,GAAG,EACZ,QAAQ,YAAY,KASA,GACrB,CAAC"}
package/dist/styled.js ADDED
@@ -0,0 +1,8 @@
1
+ import { StyledGenerator as e } from "@salty-css/core/generators";
2
+ //#region src/styled.ts
3
+ var t = (t, n) => ({
4
+ tagName: t,
5
+ generator: new e(t, n)
6
+ });
7
+ //#endregion
8
+ export { t as styled };
@@ -0,0 +1,9 @@
1
+ import { SaltyCompiler } from '../../core/dist/compiler/salty-compiler';
2
+ import { HmrContext, ModuleNode } from 'vite';
3
+ /** Vite `handleHotUpdate` hook body: invalidate config + generated-CSS modules. */
4
+ export declare const handleHotUpdate: (saltyCompiler: SaltyCompiler, { file, server, modules }: HmrContext) => Promise<ModuleNode[] | void>;
5
+ /** Vite `watchChange` hook body: regenerate the changed salty file on edits. */
6
+ export declare const watchChange: (saltyCompiler: SaltyCompiler, filePath: string, change: {
7
+ event: "create" | "update" | "delete";
8
+ }) => Promise<void>;
9
+ //# sourceMappingURL=watch-handlers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"watch-handlers.d.ts","sourceRoot":"","sources":["../src/watch-handlers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAExE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAE9C,mFAAmF;AACnF,eAAO,MAAM,eAAe,GAAU,eAAe,aAAa,EAAE,2BAA2B,UAAU,KAAG,OAAO,CAAC,UAAU,EAAE,GAAG,IAAI,CAiCtI,CAAC;AAEF,gFAAgF;AAChF,eAAO,MAAM,WAAW,GAAU,eAAe,aAAa,EAAE,UAAU,MAAM,EAAE,QAAQ;IAAE,KAAK,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAA;CAAE,KAAG,OAAO,CAAC,IAAI,CAUjJ,CAAC"}