@yummacss/nitro 0.1.0 → 0.2.1

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 CHANGED
@@ -5,24 +5,6 @@ The engine behind Yumma CSS.
5
5
  [![NPM Version](https://img.shields.io/npm/v/@yummacss/nitro?style=plastic&label=@yummacss/nitro&labelColor=eaedfc&color=413cb8)](https://www.npmjs.com/package/@yummacss/nitro)
6
6
  [![NPM Downloads](https://img.shields.io/npm/d18m/@yummacss/nitro?style=plastic&label=downloads&labelColor=eaedfc&color=413cb8)](https://www.npmjs.com/package/@yummacss/nitro)
7
7
 
8
- ## Getting started
9
-
10
- Yumma CSS is a CLI-first CSS framework packed with a set of non-opinionated, atomic utility classes designed to minimize and scale your codebase.
11
-
12
- ### Installation
13
-
14
- Install `yummacss` as a dev dependency
15
-
16
- ```
17
- npm i yummacss -D
18
- ```
19
-
20
- Initialize configuration
21
-
22
- ```
23
- npx yummacss init
24
- ```
25
-
26
8
  ## Documentation
27
9
 
28
10
  Learn more at [yummacss.com](https://yummacss.com)
@@ -30,7 +12,6 @@ Learn more at [yummacss.com](https://yummacss.com)
30
12
  ## Built with
31
13
 
32
14
  - [@yummacss/api](https://www.npmjs.com/package/@yummacss/api)
33
- - [@biomejs](https://www.npmjs.com/package/@biomejs/biome)
34
15
  - [typescript](https://www.npmjs.com/package/typescript)
35
16
 
36
17
  ## License
@@ -0,0 +1 @@
1
+ import{baseStyles as e,generator as t,tokenizer as n}from"./tokenizer-DVMuV70z.js";export{e as baseStyles,t as generator,n as tokenizer};
package/dist/index.js CHANGED
@@ -1,156 +1 @@
1
- import{z as e}from"zod";import{readFileSync as t}from"node:fs";import{globby as n}from"globby";import{coreUtils as r}from"@yummacss/api";const i=`yumma.config.mjs`,a=e.object({source:e.array(e.string()).default([``]),output:e.string().default(``),buildOptions:e.object({reset:e.boolean().default(!0),minify:e.boolean().default(!1)}).default({reset:!0,minify:!1})});async function o(e){let r=await n(e),i=new Set;for(let e of r)try{s(t(e,`utf-8`)).forEach(e=>{i.add(e)})}catch{}return i}function s(e){let t=new Set,n=[/class(?:Name)?=["']([^"']+)["']/g,/class(?:Name)?=\{["']([^"']+)["']\}/g,/class(?:Name)?=\{`([^`]+)`\}/g],r=[/`[^`]*\b([a-z]+-[a-z0-9-]+)\b[^`]*`/g,/"[^"]*\b([a-z]+-[a-z0-9-]+)\b[^"]*"/g,/'[^']*\b([a-z]+-[a-z0-9-]+)\b[^']*'/g],i=[...n,...r];for(let n of i){let r;for(r=n.exec(e);r!==null;){let i=r[1];i&&i.split(/\s+/).filter(e=>e&&/^[a-z]/.test(e)&&e.includes(`-`)).forEach(e=>{t.add(e)}),r=n.exec(e)}}return Array.from(t)}const c=`*,
2
- *::before,
3
- *::after {
4
- box-sizing: border-box;
5
- border: 0 solid;
6
- }
7
-
8
- * {
9
- margin: 0;
10
- padding: 0;
11
- }
12
-
13
- html {
14
- font-family: system-ui, sans-serif;
15
- }
16
-
17
- body {
18
- -webkit-font-smoothing: antialiased;
19
- font-family: inherit;
20
- line-height: 1.5;
21
- }
22
-
23
- canvas,
24
- img,
25
- picture,
26
- svg,
27
- video {
28
- display: block;
29
- max-width: 100%;
30
- }
31
-
32
- button,
33
- input,
34
- optgroup,
35
- select,
36
- textarea {
37
- background-color: transparent;
38
- font-family: inherit;
39
- padding: .5rem;
40
- }
41
-
42
- button:not([class]),
43
- input:not([class]),
44
- optgroup:not([class]),
45
- select:not([class]),
46
- textarea:not([class]) {
47
- border: 1px solid #bfc2c7;
48
- }
49
-
50
- a,
51
- button,
52
- input,
53
- select,
54
- summary,
55
- textarea {
56
- &:focus {
57
- outline: 2px solid transparent;
58
- }
59
- }
60
-
61
- textarea:not([rows]) {
62
- min-height: 10em;
63
- }
64
-
65
- button {
66
- cursor: pointer;
67
- }
68
-
69
- button:disabled,
70
- input:disabled,
71
- select:disabled,
72
- textarea:disabled {
73
- cursor: not-allowed;
74
- opacity: .5;
75
- }
76
-
77
- h1,
78
- h2,
79
- h3,
80
- h4,
81
- h5,
82
- h6,
83
- p {
84
- overflow-wrap: break-word;
85
- }
86
-
87
- h1,
88
- h2,
89
- h3,
90
- h4,
91
- h5,
92
- h6 {
93
- font-size: 1rem;
94
- font-weight: 600;
95
- text-wrap: balance;
96
- }
97
-
98
- p {
99
- text-wrap: pretty;
100
- }
101
-
102
- b,
103
- strong {
104
- font-weight: 700;
105
- }
106
-
107
- small {
108
- font-size: 80%;
109
- line-height: 1.4;
110
- }
111
-
112
- pre,
113
- code,
114
- kbd,
115
- samp {
116
- font-family: monospace;
117
- font-size: 1em;
118
- }
119
-
120
- a {
121
- color: inherit;
122
- text-decoration: none;
123
- }
124
-
125
- ol,
126
- ul {
127
- list-style: none;
128
- padding: 0;
129
- }
130
-
131
- th {
132
- font-size: 1rem;
133
- font-weight: 600;
134
- }
135
-
136
- hr {
137
- border-top: 1px solid #bfc2c7;
138
- height: 0;
139
- margin: 1em 0;
140
- }
141
-
142
- details {
143
- display: block;
144
- }
145
-
146
- summary {
147
- display: list-item;
148
- }`;function l(e,t){let n=[];t.buildOptions.reset&&n.push(c);let r=u(e);return r&&n.push(r),n.join(`
149
-
150
- `)}function u(e){let t=r(),n=[],i=new Map,a=new Set,o=Array.from(e).sort();for(let e of o){if(a.has(e))continue;let r=m(e,t);if(r){if(r.mediaQuery){let e=i.get(r.mediaQuery)||[];e.push(r.rule),i.set(r.mediaQuery,e)}else n.push(r.rule);a.add(e)}}let s=Array.from(i.entries()).sort(([e],[t])=>e.localeCompare(t));for(let[e,t]of s)n.push(`${e} {\n${t.join(`
151
- `)}\n}`);return n.join(`
152
- `)}function d(e,t){let{properties:n,variants:r}=t;if(r?.mediaQueries){for(let i of r.mediaQueries)if(e.startsWith(`${i.prefix}:`)){let r=f(e.slice(i.prefix.length+1),t);if(r){let t=n.map(e=>`${e}: ${r.propertyValue};`).join(`
153
- `);return{rule:`.${p(e)} {\n ${t}\n }`,mediaQuery:i.value}}}}if(r?.pseudoClasses){for(let i of r.pseudoClasses)if(e.startsWith(`${i.prefix}:`)){let r=f(e.slice(i.prefix.length+1),t);if(r){let t=n.map(e=>`${e}: ${r.propertyValue};`).join(`
154
- `);return{rule:`.${p(e)}${i.value} {\n${t}\n}`}}}}if(r?.opacity){for(let i of r.opacity)if(e.endsWith(`/${i.prefix}`)){let r=f(e.slice(0,-(i.prefix.length+1)),t);if(r){let t=r.propertyValue.startsWith(`#`)&&r.propertyValue.length===7?`${r.propertyValue}${i.value}`:r.propertyValue,a=n.map(e=>`${e}: ${t};`).join(`
155
- `);return{rule:`.${p(e)} {\n${a}\n}`}}}}let i=f(e,t);if(i){let t=n.map(e=>`${e}: ${i.propertyValue};`).join(`
156
- `);return{rule:`.${p(e)} {\n${t}\n}`}}return null}function f(e,t){let{prefix:n,values:r}=t;if(!e.startsWith(`${n}-`))return null;let i=r[e.slice(n.length+1)];return i?{propertyValue:i}:null}function p(e){return e.replace(/:/g,`\\:`).replace(/\//g,`\\/`)}function m(e,t){for(let[n,r]of Object.entries(t)){let t=d(e,r);if(t)return t}return null}export{a as ConfigSchema,c as baseCSS,i as configName,o as extractor,l as generator};
1
+ import{baseStyles as e,generator as t,tokenizer as n}from"./tokenizer-DVMuV70z.js";import{z as r}from"zod";import{readFileSync as i}from"node:fs";import{globby as a}from"globby";const o=`yumma.config.mjs`,s=r.object({source:r.array(r.string()).default([``]),output:r.string().default(``),buildOptions:r.object({reset:r.boolean().default(!0),minify:r.boolean().default(!1)}).default({reset:!0,minify:!1})});async function c(e){let t=await a(e),r=new Set;for(let e of t)try{n(i(e,`utf-8`)).forEach(e=>{r.add(e)})}catch{}return r}export{s as ConfigSchema,e as baseStyles,o as configName,c as extractor,t as generator};
@@ -0,0 +1,156 @@
1
+ import{coreUtils as e}from"@yummacss/api";const t=`*,
2
+ *::before,
3
+ *::after {
4
+ box-sizing: border-box;
5
+ border: 0 solid;
6
+ }
7
+
8
+ * {
9
+ margin: 0;
10
+ padding: 0;
11
+ }
12
+
13
+ html {
14
+ font-family: system-ui, sans-serif;
15
+ }
16
+
17
+ body {
18
+ -webkit-font-smoothing: antialiased;
19
+ font-family: inherit;
20
+ line-height: 1.5;
21
+ }
22
+
23
+ canvas,
24
+ img,
25
+ picture,
26
+ svg,
27
+ video {
28
+ display: block;
29
+ max-width: 100%;
30
+ }
31
+
32
+ button,
33
+ input,
34
+ optgroup,
35
+ select,
36
+ textarea {
37
+ background-color: transparent;
38
+ font-family: inherit;
39
+ padding: .5rem;
40
+ }
41
+
42
+ button:not([class]),
43
+ input:not([class]),
44
+ optgroup:not([class]),
45
+ select:not([class]),
46
+ textarea:not([class]) {
47
+ border: 1px solid #bfc2c7;
48
+ }
49
+
50
+ a,
51
+ button,
52
+ input,
53
+ select,
54
+ summary,
55
+ textarea {
56
+ &:focus {
57
+ outline: 2px solid transparent;
58
+ }
59
+ }
60
+
61
+ textarea:not([rows]) {
62
+ min-height: 10em;
63
+ }
64
+
65
+ button {
66
+ cursor: pointer;
67
+ }
68
+
69
+ button:disabled,
70
+ input:disabled,
71
+ select:disabled,
72
+ textarea:disabled {
73
+ cursor: not-allowed;
74
+ opacity: .5;
75
+ }
76
+
77
+ h1,
78
+ h2,
79
+ h3,
80
+ h4,
81
+ h5,
82
+ h6,
83
+ p {
84
+ overflow-wrap: break-word;
85
+ }
86
+
87
+ h1,
88
+ h2,
89
+ h3,
90
+ h4,
91
+ h5,
92
+ h6 {
93
+ font-size: 1rem;
94
+ font-weight: 600;
95
+ text-wrap: balance;
96
+ }
97
+
98
+ p {
99
+ text-wrap: pretty;
100
+ }
101
+
102
+ b,
103
+ strong {
104
+ font-weight: 700;
105
+ }
106
+
107
+ small {
108
+ font-size: 80%;
109
+ line-height: 1.4;
110
+ }
111
+
112
+ pre,
113
+ code,
114
+ kbd,
115
+ samp {
116
+ font-family: monospace;
117
+ font-size: 1em;
118
+ }
119
+
120
+ a {
121
+ color: inherit;
122
+ text-decoration: none;
123
+ }
124
+
125
+ ol,
126
+ ul {
127
+ list-style: none;
128
+ padding: 0;
129
+ }
130
+
131
+ th {
132
+ font-size: 1rem;
133
+ font-weight: 600;
134
+ }
135
+
136
+ hr {
137
+ border-top: 1px solid #bfc2c7;
138
+ height: 0;
139
+ margin: 1em 0;
140
+ }
141
+
142
+ details {
143
+ display: block;
144
+ }
145
+
146
+ summary {
147
+ display: list-item;
148
+ }`;function n(e,n){let i=[];n.buildOptions.reset&&i.push(t);let a=r(e);return a&&i.push(a),i.join(`
149
+
150
+ `)}function r(t){let n=e(),r=[],i=new Map,a=new Set,o=Array.from(t).sort();for(let e of o){if(a.has(e))continue;let t=s(e,n);if(t){if(t.mediaQuery){let e=i.get(t.mediaQuery)||[];e.push(t.rule),i.set(t.mediaQuery,e)}else r.push(t.rule);a.add(e)}}let c=Array.from(i.entries()).sort(([e],[t])=>e.localeCompare(t));for(let[e,t]of c)r.push(`${e} {\n${t.join(`
151
+ `)}\n}`);return r.join(`
152
+ `)}function i(e,t){let{properties:n,variants:r}=t;if(r?.mediaQueries){for(let i of r.mediaQueries)if(e.startsWith(`${i.prefix}:`)){let r=a(e.slice(i.prefix.length+1),t);if(r){let t=n.map(e=>`${e}: ${r.propertyValue};`).join(`
153
+ `);return{rule:`.${o(e)} {\n ${t}\n }`,mediaQuery:i.value}}}}if(r?.pseudoClasses){for(let i of r.pseudoClasses)if(e.startsWith(`${i.prefix}:`)){let r=a(e.slice(i.prefix.length+1),t);if(r){let t=n.map(e=>`${e}: ${r.propertyValue};`).join(`
154
+ `);return{rule:`.${o(e)}${i.value} {\n${t}\n}`}}}}if(r?.opacity){for(let i of r.opacity)if(e.endsWith(`/${i.prefix}`)){let r=a(e.slice(0,-(i.prefix.length+1)),t);if(r){let t=r.propertyValue.startsWith(`#`)&&r.propertyValue.length===7?`${r.propertyValue}${i.value}`:r.propertyValue,a=n.map(e=>`${e}: ${t};`).join(`
155
+ `);return{rule:`.${o(e)} {\n${a}\n}`}}}}let i=a(e,t);if(i){let t=n.map(e=>`${e}: ${i.propertyValue};`).join(`
156
+ `);return{rule:`.${o(e)} {\n${t}\n}`}}return null}function a(e,t){let{prefix:n,values:r}=t;if(!e.startsWith(`${n}-`))return null;let i=r[e.slice(n.length+1)];return i?{propertyValue:i}:null}function o(e){return e.replace(/:/g,`\\:`).replace(/\//g,`\\/`)}function s(e,t){for(let[n,r]of Object.entries(t)){let t=i(e,r);if(t)return t}return null}function c(e){let t=new Set,n=[/class(?:Name)?=["']([^"']+)["']/g,/class(?:Name)?=\{["']([^"']+)["']\}/g,/class(?:Name)?=\{`([^`]+)`\}/g],r=[/`[^`]*\b([a-z]+-[a-z0-9-]+)\b[^`]*`/g,/"[^"]*\b([a-z]+-[a-z0-9-]+)\b[^"]*"/g,/'[^']*\b([a-z]+-[a-z0-9-]+)\b[^']*'/g],i=[/cva\s*\(\s*["'`]([^"'`]+)["'`]/g,/:\s*["'`]([^"'`]*\b[a-z]+-[a-z0-9-]+[^"'`]*)["'`]/g],a=[/\bcn\s*\(\s*["'`]([^"'`]+)["'`]/g,/\bcn\s*\(\s*\{\s*["'`]([^"'`]+)["'`]\s*:/g],o=[/clsx\s*\(\s*["'`]([^"'`]+)["'`]/g,/classnames\s*\(\s*["'`]([^"'`]+)["'`]/g,/clsx\s*\(\s*\{\s*["'`]([^"'`]+)["'`]\s*:/g,/classnames\s*\(\s*\{\s*["'`]([^"'`]+)["'`]\s*:/g],s=[...n,...r,...i,...a,...o];for(let n of s){let r;for(r=n.exec(e);r!==null;){let i=r[1];i&&i.split(/\s+/).filter(e=>e&&/^[a-z]/.test(e)&&e.includes(`-`)).forEach(e=>{t.add(e)}),r=n.exec(e)}}return Array.from(t)}export{t as baseStyles,n as generator,c as tokenizer};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yummacss/nitro",
3
- "version": "0.1.0",
3
+ "version": "0.2.1",
4
4
  "description": "The engine behind Yumma CSS.",
5
5
  "keywords": [
6
6
  "css-framework",
@@ -15,7 +15,8 @@
15
15
  ],
16
16
  "type": "module",
17
17
  "exports": {
18
- ".": "./dist/index.js"
18
+ ".": "./dist/index.js",
19
+ "./browser": "./dist/browser.js"
19
20
  },
20
21
  "repository": {
21
22
  "type": "git",
@@ -33,7 +34,8 @@
33
34
  "typescript": "^5.9.2"
34
35
  },
35
36
  "publishConfig": {
36
- "access": "public"
37
+ "access": "public",
38
+ "provenance": false
37
39
  },
38
40
  "scripts": {
39
41
  "build": "tsdown",
package/dist/index.d.ts DELETED
@@ -1,24 +0,0 @@
1
- import { z } from "zod";
2
-
3
- //#region src/config/schema.d.ts
4
- declare const configName = "yumma.config.mjs";
5
- declare const ConfigSchema: z.ZodObject<{
6
- source: z.ZodDefault<z.ZodArray<z.ZodString>>;
7
- output: z.ZodDefault<z.ZodString>;
8
- buildOptions: z.ZodDefault<z.ZodObject<{
9
- reset: z.ZodDefault<z.ZodBoolean>;
10
- minify: z.ZodDefault<z.ZodBoolean>;
11
- }, z.core.$strip>>;
12
- }, z.core.$strip>;
13
- type Config = z.infer<typeof ConfigSchema>;
14
- //#endregion
15
- //#region src/extractor.d.ts
16
- declare function extractor(patterns: string[]): Promise<Set<string>>;
17
- //#endregion
18
- //#region src/generator.d.ts
19
- declare function generator(usedClasses: Set<string>, config: Config): string;
20
- //#endregion
21
- //#region src/reset/base.d.ts
22
- declare const baseCSS = "*,\n*::before,\n*::after {\n box-sizing: border-box;\n border: 0 solid;\n}\n\n* {\n margin: 0;\n padding: 0;\n}\n\nhtml {\n font-family: system-ui, sans-serif;\n}\n\nbody {\n -webkit-font-smoothing: antialiased;\n font-family: inherit;\n line-height: 1.5;\n}\n\ncanvas,\nimg,\npicture,\nsvg,\nvideo {\n display: block;\n max-width: 100%;\n}\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n background-color: transparent;\n font-family: inherit;\n padding: .5rem;\n}\n\nbutton:not([class]),\ninput:not([class]),\noptgroup:not([class]),\nselect:not([class]),\ntextarea:not([class]) {\n border: 1px solid #bfc2c7;\n}\n\na,\nbutton,\ninput,\nselect,\nsummary,\ntextarea {\n &:focus {\n outline: 2px solid transparent;\n }\n}\n\ntextarea:not([rows]) {\n min-height: 10em;\n}\n\nbutton {\n cursor: pointer;\n}\n\nbutton:disabled,\ninput:disabled,\nselect:disabled,\ntextarea:disabled {\n cursor: not-allowed;\n opacity: .5;\n}\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\np {\n overflow-wrap: break-word;\n}\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n font-size: 1rem;\n font-weight: 600;\n text-wrap: balance;\n}\n\np {\n text-wrap: pretty;\n}\n\nb,\nstrong {\n font-weight: 700;\n}\n\nsmall {\n font-size: 80%;\n line-height: 1.4;\n}\n\npre,\ncode,\nkbd,\nsamp {\n font-family: monospace;\n font-size: 1em;\n}\n\na {\n color: inherit;\n text-decoration: none;\n}\n\nol,\nul {\n list-style: none;\n padding: 0;\n}\n\nth {\n font-size: 1rem;\n font-weight: 600;\n}\n\nhr {\n border-top: 1px solid #bfc2c7;\n height: 0;\n margin: 1em 0;\n}\n\ndetails {\n display: block;\n}\n\nsummary {\n display: list-item;\n}";
23
- //#endregion
24
- export { type Config, ConfigSchema, baseCSS, configName, extractor, generator };