@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.
- package/README.md +355 -374
- package/dist/astro-template.d.ts +7 -0
- package/dist/astro-template.d.ts.map +1 -0
- package/dist/astro-vite-plugin-DDl_IdJa.js +193 -0
- package/dist/astro-vite-plugin-goCXCXLG.cjs +10 -0
- package/dist/astro-vite-plugin.cjs +1 -0
- package/{astro-vite-plugin.d.ts → dist/astro-vite-plugin.d.ts} +2 -1
- package/dist/astro-vite-plugin.d.ts.map +1 -0
- package/dist/astro-vite-plugin.js +2 -0
- package/dist/class-name.cjs +1 -0
- package/{class-name.d.ts → dist/class-name.d.ts} +3 -2
- package/dist/class-name.d.ts.map +1 -0
- package/dist/class-name.js +18 -0
- package/dist/config.cjs +1 -0
- package/dist/config.d.ts +2 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/element-props.cjs +1 -0
- package/{element-props.d.ts → dist/element-props.d.ts} +2 -1
- package/dist/element-props.d.ts.map +1 -0
- package/dist/element-props.js +40 -0
- package/dist/factories.cjs +1 -0
- package/dist/factories.d.ts +2 -0
- package/dist/factories.d.ts.map +1 -0
- package/{framework-registry.d.ts → dist/framework-registry.d.ts} +3 -3
- package/dist/framework-registry.d.ts.map +1 -0
- package/dist/helpers.cjs +1 -0
- package/dist/helpers.d.ts +2 -0
- package/dist/helpers.d.ts.map +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/integration.cjs +1 -0
- package/{integration.d.ts → dist/integration.d.ts} +1 -0
- package/dist/integration.d.ts.map +1 -0
- package/dist/integration.js +12 -0
- package/dist/keyframes.cjs +1 -0
- package/dist/keyframes.d.ts +2 -0
- package/dist/keyframes.d.ts.map +1 -0
- package/dist/load-salty-file.d.ts +14 -0
- package/dist/load-salty-file.d.ts.map +1 -0
- package/dist/media.cjs +1 -0
- package/dist/media.d.ts +2 -0
- package/dist/media.d.ts.map +1 -0
- package/dist/runtime.cjs +1 -0
- package/dist/runtime.d.ts +2 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/styled.cjs +1 -0
- package/{styled.d.ts → dist/styled.d.ts} +2 -1
- package/dist/styled.d.ts.map +1 -0
- package/dist/styled.js +8 -0
- package/dist/watch-handlers.d.ts +9 -0
- package/dist/watch-handlers.d.ts.map +1 -0
- package/package.json +53 -50
- package/astro-vite-plugin.cjs +0 -12
- package/astro-vite-plugin.js +0 -157
- package/class-name.cjs +0 -1
- package/class-name.js +0 -24
- package/config.cjs +0 -1
- package/config.d.ts +0 -1
- package/element-props.cjs +0 -1
- package/element-props.js +0 -57
- package/factories.cjs +0 -1
- package/factories.d.ts +0 -1
- package/helpers.cjs +0 -1
- package/helpers.d.ts +0 -1
- package/index.cjs +0 -1
- package/index.d.ts +0 -1
- package/integration.cjs +0 -1
- package/integration.js +0 -19
- package/keyframes.cjs +0 -1
- package/keyframes.d.ts +0 -1
- package/media.cjs +0 -1
- package/media.d.ts +0 -1
- package/runtime.cjs +0 -1
- package/runtime.d.ts +0 -1
- package/styled.cjs +0 -1
- package/styled.js +0 -11
- /package/{config.js → dist/config.js} +0 -0
- /package/{factories.js → dist/factories.js} +0 -0
- /package/{helpers.js → dist/helpers.js} +0 -0
- /package/{index.js → dist/index.js} +0 -0
- /package/{keyframes.js → dist/keyframes.js} +0 -0
- /package/{media.js → dist/media.js} +0 -0
- /package/{runtime.js → dist/runtime.js} +0 -0
package/package.json
CHANGED
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salty-css/astro",
|
|
3
|
-
"version": "0.2.1",
|
|
4
|
-
"main": "./dist/index.js",
|
|
5
|
-
"module": "./dist/index.mjs",
|
|
6
|
-
"typings": "./dist/index.d.ts",
|
|
7
|
-
"type": "module",
|
|
8
3
|
"license": "MIT",
|
|
9
4
|
"private": false,
|
|
10
5
|
"publishConfig": {
|
|
11
6
|
"access": "public"
|
|
12
7
|
},
|
|
13
|
-
"description": "
|
|
8
|
+
"description": "Vite plugin for Salty CSS",
|
|
14
9
|
"homepage": "https://salty-css.dev/",
|
|
15
10
|
"repository": {
|
|
16
11
|
"type": "git",
|
|
@@ -19,75 +14,83 @@
|
|
|
19
14
|
"bugs": {
|
|
20
15
|
"url": "https://github.com/margarita-form/salty-css/issues"
|
|
21
16
|
},
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
"version": "0.2.2-refactor-vite-8.4",
|
|
18
|
+
"type": "module",
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "node ../../node_modules/vite-build/bin/vite.js build --config vite.config.ts",
|
|
21
|
+
"test": "vitest run"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@salty-css/core": "0.2.2-refactor-vite-8.4",
|
|
25
|
+
"@salty-css/react": "0.2.2-refactor-vite-8.4",
|
|
26
|
+
"vite": "^7.3.5",
|
|
27
|
+
"vite-node": "^5.3.0"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"jsdom": "^29.1.1",
|
|
31
|
+
"vite-build": "npm:vite@^8.0.12"
|
|
32
|
+
},
|
|
26
33
|
"nx": {
|
|
27
|
-
"
|
|
28
|
-
|
|
34
|
+
"targets": {
|
|
35
|
+
"build": {
|
|
36
|
+
"dependsOn": [
|
|
37
|
+
"^build"
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
}
|
|
29
41
|
},
|
|
42
|
+
"files": [
|
|
43
|
+
"dist",
|
|
44
|
+
"README.md"
|
|
45
|
+
],
|
|
30
46
|
"exports": {
|
|
31
47
|
".": {
|
|
32
|
-
"import": "./index.js",
|
|
33
|
-
"require": "./index.cjs"
|
|
48
|
+
"import": "./dist/index.js",
|
|
49
|
+
"require": "./dist/index.cjs"
|
|
34
50
|
},
|
|
35
51
|
"./astro-vite-plugin": {
|
|
36
|
-
"import": "./astro-vite-plugin.js",
|
|
37
|
-
"require": "./astro-vite-plugin.cjs"
|
|
52
|
+
"import": "./dist/astro-vite-plugin.js",
|
|
53
|
+
"require": "./dist/astro-vite-plugin.cjs"
|
|
38
54
|
},
|
|
39
55
|
"./integration": {
|
|
40
|
-
"import": "./integration.js",
|
|
41
|
-
"require": "./integration.cjs"
|
|
56
|
+
"import": "./dist/integration.js",
|
|
57
|
+
"require": "./dist/integration.cjs"
|
|
42
58
|
},
|
|
43
59
|
"./styled": {
|
|
44
|
-
"import": "./styled.js",
|
|
45
|
-
"require": "./styled.cjs"
|
|
60
|
+
"import": "./dist/styled.js",
|
|
61
|
+
"require": "./dist/styled.cjs"
|
|
46
62
|
},
|
|
47
63
|
"./class-name": {
|
|
48
|
-
"import": "./class-name.js",
|
|
49
|
-
"require": "./class-name.cjs"
|
|
64
|
+
"import": "./dist/class-name.js",
|
|
65
|
+
"require": "./dist/class-name.cjs"
|
|
50
66
|
},
|
|
51
67
|
"./element-props": {
|
|
52
|
-
"import": "./element-props.js",
|
|
53
|
-
"require": "./element-props.cjs"
|
|
68
|
+
"import": "./dist/element-props.js",
|
|
69
|
+
"require": "./dist/element-props.cjs"
|
|
54
70
|
},
|
|
55
71
|
"./runtime": {
|
|
56
|
-
"import": "./runtime.js",
|
|
57
|
-
"require": "./runtime.cjs"
|
|
72
|
+
"import": "./dist/runtime.js",
|
|
73
|
+
"require": "./dist/runtime.cjs"
|
|
58
74
|
},
|
|
59
75
|
"./keyframes": {
|
|
60
|
-
"import": "./keyframes.js",
|
|
61
|
-
"require": "./keyframes.cjs"
|
|
76
|
+
"import": "./dist/keyframes.js",
|
|
77
|
+
"require": "./dist/keyframes.cjs"
|
|
62
78
|
},
|
|
63
79
|
"./media": {
|
|
64
|
-
"import": "./media.js",
|
|
65
|
-
"require": "./media.cjs"
|
|
80
|
+
"import": "./dist/media.js",
|
|
81
|
+
"require": "./dist/media.cjs"
|
|
66
82
|
},
|
|
67
83
|
"./factories": {
|
|
68
|
-
"import": "./factories.js",
|
|
69
|
-
"require": "./factories.cjs"
|
|
84
|
+
"import": "./dist/factories.js",
|
|
85
|
+
"require": "./dist/factories.cjs"
|
|
70
86
|
},
|
|
71
87
|
"./config": {
|
|
72
|
-
"import": "./config.js",
|
|
73
|
-
"require": "./config.cjs"
|
|
88
|
+
"import": "./dist/config.js",
|
|
89
|
+
"require": "./dist/config.cjs"
|
|
74
90
|
},
|
|
75
91
|
"./helpers": {
|
|
76
|
-
"import": "./helpers.js",
|
|
77
|
-
"require": "./helpers.cjs"
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
"dependencies": {
|
|
81
|
-
"@salty-css/core": "0.2.1",
|
|
82
|
-
"astro": "^5.13.2",
|
|
83
|
-
"vite": "^6.3.5"
|
|
84
|
-
},
|
|
85
|
-
"peerDependencies": {
|
|
86
|
-
"@salty-css/react": "0.2.1"
|
|
87
|
-
},
|
|
88
|
-
"peerDependenciesMeta": {
|
|
89
|
-
"@salty-css/react": {
|
|
90
|
-
"optional": true
|
|
92
|
+
"import": "./dist/helpers.js",
|
|
93
|
+
"require": "./dist/helpers.cjs"
|
|
91
94
|
}
|
|
92
95
|
}
|
|
93
|
-
}
|
|
96
|
+
}
|
package/astro-vite-plugin.cjs
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const _=require("@salty-css/core/compiler/helpers"),b=require("@salty-css/core/compiler/get-function-range"),A=require("@salty-css/core/compiler/salty-compiler"),O=require("@salty-css/core/server"),P=require("@salty-css/core/util"),F=require("fs/promises"),k=require("path"),L=[{name:"react",importMarkers:[/['"]@salty-css\/react(\/[^'"]*)?['"]/],loadTransform:async s=>{const n="@salty-css/react/transform-salty-file";return(s?await s(n):await import(n)).transformSaltyFile}}],q=new Map,B=(s,n)=>{const l=q.get(s.name);if(l)return l;const e=s.loadTransform(n);return q.set(s.name,e),e},U=s=>{for(const n of L)for(const l of n.importMarkers)if(l.test(s))return n},J=(s,n={})=>{let l;const e=new A.SaltyCompiler(s,{mode:n.mode});return{name:"stylegen",configureServer:function(t){e.importFile=async o=>{const a=Date.now();return l=t.ssrLoadModule,t.ssrLoadModule(`${o}?t=${a}`)}},configResolved:async function(){try{await e.generateCss()}catch(t){throw console.error("Error during initial CSS generation:",t),t}},load:async function(t){var o,a;try{if(_.isSaltyFile(t,[],!t.includes("configFile="))){const h=await e.getDestDir();if(/.+\?configFile=(\w+).+/.test(t)){const C=new URLSearchParams(t.split("?")[1]).get("configFile");if(!C)return;const f=k.join(h,"astro",C),S=await F.readFile(f,"utf-8");if(!S)return;try{const g=JSON.parse(S),{clientProps:$={},classNames:c="",tagIsComponent:N,tagName:m="div"}=g,v=["import { resolveAstroProps } from '@salty-css/astro/element-props';",...g.imports||[]],I=N?m:`__r.element || ${JSON.stringify($.element||m)}`;return`---
|
|
2
|
-
${v.join(`
|
|
3
|
-
`)}
|
|
4
|
-
const __gp = ${JSON.stringify($)};
|
|
5
|
-
const __r = resolveAstroProps(Astro.props, __gp, ${JSON.stringify(c)});
|
|
6
|
-
const Element = ${I};
|
|
7
|
-
---
|
|
8
|
-
<Element class:list={__r.class} style={__r.style} {...__r.rest}><slot/></Element>`}catch(g){console.error("Error parsing config file:",g);return}}const d=await F.readFile(t,"utf-8"),p=U(d);if(p)return await(await B(p,l))(e,t);const i=["import { classNameInstance } from '@salty-css/core/instances/classname-instance';"],y=[],M=[],T=await e.compileSaltyFile(t,h),j=Object.entries(T.contents);for(const[r,C]of j){const f=await _.resolveExportValue(C,1);if(!f.generator)continue;if(f.isClassName){const E=f.generator._withBuildContext({callerName:r,isProduction:e.isProduction,config:{}});y.push(`const ${r} = classNameInstance(${JSON.stringify(E.params)});`),M.push(r);continue}const[S,g]=await b.getFunctionRange(d,r),$=d.slice(S,g),c=(a=(o=/styled\(([^,]+),/.exec($))==null?void 0:o.at(1))==null?void 0:a.trim();if(!c){console.warn(`Could not determine tag name for ${r} in ${t}`);continue}const N=f.generator._withBuildContext({callerName:r,isProduction:e.isProduction,config:{}}),m={componentName:r,tagName:c.replace(/['"`]/g,""),tagIsComponent:!1,classNames:N.classNames,imports:[],clientProps:N.clientProps},R=/^\w+$/.test(c);if(m.tagIsComponent=R,R){const E=j.some(([w])=>w===c),D=d.match(new RegExp(`import[^;]*${c}[^;]*;`));if(E){const w=P.toHash(c),H=`import ${c} from '${t}.astro?configFile=${w}.config';`;m.imports=[H]}else if(D){const w=D.at(0);m.imports=[w]}}const v=k.join(h,"astro");await F.readFile(v,"utf-8").catch(()=>!1)||await F.mkdir(v,{recursive:!0});const x=P.toHash(r),G=k.join(h,"astro",`${x}.config`);await F.writeFile(G,JSON.stringify(m)),i.push(`import ${r} from '${t}.astro?configFile=${x}.config';`),M.push(r)}return`${i.join(`
|
|
9
|
-
`)}
|
|
10
|
-
${y.join(`
|
|
11
|
-
`)}
|
|
12
|
-
export { ${M.join(", ")} };`}return}catch(u){console.error("Error during file compilation:",u);return}},handleHotUpdate:async function({file:t,server:o,modules:a}){try{if(await O.checkShouldRestart(t))return await e.generateCss(!1);if(!_.isSaltyFile(t))return;const d=await e.getDestDir(),p=[];for(const[i,y]of o.moduleGraph.idToModuleMap)i.startsWith(t+".astro?configFile=")&&(o.moduleGraph.invalidateModule(y),p.push(y));for(const i of o.moduleGraph.urlToModuleMap.values())i.file&&i.file.startsWith(d)&&(o.moduleGraph.invalidateModule(i),p.push(i));return o.ws.send({type:"update",updates:[]}),[...a,...p]}catch(u){console.error("Error during hot update handling:",u)}},watchChange:{handler:async function(t,o){try{_.isSaltyFile(t)&&o.event!=="delete"&&(await O.checkShouldRestart(t)||await e.generateFile(t))}catch(a){console.error("Error during watch change handling:",a)}}}}};exports.default=J;exports.saltyPlugin=J;
|
package/astro-vite-plugin.js
DELETED
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import { isSaltyFile as M, resolveExportValue as H } from "@salty-css/core/compiler/helpers";
|
|
2
|
-
import { getFunctionRange as L } from "@salty-css/core/compiler/get-function-range";
|
|
3
|
-
import { SaltyCompiler as B } from "@salty-css/core/compiler/salty-compiler";
|
|
4
|
-
import { checkShouldRestart as j } from "@salty-css/core/server";
|
|
5
|
-
import { toHash as J } from "@salty-css/core/util";
|
|
6
|
-
import { readFile as R, mkdir as U, writeFile as W } from "fs/promises";
|
|
7
|
-
import { join as k } from "path";
|
|
8
|
-
const b = [
|
|
9
|
-
{
|
|
10
|
-
name: "react",
|
|
11
|
-
importMarkers: [/['"]@salty-css\/react(\/[^'"]*)?['"]/],
|
|
12
|
-
loadTransform: async (s) => {
|
|
13
|
-
const n = "@salty-css/react/transform-salty-file";
|
|
14
|
-
return (s ? await s(n) : await import(n)).transformSaltyFile;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
], P = /* @__PURE__ */ new Map(), V = (s, n) => {
|
|
18
|
-
const l = P.get(s.name);
|
|
19
|
-
if (l) return l;
|
|
20
|
-
const o = s.loadTransform(n);
|
|
21
|
-
return P.set(s.name, o), o;
|
|
22
|
-
}, q = (s) => {
|
|
23
|
-
for (const n of b)
|
|
24
|
-
for (const l of n.importMarkers)
|
|
25
|
-
if (l.test(s)) return n;
|
|
26
|
-
}, rt = (s, n = {}) => {
|
|
27
|
-
let l;
|
|
28
|
-
const o = new B(s, { mode: n.mode });
|
|
29
|
-
return {
|
|
30
|
-
name: "stylegen",
|
|
31
|
-
configureServer: function(t) {
|
|
32
|
-
o.importFile = async (r) => {
|
|
33
|
-
const a = Date.now();
|
|
34
|
-
return l = t.ssrLoadModule, t.ssrLoadModule(`${r}?t=${a}`);
|
|
35
|
-
};
|
|
36
|
-
},
|
|
37
|
-
configResolved: async function() {
|
|
38
|
-
try {
|
|
39
|
-
await o.generateCss();
|
|
40
|
-
} catch (t) {
|
|
41
|
-
throw console.error("Error during initial CSS generation:", t), t;
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
load: async function(t) {
|
|
45
|
-
var r, a;
|
|
46
|
-
try {
|
|
47
|
-
if (M(t, [], !t.includes("configFile="))) {
|
|
48
|
-
const h = await o.getDestDir();
|
|
49
|
-
if (/.+\?configFile=(\w+).+/.test(t)) {
|
|
50
|
-
const F = new URLSearchParams(t.split("?")[1]).get("configFile");
|
|
51
|
-
if (!F) return;
|
|
52
|
-
const d = k(h, "astro", F), $ = await R(d, "utf-8");
|
|
53
|
-
if (!$) return;
|
|
54
|
-
try {
|
|
55
|
-
const g = JSON.parse($), { clientProps: C = {}, classNames: c = "", tagIsComponent: N, tagName: m = "div" } = g, S = ["import { resolveAstroProps } from '@salty-css/astro/element-props';", ...g.imports || []], D = N ? m : `__r.element || ${JSON.stringify(C.element || m)}`;
|
|
56
|
-
return `---
|
|
57
|
-
${S.join(`
|
|
58
|
-
`)}
|
|
59
|
-
const __gp = ${JSON.stringify(C)};
|
|
60
|
-
const __r = resolveAstroProps(Astro.props, __gp, ${JSON.stringify(c)});
|
|
61
|
-
const Element = ${D};
|
|
62
|
-
---
|
|
63
|
-
<Element class:list={__r.class} style={__r.style} {...__r.rest}><slot/></Element>`;
|
|
64
|
-
} catch (g) {
|
|
65
|
-
console.error("Error parsing config file:", g);
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
const p = await R(t, "utf-8"), u = q(p);
|
|
70
|
-
if (u)
|
|
71
|
-
return await (await V(u, l))(o, t);
|
|
72
|
-
const i = ["import { classNameInstance } from '@salty-css/core/instances/classname-instance';"], w = [], v = [], G = await o.compileSaltyFile(t, h), I = Object.entries(G.contents);
|
|
73
|
-
for (const [e, F] of I) {
|
|
74
|
-
const d = await H(F, 1);
|
|
75
|
-
if (!d.generator) continue;
|
|
76
|
-
if (d.isClassName) {
|
|
77
|
-
const E = d.generator._withBuildContext({
|
|
78
|
-
callerName: e,
|
|
79
|
-
isProduction: o.isProduction,
|
|
80
|
-
config: {}
|
|
81
|
-
});
|
|
82
|
-
w.push(`const ${e} = classNameInstance(${JSON.stringify(E.params)});`), v.push(e);
|
|
83
|
-
continue;
|
|
84
|
-
}
|
|
85
|
-
const [$, g] = await L(p, e), C = p.slice($, g), c = (a = (r = /styled\(([^,]+),/.exec(C)) == null ? void 0 : r.at(1)) == null ? void 0 : a.trim();
|
|
86
|
-
if (!c) {
|
|
87
|
-
console.warn(`Could not determine tag name for ${e} in ${t}`);
|
|
88
|
-
continue;
|
|
89
|
-
}
|
|
90
|
-
const N = d.generator._withBuildContext({
|
|
91
|
-
callerName: e,
|
|
92
|
-
isProduction: o.isProduction,
|
|
93
|
-
config: {}
|
|
94
|
-
}), m = {
|
|
95
|
-
componentName: e,
|
|
96
|
-
tagName: c.replace(/['"`]/g, ""),
|
|
97
|
-
tagIsComponent: !1,
|
|
98
|
-
classNames: N.classNames,
|
|
99
|
-
imports: [],
|
|
100
|
-
clientProps: N.clientProps
|
|
101
|
-
}, _ = /^\w+$/.test(c);
|
|
102
|
-
if (m.tagIsComponent = _, _) {
|
|
103
|
-
const E = I.some(([y]) => y === c), O = p.match(new RegExp(`import[^;]*${c}[^;]*;`));
|
|
104
|
-
if (E) {
|
|
105
|
-
const y = J(c), A = `import ${c} from '${t}.astro?configFile=${y}.config';`;
|
|
106
|
-
m.imports = [A];
|
|
107
|
-
} else if (O) {
|
|
108
|
-
const y = O.at(0);
|
|
109
|
-
m.imports = [y];
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
const S = k(h, "astro");
|
|
113
|
-
await R(S, "utf-8").catch(() => !1) || await U(S, { recursive: !0 });
|
|
114
|
-
const x = J(e), T = k(h, "astro", `${x}.config`);
|
|
115
|
-
await W(T, JSON.stringify(m)), i.push(`import ${e} from '${t}.astro?configFile=${x}.config';`), v.push(e);
|
|
116
|
-
}
|
|
117
|
-
return `${i.join(`
|
|
118
|
-
`)}
|
|
119
|
-
${w.join(`
|
|
120
|
-
`)}
|
|
121
|
-
export { ${v.join(", ")} };`;
|
|
122
|
-
}
|
|
123
|
-
return;
|
|
124
|
-
} catch (f) {
|
|
125
|
-
console.error("Error during file compilation:", f);
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
},
|
|
129
|
-
handleHotUpdate: async function({ file: t, server: r, modules: a }) {
|
|
130
|
-
try {
|
|
131
|
-
if (await j(t)) return await o.generateCss(!1);
|
|
132
|
-
if (!M(t)) return;
|
|
133
|
-
const p = await o.getDestDir(), u = [];
|
|
134
|
-
for (const [i, w] of r.moduleGraph.idToModuleMap)
|
|
135
|
-
i.startsWith(t + ".astro?configFile=") && (r.moduleGraph.invalidateModule(w), u.push(w));
|
|
136
|
-
for (const i of r.moduleGraph.urlToModuleMap.values())
|
|
137
|
-
i.file && i.file.startsWith(p) && (r.moduleGraph.invalidateModule(i), u.push(i));
|
|
138
|
-
return r.ws.send({ type: "update", updates: [] }), [...a, ...u];
|
|
139
|
-
} catch (f) {
|
|
140
|
-
console.error("Error during hot update handling:", f);
|
|
141
|
-
}
|
|
142
|
-
},
|
|
143
|
-
watchChange: {
|
|
144
|
-
handler: async function(t, r) {
|
|
145
|
-
try {
|
|
146
|
-
M(t) && r.event !== "delete" && (await j(t) || await o.generateFile(t));
|
|
147
|
-
} catch (a) {
|
|
148
|
-
console.error("Error during watch change handling:", a);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
};
|
|
154
|
-
export {
|
|
155
|
-
rt as default,
|
|
156
|
-
rt as saltyPlugin
|
|
157
|
-
};
|
package/class-name.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("@salty-css/core/generators"),C=o=>{const c=new m.ClassNameGenerator(o),t=i=>{const e=new String(i);return Object.assign(e,{get isClassName(){return!0},variant:(r,n)=>{const a=`${r}-${n}`,s=`${e} ${a}`;return t(s)},variants:r=>{const n=Object.entries(r).reduce((s,[l,u])=>(s+=` ${l}-${u}`,s),""),a=`${e}${n}`.trim();return t(a)},generator:c}),e};return t(c.cssClassName)};exports.className=C;
|
package/class-name.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { ClassNameGenerator as u } from "@salty-css/core/generators";
|
|
2
|
-
const $ = (c) => {
|
|
3
|
-
const o = new u(c), e = (i) => {
|
|
4
|
-
const s = new String(i);
|
|
5
|
-
return Object.assign(s, {
|
|
6
|
-
get isClassName() {
|
|
7
|
-
return !0;
|
|
8
|
-
},
|
|
9
|
-
variant: (r, n) => {
|
|
10
|
-
const a = `${r}-${n}`, t = `${s} ${a}`;
|
|
11
|
-
return e(t);
|
|
12
|
-
},
|
|
13
|
-
variants: (r) => {
|
|
14
|
-
const n = Object.entries(r).reduce((t, [l, m]) => (t += ` ${l}-${m}`, t), ""), a = `${s}${n}`.trim();
|
|
15
|
-
return e(a);
|
|
16
|
-
},
|
|
17
|
-
generator: o
|
|
18
|
-
}), s;
|
|
19
|
-
};
|
|
20
|
-
return e(o.cssClassName);
|
|
21
|
-
};
|
|
22
|
-
export {
|
|
23
|
-
$ as className
|
|
24
|
-
};
|
package/config.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@salty-css/core/config");Object.keys(t).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]})});
|
package/config.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@salty-css/core/config';
|
package/element-props.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("@salty-css/core/util"),A=require("@salty-css/core/parsers"),O=["passProps"],$=(p={},t={},y="",d)=>{const{class:v="",className:m,element:k,as:b,passProps:i=t.passProps,_vks:u,style:r,...S}=p,n={passProps:i};if(t.attr)for(const[s,e]of Object.entries(t.attr))e!==void 0&&(n[s]=e);d&&Object.assign(n,d);const c={...S};if(t.defaultProps)for(const[s,e]of Object.entries(t.defaultProps))c[s]===void 0&&(c[s]=e);Object.assign(n,c);const a=new Set;for(const s of String(y).split(" "))s&&a.add(s);for(const s of String(v||"").split(" "))s&&a.add(s);for(const s of String(m||"").split(" "))s&&a.add(s);const l={};if(r&&typeof r=="object")for(const[s,e]of Object.entries(r)){const o=A.parseVariableTokens(e);l[s]=o?o.transformed:e}const f=new Set(Array.isArray(u)?u:[]);if(t.propValueKeys)for(const s of t.propValueKeys){const e=`css-${s}`,o=c[e];o!==void 0&&(l[`--props-${j.dashCase(s)}`]=o,f.add(e))}if(t.variantKeys)for(const s of t.variantKeys){const[e,o]=s.split("=");c[e]!==void 0?(a.add(`${e}-${c[e]}`),f.add(e)):o!==void 0&&a.add(`${e}-${o}`)}for(const s of f)i!==!0&&(Array.isArray(i)&&i.includes(s)||typeof i=="string"&&i===s||delete n[s]);for(const s of O)delete n[s];return{class:[...a],style:l,rest:n,element:b??k??t.element,_vks:[...f]}};exports.resolveAstroProps=$;
|
package/element-props.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { dashCase as A } from "@salty-css/core/util";
|
|
2
|
-
import { parseVariableTokens as S } from "@salty-css/core/parsers";
|
|
3
|
-
const $ = ["passProps"], V = (y = {}, t = {}, m = "", d) => {
|
|
4
|
-
const {
|
|
5
|
-
class: u = "",
|
|
6
|
-
className: v,
|
|
7
|
-
element: k,
|
|
8
|
-
as: b,
|
|
9
|
-
passProps: i = t.passProps,
|
|
10
|
-
_vks: p,
|
|
11
|
-
style: l,
|
|
12
|
-
...j
|
|
13
|
-
} = y, n = { passProps: i };
|
|
14
|
-
if (t.attr)
|
|
15
|
-
for (const [s, e] of Object.entries(t.attr))
|
|
16
|
-
e !== void 0 && (n[s] = e);
|
|
17
|
-
d && Object.assign(n, d);
|
|
18
|
-
const c = { ...j };
|
|
19
|
-
if (t.defaultProps)
|
|
20
|
-
for (const [s, e] of Object.entries(t.defaultProps))
|
|
21
|
-
c[s] === void 0 && (c[s] = e);
|
|
22
|
-
Object.assign(n, c);
|
|
23
|
-
const f = /* @__PURE__ */ new Set();
|
|
24
|
-
for (const s of String(m).split(" ")) s && f.add(s);
|
|
25
|
-
for (const s of String(u || "").split(" ")) s && f.add(s);
|
|
26
|
-
for (const s of String(v || "").split(" ")) s && f.add(s);
|
|
27
|
-
const r = {};
|
|
28
|
-
if (l && typeof l == "object")
|
|
29
|
-
for (const [s, e] of Object.entries(l)) {
|
|
30
|
-
const o = S(e);
|
|
31
|
-
r[s] = o ? o.transformed : e;
|
|
32
|
-
}
|
|
33
|
-
const a = new Set(Array.isArray(p) ? p : []);
|
|
34
|
-
if (t.propValueKeys)
|
|
35
|
-
for (const s of t.propValueKeys) {
|
|
36
|
-
const e = `css-${s}`, o = c[e];
|
|
37
|
-
o !== void 0 && (r[`--props-${A(s)}`] = o, a.add(e));
|
|
38
|
-
}
|
|
39
|
-
if (t.variantKeys)
|
|
40
|
-
for (const s of t.variantKeys) {
|
|
41
|
-
const [e, o] = s.split("=");
|
|
42
|
-
c[e] !== void 0 ? (f.add(`${e}-${c[e]}`), a.add(e)) : o !== void 0 && f.add(`${e}-${o}`);
|
|
43
|
-
}
|
|
44
|
-
for (const s of a)
|
|
45
|
-
i !== !0 && (Array.isArray(i) && i.includes(s) || typeof i == "string" && i === s || delete n[s]);
|
|
46
|
-
for (const s of $) delete n[s];
|
|
47
|
-
return {
|
|
48
|
-
class: [...f],
|
|
49
|
-
style: r,
|
|
50
|
-
rest: n,
|
|
51
|
-
element: b ?? k ?? t.element,
|
|
52
|
-
_vks: [...a]
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
export {
|
|
56
|
-
V as resolveAstroProps
|
|
57
|
-
};
|
package/factories.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@salty-css/core/factories");Object.keys(t).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]})});
|
package/factories.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@salty-css/core/factories';
|
package/helpers.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@salty-css/core/helpers");Object.keys(t).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]})});
|
package/helpers.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@salty-css/core/helpers';
|
package/index.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@salty-css/core/css");Object.keys(t).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]})});
|
package/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@salty-css/core/css';
|
package/integration.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("./astro-vite-plugin.cjs"),u=require("path"),t=(e={})=>({name:"astro-salty-integration",hooks:{"astro:config:setup":({config:r,updateConfig:o})=>{const{srcDir:i="src",rootDir:n=r.root.pathname}=e,s=u.join(n,i);o({vite:{plugins:[a.default(s)]}})}}});exports.default=t;exports.saltyIntegration=t;
|
package/integration.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import a from "./astro-vite-plugin.js";
|
|
2
|
-
import { join as e } from "path";
|
|
3
|
-
const l = (t = {}) => ({
|
|
4
|
-
name: "astro-salty-integration",
|
|
5
|
-
hooks: {
|
|
6
|
-
"astro:config:setup": ({ config: o, updateConfig: r }) => {
|
|
7
|
-
const { srcDir: i = "src", rootDir: n = o.root.pathname } = t, s = e(n, i);
|
|
8
|
-
r({
|
|
9
|
-
vite: {
|
|
10
|
-
plugins: [a(s)]
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
export {
|
|
17
|
-
l as default,
|
|
18
|
-
l as saltyIntegration
|
|
19
|
-
};
|
package/keyframes.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@salty-css/core/css/keyframes");Object.keys(t).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]})});
|
package/keyframes.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@salty-css/core/css/keyframes';
|
package/media.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@salty-css/core/css/media");Object.keys(t).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]})});
|
package/media.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@salty-css/core/css/media';
|
package/runtime.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@salty-css/core/runtime");Object.keys(t).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]})});
|
package/runtime.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@salty-css/core/runtime';
|
package/styled.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@salty-css/core/generators"),r=(e,t)=>{const n=new o.StyledGenerator(e,t);return{tagName:e,generator:n}};exports.styled=r;
|
package/styled.js
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|