@salty-css/vite 0.2.2-chore-size-check.0 → 0.2.2-refactor-vite-8.8
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 +24 -24
- package/dist/index.cjs +1 -0
- package/{index.d.ts → dist/index.d.ts} +2 -1
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +25 -0
- package/package.json +27 -21
- package/index.cjs +0 -1
- package/index.js +0 -32
package/README.md
CHANGED
|
@@ -79,29 +79,29 @@ Full reference → [salty-css.dev/docs/eslint](https://salty-css.dev/docs/eslint
|
|
|
79
79
|
|
|
80
80
|
## API index
|
|
81
81
|
|
|
82
|
-
| Symbol | Import
|
|
83
|
-
| ----------------------------------------------- |
|
|
84
|
-
| [`styled`](#styled) | `@salty-css/react/styled`
|
|
85
|
-
| [`className`](#classname) | `@salty-css/react/class-name`
|
|
86
|
-
| [Variants](#variants) | —
|
|
87
|
-
| [Overrides](#overrides) | —
|
|
88
|
-
| [ESLint plugin](#eslint) | `@salty-css/eslint-config-core` | Two rules: enforce `export` and correct `variants` placement on Salty files.
|
|
89
|
-
| [`defineConfig`](#defineconfig) | `@salty-css/core/config`
|
|
90
|
-
| [`defineVariables`](#definevariables) | `@salty-css/core/factories`
|
|
91
|
-
| [Theming](#theming) | —
|
|
92
|
-
| [`defineGlobalStyles`](#defineglobalstyles) | `@salty-css/core/factories`
|
|
93
|
-
| [`defineMediaQuery`](#definemediaquery) | `@salty-css/core/factories`
|
|
94
|
-
| [`defineTemplates`](#definetemplates) | `@salty-css/core/factories`
|
|
95
|
-
| [`defineFont`](#definefont) | `@salty-css/core/factories`
|
|
96
|
-
| [`defineImport`](#defineimport) | `@salty-css/core/factories`
|
|
97
|
-
| [`keyframes`](#keyframes) | `@salty-css/react/keyframes`
|
|
98
|
-
| [`defineViewportClamp`](#defineviewportclamp) | `@salty-css/core/helpers`
|
|
99
|
-
| [`color`](#color) | `@salty-css/core/helpers`
|
|
100
|
-
| [Modifiers](#modifiers) | (on `defineConfig`)
|
|
101
|
-
| [`withSaltyCss`](#withsaltycss-nextjs) | `@salty-css/next`
|
|
102
|
-
| [`saltyPlugin` (Vite)](#saltyplugin-vite) | `@salty-css/vite`
|
|
103
|
-
| [`saltyPlugin` (Webpack)](#saltyplugin-webpack) | `@salty-css/webpack`
|
|
104
|
-
| [`saltyIntegration`](#saltyintegration-astro) | `@salty-css/astro/integration`
|
|
82
|
+
| Symbol | Import | One-liner | Docs |
|
|
83
|
+
| ----------------------------------------------- | ------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
|
|
84
|
+
| [`styled`](#styled) | `@salty-css/react/styled` | React component factory with variants & extension. | [api/styled](https://salty-css.dev/docs/api/styled) |
|
|
85
|
+
| [`className`](#classname) | `@salty-css/react/class-name` | CSS class string with `.variant()` chaining. | [api/classname](https://salty-css.dev/docs/api/classname) |
|
|
86
|
+
| [Variants](#variants) | — | `variants`, `compoundVariants`, `anyOfVariants`, `defaultVariants` semantics. | [variants](https://salty-css.dev/docs/variants) |
|
|
87
|
+
| [Overrides](#overrides) | — | Extend components, swap element, override per-instance via `style`. | [overrides](https://salty-css.dev/docs/overrides) |
|
|
88
|
+
| [ESLint plugin](#eslint) | `@salty-css/eslint-config-core` | Two rules: enforce `export` and correct `variants` placement on Salty files. | [eslint](https://salty-css.dev/docs/eslint) |
|
|
89
|
+
| [`defineConfig`](#defineconfig) | `@salty-css/core/config` | Top-level project config. | [api/config](https://salty-css.dev/docs/api/config) |
|
|
90
|
+
| [`defineVariables`](#definevariables) | `@salty-css/core/factories` | Static, responsive, and conditional CSS variables (tokens). | [variables](https://salty-css.dev/docs/variables) |
|
|
91
|
+
| [Theming](#theming) | — | `data-theme` switcher built on conditional variables. | [theming](https://salty-css.dev/docs/theming) |
|
|
92
|
+
| [`defineGlobalStyles`](#defineglobalstyles) | `@salty-css/core/factories` | Global rules (`html`, `body`, etc.). | [api/define-factories](https://salty-css.dev/docs/api/define-factories) |
|
|
93
|
+
| [`defineMediaQuery`](#definemediaquery) | `@salty-css/core/factories` | Named, reusable media queries. | [media-queries](https://salty-css.dev/docs/media-queries) |
|
|
94
|
+
| [`defineTemplates`](#definetemplates) | `@salty-css/core/factories` | Reusable style bundles, optionally with variants. | [templates](https://salty-css.dev/docs/templates) |
|
|
95
|
+
| [`defineFont`](#definefont) | `@salty-css/core/factories` | `@font-face` (or `@import`) + CSS variable in one. | [fonts](https://salty-css.dev/docs/fonts) |
|
|
96
|
+
| [`defineImport`](#defineimport) | `@salty-css/core/factories` | Pull external CSS into Salty's `imports` layer. | [imports](https://salty-css.dev/docs/imports) |
|
|
97
|
+
| [`keyframes`](#keyframes) | `@salty-css/react/keyframes` | Typed `@keyframes` with params and initial-state injection. | [animations](https://salty-css.dev/docs/animations) |
|
|
98
|
+
| [`defineViewportClamp`](#defineviewportclamp) | `@salty-css/core/helpers` | Fluid `clamp()` values that scale with the viewport. | [viewport-clamp](https://salty-css.dev/docs/viewport-clamp) |
|
|
99
|
+
| [`color`](#color) | `@salty-css/core/helpers` | Color manipulation (`alpha`, `darken`, …). | [color-function](https://salty-css.dev/docs/color-function) |
|
|
100
|
+
| [Modifiers](#modifiers) | (on `defineConfig`) | Custom value transformers, e.g. `'space:3'` → `'12px'`. | [modifiers](https://salty-css.dev/docs/modifiers) |
|
|
101
|
+
| [`withSaltyCss`](#withsaltycss-nextjs) | `@salty-css/next` | Next.js config wrapper (Webpack + Turbopack). | [installation](https://salty-css.dev/docs/installation) |
|
|
102
|
+
| [`saltyPlugin` (Vite)](#saltyplugin-vite) | `@salty-css/vite` | Vite plugin. | [installation](https://salty-css.dev/docs/installation) |
|
|
103
|
+
| [`saltyPlugin` (Webpack)](#saltyplugin-webpack) | `@salty-css/webpack` | Webpack loader + plugin. | [installation](https://salty-css.dev/docs/installation) |
|
|
104
|
+
| [`saltyIntegration`](#saltyintegration-astro) | `@salty-css/astro/integration` | Astro integration. | [installation](https://salty-css.dev/docs/installation) |
|
|
105
105
|
|
|
106
106
|
---
|
|
107
107
|
|
|
@@ -376,7 +376,7 @@ export default defineImport(
|
|
|
376
376
|
'/fonts/inter.css', // public/ folder
|
|
377
377
|
'https://fonts.googleapis.com/css2?family=Inter', // URL
|
|
378
378
|
{ url: './print.css', media: 'print' }, // media-conditional
|
|
379
|
-
{ url: './p3.css', supports: 'color(display-p3 1 1 1)' } // supports-conditional
|
|
379
|
+
{ url: './p3.css', supports: 'color(display-p3 1 1 1)' }, // supports-conditional
|
|
380
380
|
);
|
|
381
381
|
```
|
|
382
382
|
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});let e=require("@salty-css/core/compiler/helpers"),t=require("@salty-css/core/compiler/salty-compiler"),n=require("@salty-css/core/server");var r=async e=>{if(e===`react`||e===void 0)return(await import(`@salty-css/react/transform-salty-file`)).transformSaltyFile;throw Error(`@salty-css/vite: framework "${e}" is not supported. Supported: react.`)},i=(i,a={})=>{let o=new t.SaltyCompiler(i,{mode:a.mode}),s,c=()=>(s||=o.getFramework().then(r),s);return{name:`stylegen`,buildStart:async()=>await o.generateCss(),load:async t=>{if((0,e.isSaltyFile)(t))return await(await c())(o,t)},handleHotUpdate:async({file:e,server:t})=>{await(0,n.checkShouldRestart)(e)&&t.restart()},watchChange:{handler:async(t,r)=>{(0,e.isSaltyFile)(t)&&r.event!==`delete`&&(await(0,n.checkShouldRestart)(t)||await o.generateFile(t))}}}};exports.default=i,exports.saltyPlugin=i;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SaltyCompilerMode } from '
|
|
1
|
+
import { SaltyCompilerMode } from '../../core/dist/compiler/salty-compiler';
|
|
2
2
|
import { PluginOption } from 'vite';
|
|
3
3
|
export interface SaltyVitePluginOptions {
|
|
4
4
|
/**
|
|
@@ -8,3 +8,4 @@ export interface SaltyVitePluginOptions {
|
|
|
8
8
|
}
|
|
9
9
|
export declare const saltyPlugin: (dir: string, options?: SaltyVitePluginOptions) => PluginOption;
|
|
10
10
|
export default saltyPlugin;
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAE3F,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAIpC,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,IAAI,CAAC,EAAE,iBAAiB,CAAC;CAC1B;AAWD,eAAO,MAAM,WAAW,GAAI,KAAK,MAAM,EAAE,UAAS,sBAA2B,KAAG,YAkC/E,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { isSaltyFile as e } from "@salty-css/core/compiler/helpers";
|
|
2
|
+
import { SaltyCompiler as t } from "@salty-css/core/compiler/salty-compiler";
|
|
3
|
+
import { checkShouldRestart as n } from "@salty-css/core/server";
|
|
4
|
+
//#region src/index.ts
|
|
5
|
+
var r = async (e) => {
|
|
6
|
+
if (e === "react" || e === void 0) return (await import("@salty-css/react/transform-salty-file")).transformSaltyFile;
|
|
7
|
+
throw Error(`@salty-css/vite: framework "${e}" is not supported. Supported: react.`);
|
|
8
|
+
}, i = (i, a = {}) => {
|
|
9
|
+
let o = new t(i, { mode: a.mode }), s, c = () => (s ||= o.getFramework().then(r), s);
|
|
10
|
+
return {
|
|
11
|
+
name: "stylegen",
|
|
12
|
+
buildStart: async () => await o.generateCss(),
|
|
13
|
+
load: async (t) => {
|
|
14
|
+
if (e(t)) return await (await c())(o, t);
|
|
15
|
+
},
|
|
16
|
+
handleHotUpdate: async ({ file: e, server: t }) => {
|
|
17
|
+
await n(e) && t.restart();
|
|
18
|
+
},
|
|
19
|
+
watchChange: { handler: async (t, r) => {
|
|
20
|
+
e(t) && r.event !== "delete" && (await n(t) || await o.generateFile(t));
|
|
21
|
+
} }
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
export { i as default, i as saltyPlugin };
|
package/package.json
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salty-css/vite",
|
|
3
|
-
"version": "0.2.2-chore-size-check.0",
|
|
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": {
|
|
@@ -19,30 +14,41 @@
|
|
|
19
14
|
"bugs": {
|
|
20
15
|
"url": "https://github.com/margarita-form/salty-css/issues"
|
|
21
16
|
},
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"sourceRoot": "libs/vite/src",
|
|
28
|
-
"name": "vite"
|
|
29
|
-
},
|
|
30
|
-
"exports": {
|
|
31
|
-
".": {
|
|
32
|
-
"import": "./index.js",
|
|
33
|
-
"require": "./index.cjs"
|
|
34
|
-
}
|
|
17
|
+
"version": "0.2.2-refactor-vite-8.8",
|
|
18
|
+
"type": "module",
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "vite build",
|
|
21
|
+
"test": "vitest run"
|
|
35
22
|
},
|
|
36
23
|
"dependencies": {
|
|
37
|
-
"@salty-css/core": "0.2.2-
|
|
38
|
-
"vite": "
|
|
24
|
+
"@salty-css/core": "0.2.2-refactor-vite-8.8",
|
|
25
|
+
"vite": ">=6.4.1"
|
|
39
26
|
},
|
|
40
27
|
"peerDependencies": {
|
|
41
|
-
"@salty-css/react": "0.2.2-
|
|
28
|
+
"@salty-css/react": "0.2.2-refactor-vite-8.8"
|
|
42
29
|
},
|
|
43
30
|
"peerDependenciesMeta": {
|
|
44
31
|
"@salty-css/react": {
|
|
45
32
|
"optional": true
|
|
46
33
|
}
|
|
34
|
+
},
|
|
35
|
+
"nx": {
|
|
36
|
+
"targets": {
|
|
37
|
+
"build": {
|
|
38
|
+
"dependsOn": [
|
|
39
|
+
"^build"
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"files": [
|
|
45
|
+
"dist",
|
|
46
|
+
"README.md"
|
|
47
|
+
],
|
|
48
|
+
"exports": {
|
|
49
|
+
".": {
|
|
50
|
+
"import": "./dist/index.js",
|
|
51
|
+
"require": "./dist/index.cjs"
|
|
52
|
+
}
|
|
47
53
|
}
|
|
48
54
|
}
|
package/index.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var y=Object.create;var i=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var w=Object.getPrototypeOf,p=Object.prototype.hasOwnProperty;var f=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of h(e))!p.call(t,a)&&a!==r&&i(t,a,{get:()=>e[a],enumerable:!(o=m(e,a))||o.enumerable});return t};var g=(t,e,r)=>(r=t!=null?y(w(t)):{},f(e||!t||!t.__esModule?i(r,"default",{value:t,enumerable:!0}):r,t));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("@salty-css/core/compiler/helpers"),F=require("@salty-css/core/compiler/salty-compiler"),u=require("@salty-css/core/server"),S=async t=>{if(t==="react"||t===void 0)return(await import("@salty-css/react/transform-salty-file")).transformSaltyFile;throw new Error(`@salty-css/vite: framework "${t}" is not supported. Supported: react.`)},d=(t,e={})=>{const r=new F.SaltyCompiler(t,{mode:e.mode});let o;const a=()=>(o||(o=r.getFramework().then(S)),o);return{name:"stylegen",buildStart:async()=>await r.generateCss(),load:async s=>{if(c.isSaltyFile(s))return await(await a())(r,s)},handleHotUpdate:async({file:s,server:n})=>{await u.checkShouldRestart(s)&&n.restart()},watchChange:{handler:async(s,n)=>{c.isSaltyFile(s)&&n.event!=="delete"&&(await u.checkShouldRestart(s)||await r.generateFile(s))}}}};exports.default=d;exports.saltyPlugin=d;
|
package/index.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { isSaltyFile as i } from "@salty-css/core/compiler/helpers";
|
|
2
|
-
import { SaltyCompiler as c } from "@salty-css/core/compiler/salty-compiler";
|
|
3
|
-
import { checkShouldRestart as l } from "@salty-css/core/server";
|
|
4
|
-
const d = async (a) => {
|
|
5
|
-
if (a === "react" || a === void 0)
|
|
6
|
-
return (await import("@salty-css/react/transform-salty-file")).transformSaltyFile;
|
|
7
|
-
throw new Error(`@salty-css/vite: framework "${a}" is not supported. Supported: react.`);
|
|
8
|
-
}, w = (a, o = {}) => {
|
|
9
|
-
const r = new c(a, { mode: o.mode });
|
|
10
|
-
let s;
|
|
11
|
-
const m = () => (s || (s = r.getFramework().then(d)), s);
|
|
12
|
-
return {
|
|
13
|
-
name: "stylegen",
|
|
14
|
-
buildStart: async () => await r.generateCss(),
|
|
15
|
-
load: async (t) => {
|
|
16
|
-
if (i(t))
|
|
17
|
-
return await (await m())(r, t);
|
|
18
|
-
},
|
|
19
|
-
handleHotUpdate: async ({ file: t, server: e }) => {
|
|
20
|
-
await l(t) && e.restart();
|
|
21
|
-
},
|
|
22
|
-
watchChange: {
|
|
23
|
-
handler: async (t, e) => {
|
|
24
|
-
i(t) && e.event !== "delete" && (await l(t) || await r.generateFile(t));
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
export {
|
|
30
|
-
w as default,
|
|
31
|
-
w as saltyPlugin
|
|
32
|
-
};
|