@salty-css/next 0.2.0 → 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 +24 -24
- package/dist/config.cjs +1 -0
- package/dist/config.d.ts +2 -0
- package/dist/config.d.ts.map +1 -0
- package/{detect-bundler.d.ts → dist/detect-bundler.d.ts} +2 -1
- package/dist/detect-bundler.d.ts.map +1 -0
- package/dist/factories.cjs +1 -0
- package/dist/factories.d.ts +2 -0
- package/dist/factories.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/{index.d.ts → dist/index.d.ts} +2 -1
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +63 -0
- package/dist/keyframes.cjs +1 -0
- package/dist/keyframes.d.ts +2 -0
- package/dist/keyframes.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/{with-salty-turbopack.d.ts → dist/with-salty-turbopack.d.ts} +2 -1
- package/dist/with-salty-turbopack.d.ts.map +1 -0
- package/{with-salty-webpack.d.ts → dist/with-salty-webpack.d.ts} +2 -1
- package/dist/with-salty-webpack.d.ts.map +1 -0
- package/package.json +40 -31
- package/config.cjs +0 -1
- package/config.d.ts +0 -1
- 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.js +0 -50
- 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/{config.js → dist/config.js} +0 -0
- /package/{factories.js → dist/factories.js} +0 -0
- /package/{helpers.js → dist/helpers.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/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/config.cjs
ADDED
|
@@ -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]}})});
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SaltyCompilerMode } from '
|
|
1
|
+
import { SaltyCompilerMode } from '../../core/dist/compiler/salty-compiler';
|
|
2
2
|
export type Bundler = 'webpack' | 'turbopack';
|
|
3
3
|
export type BundlerOption = Bundler | 'auto';
|
|
4
4
|
export declare const resolveBundler: (option: BundlerOption | undefined) => Bundler;
|
|
@@ -10,3 +10,4 @@ export type TurbopackLoaderRule = {
|
|
|
10
10
|
as: string;
|
|
11
11
|
};
|
|
12
12
|
export declare const buildSaltyTurbopackRules: (dir: string, mode?: SaltyCompilerMode) => Record<string, TurbopackLoaderRule>;
|
|
13
|
+
//# sourceMappingURL=detect-bundler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect-bundler.d.ts","sourceRoot":"","sources":["../src/detect-bundler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAEjF,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,WAAW,CAAC;AAC9C,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,MAAM,CAAC;AAE7C,eAAO,MAAM,cAAc,GAAI,QAAQ,aAAa,GAAG,SAAS,KAAG,OAGlE,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC,CAAC;IACrE,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAI,KAAK,MAAM,EAAE,OAAO,iBAAiB,KAAG,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAWlH,CAAC"}
|
|
@@ -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 @@
|
|
|
1
|
+
{"version":3,"file":"factories.d.ts","sourceRoot":"","sources":["../src/factories.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC"}
|
package/dist/helpers.cjs
ADDED
|
@@ -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 @@
|
|
|
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
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});let e=require("@salty-css/core/compiler/helpers"),t=require("@salty-css/webpack"),n=require("fs"),r=require("path"),i=require("@salty-css/core/compiler/salty-compiler"),a=require("@salty-css/core/server");var o=e=>e&&e!==`auto`?e:process.env.TURBOPACK===void 0?`webpack`:`turbopack`,s=(t,n)=>{let r={},i={dir:t};n!==void 0&&(i.mode=n);let a={loader:`@salty-css/webpack/loader`,options:i};for(let t of e.saltyFileExtensions)r[`**/*.${t}.ts`]={loaders:[a],as:`*.ts`},r[`**/*.${t}.tsx`]={loaders:[a],as:`*.tsx`};return r},c=(e,n={})=>{let{webpack:r,...i}=e;return{...i,webpack(e,i){let{dir:a,isServer:o}=i;return(0,t.saltyPlugin)(e,a,o,!1,{mode:n.mode}),r&&typeof r==`function`&&r(e,i),e}}},l=new Map,u=(t,o)=>{let s=`${t}|${o??``}`;if(l.get(s))return;l.set(s,!0);let c=new i.SaltyCompiler(t,{mode:o});c.generateCss().then(()=>{(0,n.watch)(t,{recursive:!0},async(n,i)=>{if(!i)return;let o=(0,r.resolve)(t,i.toString());await(0,a.checkShouldRestart)(o)?await c.generateCss():(0,e.isSaltyFile)(o)&&await c.generateFile(o)})}).catch(e=>{l.set(s,!1),console.error(`[salty-css/next] failed to initialize Turbopack runtime:`,e)})},d=(e,t={})=>{let n=e.turbopack??{},r=t.dir??n.root??process.cwd(),i=s(r,t.mode),a={...n.rules??{},...i};return u(r,t.mode),{...e,turbopack:{...n,rules:a}}},f=(e,t={})=>o(t.bundler)===`turbopack`?d(e,{mode:t.mode,dir:t.dir}):c(e,{mode:t.mode});exports.default=f,exports.withSaltyCss=f;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SaltyCompilerMode } from '
|
|
1
|
+
import { SaltyCompilerMode } from '../../core/dist/compiler/salty-compiler';
|
|
2
2
|
import { BundlerOption } from './detect-bundler';
|
|
3
3
|
type AnyRecord = Record<any, any>;
|
|
4
4
|
export type { Bundler, BundlerOption } from './detect-bundler';
|
|
@@ -28,3 +28,4 @@ export declare const withSaltyCss: <T extends AnyRecord>(nextConfig: T, options?
|
|
|
28
28
|
webpack(config: any, webpackOptions: any): any;
|
|
29
29
|
});
|
|
30
30
|
export default withSaltyCss;
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,EAAkB,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAItE,KAAK,SAAS,GAAG,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAElC,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE/D,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,IAAI,CAAC,EAAE,iBAAiB,CAAC;IACzB;;;;OAIG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,SAAS,EAAE,YAAY,CAAC,EAAE,UAAS,gBAAqB;;;;;;EAM9F,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { isSaltyFile as e, saltyFileExtensions as t } from "@salty-css/core/compiler/helpers";
|
|
2
|
+
import { saltyPlugin as n } from "@salty-css/webpack";
|
|
3
|
+
import { watch as r } from "fs";
|
|
4
|
+
import { resolve as i } from "path";
|
|
5
|
+
import { SaltyCompiler as a } from "@salty-css/core/compiler/salty-compiler";
|
|
6
|
+
import { checkShouldRestart as o } from "@salty-css/core/server";
|
|
7
|
+
//#region src/detect-bundler.ts
|
|
8
|
+
var s = (e) => e && e !== "auto" ? e : process.env.TURBOPACK === void 0 ? "webpack" : "turbopack", c = (e, n) => {
|
|
9
|
+
let r = {}, i = { dir: e };
|
|
10
|
+
n !== void 0 && (i.mode = n);
|
|
11
|
+
let a = {
|
|
12
|
+
loader: "@salty-css/webpack/loader",
|
|
13
|
+
options: i
|
|
14
|
+
};
|
|
15
|
+
for (let e of t) r[`**/*.${e}.ts`] = {
|
|
16
|
+
loaders: [a],
|
|
17
|
+
as: "*.ts"
|
|
18
|
+
}, r[`**/*.${e}.tsx`] = {
|
|
19
|
+
loaders: [a],
|
|
20
|
+
as: "*.tsx"
|
|
21
|
+
};
|
|
22
|
+
return r;
|
|
23
|
+
}, l = (e, t = {}) => {
|
|
24
|
+
let { webpack: r, ...i } = e;
|
|
25
|
+
return {
|
|
26
|
+
...i,
|
|
27
|
+
webpack(e, i) {
|
|
28
|
+
let { dir: a, isServer: o } = i;
|
|
29
|
+
return n(e, a, o, !1, { mode: t.mode }), r && typeof r == "function" && r(e, i), e;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}, u = /* @__PURE__ */ new Map(), d = (t, n) => {
|
|
33
|
+
let s = `${t}|${n ?? ""}`;
|
|
34
|
+
if (u.get(s)) return;
|
|
35
|
+
u.set(s, !0);
|
|
36
|
+
let c = new a(t, { mode: n });
|
|
37
|
+
c.generateCss().then(() => {
|
|
38
|
+
r(t, { recursive: !0 }, async (n, r) => {
|
|
39
|
+
if (!r) return;
|
|
40
|
+
let a = i(t, r.toString());
|
|
41
|
+
await o(a) ? await c.generateCss() : e(a) && await c.generateFile(a);
|
|
42
|
+
});
|
|
43
|
+
}).catch((e) => {
|
|
44
|
+
u.set(s, !1), console.error("[salty-css/next] failed to initialize Turbopack runtime:", e);
|
|
45
|
+
});
|
|
46
|
+
}, f = (e, t = {}) => {
|
|
47
|
+
let n = e.turbopack ?? {}, r = t.dir ?? n.root ?? process.cwd(), i = c(r, t.mode), a = {
|
|
48
|
+
...n.rules ?? {},
|
|
49
|
+
...i
|
|
50
|
+
};
|
|
51
|
+
return d(r, t.mode), {
|
|
52
|
+
...e,
|
|
53
|
+
turbopack: {
|
|
54
|
+
...n,
|
|
55
|
+
rules: a
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
}, p = (e, t = {}) => s(t.bundler) === "turbopack" ? f(e, {
|
|
59
|
+
mode: t.mode,
|
|
60
|
+
dir: t.dir
|
|
61
|
+
}) : l(e, { mode: t.mode });
|
|
62
|
+
//#endregion
|
|
63
|
+
export { p as default, p as withSaltyCss };
|
|
@@ -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 @@
|
|
|
1
|
+
{"version":3,"file":"keyframes.d.ts","sourceRoot":"","sources":["../src/keyframes.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,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]}})});
|
package/dist/media.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../src/media.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC"}
|
package/dist/runtime.cjs
ADDED
|
@@ -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 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SaltyCompilerMode } from '
|
|
1
|
+
import { SaltyCompilerMode } from '../../core/dist/compiler/salty-compiler';
|
|
2
2
|
type AnyRecord = Record<any, any>;
|
|
3
3
|
export interface SaltyTurbopackWrapperOptions {
|
|
4
4
|
mode?: SaltyCompilerMode;
|
|
@@ -11,3 +11,4 @@ export declare const withSaltyTurbopack: <T extends AnyRecord>(nextConfig: T, op
|
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
13
|
export {};
|
|
14
|
+
//# sourceMappingURL=with-salty-turbopack.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"with-salty-turbopack.d.ts","sourceRoot":"","sources":["../src/with-salty-turbopack.ts"],"names":[],"mappings":"AAIA,OAAO,EAAiB,KAAK,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAIhG,KAAK,SAAS,GAAG,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAElC,MAAM,WAAW,4BAA4B;IAC3C,IAAI,CAAC,EAAE,iBAAiB,CAAC;IACzB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AA8BD,eAAO,MAAM,oCAAoC,YAEhD,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,CAAC,SAAS,SAAS,EAAE,YAAY,CAAC,EAAE,UAAS,4BAAiC;;;;CAgBhH,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SaltyCompilerMode } from '
|
|
1
|
+
import { SaltyCompilerMode } from '../../core/dist/compiler/salty-compiler';
|
|
2
2
|
type AnyRecord = Record<any, any>;
|
|
3
3
|
export interface SaltyWebpackWrapperOptions {
|
|
4
4
|
mode?: SaltyCompilerMode;
|
|
@@ -7,3 +7,4 @@ export declare const withSaltyWebpack: <T extends AnyRecord>(nextConfig: T, opti
|
|
|
7
7
|
webpack(config: any, webpackOptions: any): any;
|
|
8
8
|
};
|
|
9
9
|
export {};
|
|
10
|
+
//# sourceMappingURL=with-salty-webpack.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"with-salty-webpack.d.ts","sourceRoot":"","sources":["../src/with-salty-webpack.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAEjF,KAAK,SAAS,GAAG,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAElC,MAAM,WAAW,0BAA0B;IACzC,IAAI,CAAC,EAAE,iBAAiB,CAAC;CAC1B;AAED,eAAO,MAAM,gBAAgB,GAAI,CAAC,SAAS,SAAS,EAAE,YAAY,CAAC,EAAE,UAAS,0BAA+B;oBAIzF,GAAG,kBAAkB,GAAG;CAS3C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salty-css/next",
|
|
3
|
-
"version": "0.2.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": {
|
|
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,46 +14,60 @@
|
|
|
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": "vite build",
|
|
21
|
+
"test": "vitest run"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@salty-css/core": "0.2.2-refactor-vite-8.4",
|
|
25
|
+
"@salty-css/webpack": "0.2.2-refactor-vite-8.4"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"jsdom": "^29.1.1"
|
|
29
|
+
},
|
|
26
30
|
"nx": {
|
|
27
|
-
"
|
|
28
|
-
|
|
31
|
+
"targets": {
|
|
32
|
+
"build": {
|
|
33
|
+
"dependsOn": [
|
|
34
|
+
"^build"
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
}
|
|
29
38
|
},
|
|
39
|
+
"files": [
|
|
40
|
+
"dist",
|
|
41
|
+
"README.md"
|
|
42
|
+
],
|
|
30
43
|
"exports": {
|
|
31
44
|
".": {
|
|
32
|
-
"import": "./index.js",
|
|
33
|
-
"require": "./index.cjs"
|
|
45
|
+
"import": "./dist/index.js",
|
|
46
|
+
"require": "./dist/index.cjs"
|
|
34
47
|
},
|
|
35
48
|
"./config": {
|
|
36
|
-
"import": "./config.js",
|
|
37
|
-
"require": "./config.cjs"
|
|
49
|
+
"import": "./dist/config.js",
|
|
50
|
+
"require": "./dist/config.cjs"
|
|
38
51
|
},
|
|
39
52
|
"./factories": {
|
|
40
|
-
"import": "./factories.js",
|
|
41
|
-
"require": "./factories.cjs"
|
|
53
|
+
"import": "./dist/factories.js",
|
|
54
|
+
"require": "./dist/factories.cjs"
|
|
42
55
|
},
|
|
43
56
|
"./helpers": {
|
|
44
|
-
"import": "./helpers.js",
|
|
45
|
-
"require": "./helpers.cjs"
|
|
57
|
+
"import": "./dist/helpers.js",
|
|
58
|
+
"require": "./dist/helpers.cjs"
|
|
46
59
|
},
|
|
47
60
|
"./keyframes": {
|
|
48
|
-
"import": "./keyframes.js",
|
|
49
|
-
"require": "./keyframes.cjs"
|
|
61
|
+
"import": "./dist/keyframes.js",
|
|
62
|
+
"require": "./dist/keyframes.cjs"
|
|
50
63
|
},
|
|
51
64
|
"./media": {
|
|
52
|
-
"import": "./media.js",
|
|
53
|
-
"require": "./media.cjs"
|
|
65
|
+
"import": "./dist/media.js",
|
|
66
|
+
"require": "./dist/media.cjs"
|
|
54
67
|
},
|
|
55
68
|
"./runtime": {
|
|
56
|
-
"import": "./runtime.js",
|
|
57
|
-
"require": "./runtime.cjs"
|
|
69
|
+
"import": "./dist/runtime.js",
|
|
70
|
+
"require": "./dist/runtime.cjs"
|
|
58
71
|
}
|
|
59
|
-
},
|
|
60
|
-
"dependencies": {
|
|
61
|
-
"@salty-css/core": "0.2.0",
|
|
62
|
-
"@salty-css/webpack": "0.2.0"
|
|
63
72
|
}
|
|
64
|
-
}
|
|
73
|
+
}
|
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/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.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("@salty-css/core/compiler/helpers"),d=require("@salty-css/webpack"),b=require("fs"),p=require("path"),y=require("@salty-css/core/compiler/salty-compiler"),k=require("@salty-css/core/server"),m=e=>e&&e!=="auto"?e:process.env.TURBOPACK!==void 0?"turbopack":"webpack",w=(e,t)=>{const r={},s={dir:e};t!==void 0&&(s.mode=t);const o={loader:"@salty-css/webpack/loader",options:s};for(const a of u.saltyFileExtensions)r[`**/*.${a}.ts`]={loaders:[o],as:"*.ts"},r[`**/*.${a}.tsx`]={loaders:[o],as:"*.tsx"};return r},f=(e,t={})=>{const{webpack:r,...s}=e;return{...s,webpack(o,a){const{dir:c,isServer:l}=a;return d.saltyPlugin(o,c,l,!1,{mode:t.mode}),r&&typeof r=="function"&&r(o,a),o}}},n=new Map,h=(e,t)=>{const r=`${e}|${t??""}`;if(n.get(r))return;n.set(r,!0);const s=new y.SaltyCompiler(e,{mode:t});s.generateCss().then(()=>{b.watch(e,{recursive:!0},async(o,a)=>{if(!a)return;const c=p.resolve(e,a.toString());await k.checkShouldRestart(c)?await s.generateCss():u.isSaltyFile(c)&&await s.generateFile(c)})}).catch(o=>{n.set(r,!1),console.error("[salty-css/next] failed to initialize Turbopack runtime:",o)})},S=(e,t={})=>{const r=e.turbopack??{},s=t.dir??r.root??process.cwd(),o=w(s,t.mode),c={...r.rules??{},...o};return h(s,t.mode),{...e,turbopack:{...r,rules:c}}},i=(e,t={})=>m(t.bundler)==="turbopack"?S(e,{mode:t.mode,dir:t.dir}):f(e,{mode:t.mode});exports.default=i;exports.withSaltyCss=i;
|
package/index.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { saltyFileExtensions as u, isSaltyFile as i } from "@salty-css/core/compiler/helpers";
|
|
2
|
-
import { saltyPlugin as d } from "@salty-css/webpack";
|
|
3
|
-
import { watch as m } from "fs";
|
|
4
|
-
import { resolve as p } from "path";
|
|
5
|
-
import { SaltyCompiler as b } from "@salty-css/core/compiler/salty-compiler";
|
|
6
|
-
import { checkShouldRestart as f } from "@salty-css/core/server";
|
|
7
|
-
const k = (e) => e && e !== "auto" ? e : process.env.TURBOPACK !== void 0 ? "turbopack" : "webpack", y = (e, t) => {
|
|
8
|
-
const r = {}, s = { dir: e };
|
|
9
|
-
t !== void 0 && (s.mode = t);
|
|
10
|
-
const o = { loader: "@salty-css/webpack/loader", options: s };
|
|
11
|
-
for (const a of u)
|
|
12
|
-
r[`**/*.${a}.ts`] = { loaders: [o], as: "*.ts" }, r[`**/*.${a}.tsx`] = { loaders: [o], as: "*.tsx" };
|
|
13
|
-
return r;
|
|
14
|
-
}, w = (e, t = {}) => {
|
|
15
|
-
const { webpack: r, ...s } = e;
|
|
16
|
-
return {
|
|
17
|
-
...s,
|
|
18
|
-
webpack(o, a) {
|
|
19
|
-
const { dir: c, isServer: l } = a;
|
|
20
|
-
return d(o, c, l, !1, { mode: t.mode }), r && typeof r == "function" && r(o, a), o;
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
}, n = /* @__PURE__ */ new Map(), h = (e, t) => {
|
|
24
|
-
const r = `${e}|${t ?? ""}`;
|
|
25
|
-
if (n.get(r)) return;
|
|
26
|
-
n.set(r, !0);
|
|
27
|
-
const s = new b(e, { mode: t });
|
|
28
|
-
s.generateCss().then(() => {
|
|
29
|
-
m(e, { recursive: !0 }, async (o, a) => {
|
|
30
|
-
if (!a) return;
|
|
31
|
-
const c = p(e, a.toString());
|
|
32
|
-
await f(c) ? await s.generateCss() : i(c) && await s.generateFile(c);
|
|
33
|
-
});
|
|
34
|
-
}).catch((o) => {
|
|
35
|
-
n.set(r, !1), console.error("[salty-css/next] failed to initialize Turbopack runtime:", o);
|
|
36
|
-
});
|
|
37
|
-
}, S = (e, t = {}) => {
|
|
38
|
-
const r = e.turbopack ?? {}, s = t.dir ?? r.root ?? process.cwd(), o = y(s, t.mode), c = { ...r.rules ?? {}, ...o };
|
|
39
|
-
return h(s, t.mode), {
|
|
40
|
-
...e,
|
|
41
|
-
turbopack: {
|
|
42
|
-
...r,
|
|
43
|
-
rules: c
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
}, C = (e, t = {}) => k(t.bundler) === "turbopack" ? S(e, { mode: t.mode, dir: t.dir }) : w(e, { mode: t.mode });
|
|
47
|
-
export {
|
|
48
|
-
C as default,
|
|
49
|
-
C as withSaltyCss
|
|
50
|
-
};
|
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';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|