yummacss 3.4.3 → 3.6.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/README.md CHANGED
@@ -1,38 +1,29 @@
1
- # [@yummacss](https://www.npmjs.com/package/yummacss)
1
+ # [@yummacss](www.yummacss.com)
2
2
 
3
- A CSS framework for the web with abbreviated styles.
3
+ A CLI-first CSS framework for the web with abbreviated styles.
4
4
 
5
5
  [![NPM Version](https://img.shields.io/npm/v/yummacss?style=plastic&label=yummacss&labelColor=eaedfc&color=413cb8)](https://www.npmjs.com/package/yummacss)
6
6
  [![NPM Downloads](https://img.shields.io/npm/d18m/yummacss?style=plastic&label=downloads&labelColor=eaedfc&color=413cb8)](https://www.npmjs.com/package/yummacss)
7
7
 
8
- ## Getting started
8
+ ## Installing
9
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.
10
+ Install `yummacss` as a dev dependency and initialize configuration
11
11
 
12
- ### Using the CLI
13
-
14
- Install `yummacss` as a dev dependency
15
-
16
- ```
17
- npm i yummacss -D
12
+ ```bash
13
+ npm install yummacss -D
14
+ npx yummacss init
18
15
  ```
19
16
 
20
- Initialize configuration
17
+ Build styles
21
18
 
22
- ```
23
- npx yummacss init
19
+ ```bash
20
+ npx yummacss build
24
21
  ```
25
22
 
26
23
  ## Documentation
27
24
 
28
- Head over to the [Yumma CSS docs](https://www.yummacss.com) to learn more.
29
-
30
- ## Built with
31
-
32
- - [@yummacss/api](https://www.npmjs.com/package/@yummacss/api)
33
- - [lightningcss](https://www.npmjs.com/package/lightningcss)
34
- - [typescript](https://www.npmjs.com/package/typescript)
25
+ Learn more at [yummacss.com](https://yummacss.com)
35
26
 
36
27
  ## License
37
28
 
38
- This project is licensed under the [MIT License](LICENSE)
29
+ This project is licensed under the [MIT License](LICENSE).
package/dist/index.mjs ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import{Command as e}from"commander";import{existsSync as t,writeFileSync as n}from"node:fs";import{ConfigSchema as r,configName as i,extractor as a,generator as o}from"@yummacss/nitro";import{join as s}from"node:path";import{pathToFileURL as c}from"node:url";import l from"ora";import{transform as u}from"lightningcss";import d from"stringify-object";import f from"chokidar";import{globby as p}from"globby";var m=`3.6.0`;let h={};function g(){return h}function _(e){h=e}function v(e){let t=JSON.stringify(e);return h.configHash!==t}async function y(e){return{css:o(await a(e.source),e),dependencies:e.source}}const b={build:{start:`Building...`,success:(e,t)=>`Build done in ${e}ms. (${t})`,fail:`Build failed.`},init:{fail:`Config failed.`,invalid:`Invalid config.`,notFound:`Config not found.`,success:`Config created.`},watch:{start:`Watching...`,fail:`Watch failed.`},common:{unknownError:`Something went wrong, and we don't know what.`}},x={fail:e=>l().fail(e),info:e=>l().info(e),progress:e=>l({spinner:`sand`,color:`white`}).start(e),success:e=>l().succeed(e),warn:e=>l().warn(e)};async function S(){let e=c(s(process.cwd(),i)).href;try{let{default:t}=await import(e);return r.parse(t)}catch{t(i)||(x.progress(b.init.notFound).warn(b.init.notFound),process.exit(1)),x.progress(b.init.invalid).fail(b.init.invalid),process.exit(1)}}function C(e,t){return u({code:Buffer.from(e),filename:`style.css`,minify:t.buildOptions.minify,sourceMap:!1}).code.toString()}async function w(e,t=!1){let r=x.progress(b.build.start),i=Date.now();try{let a=e||await S(),o=g(),s=v(a),c;if(t||s||!o.css){let e=await y(a);c=e.css,_({configHash:JSON.stringify(a),css:e.css,dependencies:e.dependencies})}else c=o.css;let l=C(c,a);n(a.output,l),r.succeed(b.build.success(Date.now()-i,a.output))}catch(e){r.fail(`${b.build.fail} ${e instanceof Error?e.message:String(e)}`),process.exit(1)}}function T(){return{filename:i,content:`export default ${d(r.parse({}),{indent:` `,singleQuotes:!1})};`}}function E(){let e=x.progress(`Initializing config...`);try{let{filename:t,content:r}=T();n(t,r),e.succeed(b.init.success)}catch{e.fail(b.init.fail),process.exit(1)}}let D,O=null;const k=new Set;function A(e,t){k.add(e),O&&clearTimeout(O),O=setTimeout(async()=>{k.size>0&&(await w(D,!0),k.clear()),O=null},500)}async function j(){try{D=await S(),await w(D,!0),x.info(b.watch.start);let e=await p(D.source);f.watch(e,{awaitWriteFinish:{pollInterval:50,stabilityThreshold:200},ignored:/(^|[/\\])\../,ignoreInitial:!0,persistent:!0}).on(`add`,e=>A(e,`added`)).on(`change`,e=>A(e,`changed`)).on(`unlink`,e=>A(e,`removed`))}catch{x.fail(b.watch.fail),process.exit(1)}}const M=new e;M.name(`yummacss`).description(`Yumma CSS main command`).version(m),M.command(`init`).action(E).alias(`i`).description(`Initialize config`),M.command(`build`).action(()=>w().catch(()=>process.exit(1))).alias(`b`).description(`Build styles once`),M.command(`watch`).action(()=>j().catch(()=>process.exit(1))).alias(`w`).description(`Build styles continuously`),M.parse(process.argv);export{};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "yummacss",
3
- "version": "3.4.3",
4
- "description": "A CSS framework for the web with abbreviated styles.",
3
+ "version": "3.6.0",
4
+ "description": "A CLI-first CSS framework for the web with abbreviated styles.",
5
5
  "keywords": [
6
6
  "css-framework",
7
7
  "typescript",
@@ -25,22 +25,20 @@
25
25
  "url": "git+https://github.com/yumma-lib/yumma-css.git"
26
26
  },
27
27
  "dependencies": {
28
- "@yummacss/api": "^1.6.2",
29
- "chokidar": "^4.0.3",
30
- "commander": "^14.0.0",
31
- "globby": "^14.1.0",
32
- "lightningcss": "^1.30.1",
33
- "ora": "^8.2.0",
34
- "stringify-object": "^6.0.0",
35
- "zod": "^4.0.17"
28
+ "@yummacss/nitro": "^0.3.0",
29
+ "chokidar": "^5.0.0",
30
+ "commander": "^14.0.2",
31
+ "globby": "^16.1.0",
32
+ "lightningcss": "^1.30.2",
33
+ "ora": "^9.0.0",
34
+ "stringify-object": "^6.0.0"
36
35
  },
37
36
  "devDependencies": {
38
- "@types/node": "^24.2.0",
37
+ "@biomejs/biome": "2.3.10",
38
+ "@types/node": "^25.0.3",
39
39
  "@types/stringify-object": "^4.0.5",
40
- "prettier": "^3.6.2",
41
- "prettier-plugin-organize-imports": "^4.2.0",
42
- "tsdown": "^0.15.0",
43
- "typescript": "^5.9.2"
40
+ "tsdown": "^0.18.3",
41
+ "typescript": "^5.9.3"
44
42
  },
45
43
  "publishConfig": {
46
44
  "access": "public",
@@ -49,7 +47,6 @@
49
47
  "scripts": {
50
48
  "build": "tsdown",
51
49
  "dev": "tsdown --watch",
52
- "format:cli": "prettier --write cli",
53
- "format": "prettier --write ."
50
+ "lint": "biome check --write"
54
51
  }
55
52
  }
package/dist/index.js DELETED
@@ -1,156 +0,0 @@
1
- #!/usr/bin/env node
2
- import{Command as e}from"commander";import{existsSync as t,readFileSync as n,writeFileSync as r}from"fs";import{globby as i}from"globby";import{coreUtils as a}from"@yummacss/api";import{z as o}from"zod";import s from"ora";import{join as c}from"path";import{pathToFileURL as l}from"url";import{transform as u}from"lightningcss";import d from"stringify-object";import f from"chokidar";let p={};function m(){return p}function h(e){p=e}function g(e){let t=JSON.stringify(e);return p.configHash!==t}async function _(e){let t=await i(e),r=new Set;for(let e of t)try{let t=n(e,`utf-8`);v(t).forEach(e=>r.add(e))}catch{continue}return r}function v(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))!==null;){let e=r[1];e&&e.split(/\s+/).filter(e=>e&&/^[a-z]/.test(e)&&e.includes(`-`)).forEach(e=>t.add(e))}}return Array.from(t)}function y(e,t){let n=[];t.buildOptions.reset&&n.push(`*,
3
- *::before,
4
- *::after {
5
- box-sizing: border-box;
6
- border: 0 solid;
7
- }
8
-
9
- * {
10
- margin: 0;
11
- padding: 0;
12
- }
13
-
14
- html {
15
- font-family: system-ui, sans-serif;
16
- }
17
-
18
- body {
19
- -webkit-font-smoothing: antialiased;
20
- font-family: inherit;
21
- line-height: 1.5;
22
- }
23
-
24
- canvas,
25
- img,
26
- picture,
27
- svg,
28
- video {
29
- display: block;
30
- max-width: 100%;
31
- }
32
-
33
- button,
34
- input,
35
- optgroup,
36
- select,
37
- textarea {
38
- background-color: transparent;
39
- font-family: inherit;
40
- padding: .5rem;
41
- }
42
-
43
- button:not([class]),
44
- input:not([class]),
45
- optgroup:not([class]),
46
- select:not([class]),
47
- textarea:not([class]) {
48
- border: 1px solid #bfc2c7;
49
- }
50
-
51
- a,
52
- button,
53
- input,
54
- select,
55
- summary,
56
- textarea {
57
- &:focus {
58
- outline: 2px solid transparent;
59
- }
60
- }
61
-
62
- textarea:not([rows]) {
63
- min-height: 10em;
64
- }
65
-
66
- button {
67
- cursor: pointer;
68
- }
69
-
70
- button:disabled,
71
- input:disabled,
72
- select:disabled,
73
- textarea:disabled {
74
- cursor: not-allowed;
75
- opacity: .5;
76
- }
77
-
78
- h1,
79
- h2,
80
- h3,
81
- h4,
82
- h5,
83
- h6,
84
- p {
85
- overflow-wrap: break-word;
86
- }
87
-
88
- h1,
89
- h2,
90
- h3,
91
- h4,
92
- h5,
93
- h6 {
94
- font-size: 1rem;
95
- font-weight: 600;
96
- text-wrap: balance;
97
- }
98
-
99
- p {
100
- text-wrap: pretty;
101
- }
102
-
103
- b,
104
- strong {
105
- font-weight: 700;
106
- }
107
-
108
- small {
109
- font-size: 80%;
110
- line-height: 1.4;
111
- }
112
-
113
- pre,
114
- code,
115
- kbd,
116
- samp {
117
- font-family: monospace;
118
- font-size: 1em;
119
- }
120
-
121
- a {
122
- color: inherit;
123
- text-decoration: none;
124
- }
125
-
126
- ol,
127
- ul {
128
- list-style: none;
129
- padding: 0;
130
- }
131
-
132
- th {
133
- font-size: 1rem;
134
- font-weight: 600;
135
- }
136
-
137
- hr {
138
- border-top: 1px solid #bfc2c7;
139
- height: 0;
140
- margin: 1em 0;
141
- }
142
-
143
- details {
144
- display: block;
145
- }
146
-
147
- summary {
148
- display: list-item;
149
- }`);let r=b(e);return r&&n.push(r),n.join(`
150
-
151
- `)}function b(e){let t=a(),n=[],r=new Map,i=new Set,o=Array.from(e).sort();for(let e of o){if(i.has(e))continue;let a=w(e,t);if(a){if(a.mediaQuery){let e=r.get(a.mediaQuery)||[];e.push(a.rule),r.set(a.mediaQuery,e)}else n.push(a.rule);i.add(e)}}let s=Array.from(r.entries()).sort(([e],[t])=>e.localeCompare(t));for(let[e,t]of s)n.push(`${e} {\n${t.join(`
152
- `)}\n}`);return n.join(`
153
- `)}function x(e,t){let{properties:n,variants:r}=t;if(r?.mediaQueries){for(let i of r.mediaQueries)if(e.startsWith(`${i.prefix}:`)){let r=e.slice(i.prefix.length+1),a=S(r,t);if(a){let t=n.map(e=>`${e}: ${a.cssValue};`).join(`
154
- `);return{rule:`.${C(e)} {\n ${t}\n }`,mediaQuery:i.value}}}}if(r?.pseudoClasses){for(let i of r.pseudoClasses)if(e.startsWith(`${i.prefix}:`)){let r=e.slice(i.prefix.length+1),a=S(r,t);if(a){let t=n.map(e=>`${e}: ${a.cssValue};`).join(`
155
- `);return{rule:`.${C(e)}${i.value} {\n${t}\n}`}}}}let i=S(e,t);if(i){let t=n.map(e=>`${e}: ${i.cssValue};`).join(`
156
- `);return{rule:`.${C(e)} {\n${t}\n}`}}return null}function S(e,t){let{prefix:n,values:r}=t;if(!e.startsWith(n+`-`))return null;let i=e.slice(n.length+1),a=r[i];return a?{cssValue:a}:null}function C(e){return e.replace(/:/g,`\\:`).replace(/\//g,`\\/`)}function w(e,t){for(let[n,r]of Object.entries(t)){let t=x(e,r);if(t)return t}return null}async function T(e){let t=await _(e.source);return{css:y(t,e),dependencies:e.source}}const E=`yumma.config.mjs`,D=o.object({source:o.array(o.string()).default([``]),output:o.string().default(``),buildOptions:o.object({reset:o.boolean().default(!0),minify:o.boolean().default(!1)}).default({reset:!0,minify:!1})}),O={build:{start:`Building...`,success:(e,t)=>`Build done in ${e}ms. (${t})`,fail:`Build failed.`},init:{fail:`Config failed.`,invalid:`Invalid config.`,notFound:`Config not found.`,success:`Config created.`},watch:{start:`Watching...`,fail:`Watch failed.`},common:{unknownError:`Something went wrong, and we don't know what.`}},k={error:e=>s().fail(e),info:e=>s().info(e),progress:e=>s({spinner:`sand`,color:`white`}).start(e),success:e=>s().succeed(e),warn:e=>s().warn(e)};async function A(){let e=c(process.cwd(),E),n=l(e).href;try{let{default:e}=await import(n);return D.parse(e)}catch(e){throw t(E)?e instanceof o.ZodError&&(k.progress(O.init.invalid).fail(O.init.invalid),process.exit(1)):(k.progress(O.init.notFound).warn(O.init.notFound),process.exit(1)),e}}function j(e,t){return u({filename:`style.css`,code:Buffer.from(e),minify:t.buildOptions.minify,sourceMap:!1}).code.toString()}async function M(e,t=!1){let n=k.progress(O.build.start),i=Date.now();try{let a=e||await A(),o=m(),s=g(a),c;if(t||s||!o.css){let e=await T(a);c=e.css,h({configHash:JSON.stringify(a),css:e.css,dependencies:e.dependencies})}else c=o.css;let l=j(c,a);r(a.output,l),n.succeed(O.build.success(Date.now()-i,a.output))}catch{n.fail(O.build.fail),process.exit(1)}}function N(){let e=D.parse({});return{filename:E,content:`export default ${d(e,{indent:` `,singleQuotes:!1})};`}}function P(){let e=k.progress(`Initializing config...`);try{let{filename:t,content:n}=N();r(t,n),e.succeed(O.init.success)}catch{e.fail(O.init.fail),process.exit(1)}}let F,I=null,L=new Set;function R(e,t){L.add(e),I&&clearTimeout(I),I=setTimeout(async()=>{L.size>0&&(await M(F,!0),L.clear()),I=null},500)}async function z(){try{F=await A(),await M(F,!0),k.info(O.watch.start);let e=await i(F.source);f.watch(e,{awaitWriteFinish:{pollInterval:50,stabilityThreshold:200},ignored:/(^|[/\\])\../,ignoreInitial:!0,persistent:!0}).on(`add`,e=>R(e,`added`)).on(`change`,e=>R(e,`changed`)).on(`unlink`,e=>R(e,`removed`))}catch{k.error(O.watch.fail),process.exit(1)}}const B=new e;B.name(`yummacss`).description(`Main command`),B.command(`init`).action(P).alias(`i`).description(`Initialize config`),B.command(`build`).action(()=>M().catch(()=>process.exit(1))).alias(`b`).description(`Build styles once`),B.command(`watch`).action(()=>z().catch(()=>process.exit(1))).alias(`w`).description(`Build styles continuously`),B.parse(process.argv);export{};