@yummacss/nitro 0.1.0
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 +20 -0
- package/README.md +38 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +156 -0
- package/package.json +43 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Copyright (c) 2025-present Yumma CSS Nitro maintained by Renildo Pereira.
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
|
+
a copy of this software and associated documentation files (the
|
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
+
the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be
|
|
12
|
+
included in all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# [@yummacss/nitro](https://www.npmjs.com/package/@yummacss/nitro)
|
|
2
|
+
|
|
3
|
+
The engine behind Yumma CSS.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@yummacss/nitro)
|
|
6
|
+
[](https://www.npmjs.com/package/@yummacss/nitro)
|
|
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
|
+
## Documentation
|
|
27
|
+
|
|
28
|
+
Learn more at [yummacss.com](https://yummacss.com)
|
|
29
|
+
|
|
30
|
+
## Built with
|
|
31
|
+
|
|
32
|
+
- [@yummacss/api](https://www.npmjs.com/package/@yummacss/api)
|
|
33
|
+
- [@biomejs](https://www.npmjs.com/package/@biomejs/biome)
|
|
34
|
+
- [typescript](https://www.npmjs.com/package/typescript)
|
|
35
|
+
|
|
36
|
+
## License
|
|
37
|
+
|
|
38
|
+
This project is licensed under the [MIT License](LICENSE)
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
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 };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
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};
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@yummacss/nitro",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "The engine behind Yumma CSS.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"css-framework",
|
|
7
|
+
"typescript",
|
|
8
|
+
"yummacss"
|
|
9
|
+
],
|
|
10
|
+
"homepage": "https://yummacss.com",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"author": "Renildo Pereira",
|
|
13
|
+
"files": [
|
|
14
|
+
"dist"
|
|
15
|
+
],
|
|
16
|
+
"type": "module",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": "./dist/index.js"
|
|
19
|
+
},
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/yumma-lib/yumma-css-nitro.git"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@yummacss/api": "^1.7.2",
|
|
26
|
+
"globby": "^15.0.0",
|
|
27
|
+
"zod": "^4.0.17"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@biomejs/biome": "2.2.5",
|
|
31
|
+
"@types/node": "^24.2.0",
|
|
32
|
+
"tsdown": "^0.15.0",
|
|
33
|
+
"typescript": "^5.9.2"
|
|
34
|
+
},
|
|
35
|
+
"publishConfig": {
|
|
36
|
+
"access": "public"
|
|
37
|
+
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"build": "tsdown",
|
|
40
|
+
"dev": "tsdown --watch",
|
|
41
|
+
"lint": "biome check --write"
|
|
42
|
+
}
|
|
43
|
+
}
|