@salty-css/core 0.2.1 → 0.2.2-refactor-vite-8.5
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/dist/astro-component-Ov1RH0CO.js +4 -0
- package/dist/astro-component-r0qEcF1p.cjs +14 -0
- package/{bin → dist/bin}/bin-util.d.ts +1 -0
- package/dist/bin/bin-util.d.ts.map +1 -0
- package/{bin → dist/bin}/commands/build.d.ts +1 -0
- package/dist/bin/commands/build.d.ts.map +1 -0
- package/{bin → dist/bin}/commands/generate.d.ts +1 -0
- package/dist/bin/commands/generate.d.ts.map +1 -0
- package/{bin → dist/bin}/commands/init.d.ts +1 -0
- package/dist/bin/commands/init.d.ts.map +1 -0
- package/{bin → dist/bin}/commands/update.d.ts +1 -0
- package/dist/bin/commands/update.d.ts.map +1 -0
- package/{bin → dist/bin}/commands/version.d.ts +1 -0
- package/dist/bin/commands/version.d.ts.map +1 -0
- package/{bin → dist/bin}/confirm-install.d.ts +1 -0
- package/dist/bin/confirm-install.d.ts.map +1 -0
- package/{bin → dist/bin}/context.d.ts +1 -0
- package/dist/bin/context.d.ts.map +1 -0
- package/{bin → dist/bin}/detection/css-file.d.ts +1 -0
- package/dist/bin/detection/css-file.d.ts.map +1 -0
- package/{bin → dist/bin}/frameworks/astro.d.ts +1 -0
- package/dist/bin/frameworks/astro.d.ts.map +1 -0
- package/{bin → dist/bin}/frameworks/index.d.ts +1 -0
- package/dist/bin/frameworks/index.d.ts.map +1 -0
- package/{bin → dist/bin}/frameworks/react.d.ts +1 -0
- package/dist/bin/frameworks/react.d.ts.map +1 -0
- package/{bin → dist/bin}/frameworks/types.d.ts +1 -0
- package/dist/bin/frameworks/types.d.ts.map +1 -0
- package/dist/bin/index.cjs +2 -0
- package/dist/bin/index.d.ts +3 -0
- package/dist/bin/index.d.ts.map +1 -0
- package/dist/bin/index.js +5 -0
- package/{bin → dist/bin}/integrations/astro.d.ts +1 -0
- package/dist/bin/integrations/astro.d.ts.map +1 -0
- package/{bin → dist/bin}/integrations/eslint.d.ts +1 -0
- package/dist/bin/integrations/eslint.d.ts.map +1 -0
- package/{bin → dist/bin}/integrations/index.d.ts +1 -0
- package/dist/bin/integrations/index.d.ts.map +1 -0
- package/{bin → dist/bin}/integrations/next.d.ts +1 -0
- package/dist/bin/integrations/next.d.ts.map +1 -0
- package/{bin → dist/bin}/integrations/types.d.ts +1 -0
- package/dist/bin/integrations/types.d.ts.map +1 -0
- package/{bin → dist/bin}/integrations/vite.d.ts +1 -0
- package/dist/bin/integrations/vite.d.ts.map +1 -0
- package/{bin → dist/bin}/logger.d.ts +1 -0
- package/dist/bin/logger.d.ts.map +1 -0
- package/dist/bin/main.cjs +1 -0
- package/{bin → dist/bin}/main.d.ts +1 -0
- package/dist/bin/main.d.ts.map +1 -0
- package/dist/bin/main.js +2 -0
- package/{bin → dist/bin}/package-json.d.ts +1 -0
- package/dist/bin/package-json.d.ts.map +1 -0
- package/{bin → dist/bin}/path-defaults.d.ts +1 -0
- package/dist/bin/path-defaults.d.ts.map +1 -0
- package/{bin → dist/bin}/prettier.d.ts +1 -0
- package/dist/bin/prettier.d.ts.map +1 -0
- package/{bin → dist/bin}/saltyrc.d.ts +1 -0
- package/dist/bin/saltyrc.d.ts.map +1 -0
- package/dist/bin/templates.d.ts +15 -0
- package/dist/bin/templates.d.ts.map +1 -0
- package/dist/chunk-CMqjfN_6.cjs +1 -0
- package/dist/compiler/get-files.cjs +1 -0
- package/{compiler → dist/compiler}/get-files.d.ts +1 -0
- package/dist/compiler/get-files.d.ts.map +1 -0
- package/dist/compiler/get-files.js +15 -0
- package/dist/compiler/get-function-range.cjs +1 -0
- package/{compiler → dist/compiler}/get-function-range.d.ts +1 -0
- package/dist/compiler/get-function-range.d.ts.map +1 -0
- package/dist/compiler/get-function-range.js +17 -0
- package/dist/compiler/helpers.cjs +1 -0
- package/{compiler → dist/compiler}/helpers.d.ts +1 -0
- package/dist/compiler/helpers.d.ts.map +1 -0
- package/dist/compiler/helpers.js +24 -0
- package/{compiler → dist/compiler}/resolve-import.d.ts +1 -0
- package/dist/compiler/resolve-import.d.ts.map +1 -0
- package/dist/compiler/salty-compiler.cjs +1 -0
- package/{compiler → dist/compiler}/salty-compiler.d.ts +1 -0
- package/dist/compiler/salty-compiler.d.ts.map +1 -0
- package/dist/compiler/salty-compiler.js +2 -0
- package/{config → dist/config}/define-config.d.ts +1 -0
- package/dist/config/define-config.d.ts.map +1 -0
- package/dist/config/index.cjs +1 -0
- package/{config → dist/config}/index.d.ts +1 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +5 -0
- package/dist/css/index.cjs +1 -0
- package/{css → dist/css}/index.d.ts +1 -0
- package/dist/css/index.d.ts.map +1 -0
- package/dist/css/index.js +5 -0
- package/dist/css/keyframes.cjs +1 -0
- package/{css → dist/css}/keyframes.d.ts +1 -0
- package/dist/css/keyframes.d.ts.map +1 -0
- package/dist/css/keyframes.js +30 -0
- package/dist/css/media.cjs +1 -0
- package/{css → dist/css}/media.d.ts +1 -0
- package/dist/css/media.d.ts.map +1 -0
- package/dist/css/media.js +84 -0
- package/dist/css/merge.cjs +1 -0
- package/{css → dist/css}/merge.d.ts +1 -0
- package/dist/css/merge.d.ts.map +1 -0
- package/dist/css/merge.js +20 -0
- package/dist/css/token.cjs +1 -0
- package/{css → dist/css}/token.d.ts +1 -0
- package/dist/css/token.d.ts.map +1 -0
- package/dist/css/token.js +4 -0
- package/{factories → dist/factories}/define-font.d.ts +1 -0
- package/dist/factories/define-font.d.ts.map +1 -0
- package/{factories → dist/factories}/define-global-styles.d.ts +1 -0
- package/dist/factories/define-global-styles.d.ts.map +1 -0
- package/{factories → dist/factories}/define-import.d.ts +1 -0
- package/dist/factories/define-import.d.ts.map +1 -0
- package/{factories → dist/factories}/define-media-query.d.ts +1 -0
- package/dist/factories/define-media-query.d.ts.map +1 -0
- package/{factories → dist/factories}/define-templates.d.ts +1 -0
- package/dist/factories/define-templates.d.ts.map +1 -0
- package/{factories → dist/factories}/define-variables.d.ts +1 -0
- package/dist/factories/define-variables.d.ts.map +1 -0
- package/dist/factories/index.cjs +1 -0
- package/{factories → dist/factories}/index.d.ts +1 -0
- package/dist/factories/index.d.ts.map +1 -0
- package/dist/factories/index.js +149 -0
- package/{generators → dist/generators}/class-name-generator.d.ts +1 -0
- package/dist/generators/class-name-generator.d.ts.map +1 -0
- package/dist/generators/index.cjs +1 -0
- package/{generators → dist/generators}/index.d.ts +1 -0
- package/dist/generators/index.d.ts.map +1 -0
- package/dist/generators/index.js +2 -0
- package/{generators → dist/generators}/styled-generator.d.ts +1 -0
- package/dist/generators/styled-generator.d.ts.map +1 -0
- package/{generators → dist/generators}/styles-generator.d.ts +1 -0
- package/dist/generators/styles-generator.d.ts.map +1 -0
- package/dist/generators-CrK45F8i.js +112 -0
- package/dist/generators-eEKEtyAm.cjs +1 -0
- package/{helpers → dist/helpers}/color.d.ts +1 -0
- package/dist/helpers/color.d.ts.map +1 -0
- package/dist/helpers/index.cjs +1 -0
- package/{helpers → dist/helpers}/index.d.ts +1 -0
- package/dist/helpers/index.d.ts.map +1 -0
- package/dist/helpers/index.js +33 -0
- package/{helpers → dist/helpers}/viewport-clamp.d.ts +1 -0
- package/dist/helpers/viewport-clamp.d.ts.map +1 -0
- package/dist/instances/classname-instance.cjs +1 -0
- package/{instances → dist/instances}/classname-instance.d.ts +1 -0
- package/dist/instances/classname-instance.d.ts.map +1 -0
- package/dist/instances/classname-instance.js +18 -0
- package/dist/main-DGpSu6zK.js +545 -0
- package/dist/main-LnoqOq21.cjs +11 -0
- package/dist/maybe.d.ts +2 -0
- package/dist/maybe.d.ts.map +1 -0
- package/dist/parse-styles-2rwbF9j_.cjs +3 -0
- package/dist/parse-styles-Bz0otiZ-.js +336 -0
- package/dist/parsers/index.cjs +3 -0
- package/{parsers → dist/parsers}/index.d.ts +1 -0
- package/dist/parsers/index.d.ts.map +1 -0
- package/dist/parsers/index.js +79 -0
- package/{parsers → dist/parsers}/parse-modifiers.d.ts +1 -0
- package/dist/parsers/parse-modifiers.d.ts.map +1 -0
- package/{parsers → dist/parsers}/parse-styles.d.ts +1 -0
- package/dist/parsers/parse-styles.d.ts.map +1 -0
- package/{parsers → dist/parsers}/parse-templates.d.ts +1 -0
- package/dist/parsers/parse-templates.d.ts.map +1 -0
- package/{parsers → dist/parsers}/parse-tokens.d.ts +1 -0
- package/dist/parsers/parse-tokens.d.ts.map +1 -0
- package/{parsers → dist/parsers}/parser-regexes.d.ts +1 -0
- package/dist/parsers/parser-regexes.d.ts.map +1 -0
- package/{parsers → dist/parsers}/parser-types.d.ts +1 -0
- package/dist/parsers/parser-types.d.ts.map +1 -0
- package/{parsers → dist/parsers}/property-name-check.d.ts +1 -0
- package/dist/parsers/property-name-check.d.ts.map +1 -0
- package/{parsers → dist/parsers}/resolve-template-variants.d.ts +1 -0
- package/dist/parsers/resolve-template-variants.d.ts.map +1 -0
- package/{parsers → dist/parsers}/strict.d.ts +1 -0
- package/dist/parsers/strict.d.ts.map +1 -0
- package/{parsers → dist/parsers}/unit-check.d.ts +1 -0
- package/dist/parsers/unit-check.d.ts.map +1 -0
- package/dist/runtime/index.cjs +2 -0
- package/{runtime → dist/runtime}/index.d.ts +1 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +20 -0
- package/dist/salty-compiler-Bvd0OKHz.cjs +33 -0
- package/dist/salty-compiler-CvQ-rsex.js +484 -0
- package/dist/salty.config-B0ZiRpHR.cjs +7 -0
- package/dist/salty.config-DWF4i7K0.js +4 -0
- package/dist/server/index.cjs +1 -0
- package/dist/server/index.d.ts +2 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +12 -0
- package/{server → dist/server}/should-restart.d.ts +1 -0
- package/dist/server/should-restart.d.ts.map +1 -0
- package/{styled-file-Cda3EeR6.js → dist/styled-file-BCbAEzBB.cjs} +2 -5
- package/dist/styled-file-C_4eLAdV.js +4 -0
- package/dist/styled-file-DQHLzmuL.js +4 -0
- package/{styled-file-DLcgYmGN.js → dist/styled-file-DorArlCk.cjs} +2 -5
- package/{templates → dist/templates}/salty-reset.d.ts +1 -0
- package/dist/templates/salty-reset.d.ts.map +1 -0
- package/dist/templates-BGHLaAOm.cjs +1 -0
- package/dist/templates-DWWLjEiU.js +4 -0
- package/{types → dist/types}/cli-types.d.ts +1 -0
- package/dist/types/cli-types.d.ts.map +1 -0
- package/{types → dist/types}/config-types.d.ts +1 -0
- package/dist/types/config-types.d.ts.map +1 -0
- package/{types → dist/types}/font-types.d.ts +1 -0
- package/dist/types/font-types.d.ts.map +1 -0
- package/dist/types/index.cjs +0 -0
- package/{types → dist/types}/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +0 -0
- package/{types → dist/types}/util-types.d.ts +1 -0
- package/dist/types/util-types.d.ts.map +1 -0
- package/{util → dist/util}/camel-case.d.ts +1 -0
- package/dist/util/camel-case.d.ts.map +1 -0
- package/{util → dist/util}/dash-case.d.ts +1 -0
- package/dist/util/dash-case.d.ts.map +1 -0
- package/{util → dist/util}/dot-case.d.ts +1 -0
- package/dist/util/dot-case.d.ts.map +1 -0
- package/{util → dist/util}/glob-match.d.ts +1 -0
- package/dist/util/glob-match.d.ts.map +1 -0
- package/dist/util/index.cjs +1 -0
- package/{util → dist/util}/index.d.ts +1 -0
- package/dist/util/index.d.ts.map +1 -0
- package/dist/util/index.js +72 -0
- package/{util → dist/util}/module-type.d.ts +1 -0
- package/dist/util/module-type.d.ts.map +1 -0
- package/{util → dist/util}/pascal-case.d.ts +1 -0
- package/dist/util/pascal-case.d.ts.map +1 -0
- package/{util → dist/util}/to-hash.d.ts +1 -0
- package/dist/util/to-hash.d.ts.map +1 -0
- package/dist/vanilla-file-BEqMIe-6.js +4 -0
- package/{vanilla-file-1kOqbCIM.js → dist/vanilla-file-Z3VsOa_U.cjs} +2 -5
- package/dist/viewport-clamp-CHOyzt37.cjs +1 -0
- package/dist/viewport-clamp-CRtzRvJ3.js +7 -0
- package/package.json +67 -64
- package/README.md +0 -535
- package/astro-component-5hrNTCJ5.js +0 -4
- package/astro-component-Dj3enX6K.cjs +0 -4
- package/bin/index.cjs +0 -4
- package/bin/index.d.ts +0 -2
- package/bin/index.js +0 -3
- package/bin/main.cjs +0 -783
- package/bin/main.js +0 -782
- package/bin/templates.d.ts +0 -14
- package/class-name-generator-BcbeZdcV.cjs +0 -88
- package/class-name-generator-DJ27JHW_.js +0 -89
- package/compiler/get-files.cjs +0 -25
- package/compiler/get-files.js +0 -25
- package/compiler/get-function-range.cjs +0 -22
- package/compiler/get-function-range.js +0 -22
- package/compiler/helpers.cjs +0 -34
- package/compiler/helpers.js +0 -33
- package/compiler/salty-compiler.cjs +0 -845
- package/compiler/salty-compiler.js +0 -827
- package/config/index.cjs +0 -20
- package/config/index.js +0 -20
- package/css/index.cjs +0 -12
- package/css/index.js +0 -12
- package/css/keyframes.cjs +0 -49
- package/css/keyframes.js +0 -49
- package/css/media.cjs +0 -93
- package/css/media.js +0 -93
- package/css/merge.cjs +0 -20
- package/css/merge.js +0 -20
- package/css/token.cjs +0 -4
- package/css/token.js +0 -4
- package/define-templates-CVhhgPnd.js +0 -60
- package/define-templates-Deq1aCbN.cjs +0 -59
- package/factories/index.cjs +0 -177
- package/factories/index.js +0 -177
- package/generators/index.cjs +0 -58
- package/generators/index.js +0 -59
- package/glob-match-C28iYp1A.js +0 -74
- package/glob-match-CT1uFlp-.cjs +0 -73
- package/helpers/index.cjs +0 -53
- package/helpers/index.js +0 -53
- package/index-ByR0nfaf.cjs +0 -4
- package/index-DKz1QXqs.js +0 -4
- package/instances/classname-instance.cjs +0 -31
- package/instances/classname-instance.js +0 -31
- package/parse-styles-BlUpavVg.js +0 -521
- package/parse-styles-DWT4tDyS.cjs +0 -520
- package/parsers/index.cjs +0 -147
- package/parsers/index.js +0 -148
- package/pascal-case-By_l58S-.cjs +0 -7
- package/pascal-case-F3Usi5Wf.js +0 -8
- package/runtime/index.cjs +0 -24
- package/runtime/index.js +0 -24
- package/salty.config-DogY_sSQ.cjs +0 -4
- package/salty.config-GV37Q-D2.js +0 -4
- package/server/index.cjs +0 -4
- package/server/index.d.ts +0 -1
- package/server/index.js +0 -4
- package/should-restart-CQsyHls3.cjs +0 -17
- package/should-restart-CXIO0jxY.js +0 -18
- package/styled-file-BzmB9_Ez.cjs +0 -12
- package/styled-file-CPd_rTW2.cjs +0 -11
- package/to-hash-DSoCPs8D.js +0 -33
- package/to-hash-DT2ImSPA.cjs +0 -32
- package/types/index.cjs +0 -1
- package/types/index.js +0 -1
- package/util/index.cjs +0 -18
- package/util/index.js +0 -18
- package/vanilla-file-r0fp2q_m.cjs +0 -18
- package/viewport-clamp-CEmzmcSj.cjs +0 -10
- package/viewport-clamp-K553uXu3.js +0 -11
- /package/{.saltyrc.schema.json → dist/.saltyrc.schema.json} +0 -0
|
@@ -0,0 +1,484 @@
|
|
|
1
|
+
import { isSaltyFile as e, resolveExportValue as t, saltyFileExtensions as n } from "./compiler/helpers.js";
|
|
2
|
+
import { dashCase as r, isPathAllowed as i, normalizePath as a, toHash as o } from "./util/index.js";
|
|
3
|
+
import { defineTemplates as s } from "./factories/index.js";
|
|
4
|
+
import { s as c, t as l } from "./parse-styles-Bz0otiZ-.js";
|
|
5
|
+
import { mergeFactories as u, mergeObjects as d } from "./css/merge.js";
|
|
6
|
+
import "./css/index.js";
|
|
7
|
+
import { getPackageJson as f } from "./compiler/get-files.js";
|
|
8
|
+
import { getTemplateTypes as p, getTemplateVariantMaps as m, parseTemplates as h } from "./parsers/index.js";
|
|
9
|
+
import { copyFileSync as g, existsSync as _, mkdirSync as v, readFileSync as y, readdirSync as b, statSync as x, writeFileSync as S } from "fs";
|
|
10
|
+
import * as C from "esbuild";
|
|
11
|
+
import { basename as w, dirname as T, join as E, parse as D, relative as O, resolve as k } from "path";
|
|
12
|
+
import { createLogger as A, format as j, transports as M } from "winston";
|
|
13
|
+
import { readFile as N } from "fs/promises";
|
|
14
|
+
import { execSync as P } from "child_process";
|
|
15
|
+
import { createRequire as F } from "module";
|
|
16
|
+
//#region src/bin/logger.ts
|
|
17
|
+
var I = A({
|
|
18
|
+
level: "debug",
|
|
19
|
+
format: j.combine(j.colorize(), j.cli()),
|
|
20
|
+
transports: [new M.Console({})]
|
|
21
|
+
}), L = (e) => {
|
|
22
|
+
I.error(e);
|
|
23
|
+
}, R = /^(?:[a-z][a-z0-9+.-]*:)?\/\//i, z = (e) => typeof e == "string" ? { url: e } : e, B = (e) => e.startsWith(".") || e.startsWith("/") ? e : `./${e}`, V = (e) => e.split("\\").join("/"), H = (e, t) => F(t).resolve(e), U = (e, t) => {
|
|
24
|
+
let n = T(t);
|
|
25
|
+
_(n) || v(n, { recursive: !0 }), g(e, t);
|
|
26
|
+
}, W = (e, { media: t, supports: n }) => {
|
|
27
|
+
let r = `@import url('${e}')`;
|
|
28
|
+
return n && (r += ` supports(${n})`), t && (r += ` ${t}`), `${r};`;
|
|
29
|
+
}, G = (e, t, n, r = {}) => {
|
|
30
|
+
let i = z(e), { url: a } = i, s = r.resolveModule ?? H, c = r.copyAsset ?? U;
|
|
31
|
+
if (R.test(a) || a.startsWith("/")) return { rule: W(a, i) };
|
|
32
|
+
if (a.startsWith("./") || a.startsWith("../")) {
|
|
33
|
+
let e = k(T(t), a);
|
|
34
|
+
return { rule: W(B(V(O(E(n, "css"), e))), i) };
|
|
35
|
+
}
|
|
36
|
+
let l = s(a.startsWith("~") ? a.slice(1) : a, t), u = `${o(l, 6)}-${w(l)}`;
|
|
37
|
+
return c(l, E(n, "imports", u)), { rule: W(`../imports/${u}`, i) };
|
|
38
|
+
}, K = async (e) => {
|
|
39
|
+
let t = await f(e);
|
|
40
|
+
if (t) return t.type;
|
|
41
|
+
}, q, J = async (e) => {
|
|
42
|
+
if (q) return q;
|
|
43
|
+
let t = await K(e);
|
|
44
|
+
return t === "module" ? q = "esm" : (t === "commonjs" || import.meta.url.endsWith(".cjs")) && (q = "cjs"), q || "esm";
|
|
45
|
+
};
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/util/dot-case.ts
|
|
48
|
+
function Y(e) {
|
|
49
|
+
return e ? typeof e == "string" ? e.replace(/[^\d\w]/g, ".") : Y(String(e)) : "";
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region src/templates/salty-reset.ts
|
|
53
|
+
var X = {
|
|
54
|
+
"*, *::before, *::after": { boxSizing: "border-box" },
|
|
55
|
+
"*": { margin: 0 },
|
|
56
|
+
html: {
|
|
57
|
+
lineHeight: 1.15,
|
|
58
|
+
textSizeAdjust: "100%",
|
|
59
|
+
WebkitFontSmoothing: "antialiased"
|
|
60
|
+
},
|
|
61
|
+
"img, picture, video, canvas, svg": {
|
|
62
|
+
display: "block",
|
|
63
|
+
maxWidth: "100%"
|
|
64
|
+
},
|
|
65
|
+
"p, h1, h2, h3, h4, h5, h6": { overflowWrap: "break-word" },
|
|
66
|
+
p: { textWrap: "pretty" },
|
|
67
|
+
"h1, h2, h3, h4, h5, h6": { textWrap: "balance" },
|
|
68
|
+
a: { color: "currentColor" },
|
|
69
|
+
button: {
|
|
70
|
+
lineHeight: "1em",
|
|
71
|
+
color: "currentColor"
|
|
72
|
+
},
|
|
73
|
+
"input, optgroup, select, textarea": {
|
|
74
|
+
fontFamily: "inherit",
|
|
75
|
+
fontSize: "100%",
|
|
76
|
+
lineHeight: "1.15em"
|
|
77
|
+
}
|
|
78
|
+
}, Z = class {
|
|
79
|
+
projectRootDir;
|
|
80
|
+
options;
|
|
81
|
+
importFile = (e) => import(
|
|
82
|
+
/* @vite-ignore */
|
|
83
|
+
`${e}?t=${Date.now()}`
|
|
84
|
+
);
|
|
85
|
+
cache = {
|
|
86
|
+
rcFile: null,
|
|
87
|
+
destDir: null,
|
|
88
|
+
externalModules: []
|
|
89
|
+
};
|
|
90
|
+
constructor(e, t = {}) {
|
|
91
|
+
if (this.projectRootDir = e, this.options = t, typeof process > "u") throw Error("SaltyServer can only be used in a Node.js environment.");
|
|
92
|
+
}
|
|
93
|
+
get isProduction() {
|
|
94
|
+
if (this.options.mode) return this.options.mode === "production";
|
|
95
|
+
try {
|
|
96
|
+
return process.env.NODE_ENV !== "development";
|
|
97
|
+
} catch {
|
|
98
|
+
return !1;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
readRCFile = async (e = this.projectRootDir) => {
|
|
102
|
+
if (this.cache.rcFile) return this.cache.rcFile;
|
|
103
|
+
if (e === "/") throw Error("Could not find .saltyrc.json file");
|
|
104
|
+
let t = await N(E(e, ".saltyrc.json"), "utf-8").then(JSON.parse).catch(() => void 0);
|
|
105
|
+
return t ? (this.cache.rcFile = t, t) : this.readRCFile(E(e, ".."));
|
|
106
|
+
};
|
|
107
|
+
getRCProjectConfig = async (e) => {
|
|
108
|
+
let t = await this.readRCFile(e);
|
|
109
|
+
return t.projects?.find((t) => e.endsWith(t.dir || "")) || t.projects?.find((e) => e.dir === t.defaultProject);
|
|
110
|
+
};
|
|
111
|
+
getPathFilter = async () => {
|
|
112
|
+
let e = await this.getRCProjectConfig(this.projectRootDir);
|
|
113
|
+
return {
|
|
114
|
+
include: e?.include,
|
|
115
|
+
exclude: e?.exclude
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
isAllowedSaltyFile = (t, n) => e(t) ? i(a(O(this.projectRootDir, t)), n) : !1;
|
|
119
|
+
getExternalModules = (e) => {
|
|
120
|
+
if (this.cache.externalModules.length > 0) return this.cache.externalModules;
|
|
121
|
+
let t = y(e, "utf8").match(/externalModules:\s?\[(.*)\]/);
|
|
122
|
+
if (!t) return [];
|
|
123
|
+
let n = t[1].split(",").map((e) => e.replace(/['"`]/g, "").trim());
|
|
124
|
+
return this.cache.externalModules = n, n;
|
|
125
|
+
};
|
|
126
|
+
getDestDir = async () => {
|
|
127
|
+
if (this.cache.destDir) return this.cache.destDir;
|
|
128
|
+
let e = await this.getRCProjectConfig(this.projectRootDir), t = E(this.projectRootDir, e?.saltygenDir || "saltygen");
|
|
129
|
+
return this.cache.destDir = t, t;
|
|
130
|
+
};
|
|
131
|
+
generateConfig = async () => {
|
|
132
|
+
let e = await this.getRCProjectConfig(this.projectRootDir), t = await this.getDestDir(), n = E(this.projectRootDir, e?.configDir || "", "salty.config.ts"), r = E(t, "salty.config.js"), i = await J(this.projectRootDir), a = this.getExternalModules(n);
|
|
133
|
+
await C.build({
|
|
134
|
+
entryPoints: [n],
|
|
135
|
+
minify: !0,
|
|
136
|
+
treeShaking: !0,
|
|
137
|
+
bundle: !0,
|
|
138
|
+
outfile: r,
|
|
139
|
+
format: i,
|
|
140
|
+
external: a
|
|
141
|
+
});
|
|
142
|
+
let { config: o } = await this.importFile(r);
|
|
143
|
+
return {
|
|
144
|
+
config: o,
|
|
145
|
+
path: r
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
addConfigCache = (e) => {
|
|
149
|
+
try {
|
|
150
|
+
let t = y(E(this.projectRootDir, "saltygen/cache/config-cache.json"), "utf8");
|
|
151
|
+
return t ? `globalThis.saltyConfig = ${t};\n\n${e}` : `globalThis.saltyConfig = {};\n\n${e}`;
|
|
152
|
+
} catch {
|
|
153
|
+
return e;
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
getConfigCache = async () => {
|
|
157
|
+
let e = y(E(await this.getDestDir(), "cache/config-cache.json"), "utf8");
|
|
158
|
+
if (!e) throw Error("Could not find config cache file");
|
|
159
|
+
return JSON.parse(e);
|
|
160
|
+
};
|
|
161
|
+
getConfig = async () => {
|
|
162
|
+
let e = await this.getConfigCache(), t = E(await this.getDestDir(), "salty.config.js"), { config: n } = await this.importFile(t);
|
|
163
|
+
return d(n, e);
|
|
164
|
+
};
|
|
165
|
+
generateCss = async (n = !0) => {
|
|
166
|
+
try {
|
|
167
|
+
let s = Date.now();
|
|
168
|
+
this.isProduction ? I.info("Generating CSS in production mode! 🔥") : I.info("Generating CSS in development mode! 🚀");
|
|
169
|
+
let c = [], l = [], u = await this.getDestDir(), d = E(u, "index.css");
|
|
170
|
+
n && (_(u) && P("rm -rf " + u), v(u, { recursive: !0 }), v(E(u, "css")), v(E(u, "types")), v(E(u, "js")), v(E(u, "cache")), v(E(u, "imports")));
|
|
171
|
+
let f = /* @__PURE__ */ new Set(), p = /* @__PURE__ */ new Set(), m = await this.getPathFilter(), { exclude: h } = m, g = this.projectRootDir;
|
|
172
|
+
async function C(t) {
|
|
173
|
+
let n = ["node_modules", "saltygen"], r = x(t);
|
|
174
|
+
if (r.isDirectory()) {
|
|
175
|
+
if (n.some((e) => t.includes(e))) return;
|
|
176
|
+
if (h?.length) {
|
|
177
|
+
let e = a(O(g, t));
|
|
178
|
+
if (e && !i(e, { exclude: h })) return;
|
|
179
|
+
}
|
|
180
|
+
let e = b(t);
|
|
181
|
+
await Promise.all(e.map((e) => C(E(t, e))));
|
|
182
|
+
} else if (r.isFile() && e(t) && i(a(O(g, t)), m)) {
|
|
183
|
+
f.add(t);
|
|
184
|
+
let e = y(t, "utf8");
|
|
185
|
+
/define[\w\d]+\(/.test(e) && p.add(t);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
await C(this.projectRootDir), await this.generateConfigStyles(p);
|
|
189
|
+
let w = {
|
|
190
|
+
keyframes: [],
|
|
191
|
+
components: [],
|
|
192
|
+
classNames: []
|
|
193
|
+
};
|
|
194
|
+
await Promise.all([...f].map(async (e) => {
|
|
195
|
+
let { contents: n } = await this.compileSaltyFile(e, u);
|
|
196
|
+
for (let [r, i] of Object.entries(n)) {
|
|
197
|
+
let n = await t(i, 1);
|
|
198
|
+
n.isKeyframes ? w.keyframes.push({
|
|
199
|
+
value: n,
|
|
200
|
+
src: e,
|
|
201
|
+
name: r
|
|
202
|
+
}) : n.isClassName ? w.classNames.push({
|
|
203
|
+
...i,
|
|
204
|
+
src: e,
|
|
205
|
+
name: r
|
|
206
|
+
}) : n.generator && w.components.push({
|
|
207
|
+
...i,
|
|
208
|
+
src: e,
|
|
209
|
+
name: r
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
}));
|
|
213
|
+
let T = await this.getConfig();
|
|
214
|
+
for (let e of w.keyframes) {
|
|
215
|
+
let { value: t } = e, n = `a_${t.animationName}.css`, r = E(u, `css/${n}`);
|
|
216
|
+
c.push(n), S(r, t.css);
|
|
217
|
+
}
|
|
218
|
+
let k = {};
|
|
219
|
+
for (let e of w.components) {
|
|
220
|
+
let { src: t, name: n } = e;
|
|
221
|
+
k[t] || (k[t] = []);
|
|
222
|
+
let r = e.generator._withBuildContext({
|
|
223
|
+
callerName: n,
|
|
224
|
+
isProduction: this.isProduction,
|
|
225
|
+
config: T
|
|
226
|
+
});
|
|
227
|
+
l[r.priority] || (l[r.priority] = []);
|
|
228
|
+
let i = await r.css;
|
|
229
|
+
i && (l[r.priority].push(r.cssFileName), S(E(u, `css/${r.cssFileName}`), i), T.importStrategy === "component" && k[t].push(r.cssFileName));
|
|
230
|
+
}
|
|
231
|
+
for (let e of w.classNames) {
|
|
232
|
+
let { src: t, name: n } = e;
|
|
233
|
+
k[t] || (k[t] = []);
|
|
234
|
+
let r = e.generator._withBuildContext({
|
|
235
|
+
callerName: n,
|
|
236
|
+
isProduction: this.isProduction,
|
|
237
|
+
config: T
|
|
238
|
+
}), i = await r.css;
|
|
239
|
+
i && (l[r.priority] || (l[r.priority] = []), l[r.priority].push(r.cssFileName), S(E(u, `css/${r.cssFileName}`), i), T.importStrategy === "component" && k[t].push(r.cssFileName));
|
|
240
|
+
}
|
|
241
|
+
T.importStrategy === "component" && Object.entries(k).forEach(([e, t]) => {
|
|
242
|
+
let n = t.map((e) => `@import url('./${e}');`).join("\n"), i = o(e, 6);
|
|
243
|
+
S(E(u, `css/f_${r(D(e).name)}-${i}.css`), n || "/* Empty file */");
|
|
244
|
+
});
|
|
245
|
+
let A = c.map((e) => `@import url('./css/${e}');`).join("\n"), j = `/*!
|
|
246
|
+
* Generated with Salty CSS (https://salty-css.dev)
|
|
247
|
+
* Do not edit this file directly
|
|
248
|
+
*/
|
|
249
|
+
@layer imports, reset, global, templates, fonts, l0, l1, l2, l3, l4, l5, l6, l7, l8;\n\n${[
|
|
250
|
+
"_imports.css",
|
|
251
|
+
"_variables.css",
|
|
252
|
+
"_reset.css",
|
|
253
|
+
"_global.css",
|
|
254
|
+
"_templates.css",
|
|
255
|
+
"_fonts.css"
|
|
256
|
+
].filter((e) => {
|
|
257
|
+
try {
|
|
258
|
+
return y(E(u, "css", e), "utf8").length > 0;
|
|
259
|
+
} catch {
|
|
260
|
+
return !1;
|
|
261
|
+
}
|
|
262
|
+
}).map((e) => `@import url('./css/${e}')${e === "_imports.css" ? " layer(imports)" : ""};`).join("\n")}\n${A}`;
|
|
263
|
+
if (T.importStrategy !== "component") {
|
|
264
|
+
let e = l.reduce((e, t, n) => {
|
|
265
|
+
let r = t.reduce((e, t) => {
|
|
266
|
+
let n = E(u, "css", t), r = y(n, "utf8"), i = /.*-([^-]+)-\d+.css/.exec(t)?.at(1) || o(n, 6);
|
|
267
|
+
return e.includes(i) ? e : `${e}\n/*start:${i}-${t}*/\n${r}\n/*end:${i}*/\n`;
|
|
268
|
+
}, ""), i = `l_${n}.css`;
|
|
269
|
+
return S(E(u, "css", i), `@layer l${n} { ${r}\n }`), `${e}\n@import url('./css/${i}');`;
|
|
270
|
+
}, "");
|
|
271
|
+
j += e;
|
|
272
|
+
}
|
|
273
|
+
S(d, j);
|
|
274
|
+
let M = Date.now() - s, N = M < 200 ? "🔥" : M < 500 ? "🚀" : M < 1e3 ? "🎉" : M < 2e3 ? "🚗" : M < 5e3 ? "🤔" : "🥴";
|
|
275
|
+
I.info(`Generated CSS in ${M}ms! ${N}`);
|
|
276
|
+
} catch (e) {
|
|
277
|
+
console.error(e);
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
generateConfigStyles = async (e) => {
|
|
281
|
+
let t = await this.getDestDir(), n = {
|
|
282
|
+
mediaQueries: [],
|
|
283
|
+
globalStyles: [],
|
|
284
|
+
variables: [],
|
|
285
|
+
templates: [],
|
|
286
|
+
imports: [],
|
|
287
|
+
fonts: []
|
|
288
|
+
};
|
|
289
|
+
await Promise.all([...e].map(async (e) => {
|
|
290
|
+
let { contents: r, outputFilePath: i } = await this.compileSaltyFile(e, t);
|
|
291
|
+
Object.entries(r).forEach(([t, r]) => {
|
|
292
|
+
r.isMedia ? n.mediaQueries.push([t, r]) : r.isGlobalDefine ? n.globalStyles.push(r) : r.isDefineVariables ? n.variables.push(r) : r.isDefineTemplates ? n.templates.push(r._setPath(`${t};;${i}`)) : r.isDefineImport ? n.imports.push(r._setPath(e)) : r.isDefineFont && n.fonts.push(r);
|
|
293
|
+
});
|
|
294
|
+
}));
|
|
295
|
+
let { config: i, path: a } = await this.generateConfig(), o = { ...i }, { mediaQueries: f } = n;
|
|
296
|
+
o.mediaQueries = Object.fromEntries(f.map(([e, t]) => [`@${e}`, t]));
|
|
297
|
+
let g = f.map(([e]) => `'@${e}'`).join(" | "), _ = /* @__PURE__ */ new Set(), v = async (e, t = []) => {
|
|
298
|
+
if (!e) return [];
|
|
299
|
+
let n = Object.entries(e).map(async ([e, n]) => {
|
|
300
|
+
let i = async (n) => {
|
|
301
|
+
if (!n) return;
|
|
302
|
+
if (n instanceof Promise) return await i(await n);
|
|
303
|
+
if (typeof n == "function") return await i(await n());
|
|
304
|
+
if (typeof n == "object") return await v(n, [...t, e]);
|
|
305
|
+
let a = Y(e), o = r(e), s = [...t, a].join(".");
|
|
306
|
+
_.add(`"${s}"`);
|
|
307
|
+
let l = [...t.map(r), o].join("-"), u = c(n);
|
|
308
|
+
return u ? `--${l}: ${u.transformed};` : `--${l}: ${n};`;
|
|
309
|
+
};
|
|
310
|
+
return await i(n);
|
|
311
|
+
});
|
|
312
|
+
return (await Promise.all(n)).flat();
|
|
313
|
+
}, y = async (e) => {
|
|
314
|
+
if (!e) return [];
|
|
315
|
+
let t = Object.entries(e).map(async ([e, t]) => {
|
|
316
|
+
let n = await v(t);
|
|
317
|
+
return e === "base" ? n.join("") : o.mediaQueries[e] ? `${o.mediaQueries[e]} { ${n.join("")} }` : `${e} { ${n.join("")} }`;
|
|
318
|
+
});
|
|
319
|
+
return (await Promise.all(t)).flat();
|
|
320
|
+
}, b = async (e) => {
|
|
321
|
+
if (!e) return [];
|
|
322
|
+
let t = Object.entries(e).map(async ([e, t]) => {
|
|
323
|
+
let n = Object.entries(t).map(async ([t, n]) => {
|
|
324
|
+
let r = await v(n, [e]);
|
|
325
|
+
return `${`.${e}-${t}, [data-${e}="${t}"]`} { ${r.join("")} }`;
|
|
326
|
+
});
|
|
327
|
+
return (await Promise.all(n)).flat();
|
|
328
|
+
});
|
|
329
|
+
return (await Promise.all(t)).flat();
|
|
330
|
+
}, x = (e = {}) => ({
|
|
331
|
+
...e,
|
|
332
|
+
responsive: void 0,
|
|
333
|
+
conditional: void 0
|
|
334
|
+
}), C = (e) => n.variables.map((t) => e === "static" ? x(t._current) : t._current[e]), w = d(x(i.variables), C("static")), T = await v(w), D = await y(d(i.variables?.responsive, C("responsive"))), O = await b(d(i.variables?.conditional, C("conditional")));
|
|
335
|
+
S(E(t, "css/_variables.css"), `:root { ${T.join("")} ${D.join("")} } ${O.join("")}`), o.staticVariables = w, S(E(t, "css/_global.css"), `@layer global { ${await l(d(i.global, n.globalStyles), "")} }`), S(E(t, "css/_reset.css"), `@layer reset { ${await l(i.reset === "none" ? {} : typeof i.reset == "object" ? i.reset : X, "")} }`);
|
|
336
|
+
let k = E(t, "css/_templates.css"), A = d(i.templates, n.templates), j = await h(A), M = p(A), N = m(A);
|
|
337
|
+
S(k, `@layer templates { ${j} }`), o.templates = A;
|
|
338
|
+
let P = E(t, "css/_imports.css"), F = [];
|
|
339
|
+
for (let e of n.imports) {
|
|
340
|
+
let n = e._path;
|
|
341
|
+
if (n) for (let r of e._current) try {
|
|
342
|
+
let { rule: e } = G(r, n, t);
|
|
343
|
+
F.push(e);
|
|
344
|
+
} catch (e) {
|
|
345
|
+
let t = typeof r == "string" ? r : r.url;
|
|
346
|
+
I.error(`Failed to resolve defineImport(${JSON.stringify(t)}) from ${n}: ${e.message}`);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
S(P, F.join("\n"));
|
|
350
|
+
let L = i.templates ? [s(i.templates)._setPath(`config;;${a}`)] : [], R = u(n.templates, L);
|
|
351
|
+
o.templatePaths = Object.fromEntries(Object.entries(R).map(([e, t]) => [e, t._path]));
|
|
352
|
+
let z = E(t, "css/_fonts.css");
|
|
353
|
+
if (n.fonts.length === 0) S(z, "");
|
|
354
|
+
else {
|
|
355
|
+
let e = [], t = [];
|
|
356
|
+
for (let r of n.fonts) {
|
|
357
|
+
let { imports: n, body: i } = r._toCss();
|
|
358
|
+
e.push(...n), t.push(i);
|
|
359
|
+
}
|
|
360
|
+
S(z, `${e.length ? `${e.join("\n")}\n\n` : ""}@layer fonts { ${t.join(" ")} }`);
|
|
361
|
+
}
|
|
362
|
+
let B = E(t, "types/css-tokens.d.ts"), V = [..._].join("|"), H = (e) => e.split(/[.\-_]/).filter(Boolean).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join(""), U = Object.entries(N), W = U.some(([, e]) => Object.keys(e).length > 0) ? `type TemplateVariantTokens = {
|
|
363
|
+
${U.filter(([, e]) => Object.keys(e).length > 0).map(([e, t]) => `${e}: {\n ${Object.entries(t).map(([e, t]) => `'${e}': { ${Object.entries(t).map(([e, t]) => `${e}?: ${t}`).join("; ")} }`).join(";\n ")}\n }`).join(";\n ")}
|
|
364
|
+
}` : "type TemplateVariantTokens = Record<string, Record<string, Record<string, never>>>;", K = U.flatMap(([e, t]) => Object.keys(t).map((t) => `type ${H(e)}${H(t)}Variants = TemplateVariantTokens['${e}']['${t}'];`)).join("\n ");
|
|
365
|
+
S(B, `
|
|
366
|
+
// Variable types
|
|
367
|
+
type VariableTokens = ${V || "''"};
|
|
368
|
+
type PropertyValueToken = \`{\${VariableTokens}}\`;
|
|
369
|
+
|
|
370
|
+
// Template types
|
|
371
|
+
type TemplateTokens = {
|
|
372
|
+
${Object.entries(M).map(([e, t]) => !t || t === "any" ? `${e}?: ${t || "any"}` : `${e}?: ${t} | \`\${${t}}@\${string}\``).join("\n")}
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
// Template variant types (per docs/template-variants-spec.md §7)
|
|
376
|
+
${W}
|
|
377
|
+
${K}
|
|
378
|
+
|
|
379
|
+
// Media query types
|
|
380
|
+
type MediaQueryKeys = ${g || "''"};
|
|
381
|
+
`), S(E(t, "cache/config-cache.json"), JSON.stringify(o, null, 2));
|
|
382
|
+
};
|
|
383
|
+
compileSaltyFile = async (e, t) => {
|
|
384
|
+
let n = o(e), r = E(t, "./temp");
|
|
385
|
+
_(r) || v(r);
|
|
386
|
+
let i = D(e), a = y(e, "utf8");
|
|
387
|
+
a = this.replaceStyledTag(a), a = this.addConfigCache(a);
|
|
388
|
+
let s = E(t, "js", `${n}-${o(a)}.js`), c = await this.getRCProjectConfig(this.projectRootDir), l = E(this.projectRootDir, c?.configDir || "", "salty.config.ts"), u = this.getExternalModules(l), d = await J(this.projectRootDir);
|
|
389
|
+
return await C.build({
|
|
390
|
+
stdin: {
|
|
391
|
+
contents: a,
|
|
392
|
+
sourcefile: i.base,
|
|
393
|
+
resolveDir: i.dir,
|
|
394
|
+
loader: "tsx"
|
|
395
|
+
},
|
|
396
|
+
minify: !0,
|
|
397
|
+
treeShaking: !0,
|
|
398
|
+
bundle: !0,
|
|
399
|
+
outfile: s,
|
|
400
|
+
format: d,
|
|
401
|
+
target: ["node20"],
|
|
402
|
+
keepNames: !0,
|
|
403
|
+
external: u,
|
|
404
|
+
packages: "external",
|
|
405
|
+
plugins: [{
|
|
406
|
+
name: "test",
|
|
407
|
+
setup: (e) => {
|
|
408
|
+
e.onLoad({ filter: /.*\.css|salty|styles|styled\.ts/ }, (e) => {
|
|
409
|
+
let t = y(e.path, "utf8");
|
|
410
|
+
return {
|
|
411
|
+
contents: this.replaceStyledTag(t),
|
|
412
|
+
loader: "ts"
|
|
413
|
+
};
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
}]
|
|
417
|
+
}), {
|
|
418
|
+
contents: await this.importFile(s),
|
|
419
|
+
outputFilePath: s
|
|
420
|
+
};
|
|
421
|
+
};
|
|
422
|
+
getFramework = async () => (await this.getRCProjectConfig(this.projectRootDir))?.framework;
|
|
423
|
+
generateFile = async (e) => {
|
|
424
|
+
try {
|
|
425
|
+
let n = await this.getDestDir(), i = await this.getPathFilter();
|
|
426
|
+
if (this.isAllowedSaltyFile(e, i)) {
|
|
427
|
+
let i = [], a = await this.getConfig(), { contents: s } = await this.compileSaltyFile(e, n);
|
|
428
|
+
for (let [e, r] of Object.entries(s)) {
|
|
429
|
+
let o = await t(r, 1);
|
|
430
|
+
if (o.isKeyframes && o.css) {
|
|
431
|
+
S(E(n, `css/${`a_${o.animationName}.css`}`), await o.css);
|
|
432
|
+
continue;
|
|
433
|
+
}
|
|
434
|
+
if (o.isClassName) {
|
|
435
|
+
let t = o.generator._withBuildContext({
|
|
436
|
+
callerName: e,
|
|
437
|
+
isProduction: this.isProduction,
|
|
438
|
+
config: a
|
|
439
|
+
}), r = await t.css;
|
|
440
|
+
if (!r) continue;
|
|
441
|
+
i[t.priority] || (i[t.priority] = []), i[t.priority].push(t.cssFileName), S(E(n, `css/${t.cssFileName}`), r);
|
|
442
|
+
continue;
|
|
443
|
+
}
|
|
444
|
+
if (!o.generator) continue;
|
|
445
|
+
let s = o.generator._withBuildContext({
|
|
446
|
+
callerName: e,
|
|
447
|
+
isProduction: this.isProduction,
|
|
448
|
+
config: a
|
|
449
|
+
}), c = await s.css;
|
|
450
|
+
c && (S(E(n, `css/${s.cssFileName}`), c), i[s.priority] || (i[s.priority] = []), i[s.priority].push(s.cssFileName));
|
|
451
|
+
}
|
|
452
|
+
if (a.importStrategy !== "component") i.forEach((e, t) => {
|
|
453
|
+
let r = E(n, "css", `l_${t}.css`), i = y(r, "utf8");
|
|
454
|
+
e.forEach((e) => {
|
|
455
|
+
let t = E(n, "css", e), r = /.*-([^-]+)-\d+.css/.exec(e)?.at(1) || o(t, 6);
|
|
456
|
+
if (!i.includes(r)) {
|
|
457
|
+
let n = `/*start:${r}-${e}*/\n${y(t, "utf8")}\n/*end:${r}*/\n`;
|
|
458
|
+
i = `${i.replace(/\}$/, "")}\n${n}\n}`;
|
|
459
|
+
}
|
|
460
|
+
}), S(r, i);
|
|
461
|
+
});
|
|
462
|
+
else {
|
|
463
|
+
let t = i.flat().map((e) => `@import url('./${e}');`).join("\n"), a = o(e, 6);
|
|
464
|
+
S(E(n, `css/f_${r(D(e).name)}-${a}.css`), t || "/* Empty file */");
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
} catch (e) {
|
|
468
|
+
console.error(e);
|
|
469
|
+
}
|
|
470
|
+
};
|
|
471
|
+
replaceStyledTag = (e) => e.replace(/styled\(([^"'`{,]+),/g, (t, r) => {
|
|
472
|
+
if (/^['"`]/.test(r)) return t;
|
|
473
|
+
let i = RegExp(`import[^;]*${r}[,\\s{][^;]*from\\s?([^{};]+);`);
|
|
474
|
+
if (!i.test(e)) return t;
|
|
475
|
+
let a = i.exec(e);
|
|
476
|
+
if (a) {
|
|
477
|
+
let e = a.at(1);
|
|
478
|
+
if (n.some((t) => e?.includes(t))) return t;
|
|
479
|
+
}
|
|
480
|
+
return "styled('div',";
|
|
481
|
+
});
|
|
482
|
+
};
|
|
483
|
+
//#endregion
|
|
484
|
+
export { L as n, I as r, Z as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../compiler/helpers.cjs");let t=require("fs/promises");var n=async n=>{if(!n||n.includes(`node_modules`)||n.includes(`saltygen`))return!1;if(n.includes(`salty.config`))return!0;if(!e.isSaltyFile(n))return!1;let r=await(0,t.readFile)(n,`utf-8`);return!!(/.+define[A-Z]\w+/.test(r)||/.+keyframes\(.+/.test(r))};exports.checkShouldRestart=n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { isSaltyFile as e } from "../compiler/helpers.js";
|
|
2
|
+
import { readFile as t } from "fs/promises";
|
|
3
|
+
//#region src/server/should-restart.ts
|
|
4
|
+
var n = async (n) => {
|
|
5
|
+
if (!n || n.includes("node_modules") || n.includes("saltygen")) return !1;
|
|
6
|
+
if (n.includes("salty.config")) return !0;
|
|
7
|
+
if (!e(n)) return !1;
|
|
8
|
+
let r = await t(n, "utf-8");
|
|
9
|
+
return !!(/.+define[A-Z]\w+/.test(r) || /.+keyframes\(.+/.test(r));
|
|
10
|
+
};
|
|
11
|
+
//#endregion
|
|
12
|
+
export { n as checkShouldRestart };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"should-restart.d.ts","sourceRoot":"","sources":["../../src/server/should-restart.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kBAAkB,GAAU,UAAU,MAAM,KAAG,OAAO,CAAC,OAAO,CAa1E,CAAC"}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
var e=`import { styled } from "@salty-css/react/styled";
|
|
2
2
|
|
|
3
3
|
export const <%- name %> = styled('<%- tag %>', {
|
|
4
4
|
<% if(className) { %>className: '<%- className %>',<% } %>
|
|
5
5
|
base: {
|
|
6
6
|
// Add your styles here
|
|
7
7
|
}
|
|
8
|
-
})`;
|
|
9
|
-
export {
|
|
10
|
-
styledFile as default
|
|
11
|
-
};
|
|
8
|
+
})`;exports.default=e;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
//#region src/bin/templates/react/styled-file.ts__template
|
|
2
|
+
var e = "import { styled } from \"@salty-css/react/styled\";\n\nexport const <%- name %> = styled('<%- tag %>', {\n <% if(className) { %>className: '<%- className %>',<% } %>\n base: {\n // Add your styles here\n }\n})";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { e as default };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
//#region src/bin/templates/astro/styled-file.ts__template
|
|
2
|
+
var e = "import { styled } from \"@salty-css/astro/styled\";\n\nexport const <%- name %> = styled('<%- tag %>', {\n <% if(className) { %>className: '<%- className %>',<% } %>\n base: {\n // Add your styles here\n }\n})\n";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { e as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
var e=`import { styled } from "@salty-css/astro/styled";
|
|
2
2
|
|
|
3
3
|
export const <%- name %> = styled('<%- tag %>', {
|
|
4
4
|
<% if(className) { %>className: '<%- className %>',<% } %>
|
|
@@ -6,7 +6,4 @@ export const <%- name %> = styled('<%- tag %>', {
|
|
|
6
6
|
// Add your styles here
|
|
7
7
|
}
|
|
8
8
|
})
|
|
9
|
-
`;
|
|
10
|
-
export {
|
|
11
|
-
styledFile as default
|
|
12
|
-
};
|
|
9
|
+
`;exports.default=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"salty-reset.d.ts","sourceRoot":"","sources":["../../src/templates/salty-reset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,eAAO,MAAM,UAAU,EAAE,YA8CxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=`/* Empty */`;exports.default=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-types.d.ts","sourceRoot":"","sources":["../../src/types/cli-types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE;QACT,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,WAAW,CAA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EAAE,MAAM,CAAC;IACjB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC;IACxC,YAAY,CAAC,EAAE,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAC5C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,UAAW,SAAQ,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,cAAc,EAAE,gBAAgB;CAAG;AAE7G,KAAK,OAAO,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,GAAG,CAAC,OAAO,EAAE,CAAC;AAC/C,KAAK,UAAU,GAAG;KAAG,CAAC,IAAI,OAAO,CAAC,CAAC,EAAE,SAAS;CAAE,CAAC;AAEjD,MAAM,WAAW,YAAa,SAAQ,gBAAgB,EAAE,QAAQ;IAC9D,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB"}
|
|
File without changes
|
|
@@ -11,3 +11,4 @@ export type ReplaceAny<TYPE, WITH = unknown> = TYPE extends any ? WITH : TYPE;
|
|
|
11
11
|
export type BothTrue<T, U> = T extends true ? (U extends true ? true : false) : false;
|
|
12
12
|
export type EitherTrue<T, U> = T extends true ? true : U extends true ? true : false;
|
|
13
13
|
export type Tail<T extends any[]> = ((...args: T) => any) extends (arg: any, ...rest: infer R) => any ? R : never;
|
|
14
|
+
//# sourceMappingURL=util-types.d.ts.map
|