zuixs 0.0.0-stage → 0.0.2

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/LICENSE-APACHE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/LICENSE-MIT ADDED
@@ -0,0 +1,9 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2026 ZeruxJS.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,119 @@
1
- # Temporary Holding Version
1
+ # Zuixs
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ **Zuixs** (Zerux User Interface and Experience) is a utility-first, on-demand CSS compiler. It has no runtime framework dependency and is designed for **ZeruxJS**, **ZyroJS**, React, Vue, Next.js, Nuxt and plain HTML.
4
+
5
+ ## Getting started
6
+
7
+ ```sh
8
+ npm run build -w zuixs
9
+ node apps/proworkspace/packages/zuixs/dist/cli.js build --cwd apps/proworkspace -o public/zuix.css
10
+ ```
11
+
12
+ In a consuming package, install `zuixs` and use the `zuix` binary. Add the generated stylesheet in the application's HTML root/layout. For dev regeneration, use `zuix watch -c zuix.config.mjs`. The CLI scans `html`, `js`, `jsx`, `ts`, `tsx`, `vue`, `svelte`, `astro`, `md` and `mdx` by default and skips common build directories. Set `content` to constrain scanning on large projects.
13
+
14
+ ```js
15
+ // zuix.config.mjs
16
+ export default {
17
+ content: ['app/**/*.{ts,tsx,html}', 'src/**/*.{js,jsx,vue}'],
18
+ output: 'public/zuix.css',
19
+ darkMode: 'class',
20
+ extend: { colors: { brand: '#2563eb' } },
21
+ safelist: ['hidden', 'md:flex', 'dark:bg-slate-900']
22
+ };
23
+ ```
24
+
25
+ ```html
26
+ <div class="mx-auto max-w-full p-6 flex flex-col gap-4 bg-white dark:bg-slate-900 md:flex-row">
27
+ <button class="rounded-lg bg-blue-600 px-4 py-2 text-white hover:bg-blue-700 focus-visible:ring-blue-500">Save</button>
28
+ </div>
29
+ ```
30
+
31
+ ## API
32
+
33
+ ```ts
34
+ import { createZuix, generateCSS, extractClasses, injectZuix } from 'zuixs';
35
+ import { buildZuix, watchZuix, scanProject } from 'zuixs/node';
36
+
37
+ const result = createZuix({ preflight: false }).generate(['p-4','hover:bg-blue-600']);
38
+ console.log(result.css, result.unmatched);
39
+ // SSR: renderZuixStyle(classes); Browser/ZyroJS: injectZuix(classes)
40
+ ```
41
+
42
+ For a Vite-based app (including Vue, React, or Nuxt in Vite mode), use `zuixVite()` from `zuixs/vite`, and import `virtual:zuix.css`. The plugin is an early integration point; for reliable production builds with dynamically generated strings, prefer the CLI scanner and explicit `safelist` values.
43
+
44
+ ## Utilities
45
+
46
+ Includes spacing, sizes, flex/grid/layout, typography, colors, palette shades, background, border, shadow, radii, positioning, overflow, display, responsive breakpoints, dark mode, pseudo states, group/peer states, arbitrary values (`w-[35px]`) and property utilities (`[scroll-margin-top:2rem]`). Variants can be chained, e.g. `md:dark:hover:bg-blue-700`. The `!` modifier marks declarations important. Responsive defaults: `sm` 640px, `md` 768px, `lg` 1024px, `xl` 1280px, `2xl` 1536px.
47
+
48
+ ```ts
49
+ import type { ZuixPlugin } from 'zuixs';
50
+ const plugin: ZuixPlugin = ({addUtilities,addBase,theme}) => {
51
+ addUtilities({'.text-brand':{color:theme('colors.brand','#2563eb')}});
52
+ addBase(':root { --app-radius: 8px; }');
53
+ };
54
+ ```
55
+
56
+ **Limitations:** Static extraction recognizes literal class attributes and common class helpers, not all expressions or runtime-generated class names. Arbitrary values are accepted only from trusted application source code; don't compile raw classes submitted by untrusted users. `zuixVite` is intentionally framework-neutral and does not manage all bundler-specific invalidation cases yet. No changes to the ZeruxJS renderer or ZyroJS internals are required to use the generated CSS.
57
+
58
+ ## Production improvements (0.2)
59
+
60
+ - **Idempotent output:** classes are deduplicated before generation; identical token inputs emit one rule. Configurable reset and plugin base CSS are emitted once per build.
61
+ - **Tree-shaken keyframes:** built-in `spin`, `pulse`, `bounce` and `ping` animation definitions are output only when their matching utilities are present; custom `keyframes` entries are supported.
62
+ - **Modern conditions:** `cq-md:`, `container-[min-width:400px]:`, `supports-[display:grid]:`, `media-[width>=700px]:`, `starting:`, `portrait:`, `landscape:`, `forced-colors:`, `contrast-more:`, `rtl:`, `ltr:` and `has-[.active]:` / `not-[.hidden]:`.
63
+ - **Modern CSS utilities:** container sizing, scroll snap, overscroll, content-visibility, view transitions, color schemes, field sizing, text wrapping, subgrid, transition behaviors, filters, CSS scroll-driven animations, CSS anchor positioning and other properties via typed arbitrary utilities or `[property:value]`.
64
+ - **Per-source CSS:** set `perFile: true` or `{dir:'public/zuix-parts'}`. Each source generates a corresponding `.css` file and a `manifest.json` mapping source files to output. Source-specific files omit preflight, while global output retains reset. Each CSS file is self-contained regarding its own requested utilities; importing global and per-source styles simultaneously intentionally repeats those utilities.
65
+ - **Safe writes:** output is written only if changed; stale per-source CSS is removed when its input file disappears.
66
+ - **Vite:** scans at build start for production builds, updates changed module classes, and invalidates its virtual stylesheet on edits/deletion. This adapter still uses broad reloads rather than granular HMR.
67
+
68
+ ```js
69
+ export default {
70
+ content: ['src/**/*.{tsx,vue,html}', 'app/**/*.{ts,tsx}'],
71
+ output: 'public/zuix.css',
72
+ perFile: { dir: 'public/zuix-parts' },
73
+ minify: true,
74
+ keyframes: { 'wave': '0%,100%{transform:rotate(0)}50%{transform:rotate(20deg)}' },
75
+ safelist: ['animate-[wave_2s_ease-in-out_infinite]', 'cq-md:grid']
76
+ };
77
+ ```
78
+
79
+ Run `zuix build --per-file` or `zuix build --per-file-dir public/zuix-parts` to enable per-source builds from the CLI. A lightweight regression suite is available via `npm run test:smoke`.
80
+
81
+ ### Production cautions
82
+
83
+ This version does **not** claim 100% coverage of every current or experimental CSS grammar. For new properties, arbitrary properties (e.g. `[animation-timeline:view()]`) are a forward-compatible escape hatch, subject to browser support. `@property`, `@layer`, complex selector authoring, custom CSS animations, font faces, and newer spec features should use authored CSS or `addBase` in addition to utility classes. Some modern features require progressive enhancement and browser fallbacks. Source extraction is deliberately static, so safelist runtime-built tokens. Do not pass untrusted input into arbitrary CSS syntax. Minification is structural/whitespace-light, not equivalent to an AST optimizer such as Lightning CSS; do not assume vendor prefixing or complex declaration-level compression.
84
+
85
+ ## Section 82 — Production compiler and adapter hardening (source/local gate)
86
+
87
+ The compiler now rejects malformed/unsafe arbitrary CSS values (including declaration delimiters, comment escapes, `url(...)`, `expression(...)`, control characters and invalid at-rule conditions) instead of concatenating them into CSS. Selectors are CSS-escaped, including leading digits. `unmatched` lists unsupported and rejected class tokens; explicitly safelist classes built at runtime. Plugins (`addBase`, custom keyframes, `addUtilities`) are **trusted application code**, not a sandbox for untrusted CSS.
88
+
89
+ Generation is bounded through optional `limits` with defaults: `maxFiles: 20000`, `maxFileBytes: 1 MiB`, `maxTotalBytes: 64 MiB`, `maxClasses: 50000`, `maxTokenLength: 256`. Limit failures throw rather than silently produce an incomplete stylesheet. Scanning skips symlink entries and build artefacts; watched files reuse their previous parsed class lists when size/mtime do not change. Outputs must remain under the project root and refuse symlink paths. Per-file manifests remove stale **generated** CSS after a source deletion, not arbitrary files. Configure content/exclude patterns narrowly for large monorepos.
90
+
91
+ `zuix watch` runs a polling watcher with deterministic regeneration and explicit cleanup; recoverable read/build failures are reported and retried on later polls. `zuix build` rejects unknown flags, missing values and unsupported commands. The framework-neutral Vite adapter tracks current transformed modules in preference to initial scanned data, removes old classes when a file changes, and invalidates its virtual stylesheet on additions/deletions. No eager filesystem import occurs through the browser-safe root entry point.
92
+
93
+ ### Tested integration matrix
94
+
95
+ | Environment | Supported mechanism | Verification |
96
+ | --- | --- | --- |
97
+ | Plain HTML / ZeruxJS templates | `zuix build` or `zuix watch`; link generated CSS | Node filesystem/compiler tests |
98
+ | ZyroJS DOM templates | Same generated CSS; optional `injectZuix()` / `renderZuixStyle()` | API and packed import tests; live browser pending |
99
+ | React + Vite | `zuixVite()` and `import 'virtual:zuix.css'` | Vite hook/transform simulation; real React app pending |
100
+ | Vue + Vite | Same Vite adapter | Vite hook simulation; real Vue app pending |
101
+ | Next.js | External CLI-generated CSS imported by app layout | No official Next adapter or live Next app certification |
102
+ | Nuxt | External CLI-generated CSS through app stylesheet | No official Nuxt adapter or live Nuxt app certification |
103
+ | Browser/SSR | Browser style injection and inline SSR style | Node output validation; Chromium CSS rendering pending |
104
+
105
+ ### Reproducible commands
106
+
107
+ ```sh
108
+ cd apps/proworkspace
109
+ npm run test:zuix # TypeScript, focused tests, npm-pack + offline consumer
110
+ npm run test:zuix:browser # opt-in real Chromium CSS assertion; fails if Chromium cannot launch
111
+ npm run test:workspace-tools
112
+ npm run verify:source # source-only; does not certify npm ci
113
+ ```
114
+
115
+ `npm run test:zuix` checks tarball contents and installs the packed `zuixs` offline in an isolated consumer, importing `zuixs`, `zuix/node`, `zuix/vite`, and `zuix/theme`. It does not certify a clean workspace installation or actual Vite/Next/Nuxt applications. Chromium fails to render in the current environment; real computed-style screenshots, CSSOM validation across browsers, large-scale memory/load profiling, and full cross-OS tests remain release gates for Sections 82–85. The existing 14 unresolved external workspace dependency resolutions also remain outstanding.
116
+
117
+ ## Release 0.0.2
118
+
119
+ Prepared to validate npm trusted publishing through GitHub Actions.
@@ -0,0 +1,33 @@
1
+ import type { ZuixConfig } from './types.js';
2
+ /** Framework-neutral Vite 5+ plugin. React/Vue/Svelte/Astro work through Vite compilation. */
3
+ export declare function zuixVite(config?: ZuixConfig): {
4
+ name: string;
5
+ enforce: "pre";
6
+ configResolved(resolvedConfig: {
7
+ root: string;
8
+ }): void;
9
+ buildStart(): Promise<void>;
10
+ configureServer(s: {
11
+ moduleGraph: {
12
+ getModuleById(id: string): unknown;
13
+ invalidateModule(module: unknown): void;
14
+ };
15
+ ws: {
16
+ send(message: unknown): void;
17
+ };
18
+ } | undefined): void;
19
+ resolveId(id: string): string | null;
20
+ load(id: string): string | null;
21
+ transform(code: string, id: string): null;
22
+ watchChange(id: string, change: {
23
+ event: string;
24
+ }): Promise<void> | undefined;
25
+ handleHotUpdate(ctx: {
26
+ file: string;
27
+ }): void;
28
+ closeBundle(): void;
29
+ };
30
+ /** Browser-only injection; call cleanup on unmount. */
31
+ export declare function injectZuix(classes: Iterable<string>, config?: ZuixConfig): () => void;
32
+ /** Escaped inline SSR style. Prefer a nonce/external CSS for strict CSP. */
33
+ export declare function renderZuixStyle(classes: Iterable<string>, config?: ZuixConfig): string;
@@ -0,0 +1,83 @@
1
+ import { createZuix } from './compiler.js';
2
+ import { extractClasses } from './scanner.js';
3
+ /** Framework-neutral Vite 5+ plugin. React/Vue/Svelte/Astro work through Vite compilation. */
4
+ export function zuixVite(config = {}) {
5
+ const virtualId = 'virtual:zuix.css', resolved = '\0' + virtualId;
6
+ const modules = new Map();
7
+ let scanned = new Map(), root = '';
8
+ let server;
9
+ const relative = (id) => {
10
+ const pathname = id.split('?')[0].replace(/\\/g, '/');
11
+ if (!root || !pathname.startsWith(root + '/'))
12
+ return null;
13
+ return pathname.slice(root.length + 1);
14
+ };
15
+ const generate = () => {
16
+ const tokens = new Set();
17
+ for (const [file, values] of scanned)
18
+ if (!modules.has(file))
19
+ for (const value of values)
20
+ tokens.add(value);
21
+ for (const values of modules.values())
22
+ for (const value of values)
23
+ tokens.add(value);
24
+ return createZuix(config).generate(tokens).css;
25
+ };
26
+ const invalidate = () => { const mod = server?.moduleGraph.getModuleById(resolved); if (mod) {
27
+ server?.moduleGraph.invalidateModule(mod);
28
+ server?.ws.send({ type: 'full-reload' });
29
+ } };
30
+ const refresh = async () => { const { scanProjectFiles } = await import('./node.js'); scanned = scanProjectFiles(root, config); invalidate(); };
31
+ return { name: 'zuix', enforce: 'pre',
32
+ configResolved(resolvedConfig) { root = resolvedConfig.root.replace(/\\/g, '/').replace(/\/$/, ''); },
33
+ async buildStart() { await refresh(); },
34
+ configureServer(s) { server = s; },
35
+ resolveId(id) { return id === virtualId ? resolved : null; },
36
+ load(id) { return id === resolved ? generate() : null; },
37
+ transform(code, id) {
38
+ if (!/\.(?:tsx?|jsx?|vue|svelte|astro|html)(?:\?.*)?$/.test(id))
39
+ return null;
40
+ const file = relative(id);
41
+ if (!file)
42
+ return null;
43
+ const next = new Set(extractClasses(code));
44
+ const old = modules.get(file);
45
+ if (!old || next.size !== old.size || [...next].some(c => !old.has(c))) {
46
+ modules.set(file, next);
47
+ invalidate();
48
+ }
49
+ return null;
50
+ },
51
+ watchChange(id, change) {
52
+ const file = relative(id);
53
+ if (!file)
54
+ return;
55
+ if (change.event === 'delete') {
56
+ modules.delete(file);
57
+ scanned.delete(file);
58
+ invalidate();
59
+ }
60
+ else if (change.event === 'create') {
61
+ return refresh();
62
+ }
63
+ },
64
+ handleHotUpdate(ctx) { const file = relative(ctx.file); if (file && modules.has(file))
65
+ invalidate(); },
66
+ closeBundle() { modules.clear(); scanned.clear(); server = undefined; } };
67
+ }
68
+ /** Browser-only injection; call cleanup on unmount. */
69
+ export function injectZuix(classes, config = {}) {
70
+ if (typeof document === 'undefined')
71
+ return () => { };
72
+ const style = document.createElement('style');
73
+ style.setAttribute('data-zuix', '');
74
+ style.textContent = createZuix(config).generate(classes).css;
75
+ document.head.appendChild(style);
76
+ return () => style.remove();
77
+ }
78
+ /** Escaped inline SSR style. Prefer a nonce/external CSS for strict CSP. */
79
+ export function renderZuixStyle(classes, config = {}) {
80
+ const css = createZuix(config).generate(classes).css.replace(/<\/style/gi, '<\\/style');
81
+ return `<style data-zuix>${css}</style>`;
82
+ }
83
+ //# sourceMappingURL=adapters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapters.js","sourceRoot":"","sources":["../src/adapters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AACzC,OAAO,EAAC,cAAc,EAAC,MAAM,cAAc,CAAC;AAE5C,8FAA8F;AAC9F,MAAM,UAAU,QAAQ,CAAC,SAAkB,EAAE;IAC5C,MAAM,SAAS,GAAC,kBAAkB,EAAC,QAAQ,GAAC,IAAI,GAAC,SAAS,CAAC;IAC3D,MAAM,OAAO,GAAC,IAAI,GAAG,EAAsB,CAAC;IAC5C,IAAI,OAAO,GAAC,IAAI,GAAG,EAAmB,EAAC,IAAI,GAAC,EAAE,CAAC;IAC/C,IAAI,MAAuI,CAAC;IAC5I,MAAM,QAAQ,GAAC,CAAC,EAAS,EAAC,EAAE;QAC3B,MAAM,QAAQ,GAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,EAAC,GAAG,CAAC,CAAC;QAAA,IAAG,CAAC,IAAI,IAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,GAAC,GAAG,CAAC;YAAC,OAAO,IAAI,CAAC;QACxG,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAC,CAAC,CAAC,CAAC;IACtC,CAAC,CAAC;IACF,MAAM,QAAQ,GAAC,GAAE,EAAE;QAClB,MAAM,MAAM,GAAC,IAAI,GAAG,EAAU,CAAC;QAC/B,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M,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,YAAY,EAAC,WAAW,CAAC,CAAC;IAAA,OAAO,oBAAoB,GAAG,UAAU,CAAC;AAC/H,CAAC"}
package/dist/cli.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export declare function runCli(args?: string[]): Promise<void>;
package/dist/cli.js ADDED
@@ -0,0 +1,56 @@
1
+ #!/usr/bin/env node
2
+ import path from 'node:path';
3
+ import { pathToFileURL } from 'node:url';
4
+ import { buildZuix, watchZuix } from './node.js';
5
+ export async function runCli(args = process.argv.slice(2)) {
6
+ if (args.includes('--help') || args.includes('-h')) {
7
+ console.log('zuix [build|watch] [-c zuix.config.mjs] [-o output.css] [--cwd directory] [--per-file] [--per-file-dir directory]');
8
+ return;
9
+ }
10
+ const command = args[0] && !args[0].startsWith('-') ? args[0] : 'build';
11
+ if (command !== 'build' && command !== 'watch')
12
+ throw new Error(`unknown command: ${command}`);
13
+ const opts = new Map();
14
+ const flags = new Set();
15
+ const valid = new Set(['-c', '--config', '-o', '--output', '--cwd', '--per-file-dir']);
16
+ for (let i = args[0] === command ? 1 : 0; i < args.length; i++) {
17
+ const arg = args[i];
18
+ if (arg === '--watch' || arg === '--per-file') {
19
+ flags.add(arg);
20
+ continue;
21
+ }
22
+ if (!valid.has(arg))
23
+ throw new Error(`unknown argument: ${arg}`);
24
+ if (opts.has(arg) || i + 1 >= args.length || args[i + 1].startsWith('--') || args[i + 1] === '-o' || args[i + 1] === '-c')
25
+ throw new Error(`missing or repeated value: ${arg}`);
26
+ opts.set(arg, args[++i]);
27
+ }
28
+ const root = path.resolve(opts.get('--cwd') ?? process.cwd());
29
+ const configPath = opts.get('-c') ?? opts.get('--config');
30
+ let config = {};
31
+ if (configPath) {
32
+ const mod = await import(pathToFileURL(path.resolve(root, configPath)).href);
33
+ config = mod.default ?? mod.config ?? {};
34
+ }
35
+ if (flags.has('--per-file'))
36
+ config.perFile = true;
37
+ if (opts.has('--per-file-dir'))
38
+ config.perFile = { dir: opts.get('--per-file-dir') };
39
+ if (opts.has('-o') || opts.has('--output'))
40
+ config.output = opts.get('--output') ?? opts.get('-o');
41
+ const report = (result) => console.log(`[zuix] compiled ${result.classes.length - result.unmatched.length} utilities -> ${config.output ?? 'zuix.css'}`);
42
+ if (command === 'watch' || flags.has('--watch')) {
43
+ const stop = watchZuix(root, config, report, error => console.error('[zuix] watch:', error));
44
+ const shutdown = () => { stop(); process.off('SIGINT', shutdown); process.off('SIGTERM', shutdown); };
45
+ process.once('SIGINT', shutdown);
46
+ process.once('SIGTERM', shutdown);
47
+ console.log('[zuix] watching for changes');
48
+ }
49
+ else
50
+ report(buildZuix(root, config));
51
+ }
52
+ // Importable CLI entry for validation without executing from a package consumer.
53
+ if (process.argv[1] && import.meta.url === pathToFileURL(path.resolve(process.argv[1])).href) {
54
+ runCli().catch(error => { console.error('[zuix]', error); process.exitCode = 1; });
55
+ }
56
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAC,aAAa,EAAC,MAAM,UAAU,CAAC;AACvC,OAAO,EAAC,SAAS,EAAC,SAAS,EAAC,MAAM,WAAW,CAAC;AAE9C,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,OAAc,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAC/D,IAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAC,CAAC;QAAA,OAAO,CAAC,GAAG,CAAC,mHAAmH,CAAC,CAAC;QAAA,OAAO;IAAA,CAAC;IAC1L,MAAM,OAAO,GAAC,IAAI,CAAC,CAAC,CAAC,IAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,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
1
+ import type { ZuixConfig, GenerateResult } from './types.js';
2
+ export declare const preflight = "*,::before,::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:currentColor}html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif}body{margin:0;line-height:inherit}button,input,select,textarea{font:inherit}button{cursor:pointer}img,svg,video,canvas{display:block;max-width:100%}a{color:inherit;text-decoration:inherit}h1,h2,h3,h4,h5,h6,p{margin:0}ol,ul{list-style:none;margin:0;padding:0}";
3
+ export declare function createZuix(config?: ZuixConfig): {
4
+ config: ZuixConfig;
5
+ theme: import("./types.js").ZuixTheme;
6
+ compileClass: (token: string) => string | undefined;
7
+ generate: (tokens: Iterable<string>) => GenerateResult;
8
+ };
9
+ export declare function generateCSS(classes: Iterable<string>, config?: ZuixConfig): string;